Version Description
Download this release
Release Info
Developer | Yoast |
Plugin | Yoast SEO |
Version | 9.6 |
Comparing to | |
See all releases |
Code changes from version 9.5 to 9.6
- admin/ajax.php +10 -9
- admin/capabilities/class-abstract-capability-manager.php +6 -1
- admin/capabilities/class-capability-manager-integration.php +5 -1
- admin/class-admin-asset-manager.php +53 -12
- admin/class-admin.php +8 -1
- admin/class-asset.php +36 -2
- admin/class-bulk-editor-list-table.php +33 -54
- admin/class-collector.php +3 -1
- admin/class-database-proxy.php +15 -5
- admin/class-export.php +12 -3
- admin/class-expose-shortlinks.php +36 -1
- admin/class-extension-manager.php +14 -4
- admin/class-extensions.php +5 -1
- admin/class-gutenberg-compatibility.php +2 -2
- admin/class-help-center-item.php +20 -4
- admin/class-help-center.php +1 -0
- admin/class-meta-storage.php +8 -2
- admin/class-option-tab.php +15 -3
- admin/class-option-tabs.php +15 -3
- admin/class-paper-presenter.php +1 -0
- admin/class-premium-popup.php +1 -0
- admin/class-premium-upsell-admin-block.php +11 -2
- admin/class-product-upsell-notice.php +3 -1
- admin/class-recalibration-beta.php +7 -4
- admin/class-remote-request.php +12 -4
- admin/class-social-admin.php +45 -28
- admin/class-yoast-alerts.php +39 -7
- admin/class-yoast-network-admin.php +2 -2
- admin/class-yoast-network-settings-api.php +9 -3
- admin/class-yoast-notification-center.php +33 -7
- admin/class-yoast-notification.php +15 -5
- admin/config-ui/class-configuration-components.php +10 -2
- admin/config-ui/class-configuration-endpoint.php +23 -1
- admin/config-ui/class-configuration-options-adapter.php +16 -1
- admin/config-ui/class-configuration-service.php +18 -6
- admin/config-ui/class-configuration-storage.php +6 -2
- admin/config-ui/class-configuration-structure.php +5 -1
- admin/config-ui/class-configuration-translations.php +10 -2
- admin/config-ui/components/class-component-connect-google-search-console.php +12 -2
- admin/config-ui/factories/class-factory-post-type.php +5 -1
- admin/config-ui/fields/class-field-choice-post-type.php +5 -1
- admin/config-ui/fields/class-field.php +26 -5
- admin/endpoints/class-endpoint-file-size.php +13 -1
- admin/endpoints/class-endpoint-ryte.php +15 -1
- admin/endpoints/class-endpoint-statistics.php +15 -1
- admin/google_search_console/class-gsc-modal.php +9 -3
- admin/google_search_console/class-gsc-table.php +50 -25
- admin/google_search_console/class-gsc.php +86 -42
- admin/google_search_console/views/gsc-display.php +6 -2
- admin/google_search_console/views/gsc-redirect-nopremium.php +2 -0
- admin/import/class-import-detector.php +1 -0
- admin/import/class-import-plugin.php +1 -0
- admin/import/class-import-status.php +1 -0
- admin/import/plugins/class-abstract-plugin-importer.php +1 -0
- admin/import/plugins/class-import-aioseo.php +1 -0
- admin/import/plugins/class-import-greg-high-performance-seo.php +1 -0
- admin/import/plugins/class-import-headspace.php +1 -0
- admin/import/plugins/class-import-jetpack.php +1 -0
- admin/import/plugins/class-import-platinum-seo-pack.php +1 -0
- admin/import/plugins/class-import-premium-seo-pack.php +1 -0
- admin/import/plugins/class-import-seo-framework.php +1 -0
- admin/import/plugins/class-import-seopressor.php +1 -0
- admin/import/plugins/class-import-smartcrawl.php +1 -0
- admin/import/plugins/class-import-squirrly.php +1 -0
- admin/import/plugins/class-import-ultimate-seo.php +1 -0
- admin/import/plugins/class-import-woothemes-seo.php +1 -0
- admin/import/plugins/class-import-wp-meta-seo.php +1 -0
- admin/import/plugins/class-import-wpseo.php +1 -0
- admin/import/plugins/class-importers.php +1 -0
- admin/links/class-link-column-count.php +3 -1
- admin/links/class-link-content-processor.php +6 -2
- admin/links/class-link-extractor.php +3 -1
- admin/links/class-link-factory.php +9 -4
- admin/links/class-link-filter.php +3 -1
- admin/links/class-link-installer.php +3 -1
- admin/links/class-link-reindex-dashboard.php +11 -2
- admin/links/class-link-reindex-post-endpoint.php +3 -1
- admin/links/class-link-storage.php +8 -2
- admin/links/class-link-type-classifier.php +6 -2
- admin/links/class-link-watcher.php +3 -1
- admin/links/class-link.php +9 -3
- admin/menu/class-base-menu.php +5 -1
- admin/menu/class-menu.php +13 -2
- admin/menu/class-replacevar-editor.php +6 -3
- admin/menu/class-replacevar-field.php +1 -0
- admin/metabox/class-metabox-section-react.php +1 -0
- admin/metabox/class-metabox.php +33 -46
- admin/my-yoast-proxy.php +1 -1
- admin/notifiers/class-configuration-notifier.php +11 -1
- admin/notifiers/class-recalibration-beta.php +0 -105
- admin/pages/dashboard.php +1 -1
- admin/roles/class-abstract-role-manager.php +6 -1
- admin/taxonomy/class-taxonomy-metabox.php +4 -79
- admin/taxonomy/class-taxonomy-settings-fields.php +1 -0
- admin/taxonomy/class-taxonomy-social-fields.php +6 -1
- admin/tracking/class-tracking.php +9 -3
- admin/views/class-view-utils.php +6 -1
- admin/views/class-yoast-feature-toggle.php +35 -7
- admin/views/class-yoast-feature-toggles.php +10 -2
- admin/views/licenses.php +1 -1
- admin/views/paper-collapsible.php +1 -2
- admin/views/tabs/metas/archives.php +4 -0
- admin/views/tabs/metas/breadcrumbs.php +4 -1
- admin/views/tabs/metas/general.php +4 -1
- admin/views/tabs/metas/media.php +1 -0
- admin/views/tabs/metas/post-types.php +1 -1
- admin/views/tabs/metas/rss.php +1 -1
- admin/views/tabs/metas/taxonomies.php +1 -1
- admin/views/tabs/tool/wpseo-import.php +1 -1
- admin/views/tool-bulk-editor.php +52 -6
- admin/views/tool-file-editor.php +7 -6
- css/dist/{admin-global-950-rtl.min.css → admin-global-960-rtl.min.css} +0 -0
- css/dist/{admin-global-950.min.css → admin-global-960.min.css} +0 -0
- css/dist/{adminbar-950-rtl.min.css → adminbar-960-rtl.min.css} +0 -0
- css/dist/{adminbar-950.min.css → adminbar-960.min.css} +0 -0
- css/dist/{alerts-950-rtl.min.css → alerts-960-rtl.min.css} +0 -0
- css/dist/{alerts-950.min.css → alerts-960.min.css} +0 -0
- css/dist/{dashboard-950-rtl.min.css → dashboard-960-rtl.min.css} +0 -0
- css/dist/{dashboard-950.min.css → dashboard-960.min.css} +0 -0
- css/dist/{edit-page-950-rtl.min.css → edit-page-960-rtl.min.css} +0 -0
- css/dist/{edit-page-950.min.css → edit-page-960.min.css} +0 -0
- css/dist/{featured-image-950-rtl.min.css → featured-image-960-rtl.min.css} +0 -0
- css/dist/{featured-image-950.min.css → featured-image-960.min.css} +0 -0
- css/dist/{filter-explanation-950-rtl.min.css → filter-explanation-960-rtl.min.css} +0 -0
- css/dist/{filter-explanation-950.min.css → filter-explanation-960.min.css} +0 -0
- css/dist/{inside-editor-950-rtl.min.css → inside-editor-960-rtl.min.css} +0 -0
- css/dist/{inside-editor-950.min.css → inside-editor-960.min.css} +0 -0
- css/dist/{metabox-950-rtl.min.css → metabox-960-rtl.min.css} +0 -0
- css/dist/{metabox-950.min.css → metabox-960.min.css} +0 -0
- css/dist/{metabox-primary-category-950-rtl.min.css → metabox-primary-category-960-rtl.min.css} +0 -0
- css/dist/{metabox-primary-category-950.min.css → metabox-primary-category-960.min.css} +0 -0
- css/dist/{search-appearance-950-rtl.min.css → search-appearance-960-rtl.min.css} +0 -0
- css/dist/{search-appearance-950.min.css → search-appearance-960.min.css} +0 -0
- css/dist/{structured-data-blocks-950-rtl.min.css → structured-data-blocks-960-rtl.min.css} +0 -0
- css/dist/{structured-data-blocks-950.min.css → structured-data-blocks-960.min.css} +0 -0
- css/dist/{toggle-switch-950-rtl.min.css → toggle-switch-960-rtl.min.css} +0 -0
- css/dist/{toggle-switch-950.min.css → toggle-switch-960.min.css} +0 -0
- css/dist/{wpseo-dismissible-950-rtl.min.css → wpseo-dismissible-960-rtl.min.css} +0 -0
- css/dist/{wpseo-dismissible-950.min.css → wpseo-dismissible-960.min.css} +0 -0
- css/dist/{yoast-components-950-rtl.min.css → yoast-components-960-rtl.min.css} +0 -0
- css/dist/{yoast-components-950.min.css → yoast-components-960.min.css} +0 -0
- css/dist/{yoast-extensions-950-rtl.min.css → yoast-extensions-960-rtl.min.css} +0 -0
- css/dist/{yoast-extensions-950.min.css → yoast-extensions-960.min.css} +0 -0
- css/dist/{yst_plugin_tools-950-rtl.min.css → yst_plugin_tools-960-rtl.min.css} +0 -0
- css/dist/{yst_plugin_tools-950.min.css → yst_plugin_tools-960.min.css} +0 -0
- css/dist/{yst_seo_score-950-rtl.min.css → yst_seo_score-960-rtl.min.css} +0 -0
- css/dist/{yst_seo_score-950.min.css → yst_seo_score-960.min.css} +0 -0
- deprecated/class-recalibration-beta-notification.php +52 -0
- frontend/class-breadcrumbs.php +39 -14
- frontend/class-frontend.php +42 -45
- frontend/class-handle-404.php +92 -0
- frontend/class-json-ld.php +10 -3
- frontend/class-opengraph.php +3 -1
- frontend/class-remove-reply-to-com.php +5 -2
- frontend/class-twitter.php +12 -4
- inc/class-rewrite.php +1 -1
- inc/class-upgrade.php +13 -0
- inc/class-wpseo-admin-bar-menu.php +30 -6
- inc/class-wpseo-meta.php +23 -16
- inc/class-wpseo-utils.php +10 -6
- inc/options/class-wpseo-option-wpseo.php +29 -8
- inc/options/class-wpseo-option.php +38 -16
- inc/options/class-wpseo-options-backfill.php +6 -1
- inc/options/class-wpseo-options.php +17 -5
- inc/sitemaps/class-post-type-sitemap-provider.php +25 -5
- inc/sitemaps/class-sitemap-cache-data.php +10 -2
- inc/sitemaps/class-sitemap-image-parser.php +25 -5
- inc/sitemaps/class-sitemaps-admin.php +4 -1
- inc/sitemaps/class-sitemaps-cache-validator.php +15 -3
- inc/sitemaps/class-sitemaps-cache.php +20 -4
- inc/sitemaps/class-sitemaps-renderer.php +25 -5
- inc/sitemaps/class-sitemaps-router.php +1 -1
- inc/sitemaps/class-sitemaps.php +35 -10
- inc/sitemaps/class-taxonomy-sitemap-provider.php +5 -1
- js/dist/analysis-950.min.js +0 -21
admin/ajax.php
CHANGED
@@ -253,18 +253,19 @@ add_action( 'wp_ajax_wpseo_save_all_descriptions', 'wpseo_save_all_descriptions'
|
|
253 |
function wpseo_save_all( $what ) {
|
254 |
check_ajax_referer( 'wpseo-bulk-editor' );
|
255 |
|
256 |
-
// @todo the WPSEO Utils class can't filter arrays in POST yet.
|
257 |
-
$new_values = $_POST['items'];
|
258 |
-
$original_values = $_POST['existing_items'];
|
259 |
-
|
260 |
$results = array();
|
|
|
|
|
|
|
261 |
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
|
|
267 |
}
|
|
|
268 |
wpseo_ajax_json_echo_die( $results );
|
269 |
}
|
270 |
|
253 |
function wpseo_save_all( $what ) {
|
254 |
check_ajax_referer( 'wpseo-bulk-editor' );
|
255 |
|
|
|
|
|
|
|
|
|
256 |
$results = array();
|
257 |
+
if ( ! isset( $_POST['items'], $_POST['existingItems'] ) ) {
|
258 |
+
wpseo_ajax_json_echo_die( $results );
|
259 |
+
}
|
260 |
|
261 |
+
$new_values = array_map( array( 'WPSEO_Utils', 'sanitize_text_field' ), wp_unslash( (array) $_POST['items'] ) );
|
262 |
+
$original_values = array_map( array( 'WPSEO_Utils', 'sanitize_text_field' ), wp_unslash( (array) $_POST['existingItems'] ) );
|
263 |
+
|
264 |
+
foreach ( $new_values as $post_id => $new_value ) {
|
265 |
+
$original_value = $original_values[ $post_id ];
|
266 |
+
$results[] = wpseo_upsert_new( $what, $post_id, $new_value, $original_value );
|
267 |
}
|
268 |
+
|
269 |
wpseo_ajax_json_echo_die( $results );
|
270 |
}
|
271 |
|
admin/capabilities/class-abstract-capability-manager.php
CHANGED
@@ -9,7 +9,12 @@
|
|
9 |
* Abstract Capability Manager shared code.
|
10 |
*/
|
11 |
abstract class WPSEO_Abstract_Capability_Manager implements WPSEO_Capability_Manager {
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
protected $capabilities = array();
|
14 |
|
15 |
/**
|
9 |
* Abstract Capability Manager shared code.
|
10 |
*/
|
11 |
abstract class WPSEO_Abstract_Capability_Manager implements WPSEO_Capability_Manager {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Registered capabilities.
|
15 |
+
*
|
16 |
+
* @var array
|
17 |
+
*/
|
18 |
protected $capabilities = array();
|
19 |
|
20 |
/**
|
admin/capabilities/class-capability-manager-integration.php
CHANGED
@@ -13,7 +13,11 @@
|
|
13 |
*/
|
14 |
class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integration {
|
15 |
|
16 |
-
/**
|
|
|
|
|
|
|
|
|
17 |
public $manager;
|
18 |
|
19 |
/**
|
13 |
*/
|
14 |
class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integration {
|
15 |
|
16 |
+
/**
|
17 |
+
* Capability manager to use.
|
18 |
+
*
|
19 |
+
* @var WPSEO_Capability_Manager
|
20 |
+
*/
|
21 |
public $manager;
|
22 |
|
23 |
/**
|
admin/class-admin-asset-manager.php
CHANGED
@@ -188,17 +188,51 @@ class WPSEO_Admin_Asset_Manager {
|
|
188 |
|
189 |
$flat_version = $this->flatten_version( WPSEO_VERSION );
|
190 |
|
191 |
-
wp_register_script(
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
|
197 |
wp_register_script(
|
198 |
'wp-element',
|
199 |
plugins_url( 'js/dist/wp-element-' . $flat_version . '.min.js', WPSEO_FILE ),
|
200 |
array( 'lodash', 'wp-polyfill', 'react', 'react-dom' ),
|
201 |
-
|
202 |
true
|
203 |
);
|
204 |
|
@@ -206,7 +240,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
206 |
'wp-api-fetch',
|
207 |
plugins_url( 'js/dist/wp-apiFetch-' . $flat_version . '.min.js', WPSEO_FILE ),
|
208 |
array( 'wp-i18n', 'wp-polyfill' ),
|
209 |
-
|
210 |
true
|
211 |
);
|
212 |
|
@@ -214,7 +248,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
214 |
'wp-components',
|
215 |
plugins_url( 'js/dist/wp-components-' . $flat_version . '.min.js', WPSEO_FILE ),
|
216 |
array( 'lodash', 'wp-api-fetch', 'wp-i18n', 'wp-polyfill', 'wp-compose' ),
|
217 |
-
|
218 |
true
|
219 |
);
|
220 |
|
@@ -222,7 +256,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
222 |
'wp-data',
|
223 |
plugins_url( 'js/dist/wp-data-' . $flat_version . '.min.js', WPSEO_FILE ),
|
224 |
array( 'lodash', 'wp-element', 'wp-polyfill', 'wp-compose' ),
|
225 |
-
|
226 |
true
|
227 |
);
|
228 |
|
@@ -230,7 +264,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
230 |
'wp-i18n',
|
231 |
plugins_url( 'js/dist/wp-i18n-' . $flat_version . '.min.js', WPSEO_FILE ),
|
232 |
array( 'wp-polyfill' ),
|
233 |
-
|
234 |
true
|
235 |
);
|
236 |
|
@@ -238,7 +272,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
238 |
'wp-rich-text',
|
239 |
plugins_url( 'js/dist/wp-rich-text-' . $flat_version . '.min.js', WPSEO_FILE ),
|
240 |
array( 'lodash', 'wp-polyfill', 'wp-data' ),
|
241 |
-
|
242 |
true
|
243 |
);
|
244 |
|
@@ -246,7 +280,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
246 |
'wp-compose',
|
247 |
plugins_url( 'js/dist/wp-compose-' . $flat_version . '.min.js', WPSEO_FILE ),
|
248 |
array( 'lodash', 'wp-polyfill' ),
|
249 |
-
|
250 |
true
|
251 |
);
|
252 |
|
@@ -254,11 +288,14 @@ class WPSEO_Admin_Asset_Manager {
|
|
254 |
* wp-annotations only exists from Gutenberg 4.3 and onwards, so we register a no-op in earlier versions.
|
255 |
* The no-op achieves that our scripts that depend on this are actually loaded. Because WordPress doesn't
|
256 |
* load a script if any of the dependencies are missing.
|
|
|
|
|
257 |
*/
|
258 |
wp_register_script(
|
259 |
'wp-annotations',
|
260 |
null
|
261 |
);
|
|
|
262 |
}
|
263 |
|
264 |
/**
|
@@ -393,6 +430,10 @@ class WPSEO_Admin_Asset_Manager {
|
|
393 |
'name' => 'admin-gsc',
|
394 |
'src' => 'wp-seo-admin-gsc-' . $flat_version,
|
395 |
'deps' => array(
|
|
|
|
|
|
|
|
|
396 |
self::PREFIX . 'commons',
|
397 |
),
|
398 |
'in_footer' => false,
|
188 |
|
189 |
$flat_version = $this->flatten_version( WPSEO_VERSION );
|
190 |
|
191 |
+
wp_register_script(
|
192 |
+
'react',
|
193 |
+
plugins_url( 'js/vendor/react.min.js', WPSEO_FILE ),
|
194 |
+
array(),
|
195 |
+
'v16.6.1',
|
196 |
+
true
|
197 |
+
);
|
198 |
+
|
199 |
+
wp_register_script(
|
200 |
+
'react-dom',
|
201 |
+
plugins_url( 'js/vendor/react-dom.min.js', WPSEO_FILE ),
|
202 |
+
array( 'react' ),
|
203 |
+
'v16.6.1',
|
204 |
+
true
|
205 |
+
);
|
206 |
+
|
207 |
+
wp_register_script(
|
208 |
+
'lodash-base',
|
209 |
+
plugins_url( 'js/vendor/lodash.min.js', WPSEO_FILE ),
|
210 |
+
array(),
|
211 |
+
'4.17.5',
|
212 |
+
true
|
213 |
+
);
|
214 |
+
|
215 |
+
wp_register_script(
|
216 |
+
'lodash',
|
217 |
+
plugins_url( 'js/vendor/lodash-noconflict.js', WPSEO_FILE ),
|
218 |
+
array( 'lodash-base' ),
|
219 |
+
WPSEO_VERSION,
|
220 |
+
true
|
221 |
+
);
|
222 |
+
|
223 |
+
wp_register_script(
|
224 |
+
'wp-polyfill',
|
225 |
+
plugins_url( 'js/dist/babel-polyfill-' . $flat_version . '.min.js', WPSEO_FILE ),
|
226 |
+
array(),
|
227 |
+
WPSEO_VERSION,
|
228 |
+
true
|
229 |
+
);
|
230 |
|
231 |
wp_register_script(
|
232 |
'wp-element',
|
233 |
plugins_url( 'js/dist/wp-element-' . $flat_version . '.min.js', WPSEO_FILE ),
|
234 |
array( 'lodash', 'wp-polyfill', 'react', 'react-dom' ),
|
235 |
+
WPSEO_VERSION,
|
236 |
true
|
237 |
);
|
238 |
|
240 |
'wp-api-fetch',
|
241 |
plugins_url( 'js/dist/wp-apiFetch-' . $flat_version . '.min.js', WPSEO_FILE ),
|
242 |
array( 'wp-i18n', 'wp-polyfill' ),
|
243 |
+
WPSEO_VERSION,
|
244 |
true
|
245 |
);
|
246 |
|
248 |
'wp-components',
|
249 |
plugins_url( 'js/dist/wp-components-' . $flat_version . '.min.js', WPSEO_FILE ),
|
250 |
array( 'lodash', 'wp-api-fetch', 'wp-i18n', 'wp-polyfill', 'wp-compose' ),
|
251 |
+
WPSEO_VERSION,
|
252 |
true
|
253 |
);
|
254 |
|
256 |
'wp-data',
|
257 |
plugins_url( 'js/dist/wp-data-' . $flat_version . '.min.js', WPSEO_FILE ),
|
258 |
array( 'lodash', 'wp-element', 'wp-polyfill', 'wp-compose' ),
|
259 |
+
WPSEO_VERSION,
|
260 |
true
|
261 |
);
|
262 |
|
264 |
'wp-i18n',
|
265 |
plugins_url( 'js/dist/wp-i18n-' . $flat_version . '.min.js', WPSEO_FILE ),
|
266 |
array( 'wp-polyfill' ),
|
267 |
+
WPSEO_VERSION,
|
268 |
true
|
269 |
);
|
270 |
|
272 |
'wp-rich-text',
|
273 |
plugins_url( 'js/dist/wp-rich-text-' . $flat_version . '.min.js', WPSEO_FILE ),
|
274 |
array( 'lodash', 'wp-polyfill', 'wp-data' ),
|
275 |
+
WPSEO_VERSION,
|
276 |
true
|
277 |
);
|
278 |
|
280 |
'wp-compose',
|
281 |
plugins_url( 'js/dist/wp-compose-' . $flat_version . '.min.js', WPSEO_FILE ),
|
282 |
array( 'lodash', 'wp-polyfill' ),
|
283 |
+
WPSEO_VERSION,
|
284 |
true
|
285 |
);
|
286 |
|
288 |
* wp-annotations only exists from Gutenberg 4.3 and onwards, so we register a no-op in earlier versions.
|
289 |
* The no-op achieves that our scripts that depend on this are actually loaded. Because WordPress doesn't
|
290 |
* load a script if any of the dependencies are missing.
|
291 |
+
*
|
292 |
+
* @phpcs:disable WordPress.WP.EnqueuedResourceParameters -- The no-op does not require these settings.
|
293 |
*/
|
294 |
wp_register_script(
|
295 |
'wp-annotations',
|
296 |
null
|
297 |
);
|
298 |
+
// phpcs:enable -- End of disable.
|
299 |
}
|
300 |
|
301 |
/**
|
430 |
'name' => 'admin-gsc',
|
431 |
'src' => 'wp-seo-admin-gsc-' . $flat_version,
|
432 |
'deps' => array(
|
433 |
+
'wp-element',
|
434 |
+
'wp-i18n',
|
435 |
+
self::PREFIX . 'styled-components',
|
436 |
+
self::PREFIX . 'components',
|
437 |
self::PREFIX . 'commons',
|
438 |
),
|
439 |
'in_footer' => false,
|
admin/class-admin.php
CHANGED
@@ -10,7 +10,13 @@
|
|
10 |
*/
|
11 |
class WPSEO_Admin {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
const PAGE_IDENTIFIER = 'wpseo_dashboard';
|
15 |
|
16 |
/**
|
@@ -106,6 +112,7 @@ class WPSEO_Admin {
|
|
106 |
$integrations[] = new WPSEO_Admin_Gutenberg_Compatibility_Notification();
|
107 |
$integrations[] = new WPSEO_Expose_Shortlinks();
|
108 |
$integrations[] = new WPSEO_Recalibration_Beta();
|
|
|
109 |
$integrations = array_merge( $integrations, $this->initialize_seo_links(), $this->initialize_cornerstone_content() );
|
110 |
|
111 |
/** @var WPSEO_WordPress_Integration $integration */
|
10 |
*/
|
11 |
class WPSEO_Admin {
|
12 |
|
13 |
+
/**
|
14 |
+
* The page identifier used in WordPress to register the admin page.
|
15 |
+
*
|
16 |
+
* !DO NOT CHANGE THIS!
|
17 |
+
*
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
const PAGE_IDENTIFIER = 'wpseo_dashboard';
|
21 |
|
22 |
/**
|
112 |
$integrations[] = new WPSEO_Admin_Gutenberg_Compatibility_Notification();
|
113 |
$integrations[] = new WPSEO_Expose_Shortlinks();
|
114 |
$integrations[] = new WPSEO_Recalibration_Beta();
|
115 |
+
$integrations[] = $this->admin_features['google_search_console'];
|
116 |
$integrations = array_merge( $integrations, $this->initialize_seo_links(), $this->initialize_cornerstone_content() );
|
117 |
|
118 |
/** @var WPSEO_WordPress_Integration $integration */
|
admin/class-asset.php
CHANGED
@@ -10,19 +10,53 @@
|
|
10 |
*/
|
11 |
class WPSEO_Admin_Asset {
|
12 |
|
|
|
|
|
|
|
13 |
const TYPE_JS = 'js';
|
|
|
|
|
|
|
|
|
14 |
const TYPE_CSS = 'css';
|
15 |
|
|
|
|
|
|
|
16 |
const NAME = 'name';
|
|
|
|
|
|
|
|
|
17 |
const SRC = 'src';
|
|
|
|
|
|
|
|
|
18 |
const DEPS = 'deps';
|
|
|
|
|
|
|
|
|
19 |
const VERSION = 'version';
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
22 |
const MEDIA = 'media';
|
|
|
|
|
|
|
|
|
23 |
const RTL = 'rtl';
|
24 |
|
25 |
-
|
|
|
|
|
|
|
|
|
26 |
const IN_FOOTER = 'in_footer';
|
27 |
|
28 |
/**
|
10 |
*/
|
11 |
class WPSEO_Admin_Asset {
|
12 |
|
13 |
+
/**
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
const TYPE_JS = 'js';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
const TYPE_CSS = 'css';
|
22 |
|
23 |
+
/**
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
const NAME = 'name';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
const SRC = 'src';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
const DEPS = 'deps';
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var string
|
40 |
+
*/
|
41 |
const VERSION = 'version';
|
42 |
|
43 |
+
/* Style specific. */
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @var string
|
47 |
+
*/
|
48 |
const MEDIA = 'media';
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @var string
|
52 |
+
*/
|
53 |
const RTL = 'rtl';
|
54 |
|
55 |
+
/* Script specific. */
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @var string
|
59 |
+
*/
|
60 |
const IN_FOOTER = 'in_footer';
|
61 |
|
62 |
/**
|
admin/class-bulk-editor-list-table.php
CHANGED
@@ -44,7 +44,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
44 |
*
|
45 |
* @var string
|
46 |
*/
|
47 |
-
private $request_url;
|
48 |
|
49 |
/**
|
50 |
* The current page (depending on $_GET['paged']) if current tab is for current page_type, else it will be 1
|
@@ -101,67 +101,46 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
101 |
*/
|
102 |
protected $pagination = array();
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
/**
|
105 |
* Class constructor
|
|
|
|
|
106 |
*/
|
107 |
-
public function __construct() {
|
108 |
parent::__construct( $this->settings );
|
109 |
|
110 |
-
$
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
'orderby' => ( ! empty( $_GET['orderby'] ) ) ? $_GET['orderby'] : 'post_title',
|
117 |
);
|
118 |
|
119 |
-
$this->
|
120 |
-
|
121 |
-
|
122 |
-
$this->page_url = "&nonce={$this->nonce}&type={$this->page_type}#top#{$this->page_type}";
|
123 |
-
|
124 |
-
$this->populate_editable_post_types();
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Verifies nonce if additional parameters have been sent.
|
129 |
-
*
|
130 |
-
* Shows an error notification if the nonce check fails.
|
131 |
-
*/
|
132 |
-
private function verify_nonce() {
|
133 |
-
if ( $this->should_verify_nonce() && ! wp_verify_nonce( filter_input( INPUT_GET, 'nonce' ), 'bulk-editor-table' ) ) {
|
134 |
-
Yoast_Notification_Center::get()->add_notification(
|
135 |
-
new Yoast_Notification(
|
136 |
-
__( 'You are not allowed to access this page.', 'wordpress-seo' ),
|
137 |
-
array( 'type' => Yoast_Notification::ERROR )
|
138 |
-
)
|
139 |
-
);
|
140 |
-
Yoast_Notification_Center::get()->display_notifications();
|
141 |
-
die;
|
142 |
}
|
143 |
-
}
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
$possible_params = array(
|
152 |
-
'type',
|
153 |
-
'paged',
|
154 |
-
'post_type_filter',
|
155 |
-
'post_status',
|
156 |
-
'order',
|
157 |
-
'orderby',
|
158 |
);
|
159 |
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
}
|
165 |
}
|
166 |
|
167 |
/**
|
@@ -458,7 +437,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
458 |
$current_order = $this->current_order;
|
459 |
|
460 |
// If current type doesn't compare with objects page_type, than we have to unset some vars in the requested url (which will be use for internal table urls).
|
461 |
-
if ( $
|
462 |
$request_url = remove_query_arg( 'paged', $request_url ); // Page will be set with value 1 below.
|
463 |
$request_url = remove_query_arg( 'post_type_filter', $request_url );
|
464 |
$request_url = remove_query_arg( 'post_status', $request_url );
|
@@ -699,8 +678,8 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
699 |
$states = get_post_stati( array( 'show_in_admin_all_list' => true ) );
|
700 |
$states['trash'] = 'trash';
|
701 |
|
702 |
-
if ( ! empty( $
|
703 |
-
$requested_state =
|
704 |
if ( in_array( $requested_state, $states, true ) ) {
|
705 |
$states = array( $requested_state );
|
706 |
}
|
44 |
*
|
45 |
* @var string
|
46 |
*/
|
47 |
+
private $request_url = '';
|
48 |
|
49 |
/**
|
50 |
* The current page (depending on $_GET['paged']) if current tab is for current page_type, else it will be 1
|
101 |
*/
|
102 |
protected $pagination = array();
|
103 |
|
104 |
+
/**
|
105 |
+
* Holds the sanitized data from the user input.
|
106 |
+
*
|
107 |
+
* @var array
|
108 |
+
*/
|
109 |
+
protected $input_fields = array();
|
110 |
+
|
111 |
/**
|
112 |
* Class constructor
|
113 |
+
*
|
114 |
+
* @param array $args The arguments.
|
115 |
*/
|
116 |
+
public function __construct( $args = array() ) {
|
117 |
parent::__construct( $this->settings );
|
118 |
|
119 |
+
$args = wp_parse_args(
|
120 |
+
$args,
|
121 |
+
array(
|
122 |
+
'nonce' => '',
|
123 |
+
'input_fields' => array(),
|
124 |
+
)
|
|
|
125 |
);
|
126 |
|
127 |
+
$this->input_fields = $args['input_fields'];
|
128 |
+
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
|
129 |
+
$this->request_url = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
}
|
|
|
131 |
|
132 |
+
$this->current_page = ( ! empty( $this->input_fields['paged'] ) ) ? $this->input_fields['paged'] : 1;
|
133 |
+
$this->current_filter = ( ! empty( $this->input_fields['post_type_filter'] ) ) ? $this->input_fields['post_type_filter'] : 1;
|
134 |
+
$this->current_status = ( ! empty( $this->input_fields['post_status'] ) ) ? $this->input_fields['post_status'] : 1;
|
135 |
+
$this->current_order = array(
|
136 |
+
'order' => ( ! empty( $this->input_fields['order'] ) ) ? $this->input_fields['order'] : 'asc',
|
137 |
+
'orderby' => ( ! empty( $this->input_fields['orderby'] ) ) ? $this->input_fields['orderby'] : 'post_title',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
);
|
139 |
|
140 |
+
$this->nonce = $args['nonce'];
|
141 |
+
$this->page_url = "&nonce={$this->nonce}&type={$this->page_type}#top#{$this->page_type}";
|
142 |
+
|
143 |
+
$this->populate_editable_post_types();
|
|
|
144 |
}
|
145 |
|
146 |
/**
|
437 |
$current_order = $this->current_order;
|
438 |
|
439 |
// If current type doesn't compare with objects page_type, than we have to unset some vars in the requested url (which will be use for internal table urls).
|
440 |
+
if ( isset( $this->input_fields['type'] ) && $this->input_fields['type'] !== $this->page_type ) {
|
441 |
$request_url = remove_query_arg( 'paged', $request_url ); // Page will be set with value 1 below.
|
442 |
$request_url = remove_query_arg( 'post_type_filter', $request_url );
|
443 |
$request_url = remove_query_arg( 'post_status', $request_url );
|
678 |
$states = get_post_stati( array( 'show_in_admin_all_list' => true ) );
|
679 |
$states['trash'] = 'trash';
|
680 |
|
681 |
+
if ( ! empty( $this->input_fields['post_status'] ) ) {
|
682 |
+
$requested_state = $this->input_fields['post_status'];
|
683 |
if ( in_array( $requested_state, $states, true ) ) {
|
684 |
$states = array( $requested_state );
|
685 |
}
|
admin/class-collector.php
CHANGED
@@ -10,7 +10,9 @@
|
|
10 |
*/
|
11 |
class WPSEO_Collector {
|
12 |
|
13 |
-
/**
|
|
|
|
|
14 |
protected $collections = array();
|
15 |
|
16 |
/**
|
10 |
*/
|
11 |
class WPSEO_Collector {
|
12 |
|
13 |
+
/**
|
14 |
+
* @var WPSEO_Collection[]
|
15 |
+
*/
|
16 |
protected $collections = array();
|
17 |
|
18 |
/**
|
admin/class-database-proxy.php
CHANGED
@@ -10,19 +10,29 @@
|
|
10 |
*/
|
11 |
class WPSEO_Database_Proxy {
|
12 |
|
13 |
-
/**
|
|
|
|
|
14 |
protected $table_name;
|
15 |
|
16 |
-
/**
|
|
|
|
|
17 |
protected $suppress_errors = true;
|
18 |
|
19 |
-
/**
|
|
|
|
|
20 |
protected $is_multisite_table = false;
|
21 |
|
22 |
-
/**
|
|
|
|
|
23 |
protected $last_suppressed_state;
|
24 |
|
25 |
-
/**
|
|
|
|
|
26 |
protected $database;
|
27 |
|
28 |
/**
|
10 |
*/
|
11 |
class WPSEO_Database_Proxy {
|
12 |
|
13 |
+
/**
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
protected $table_name;
|
17 |
|
18 |
+
/**
|
19 |
+
* @var bool
|
20 |
+
*/
|
21 |
protected $suppress_errors = true;
|
22 |
|
23 |
+
/**
|
24 |
+
* @var bool
|
25 |
+
*/
|
26 |
protected $is_multisite_table = false;
|
27 |
|
28 |
+
/**
|
29 |
+
* @var bool
|
30 |
+
*/
|
31 |
protected $last_suppressed_state;
|
32 |
|
33 |
+
/**
|
34 |
+
* @var wpdb
|
35 |
+
*/
|
36 |
protected $database;
|
37 |
|
38 |
/**
|
admin/class-export.php
CHANGED
@@ -47,8 +47,17 @@ class WPSEO_Export {
|
|
47 |
}
|
48 |
|
49 |
echo '<p>';
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
echo '</p>';
|
53 |
echo '<textarea id="wpseo-export" rows="20" cols="100">' . $this->export . '</textarea>';
|
54 |
}
|
@@ -130,7 +139,7 @@ class WPSEO_Export {
|
|
130 |
foreach ( $options as $key => $elem ) {
|
131 |
if ( is_array( $elem ) ) {
|
132 |
$count = count( $elem );
|
133 |
-
for ( $i = 0; $i < $count; $i
|
134 |
$this->write_setting( $key . '[]', $elem[ $i ] );
|
135 |
}
|
136 |
}
|
47 |
}
|
48 |
|
49 |
echo '<p>';
|
50 |
+
printf(
|
51 |
+
/* translators: %1$s expands to Import settings */
|
52 |
+
esc_html__(
|
53 |
+
'Copy all these settings to another site\'s %1$s tab and click "%1$s" there.',
|
54 |
+
'wordpress-seo'
|
55 |
+
),
|
56 |
+
esc_html__(
|
57 |
+
'Import settings',
|
58 |
+
'wordpress-seo'
|
59 |
+
)
|
60 |
+
);
|
61 |
echo '</p>';
|
62 |
echo '<textarea id="wpseo-export" rows="20" cols="100">' . $this->export . '</textarea>';
|
63 |
}
|
139 |
foreach ( $options as $key => $elem ) {
|
140 |
if ( is_array( $elem ) ) {
|
141 |
$count = count( $elem );
|
142 |
+
for ( $i = 0; $i < $count; $i++ ) {
|
143 |
$this->write_setting( $key . '[]', $elem[ $i ] );
|
144 |
}
|
145 |
}
|
admin/class-expose-shortlinks.php
CHANGED
@@ -30,6 +30,7 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
|
|
30 |
'shortlinks.upsell.metabox.focus_keyword_additional_button' => 'https://yoa.st/add-keywords-popup',
|
31 |
'shortlinks.upsell.metabox.additional_link' => 'https://yoa.st/textlink-keywords-metabox',
|
32 |
'shortlinks.upsell.metabox.additional_button' => 'https://yoa.st/add-keywords-metabox',
|
|
|
33 |
'shortlinks.readability_analysis_info' => 'https://yoa.st/readability-analysis',
|
34 |
'shortlinks.activate_premium_info' => 'https://yoa.st/activate-subscription',
|
35 |
'shortlinks.recalibration_beta_metabox' => 'https://yoa.st/recalibration-beta-metabox',
|
@@ -54,7 +55,7 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
|
|
54 |
* @return array The passed array with the additional shortlinks.
|
55 |
*/
|
56 |
public function expose_shortlinks( $input ) {
|
57 |
-
foreach ( $this->
|
58 |
$input[ $key ] = WPSEO_Shortlinker::get( $shortlink );
|
59 |
}
|
60 |
|
@@ -62,4 +63,38 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
|
|
62 |
|
63 |
return $input;
|
64 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
30 |
'shortlinks.upsell.metabox.focus_keyword_additional_button' => 'https://yoa.st/add-keywords-popup',
|
31 |
'shortlinks.upsell.metabox.additional_link' => 'https://yoa.st/textlink-keywords-metabox',
|
32 |
'shortlinks.upsell.metabox.additional_button' => 'https://yoa.st/add-keywords-metabox',
|
33 |
+
'shortlinks.upsell.gsc.create_redirect_button' => 'https://yoa.st/redirects',
|
34 |
'shortlinks.readability_analysis_info' => 'https://yoa.st/readability-analysis',
|
35 |
'shortlinks.activate_premium_info' => 'https://yoa.st/activate-subscription',
|
36 |
'shortlinks.recalibration_beta_metabox' => 'https://yoa.st/recalibration-beta-metabox',
|
55 |
* @return array The passed array with the additional shortlinks.
|
56 |
*/
|
57 |
public function expose_shortlinks( $input ) {
|
58 |
+
foreach ( $this->get_shortlinks() as $key => $shortlink ) {
|
59 |
$input[ $key ] = WPSEO_Shortlinker::get( $shortlink );
|
60 |
}
|
61 |
|
63 |
|
64 |
return $input;
|
65 |
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Retrieves the shortlinks.
|
69 |
+
*
|
70 |
+
* @return array The shortlinks.
|
71 |
+
*/
|
72 |
+
private function get_shortlinks() {
|
73 |
+
if ( ! $this->is_term_edit() ) {
|
74 |
+
return $this->shortlinks;
|
75 |
+
}
|
76 |
+
|
77 |
+
$shortlinks = $this->shortlinks;
|
78 |
+
|
79 |
+
$shortlinks['shortlinks.upsell.metabox.focus_keyword_synonyms_link'] = 'https://yoa.st/textlink-synonyms-popup-metabox-term';
|
80 |
+
$shortlinks['shortlinks.upsell.metabox.focus_keyword_synonyms_button'] = 'https://yoa.st/keyword-synonyms-popup-term';
|
81 |
+
$shortlinks['shortlinks.upsell.metabox.focus_keyword_additional_link'] = 'https://yoa.st/textlink-keywords-popup-metabox-term';
|
82 |
+
$shortlinks['shortlinks.upsell.metabox.focus_keyword_additional_button'] = 'https://yoa.st/add-keywords-popup-term';
|
83 |
+
$shortlinks['shortlinks.upsell.metabox.additional_link'] = 'https://yoa.st/textlink-keywords-metabox-term';
|
84 |
+
$shortlinks['shortlinks.upsell.metabox.additional_button'] = 'https://yoa.st/add-keywords-metabox-term';
|
85 |
+
$shortlinks['shortlinks.upsell.sidebar.morphology_upsell_metabox'] = 'https://yoa.st/morphology-upsell-metabox-term';
|
86 |
+
|
87 |
+
return $shortlinks;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Checks if the current page is a term edit page.
|
92 |
+
*
|
93 |
+
* @return bool True when page is term edit.
|
94 |
+
*/
|
95 |
+
private function is_term_edit() {
|
96 |
+
global $pagenow;
|
97 |
+
|
98 |
+
return WPSEO_Taxonomy::is_term_edit( $pagenow );
|
99 |
+
}
|
100 |
}
|
admin/class-extension-manager.php
CHANGED
@@ -10,14 +10,24 @@
|
|
10 |
*/
|
11 |
class WPSEO_Extension_Manager {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
const TRANSIENT_CACHE_KEY = 'wpseo_license_active_extensions';
|
15 |
|
16 |
-
/**
|
|
|
|
|
17 |
protected $extensions = array();
|
18 |
|
19 |
-
/**
|
20 |
-
|
|
|
|
|
|
|
|
|
21 |
|
22 |
/**
|
23 |
* Adds an extension to the manager.
|
10 |
*/
|
11 |
class WPSEO_Extension_Manager {
|
12 |
|
13 |
+
/**
|
14 |
+
* The transient key to save the cache in.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
const TRANSIENT_CACHE_KEY = 'wpseo_license_active_extensions';
|
19 |
|
20 |
+
/**
|
21 |
+
* @var WPSEO_Extension[]
|
22 |
+
*/
|
23 |
protected $extensions = array();
|
24 |
|
25 |
+
/**
|
26 |
+
* List of active plugins.
|
27 |
+
*
|
28 |
+
* @var array
|
29 |
+
*/
|
30 |
+
protected static $active_extensions;
|
31 |
|
32 |
/**
|
33 |
* Adds an extension to the manager.
|
admin/class-extensions.php
CHANGED
@@ -10,7 +10,11 @@
|
|
10 |
*/
|
11 |
class WPSEO_Extensions {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
protected $extensions = array(
|
15 |
'Yoast SEO Premium' => array(
|
16 |
'slug' => 'yoast-seo-premium',
|
10 |
*/
|
11 |
class WPSEO_Extensions {
|
12 |
|
13 |
+
/**
|
14 |
+
* Array with the Yoast extensions.
|
15 |
+
*
|
16 |
+
* @var array
|
17 |
+
*/
|
18 |
protected $extensions = array(
|
19 |
'Yoast SEO Premium' => array(
|
20 |
'slug' => 'yoast-seo-premium',
|
admin/class-gutenberg-compatibility.php
CHANGED
@@ -13,12 +13,12 @@ class WPSEO_Gutenberg_Compatibility {
|
|
13 |
/**
|
14 |
* The currently released version of Gutenberg.
|
15 |
*/
|
16 |
-
const CURRENT_RELEASE = '
|
17 |
|
18 |
/**
|
19 |
* The minimally supported version of Gutenberg by the plugin.
|
20 |
*/
|
21 |
-
const MINIMUM_SUPPORTED = '
|
22 |
|
23 |
/**
|
24 |
* @var string
|
13 |
/**
|
14 |
* The currently released version of Gutenberg.
|
15 |
*/
|
16 |
+
const CURRENT_RELEASE = '5.0.0';
|
17 |
|
18 |
/**
|
19 |
* The minimally supported version of Gutenberg by the plugin.
|
20 |
*/
|
21 |
+
const MINIMUM_SUPPORTED = '5.0.0';
|
22 |
|
23 |
/**
|
24 |
* @var string
|
admin/class-help-center-item.php
CHANGED
@@ -10,16 +10,32 @@
|
|
10 |
*/
|
11 |
class WPSEO_Help_Center_Item {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
private $identifier;
|
15 |
|
16 |
-
/**
|
|
|
|
|
|
|
|
|
17 |
private $label;
|
18 |
|
19 |
-
/**
|
|
|
|
|
|
|
|
|
20 |
private $dashicon;
|
21 |
|
22 |
-
/**
|
|
|
|
|
|
|
|
|
23 |
private $args = array();
|
24 |
|
25 |
/**
|
10 |
*/
|
11 |
class WPSEO_Help_Center_Item {
|
12 |
|
13 |
+
/**
|
14 |
+
* Identifier for this tab.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
private $identifier;
|
19 |
|
20 |
+
/**
|
21 |
+
* Label to display.
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
private $label;
|
26 |
|
27 |
+
/**
|
28 |
+
* The dashicon classname to display in front of the label.
|
29 |
+
*
|
30 |
+
* @var string
|
31 |
+
*/
|
32 |
private $dashicon;
|
33 |
|
34 |
+
/**
|
35 |
+
* Optional arguments.
|
36 |
+
*
|
37 |
+
* @var array
|
38 |
+
*/
|
39 |
private $args = array();
|
40 |
|
41 |
/**
|
admin/class-help-center.php
CHANGED
@@ -9,6 +9,7 @@
|
|
9 |
* Class WPSEO_Help_Center
|
10 |
*/
|
11 |
class WPSEO_Help_Center {
|
|
|
12 |
/**
|
13 |
* The tabs in the help center.
|
14 |
*
|
9 |
* Class WPSEO_Help_Center
|
10 |
*/
|
11 |
class WPSEO_Help_Center {
|
12 |
+
|
13 |
/**
|
14 |
* The tabs in the help center.
|
15 |
*
|
admin/class-meta-storage.php
CHANGED
@@ -12,10 +12,16 @@ class WPSEO_Meta_Storage implements WPSEO_Installable {
|
|
12 |
|
13 |
const TABLE_NAME = 'yoast_seo_meta';
|
14 |
|
15 |
-
/**
|
|
|
|
|
16 |
protected $database_proxy;
|
17 |
|
18 |
-
/**
|
|
|
|
|
|
|
|
|
19 |
protected $table_prefix;
|
20 |
|
21 |
/**
|
12 |
|
13 |
const TABLE_NAME = 'yoast_seo_meta';
|
14 |
|
15 |
+
/**
|
16 |
+
* @var WPSEO_Database_Proxy
|
17 |
+
*/
|
18 |
protected $database_proxy;
|
19 |
|
20 |
+
/**
|
21 |
+
* @deprecated
|
22 |
+
*
|
23 |
+
* @var null|string
|
24 |
+
*/
|
25 |
protected $table_prefix;
|
26 |
|
27 |
/**
|
admin/class-option-tab.php
CHANGED
@@ -10,13 +10,25 @@
|
|
10 |
*/
|
11 |
class WPSEO_Option_Tab {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
private $name;
|
15 |
|
16 |
-
/**
|
|
|
|
|
|
|
|
|
17 |
private $label;
|
18 |
|
19 |
-
/**
|
|
|
|
|
|
|
|
|
20 |
private $arguments;
|
21 |
|
22 |
/**
|
10 |
*/
|
11 |
class WPSEO_Option_Tab {
|
12 |
|
13 |
+
/**
|
14 |
+
* Name of the tab.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
private $name;
|
19 |
|
20 |
+
/**
|
21 |
+
* Label of the tab.
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
private $label;
|
26 |
|
27 |
+
/**
|
28 |
+
* Optional arguments.
|
29 |
+
*
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
private $arguments;
|
33 |
|
34 |
/**
|
admin/class-option-tabs.php
CHANGED
@@ -10,13 +10,25 @@
|
|
10 |
*/
|
11 |
class WPSEO_Option_Tabs {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
private $base;
|
15 |
|
16 |
-
/**
|
|
|
|
|
|
|
|
|
17 |
private $tabs = array();
|
18 |
|
19 |
-
/**
|
|
|
|
|
|
|
|
|
20 |
private $active_tab = '';
|
21 |
|
22 |
/**
|
10 |
*/
|
11 |
class WPSEO_Option_Tabs {
|
12 |
|
13 |
+
/**
|
14 |
+
* Tabs base.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
private $base;
|
19 |
|
20 |
+
/**
|
21 |
+
* The tabs in this group.
|
22 |
+
*
|
23 |
+
* @var array
|
24 |
+
*/
|
25 |
private $tabs = array();
|
26 |
|
27 |
+
/**
|
28 |
+
* Name of the active tab.
|
29 |
+
*
|
30 |
+
* @var string
|
31 |
+
*/
|
32 |
private $active_tab = '';
|
33 |
|
34 |
/**
|
admin/class-paper-presenter.php
CHANGED
@@ -9,6 +9,7 @@
|
|
9 |
* Class WPSEO_presenter_paper
|
10 |
*/
|
11 |
class WPSEO_Paper_Presenter {
|
|
|
12 |
/**
|
13 |
* @var string Title of the paper
|
14 |
*/
|
9 |
* Class WPSEO_presenter_paper
|
10 |
*/
|
11 |
class WPSEO_Paper_Presenter {
|
12 |
+
|
13 |
/**
|
14 |
* @var string Title of the paper
|
15 |
*/
|
admin/class-premium-popup.php
CHANGED
@@ -9,6 +9,7 @@
|
|
9 |
* Class WPSEO_Premium_popup
|
10 |
*/
|
11 |
class WPSEO_Premium_Popup {
|
|
|
12 |
/**
|
13 |
* An unique identifier for the popup
|
14 |
*
|
9 |
* Class WPSEO_Premium_popup
|
10 |
*/
|
11 |
class WPSEO_Premium_Popup {
|
12 |
+
|
13 |
/**
|
14 |
* An unique identifier for the popup
|
15 |
*
|
admin/class-premium-upsell-admin-block.php
CHANGED
@@ -9,10 +9,19 @@
|
|
9 |
* Class WPSEO_Premium_Upsell_Admin_Block
|
10 |
*/
|
11 |
class WPSEO_Premium_Upsell_Admin_Block {
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
protected $hook;
|
14 |
|
15 |
-
/**
|
|
|
|
|
|
|
|
|
16 |
protected $identifier = 'premium_upsell_admin_block';
|
17 |
|
18 |
/**
|
9 |
* Class WPSEO_Premium_Upsell_Admin_Block
|
10 |
*/
|
11 |
class WPSEO_Premium_Upsell_Admin_Block {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Hook to display the block on.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
protected $hook;
|
19 |
|
20 |
+
/**
|
21 |
+
* Identifier to use in the dismissal functionality.
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
protected $identifier = 'premium_upsell_admin_block';
|
26 |
|
27 |
/**
|
admin/class-product-upsell-notice.php
CHANGED
@@ -14,7 +14,9 @@ class WPSEO_Product_Upsell_Notice {
|
|
14 |
|
15 |
const OPTION_NAME = 'wpseo';
|
16 |
|
17 |
-
/**
|
|
|
|
|
18 |
protected $options;
|
19 |
|
20 |
/**
|
14 |
|
15 |
const OPTION_NAME = 'wpseo';
|
16 |
|
17 |
+
/**
|
18 |
+
* @var array
|
19 |
+
*/
|
20 |
protected $options;
|
21 |
|
22 |
/**
|
admin/class-recalibration-beta.php
CHANGED
@@ -29,6 +29,12 @@ class WPSEO_Recalibration_Beta implements WPSEO_WordPress_Integration {
|
|
29 |
* @return void
|
30 |
*/
|
31 |
public function show_feature_toggle() {
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
$values = array(
|
33 |
'on' => __( 'On', 'wordpress-seo' ),
|
34 |
'off' => __( 'Off', 'wordpress-seo' ),
|
@@ -36,7 +42,7 @@ class WPSEO_Recalibration_Beta implements WPSEO_WordPress_Integration {
|
|
36 |
|
37 |
echo '<div class="switch-container">';
|
38 |
echo '<fieldset id="', esc_attr( $this->option_name ), '" class="fieldset-switch-toggle">';
|
39 |
-
echo '<legend><strong>',
|
40 |
echo '<p class="clear">';
|
41 |
printf(
|
42 |
/* translators: 1: link opening tag, 2: link closing tag, 3: strong opening tag, 4: strong closing tag */
|
@@ -83,9 +89,6 @@ class WPSEO_Recalibration_Beta implements WPSEO_WordPress_Integration {
|
|
83 |
*/
|
84 |
public function register_hooks() {
|
85 |
add_action( 'update_option_wpseo', array( $this, 'update_option' ), 10, 2 );
|
86 |
-
|
87 |
-
$notification = new WPSEO_Recalibration_Beta_Notification();
|
88 |
-
$notification->register_hooks();
|
89 |
}
|
90 |
|
91 |
/**
|
29 |
* @return void
|
30 |
*/
|
31 |
public function show_feature_toggle() {
|
32 |
+
// If the recalibration beta has been disabled you will no longer be able to enable it.
|
33 |
+
// See https://github.com/Yoast/wordpress-seo/issues/12183.
|
34 |
+
if ( ! self::is_enabled() ) {
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
|
38 |
$values = array(
|
39 |
'on' => __( 'On', 'wordpress-seo' ),
|
40 |
'off' => __( 'Off', 'wordpress-seo' ),
|
42 |
|
43 |
echo '<div class="switch-container">';
|
44 |
echo '<fieldset id="', esc_attr( $this->option_name ), '" class="fieldset-switch-toggle">';
|
45 |
+
echo '<legend><strong>', esc_html__( 'Get an even better analysis', 'wordpress-seo' ), '</strong></legend>';
|
46 |
echo '<p class="clear">';
|
47 |
printf(
|
48 |
/* translators: 1: link opening tag, 2: link closing tag, 3: strong opening tag, 4: strong closing tag */
|
89 |
*/
|
90 |
public function register_hooks() {
|
91 |
add_action( 'update_option_wpseo', array( $this, 'update_option' ), 10, 2 );
|
|
|
|
|
|
|
92 |
}
|
93 |
|
94 |
/**
|
admin/class-remote-request.php
CHANGED
@@ -13,20 +13,28 @@ class WPSEO_Remote_Request {
|
|
13 |
const METHOD_POST = 'post';
|
14 |
const METHOD_GET = 'get';
|
15 |
|
16 |
-
/**
|
|
|
|
|
17 |
protected $endpoint = '';
|
18 |
|
19 |
-
/**
|
|
|
|
|
20 |
protected $args = array(
|
21 |
'blocking' => false,
|
22 |
'sslverify' => false,
|
23 |
'timeout' => 2,
|
24 |
);
|
25 |
|
26 |
-
/**
|
|
|
|
|
27 |
protected $response_error;
|
28 |
|
29 |
-
/**
|
|
|
|
|
30 |
protected $response_body;
|
31 |
|
32 |
/**
|
13 |
const METHOD_POST = 'post';
|
14 |
const METHOD_GET = 'get';
|
15 |
|
16 |
+
/**
|
17 |
+
* @var string
|
18 |
+
*/
|
19 |
protected $endpoint = '';
|
20 |
|
21 |
+
/**
|
22 |
+
* @var array
|
23 |
+
*/
|
24 |
protected $args = array(
|
25 |
'blocking' => false,
|
26 |
'sslverify' => false,
|
27 |
'timeout' => 2,
|
28 |
);
|
29 |
|
30 |
+
/**
|
31 |
+
* @var WP_Error|null
|
32 |
+
*/
|
33 |
protected $response_error;
|
34 |
|
35 |
+
/**
|
36 |
+
* @var mixed
|
37 |
+
*/
|
38 |
protected $response_body;
|
39 |
|
40 |
/**
|
admin/class-social-admin.php
CHANGED
@@ -86,6 +86,8 @@ class WPSEO_Social_Admin extends WPSEO_Metabox {
|
|
86 |
$single = null;
|
87 |
}
|
88 |
|
|
|
|
|
89 |
if ( $opengraph === true ) {
|
90 |
$tabs[] = new WPSEO_Metabox_Form_Tab(
|
91 |
'facebook',
|
@@ -195,50 +197,65 @@ class WPSEO_Social_Admin extends WPSEO_Metabox {
|
|
195 |
* @return array
|
196 |
*/
|
197 |
public function save_meta_boxes( $field_defs ) {
|
198 |
-
|
|
|
|
|
|
|
|
|
199 |
}
|
200 |
|
201 |
/**
|
202 |
* This method will compare opengraph fields with the posted values.
|
203 |
*
|
204 |
-
* When fields are changed, the facebook cache will be
|
205 |
*
|
206 |
* @param WP_Post $post Post instance.
|
207 |
*/
|
208 |
public function og_data_compare( $post ) {
|
|
|
|
|
|
|
209 |
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
! empty( $_POST ) && ! empty( $post->ID ) && $post->post_status === 'publish' &&
|
214 |
-
isset( $_POST['original_post_status'] ) && $_POST['original_post_status'] === 'publish'
|
215 |
-
) {
|
216 |
-
// @codingStandardsIgnoreEnd
|
217 |
-
|
218 |
-
$fields_to_compare = array(
|
219 |
-
'opengraph-title',
|
220 |
-
'opengraph-description',
|
221 |
-
'opengraph-image',
|
222 |
-
);
|
223 |
|
224 |
-
|
|
|
|
|
225 |
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
}
|
235 |
-
unset( $field_to_compare, $old_value, $new_value );
|
236 |
|
237 |
-
if ( $
|
238 |
-
|
239 |
-
|
240 |
-
);
|
241 |
}
|
242 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
}
|
244 |
} /* End of class */
|
86 |
$single = null;
|
87 |
}
|
88 |
|
89 |
+
wp_nonce_field( 'yoast_free_metabox_social', 'yoast_free_metabox_social_nonce' );
|
90 |
+
|
91 |
if ( $opengraph === true ) {
|
92 |
$tabs[] = new WPSEO_Metabox_Form_Tab(
|
93 |
'facebook',
|
197 |
* @return array
|
198 |
*/
|
199 |
public function save_meta_boxes( $field_defs ) {
|
200 |
+
if ( ! isset( $_POST['yoast_free_metabox_social_nonce'] ) || ! wp_verify_nonce( $_POST['yoast_free_metabox_social_nonce'], 'yoast_free_metabox_social' ) ) {
|
201 |
+
return $field_defs;
|
202 |
+
}
|
203 |
+
|
204 |
+
return array_merge( $field_defs, self::get_meta_field_defs( 'social' ) );
|
205 |
}
|
206 |
|
207 |
/**
|
208 |
* This method will compare opengraph fields with the posted values.
|
209 |
*
|
210 |
+
* When fields are changed, the facebook cache will be purged.
|
211 |
*
|
212 |
* @param WP_Post $post Post instance.
|
213 |
*/
|
214 |
public function og_data_compare( $post ) {
|
215 |
+
if ( empty( $_POST ) ) {
|
216 |
+
return;
|
217 |
+
}
|
218 |
|
219 |
+
if ( empty( $post->ID ) || $post->post_status !== 'publish' ) {
|
220 |
+
return;
|
221 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
+
if ( ! isset( $_POST['yoast_free_metabox_social_nonce'] ) || ! wp_verify_nonce( $_POST['yoast_free_metabox_social_nonce'], 'yoast_free_metabox_social' ) ) {
|
224 |
+
return;
|
225 |
+
}
|
226 |
|
227 |
+
if ( ! isset( $_POST['original_post_status'] ) || $_POST['original_post_status'] !== 'publish' ) {
|
228 |
+
return;
|
229 |
+
}
|
230 |
|
231 |
+
$fields_to_compare = array(
|
232 |
+
'opengraph-title',
|
233 |
+
'opengraph-description',
|
234 |
+
'opengraph-image',
|
235 |
+
);
|
236 |
+
|
237 |
+
$reset_facebook_cache = false;
|
238 |
+
|
239 |
+
foreach ( $fields_to_compare as $field_to_compare ) {
|
240 |
+
$old_value = self::get_value( $field_to_compare, $post->ID );
|
241 |
+
|
242 |
+
$new_value = '';
|
243 |
+
$post_key = self::$form_prefix . $field_to_compare;
|
244 |
+
if ( isset( $_POST[ $post_key ] ) ) {
|
245 |
+
$new_value = sanitize_text_field( wp_unslash( $_POST[ $post_key ] ) );
|
246 |
}
|
|
|
247 |
|
248 |
+
if ( $old_value !== $new_value ) {
|
249 |
+
$reset_facebook_cache = true;
|
250 |
+
break;
|
|
|
251 |
}
|
252 |
}
|
253 |
+
unset( $field_to_compare, $old_value, $new_value );
|
254 |
+
|
255 |
+
if ( $reset_facebook_cache ) {
|
256 |
+
wp_remote_get(
|
257 |
+
'https://graph.facebook.com/?id=' . get_permalink( $post->ID ) . '&scrape=true&method=post'
|
258 |
+
);
|
259 |
+
}
|
260 |
}
|
261 |
} /* End of class */
|
admin/class-yoast-alerts.php
CHANGED
@@ -12,21 +12,53 @@ class Yoast_Alerts {
|
|
12 |
|
13 |
const ADMIN_PAGE = 'wpseo_dashboard';
|
14 |
|
15 |
-
/**
|
|
|
|
|
|
|
|
|
16 |
private static $notification_count = 0;
|
17 |
|
18 |
-
/**
|
|
|
|
|
|
|
|
|
19 |
private static $errors = array();
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
21 |
private static $active_errors = array();
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
23 |
private static $dismissed_errors = array();
|
24 |
|
25 |
-
/**
|
|
|
|
|
|
|
|
|
26 |
private static $warnings = array();
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
28 |
private static $active_warnings = array();
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
30 |
private static $dismissed_warnings = array();
|
31 |
|
32 |
/**
|
12 |
|
13 |
const ADMIN_PAGE = 'wpseo_dashboard';
|
14 |
|
15 |
+
/**
|
16 |
+
* Total notifications count.
|
17 |
+
*
|
18 |
+
* @var int
|
19 |
+
*/
|
20 |
private static $notification_count = 0;
|
21 |
|
22 |
+
/**
|
23 |
+
* All error notifications.
|
24 |
+
*
|
25 |
+
* @var array
|
26 |
+
*/
|
27 |
private static $errors = array();
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Active errors.
|
31 |
+
*
|
32 |
+
* @var array
|
33 |
+
*/
|
34 |
private static $active_errors = array();
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Dismissed errors.
|
38 |
+
*
|
39 |
+
* @var array
|
40 |
+
*/
|
41 |
private static $dismissed_errors = array();
|
42 |
|
43 |
+
/**
|
44 |
+
* All warning notifications.
|
45 |
+
*
|
46 |
+
* @var array
|
47 |
+
*/
|
48 |
private static $warnings = array();
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Active warnings.
|
52 |
+
*
|
53 |
+
* @var array
|
54 |
+
*/
|
55 |
private static $active_warnings = array();
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Dismissed warnings.
|
59 |
+
*
|
60 |
+
* @var array
|
61 |
+
*/
|
62 |
private static $dismissed_warnings = array();
|
63 |
|
64 |
/**
|
admin/class-yoast-network-admin.php
CHANGED
@@ -112,7 +112,7 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
|
|
112 |
foreach ( $whitelist_options as $option_name ) {
|
113 |
$value = null;
|
114 |
if ( isset( $_POST[ $option_name ] ) ) { // WPCS: CSRF ok.
|
115 |
-
$value = wp_unslash( $_POST[ $option_name ] ); // WPCS: CSRF ok.
|
116 |
}
|
117 |
|
118 |
WPSEO_Options::update_site_option( $option_name, $value );
|
@@ -255,7 +255,7 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
|
|
255 |
check_admin_referer( $action, $query_arg );
|
256 |
|
257 |
if ( ! $has_access ) {
|
258 |
-
wp_die(
|
259 |
}
|
260 |
}
|
261 |
|
112 |
foreach ( $whitelist_options as $option_name ) {
|
113 |
$value = null;
|
114 |
if ( isset( $_POST[ $option_name ] ) ) { // WPCS: CSRF ok.
|
115 |
+
$value = sanitize_text_field( wp_unslash( $_POST[ $option_name ] ) ); // WPCS: CSRF ok.
|
116 |
}
|
117 |
|
118 |
WPSEO_Options::update_site_option( $option_name, $value );
|
255 |
check_admin_referer( $action, $query_arg );
|
256 |
|
257 |
if ( ! $has_access ) {
|
258 |
+
wp_die( esc_html__( 'You are not allowed to perform this action.', 'wordpress-seo' ) );
|
259 |
}
|
260 |
}
|
261 |
|
admin/class-yoast-network-settings-api.php
CHANGED
@@ -11,17 +11,23 @@
|
|
11 |
class Yoast_Network_Settings_API {
|
12 |
|
13 |
/**
|
14 |
-
*
|
|
|
|
|
15 |
*/
|
16 |
private $registered_settings = array();
|
17 |
|
18 |
/**
|
19 |
-
*
|
|
|
|
|
20 |
*/
|
21 |
private $whitelist_options = array();
|
22 |
|
23 |
/**
|
24 |
-
*
|
|
|
|
|
25 |
*/
|
26 |
private static $instance = null;
|
27 |
|
11 |
class Yoast_Network_Settings_API {
|
12 |
|
13 |
/**
|
14 |
+
* Registered network settings.
|
15 |
+
*
|
16 |
+
* @var array
|
17 |
*/
|
18 |
private $registered_settings = array();
|
19 |
|
20 |
/**
|
21 |
+
* Options whitelist, keyed by option group.
|
22 |
+
*
|
23 |
+
* @var array
|
24 |
*/
|
25 |
private $whitelist_options = array();
|
26 |
|
27 |
/**
|
28 |
+
* The singleton instance of this class.
|
29 |
+
*
|
30 |
+
* @var Yoast_Network_Settings_API
|
31 |
*/
|
32 |
private static $instance = null;
|
33 |
|
admin/class-yoast-notification-center.php
CHANGED
@@ -10,25 +10,51 @@
|
|
10 |
*/
|
11 |
class Yoast_Notification_Center {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
const STORAGE_KEY = 'yoast_notifications';
|
15 |
|
16 |
-
/**
|
|
|
|
|
|
|
|
|
17 |
private static $instance = null;
|
18 |
|
19 |
-
/**
|
|
|
|
|
20 |
private $notifications = array();
|
21 |
|
22 |
-
/**
|
|
|
|
|
|
|
|
|
23 |
private $new = array();
|
24 |
|
25 |
-
/**
|
|
|
|
|
|
|
|
|
26 |
private $resolved = 0;
|
27 |
|
28 |
-
/**
|
|
|
|
|
|
|
|
|
29 |
private $queued_transactions = array();
|
30 |
|
31 |
-
/**
|
|
|
|
|
|
|
|
|
32 |
private $notifications_retrieved = false;
|
33 |
|
34 |
/**
|
10 |
*/
|
11 |
class Yoast_Notification_Center {
|
12 |
|
13 |
+
/**
|
14 |
+
* Option name to store notifications on.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
const STORAGE_KEY = 'yoast_notifications';
|
19 |
|
20 |
+
/**
|
21 |
+
* The singleton instance of this object.
|
22 |
+
*
|
23 |
+
* @var \Yoast_Notification_Center
|
24 |
+
*/
|
25 |
private static $instance = null;
|
26 |
|
27 |
+
/**
|
28 |
+
* @var \Yoast_Notification[]
|
29 |
+
*/
|
30 |
private $notifications = array();
|
31 |
|
32 |
+
/**
|
33 |
+
* Notifications there are newly added.
|
34 |
+
*
|
35 |
+
* @var array
|
36 |
+
*/
|
37 |
private $new = array();
|
38 |
|
39 |
+
/**
|
40 |
+
* Notifications that were resolved this execution.
|
41 |
+
*
|
42 |
+
* @var array
|
43 |
+
*/
|
44 |
private $resolved = 0;
|
45 |
|
46 |
+
/**
|
47 |
+
* Internal storage for transaction before notifications have been retrieved from storage.
|
48 |
+
*
|
49 |
+
* @var array
|
50 |
+
*/
|
51 |
private $queued_transactions = array();
|
52 |
|
53 |
+
/**
|
54 |
+
* Internal flag for whether notifications have been retrieved from storage.
|
55 |
+
*
|
56 |
+
* @var bool
|
57 |
+
*/
|
58 |
private $notifications_retrieved = false;
|
59 |
|
60 |
/**
|
admin/class-yoast-notification.php
CHANGED
@@ -12,27 +12,37 @@
|
|
12 |
class Yoast_Notification {
|
13 |
|
14 |
/**
|
15 |
-
*
|
|
|
|
|
16 |
*/
|
17 |
const MATCH_ALL = 'all';
|
18 |
|
19 |
/**
|
20 |
-
*
|
|
|
|
|
21 |
*/
|
22 |
const MATCH_ANY = 'any';
|
23 |
|
24 |
/**
|
25 |
-
*
|
|
|
|
|
26 |
*/
|
27 |
const ERROR = 'error';
|
28 |
|
29 |
/**
|
30 |
-
*
|
|
|
|
|
31 |
*/
|
32 |
const WARNING = 'warning';
|
33 |
|
34 |
/**
|
35 |
-
*
|
|
|
|
|
36 |
*/
|
37 |
const UPDATED = 'updated';
|
38 |
|
12 |
class Yoast_Notification {
|
13 |
|
14 |
/**
|
15 |
+
* Type of capability check.
|
16 |
+
*
|
17 |
+
* @var string
|
18 |
*/
|
19 |
const MATCH_ALL = 'all';
|
20 |
|
21 |
/**
|
22 |
+
* Type of capability check.
|
23 |
+
*
|
24 |
+
* @var string
|
25 |
*/
|
26 |
const MATCH_ANY = 'any';
|
27 |
|
28 |
/**
|
29 |
+
* Notification type.
|
30 |
+
*
|
31 |
+
* @var string
|
32 |
*/
|
33 |
const ERROR = 'error';
|
34 |
|
35 |
/**
|
36 |
+
* Notification type.
|
37 |
+
*
|
38 |
+
* @var string
|
39 |
*/
|
40 |
const WARNING = 'warning';
|
41 |
|
42 |
/**
|
43 |
+
* Notification type.
|
44 |
+
*
|
45 |
+
* @var string
|
46 |
*/
|
47 |
const UPDATED = 'updated';
|
48 |
|
admin/config-ui/class-configuration-components.php
CHANGED
@@ -10,10 +10,18 @@
|
|
10 |
*/
|
11 |
class WPSEO_Configuration_Components {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
protected $components = array();
|
15 |
|
16 |
-
/**
|
|
|
|
|
|
|
|
|
17 |
protected $adapter;
|
18 |
|
19 |
/**
|
10 |
*/
|
11 |
class WPSEO_Configuration_Components {
|
12 |
|
13 |
+
/**
|
14 |
+
* List of registered components.
|
15 |
+
*
|
16 |
+
* @var WPSEO_Config_Component[]
|
17 |
+
*/
|
18 |
protected $components = array();
|
19 |
|
20 |
+
/**
|
21 |
+
* Adapter.
|
22 |
+
*
|
23 |
+
* @var WPSEO_Configuration_Options_Adapter
|
24 |
+
*/
|
25 |
protected $adapter;
|
26 |
|
27 |
/**
|
admin/config-ui/class-configuration-endpoint.php
CHANGED
@@ -10,14 +10,36 @@
|
|
10 |
*/
|
11 |
class WPSEO_Configuration_Endpoint {
|
12 |
|
|
|
|
|
|
|
13 |
const REST_NAMESPACE = 'yoast/v1';
|
|
|
|
|
|
|
|
|
14 |
const ENDPOINT_RETRIEVE = 'configurator';
|
|
|
|
|
|
|
|
|
15 |
const ENDPOINT_STORE = 'configurator';
|
16 |
|
|
|
|
|
|
|
17 |
const CAPABILITY_RETRIEVE = 'wpseo_manage_options';
|
|
|
|
|
|
|
|
|
18 |
const CAPABILITY_STORE = 'wpseo_manage_options';
|
19 |
|
20 |
-
/**
|
|
|
|
|
|
|
|
|
21 |
protected $service;
|
22 |
|
23 |
/**
|
10 |
*/
|
11 |
class WPSEO_Configuration_Endpoint {
|
12 |
|
13 |
+
/**
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
const REST_NAMESPACE = 'yoast/v1';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
const ENDPOINT_RETRIEVE = 'configurator';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
const ENDPOINT_STORE = 'configurator';
|
27 |
|
28 |
+
/**
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
const CAPABILITY_RETRIEVE = 'wpseo_manage_options';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
const CAPABILITY_STORE = 'wpseo_manage_options';
|
37 |
|
38 |
+
/**
|
39 |
+
* Service to use.
|
40 |
+
*
|
41 |
+
* @var WPSEO_Configuration_Service
|
42 |
+
*/
|
43 |
protected $service;
|
44 |
|
45 |
/**
|
admin/config-ui/class-configuration-options-adapter.php
CHANGED
@@ -14,11 +14,26 @@
|
|
14 |
*/
|
15 |
class WPSEO_Configuration_Options_Adapter {
|
16 |
|
|
|
|
|
|
|
17 |
const OPTION_TYPE_WORDPRESS = 'wordpress';
|
|
|
|
|
|
|
|
|
18 |
const OPTION_TYPE_YOAST = 'yoast';
|
|
|
|
|
|
|
|
|
19 |
const OPTION_TYPE_CUSTOM = 'custom';
|
20 |
|
21 |
-
/**
|
|
|
|
|
|
|
|
|
22 |
protected $lookup = array();
|
23 |
|
24 |
/**
|
14 |
*/
|
15 |
class WPSEO_Configuration_Options_Adapter {
|
16 |
|
17 |
+
/**
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
const OPTION_TYPE_WORDPRESS = 'wordpress';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
const OPTION_TYPE_YOAST = 'yoast';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
const OPTION_TYPE_CUSTOM = 'custom';
|
31 |
|
32 |
+
/**
|
33 |
+
* List of registered lookups.
|
34 |
+
*
|
35 |
+
* @var array
|
36 |
+
*/
|
37 |
protected $lookup = array();
|
38 |
|
39 |
/**
|
admin/config-ui/class-configuration-service.php
CHANGED
@@ -10,22 +10,34 @@
|
|
10 |
*/
|
11 |
class WPSEO_Configuration_Service {
|
12 |
|
13 |
-
/**
|
|
|
|
|
14 |
protected $structure;
|
15 |
|
16 |
-
/**
|
|
|
|
|
17 |
protected $components;
|
18 |
|
19 |
-
/**
|
|
|
|
|
20 |
protected $storage;
|
21 |
|
22 |
-
/**
|
|
|
|
|
23 |
protected $endpoint;
|
24 |
|
25 |
-
/**
|
|
|
|
|
26 |
protected $adapter;
|
27 |
|
28 |
-
/**
|
|
|
|
|
29 |
protected $translations;
|
30 |
|
31 |
/**
|
10 |
*/
|
11 |
class WPSEO_Configuration_Service {
|
12 |
|
13 |
+
/**
|
14 |
+
* @var WPSEO_Configuration_Structure
|
15 |
+
*/
|
16 |
protected $structure;
|
17 |
|
18 |
+
/**
|
19 |
+
* @var WPSEO_Configuration_Components
|
20 |
+
*/
|
21 |
protected $components;
|
22 |
|
23 |
+
/**
|
24 |
+
* @var WPSEO_Configuration_Storage
|
25 |
+
*/
|
26 |
protected $storage;
|
27 |
|
28 |
+
/**
|
29 |
+
* @var WPSEO_Configuration_Endpoint
|
30 |
+
*/
|
31 |
protected $endpoint;
|
32 |
|
33 |
+
/**
|
34 |
+
* @var WPSEO_Configuration_Options_Adapter
|
35 |
+
*/
|
36 |
protected $adapter;
|
37 |
|
38 |
+
/**
|
39 |
+
* @var WPSEO_Configuration_Translations
|
40 |
+
*/
|
41 |
protected $translations;
|
42 |
|
43 |
/**
|
admin/config-ui/class-configuration-storage.php
CHANGED
@@ -10,10 +10,14 @@
|
|
10 |
*/
|
11 |
class WPSEO_Configuration_Storage {
|
12 |
|
13 |
-
/**
|
|
|
|
|
14 |
protected $adapter;
|
15 |
|
16 |
-
/**
|
|
|
|
|
17 |
protected $fields = array();
|
18 |
|
19 |
/**
|
10 |
*/
|
11 |
class WPSEO_Configuration_Storage {
|
12 |
|
13 |
+
/**
|
14 |
+
* @var \WPSEO_Configuration_Options_Adapter
|
15 |
+
*/
|
16 |
protected $adapter;
|
17 |
|
18 |
+
/**
|
19 |
+
* @var \WPSEO_Config_Field[]
|
20 |
+
*/
|
21 |
protected $fields = array();
|
22 |
|
23 |
/**
|
admin/config-ui/class-configuration-structure.php
CHANGED
@@ -10,7 +10,11 @@
|
|
10 |
*/
|
11 |
class WPSEO_Configuration_Structure {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
protected $steps = array();
|
15 |
|
16 |
/**
|
10 |
*/
|
11 |
class WPSEO_Configuration_Structure {
|
12 |
|
13 |
+
/**
|
14 |
+
* Registered steps.
|
15 |
+
*
|
16 |
+
* @var array
|
17 |
+
*/
|
18 |
protected $steps = array();
|
19 |
|
20 |
/**
|
admin/config-ui/class-configuration-translations.php
CHANGED
@@ -10,10 +10,18 @@
|
|
10 |
*/
|
11 |
class WPSEO_Configuration_Translations {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
protected $translations = array();
|
15 |
|
16 |
-
/**
|
|
|
|
|
|
|
|
|
17 |
protected $locale;
|
18 |
|
19 |
/**
|
10 |
*/
|
11 |
class WPSEO_Configuration_Translations {
|
12 |
|
13 |
+
/**
|
14 |
+
* Registered steps.
|
15 |
+
*
|
16 |
+
* @var array
|
17 |
+
*/
|
18 |
protected $translations = array();
|
19 |
|
20 |
+
/**
|
21 |
+
* The locale.
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
protected $locale;
|
26 |
|
27 |
/**
|
admin/config-ui/components/class-component-connect-google-search-console.php
CHANGED
@@ -10,11 +10,21 @@
|
|
10 |
*/
|
11 |
class WPSEO_Config_Component_Connect_Google_Search_Console implements WPSEO_Config_Component {
|
12 |
|
|
|
|
|
|
|
13 |
const OPTION_ACCESS_TOKEN = 'wpseo-gsc-access_token';
|
14 |
-
const OPTION_REFRESH_TOKEN = 'wpseo-gsc-refresh_token';
|
15 |
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
/**
|
|
|
|
|
|
|
|
|
18 |
protected $gsc_service;
|
19 |
|
20 |
/**
|
10 |
*/
|
11 |
class WPSEO_Config_Component_Connect_Google_Search_Console implements WPSEO_Config_Component {
|
12 |
|
13 |
+
/**
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
const OPTION_ACCESS_TOKEN = 'wpseo-gsc-access_token';
|
|
|
17 |
|
18 |
+
/**
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
+
const OPTION_REFRESH_TOKEN = 'wpseo-gsc-refresh_token';
|
22 |
|
23 |
+
/**
|
24 |
+
* Service to use.
|
25 |
+
*
|
26 |
+
* @var WPSEO_GSC_Service
|
27 |
+
*/
|
28 |
protected $gsc_service;
|
29 |
|
30 |
/**
|
admin/config-ui/factories/class-factory-post-type.php
CHANGED
@@ -10,7 +10,11 @@
|
|
10 |
*/
|
11 |
class WPSEO_Config_Factory_Post_Type {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
protected static $fields = array();
|
15 |
|
16 |
/**
|
10 |
*/
|
11 |
class WPSEO_Config_Factory_Post_Type {
|
12 |
|
13 |
+
/**
|
14 |
+
* List of fields.
|
15 |
+
*
|
16 |
+
* @var WPSEO_Config_Field_Choice_Post_Type[]
|
17 |
+
*/
|
18 |
protected static $fields = array();
|
19 |
|
20 |
/**
|
admin/config-ui/fields/class-field-choice-post-type.php
CHANGED
@@ -10,7 +10,11 @@
|
|
10 |
*/
|
11 |
class WPSEO_Config_Field_Choice_Post_Type extends WPSEO_Config_Field_Choice {
|
12 |
|
13 |
-
/**
|
|
|
|
|
|
|
|
|
14 |
protected $post_type;
|
15 |
|
16 |
/**
|
10 |
*/
|
11 |
class WPSEO_Config_Field_Choice_Post_Type extends WPSEO_Config_Field_Choice {
|
12 |
|
13 |
+
/**
|
14 |
+
* Post type.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
protected $post_type;
|
19 |
|
20 |
/**
|
admin/config-ui/fields/class-field.php
CHANGED
@@ -9,19 +9,40 @@
|
|
9 |
* Class WPSEO_Config_Field
|
10 |
*/
|
11 |
class WPSEO_Config_Field {
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
protected $field;
|
14 |
|
15 |
-
/**
|
|
|
|
|
|
|
|
|
16 |
protected $component;
|
17 |
|
18 |
-
/**
|
|
|
|
|
|
|
|
|
19 |
protected $properties = array();
|
20 |
|
21 |
-
/**
|
|
|
|
|
|
|
|
|
22 |
protected $requires = array();
|
23 |
|
24 |
-
/**
|
|
|
|
|
|
|
|
|
25 |
protected $data = array();
|
26 |
|
27 |
/**
|
9 |
* Class WPSEO_Config_Field
|
10 |
*/
|
11 |
class WPSEO_Config_Field {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Field name.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
protected $field;
|
19 |
|
20 |
+
/**
|
21 |
+
* Component to use.
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
protected $component;
|
26 |
|
27 |
+
/**
|
28 |
+
* Properties of this field.
|
29 |
+
*
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
protected $properties = array();
|
33 |
|
34 |
+
/**
|
35 |
+
* Field requirements.
|
36 |
+
*
|
37 |
+
* @var array
|
38 |
+
*/
|
39 |
protected $requires = array();
|