Commit af827991 authored by Simonas's avatar Simonas

release 1.11.1

parent 7031e612
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Loco Translate 2.3.0\n"
"Project-Id-Version: Loco Translate 2.3.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-31 14:05+0000\n"
"POT-Creation-Date: 2019-10-18 10:23+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: \n"
......@@ -13,7 +13,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.3.0; wp-5.2.1"
"X-Loco-Version: 2.3.1; wp-5.2.4"
#: src/fs/FileWriter.php:214
#, php-format
......@@ -129,7 +129,7 @@ msgstr ""
msgid "Additional files found"
msgstr ""
#: src/hooks/AdminHooks.php:69
#: src/hooks/AdminHooks.php:67
#, php-format
msgid ""
"Administrators and auditors may wish to review Loco's <a href=\"%s\">plugin "
......@@ -553,6 +553,10 @@ msgid ""
"it"
msgstr ""
#: tpl/admin/config/settings.php:92
msgid "Enable Ajax file uploads"
msgstr ""
#: src/js/Strings.php:67 src/error/Exception.php:149
msgid "Error"
msgstr ""
......@@ -946,7 +950,7 @@ msgid ""
msgstr ""
#. Name of the plugin
#: src/mvc/AdminRouter.php:37 src/hooks/AdminHooks.php:67
#: src/mvc/AdminRouter.php:37 src/hooks/AdminHooks.php:65
msgid "Loco Translate"
msgstr ""
......@@ -1296,6 +1300,10 @@ msgstr ""
msgid "Recently updated:"
msgstr ""
#: tpl/admin/config/settings.php:92
msgid "Recommended"
msgstr ""
#: src/fs/FileWriter.php:150
msgid "Refusing to copy over an existing file"
msgstr ""
......@@ -1622,7 +1630,7 @@ msgstr ""
msgid "This page was expecting a file, but the path is actually a directory"
msgstr ""
#: src/hooks/AdminHooks.php:68
#: src/hooks/AdminHooks.php:66
msgid "This plugin doesn't collect any data from public website visitors."
msgstr ""
......@@ -1652,7 +1660,7 @@ msgid ""
"the file writeable by %s"
msgstr ""
#: src/hooks/AdminHooks.php:102
#: src/hooks/AdminHooks.php:100
msgid "Translate"
msgstr ""
......
......@@ -4,7 +4,7 @@ Plugin Name: Loco Translate
Plugin URI: https://wordpress.org/plugins/loco-translate/
Description: Translate themes and plugins directly in WordPress
Author: Tim Whitlock
Version: 2.3.0
Version: 2.3.1
Author URI: https://localise.biz/wordpress/plugin
Text Domain: loco-translate
Domain Path: /languages/
......@@ -36,7 +36,7 @@ function loco_plugin_file(){
* @return string
*/
function loco_plugin_version(){
return '2.3.0';
return '2.3.1';
}
......
form#loco-conf>div{overflow:visible;border-bottom:solid 1px #ccc;padding-top:2em}form#loco-conf>div h2{margin-top:0}form#loco-conf td.twin>div{float:left;clear:none;width:50%}form#loco-conf td .description:first-child{margin-top:0;margin-bottom:4px}form#loco-conf a.icon-del{display:block;float:right;z-index:99;color:#aaa;outline:none}form#loco-conf a.icon-del:hover{color:#cc0000}form#loco-conf>div:first-child a.icon-del{display:none}form#loco-conf p.description{color:#aaa;font-size:12px;text-indent:0.25em}form#loco-conf tr:hover p.description{color:#666}form#loco-reset{position:absolute;bottom:0;right:0}
form#loco-conf>div{overflow:visible;border-bottom:solid 1px #ccc;padding-top:2em}form#loco-conf>div h2{margin-top:0}form#loco-conf td.twin>div{float:left;clear:none;width:50%}form#loco-conf td .description:first-child{margin-top:0;margin-bottom:4px}form#loco-conf a.icon-del{display:block;float:right;z-index:99;color:#aaa;outline:none}form#loco-conf a.icon-del:hover{color:#c00}form#loco-conf>div:first-child a.icon-del{display:none}form#loco-conf p.description{color:#aaa;font-size:12px;text-indent:.25em}form#loco-conf tr:hover p.description{color:#666}form#loco-reset{position:absolute;bottom:0;right:0}
\ No newline at end of file
#loco.wrap .notice-info dl{margin-top:0;display:inline-block}#loco.wrap .notice-info dl dt,#loco.wrap .notice-info dl dd{line-height:1.4em}#loco.wrap .notice-info dl dt{font-weight:bold;color:#555}#loco.wrap .notice-info dl dd{margin-left:0;margin-bottom:0.8em}#loco.wrap .notice-info dl div.progress .l{display:none}
#loco.wrap .notice-info dl{margin-top:0;display:inline-block}#loco.wrap .notice-info dl dt,#loco.wrap .notice-info dl dd{line-height:1.4em}#loco.wrap .notice-info dl dt{font-weight:bold;color:#555}#loco.wrap .notice-info dl dd{margin-left:0;margin-bottom:.8em}#loco.wrap .notice-info dl div.progress .l{display:none}
\ No newline at end of file
#loco.wrap .revisions-diff{padding:10px;min-height:20px}#loco.wrap table.diff{border-collapse:collapse}#loco.wrap table.diff td{white-space:nowrap;overflow:hidden;font:normal 12px/17px 'Monaco','Menlo','Ubuntu Mono','Consolas','source-code-pro',monospace;padding:2px}#loco.wrap table.diff td>span{color:#aaa}#loco.wrap table.diff td>span:after{content:". "}#loco.wrap table.diff tbody{border-top:1px dashed #ccc}#loco.wrap table.diff tbody:first-child{border-top:none}#loco.wrap .revisions.loading .diff-meta{color:#eee}#loco.wrap .revisions.loading .loading-indicator span.spinner{visibility:visible;background:#fff url(../img/spin-modal.gif?v=2.3.0) center center no-repeat}#loco.wrap .revisions-meta{clear:both;padding:10px 12px;margin:0;position:relative;top:10px}#loco.wrap .revisions-meta .diff-meta{clear:none;float:left;width:50%;padding:0;min-height:auto}#loco.wrap .revisions-meta .diff-meta button{margin-top:5px}#loco.wrap .revisions-meta .diff-meta-current{float:right;text-align:right}#loco.wrap .revisions-meta time{color:#72777c}#loco.wrap .revisions-control-frame{margin:10px 0}#loco.wrap .revisions-diff-frame{margin-top:20px}
#loco.wrap .revisions-diff{padding:10px;min-height:20px}#loco.wrap table.diff{border-collapse:collapse}#loco.wrap table.diff td{white-space:nowrap;overflow:hidden;font:normal 12px/17px "Monaco","Menlo","Ubuntu Mono","Consolas","source-code-pro",monospace;padding:2px}#loco.wrap table.diff td>span{color:#aaa}#loco.wrap table.diff td>span:after{content:". "}#loco.wrap table.diff tbody{border-top:1px dashed #ccc}#loco.wrap table.diff tbody:first-child{border-top:none}#loco.wrap .revisions.loading .diff-meta{color:#eee}#loco.wrap .revisions.loading .loading-indicator span.spinner{visibility:visible;background:#fff url(../img/spin-modal.gif?v=2.3.1) center center no-repeat}#loco.wrap .revisions-meta{clear:both;padding:10px 12px;margin:0;position:relative;top:10px}#loco.wrap .revisions-meta .diff-meta{clear:none;float:left;width:50%;padding:0;min-height:auto}#loco.wrap .revisions-meta .diff-meta button{margin-top:5px}#loco.wrap .revisions-meta .diff-meta-current{float:right;text-align:right}#loco.wrap .revisions-meta time{color:#72777c}#loco.wrap .revisions-control-frame{margin:10px 0}#loco.wrap .revisions-diff-frame{margin-top:20px}
\ No newline at end of file
form#loco-poinit .loco-locales fieldset{float:left;margin-right:2em}form#loco-poinit .loco-locales fieldset.disabled span.lang{visibility:hidden !important}form#loco-poinit .loco-locales fieldset span.nolang{background:#999}form#loco-poinit .loco-locales fieldset>label span{width:20px;text-align:center;display:inline-block;margin-right:4px}form#loco-poinit a.icon-help{color:#999;font-style:normal;text-decoration:none}form#loco-poinit a.icon-help:hover{color:#666}form#loco-poinit .form-table th{padding:15px 10px}form#loco-poinit .form-table tr:first-child td,form#loco-poinit .form-table tr:first-child th{padding-top:25px}form#loco-poinit label.for-disabled input{visibility:hidden}form#loco-poinit label.for-disabled .icon-lock{top:0;left:0;display:block;position:absolute;width:1em;font-size:14px;text-align:center;color:#808080}
form#loco-poinit .loco-locales fieldset{float:left;margin-right:2em}form#loco-poinit .loco-locales fieldset.disabled span.lang{visibility:hidden !important}form#loco-poinit .loco-locales fieldset span.nolang{background:#999}form#loco-poinit .loco-locales fieldset>label span{width:20px;text-align:center;display:inline-block;margin-right:4px}form#loco-poinit a.icon-help{color:#999;font-style:normal;text-decoration:none}form#loco-poinit a.icon-help:hover{color:#666}form#loco-poinit .form-table th{padding:15px 10px}form#loco-poinit .form-table tr:first-child td,form#loco-poinit .form-table tr:first-child th{padding-top:25px}form#loco-poinit label.for-disabled input{visibility:hidden}form#loco-poinit label.for-disabled .icon-lock{top:0;left:0;display:block;position:absolute;width:1em;font-size:14px;text-align:center;color:gray}
\ No newline at end of file
.js #loco.wrap .loco-loading{min-height:100px;background:#fff url(../img/spin-modal.gif?v=2.3.0) center center no-repeat}.js #loco.wrap .loco-loading ol.msgcat{display:none}#loco.wrap #loco-po{padding-right:0;overflow:auto}#loco.wrap ol.msgcat{margin-left:3em;padding-top:1em;border-top:1px dashed #ccc}#loco.wrap ol.msgcat:first-child{padding-top:0;border-top:none}#loco.wrap ol.msgcat li{color:#aaa;margin:0;padding:0 0 0 1em;font:normal 12px/17px 'Monaco','Menlo','Ubuntu Mono','Consolas','source-code-pro',monospace;border-left:1px solid #EEE}#loco.wrap ol.msgcat li>*{color:#333;white-space:pre}#loco.wrap ol.msgcat li>.po-comment{color:#3CC200}#loco.wrap ol.msgcat li>.po-refs{color:#0073aa}#loco.wrap ol.msgcat li>.po-refs a{color:inherit;text-decoration:none}#loco.wrap ol.msgcat li>.po-refs a:hover{text-decoration:underline}#loco.wrap ol.msgcat li>.po-flags{color:#77904a}#loco.wrap ol.msgcat li>.po-flags em{font-style:normal}#loco.wrap ol.msgcat li>.po-word{color:#000}#loco.wrap ol.msgcat li>.po-junk{font-style:italic;color:#CCC}#loco.wrap ol.msgcat li>.po-string>span{color:#C931C7}#loco.wrap form.loco-filter{top:0;right:0;position:absolute}#loco.wrap .loco-invalid form.loco-filter input[type="text"]:focus{border-color:#cc0000;-webkit-box-shadow:0 0 2px rgba(153,0,0,0.5);-moz-box-shadow:0 0 2px rgba(153,0,0,0.5);box-shadow:0 0 2px rgba(153,0,0,0.5)}#loco.wrap .loco-invalid ol.msgcat{list-style-type:none}#loco.wrap .loco-invalid ol.msgcat li{color:#000}.loco-modal{min-width:90% !important;min-height:100px}#loco-po-ref ol li{color:#aaa;margin:0;white-space:pre;padding:0 0 0 1em;font:normal 12px/17px Consolas,Monaco,monospace;background:transparent;border-left:1px solid #EEE}#loco-po-ref ol li code{margin:0;padding:0;display:inline;background:inherit}#loco-po-ref ol li.highlighted{color:#666;background-color:#f8eec7}#loco-po-ref ol li.highlighted code.T_CONSTANT_ENCAPSED_STRING{color:#C931C7}
.js #loco.wrap .loco-loading{min-height:100px;background:#fff url(../img/spin-modal.gif?v=2.3.1) center center no-repeat}.js #loco.wrap .loco-loading ol.msgcat{display:none}#loco.wrap #loco-po{padding-right:0;overflow:auto}#loco.wrap ol.msgcat{margin-left:3em;padding-top:1em;border-top:1px dashed #ccc}#loco.wrap ol.msgcat:first-child{padding-top:0;border-top:none}#loco.wrap ol.msgcat li{color:#aaa;margin:0;padding:0 0 0 1em;font:normal 12px/17px "Monaco","Menlo","Ubuntu Mono","Consolas","source-code-pro",monospace;border-left:1px solid #eee}#loco.wrap ol.msgcat li>*{color:#333;white-space:pre}#loco.wrap ol.msgcat li>.po-comment{color:#3cc200}#loco.wrap ol.msgcat li>.po-refs{color:#0073aa}#loco.wrap ol.msgcat li>.po-refs a{color:inherit;text-decoration:none}#loco.wrap ol.msgcat li>.po-refs a:hover{text-decoration:underline}#loco.wrap ol.msgcat li>.po-flags{color:#77904a}#loco.wrap ol.msgcat li>.po-flags em{font-style:normal}#loco.wrap ol.msgcat li>.po-word{color:#000}#loco.wrap ol.msgcat li>.po-junk{font-style:italic;color:#ccc}#loco.wrap ol.msgcat li>.po-string>span{color:#c931c7}#loco.wrap form.loco-filter{top:0;right:0;position:absolute}#loco.wrap .loco-invalid form.loco-filter input[type=text]:focus{border-color:#c00;-webkit-box-shadow:0 0 2px rgba(153,0,0,.5);-moz-box-shadow:0 0 2px rgba(153,0,0,.5);box-shadow:0 0 2px rgba(153,0,0,.5)}#loco.wrap .loco-invalid ol.msgcat{list-style-type:none}#loco.wrap .loco-invalid ol.msgcat li{color:#000}.loco-modal{min-width:90% !important;min-height:100px}#loco-po-ref ol li{color:#aaa;margin:0;white-space:pre;padding:0 0 0 1em;font:normal 12px/17px Consolas,Monaco,monospace;background:transparent;border-left:1px solid #eee}#loco-po-ref ol li code{margin:0;padding:0;display:inline;background:inherit}#loco-po-ref ol li.highlighted{color:#666;background-color:#f8eec7}#loco-po-ref ol li.highlighted code.T_CONSTANT_ENCAPSED_STRING{color:#c931c7}
\ No newline at end of file
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(9,100,132,0.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#096484}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);-moz-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/blue/spin-primary-button.gif?v=2.3.0) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(9,100,132,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#096484}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/blue/spin-primary-button.gif?v=2.3.1) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(199,165,137,0.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#c7a589}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);-moz-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/coffee/spin-primary-button.gif?v=2.3.0) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(199,165,137,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#c7a589}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/coffee/spin-primary-button.gif?v=2.3.1) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(163,183,69,0.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#a3b745}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);-moz-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/ectoplasm/spin-primary-button.gif?v=2.3.0) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(163,183,69,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#a3b745}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/ectoplasm/spin-primary-button.gif?v=2.3.1) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(136,136,136,0.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#888}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);-moz-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/light/spin-primary-button.gif?v=2.3.0) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(136,136,136,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#888}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/light/spin-primary-button.gif?v=2.3.1) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(225,77,67,0.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#e14d43}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);-moz-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/midnight/spin-primary-button.gif?v=2.3.0) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(225,77,67,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#e14d43}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/midnight/spin-primary-button.gif?v=2.3.1) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(158,186,160,0.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#9ebaa0}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);-moz-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/ocean/spin-primary-button.gif?v=2.3.0) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(158,186,160,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#9ebaa0}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/ocean/spin-primary-button.gif?v=2.3.1) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(221,130,59,0.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#dd823b}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);-moz-box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8);box-shadow:inset 0 0 0.6em rgba(30,140,190,0.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/sunrise/spin-primary-button.gif?v=2.3.0) 0 0 no-repeat !important}
.wrap #loco-editor .is-table .wg-tr:nth-child(even){background-color:rgba(221,130,59,.05)}.wrap #loco-editor .wg-split-x>nav.wg-tabs>a.active,.wrap #loco-editor .is-table .wg-cols>div>div.selected{background-color:#dd823b}.wrap #loco-editor .is-editable>.wg-content>textarea:focus,.wrap #loco-editor .is-editable>.wg-content.has-focus .ace_scroller,.wrap #loco-editor .is-editable>.wg-content.has-focus .mce-content-body{border-color:#5b9dd9;-webkit-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);-moz-box-shadow:inset 0 0 .6em rgba(30,140,190,.8);box-shadow:inset 0 0 .6em rgba(30,140,190,.8)}form button.loco-loading.button-primary[disabled]:before{background:transparent url(../../img/skins/sunrise/spin-primary-button.gif?v=2.3.1) 0 0 no-repeat !important}
......@@ -92,6 +92,7 @@
<glyph unicode="&#xe902;" glyph-name="min" d="M64 384h384v-384l-138.26 138.26-202-202-107.48 107.48 202 202zM821.74 245.74l202-202-107.48-107.48-202 202-138.26-138.26v384h384zM960 512h-384v384l138.26-138.26 202 202 107.48-107.48-202-202zM309.74 757.74l138.26 138.26v-384h-384l138.26 138.26-202 202 107.48 107.48z" />
<glyph unicode="&#xe903;" glyph-name="sort" d="M0 576h704v-128h-704v128zM0 768h704v-128h-704v128zM0 384h704v-128h-704v128zM0 192h704v-128h-704v128zM768 384l128-192 128 192h-256zM1024 448l-128 192-128-192h256z" />
<glyph unicode="&#xe904;" glyph-name="share" d="M864 256c-45.16 0-85.92-18.738-115.012-48.83l-431.004 215.502c1.314 8.252 2.016 16.706 2.016 25.328s-0.702 17.076-2.016 25.326l431.004 215.502c29.092-30.090 69.852-48.828 115.012-48.828 88.366 0 160 71.634 160 160s-71.634 160-160 160-160-71.634-160-160c0-8.622 0.704-17.076 2.016-25.326l-431.004-215.504c-29.092 30.090-69.852 48.83-115.012 48.83-88.366 0-160-71.636-160-160 0-88.368 71.634-160 160-160 45.16 0 85.92 18.738 115.012 48.828l431.004-215.502c-1.312-8.25-2.016-16.704-2.016-25.326 0-88.368 71.634-160 160-160s160 71.632 160 160c0 88.364-71.634 160-160 160z" />
<glyph unicode="&#xe906;" glyph-name="notag" d="M949.632 482.994l-408.455 410.066c-10.94 10.997-25.826 17.163-41.323 17.163h-384.156c-32.215 0-58.347-26.132-58.347-58.404v-384.128c0-15.497 6.165-30.354 17.108-41.296l409.289-409.316c11.385-11.385 26.327-17.079 41.239-17.079s29.854 5.694 41.239 17.079l383.323 383.351c22.773 22.772 22.8 59.737 0.084 82.564zM810.028 421.731l-264.964-264.964c-11.109-11.108-29.074-11.108-40.156 0l-333.863 333.89v277.349c0 15.691 12.718 28.437 28.382 28.437h277.46l333.168-334.5c11.108-11.109 11.052-29.104-0.027-40.213zM455.198 597.326c0-47.127-38.185-85.34-85.257-85.34-47.1 0-85.257 38.213-85.257 85.34 0 47.129 38.156 85.34 85.257 85.34 47.070 0 85.257-38.212 85.257-85.34z" />
<glyph unicode="&#xf062;" glyph-name="arrow-up" horiz-adv-x="951" d="M30.286 396q0 30.286 21.714 52l372 372q20 21.143 51.429 21.143 30.857 0 52-21.143l372-372q21.143-22.286 21.143-52 0-29.143-21.143-51.429l-42.857-42.857q-21.714-21.714-52-21.714-30.857 0-51.429 21.714l-168 167.429v-402.286q0-29.714-21.429-48.286t-51.714-18.571h-73.143q-30.286 0-51.714 18.571t-21.429 48.286v402.286l-168-167.429q-20.571-21.714-51.429-21.714t-51.429 21.714l-42.857 42.857q-21.714 21.714-21.714 51.429z" />
<glyph unicode="&#xf09d;" glyph-name="ccard" horiz-adv-x="1097" d="M0 91.428v694.857q0 37.714 26.857 64.571t64.571 26.857h914.286q37.714 0 64.571-26.857t26.857-64.571v-694.857q0-37.714-26.857-64.571t-64.571-26.857h-914.286q-37.714 0-64.571 26.857t-26.857 64.571zM73.143 91.428q0-7.429 5.429-12.857t12.857-5.429h914.286q7.429 0 12.857 5.429t5.429 12.857v347.429h-950.857v-347.429zM73.143 658.286h950.857v128q0 7.429-5.429 12.857t-12.857 5.429h-914.286q-7.429 0-12.857-5.429t-5.429-12.857v-128zM146.286 146.286v73.143h146.286v-73.143h-146.286zM365.714 146.286v73.143h219.429v-73.143h-219.429z" />
<glyph unicode="&#xf0f3;" glyph-name="bell" horiz-adv-x="951" d="M0 146.286q108.571 92 164 227.143t55.429 284.857q0 94.286 54.857 149.714t150.857 66.857q-4.571 10.286-4.571 21.143 0 22.857 16 38.857t38.857 16 38.857-16 16-38.857q0-10.857-4.571-21.143 96-11.429 150.857-66.857t54.857-149.714q0-149.714 55.429-284.857t164-227.143q0-29.714-21.714-51.429t-51.429-21.714h-256q0-60.571-42.857-103.429t-103.429-42.857-103.429 42.857-42.857 103.429h-256q-29.714 0-51.429 21.714t-21.714 51.429zM374.857 73.143q0-41.714 29.429-71.143t71.143-29.429q9.143 0 9.143 9.143t-9.143 9.143q-33.714 0-58 24.286t-24.286 58q0 9.143-9.143 9.143t-9.143-9.143z" />
......@@ -102,6 +103,7 @@
<glyph unicode="&#xf1c0;" glyph-name="database" d="M0 73.143v97.143q68-48 185.714-72.571t253.143-24.571 253.143 24.571 185.714 72.571v-97.143q0-39.429-58.857-73.143t-160-53.429-220-19.714-220 19.714-160 53.429-58.857 73.143zM0 292.571v97.143q68-48 185.714-72.571t253.143-24.571 253.143 24.571 185.714 72.571v-97.143q0-39.429-58.857-73.143t-160-53.429-220-19.714-220 19.714-160 53.429-58.857 73.143zM0 512v97.143q68-48 185.714-72.571t253.143-24.571 253.143 24.571 185.714 72.571v-97.143q0-39.429-58.857-73.143t-160-53.429-220-19.714-220 19.714-160 53.429-58.857 73.143zM0 731.428v73.143q0 39.429 58.857 73.143t160 53.429 220 19.714 220-19.714 160-53.429 58.857-73.143v-73.143q0-39.429-58.857-73.143t-160-53.429-220-19.714-220 19.714-160 53.429-58.857 73.143z" />
<glyph unicode="&#xf1da;" glyph-name="restore" d="M0 548.571v256q0 24 22.857 33.714 22.286 9.714 39.429-8l74.286-73.714q61.143 57.714 139.714 89.429t162.571 31.714q89.143 0 170.286-34.857t140-93.714 93.714-140 34.857-170.286-34.857-170.286-93.714-140-140-93.714-170.286-34.857q-98.286 0-186.857 41.429t-150.857 116.857q-4 5.714-3.714 12.857t4.857 11.714l78.286 78.857q5.714 5.143 14.286 5.143 9.143-1.143 13.143-6.857 41.714-54.286 102.286-84t128.571-29.714q59.429 0 113.429 23.143t93.429 62.571 62.571 93.429 23.143 113.429-23.143 113.429-62.571 93.429-93.429 62.571-113.429 23.143q-56 0-107.429-20.286t-91.429-58l78.286-78.857q17.714-17.143 8-39.429-9.714-22.857-33.714-22.857h-256q-14.857 0-25.714 10.857t-10.857 25.714zM292.571 347.428v36.571q0 8 5.143 13.143t13.143 5.143h128v201.143q0 8 5.143 13.143t13.143 5.143h36.571q8 0 13.143-5.143t5.143-13.143v-256q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143z" />
<glyph unicode="&#xf326;" glyph-name="translate" d="M628.217 728.84h-81.381q-24.792 0-48.236-10.509t-37.457-27.217l-48.505 145.516h-154.678l-128.808-377.263h91.082l39.882 107.789h152.522v-215.579h-269.474q-44.194 0-75.992 31.798t-31.798 75.992v377.263q0 44.194 31.798 75.992t75.992 31.798h377.263q44.194 0 75.992-31.798t31.798-75.992v-107.789zM386.23 621.051h-108.867l53.895 157.912zM574.322 674.945h377.263q44.194 0 75.992-31.798t31.798-75.992v-377.263q0-44.194-31.798-75.992t-75.992-31.798h-377.263q-44.194 0-75.992 31.798t-31.798 75.992v377.263q0 44.194 31.798 75.992t75.992 31.798zM965.059 405.472v58.206h-170.846v116.952h-62.518v-116.952h-170.846v-58.206h68.985q4.851-35.571 22.636-73.297t46.349-67.907q-34.493-14.013-70.872-23.714t-53.625-9.701l2.695-14.013q2.695-14.013 5.659-33.415t2.425-31.259q33.415 0 82.998 17.516t93.777 44.463q44.733-26.947 95.394-44.463t84.615-17.516q-0.539 7.545 0.539 18.055t2.695 20.749 3.234 19.133 3.234 14.821l1.078 5.928q-17.785 0-55.512 9.971t-72.758 23.983q27.486 30.181 45.002 67.907t22.366 72.758h73.297zM759.72 301.455q-40.96 37.726-54.434 104.017h112.64q-14.013-66.829-53.895-104.017l-2.156-1.617q-1.617 1.078-2.156 1.617z" />
<glyph unicode="&#x1f40d;" glyph-name="python" horiz-adv-x="896" d="M879.6 559c-15.4 61.8-44.6 108.4-106.8 108.4h-80.2v-94.8c0-73.6-62.4-135.6-133.6-135.6h-213.6c-58.4 0-106.8-50-106.8-108.6v-203.6c0-58 50.4-92 106.8-108.6 67.6-19.8 132.6-23.4 213.6 0 53.8 15.6 106.8 47 106.8 108.6v81.4h-213.4v27.2h320.4c62.2 0 85.2 43.4 106.8 108.4 22.4 67 21.4 131.4 0 217.2zM572.4 152c22.2 0 40.2-18.2 40.2-40.6 0-22.6-18-40.8-40.2-40.8-22 0-40.2 18.4-40.2 40.8 0.2 22.6 18.2 40.6 40.2 40.6zM335.6 463.8h213.6c59.4 0 106.8 49 106.8 108.6v203.8c0 58-48.8 101.4-106.8 111.2-71.6 11.8-149.4 11.2-213.6-0.2-90.4-16-106.8-49.4-106.8-111.2v-81.4h213.8v-27.2h-294c-62.2 0-116.6-37.4-133.6-108.4-19.6-81.4-20.4-132.2 0-217.2 15.2-63.2 51.4-108.4 113.6-108.4h73.4v97.6c0 70.6 61 132.8 133.6 132.8zM322.2 749c-22.2 0-40.2 18.2-40.2 40.6 0.2 22.6 18 40.8 40.2 40.8 22 0 40.2-18.4 40.2-40.8s-18-40.6-40.2-40.6z" />
<glyph unicode="&#x1f426;" glyph-name="twitter" horiz-adv-x="951" d="M925.714 717.714q-38.286-56-92.571-95.429 0.571-8 0.571-24 0-74.286-21.714-148.286t-66-142-105.429-120.286-147.429-83.429-184.571-31.143q-154.857 0-283.429 82.857 20-2.286 44.571-2.286 128.571 0 229.143 78.857-60 1.143-107.429 36.857t-65.143 91.143q18.857-2.857 34.857-2.857 24.571 0 48.571 6.286-64 13.143-106 63.714t-42 117.429v2.286q38.857-21.714 83.429-23.429-37.714 25.143-60 65.714t-22.286 88q0 50.286 25.143 93.143 69.143-85.143 168.286-136.286t212.286-56.857q-4.571 21.714-4.571 42.286 0 76.571 54 130.571t130.571 54q80 0 134.857-58.286 62.286 12 117.143 44.571-21.143-65.714-81.143-101.714 53.143 5.714 106.286 28.571z" />
<glyph unicode="&#x1f50d;" glyph-name="magnify" d="M898.304 180.89l-193.485 193.485c29.184 47.872 45.978 104.192 45.978 164.352 0 174.95-151.603 326.502-326.554 326.502-174.95 0.051-316.723-141.773-316.723-316.723 0-174.899 151.603-326.502 326.502-326.502 58.214 0 112.64 15.821 159.488 43.213l194.509-194.611c19.046-18.995 49.92-18.995 68.915 0l48.282 48.282c18.995 18.995 12.083 43.008-6.912 62.003zM205.005 548.506c0 121.139 98.15 219.29 219.238 219.29 121.139 0 229.069-107.878 229.069-229.069 0-121.088-98.202-219.29-219.29-219.29-121.139 0.051-229.018 107.981-229.018 229.069z" />
<glyph unicode="&#x1f5cc;" glyph-name="ok-empty" d="M397.434 42.304l-397.868 391.6 197.378 194.27 200.49-197.332 429.62 422.852 197.378-194.27-626.998-617.12zM107.912 433.904l289.524-284.962 518.656 510.482-89.036 87.632-429.62-422.852-200.49 197.334-89.034-87.634z" />
......
......@@ -42,7 +42,7 @@
// warn if ajax uploads are enabled but not supported
if( ajaxUpload && ! ( window.FormData && window.Blob ) ){
ajaxUpload = false;
loco.notices.warn("Your browser doesn't support ajax file uploads. Falling back to standard postdata");
loco.notices.warn("Your browser doesn't support Ajax file uploads. Falling back to standard postdata");
}
......@@ -143,9 +143,8 @@
}
// submit PO as concrete file if configured
if( ajaxUpload ){
var fname = String(postData.path).split('/').pop() || 'untitled.po';
postData = initMultiPart(postData);
postData.append('po', new Blob([String(messages)],{type:'application/x-gettext'}), fname );
postData.append('po', new Blob([String(messages)],{type:'application/x-gettext'}), String(postData.path).split('/').pop()||'untitled.po' );
}
else {
postData.data = String(messages);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,8 +3,8 @@ Contributors: timwhitlock
Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, PO, MO, productivity, multilingual, internationalization
Requires at least: 4.1
Requires PHP: 5.2.4
Tested up to: 5.2.1
Stable tag: 2.3.0
Tested up to: 5.2.4
Stable tag: 2.3.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......@@ -97,6 +97,14 @@ We don't collect your data or snoop on you. See the [plugin privacy notice](http
== Changelog ==
= 2.3.1 =
* Default POT getter now looks in "lang" directory
* Not calling deprecated magic quotes functions under PHP 7.4
* Fixed issue with conflicting page hooks
* Ajax file uploads now enabled by default
* Removed legacy option migrations from 1.x branch
* Bumped WP compatibility to 5.2.4
= 2.3.0 =
* Added experimental support for multipart uploads
* Added relocation tab for moving translation sets
......@@ -306,7 +314,7 @@ We don't collect your data or snoop on you. See the [plugin privacy notice](http
== Upgrade Notice ==
= 2.3.0 =
= 2.3.1 =
* Various bug fixes and improvements
......
......@@ -134,13 +134,15 @@ class Loco_admin_config_DebugController extends Loco_admin_config_BaseController
'zlib.output_handler' => ini_get('zlib.output_handler'),
) ) );*/
// alert to known system setting problems
// alert to known system setting problems:
if( version_compare(PHP_VERSION,'7.4','<') ){
if( get_magic_quotes_gpc() ){
Loco_error_AdminNotices::add( new Loco_error_Debug('You have "magic_quotes_gpc" enabled. We recommend you disable this in PHP') );
}
if( get_magic_quotes_runtime() ){
Loco_error_AdminNotices::add( new Loco_error_Debug('You have "magic_quotes_runtime" enabled. We recommend you disable this in PHP') );
}
}
return $this->view('admin/config/debug', compact('breadcrumb','versions','encoding','memory','fs','debug') );
}
......
......@@ -26,16 +26,14 @@ class Loco_admin_config_VersionController extends Loco_admin_config_BaseControll
// current plugin version
$version = loco_plugin_version();
// check for auto-update availabilty
// check for auto-update availability
if( $updates = get_site_transient('update_plugins') ){
$key = loco_plugin_self();
if( isset($updates->checked[$key]) && isset($updates->response[$key]) ){
$old = $updates->checked[$key];
$new = $updates->response[$key]->new_version;
$diff = version_compare( $new, $old );
if( isset($updates->response[$key]) ){
$latest = $updates->response[$key]->new_version;
// if current version is lower than latest, prompt update
if( 1 === $diff ){
$this->setUpdate( $new );
if( version_compare($version,$latest,'<') ){
$this->setUpdate($latest);
}
}
}
......@@ -52,7 +50,8 @@ class Loco_admin_config_VersionController extends Loco_admin_config_BaseControll
/**
* @internal
* @param string version
* @return void
*/
private function setUpdate( $version ){
$action = 'upgrade-plugin_'.loco_plugin_self();
......
......@@ -15,7 +15,7 @@
* @property bool $po_utf8_bom Whether to prepend PO and POT files with UTF-8 byte order mark
* @property string $po_width PO/POT file maximum line width (wrapping) zero to disable
* @property bool $jed_pretty Whether to pretty print JSON JED files
* @property bool $ajax_files Whether to submit PO data as concrete files
* @property bool $ajax_files Whether to submit PO data as concrete files (requires Blob support in Ajax)
*/
class Loco_data_Settings extends Loco_data_Serializable {
......@@ -44,7 +44,7 @@ class Loco_data_Settings extends Loco_data_Serializable {
'po_utf8_bom' => false,
'po_width' => '79',
'jed_pretty' => false,
'ajax_files' => false,
'ajax_files' => true,
);
......@@ -113,8 +113,7 @@ class Loco_data_Settings extends Loco_data_Serializable {
}
else if( is_array($default) ){
if( ! is_array($value) ){
// TODO use a standard CSV split for array values?
$value = preg_split( '/[\s,]+/', trim($value), -1, PREG_SPLIT_NO_EMPTY );
$value = preg_split( '/[\\s,]+/', trim($value), -1, PREG_SPLIT_NO_EMPTY );
}
}
else {
......@@ -157,26 +156,17 @@ class Loco_data_Settings extends Loco_data_Serializable {
/**
* Run migration in case plugin has been upgraded from 1.x => 2.x since settings last saved
* Run migration in case plugin has been upgraded since settings last saved
* @return bool whether upgrade has occurred
*/
public function migrate(){
$existed = (bool) get_option('loco_settings');
// migrate 1.x branch settings if first run of 2.x
if( ! $existed ){
$this->gen_hash = get_option('loco-translate-gen_hash','0');
$this->use_fuzzy = get_option('loco-translate-use_fuzzy', '1' );
$this->num_backups = get_option('loco-translate-num_backups','1');
$updated = false;
// Always update version number in settings after an upgrade
if( version_compare($this->version,loco_plugin_version(),'<') ){
$this->persist();
$updated = true;
}
// running of plugin in 1.x legacy mode is disabled as of 2.0.15
if( false !== get_option('loco-branch',false) ){
delete_option('loco-branch');
delete_option('loco-translate-gen_hash');
delete_option('loco-translate-use_fuzzy');
delete_option('loco-translate-num_backups');
}
return ! $existed;
return $updated;
}
......
......@@ -481,13 +481,13 @@ class Loco_fs_FileFinder implements Iterator, Countable, Loco_fs_FileListInterfa
$this->subdir = new Loco_fs_FileList;
/* @var Loco_fs_Directory */
foreach( $this->roots as $root ){
if( $root->exists() && ! $this->isExcluded( $root->getPath() ) ){
$this->subdir->add( $root );
if( $root instanceof Loco_fs_Directory && $root->exists() && ! $this->isExcluded( $root->getPath() ) ){
$this->subdir->add($root);
}
}
if( $root = reset($this->subdir) ){
if( $this->subdir->offsetExists(0) ){
$this->i = -1;
$this->open( $root );
$this->open( $this->subdir->offsetGet(0) );
$this->next();
}
else {
......
......@@ -22,6 +22,16 @@ class Loco_fs_FileList extends ArrayIterator implements Loco_fs_FileListInterfac
}
/**
* Use instead of clone because that does weird things to ArrayIterator instances.
* Note that this does NOT clone individual file members.
* @return Loco_fs_FileList
*/
public function copy(){
return new Loco_fs_FileList( $this->getArrayCopy() );
}
/**
* Like getArrayCopy, but exports string paths
* @return array
......
......@@ -46,9 +46,7 @@ class Loco_hooks_AdminHooks extends Loco_hooks_Hookable {
Loco_package_Listener::create();
// trigger post-upgrade process if required
$opts = Loco_data_Settings::get();
if( $opts->migrate() ){
// would trigger upgrade handlers here in future releases
}
$opts->migrate();
}
}
}
......
......@@ -273,11 +273,11 @@ class Loco_mvc_AdminRouter extends Loco_hooks_Hookable {
$page = null;
$action = null;
// empty action targets plugin root
if( ! $route ){
$route = 'loco';
if( ! $route || 'loco' === $route ){
$page = 'loco';
}
// support direct usage of page hooks
if( $url = menu_page_url( $route, false ) ){
else if( 'loco-' === substr($route,0,5) && menu_page_url($route,false) ){
$page = $route;
}
// else split action into admin page (e.g. "loco-themes") and sub-action (e.g. "view-theme")
......@@ -294,7 +294,7 @@ class Loco_mvc_AdminRouter extends Loco_hooks_Hookable {
// sanitize extended route in debug mode only. useful in tests
if( loco_debugging() ){
$tmp = array();
$class = self::pageToClass( substr($page,5), $action, $tmp );
$class = self::pageToClass( (string) substr($page,5), $action, $tmp );
if( ! $class ){
throw new UnexpectedValueException( sprintf('Invalid admin route: %s', json_encode($route) ) );
}
......
......@@ -30,6 +30,16 @@ class Loco_mvc_PostParams extends Loco_mvc_ViewParams {
}
/**
* Check if either magic_quotes_gpc or magic_quotes_runtime are enabled.
* Note that get_magic_quotes_gpc and get_magic_quotes_runtime are deprecated as of PHP 7.4 and always return false
* @return bool
*/
private static function has_magic_quotes(){
return version_compare(PHP_VERSION,'7.4','<') && ( get_magic_quotes_gpc() || get_magic_quotes_runtime() );
}
/**
* Construct clean postdata from current HTTP request
* @return Loco_mvc_PostParams
......@@ -37,8 +47,9 @@ class Loco_mvc_PostParams extends Loco_mvc_ViewParams {
public static function create(){
$post = array();
if( 'POST' === $_SERVER['REQUEST_METHOD'] ){
// attempt to use clean input if available and unslashed
if( ( $raw = file_get_contents('php://input') ) && ! get_magic_quotes_gpc() && ! get_magic_quotes_runtime() ){
// attempt to use clean input if available (without added slashes)
$raw = (string) file_get_contents('php://input');
if( '' !== $raw && ! self::has_magic_quotes() ){
parse_str( $raw, $post );
}
// else reverse wp_magic_quotes (assumes no other process has hacked the array)
......
......@@ -324,6 +324,16 @@ class Loco_package_Project {
}
/**
* Check if target file or directory is excluded
* @param Loco_fs_File PO or POT file
* @return bool
*/
private function isTargetExcluded( Loco_fs_File $file ){
return $this->xgpaths->has($file) || $this->xdpaths->has($file);
}
/**
* Add a path for excluding in a recursive target file search
* @param string | Loco_fs_File
......@@ -513,22 +523,35 @@ class Loco_package_Project {
*/
public function getPot(){
if( ! $this->pot ){
// attempt to match POT exactly under configured domain paths
$name = $this->getSlug().'.pot';
$targets = $this->getConfiguredTargets()->export();
// permit POT file in the bundle root (i.e. outside domain path)
if( '.pot' !== $name ){
// find under configured domain paths
$targets = $this->getConfiguredTargets()->copy();
// always permit POT file in the bundle root (i.e. outside domain path)
if( $this->isDomainDefault() && $this->bundle->hasDirectoryPath() ){
$targets[] = $this->bundle->getDirectoryPath();
$root = $this->bundle->getDirectoryPath();
$targets->add( new Loco_fs_Directory($root) );
// look in alternative language directories if only root is configured
if( 1 === count($targets) ){
foreach( array('languages','language','lang','l10n','i18n') as $d ) {
$alt = new Loco_fs_Directory($root.'/'.$d);
if( ! $this->isTargetExcluded($alt) ){
$targets->add($alt);
}
}
}
}
// pot check is for exact name and not recursive
foreach( $targets as $dir ){
$file = new Loco_fs_File( $name );
$file->normalize( $dir );
if( $file->exists() ){
$file = new Loco_fs_File($name);
$file->normalize( $dir->getPath() );
if( $file->exists() && ! $this->isTargetExcluded($file) ){
$this->pot = $file;
break;
}
}
}
}
return $this->pot;
}
......
......@@ -4,8 +4,8 @@
*/
$this->extend('../layout');
$fs_help = esc_url( apply_filters('loco_external','https://localise.biz/wordpress/plugin/manual/filesystem') );
/* @var Loco_data_Settings $opts */
?>
<form action="" method="post" enctype="application/x-www-form-urlencoded">
......@@ -89,7 +89,7 @@ $fs_help = esc_url( apply_filters('loco_external','https://localise.biz/wordpres
<p>
<label for="loco--ajax-files">
<input type="checkbox" name="opts[ajax_files]" value="1" id="loco--ajax-files"<?php echo $opts->ajax_files?' checked':''?> />
Submit PO data as multipart file uploads (Experimental)
<?php esc_html_e('Enable Ajax file uploads','loco-translate')?> (<?php esc_html_e('Recommended','loco-translate')?>)
</label>
</p>
</fieldset>
......
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* A Wordpress integration that listens for whether the SEO changes have been saved successfully.
*/
class WPSEO_Admin_Settings_Changed_Listener implements WPSEO_WordPress_Integration {
/**
* Have the Yoast SEO settings been saved.
*
* @var bool
*/
private static $settings_saved = false;
/**
* Registers all hooks to WordPress.
*
* @return void
*/
public function register_hooks() {
add_action( 'admin_init', array( $this, 'intercept_save_update_notification' ) );
}
/**
* Checks and overwrites the wp_settings_errors global to determine whether the Yoast SEO settings have been saved.
*/
public function intercept_save_update_notification() {
global $pagenow;
if ( $pagenow !== 'admin.php' || ! WPSEO_Utils::is_yoast_seo_page() ) {
return;
}
// Variable name is the same as the global that is set by get_settings_errors.
$wp_settings_errors = get_settings_errors();
foreach ( $wp_settings_errors as $key => $wp_settings_error ) {
if ( ! $this->is_settings_updated_notification( $wp_settings_error ) ) {
continue;
}
self::$settings_saved = true;
unset( $wp_settings_errors[ $key ] );
// Overwrite the global with the list excluding the Changed saved message.
$GLOBALS['wp_settings_errors'] = $wp_settings_errors;
break;
}
}
/**
* Checks whether the settings notification is a settings_updated notification.
*
* @param array $wp_settings_error The settings object.
*
* @return bool Whether this is a settings updated settings notification.
*/
public function is_settings_updated_notification( $wp_settings_error ) {
return ! empty( $wp_settings_error['code'] ) && $wp_settings_error['code'] === 'settings_updated';
}
/**
* Get whether the settings have successfully been saved
*
* @return bool Whether the settings have successfully been saved.
*/
public function have_settings_been_saved() {
return self::$settings_saved;
}
/**
* Renders a success message if the Yoast SEO settings have been saved.
*/
public function show_success_message() {
if ( $this->have_settings_been_saved() ) {
echo '<p class="wpseo-message"><span class="dashicons dashicons-yes"></span>',
esc_html__( 'Settings saved.', 'wordpress-seo' ),
'</p>';
}
}
}
......@@ -372,6 +372,7 @@ class WPSEO_Admin_Asset_Manager {
'name' => 'admin-script',
'src' => 'wp-seo-admin-' . $flat_version,
'deps' => array(
'lodash',
'jquery',
'jquery-ui-core',
'jquery-ui-progressbar',
......@@ -706,6 +707,9 @@ class WPSEO_Admin_Asset_Manager {
array(
'name' => 'adminbar',
'src' => 'adminbar-' . $flat_version,
'deps' => array(
'admin-bar',
),
),
array(
'name' => 'primary-category',
......
......@@ -40,7 +40,6 @@ class WPSEO_Admin_Init {
add_action( 'admin_init', array( $this, 'permalink_notice' ), 15 );
add_action( 'admin_init', array( $this, 'page_comments_notice' ), 15 );
add_action( 'admin_init', array( $this, 'ga_compatibility_notice' ), 15 );
add_action( 'admin_init', array( $this, 'yoast_plugin_compatibility_notification' ), 15 );
add_action( 'admin_init', array( $this, 'yoast_plugin_suggestions_notification' ), 15 );
add_action( 'admin_init', array( $this, 'recalculate_notice' ), 15 );
add_action( 'admin_init', array( $this, 'unsupported_php_notice' ), 15 );
......@@ -340,56 +339,6 @@ class WPSEO_Admin_Init {
);
}
/**
* Add an alert if outdated versions of Yoast SEO plugins are running.
*/
public function yoast_plugin_compatibility_notification() {
$compatibility_checker = new WPSEO_Plugin_Compatibility( WPSEO_VERSION );
$plugins = $compatibility_checker->get_installed_plugins_compatibility();
$notification_center = Yoast_Notification_Center::get();
foreach ( $plugins as $name => $plugin ) {
$type = ( $plugin['active'] ) ? Yoast_Notification::ERROR : Yoast_Notification::WARNING;
$notification = $this->get_yoast_seo_compatibility_notification( $name, $plugin, $type );
if ( $plugin['active'] && $plugin['compatible'] === false ) {
$notification_center->add_notification( $notification );
continue;
}
$notification_center->remove_notification( $notification );
}
}
/**
* Build Yoast SEO compatibility problem notification.
*
* @param string $name The plugin name to use for the unique ID.
* @param array $plugin The plugin to retrieve the data from.
* @param string $level The severity level to use for the notification.
*
* @return Yoast_Notification
*/
private function get_yoast_seo_compatibility_notification( $name, $plugin, $level = Yoast_Notification::WARNING ) {
$info_message = sprintf(
/* translators: %1$s expands to Yoast SEO, %2$s expands to the plugin version, %3$s expands to the plugin name */
__( '%1$s detected you are using version %2$s of %3$s, please update to the latest version to prevent compatibility issues.', 'wordpress-seo' ),
'Yoast SEO',
$plugin['version'],
$plugin['title']
);
return new Yoast_Notification(
$info_message,
array(
'id' => 'wpseo-outdated-yoast-seo-plugin-' . $name,
'type' => $level,
)
);
}
/**
* Shows the notice for recalculating the post. the Notice will only be shown if the user hasn't dismissed it before.
*/
......@@ -735,4 +684,15 @@ class WPSEO_Admin_Init {
);
}
}
/* ********************* DEPRECATED METHODS ********************* */
/**
* Add an alert if outdated versions of Yoast SEO plugins are running.
*
* @deprecated 12.3
* @codeCoverageIgnore
*/
public function yoast_plugin_compatibility_notification() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
}
}
......@@ -112,6 +112,7 @@ class WPSEO_Admin {
$integrations[] = new WPSEO_MyYoast_Route();
$integrations[] = new WPSEO_Schema_Person_Upgrade_Notification();
$integrations[] = new WPSEO_Tracking( 'https://tracking.yoast.com/stats', ( WEEK_IN_SECONDS * 2 ) );
$integrations[] = new WPSEO_Admin_Settings_Changed_Listener();
$integrations = array_merge(
$integrations,
......
......@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
const CURRENT_RELEASE = '6.5.0';
const CURRENT_RELEASE = '6.6.0';
/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
const MINIMUM_SUPPORTED = '6.5.0';
const MINIMUM_SUPPORTED = '6.6.0';
/**
* Holds the current version.
......
......@@ -7,6 +7,9 @@
/**
* Class WPSEO_Plugin_Compatibility.
*
* @codeCoverageIgnore
* @deprecated 12.3
*/
class WPSEO_Plugin_Compatibility {
......@@ -34,10 +37,14 @@ class WPSEO_Plugin_Compatibility {
/**
* WPSEO_Plugin_Compatibility constructor.
*
* @deprecated 12.3
*
* @param string $version The version to check against.
* @param null|class $availability_checker The checker to use.
*/
public function __construct( $version, $availability_checker = null ) {
_deprecated_function( __METHOD__, '12.3' );
// We trim off the patch version, as this shouldn't break the comparison.
$this->current_wpseo_version = $this->get_major_minor_version( $version );
$this->availability_checker = $this->retrieve_availability_checker( $availability_checker );
......@@ -47,11 +54,15 @@ class WPSEO_Plugin_Compatibility {
/**
* Retrieves the availability checker.
*
* @deprecated 12.3
*
* @param null|object $checker The checker to set.
*
* @return WPSEO_Plugin_Availability The checker to use.
*/
private function retrieve_availability_checker( $checker ) {
_deprecated_function( __METHOD__, '12.3' );
if ( is_null( $checker ) || ! is_object( $checker ) ) {
$checker = new WPSEO_Plugin_Availability();
$checker->register();
......@@ -63,18 +74,26 @@ class WPSEO_Plugin_Compatibility {
/**
* Wraps the availability checker's get_installed_plugins method.
*
* @deprecated 12.3
*
* @return array Array containing all the installed plugins.
*/
public function get_installed_plugins() {
_deprecated_function( __METHOD__, '12.3' );
return $this->installed_plugins;
}
/**
* Creates a list of installed plugins and whether or not they are compatible.
*
* @deprecated 12.3
*
* @return array Array containing the installed plugins and compatibility.
*/
public function get_installed_plugins_compatibility() {
_deprecated_function( __METHOD__, '12.3' );
foreach ( $this->installed_plugins as $key => $plugin ) {
$this->installed_plugins[ $key ]['compatible'] = $this->is_compatible( $key );
......@@ -86,11 +105,15 @@ class WPSEO_Plugin_Compatibility {
/**
* Checks whether or not a plugin is compatible.
*
* @deprecated 12.3
*
* @param string $plugin The plugin to look for and match.
*
* @return bool Whether or not the plugin is compatible.
*/
public function is_compatible( $plugin ) {
_deprecated_function( __METHOD__, '12.3' );
$plugin = $this->availability_checker->get_plugin( $plugin );
// If we are not syncing versions, we are always compatible.
......@@ -105,11 +128,15 @@ class WPSEO_Plugin_Compatibility {
/**
* Gets the major/minor version of the plugin for easier comparing.
*
* @deprecated 12.3
*
* @param string $version The version to trim.
*
* @return string The major/minor version of the plugin.
*/
protected function get_major_minor_version( $version ) {
_deprecated_function( __METHOD__, '12.3' );
return substr( $version, 0, 3 );
}
}
......@@ -153,7 +153,20 @@ class Yoast_Form {
*/
public function admin_footer( $submit = true, $show_sidebar = true ) {
if ( $submit ) {
$settings_changed_listener = new WPSEO_Admin_Settings_Changed_Listener();
echo '<div id="wpseo-submit-container">';
echo '<div id="wpseo-submit-container-float" class="wpseo-admin-submit">';
submit_button( __( 'Save changes', 'wordpress-seo' ) );
$settings_changed_listener->show_success_message();
echo '</div>';
echo '<div id="wpseo-submit-container-fixed" class="wpseo-admin-submit wpseo-admin-submit-fixed" style="display: none;">';
submit_button( __( 'Save changes', 'wordpress-seo' ) );
$settings_changed_listener->show_success_message();
echo '</div>';
echo '</div>';
echo '
</form>';
......
......@@ -106,6 +106,11 @@ class Yoast_Input_Validation {
esc_html__( 'Baidu verification codes can only contain letters, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'baiduverify' )
),
'facebook_site' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Please check the format of the Facebook Page URL you entered. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'facebook_site' )
),
'fbadminapp' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'The Facebook App ID you entered doesn\'t exist. %s', 'wordpress-seo' ),
......@@ -116,11 +121,31 @@ class Yoast_Input_Validation {
esc_html__( 'Google verification codes can only contain letters, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'googleverify' )
),
'instagram_url' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Please check the format of the Instagram URL you entered. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'instagram_url' )
),
'linkedin_url' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Please check the format of the Linkedin URL you entered. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'linkedin_url' )
),
'msverify' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Bing confirmation codes can only contain letters from A to F, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'msverify' )
),
'myspace_url' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Please check the format of the MySpace URL you entered. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'myspace_url' )
),
'pinterest_url' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Please check the format of the Pinterest URL you entered. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'pinterest_url' )
),
'pinterestverify' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Pinterest confirmation codes can only contain letters from A to F, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
......@@ -131,11 +156,21 @@ class Yoast_Input_Validation {
esc_html__( 'Twitter usernames can only contain letters, numbers, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'twitter_site' )
),
'wikipedia_url' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Please check the format of the Wikipedia URL you entered. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'wikipedia_url' )
),
'yandexverify' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Yandex confirmation codes can only contain letters from A to F, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'yandexverify' )
),
'youtube_url' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Please check the format of the Youtube URL you entered. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'youtube_url' )
),
);
$descriptions = wp_parse_args( $descriptions, $defaults );
......
<?php
/**
* File with the class to handle data from RankMath.
*
* @package WPSEO\Admin\Import\Plugins
*/
/**
* Class with functionality to import RankMath post metadata.
*/
class WPSEO_Import_RankMath extends WPSEO_Plugin_Importer {
/**
* The plugin name.
*
* @var string
*/
protected $plugin_name = 'RankMath';
/**
* Meta key, used in SQL LIKE clause for delete query.
*
* @var string
*/
protected $meta_key = 'rank_math_%';
/**
* Array of meta keys to detect and import.
*
* @var array
*/
protected $clone_keys = array(
array(
'old_key' => 'rank_math_description',
'new_key' => 'metadesc',
),
array(
'old_key' => 'rank_math_title',
'new_key' => 'title',
),
array(
'old_key' => 'rank_math_canonical_url',
'new_key' => 'canonical',
),
array(
'old_key' => 'rank_math_primary_category',
'new_key' => 'primary_category',
),
array(
'old_key' => 'rank_math_facebook_title',
'new_key' => 'opengraph-title',
),
array(
'old_key' => 'rank_math_facebook_description',
'new_key' => 'opengraph-description',
),
array(
'old_key' => 'rank_math_facebook_image',
'new_key' => 'opengraph-image',
),
array(
'old_key' => 'rank_math_facebook_image_id',
'new_key' => 'opengraph-image-id',
),
array(
'old_key' => 'rank_math_twitter_title',
'new_key' => 'twitter-title',
),
array(
'old_key' => 'rank_math_twitter_description',
'new_key' => 'twitter-description',
),
array(
'old_key' => 'rank_math_twitter_image',
'new_key' => 'twitter-image',
),
array(
'old_key' => 'rank_math_twitter_image_id',
'new_key' => 'twitter-image-id',
),
array(
'old_key' => 'rank_math_focus_keyword',
'new_key' => 'focuskw',
),
);
/**
* Handles post meta data to import.
*
* @return bool Import success status.
*/
protected function import() {
global $wpdb;
// Replace % with %% as their variables are the same except for that.
$wpdb->query( "UPDATE $wpdb->postmeta SET meta_value = REPLACE( meta_value, '%', '%%' ) WHERE meta_key IN ( 'rank_math_description', 'rank_math_title' )" );
$this->import_meta_robots();
$return = $this->meta_keys_clone( $this->clone_keys );
// Return %% to % so our import is non-destructive.
$wpdb->query( "UPDATE $wpdb->postmeta SET meta_value = REPLACE( meta_value, '%%', '%' ) WHERE meta_key IN ( 'rank_math_description', 'rank_math_title' )" );
if ( $return ) {
$this->import_settings();
}
return $return;
}
/**
* RankMath stores robots meta quite differently, so we have to parse it out.
*/
private function import_meta_robots() {
global $wpdb;
$post_metas = $wpdb->get_results( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'rank_math_robots'" );
foreach ( $post_metas as $post_meta ) {
$robots_values = unserialize( $post_meta->meta_value );
foreach ( array( 'noindex', 'nofollow' ) as $directive ) {
$directive_key = array_search( $directive, $robots_values );
if ( $directive_key !== false ) {
update_post_meta( $post_meta->post_id, '_yoast_wpseo_meta-robots-' . $directive, 1 );
unset( $robots_values[ $directive_key ] );
}
}
if ( count( $robots_values ) > 0 ) {
$value = implode( ',', $robots_values );
update_post_meta( $post_meta->post_id, '_yoast_wpseo_meta-robots-adv', $value );
}
}
}
/**
* Imports some of the RankMath settings.
*/
private function import_settings() {
$settings = array(
'title_separator' => 'separator',
'homepage_title' => 'title-home-wpseo',
'homepage_description' => 'metadesc-home-wpseo',
'author_archive_title' => 'title-author-wpseo',
'date_archive_title' => 'title-archive-wpseo',
'search_title' => 'title-search-wpseo',
'404_title' => 'title-404-wpseo',
'pt_post_title' => 'title-post',
'pt_page_title' => 'title-page',
);
$options = get_option( 'rank-math-options-titles' );
foreach ( $settings as $import_setting_key => $setting_key ) {
if ( ! empty( $options[ $import_setting_key ] ) ) {
$value = $options[ $import_setting_key ];
// Make sure replace vars work.
$value = str_replace( '%', '%%', $value );
WPSEO_Options::set( $setting_key, $value );
}
}
}
/**
* Removes the plugin data from the database.
*
* @return bool Cleanup status.
*/
protected function cleanup() {
$return = parent::cleanup();
if ( $return ) {
global $wpdb;
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'rank-math-%'" );
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '%rank_math%'" );
}
return $return;
}
}
......@@ -25,6 +25,7 @@ class WPSEO_Plugin_Importers {
'WPSEO_Import_WP_Meta_SEO',
'WPSEO_Import_Platinum_SEO',
'WPSEO_Import_Premium_SEO_Pack',
'WPSEO_Import_RankMath',
'WPSEO_Import_SEOPressor',
'WPSEO_Import_SEO_Framework',
'WPSEO_Import_Smartcrawl_SEO',
......
......@@ -55,12 +55,7 @@ class WPSEO_Tracking_Plugin_Data implements WPSEO_Collection {
protected function format_plugin( array $plugin ) {
return array(
'name' => $plugin['Name'],
'url' => $plugin['PluginURI'],
'version' => $plugin['Version'],
'author' => array(
'name' => wp_strip_all_tags( $plugin['Author'], true ),
'url' => $plugin['AuthorURI'],
),
);
}
}
......@@ -19,6 +19,7 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
'googleverify',
'msverify',
'yandexverify',
'myyoast-oauth',
'website_name',
'alternate_website_name',
'company_logo',
......@@ -31,6 +32,12 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
'instagram_url',
'linkedin_url',
'myspace_url',
'og_default_image',
'og_default_image_id',
'og_frontpage_title',
'og_frontpage_desc',
'og_frontpage_image',
'og_frontpage_image_id',
'pinterest_url',
'pinterestverify',
'twitter_site',
......@@ -39,15 +46,136 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
'fbadminapp',
);
/**
* @var array $include_list contains the option_names for the options we want to track.
*/
private $include_list = array(
'ms_defaults_set',
'version',
'disableadvanced_meta',
'onpage_indexability',
'baiduverify',
'googleverify',
'msverify',
'yandexverify',
'site_type',
'has_multiple_authors',
'environment_type',
'content_analysis_active',
'keyword_analysis_active',
'enable_admin_bar_menu',
'enable_cornerstone_content',
'enable_xml_sitemap',
'enable_text_link_counter',
'show_onboarding_notice',
'first_activated_on',
'myyoast-oauth',
'website_name',
'alternate_website_name',
'company_logo',
'company_name',
'company_or_person',
'person_name',
'title_test',
'forcerewritetitle',
'separator',
'title-home-wpseo',
'title-author-wpseo',
'title-archive-wpseo',
'title-search-wpseo',
'title-404-wpseo',
'metadesc-home-wpseo',
'metadesc-author-wpseo',
'metadesc-archive-wpseo',
'rssbefore',
'rssafter',
'noindex-author-wpseo',
'noindex-author-noposts-wpseo',
'noindex-archive-wpseo',
'disable-author',
'disable-date',
'disable-post_format',
'disable-attachment',
'is-media-purge-relevant',
'breadcrumbs-404crumb',
'breadcrumbs-display-blog-page',
'breadcrumbs-boldlast',
'breadcrumbs-archiveprefix',
'breadcrumbs-enable',
'breadcrumbs-home',
'breadcrumbs-prefix',
'breadcrumbs-searchprefix',
'breadcrumbs-sep',
'person_logo',
'person_logo_id',
'company_logo_id',
'company_or_person_user_id',
'stripcategorybase',
'noindex-post',
'showdate-post',
'display-metabox-pt-post',
'noindex-page',
'showdate-page',
'display-metabox-pt-page',
'noindex-attachment',
'showdate-attachment',
'display-metabox-pt-attachment',
'display-metabox-tax-category',
'noindex-tax-category',
'display-metabox-tax-post_tag',
'noindex-tax-post_tag',
'display-metabox-tax-post_format',
'noindex-tax-post_format',
'taxonomy-category-ptparent',
'taxonomy-post_tag-ptparent',
'taxonomy-post_format-ptparent',
'breadcrumbs-blog-remove',
'hideeditbox-post',
'hideeditbox-page',
'hideeditbox-attachment',
'hideeditbox-tax-category',
'hideeditbox-tax-post_tag',
'hideeditbox-tax-post_format',
'facebook_site',
'instagram_url',
'linkedin_url',
'myspace_url',
'og_default_image',
'og_default_image_id',
'og_frontpage_title',
'og_frontpage_desc',
'og_frontpage_image',
'og_frontpage_image_id',
'opengraph',
'pinterest_url',
'pinterestverify',
'twitter',
'twitter_site',
'twitter_card_type',
'youtube_url',
'wikipedia_url',
'fbadminapp',
);
/**
* Returns the collection data.
*
* @return array The collection data.
*/
public function get() {
/**
* Filter: 'wpseo_tracking_settings_include_list' - Allow filtering the settings included in tracking.
*
* @api string $include_list the list with included setting names.
*/
$this->include_list = apply_filters( 'wpseo_tracking_settings_include_list', $this->include_list );
$options = WPSEO_Options::get_all();
// Returns the settings of which the keys intersect with the values of the include list.
$options = array_intersect_key( $options, array_flip( $this->include_list ) );
return array(
'settings' => $this->anonymize_settings( WPSEO_Options::get_all() ),
'settings' => $this->anonymize_settings( $options ),
);
}
......
......@@ -18,6 +18,7 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
}
?>
<?php /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $attributes is properly escaped in parse_attribute via get_attributes in class-yoast-input-select.php. */ ?>
<select <?php echo $attributes; ?>name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $id ); ?>">
<?php foreach ( $options as $option_attribute_value => $option_html_value ) : ?>
<option value="<?php echo esc_attr( $option_attribute_value ); ?>"<?php echo selected( $selected, $option_attribute_value, false ); ?>><?php echo esc_html( $option_html_value ); ?></option>
......
......@@ -37,6 +37,7 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
<?php
/* translators: %s expands to Yoast SEO Premium */
printf( esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
echo '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';
?>
......@@ -51,7 +52,10 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/2oi' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/SEO_for_beginners.svg' ); ?>" alt="">
<strong><?php esc_html_e( 'SEO for Beginners training', 'wordpress-seo' ); ?></strong>
<?php echo $new_tab_message; ?>
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a><br>
<?php esc_html_e( 'Get quick wins to make your site rank higher in search engines.', 'wordpress-seo' ); ?>
</p>
......@@ -67,7 +71,10 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
printf( esc_html__( '%s for WordPress training', 'wordpress-seo' ), 'Yoast SEO' );
?>
</strong>
<?php echo $new_tab_message; ?>
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a><br>
<?php esc_html_e( 'Don’t waste time figuring out the best settings yourself.', 'wordpress-seo' ); ?>
</p>
......@@ -77,7 +84,10 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/3lj' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/all-round-SEO.svg' ); ?>" alt="">
<strong><?php esc_html_e( 'All-around SEO training', 'wordpress-seo' ); ?></strong>
<?php echo $new_tab_message; ?>
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a><br>
<?php esc_html_e( 'Learn practical SEO skills to rank higher in Google.', 'wordpress-seo' ); ?>
</p>
......@@ -95,7 +105,10 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jq' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Local_SEO_Icon.svg' ); ?>" alt="">
<strong>Local SEO</strong>
<?php echo $new_tab_message; ?>
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a><br>
<?php esc_html_e( 'Be found in Google Maps and local results.', 'wordpress-seo' ); ?>
</p>
......@@ -105,7 +118,10 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jo' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Video_SEO_Icon.svg' ); ?>" alt="">
<strong>Video SEO</strong>
<?php echo $new_tab_message; ?>
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a><br>
<?php esc_html_e( 'Be found in Google Video search and enhance your video sharing on social media.', 'wordpress-seo' ); ?>
</p>
......@@ -115,7 +131,10 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jp' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Woo_SEO_Icon.svg' ); ?>" alt="">
<strong>WooCommerce SEO</strong>
<?php echo $new_tab_message; ?>
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a><br>
<?php esc_html_e( 'Optimize your shop\'s SEO and sell more products!', 'wordpress-seo' ); ?>
</p>
......@@ -125,7 +144,10 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jr' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/News_SEO_Icon.svg' ); ?>" alt="">
<strong>News SEO</strong>
<?php echo $new_tab_message; ?>
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a><br>
<?php esc_html_e( 'Optimize your site for Google News.', 'wordpress-seo' ); ?>
</p>
......@@ -139,6 +161,7 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
<?php
/* translators: %s expands to Yoast SEO Premium */
printf( esc_html__( 'Upgrade to %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a>
......
......@@ -20,6 +20,9 @@ class WPSEO_Metabox_Tab_Section extends WPSEO_Abstract_Metabox_Tab_With_Sections
/**
* Constructor.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @param string $name The name of the section, used as an identifier in the html.
* Can only contain URL safe characters.
* @param string $link_content The text content of the section link.
......@@ -27,6 +30,8 @@ class WPSEO_Metabox_Tab_Section extends WPSEO_Abstract_Metabox_Tab_With_Sections
* @param array $options Optional link attributes.
*/
public function __construct( $name, $link_content, array $tabs = array(), array $options = array() ) {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
parent::__construct( $name, $link_content, $options );
// Filter out invalid tab instances.
......@@ -40,11 +45,16 @@ class WPSEO_Metabox_Tab_Section extends WPSEO_Abstract_Metabox_Tab_With_Sections
/**
* Determines whether the passed tab is considered valid.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @param mixed $tab The potential tab that needs to be validated.
*
* @return bool Whether or not the tab is valid.
*/
protected function is_valid_tab( $tab ) {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
if ( $tab instanceof WPSEO_Metabox_Tab && ! $tab instanceof WPSEO_Metabox_Null_Tab ) {
return true;
}
......@@ -54,8 +64,13 @@ class WPSEO_Metabox_Tab_Section extends WPSEO_Abstract_Metabox_Tab_With_Sections
/**
* Outputs the section content if any tab has been added.
*
* @deprecated 12.3
* @codeCoverageIgnore
*/
public function display_content() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
if ( $this->has_sections() ) {
$html = '<div role="tabpanel" id="wpseo-meta-section-%1$s" aria-labelledby="wpseo-meta-tab-%1$s" tabindex="0" class="wpseo-meta-section">';
$html .= '<div class="wpseo-metabox-tabs-div">';
......@@ -63,10 +78,13 @@ class WPSEO_Metabox_Tab_Section extends WPSEO_Abstract_Metabox_Tab_With_Sections
$html .= '</div></div>';
printf(
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated.
$html,
esc_attr( $this->name ),
esc_attr( 'wpseo-metabox-tab-' . $this->name ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated.
$this->tab_links(),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated.
$this->tab_content()
);
}
......@@ -75,27 +93,42 @@ class WPSEO_Metabox_Tab_Section extends WPSEO_Abstract_Metabox_Tab_With_Sections
/**
* Add a `WPSEO_Metabox_Tab` object to the tabs.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @param WPSEO_Metabox_Tab $tab Tab to add.
*/
public function add_tab( WPSEO_Metabox_Tab $tab ) {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
$this->tabs[] = $tab;
}
/**
* Checks if any tabs have been added to the section.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @return bool
*/
protected function has_sections() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
return ! empty( $this->tabs );
}
/**
* Concatenates all tabs' links into one html string.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @return string
*/
private function tab_links() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
$links = '';
foreach ( $this->tabs as $tab ) {
$links .= $tab->link();
......@@ -106,9 +139,14 @@ class WPSEO_Metabox_Tab_Section extends WPSEO_Abstract_Metabox_Tab_With_Sections
/**
* Concatenates all tabs' content into one html string.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @return string
*/
private function tab_content() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
$content = '';
foreach ( $this->tabs as $tab ) {
$content .= $tab->content();
......@@ -119,9 +157,14 @@ class WPSEO_Metabox_Tab_Section extends WPSEO_Abstract_Metabox_Tab_With_Sections
/**
* Gets the name of the tab section.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @return string The name of the tab section.
*/
public function get_name() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
return $this->name;
}
}
......@@ -23,6 +23,9 @@ class WPSEO_Schema_Utils {
public static function get_user_schema_id( $user_id, $context ) {
$user = get_userdata( $user_id );
if ( is_object( $user ) && isset( $user->user_login ) ) {
return $context->site_url . WPSEO_Schema_IDs::PERSON_HASH . wp_hash( $user->user_login . $user_id );
}
return $context->site_url . WPSEO_Schema_IDs::PERSON_HASH;
}
}
......@@ -137,6 +137,10 @@ class WPSEO_Upgrade {
$this->clean_all_notifications();
}
if ( version_compare( $version, '12.3-RC0', '<' ) ) {
$this->upgrade_123();
}
// Since 3.7.
$upsell_notice = new WPSEO_Product_Upsell_Notice();
$upsell_notice->set_upgrade_notice();
......@@ -686,6 +690,26 @@ class WPSEO_Upgrade {
}
}
/**
* Removes the about notice when its still in the database.
*/
private function upgrade_123() {
$plugins = array(
'yoast-seo-premium',
'video-seo-for-wordpress-seo-by-yoast',
'yoast-news-seo',
'local-seo-for-yoast-seo',
'yoast-woocommerce-seo',
'yoast-acf-analysis',
);
$center = Yoast_Notification_Center::get();
foreach ( $plugins as $plugin ) {
$center->remove_notification_by_id( 'wpseo-outdated-yoast-seo-plugin-' . $plugin );
}
}
/**
* Removes all notifications saved in the database under 'wp_yoast_notifications'.
*
......
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Internals
*/
/**
* Represents the abstract class for the health check.
*/
abstract class WPSEO_Health_Check {
const STATUS_GOOD = 'good';
const STATUS_RECOMMENDED = 'recommended';
const STATUS_CRITICAL = 'critical';
/**
* Name of the test.
*
* @var string
*/
protected $name = '';
/**
* The value of the section header in the Health check.
*
* @var string
*/
protected $label = '';
/**
* Section the result should be displayed in.
*
* @var string
*/
protected $status = '';
/**
* What the badge should say with a color.
*
* @var array
*/
protected $badge = array(
'label' => '',
'color' => '',
);
/**
* Additional details about the results of the test.
*
* @var string
*/
protected $description = '';
/**
* A link or button to allow the end user to take action on the result.
*
* @var string
*/
protected $actions = '';
/**
* The name of the test.
*
* @var string
*/
protected $test = '';
/**
* Whether or not the test should be ran on AJAX as well.
*
* @var bool True when is async, default false.
*/
protected $async = false;
/**
* Runs the test and returns the result.
*
* @return array The result.
*/
abstract public function run();
/**
* Registers the test to WordPress.
*/
public function register_test() {
if ( $this->async ) {
add_filter( 'site_status_tests', array( $this, 'add_async_test' ) );
add_action( 'wp_ajax_health-check-' . $this->get_test_name(), array( $this, 'get_async_test_result' ) );
return;
}
add_filter( 'site_status_tests', array( $this, 'add_test' ) );
}
/**
* Runs the test.
*
* @param array $tests Array with the current tests.
*
* @return array The extended array.
*/
public function add_test( $tests ) {
$tests['direct'][ $this->name ] = array(
'test' => array( $this, 'get_test_result' ),
'name' => $this->name,
);
return $tests;
}
/**
* Runs the test in async mode.
*
* @param array $tests Array with the current tests.
*
* @return array The extended array.
*/
public function add_async_test( $tests ) {
$tests['async'][ $this->name ] = array(
'test' => $this->get_test_name(),
'name' => $this->name,
);
return $tests;
}
/**
* Formats the test result as an array.
*
* @return array The formatted test result.
*/
public function get_test_result() {
$this->run();
return array(
'label' => $this->label,
'status' => $this->status,
'badge' => $this->get_badge(),
'description' => $this->description,
'actions' => $this->actions,
);
}
/**
* Formats the test result as an array.
*/
public function get_async_test_result() {
wp_send_json_success( $this->get_test_result() );
}
/**
* Retrieves the badge and ensure usable values are set.
*
* @return array The proper formatted badge.
*/
protected function get_badge() {
if ( ! is_array( $this->badge ) ) {
$this->badge = array();
}
if ( empty( $this->badge['label'] ) ) {
$this->badge['label'] = __( 'SEO', 'wordpress-seo' );
}
if ( empty( $this->badge['color'] ) ) {
$this->badge['color'] = 'green';
}
return $this->badge;
}
/**
* WordPress converts the underscores to dashes. To prevent issues we have
* to do it as well.
*
* @return string The formatted testname.
*/
protected function get_test_name() {
return str_replace( '_', '-', $this->test );
}
}
......@@ -335,7 +335,7 @@ abstract class WPSEO_Option {
if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' ) {
$submitted_url = trim( htmlspecialchars( $dirty[ $key ] ) );
$validated_url = filter_var( $submitted_url, FILTER_VALIDATE_URL );
$validated_url = filter_var( WPSEO_Utils::sanitize_url( $submitted_url ), FILTER_VALIDATE_URL );
if ( $validated_url === false ) {
if ( function_exists( 'add_settings_error' ) ) {
......@@ -362,6 +362,8 @@ abstract class WPSEO_Option {
}
}
Yoast_Input_Validation::add_dirty_value_to_settings_errors( $key, $submitted_url );
return;
}
......
......@@ -11,7 +11,6 @@
* @todo This class could use a general description with some explanation on sitemaps. OR.
*/
class WPSEO_Sitemaps {
/**
* Sitemap index identifier.
*
......@@ -146,14 +145,11 @@ class WPSEO_Sitemaps {
* Check the current request URI, if we can determine it's probably an XML sitemap, kill loading the widgets.
*/
public function reduce_query_load() {
if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
return;
}
$request_uri = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
$extension = substr( $request_uri, -4 );
if ( false !== stripos( $request_uri, 'sitemap' ) && in_array( $extension, array( '.xml', '.xsl' ), true ) ) {
remove_all_actions( 'widgets_init' );
}
......@@ -366,10 +362,12 @@ class WPSEO_Sitemaps {
$links = $provider->get_sitemap_links( $type, $entries_per_page, $this->current_page );
} catch ( OutOfBoundsException $exception ) {
$this->bad_sitemap = true;
return;
}
$this->sitemap = $this->renderer->get_sitemap( $links, $type, $this->current_page );
return;
}
......@@ -441,17 +439,10 @@ class WPSEO_Sitemaps {
}
/**
* Spit out the generated sitemap and relevant headers and encoding information.
* Spit out the generated sitemap.
*/
public function output() {
if ( ! headers_sent() ) {
header( $this->http_protocol . ' 200 OK', true, 200 );
// Prevent the search engines from indexing the XML Sitemap.
header( 'X-Robots-Tag: noindex, follow', true );
header( 'Content-Type: text/xml; charset=' . esc_attr( $this->renderer->get_output_charset() ) );
}
$this->send_headers();
echo $this->renderer->get_output( $this->sitemap, $this->transient );
}
......@@ -623,4 +614,35 @@ class WPSEO_Sitemaps {
return $post_statuses;
}
/**
* Sends all the required HTTP Headers.
*/
private function send_headers() {
if ( headers_sent() ) {
return;
}
$headers = array(
$this->http_protocol . ' 200 OK' => 200,
// Prevent the search engines from indexing the XML Sitemap.
'X-Robots-Tag: noindex, follow' => '',
'Content-Type: text/xml; charset=' . esc_attr( $this->renderer->get_output_charset() ) => '',
);
/**
* Filter the HTTP headers we send before an XML sitemap.
*
* @param array $headers The HTTP headers we're going to send out.
*/
$headers = apply_filters( 'wpseo_sitemap_http_headers', $headers );
foreach ( $headers as $header => $status ) {
if ( is_numeric( $status ) ) {
header( $header, true, $status );
continue;
}
header( $header, true );
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment