Version Description
Download this release
Release Info
Developer | Yoast |
Plugin | Yoast SEO |
Version | 12.7 |
Comparing to | |
See all releases |
Code changes from version 12.6.2 to 12.7
- admin/admin-settings-changed-listener.php +1 -1
- admin/ajax.php +8 -8
- admin/ajax/class-recalculate-scores-ajax.php +9 -9
- admin/ajax/class-shortcode-filter.php +4 -4
- admin/ajax/class-yoast-dismissable-notice.php +1 -1
- admin/ajax/class-yoast-onpage-ajax.php +1 -1
- admin/ajax/class-yoast-plugin-conflict-ajax.php +3 -3
- admin/capabilities/class-abstract-capability-manager.php +2 -2
- admin/capabilities/class-capability-manager-integration.php +11 -11
- admin/capabilities/class-capability-manager-vip.php +3 -3
- admin/capabilities/class-capability-utils.php +1 -1
- admin/capabilities/class-register-capabilities.php +5 -5
- admin/class-add-keyword-modal.php +4 -4
- admin/class-admin-asset-analysis-worker-location.php +3 -3
- admin/class-admin-asset-manager.php +186 -186
- admin/class-admin-asset-yoast-components-l10n.php +2 -2
- admin/class-admin-editor-specific-replace-vars.php +14 -14
- admin/class-admin-gutenberg-compatibility-notification.php +3 -3
- admin/class-admin-init.php +41 -41
- admin/class-admin-media-purge-notification.php +4 -4
- admin/class-admin-recommended-replace-vars.php +16 -16
- admin/class-admin-user-profile.php +6 -6
- admin/class-admin.php +36 -36
- admin/class-asset.php +3 -3
- admin/class-bulk-description-editor-list-table.php +4 -4
- admin/class-bulk-editor-list-table.php +53 -53
- admin/class-bulk-title-editor-list-table.php +5 -5
- admin/class-collector.php +2 -2
- admin/class-config.php +10 -10
- admin/class-customizer.php +24 -24
- admin/class-database-proxy.php +3 -3
- admin/class-expose-shortlinks.php +3 -3
- admin/class-extension-manager.php +2 -2
- admin/class-extension.php +1 -1
- admin/class-extensions.php +12 -12
- admin/class-helpscout.php +6 -6
- admin/class-keyword-synonyms-modal.php +4 -4
- admin/class-license-page-manager.php +7 -7
- admin/class-meta-columns.php +50 -50
- admin/class-meta-storage.php +8 -8
- admin/class-multiple-keywords-modal.php +4 -4
- admin/class-my-yoast-proxy.php +7 -7
- admin/class-my-yoast-route.php +10 -10
- admin/class-option-tab.php +1 -1
- admin/class-option-tabs.php +2 -2
- admin/class-paper-presenter.php +12 -12
- admin/class-plugin-availability.php +29 -29
- admin/class-plugin-conflict.php +11 -11
- admin/class-premium-upsell-admin-block.php +4 -4
- admin/class-primary-term-admin.php +13 -13
- admin/class-product-upsell-notice.php +2 -2
- admin/class-recalculate-scores.php +2 -2
- admin/class-remote-request.php +3 -3
- admin/class-schema-person-upgrade-notification.php +3 -3
- admin/class-social-admin.php +11 -11
- admin/class-suggested-plugins.php +5 -5
- admin/class-yoast-alerts.php +24 -24
- admin/class-yoast-columns.php +3 -3
- admin/class-yoast-dashboard-widget.php +8 -9
- admin/class-yoast-form.php +42 -42
- admin/class-yoast-input-validation.php +4 -4
- admin/class-yoast-network-admin.php +15 -15
- admin/class-yoast-network-settings-api.php +9 -9
- admin/class-yoast-notification-center.php +26 -26
- admin/class-yoast-notification.php +16 -16
- admin/class-yoast-plugin-conflict.php +10 -10
- admin/config-ui/class-configuration-components.php +5 -5
- admin/config-ui/class-configuration-endpoint.php +8 -8
- admin/config-ui/class-configuration-options-adapter.php +4 -4
- admin/config-ui/class-configuration-page.php +7 -7
- admin/config-ui/class-configuration-service.php +2 -2
- admin/config-ui/class-configuration-storage.php +9 -9
- admin/config-ui/class-configuration-structure.php +16 -16
- admin/config-ui/class-configuration-translations.php +2 -2
- admin/config-ui/components/class-component-mailchimp-signup.php +4 -4
- admin/config-ui/components/class-component-suggestions.php +13 -13
- admin/config-ui/factories/class-factory-post-type.php +3 -3
- admin/config-ui/fields/class-field-choice-post-type.php +2 -2
- admin/config-ui/fields/class-field-choice.php +3 -3
- admin/config-ui/fields/class-field-environment.php +2 -2
- admin/config-ui/fields/class-field-mailchimp-signup.php +2 -2
- admin/config-ui/fields/class-field-multiple-authors.php +4 -4
- admin/config-ui/fields/class-field-site-name.php +2 -2
- admin/config-ui/fields/class-field-success-message.php +2 -2
- admin/config-ui/fields/class-field-suggestions.php +4 -4
- admin/config-ui/fields/class-field-upsell-configuration-service.php +6 -6
- admin/config-ui/fields/class-field-upsell-site-review.php +6 -6
- admin/config-ui/fields/class-field.php +7 -7
- admin/endpoints/class-endpoint-file-size.php +10 -10
- admin/endpoints/class-endpoint-indexable.php +5 -5
- admin/endpoints/class-endpoint-ryte.php +4 -4
- admin/endpoints/class-endpoint-statistics.php +4 -4
- admin/filters/class-abstract-post-filter.php +11 -11
- admin/filters/class-cornerstone-filter.php +4 -4
- admin/formatter/class-metabox-formatter.php +16 -16
- admin/formatter/class-post-metabox-formatter.php +5 -5
- admin/formatter/class-term-metabox-formatter.php +3 -3
- admin/import/class-import-detector.php +1 -1
- admin/import/class-import-settings.php +2 -8
- admin/import/plugins/class-abstract-plugin-importer.php +3 -3
- admin/import/plugins/class-import-aioseo.php +14 -14
- admin/import/plugins/class-import-greg-high-performance-seo.php +6 -6
- admin/import/plugins/class-import-headspace.php +12 -12
- admin/import/plugins/class-import-jetpack.php +4 -4
- admin/import/plugins/class-import-platinum-seo-pack.php +11 -11
- admin/import/plugins/class-import-rankmath.php +31 -31
- admin/import/plugins/class-import-seo-framework.php +22 -22
- admin/import/plugins/class-import-seopressor.php +11 -11
- admin/import/plugins/class-import-smartcrawl.php +19 -19
- admin/import/plugins/class-import-squirrly.php +2 -2
- admin/import/plugins/class-import-ultimate-seo.php +18 -18
- admin/import/plugins/class-import-woothemes-seo.php +14 -14
- admin/import/plugins/class-import-wp-meta-seo.php +26 -26
- admin/import/plugins/class-import-wpseo.php +37 -37
- admin/import/plugins/class-importers.php +2 -2
- admin/links/class-link-cleanup-transient.php +1 -1
- admin/links/class-link-column-count.php +6 -6
- admin/links/class-link-columns.php +13 -13
- admin/links/class-link-compatibility-notifier.php +2 -2
- admin/links/class-link-content-processor.php +5 -5
- admin/links/class-link-extractor.php +1 -1
- admin/links/class-link-factory.php +2 -2
- admin/links/class-link-installer.php +3 -3
- admin/links/class-link-notifier.php +4 -4
- admin/links/class-link-query.php +1 -1
- admin/links/class-link-reindex-dashboard.php +16 -16
- admin/links/class-link-reindex-post-endpoint.php +4 -4
- admin/links/class-link-reindex-post-service.php +2 -2
- admin/links/class-link-storage.php +11 -11
- admin/links/class-link-table-accessible-notifier.php +2 -2
- admin/links/class-link-type-classifier.php +2 -2
- admin/links/class-link-watcher.php +3 -3
- admin/menu/class-admin-menu.php +4 -4
- admin/menu/class-base-menu.php +5 -5
- admin/menu/class-network-admin-menu.php +5 -5
- admin/menu/class-replacevar-editor.php +6 -6
- admin/menu/class-submenu-capability-normalize.php +1 -1
- admin/metabox/class-abstract-sectioned-metabox-tab.php +3 -3
- admin/metabox/class-metabox-collapsible.php +2 -2
- admin/metabox/class-metabox-collapsibles-section.php +6 -6
- admin/metabox/class-metabox-editor.php +2 -2
- admin/metabox/class-metabox-form-tab.php +3 -3
- admin/metabox/class-metabox-section-additional.php +3 -3
- admin/metabox/class-metabox-section-react.php +7 -7
- admin/metabox/class-metabox.php +53 -53
- admin/notifiers/class-post-type-archive-notification-handler.php +7 -7
- admin/onpage/class-onpage-option.php +2 -2
- admin/onpage/class-onpage-request.php +4 -4
- admin/onpage/class-onpage.php +10 -10
- admin/onpage/class-ryte-service.php +10 -10
- admin/pages/dashboard.php +2 -2
- admin/pages/network.php +1 -1
- admin/pages/tools.php +9 -9
- admin/recalculate/class-recalculate-posts.php +6 -6
- admin/recalculate/class-recalculate-terms.php +8 -8
- admin/recalculate/class-recalculate.php +2 -2
- admin/roles/class-abstract-role-manager.php +8 -8
- admin/roles/class-register-roles.php +1 -1
- admin/roles/class-role-manager-vip.php +4 -4
- admin/roles/class-role-manager-wp.php +1 -1
- admin/services/class-file-size.php +6 -6
- admin/services/class-indexable-post-provider.php +5 -5
- admin/services/class-indexable-provider.php +1 -1
- admin/services/class-indexable-term-provider.php +5 -5
- admin/statistics/class-statistics-integration.php +2 -2
- admin/statistics/class-statistics-service.php +12 -12
- admin/taxonomy/class-taxonomy-columns.php +3 -3
- admin/taxonomy/class-taxonomy-content-fields.php +3 -3
- admin/taxonomy/class-taxonomy-fields-presenter.php +1 -1
- admin/taxonomy/class-taxonomy-fields.php +2 -2
- admin/taxonomy/class-taxonomy-metabox.php +6 -6
- admin/taxonomy/class-taxonomy-settings-fields.php +3 -3
- admin/taxonomy/class-taxonomy-social-fields.php +8 -8
- admin/taxonomy/class-taxonomy.php +19 -19
- admin/tracking/class-tracking-default-data.php +2 -2
- admin/tracking/class-tracking-plugin-data.php +6 -6
- admin/tracking/class-tracking-server-data.php +7 -7
- admin/tracking/class-tracking-settings-data.php +6 -6
- admin/tracking/class-tracking-theme-data.php +6 -6
- admin/tracking/class-tracking.php +66 -13
- admin/views/class-view-utils.php +2 -2
- admin/views/class-yoast-feature-toggle.php +1 -1
- admin/views/class-yoast-feature-toggles.php +20 -20
- admin/views/class-yoast-input-select.php +4 -4
- admin/views/licenses.php +22 -22
- admin/views/partial-alerts-template.php +2 -2
- admin/views/tabs/dashboard/dashboard.php +1 -1
- admin/views/tabs/dashboard/features.php +2 -2
- admin/views/tabs/dashboard/webmaster-tools.php +2 -2
- admin/views/tabs/metas/archives.php +10 -10
- admin/views/tabs/metas/archives/help.php +2 -2
- admin/views/tabs/metas/breadcrumbs.php +2 -2
- admin/views/tabs/metas/general.php +2 -2
- admin/views/tabs/metas/media.php +2 -2
- admin/views/tabs/metas/paper-content/author-archive-settings.php +4 -4
- admin/views/tabs/metas/paper-content/breadcrumbs-content.php +11 -11
- admin/views/tabs/metas/paper-content/date-archives-settings.php +4 -4
- admin/views/tabs/metas/paper-content/general/homepage.php +2 -2
- admin/views/tabs/metas/paper-content/general/knowledge-graph.php +3 -3
- admin/views/tabs/metas/paper-content/general/title-separator.php +1 -1
- admin/views/tabs/metas/paper-content/media-content.php +2 -2
- admin/views/tabs/metas/paper-content/post-type-content.php +2 -2
- admin/views/tabs/metas/paper-content/post_type/post-type.php +2 -2
- admin/views/tabs/metas/paper-content/rss-content.php +2 -2
- admin/views/tabs/metas/paper-content/taxonomy-content.php +3 -3
- admin/views/tabs/metas/post-types.php +6 -6
- admin/views/tabs/metas/rss.php +2 -2
- admin/views/tabs/metas/taxonomies.php +7 -7
- admin/views/tabs/metas/taxonomies/category-url.php +1 -1
- admin/views/tabs/network/features.php +2 -2
- admin/views/tabs/network/general.php +2 -2
- admin/views/tabs/social/accounts.php +18 -18
- admin/views/tabs/social/twitterbox.php +1 -1
- admin/views/tool-bulk-editor.php +8 -8
- admin/views/tool-import-export.php +8 -8
- admin/watchers/class-slug-change-watcher.php +9 -9
- css/dist/{admin-global-1262-rtl.min.css → admin-global-1270-rtl.min.css} +0 -0
- css/dist/{admin-global-1262.min.css → admin-global-1270.min.css} +0 -0
- css/dist/{adminbar-1262-rtl.min.css → adminbar-1270-rtl.min.css} +0 -0
- css/dist/{adminbar-1262.min.css → adminbar-1270.min.css} +0 -0
- css/dist/alerts-1262-rtl.min.css +0 -1
- css/dist/alerts-1262.min.css +0 -1
- css/dist/alerts-1270-rtl.min.css +1 -0
- css/dist/alerts-1270.min.css +1 -0
- css/dist/{dashboard-1262-rtl.min.css → dashboard-1270-rtl.min.css} +0 -0
- css/dist/{dashboard-1262.min.css → dashboard-1270.min.css} +0 -0
- css/dist/{edit-page-1262-rtl.min.css → edit-page-1270-rtl.min.css} +0 -0
- css/dist/{edit-page-1262.min.css → edit-page-1270.min.css} +0 -0
- css/dist/{featured-image-1262-rtl.min.css → featured-image-1270-rtl.min.css} +0 -0
- css/dist/{featured-image-1262.min.css → featured-image-1270.min.css} +0 -0
- css/dist/{filter-explanation-1262-rtl.min.css → filter-explanation-1270-rtl.min.css} +0 -0
- css/dist/{filter-explanation-1262.min.css → filter-explanation-1270.min.css} +0 -0
- css/dist/{inside-editor-1262-rtl.min.css → inside-editor-1270-rtl.min.css} +0 -0
- css/dist/{inside-editor-1262.min.css → inside-editor-1270.min.css} +0 -0
- css/dist/{metabox-1262-rtl.min.css → metabox-1270-rtl.min.css} +0 -0
- css/dist/{metabox-1262.min.css → metabox-1270.min.css} +0 -0
- css/dist/{metabox-primary-category-1262-rtl.min.css → metabox-primary-category-1270-rtl.min.css} +0 -0
- css/dist/{metabox-primary-category-1262.min.css → metabox-primary-category-1270.min.css} +0 -0
- css/dist/{search-appearance-1262-rtl.min.css → search-appearance-1270-rtl.min.css} +0 -0
- css/dist/{search-appearance-1262.min.css → search-appearance-1270.min.css} +0 -0
- css/dist/{structured-data-blocks-1262-rtl.min.css → structured-data-blocks-1270-rtl.min.css} +0 -0
- css/dist/{structured-data-blocks-1262.min.css → structured-data-blocks-1270.min.css} +0 -0
- css/dist/{toggle-switch-1262-rtl.min.css → toggle-switch-1270-rtl.min.css} +0 -0
- css/dist/{toggle-switch-1262.min.css → toggle-switch-1270.min.css} +0 -0
- css/dist/{wpseo-dismissible-1262-rtl.min.css → wpseo-dismissible-1270-rtl.min.css} +0 -0
- css/dist/{wpseo-dismissible-1262.min.css → wpseo-dismissible-1270.min.css} +0 -0
- css/dist/{yoast-components-1262-rtl.min.css → yoast-components-1270-rtl.min.css} +0 -0
- css/dist/{yoast-components-1262.min.css → yoast-components-1270.min.css} +0 -0
- css/dist/{yoast-extensions-1262-rtl.min.css → yoast-extensions-1270-rtl.min.css} +0 -0
- css/dist/{yoast-extensions-1262.min.css → yoast-extensions-1270.min.css} +0 -0
- css/dist/{yst_plugin_tools-1262-rtl.min.css → yst_plugin_tools-1270-rtl.min.css} +0 -0
- css/dist/{yst_plugin_tools-1262.min.css → yst_plugin_tools-1270.min.css} +0 -0
- css/dist/{yst_seo_score-1262-rtl.min.css → yst_seo_score-1270-rtl.min.css} +0 -0
- css/dist/{yst_seo_score-1262.min.css → yst_seo_score-1270.min.css} +0 -0
- frontend/class-breadcrumbs.php +24 -24
- frontend/class-frontend.php +38 -38
- frontend/class-handle-404.php +1 -1
- frontend/class-opengraph-image.php +14 -14
- frontend/class-opengraph-oembed.php +1 -1
- frontend/class-opengraph.php +20 -20
- frontend/class-primary-category.php +1 -1
- frontend/class-remove-reply-to-com.php +2 -2
- frontend/class-twitter.php +6 -6
- frontend/class-woocommerce-shop-page.php +1 -1
- frontend/schema/class-schema-article.php +9 -9
- frontend/schema/class-schema-author.php +3 -3
- frontend/schema/class-schema-breadcrumb.php +9 -9
- frontend/schema/class-schema-context.php +2 -2
- frontend/schema/class-schema-faq-question-list.php +5 -5
- frontend/schema/class-schema-faq-questions.php +8 -6
- frontend/schema/class-schema-faq.php +4 -4
- frontend/schema/class-schema-howto.php +13 -13
- frontend/schema/class-schema-image.php +2 -2
- frontend/schema/class-schema-organization.php +6 -6
- frontend/schema/class-schema-person.php +8 -8
- frontend/schema/class-schema-webpage.php +8 -8
- frontend/schema/class-schema-website.php +5 -5
- frontend/schema/class-schema.php +11 -11
- inc/class-addon-manager.php +20 -20
- inc/class-my-yoast-api-request.php +12 -12
- inc/class-post-type.php +2 -2
- inc/class-rewrite.php +12 -12
- inc/class-structured-data-blocks.php +4 -4
- inc/class-upgrade-history.php +7 -7
- inc/class-upgrade.php +71 -142
- inc/class-wpseo-admin-bar-menu.php +65 -65
- inc/class-wpseo-content-images.php +4 -4
- inc/class-wpseo-custom-fields.php +2 -2
- inc/class-wpseo-custom-taxonomies.php +3 -3
- inc/class-wpseo-endpoint-factory.php +7 -7
- inc/class-wpseo-image-utils.php +8 -8
- inc/class-wpseo-installation.php +1 -1
- inc/class-wpseo-meta.php +84 -84
- inc/class-wpseo-primary-term.php +1 -1
- inc/class-wpseo-rank.php +22 -22
- inc/class-wpseo-replace-vars.php +32 -32
- inc/class-wpseo-shortlinker.php +2 -2
- inc/class-wpseo-statistics.php +11 -11
- inc/class-wpseo-utils.php +44 -47
- inc/endpoints/class-myyoast-connect.php +6 -6
- inc/health-check.php +13 -13
- inc/indexables/class-indexable.php +3 -3
- inc/indexables/class-post-indexable.php +5 -5
- inc/indexables/class-term-indexable.php +4 -4
- inc/indexables/validators/class-object-type-validator.php +1 -1
- inc/indexables/validators/class-robots-validator.php +2 -2
- inc/language-utils.php +2 -2
- inc/options/class-wpseo-option-ms.php +12 -12
- inc/options/class-wpseo-option-social.php +11 -11
- inc/options/class-wpseo-option-titles.php +73 -73
- inc/options/class-wpseo-option-wpseo.php +27 -27
- inc/options/class-wpseo-option.php +10 -10
- inc/options/class-wpseo-options-backfill.php +29 -29
- inc/options/class-wpseo-options.php +14 -14
- inc/options/class-wpseo-taxonomy-meta.php +27 -27
- inc/sitemaps/class-author-sitemap-provider.php +32 -32
- inc/sitemaps/class-post-type-sitemap-provider.php +21 -22
- inc/sitemaps/class-sitemap-cache-data.php +2 -2
- inc/sitemaps/class-sitemap-image-parser.php +26 -38
- inc/sitemaps/class-sitemaps-admin.php +3 -3
- inc/sitemaps/class-sitemaps-cache-validator.php +1 -1
- inc/sitemaps/class-sitemaps-cache.php +15 -15
- inc/sitemaps/class-sitemaps-renderer.php +1 -1
- inc/sitemaps/class-sitemaps-router.php +4 -4
- inc/sitemaps/class-sitemaps.php +19 -21
- inc/sitemaps/class-taxonomy-sitemap-provider.php +21 -21
- inc/wpseo-functions.php +5 -5
- inc/wpseo-non-ajax-functions.php +2 -2
- js/dist/{analysis-1262.min.js → analysis-1270.min.js} +0 -0
- js/dist/{babel-polyfill-1262.min.js → babel-polyfill-1270.min.js} +0 -0
- js/dist/{commons-1262.min.js → commons-1270.min.js} +0 -0
- js/dist/components-1262.min.js +0 -29
admin/admin-settings-changed-listener.php
CHANGED
@@ -23,7 +23,7 @@ class WPSEO_Admin_Settings_Changed_Listener implements WPSEO_WordPress_Integrati
|
|
23 |
* @return void
|
24 |
*/
|
25 |
public function register_hooks() {
|
26 |
-
add_action( 'admin_init',
|
27 |
}
|
28 |
|
29 |
/**
|
23 |
* @return void
|
24 |
*/
|
25 |
public function register_hooks() {
|
26 |
+
add_action( 'admin_init', [ $this, 'intercept_save_update_notification' ] );
|
27 |
}
|
28 |
|
29 |
/**
|
admin/ajax.php
CHANGED
@@ -46,7 +46,7 @@ add_action( 'wp_ajax_wpseo_set_option', 'wpseo_set_option' );
|
|
46 |
/**
|
47 |
* Since 3.2 Notifications are dismissed in the Notification Center.
|
48 |
*/
|
49 |
-
add_action( 'wp_ajax_yoast_dismiss_notification',
|
50 |
|
51 |
/**
|
52 |
* Function used to remove the admin notices for several purposes, dies on exit.
|
@@ -136,12 +136,12 @@ function wpseo_upsert_meta( $post_id, $new_meta_value, $orig_meta_value, $meta_k
|
|
136 |
$sanitized_new_meta_value = wp_strip_all_tags( $new_meta_value );
|
137 |
$orig_meta_value = wp_strip_all_tags( $orig_meta_value );
|
138 |
|
139 |
-
$upsert_results =
|
140 |
'status' => 'success',
|
141 |
'post_id' => $post_id,
|
142 |
"new_{$return_key}" => $sanitized_new_meta_value,
|
143 |
"original_{$return_key}" => $orig_meta_value,
|
144 |
-
|
145 |
|
146 |
$the_post = get_post( $post_id );
|
147 |
if ( empty( $the_post ) ) {
|
@@ -231,13 +231,13 @@ add_action( 'wp_ajax_wpseo_save_all_descriptions', 'wpseo_save_all_descriptions'
|
|
231 |
function wpseo_save_all( $what ) {
|
232 |
check_ajax_referer( 'wpseo-bulk-editor' );
|
233 |
|
234 |
-
$results =
|
235 |
if ( ! isset( $_POST['items'], $_POST['existingItems'] ) ) {
|
236 |
wpseo_ajax_json_echo_die( $results );
|
237 |
}
|
238 |
|
239 |
-
$new_values = array_map(
|
240 |
-
$original_values = array_map(
|
241 |
|
242 |
foreach ( $new_values as $post_id => $new_value ) {
|
243 |
$original_value = $original_values[ $post_id ];
|
@@ -319,7 +319,7 @@ add_action( 'wp_ajax_get_term_keyword_usage', 'ajax_get_term_keyword_usage' );
|
|
319 |
* @return void
|
320 |
*/
|
321 |
function wpseo_register_ajax_integrations() {
|
322 |
-
$integrations =
|
323 |
|
324 |
foreach ( $integrations as $integration ) {
|
325 |
$integration->register_ajax_hooks();
|
@@ -397,7 +397,7 @@ function wpseo_ajax_replace_vars() {
|
|
397 |
$wp_query->queried_object = $post;
|
398 |
$wp_query->queried_object_id = $post->ID;
|
399 |
|
400 |
-
$omit =
|
401 |
echo wpseo_replace_vars( stripslashes( filter_input( INPUT_POST, 'string' ) ), $post, $omit );
|
402 |
die;
|
403 |
}
|
46 |
/**
|
47 |
* Since 3.2 Notifications are dismissed in the Notification Center.
|
48 |
*/
|
49 |
+
add_action( 'wp_ajax_yoast_dismiss_notification', [ 'Yoast_Notification_Center', 'ajax_dismiss_notification' ] );
|
50 |
|
51 |
/**
|
52 |
* Function used to remove the admin notices for several purposes, dies on exit.
|
136 |
$sanitized_new_meta_value = wp_strip_all_tags( $new_meta_value );
|
137 |
$orig_meta_value = wp_strip_all_tags( $orig_meta_value );
|
138 |
|
139 |
+
$upsert_results = [
|
140 |
'status' => 'success',
|
141 |
'post_id' => $post_id,
|
142 |
"new_{$return_key}" => $sanitized_new_meta_value,
|
143 |
"original_{$return_key}" => $orig_meta_value,
|
144 |
+
];
|
145 |
|
146 |
$the_post = get_post( $post_id );
|
147 |
if ( empty( $the_post ) ) {
|
231 |
function wpseo_save_all( $what ) {
|
232 |
check_ajax_referer( 'wpseo-bulk-editor' );
|
233 |
|
234 |
+
$results = [];
|
235 |
if ( ! isset( $_POST['items'], $_POST['existingItems'] ) ) {
|
236 |
wpseo_ajax_json_echo_die( $results );
|
237 |
}
|
238 |
|
239 |
+
$new_values = array_map( [ 'WPSEO_Utils', 'sanitize_text_field' ], wp_unslash( (array) $_POST['items'] ) );
|
240 |
+
$original_values = array_map( [ 'WPSEO_Utils', 'sanitize_text_field' ], wp_unslash( (array) $_POST['existingItems'] ) );
|
241 |
|
242 |
foreach ( $new_values as $post_id => $new_value ) {
|
243 |
$original_value = $original_values[ $post_id ];
|
319 |
* @return void
|
320 |
*/
|
321 |
function wpseo_register_ajax_integrations() {
|
322 |
+
$integrations = [ new Yoast_Network_Admin() ];
|
323 |
|
324 |
foreach ( $integrations as $integration ) {
|
325 |
$integration->register_ajax_hooks();
|
397 |
$wp_query->queried_object = $post;
|
398 |
$wp_query->queried_object_id = $post->ID;
|
399 |
|
400 |
+
$omit = [ 'excerpt', 'excerpt_only', 'title' ];
|
401 |
echo wpseo_replace_vars( stripslashes( filter_input( INPUT_POST, 'string' ) ), $post, $omit );
|
402 |
die;
|
403 |
}
|
admin/ajax/class-recalculate-scores-ajax.php
CHANGED
@@ -16,9 +16,9 @@ class WPSEO_Recalculate_Scores_Ajax {
|
|
16 |
* Initialize the AJAX hooks.
|
17 |
*/
|
18 |
public function __construct() {
|
19 |
-
add_action( 'wp_ajax_wpseo_recalculate_scores',
|
20 |
-
add_action( 'wp_ajax_wpseo_update_score',
|
21 |
-
add_action( 'wp_ajax_wpseo_recalculate_total',
|
22 |
}
|
23 |
|
24 |
/**
|
@@ -30,10 +30,10 @@ class WPSEO_Recalculate_Scores_Ajax {
|
|
30 |
wp_die(
|
31 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: WPSEO_Utils::format_json_encode is considered safe.
|
32 |
WPSEO_Utils::format_json_encode(
|
33 |
-
|
34 |
'posts' => $this->calculate_posts(),
|
35 |
'terms' => $this->calculate_terms(),
|
36 |
-
|
37 |
)
|
38 |
);
|
39 |
}
|
@@ -96,12 +96,12 @@ class WPSEO_Recalculate_Scores_Ajax {
|
|
96 |
*/
|
97 |
private function calculate_posts() {
|
98 |
$count_posts_query = new WP_Query(
|
99 |
-
|
100 |
'post_type' => 'any',
|
101 |
'meta_key' => '_yoast_wpseo_focuskw',
|
102 |
'posts_per_page' => 1,
|
103 |
'fields' => 'ids',
|
104 |
-
|
105 |
);
|
106 |
|
107 |
return $count_posts_query->found_posts;
|
@@ -114,8 +114,8 @@ class WPSEO_Recalculate_Scores_Ajax {
|
|
114 |
*/
|
115 |
private function calculate_terms() {
|
116 |
$total = 0;
|
117 |
-
foreach ( get_taxonomies(
|
118 |
-
$total += wp_count_terms( $taxonomy->name,
|
119 |
}
|
120 |
|
121 |
return $total;
|
16 |
* Initialize the AJAX hooks.
|
17 |
*/
|
18 |
public function __construct() {
|
19 |
+
add_action( 'wp_ajax_wpseo_recalculate_scores', [ $this, 'recalculate_scores' ] );
|
20 |
+
add_action( 'wp_ajax_wpseo_update_score', [ $this, 'save_score' ] );
|
21 |
+
add_action( 'wp_ajax_wpseo_recalculate_total', [ $this, 'get_total' ] );
|
22 |
}
|
23 |
|
24 |
/**
|
30 |
wp_die(
|
31 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: WPSEO_Utils::format_json_encode is considered safe.
|
32 |
WPSEO_Utils::format_json_encode(
|
33 |
+
[
|
34 |
'posts' => $this->calculate_posts(),
|
35 |
'terms' => $this->calculate_terms(),
|
36 |
+
]
|
37 |
)
|
38 |
);
|
39 |
}
|
96 |
*/
|
97 |
private function calculate_posts() {
|
98 |
$count_posts_query = new WP_Query(
|
99 |
+
[
|
100 |
'post_type' => 'any',
|
101 |
'meta_key' => '_yoast_wpseo_focuskw',
|
102 |
'posts_per_page' => 1,
|
103 |
'fields' => 'ids',
|
104 |
+
]
|
105 |
);
|
106 |
|
107 |
return $count_posts_query->found_posts;
|
114 |
*/
|
115 |
private function calculate_terms() {
|
116 |
$total = 0;
|
117 |
+
foreach ( get_taxonomies( [], 'objects' ) as $taxonomy ) {
|
118 |
+
$total += wp_count_terms( $taxonomy->name, [ 'hide_empty' => false ] );
|
119 |
}
|
120 |
|
121 |
return $total;
|
admin/ajax/class-shortcode-filter.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_Shortcode_Filter {
|
|
16 |
* Initialize the AJAX hooks.
|
17 |
*/
|
18 |
public function __construct() {
|
19 |
-
add_action( 'wp_ajax_wpseo_filter_shortcodes',
|
20 |
}
|
21 |
|
22 |
/**
|
@@ -27,13 +27,13 @@ class WPSEO_Shortcode_Filter {
|
|
27 |
|
28 |
$shortcodes = filter_input( INPUT_POST, 'data', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
|
29 |
|
30 |
-
$parsed_shortcodes =
|
31 |
|
32 |
foreach ( $shortcodes as $shortcode ) {
|
33 |
-
$parsed_shortcodes[] =
|
34 |
'shortcode' => $shortcode,
|
35 |
'output' => do_shortcode( $shortcode ),
|
36 |
-
|
37 |
}
|
38 |
|
39 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: WPSEO_Utils::format_json_encode is considered safe.
|
16 |
* Initialize the AJAX hooks.
|
17 |
*/
|
18 |
public function __construct() {
|
19 |
+
add_action( 'wp_ajax_wpseo_filter_shortcodes', [ $this, 'do_filter' ] );
|
20 |
}
|
21 |
|
22 |
/**
|
27 |
|
28 |
$shortcodes = filter_input( INPUT_POST, 'data', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
|
29 |
|
30 |
+
$parsed_shortcodes = [];
|
31 |
|
32 |
foreach ( $shortcodes as $shortcode ) {
|
33 |
+
$parsed_shortcodes[] = [
|
34 |
'shortcode' => $shortcode,
|
35 |
'output' => do_shortcode( $shortcode ),
|
36 |
+
];
|
37 |
}
|
38 |
|
39 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: WPSEO_Utils::format_json_encode is considered safe.
|
admin/ajax/class-yoast-dismissable-notice.php
CHANGED
@@ -56,7 +56,7 @@ class Yoast_Dismissable_Notice_Ajax {
|
|
56 |
$this->notice_name = $notice_name;
|
57 |
$this->notice_type = $notice_type;
|
58 |
|
59 |
-
add_action( 'wp_ajax_wpseo_dismiss_' . $notice_name,
|
60 |
}
|
61 |
|
62 |
/**
|
56 |
$this->notice_name = $notice_name;
|
57 |
$this->notice_type = $notice_type;
|
58 |
|
59 |
+
add_action( 'wp_ajax_wpseo_dismiss_' . $notice_name, [ $this, 'dismiss_notice' ] );
|
60 |
}
|
61 |
|
62 |
/**
|
admin/ajax/class-yoast-onpage-ajax.php
CHANGED
@@ -17,7 +17,7 @@ class Yoast_OnPage_Ajax {
|
|
17 |
* Initialize the hooks for the AJAX request.
|
18 |
*/
|
19 |
public function __construct() {
|
20 |
-
add_action( 'wp_ajax_wpseo_dismiss_onpageorg',
|
21 |
}
|
22 |
|
23 |
/**
|
17 |
* Initialize the hooks for the AJAX request.
|
18 |
*/
|
19 |
public function __construct() {
|
20 |
+
add_action( 'wp_ajax_wpseo_dismiss_onpageorg', [ $this, 'dismiss_notice' ] );
|
21 |
}
|
22 |
|
23 |
/**
|
admin/ajax/class-yoast-plugin-conflict-ajax.php
CHANGED
@@ -22,13 +22,13 @@ class Yoast_Plugin_Conflict_Ajax {
|
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
-
private $dismissed_conflicts =
|
26 |
|
27 |
/**
|
28 |
* Initialize the hooks for the AJAX request.
|
29 |
*/
|
30 |
public function __construct() {
|
31 |
-
add_action( 'wp_ajax_wpseo_dismiss_plugin_conflict',
|
32 |
}
|
33 |
|
34 |
/**
|
@@ -71,7 +71,7 @@ class Yoast_Plugin_Conflict_Ajax {
|
|
71 |
return $dismissed_conflicts[ $plugin_section ];
|
72 |
}
|
73 |
|
74 |
-
return
|
75 |
}
|
76 |
|
77 |
/**
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
+
private $dismissed_conflicts = [];
|
26 |
|
27 |
/**
|
28 |
* Initialize the hooks for the AJAX request.
|
29 |
*/
|
30 |
public function __construct() {
|
31 |
+
add_action( 'wp_ajax_wpseo_dismiss_plugin_conflict', [ $this, 'dismiss_notice' ] );
|
32 |
}
|
33 |
|
34 |
/**
|
71 |
return $dismissed_conflicts[ $plugin_section ];
|
72 |
}
|
73 |
|
74 |
+
return [];
|
75 |
}
|
76 |
|
77 |
/**
|
admin/capabilities/class-abstract-capability-manager.php
CHANGED
@@ -15,7 +15,7 @@ abstract class WPSEO_Abstract_Capability_Manager implements WPSEO_Capability_Man
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $capabilities =
|
19 |
|
20 |
/**
|
21 |
* Registers a capability.
|
@@ -81,7 +81,7 @@ abstract class WPSEO_Abstract_Capability_Manager implements WPSEO_Capability_Man
|
|
81 |
|
82 |
// Make sure we have the expected type.
|
83 |
if ( ! is_array( $filtered ) ) {
|
84 |
-
return
|
85 |
}
|
86 |
|
87 |
return $filtered;
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $capabilities = [];
|
19 |
|
20 |
/**
|
21 |
* Registers a capability.
|
81 |
|
82 |
// Make sure we have the expected type.
|
83 |
if ( ! is_array( $filtered ) ) {
|
84 |
+
return [];
|
85 |
}
|
86 |
|
87 |
return $filtered;
|
admin/capabilities/class-capability-manager-integration.php
CHANGED
@@ -35,11 +35,11 @@ class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integratio
|
|
35 |
* @return void
|
36 |
*/
|
37 |
public function register_hooks() {
|
38 |
-
add_filter( 'members_get_capabilities',
|
39 |
-
add_action( 'members_register_cap_groups',
|
40 |
|
41 |
-
add_filter( 'ure_capabilities_groups_tree',
|
42 |
-
add_filter( 'ure_custom_capability_groups',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -49,7 +49,7 @@ class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integratio
|
|
49 |
* @param array $caps Optional existing capability list.
|
50 |
* @return array
|
51 |
*/
|
52 |
-
public function get_capabilities( array $caps =
|
53 |
if ( ! did_action( 'wpseo_register_capabilities' ) ) {
|
54 |
do_action( 'wpseo_register_capabilities' );
|
55 |
}
|
@@ -68,12 +68,12 @@ class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integratio
|
|
68 |
}
|
69 |
|
70 |
// Register the yoast group.
|
71 |
-
$args =
|
72 |
'label' => esc_html__( 'Yoast SEO', 'wordpress-seo' ),
|
73 |
'caps' => $this->get_capabilities(),
|
74 |
'icon' => 'dashicons-admin-plugins',
|
75 |
'diff_added' => true,
|
76 |
-
|
77 |
members_register_cap_group( 'wordpress-seo', $args );
|
78 |
}
|
79 |
|
@@ -86,14 +86,14 @@ class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integratio
|
|
86 |
*
|
87 |
* @return array Filtered list of capabilty groups.
|
88 |
*/
|
89 |
-
public function filter_ure_capabilities_groups_tree( $groups =
|
90 |
$groups = (array) $groups;
|
91 |
|
92 |
-
$groups['wordpress-seo'] =
|
93 |
'caption' => 'Yoast SEO',
|
94 |
'parent' => 'custom',
|
95 |
'level' => 3,
|
96 |
-
|
97 |
|
98 |
return $groups;
|
99 |
}
|
@@ -108,7 +108,7 @@ class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integratio
|
|
108 |
*
|
109 |
* @return array List of filtered groups.
|
110 |
*/
|
111 |
-
public function filter_ure_custom_capability_groups( $groups =
|
112 |
if ( in_array( $cap_id, $this->get_capabilities(), true ) ) {
|
113 |
$groups = (array) $groups;
|
114 |
$groups[] = 'wordpress-seo';
|
35 |
* @return void
|
36 |
*/
|
37 |
public function register_hooks() {
|
38 |
+
add_filter( 'members_get_capabilities', [ $this, 'get_capabilities' ] );
|
39 |
+
add_action( 'members_register_cap_groups', [ $this, 'action_members_register_cap_group' ] );
|
40 |
|
41 |
+
add_filter( 'ure_capabilities_groups_tree', [ $this, 'filter_ure_capabilities_groups_tree' ] );
|
42 |
+
add_filter( 'ure_custom_capability_groups', [ $this, 'filter_ure_custom_capability_groups' ], 10, 2 );
|
43 |
}
|
44 |
|
45 |
/**
|
49 |
* @param array $caps Optional existing capability list.
|
50 |
* @return array
|
51 |
*/
|
52 |
+
public function get_capabilities( array $caps = [] ) {
|
53 |
if ( ! did_action( 'wpseo_register_capabilities' ) ) {
|
54 |
do_action( 'wpseo_register_capabilities' );
|
55 |
}
|
68 |
}
|
69 |
|
70 |
// Register the yoast group.
|
71 |
+
$args = [
|
72 |
'label' => esc_html__( 'Yoast SEO', 'wordpress-seo' ),
|
73 |
'caps' => $this->get_capabilities(),
|
74 |
'icon' => 'dashicons-admin-plugins',
|
75 |
'diff_added' => true,
|
76 |
+
];
|
77 |
members_register_cap_group( 'wordpress-seo', $args );
|
78 |
}
|
79 |
|
86 |
*
|
87 |
* @return array Filtered list of capabilty groups.
|
88 |
*/
|
89 |
+
public function filter_ure_capabilities_groups_tree( $groups = [] ) {
|
90 |
$groups = (array) $groups;
|
91 |
|
92 |
+
$groups['wordpress-seo'] = [
|
93 |
'caption' => 'Yoast SEO',
|
94 |
'parent' => 'custom',
|
95 |
'level' => 3,
|
96 |
+
];
|
97 |
|
98 |
return $groups;
|
99 |
}
|
108 |
*
|
109 |
* @return array List of filtered groups.
|
110 |
*/
|
111 |
+
public function filter_ure_custom_capability_groups( $groups = [], $cap_id = '' ) {
|
112 |
if ( in_array( $cap_id, $this->get_capabilities(), true ) ) {
|
113 |
$groups = (array) $groups;
|
114 |
$groups[] = 'wordpress-seo';
|
admin/capabilities/class-capability-manager-vip.php
CHANGED
@@ -16,7 +16,7 @@ final class WPSEO_Capability_Manager_VIP extends WPSEO_Abstract_Capability_Manag
|
|
16 |
* @return void
|
17 |
*/
|
18 |
public function add() {
|
19 |
-
$role_capabilities =
|
20 |
foreach ( $this->capabilities as $capability => $roles ) {
|
21 |
$role_capabilities = $this->get_role_capabilities( $role_capabilities, $capability, $roles );
|
22 |
}
|
@@ -36,7 +36,7 @@ final class WPSEO_Capability_Manager_VIP extends WPSEO_Abstract_Capability_Manag
|
|
36 |
$roles = wp_roles()->get_names();
|
37 |
$roles = array_keys( $roles );
|
38 |
|
39 |
-
$role_capabilities =
|
40 |
foreach ( array_keys( $this->capabilities ) as $capability ) {
|
41 |
// Allow filtering of roles.
|
42 |
$role_capabilities = $this->get_role_capabilities( $role_capabilities, $capability, $roles );
|
@@ -62,7 +62,7 @@ final class WPSEO_Capability_Manager_VIP extends WPSEO_Abstract_Capability_Manag
|
|
62 |
|
63 |
foreach ( $filtered_roles as $role ) {
|
64 |
if ( ! isset( $add_role_caps[ $role ] ) ) {
|
65 |
-
$role_capabilities[ $role ] =
|
66 |
}
|
67 |
|
68 |
$role_capabilities[ $role ][] = $capability;
|
16 |
* @return void
|
17 |
*/
|
18 |
public function add() {
|
19 |
+
$role_capabilities = [];
|
20 |
foreach ( $this->capabilities as $capability => $roles ) {
|
21 |
$role_capabilities = $this->get_role_capabilities( $role_capabilities, $capability, $roles );
|
22 |
}
|
36 |
$roles = wp_roles()->get_names();
|
37 |
$roles = array_keys( $roles );
|
38 |
|
39 |
+
$role_capabilities = [];
|
40 |
foreach ( array_keys( $this->capabilities ) as $capability ) {
|
41 |
// Allow filtering of roles.
|
42 |
$role_capabilities = $this->get_role_capabilities( $role_capabilities, $capability, $roles );
|
62 |
|
63 |
foreach ( $filtered_roles as $role ) {
|
64 |
if ( ! isset( $add_role_caps[ $role ] ) ) {
|
65 |
+
$role_capabilities[ $role ] = [];
|
66 |
}
|
67 |
|
68 |
$role_capabilities[ $role ][] = $capability;
|
admin/capabilities/class-capability-utils.php
CHANGED
@@ -22,7 +22,7 @@ class WPSEO_Capability_Utils {
|
|
22 |
return self::has( $capability );
|
23 |
}
|
24 |
|
25 |
-
return self::has_any(
|
26 |
}
|
27 |
|
28 |
/**
|
22 |
return self::has( $capability );
|
23 |
}
|
24 |
|
25 |
+
return self::has_any( [ 'wpseo_manage_options', $capability ] );
|
26 |
}
|
27 |
|
28 |
/**
|
admin/capabilities/class-register-capabilities.php
CHANGED
@@ -16,10 +16,10 @@ class WPSEO_Register_Capabilities implements WPSEO_WordPress_Integration {
|
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
-
add_action( 'wpseo_register_capabilities',
|
20 |
|
21 |
if ( is_multisite() ) {
|
22 |
-
add_action( 'user_has_cap',
|
23 |
}
|
24 |
}
|
25 |
|
@@ -31,10 +31,10 @@ class WPSEO_Register_Capabilities implements WPSEO_WordPress_Integration {
|
|
31 |
public function register() {
|
32 |
$manager = WPSEO_Capability_Manager_Factory::get();
|
33 |
|
34 |
-
$manager->register( 'wpseo_bulk_edit',
|
35 |
-
$manager->register( 'wpseo_edit_advanced_metadata',
|
36 |
|
37 |
-
$manager->register( 'wpseo_manage_options',
|
38 |
}
|
39 |
|
40 |
/**
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
+
add_action( 'wpseo_register_capabilities', [ $this, 'register' ] );
|
20 |
|
21 |
if ( is_multisite() ) {
|
22 |
+
add_action( 'user_has_cap', [ $this, 'filter_user_has_wpseo_manage_options_cap' ], 10, 4 );
|
23 |
}
|
24 |
}
|
25 |
|
31 |
public function register() {
|
32 |
$manager = WPSEO_Capability_Manager_Factory::get();
|
33 |
|
34 |
+
$manager->register( 'wpseo_bulk_edit', [ 'editor', 'wpseo_editor', 'wpseo_manager' ] );
|
35 |
+
$manager->register( 'wpseo_edit_advanced_metadata', [ 'wpseo_editor', 'wpseo_manager' ] );
|
36 |
|
37 |
+
$manager->register( 'wpseo_manage_options', [ 'administrator', 'wpseo_manager' ] );
|
38 |
}
|
39 |
|
40 |
/**
|
admin/class-add-keyword-modal.php
CHANGED
@@ -19,7 +19,7 @@ class WPSEO_Add_Keyword_Modal {
|
|
19 |
* @return array Translated text strings for the Add Keyword modal.
|
20 |
*/
|
21 |
public function get_translations() {
|
22 |
-
return
|
23 |
'title' => __( 'Would you like to add more than one keyphrase?', 'wordpress-seo' ),
|
24 |
'intro' => sprintf(
|
25 |
/* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
|
@@ -40,7 +40,7 @@ class WPSEO_Add_Keyword_Modal {
|
|
40 |
),
|
41 |
'small' => __( '1 year free support and updates included!', 'wordpress-seo' ),
|
42 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
43 |
-
|
44 |
}
|
45 |
|
46 |
/**
|
@@ -50,10 +50,10 @@ class WPSEO_Add_Keyword_Modal {
|
|
50 |
*/
|
51 |
public function get_translations_for_js() {
|
52 |
$translations = $this->get_translations();
|
53 |
-
return
|
54 |
'locale' => WPSEO_Language_Utils::get_user_locale(),
|
55 |
'intl' => $translations,
|
56 |
-
|
57 |
}
|
58 |
|
59 |
/**
|
19 |
* @return array Translated text strings for the Add Keyword modal.
|
20 |
*/
|
21 |
public function get_translations() {
|
22 |
+
return [
|
23 |
'title' => __( 'Would you like to add more than one keyphrase?', 'wordpress-seo' ),
|
24 |
'intro' => sprintf(
|
25 |
/* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
|
40 |
),
|
41 |
'small' => __( '1 year free support and updates included!', 'wordpress-seo' ),
|
42 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
43 |
+
];
|
44 |
}
|
45 |
|
46 |
/**
|
50 |
*/
|
51 |
public function get_translations_for_js() {
|
52 |
$translations = $this->get_translations();
|
53 |
+
return [
|
54 |
'locale' => WPSEO_Language_Utils::get_user_locale(),
|
55 |
'intl' => $translations,
|
56 |
+
];
|
57 |
}
|
58 |
|
59 |
/**
|
admin/class-admin-asset-analysis-worker-location.php
CHANGED
@@ -40,10 +40,10 @@ final class WPSEO_Admin_Asset_Analysis_Worker_Location implements WPSEO_Admin_As
|
|
40 |
|
41 |
$this->asset_location = WPSEO_Admin_Asset_Manager::create_default_location();
|
42 |
$this->asset = new WPSEO_Admin_Asset(
|
43 |
-
|
44 |
'name' => $name,
|
45 |
'src' => $analysis_worker,
|
46 |
-
|
47 |
);
|
48 |
}
|
49 |
|
@@ -66,7 +66,7 @@ final class WPSEO_Admin_Asset_Analysis_Worker_Location implements WPSEO_Admin_As
|
|
66 |
*/
|
67 |
public function get_url( WPSEO_Admin_Asset $asset, $type ) {
|
68 |
$scheme = wp_parse_url( $asset->get_src(), PHP_URL_SCHEME );
|
69 |
-
if ( in_array( $scheme,
|
70 |
return $asset->get_src();
|
71 |
}
|
72 |
|
40 |
|
41 |
$this->asset_location = WPSEO_Admin_Asset_Manager::create_default_location();
|
42 |
$this->asset = new WPSEO_Admin_Asset(
|
43 |
+
[
|
44 |
'name' => $name,
|
45 |
'src' => $analysis_worker,
|
46 |
+
]
|
47 |
);
|
48 |
}
|
49 |
|
66 |
*/
|
67 |
public function get_url( WPSEO_Admin_Asset $asset, $type ) {
|
68 |
$scheme = wp_parse_url( $asset->get_src(), PHP_URL_SCHEME );
|
69 |
+
if ( in_array( $scheme, [ 'http', 'https' ], true ) ) {
|
70 |
return $asset->get_src();
|
71 |
}
|
72 |
|
admin/class-admin-asset-manager.php
CHANGED
@@ -136,12 +136,12 @@ class WPSEO_Admin_Asset_Manager {
|
|
136 |
*/
|
137 |
public function special_styles() {
|
138 |
$flat_version = $this->flatten_version( WPSEO_VERSION );
|
139 |
-
$asset_args =
|
140 |
'name' => 'inside-editor',
|
141 |
'src' => 'inside-editor-' . $flat_version,
|
142 |
-
|
143 |
|
144 |
-
return
|
145 |
}
|
146 |
|
147 |
/**
|
@@ -200,7 +200,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
200 |
wp_register_script(
|
201 |
'react',
|
202 |
plugins_url( 'js/vendor/react.min.js', WPSEO_FILE ),
|
203 |
-
|
204 |
'v16.6.1',
|
205 |
true
|
206 |
);
|
@@ -208,7 +208,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
208 |
wp_register_script(
|
209 |
'react-dom',
|
210 |
plugins_url( 'js/vendor/react-dom.min.js', WPSEO_FILE ),
|
211 |
-
|
212 |
'v16.6.1',
|
213 |
true
|
214 |
);
|
@@ -216,7 +216,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
216 |
wp_register_script(
|
217 |
'lodash-base',
|
218 |
plugins_url( 'js/vendor/lodash.min.js', WPSEO_FILE ),
|
219 |
-
|
220 |
'4.17.5',
|
221 |
true
|
222 |
);
|
@@ -224,7 +224,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
224 |
wp_register_script(
|
225 |
'lodash',
|
226 |
plugins_url( 'js/vendor/lodash-noconflict.js', WPSEO_FILE ),
|
227 |
-
|
228 |
WPSEO_VERSION,
|
229 |
true
|
230 |
);
|
@@ -232,7 +232,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
232 |
wp_register_script(
|
233 |
'wp-polyfill',
|
234 |
plugins_url( 'js/dist/babel-polyfill-' . $flat_version . '.min.js', WPSEO_FILE ),
|
235 |
-
|
236 |
WPSEO_VERSION,
|
237 |
true
|
238 |
);
|
@@ -240,7 +240,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
240 |
wp_register_script(
|
241 |
'wp-element',
|
242 |
plugins_url( 'js/dist/wp-element-' . $flat_version . '.min.js', WPSEO_FILE ),
|
243 |
-
|
244 |
WPSEO_VERSION,
|
245 |
true
|
246 |
);
|
@@ -248,7 +248,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
248 |
wp_register_script(
|
249 |
'wp-api-fetch',
|
250 |
plugins_url( 'js/dist/wp-apiFetch-' . $flat_version . '.min.js', WPSEO_FILE ),
|
251 |
-
|
252 |
WPSEO_VERSION,
|
253 |
true
|
254 |
);
|
@@ -256,7 +256,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
256 |
wp_register_script(
|
257 |
'wp-components',
|
258 |
plugins_url( 'js/dist/wp-components-' . $flat_version . '.min.js', WPSEO_FILE ),
|
259 |
-
|
260 |
WPSEO_VERSION,
|
261 |
true
|
262 |
);
|
@@ -264,7 +264,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
264 |
wp_register_script(
|
265 |
'wp-data',
|
266 |
plugins_url( 'js/dist/wp-data-' . $flat_version . '.min.js', WPSEO_FILE ),
|
267 |
-
|
268 |
WPSEO_VERSION,
|
269 |
true
|
270 |
);
|
@@ -272,7 +272,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
272 |
wp_register_script(
|
273 |
'wp-i18n',
|
274 |
plugins_url( 'js/dist/wp-i18n-' . $flat_version . '.min.js', WPSEO_FILE ),
|
275 |
-
|
276 |
WPSEO_VERSION,
|
277 |
true
|
278 |
);
|
@@ -280,7 +280,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
280 |
wp_register_script(
|
281 |
'wp-rich-text',
|
282 |
plugins_url( 'js/dist/wp-rich-text-' . $flat_version . '.min.js', WPSEO_FILE ),
|
283 |
-
|
284 |
WPSEO_VERSION,
|
285 |
true
|
286 |
);
|
@@ -288,7 +288,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
288 |
wp_register_script(
|
289 |
'wp-compose',
|
290 |
plugins_url( 'js/dist/wp-compose-' . $flat_version . '.min.js', WPSEO_FILE ),
|
291 |
-
|
292 |
WPSEO_VERSION,
|
293 |
true
|
294 |
);
|
@@ -328,40 +328,40 @@ class WPSEO_Admin_Asset_Manager {
|
|
328 |
|
329 |
$flat_version = $this->flatten_version( WPSEO_VERSION );
|
330 |
|
331 |
-
return
|
332 |
-
|
333 |
'name' => 'commons',
|
334 |
// Load webpack-commons for bundle support.
|
335 |
'src' => 'commons-' . $flat_version,
|
336 |
'in_footer' => false,
|
337 |
-
'deps' =>
|
338 |
'wp-polyfill',
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
'name' => 'search-appearance',
|
343 |
'src' => 'search-appearance-' . $flat_version,
|
344 |
-
'deps' =>
|
345 |
'wp-api',
|
346 |
self::PREFIX . 'components',
|
347 |
self::PREFIX . 'commons',
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
'name' => 'yoast-modal',
|
352 |
'src' => 'wp-seo-modal-' . $flat_version,
|
353 |
-
'deps' =>
|
354 |
'jquery',
|
355 |
'wp-element',
|
356 |
'wp-i18n',
|
357 |
self::PREFIX . 'components',
|
358 |
self::PREFIX . 'commons',
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
'name' => 'admin-script',
|
363 |
'src' => 'wp-seo-admin-' . $flat_version,
|
364 |
-
'deps' =>
|
365 |
'lodash',
|
366 |
'jquery',
|
367 |
'jquery-ui-core',
|
@@ -369,45 +369,45 @@ class WPSEO_Admin_Asset_Manager {
|
|
369 |
self::PREFIX . 'select2',
|
370 |
self::PREFIX . 'select2-translations',
|
371 |
self::PREFIX . 'commons',
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
'name' => 'admin-media',
|
376 |
'src' => 'wp-seo-admin-media-' . $flat_version,
|
377 |
-
'deps' =>
|
378 |
'jquery',
|
379 |
'jquery-ui-core',
|
380 |
self::PREFIX . 'commons',
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
'name' => 'network-admin-script',
|
385 |
'src' => 'wp-seo-network-admin-' . $flat_version,
|
386 |
-
'deps' =>
|
387 |
'jquery',
|
388 |
self::PREFIX . 'commons',
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
'name' => 'bulk-editor',
|
393 |
'src' => 'wp-seo-bulk-editor-' . $flat_version,
|
394 |
-
'deps' =>
|
395 |
'jquery',
|
396 |
self::PREFIX . 'commons',
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
'name' => 'admin-global-script',
|
401 |
'src' => 'wp-seo-admin-global-' . $flat_version,
|
402 |
-
'deps' =>
|
403 |
'jquery',
|
404 |
self::PREFIX . 'commons',
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
'name' => 'metabox',
|
409 |
'src' => 'wp-seo-metabox-' . $flat_version,
|
410 |
-
'deps' =>
|
411 |
'jquery',
|
412 |
'wp-element',
|
413 |
'wp-i18n',
|
@@ -416,33 +416,33 @@ class WPSEO_Admin_Asset_Manager {
|
|
416 |
self::PREFIX . 'select2',
|
417 |
self::PREFIX . 'select2-translations',
|
418 |
self::PREFIX . 'commons',
|
419 |
-
|
420 |
'in_footer' => false,
|
421 |
-
|
422 |
-
|
423 |
'name' => 'featured-image',
|
424 |
'src' => 'wp-seo-featured-image-' . $flat_version,
|
425 |
-
'deps' =>
|
426 |
'jquery',
|
427 |
self::PREFIX . 'commons',
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
'name' => 'admin-gsc',
|
432 |
'src' => 'wp-seo-admin-gsc-' . $flat_version,
|
433 |
-
'deps' =>
|
434 |
'wp-element',
|
435 |
'wp-i18n',
|
436 |
self::PREFIX . 'styled-components',
|
437 |
self::PREFIX . 'components',
|
438 |
self::PREFIX . 'commons',
|
439 |
-
|
440 |
'in_footer' => false,
|
441 |
-
|
442 |
-
|
443 |
'name' => 'post-scraper',
|
444 |
'src' => 'wp-seo-post-scraper-' . $flat_version,
|
445 |
-
'deps' =>
|
446 |
'wp-util',
|
447 |
'wp-api',
|
448 |
'wp-sanitize',
|
@@ -457,12 +457,12 @@ class WPSEO_Admin_Asset_Manager {
|
|
457 |
self::PREFIX . 'analysis',
|
458 |
self::PREFIX . 'components',
|
459 |
self::PREFIX . 'commons',
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
'name' => 'term-scraper',
|
464 |
'src' => 'wp-seo-term-scraper-' . $flat_version,
|
465 |
-
'deps' =>
|
466 |
'wp-sanitize',
|
467 |
'wp-element',
|
468 |
'wp-i18n',
|
@@ -473,40 +473,40 @@ class WPSEO_Admin_Asset_Manager {
|
|
473 |
self::PREFIX . 'analysis',
|
474 |
self::PREFIX . 'components',
|
475 |
self::PREFIX . 'commons',
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
'name' => 'replacevar-plugin',
|
480 |
'src' => 'wp-seo-replacevar-plugin-' . $flat_version,
|
481 |
-
'deps' =>
|
482 |
self::PREFIX . 'analysis',
|
483 |
self::PREFIX . 'components',
|
484 |
self::PREFIX . 'commons',
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
'name' => 'shortcode-plugin',
|
489 |
'src' => 'wp-seo-shortcode-plugin-' . $flat_version,
|
490 |
-
'deps' =>
|
491 |
self::PREFIX . 'analysis',
|
492 |
self::PREFIX . 'commons',
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
'name' => 'recalculate',
|
497 |
'src' => 'wp-seo-recalculate-' . $flat_version,
|
498 |
-
'deps' =>
|
499 |
'jquery',
|
500 |
'jquery-ui-core',
|
501 |
'jquery-ui-progressbar',
|
502 |
self::PREFIX . 'analysis',
|
503 |
self::PREFIX . 'commons',
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
'name' => 'primary-category',
|
508 |
'src' => 'wp-seo-metabox-category-' . $flat_version,
|
509 |
-
'deps' =>
|
510 |
'jquery',
|
511 |
'wp-util',
|
512 |
'wp-element',
|
@@ -516,141 +516,141 @@ class WPSEO_Admin_Asset_Manager {
|
|
516 |
self::PREFIX . 'analysis',
|
517 |
self::PREFIX . 'components',
|
518 |
self::PREFIX . 'commons',
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
'name' => 'select2',
|
523 |
'src' => 'select2/select2.full',
|
524 |
'suffix' => '.min',
|
525 |
-
'deps' =>
|
526 |
'jquery',
|
527 |
-
|
528 |
'version' => '4.0.3',
|
529 |
-
|
530 |
-
|
531 |
'name' => 'select2-translations',
|
532 |
'src' => 'select2/i18n/' . $select2_language,
|
533 |
-
'deps' =>
|
534 |
'jquery',
|
535 |
self::PREFIX . 'select2',
|
536 |
-
|
537 |
'version' => '4.0.3',
|
538 |
'suffix' => '',
|
539 |
-
|
540 |
-
|
541 |
'name' => 'configuration-wizard',
|
542 |
'src' => 'configuration-wizard-' . $flat_version,
|
543 |
-
'deps' =>
|
544 |
'jquery',
|
545 |
'wp-element',
|
546 |
'wp-i18n',
|
547 |
'wp-api',
|
548 |
self::PREFIX . 'components',
|
549 |
self::PREFIX . 'commons',
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
'name' => 'reindex-links',
|
554 |
'src' => 'wp-seo-reindex-links-' . $flat_version,
|
555 |
-
'deps' =>
|
556 |
'jquery',
|
557 |
'jquery-ui-core',
|
558 |
'jquery-ui-progressbar',
|
559 |
self::PREFIX . 'commons',
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
'name' => 'edit-page-script',
|
564 |
'src' => 'wp-seo-edit-page-' . $flat_version,
|
565 |
-
'deps' =>
|
566 |
'jquery',
|
567 |
self::PREFIX . 'commons',
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
'name' => 'quick-edit-handler',
|
572 |
'src' => 'wp-seo-quick-edit-handler-' . $flat_version,
|
573 |
-
'deps' =>
|
574 |
'jquery',
|
575 |
self::PREFIX . 'commons',
|
576 |
-
|
577 |
'in_footer' => true,
|
578 |
-
|
579 |
-
|
580 |
'name' => 'api',
|
581 |
'src' => 'wp-seo-api-' . $flat_version,
|
582 |
-
'deps' =>
|
583 |
'wp-api',
|
584 |
'jquery',
|
585 |
self::PREFIX . 'commons',
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
'name' => 'dashboard-widget',
|
590 |
'src' => 'wp-seo-dashboard-widget-' . $flat_version,
|
591 |
-
'deps' =>
|
592 |
self::PREFIX . 'api',
|
593 |
'jquery',
|
594 |
'wp-element',
|
595 |
'wp-i18n',
|
596 |
self::PREFIX . 'components',
|
597 |
self::PREFIX . 'commons',
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
'name' => 'filter-explanation',
|
602 |
'src' => 'wp-seo-filter-explanation-' . $flat_version,
|
603 |
-
'deps' =>
|
604 |
'jquery',
|
605 |
self::PREFIX . 'commons',
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
'name' => 'analysis',
|
610 |
'src' => 'analysis-' . $flat_version,
|
611 |
-
'deps' =>
|
612 |
'lodash',
|
613 |
self::PREFIX . 'commons',
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
'name' => 'components',
|
618 |
'src' => 'components-' . $flat_version,
|
619 |
-
'deps' =>
|
620 |
self::PREFIX . 'analysis',
|
621 |
self::PREFIX . 'styled-components',
|
622 |
self::PREFIX . 'commons',
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
'name' => 'structured-data-blocks',
|
627 |
'src' => 'wp-seo-structured-data-blocks-' . $flat_version,
|
628 |
-
'deps' =>
|
629 |
'wp-blocks',
|
630 |
'wp-i18n',
|
631 |
'wp-element',
|
632 |
self::PREFIX . 'styled-components',
|
633 |
self::PREFIX . 'commons',
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
'name' => 'styled-components',
|
638 |
'src' => 'styled-components-' . $flat_version,
|
639 |
-
'deps' =>
|
640 |
'wp-element',
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
'name' => 'help-scout-beacon',
|
645 |
'src' => 'help-scout-beacon-' . $flat_version,
|
646 |
'in_footer' => false,
|
647 |
-
'deps' =>
|
648 |
self::PREFIX . 'styled-components',
|
649 |
'wp-element',
|
650 |
'wp-i18n',
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
}
|
655 |
|
656 |
/**
|
@@ -663,92 +663,92 @@ class WPSEO_Admin_Asset_Manager {
|
|
663 |
protected function styles_to_be_registered() {
|
664 |
$flat_version = $this->flatten_version( WPSEO_VERSION );
|
665 |
|
666 |
-
return
|
667 |
-
|
668 |
'name' => 'admin-css',
|
669 |
'src' => 'yst_plugin_tools-' . $flat_version,
|
670 |
-
'deps' =>
|
671 |
-
|
672 |
-
|
673 |
'name' => 'toggle-switch',
|
674 |
'src' => 'toggle-switch-' . $flat_version,
|
675 |
-
|
676 |
-
|
677 |
'name' => 'dismissible',
|
678 |
'src' => 'wpseo-dismissible-' . $flat_version,
|
679 |
-
|
680 |
-
|
681 |
'name' => 'alerts',
|
682 |
'src' => 'alerts-' . $flat_version,
|
683 |
-
|
684 |
-
|
685 |
'name' => 'edit-page',
|
686 |
'src' => 'edit-page-' . $flat_version,
|
687 |
-
|
688 |
-
|
689 |
'name' => 'featured-image',
|
690 |
'src' => 'featured-image-' . $flat_version,
|
691 |
-
|
692 |
-
|
693 |
'name' => 'metabox-css',
|
694 |
'src' => 'metabox-' . $flat_version,
|
695 |
-
'deps' =>
|
696 |
self::PREFIX . 'select2',
|
697 |
self::PREFIX . 'admin-css',
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
'name' => 'wp-dashboard',
|
702 |
'src' => 'dashboard-' . $flat_version,
|
703 |
-
|
704 |
-
|
705 |
'name' => 'scoring',
|
706 |
'src' => 'yst_seo_score-' . $flat_version,
|
707 |
-
|
708 |
-
|
709 |
'name' => 'adminbar',
|
710 |
'src' => 'adminbar-' . $flat_version,
|
711 |
-
'deps' =>
|
712 |
'admin-bar',
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
'name' => 'primary-category',
|
717 |
'src' => 'metabox-primary-category-' . $flat_version,
|
718 |
-
|
719 |
-
|
720 |
'name' => 'select2',
|
721 |
'src' => 'select2/select2',
|
722 |
'suffix' => '.min',
|
723 |
'version' => '4.0.1',
|
724 |
'rtl' => false,
|
725 |
-
|
726 |
-
|
727 |
'name' => 'admin-global',
|
728 |
'src' => 'admin-global-' . $flat_version,
|
729 |
-
|
730 |
-
|
731 |
'name' => 'yoast-components',
|
732 |
'src' => 'yoast-components-' . $flat_version,
|
733 |
-
|
734 |
-
|
735 |
'name' => 'extensions',
|
736 |
'src' => 'yoast-extensions-' . $flat_version,
|
737 |
-
|
738 |
-
|
739 |
'name' => 'filter-explanation',
|
740 |
'src' => 'filter-explanation-' . $flat_version,
|
741 |
-
|
742 |
-
|
743 |
'name' => 'search-appearance',
|
744 |
'src' => 'search-appearance-' . $flat_version,
|
745 |
-
|
746 |
-
|
747 |
'name' => 'structured-data-blocks',
|
748 |
'src' => 'structured-data-blocks-' . $flat_version,
|
749 |
-
'deps' =>
|
750 |
-
|
751 |
-
|
752 |
}
|
753 |
|
754 |
/**
|
@@ -761,7 +761,7 @@ class WPSEO_Admin_Asset_Manager {
|
|
761 |
*/
|
762 |
protected function get_url( WPSEO_Admin_Asset $asset, $type ) {
|
763 |
$scheme = wp_parse_url( $asset->get_src(), PHP_URL_SCHEME );
|
764 |
-
if ( in_array( $scheme,
|
765 |
return $asset->get_src();
|
766 |
}
|
767 |
|
136 |
*/
|
137 |
public function special_styles() {
|
138 |
$flat_version = $this->flatten_version( WPSEO_VERSION );
|
139 |
+
$asset_args = [
|
140 |
'name' => 'inside-editor',
|
141 |
'src' => 'inside-editor-' . $flat_version,
|
142 |
+
];
|
143 |
|
144 |
+
return [ 'inside-editor' => new WPSEO_Admin_Asset( $asset_args ) ];
|
145 |
}
|
146 |
|
147 |
/**
|
200 |
wp_register_script(
|
201 |
'react',
|
202 |
plugins_url( 'js/vendor/react.min.js', WPSEO_FILE ),
|
203 |
+
[],
|
204 |
'v16.6.1',
|
205 |
true
|
206 |
);
|
208 |
wp_register_script(
|
209 |
'react-dom',
|
210 |
plugins_url( 'js/vendor/react-dom.min.js', WPSEO_FILE ),
|
211 |
+
[ 'react' ],
|
212 |
'v16.6.1',
|
213 |
true
|
214 |
);
|
216 |
wp_register_script(
|
217 |
'lodash-base',
|
218 |
plugins_url( 'js/vendor/lodash.min.js', WPSEO_FILE ),
|
219 |
+
[],
|
220 |
'4.17.5',
|
221 |
true
|
222 |
);
|
224 |
wp_register_script(
|
225 |
'lodash',
|
226 |
plugins_url( 'js/vendor/lodash-noconflict.js', WPSEO_FILE ),
|
227 |
+
[ 'lodash-base' ],
|
228 |
WPSEO_VERSION,
|
229 |
true
|
230 |
);
|
232 |
wp_register_script(
|
233 |
'wp-polyfill',
|
234 |
plugins_url( 'js/dist/babel-polyfill-' . $flat_version . '.min.js', WPSEO_FILE ),
|
235 |
+
[],
|
236 |
WPSEO_VERSION,
|
237 |
true
|
238 |
);
|
240 |
wp_register_script(
|
241 |
'wp-element',
|
242 |
plugins_url( 'js/dist/wp-element-' . $flat_version . '.min.js', WPSEO_FILE ),
|
243 |
+
[ 'lodash', 'wp-polyfill', 'react', 'react-dom' ],
|
244 |
WPSEO_VERSION,
|
245 |
true
|
246 |
);
|
248 |
wp_register_script(
|
249 |
'wp-api-fetch',
|
250 |
plugins_url( 'js/dist/wp-apiFetch-' . $flat_version . '.min.js', WPSEO_FILE ),
|
251 |
+
[ 'wp-i18n', 'wp-polyfill' ],
|
252 |
WPSEO_VERSION,
|
253 |
true
|
254 |
);
|
256 |
wp_register_script(
|
257 |
'wp-components',
|
258 |
plugins_url( 'js/dist/wp-components-' . $flat_version . '.min.js', WPSEO_FILE ),
|
259 |
+
[ 'lodash', 'wp-api-fetch', 'wp-i18n', 'wp-polyfill', 'wp-compose' ],
|
260 |
WPSEO_VERSION,
|
261 |
true
|
262 |
);
|
264 |
wp_register_script(
|
265 |
'wp-data',
|
266 |
plugins_url( 'js/dist/wp-data-' . $flat_version . '.min.js', WPSEO_FILE ),
|
267 |
+
[ 'lodash', 'wp-element', 'wp-polyfill', 'wp-compose' ],
|
268 |
WPSEO_VERSION,
|
269 |
true
|
270 |
);
|
272 |
wp_register_script(
|
273 |
'wp-i18n',
|
274 |
plugins_url( 'js/dist/wp-i18n-' . $flat_version . '.min.js', WPSEO_FILE ),
|
275 |
+
[ 'wp-polyfill' ],
|
276 |
WPSEO_VERSION,
|
277 |
true
|
278 |
);
|
280 |
wp_register_script(
|
281 |
'wp-rich-text',
|
282 |
plugins_url( 'js/dist/wp-rich-text-' . $flat_version . '.min.js', WPSEO_FILE ),
|
283 |
+
[ 'lodash', 'wp-polyfill', 'wp-data' ],
|
284 |
WPSEO_VERSION,
|
285 |
true
|
286 |
);
|
288 |
wp_register_script(
|
289 |
'wp-compose',
|
290 |
plugins_url( 'js/dist/wp-compose-' . $flat_version . '.min.js', WPSEO_FILE ),
|
291 |
+
[ 'lodash', 'wp-polyfill' ],
|
292 |
WPSEO_VERSION,
|
293 |
true
|
294 |
);
|
328 |
|
329 |
$flat_version = $this->flatten_version( WPSEO_VERSION );
|
330 |
|
331 |
+
return [
|
332 |
+
[
|
333 |
'name' => 'commons',
|
334 |
// Load webpack-commons for bundle support.
|
335 |
'src' => 'commons-' . $flat_version,
|
336 |
'in_footer' => false,
|
337 |
+
'deps' => [
|
338 |
'wp-polyfill',
|
339 |
+
],
|
340 |
+
],
|
341 |
+
[
|
342 |
'name' => 'search-appearance',
|
343 |
'src' => 'search-appearance-' . $flat_version,
|
344 |
+
'deps' => [
|
345 |
'wp-api',
|
346 |
self::PREFIX . 'components',
|
347 |
self::PREFIX . 'commons',
|
348 |
+
],
|
349 |
+
],
|
350 |
+
[
|
351 |
'name' => 'yoast-modal',
|
352 |
'src' => 'wp-seo-modal-' . $flat_version,
|
353 |
+
'deps' => [
|
354 |
'jquery',
|
355 |
'wp-element',
|
356 |
'wp-i18n',
|
357 |
self::PREFIX . 'components',
|
358 |
self::PREFIX . 'commons',
|
359 |
+
],
|
360 |
+
],
|
361 |
+
[
|
362 |
'name' => 'admin-script',
|
363 |
'src' => 'wp-seo-admin-' . $flat_version,
|
364 |
+
'deps' => [
|
365 |
'lodash',
|
366 |
'jquery',
|
367 |
'jquery-ui-core',
|
369 |
self::PREFIX . 'select2',
|
370 |
self::PREFIX . 'select2-translations',
|
371 |
self::PREFIX . 'commons',
|
372 |
+
],
|
373 |
+
],
|
374 |
+
[
|
375 |
'name' => 'admin-media',
|
376 |
'src' => 'wp-seo-admin-media-' . $flat_version,
|
377 |
+
'deps' => [
|
378 |
'jquery',
|
379 |
'jquery-ui-core',
|
380 |
self::PREFIX . 'commons',
|
381 |
+
],
|
382 |
+
],
|
383 |
+
[
|
384 |
'name' => 'network-admin-script',
|
385 |
'src' => 'wp-seo-network-admin-' . $flat_version,
|
386 |
+
'deps' => [
|
387 |
'jquery',
|
388 |
self::PREFIX . 'commons',
|
389 |
+
],
|
390 |
+
],
|
391 |
+
[
|
392 |
'name' => 'bulk-editor',
|
393 |
'src' => 'wp-seo-bulk-editor-' . $flat_version,
|
394 |
+
'deps' => [
|
395 |
'jquery',
|
396 |
self::PREFIX . 'commons',
|
397 |
+
],
|
398 |
+
],
|
399 |
+
[
|
400 |
'name' => 'admin-global-script',
|
401 |
'src' => 'wp-seo-admin-global-' . $flat_version,
|
402 |
+
'deps' => [
|
403 |
'jquery',
|
404 |
self::PREFIX . 'commons',
|
405 |
+
],
|
406 |
+
],
|
407 |
+
[
|
408 |
'name' => 'metabox',
|
409 |
'src' => 'wp-seo-metabox-' . $flat_version,
|
410 |
+
'deps' => [
|
411 |
'jquery',
|
412 |
'wp-element',
|
413 |
'wp-i18n',
|
416 |
self::PREFIX . 'select2',
|
417 |
self::PREFIX . 'select2-translations',
|
418 |
self::PREFIX . 'commons',
|
419 |
+
],
|
420 |
'in_footer' => false,
|
421 |
+
],
|
422 |
+
[
|
423 |
'name' => 'featured-image',
|
424 |
'src' => 'wp-seo-featured-image-' . $flat_version,
|
425 |
+
'deps' => [
|
426 |
'jquery',
|
427 |
self::PREFIX . 'commons',
|
428 |
+
],
|
429 |
+
],
|
430 |
+
[
|
431 |
'name' => 'admin-gsc',
|
432 |
'src' => 'wp-seo-admin-gsc-' . $flat_version,
|
433 |
+
'deps' => [
|
434 |
'wp-element',
|
435 |
'wp-i18n',
|
436 |
self::PREFIX . 'styled-components',
|
437 |
self::PREFIX . 'components',
|
438 |
self::PREFIX . 'commons',
|
439 |
+
],
|
440 |
'in_footer' => false,
|
441 |
+
],
|
442 |
+
[
|
443 |
'name' => 'post-scraper',
|
444 |
'src' => 'wp-seo-post-scraper-' . $flat_version,
|
445 |
+
'deps' => [
|
446 |
'wp-util',
|
447 |
'wp-api',
|
448 |
'wp-sanitize',
|
457 |
self::PREFIX . 'analysis',
|
458 |
self::PREFIX . 'components',
|
459 |
self::PREFIX . 'commons',
|
460 |
+
],
|
461 |
+
],
|
462 |
+
[
|
463 |
'name' => 'term-scraper',
|
464 |
'src' => 'wp-seo-term-scraper-' . $flat_version,
|
465 |
+
'deps' => [
|
466 |
'wp-sanitize',
|
467 |
'wp-element',
|
468 |
'wp-i18n',
|
473 |
self::PREFIX . 'analysis',
|
474 |
self::PREFIX . 'components',
|
475 |
self::PREFIX . 'commons',
|
476 |
+
],
|
477 |
+
],
|
478 |
+
[
|
479 |
'name' => 'replacevar-plugin',
|
480 |
'src' => 'wp-seo-replacevar-plugin-' . $flat_version,
|
481 |
+
'deps' => [
|
482 |
self::PREFIX . 'analysis',
|
483 |
self::PREFIX . 'components',
|
484 |
self::PREFIX . 'commons',
|
485 |
+
],
|
486 |
+
],
|
487 |
+
[
|
488 |
'name' => 'shortcode-plugin',
|
489 |
'src' => 'wp-seo-shortcode-plugin-' . $flat_version,
|
490 |
+
'deps' => [
|
491 |
self::PREFIX . 'analysis',
|
492 |
self::PREFIX . 'commons',
|
493 |
+
],
|
494 |
+
],
|
495 |
+
[
|
496 |
'name' => 'recalculate',
|
497 |
'src' => 'wp-seo-recalculate-' . $flat_version,
|
498 |
+
'deps' => [
|
499 |
'jquery',
|
500 |
'jquery-ui-core',
|
501 |
'jquery-ui-progressbar',
|
502 |
self::PREFIX . 'analysis',
|
503 |
self::PREFIX . 'commons',
|
504 |
+
],
|
505 |
+
],
|
506 |
+
[
|
507 |
'name' => 'primary-category',
|
508 |
'src' => 'wp-seo-metabox-category-' . $flat_version,
|
509 |
+
'deps' => [
|
510 |
'jquery',
|
511 |
'wp-util',
|
512 |
'wp-element',
|
516 |
self::PREFIX . 'analysis',
|
517 |
self::PREFIX . 'components',
|
518 |
self::PREFIX . 'commons',
|
519 |
+
],
|
520 |
+
],
|
521 |
+
[
|
522 |
'name' => 'select2',
|
523 |
'src' => 'select2/select2.full',
|
524 |
'suffix' => '.min',
|
525 |
+
'deps' => [
|
526 |
'jquery',
|
527 |
+
],
|
528 |
'version' => '4.0.3',
|
529 |
+
],
|
530 |
+
[
|
531 |
'name' => 'select2-translations',
|
532 |
'src' => 'select2/i18n/' . $select2_language,
|
533 |
+
'deps' => [
|
534 |
'jquery',
|
535 |
self::PREFIX . 'select2',
|
536 |
+
],
|
537 |
'version' => '4.0.3',
|
538 |
'suffix' => '',
|
539 |
+
],
|
540 |
+
[
|
541 |
'name' => 'configuration-wizard',
|
542 |
'src' => 'configuration-wizard-' . $flat_version,
|
543 |
+
'deps' => [
|
544 |
'jquery',
|
545 |
'wp-element',
|
546 |
'wp-i18n',
|
547 |
'wp-api',
|
548 |
self::PREFIX . 'components',
|
549 |
self::PREFIX . 'commons',
|
550 |
+
],
|
551 |
+
],
|
552 |
+
[
|
553 |
'name' => 'reindex-links',
|
554 |
'src' => 'wp-seo-reindex-links-' . $flat_version,
|
555 |
+
'deps' => [
|
556 |
'jquery',
|
557 |
'jquery-ui-core',
|
558 |
'jquery-ui-progressbar',
|
559 |
self::PREFIX . 'commons',
|
560 |
+
],
|
561 |
+
],
|
562 |
+
[
|
563 |
'name' => 'edit-page-script',
|
564 |
'src' => 'wp-seo-edit-page-' . $flat_version,
|
565 |
+
'deps' => [
|
566 |
'jquery',
|
567 |
self::PREFIX . 'commons',
|
568 |
+
],
|
569 |
+
],
|
570 |
+
[
|
571 |
'name' => 'quick-edit-handler',
|
572 |
'src' => 'wp-seo-quick-edit-handler-' . $flat_version,
|
573 |
+
'deps' => [
|
574 |
'jquery',
|
575 |
self::PREFIX . 'commons',
|
576 |
+
],
|
577 |
'in_footer' => true,
|
578 |
+
],
|
579 |
+
[
|
580 |
'name' => 'api',
|
581 |
'src' => 'wp-seo-api-' . $flat_version,
|
582 |
+
'deps' => [
|
583 |
'wp-api',
|
584 |
'jquery',
|
585 |
self::PREFIX . 'commons',
|
586 |
+
],
|
587 |
+
],
|
588 |
+
[
|
589 |
'name' => 'dashboard-widget',
|
590 |
'src' => 'wp-seo-dashboard-widget-' . $flat_version,
|
591 |
+
'deps' => [
|
592 |
self::PREFIX . 'api',
|
593 |
'jquery',
|
594 |
'wp-element',
|
595 |
'wp-i18n',
|
596 |
self::PREFIX . 'components',
|
597 |
self::PREFIX . 'commons',
|
598 |
+
],
|
599 |
+
],
|
600 |
+
[
|
601 |
'name' => 'filter-explanation',
|
602 |
'src' => 'wp-seo-filter-explanation-' . $flat_version,
|
603 |
+
'deps' => [
|
604 |
'jquery',
|
605 |
self::PREFIX . 'commons',
|
606 |
+
],
|
607 |
+
],
|
608 |
+
[
|
609 |
'name' => 'analysis',
|
610 |
'src' => 'analysis-' . $flat_version,
|
611 |
+
'deps' => [
|
612 |
'lodash',
|
613 |
self::PREFIX . 'commons',
|
614 |
+
],
|
615 |
+
],
|
616 |
+
[
|
617 |
'name' => 'components',
|
618 |
'src' => 'components-' . $flat_version,
|
619 |
+
'deps' => [
|
620 |
self::PREFIX . 'analysis',
|
621 |
self::PREFIX . 'styled-components',
|
622 |
self::PREFIX . 'commons',
|
623 |
+
],
|
624 |
+
],
|
625 |
+
[
|
626 |
'name' => 'structured-data-blocks',
|
627 |
'src' => 'wp-seo-structured-data-blocks-' . $flat_version,
|
628 |
+
'deps' => [
|
629 |
'wp-blocks',
|
630 |
'wp-i18n',
|
631 |
'wp-element',
|
632 |
self::PREFIX . 'styled-components',
|
633 |
self::PREFIX . 'commons',
|
634 |
+
],
|
635 |
+
],
|
636 |
+
[
|
637 |
'name' => 'styled-components',
|
638 |
'src' => 'styled-components-' . $flat_version,
|
639 |
+
'deps' => [
|
640 |
'wp-element',
|
641 |
+
],
|
642 |
+
],
|
643 |
+
[
|
644 |
'name' => 'help-scout-beacon',
|
645 |
'src' => 'help-scout-beacon-' . $flat_version,
|
646 |
'in_footer' => false,
|
647 |
+
'deps' => [
|
648 |
self::PREFIX . 'styled-components',
|
649 |
'wp-element',
|
650 |
'wp-i18n',
|
651 |
+
],
|
652 |
+
],
|
653 |
+
];
|
654 |
}
|
655 |
|
656 |
/**
|
663 |
protected function styles_to_be_registered() {
|
664 |
$flat_version = $this->flatten_version( WPSEO_VERSION );
|
665 |
|
666 |
+
return [
|
667 |
+
[
|
668 |
'name' => 'admin-css',
|
669 |
'src' => 'yst_plugin_tools-' . $flat_version,
|
670 |
+
'deps' => [ self::PREFIX . 'toggle-switch' ],
|
671 |
+
],
|
672 |
+
[
|
673 |
'name' => 'toggle-switch',
|
674 |
'src' => 'toggle-switch-' . $flat_version,
|
675 |
+
],
|
676 |
+
[
|
677 |
'name' => 'dismissible',
|
678 |
'src' => 'wpseo-dismissible-' . $flat_version,
|
679 |
+
],
|
680 |
+
[
|
681 |
'name' => 'alerts',
|
682 |
'src' => 'alerts-' . $flat_version,
|
683 |
+
],
|
684 |
+
[
|
685 |
'name' => 'edit-page',
|
686 |
'src' => 'edit-page-' . $flat_version,
|
687 |
+
],
|
688 |
+
[
|
689 |
'name' => 'featured-image',
|
690 |
'src' => 'featured-image-' . $flat_version,
|
691 |
+
],
|
692 |
+
[
|
693 |
'name' => 'metabox-css',
|
694 |
'src' => 'metabox-' . $flat_version,
|
695 |
+
'deps' => [
|
696 |
self::PREFIX . 'select2',
|
697 |
self::PREFIX . 'admin-css',
|
698 |
+
],
|
699 |
+
],
|
700 |
+
[
|
701 |
'name' => 'wp-dashboard',
|
702 |
'src' => 'dashboard-' . $flat_version,
|
703 |
+
],
|
704 |
+
[
|
705 |
'name' => 'scoring',
|
706 |
'src' => 'yst_seo_score-' . $flat_version,
|
707 |
+
],
|
708 |
+
[
|
709 |
'name' => 'adminbar',
|
710 |
'src' => 'adminbar-' . $flat_version,
|
711 |
+
'deps' => [
|
712 |
'admin-bar',
|
713 |
+
],
|
714 |
+
],
|
715 |
+
[
|
716 |
'name' => 'primary-category',
|
717 |
'src' => 'metabox-primary-category-' . $flat_version,
|
718 |
+
],
|
719 |
+
[
|
720 |
'name' => 'select2',
|
721 |
'src' => 'select2/select2',
|
722 |
'suffix' => '.min',
|
723 |
'version' => '4.0.1',
|
724 |
'rtl' => false,
|
725 |
+
],
|
726 |
+
[
|
727 |
'name' => 'admin-global',
|
728 |
'src' => 'admin-global-' . $flat_version,
|
729 |
+
],
|
730 |
+
[
|
731 |
'name' => 'yoast-components',
|
732 |
'src' => 'yoast-components-' . $flat_version,
|
733 |
+
],
|
734 |
+
[
|
735 |
'name' => 'extensions',
|
736 |
'src' => 'yoast-extensions-' . $flat_version,
|
737 |
+
],
|
738 |
+
[
|
739 |
'name' => 'filter-explanation',
|
740 |
'src' => 'filter-explanation-' . $flat_version,
|
741 |
+
],
|
742 |
+
[
|
743 |
'name' => 'search-appearance',
|
744 |
'src' => 'search-appearance-' . $flat_version,
|
745 |
+
],
|
746 |
+
[
|
747 |
'name' => 'structured-data-blocks',
|
748 |
'src' => 'structured-data-blocks-' . $flat_version,
|
749 |
+
'deps' => [ 'wp-edit-blocks' ],
|
750 |
+
],
|
751 |
+
];
|
752 |
}
|
753 |
|
754 |
/**
|
761 |
*/
|
762 |
protected function get_url( WPSEO_Admin_Asset $asset, $type ) {
|
763 |
$scheme = wp_parse_url( $asset->get_src(), PHP_URL_SCHEME );
|
764 |
+
if ( in_array( $scheme, [ 'http', 'https' ], true ) ) {
|
765 |
return $asset->get_src();
|
766 |
}
|
767 |
|
admin/class-admin-asset-yoast-components-l10n.php
CHANGED
@@ -18,10 +18,10 @@ final class WPSEO_Admin_Asset_Yoast_Components_L10n {
|
|
18 |
* @return void
|
19 |
*/
|
20 |
public function localize_script( $script_handle ) {
|
21 |
-
$translations =
|
22 |
'yoast-components' => $this->get_translations( 'yoast-components' ),
|
23 |
'wordpress-seo' => $this->get_translations( 'wordpress-seojs' ),
|
24 |
-
|
25 |
wp_localize_script( $script_handle, 'wpseoYoastJSL10n', $translations );
|
26 |
}
|
27 |
|
18 |
* @return void
|
19 |
*/
|
20 |
public function localize_script( $script_handle ) {
|
21 |
+
$translations = [
|
22 |
'yoast-components' => $this->get_translations( 'yoast-components' ),
|
23 |
'wordpress-seo' => $this->get_translations( 'wordpress-seojs' ),
|
24 |
+
];
|
25 |
wp_localize_script( $script_handle, 'wpseoYoastJSL10n', $translations );
|
26 |
}
|
27 |
|
admin/class-admin-editor-specific-replace-vars.php
CHANGED
@@ -15,37 +15,37 @@ class WPSEO_Admin_Editor_Specific_Replace_Vars {
|
|
15 |
*
|
16 |
* @var array The editor specific replacement variables.
|
17 |
*/
|
18 |
-
protected $replacement_variables =
|
19 |
// Posts types.
|
20 |
-
'page' =>
|
21 |
-
'post' =>
|
22 |
// Custom post type.
|
23 |
-
'custom_post_type' =>
|
24 |
// Settings - archive pages.
|
25 |
-
'custom-post-type_archive' =>
|
26 |
|
27 |
// Taxonomies.
|
28 |
-
'category' =>
|
29 |
-
'post_tag' =>
|
30 |
-
'post_format' =>
|
31 |
// Custom taxonomy.
|
32 |
-
'term-in-custom-taxonomy' =>
|
33 |
|
34 |
// Settings - special pages.
|
35 |
-
'search' =>
|
36 |
-
|
37 |
|
38 |
/**
|
39 |
* WPSEO_Admin_Editor_Specific_Replace_Vars constructor.
|
40 |
*/
|
41 |
public function __construct() {
|
42 |
$this->add_for_page_types(
|
43 |
-
|
44 |
WPSEO_Custom_Fields::get_custom_fields()
|
45 |
);
|
46 |
|
47 |
$this->add_for_page_types(
|
48 |
-
|
49 |
WPSEO_Custom_Taxonomies::get_custom_taxonomies()
|
50 |
);
|
51 |
}
|
@@ -188,7 +188,7 @@ class WPSEO_Admin_Editor_Specific_Replace_Vars {
|
|
188 |
* @return array Extracted names.
|
189 |
*/
|
190 |
protected function extract_names( $replacement_variables ) {
|
191 |
-
$extracted_names =
|
192 |
|
193 |
foreach ( $replacement_variables as $replacement_variable ) {
|
194 |
if ( empty( $replacement_variable['name'] ) ) {
|
15 |
*
|
16 |
* @var array The editor specific replacement variables.
|
17 |
*/
|
18 |
+
protected $replacement_variables = [
|
19 |
// Posts types.
|
20 |
+
'page' => [ 'id', 'pt_single', 'pt_plural', 'parent_title' ],
|
21 |
+
'post' => [ 'id', 'term404', 'pt_single', 'pt_plural' ],
|
22 |
// Custom post type.
|
23 |
+
'custom_post_type' => [ 'id', 'term404', 'pt_single', 'pt_plural', 'parent_title' ],
|
24 |
// Settings - archive pages.
|
25 |
+
'custom-post-type_archive' => [ 'pt_single', 'pt_plural' ],
|
26 |
|
27 |
// Taxonomies.
|
28 |
+
'category' => [ 'term_title', 'term_description', 'category_description', 'parent_title' ],
|
29 |
+
'post_tag' => [ 'term_title', 'term_description', 'tag_description' ],
|
30 |
+
'post_format' => [],
|
31 |
// Custom taxonomy.
|
32 |
+
'term-in-custom-taxonomy' => [ 'term_title', 'term_description', 'category_description', 'parent_title' ],
|
33 |
|
34 |
// Settings - special pages.
|
35 |
+
'search' => [ 'searchphrase' ],
|
36 |
+
];
|
37 |
|
38 |
/**
|
39 |
* WPSEO_Admin_Editor_Specific_Replace_Vars constructor.
|
40 |
*/
|
41 |
public function __construct() {
|
42 |
$this->add_for_page_types(
|
43 |
+
[ 'page', 'post', 'custom_post_type' ],
|
44 |
WPSEO_Custom_Fields::get_custom_fields()
|
45 |
);
|
46 |
|
47 |
$this->add_for_page_types(
|
48 |
+
[ 'post', 'term-in-custom-taxonomies' ],
|
49 |
WPSEO_Custom_Taxonomies::get_custom_taxonomies()
|
50 |
);
|
51 |
}
|
188 |
* @return array Extracted names.
|
189 |
*/
|
190 |
protected function extract_names( $replacement_variables ) {
|
191 |
+
$extracted_names = [];
|
192 |
|
193 |
foreach ( $replacement_variables as $replacement_variable ) {
|
194 |
if ( empty( $replacement_variable['name'] ) ) {
|
admin/class-admin-gutenberg-compatibility-notification.php
CHANGED
@@ -45,7 +45,7 @@ class WPSEO_Admin_Gutenberg_Compatibility_Notification implements WPSEO_WordPres
|
|
45 |
* @return void
|
46 |
*/
|
47 |
public function register_hooks() {
|
48 |
-
add_action( 'admin_init',
|
49 |
}
|
50 |
|
51 |
/**
|
@@ -81,11 +81,11 @@ class WPSEO_Admin_Gutenberg_Compatibility_Notification implements WPSEO_WordPres
|
|
81 |
|
82 |
$notification = new Yoast_Notification(
|
83 |
$message,
|
84 |
-
|
85 |
'id' => $this->notification_id,
|
86 |
'type' => $level,
|
87 |
'priority' => 1,
|
88 |
-
|
89 |
);
|
90 |
|
91 |
$this->notification_center->add_notification( $notification );
|
45 |
* @return void
|
46 |
*/
|
47 |
public function register_hooks() {
|
48 |
+
add_action( 'admin_init', [ $this, 'manage_notification' ] );
|
49 |
}
|
50 |
|
51 |
/**
|
81 |
|
82 |
$notification = new Yoast_Notification(
|
83 |
$message,
|
84 |
+
[
|
85 |
'id' => $this->notification_id,
|
86 |
'type' => $level,
|
87 |
'priority' => 1,
|
88 |
+
]
|
89 |
);
|
90 |
|
91 |
$this->notification_center->add_notification( $notification );
|
admin/class-admin-init.php
CHANGED
@@ -34,22 +34,22 @@ class WPSEO_Admin_Init {
|
|
34 |
|
35 |
$this->asset_manager = new WPSEO_Admin_Asset_Manager();
|
36 |
|
37 |
-
add_action( 'admin_enqueue_scripts',
|
38 |
-
add_action( 'admin_init',
|
39 |
-
add_action( 'admin_init',
|
40 |
-
add_action( 'admin_init',
|
41 |
-
add_action( 'admin_init',
|
42 |
-
add_action( 'admin_init',
|
43 |
-
add_action( 'admin_init',
|
44 |
-
add_action( 'admin_init',
|
45 |
-
add_action( 'admin_init',
|
46 |
-
add_action( 'admin_init',
|
47 |
-
add_action( 'admin_init',
|
48 |
-
add_action( 'admin_init',
|
49 |
-
add_action( 'admin_notices',
|
50 |
-
add_action( 'admin_enqueue_scripts',
|
51 |
-
|
52 |
-
$listeners =
|
53 |
$listeners[] = new WPSEO_Post_Type_Archive_Notification_Handler();
|
54 |
|
55 |
/**
|
@@ -80,7 +80,7 @@ class WPSEO_Admin_Init {
|
|
80 |
*
|
81 |
* @var WPSEO_Notification_Handler[] $handlers
|
82 |
*/
|
83 |
-
$handlers =
|
84 |
$handlers[] = new WPSEO_Post_Type_Archive_Notification_Handler();
|
85 |
|
86 |
$notification_center = Yoast_Notification_Center::get();
|
@@ -100,9 +100,9 @@ class WPSEO_Admin_Init {
|
|
100 |
* Notify about the default tagline if the user hasn't changed it.
|
101 |
*/
|
102 |
public function tagline_notice() {
|
103 |
-
$query_args =
|
104 |
'autofocus[control]' => 'blogdescription',
|
105 |
-
|
106 |
$customize_url = add_query_arg( $query_args, wp_customize_url() );
|
107 |
|
108 |
$info_message = sprintf(
|
@@ -112,11 +112,11 @@ class WPSEO_Admin_Init {
|
|
112 |
'</a>'
|
113 |
);
|
114 |
|
115 |
-
$notification_options =
|
116 |
'type' => Yoast_Notification::ERROR,
|
117 |
'id' => 'wpseo-dismiss-tagline-notice',
|
118 |
'capabilities' => 'wpseo_manage_options',
|
119 |
-
|
120 |
|
121 |
$tagline_notification = new Yoast_Notification( $info_message, $notification_options );
|
122 |
|
@@ -137,12 +137,12 @@ class WPSEO_Admin_Init {
|
|
137 |
'</a>'
|
138 |
);
|
139 |
|
140 |
-
$notification_options =
|
141 |
'type' => Yoast_Notification::ERROR,
|
142 |
'id' => 'wpseo-dismiss-blog-public-notice',
|
143 |
'priority' => 1.0,
|
144 |
'capabilities' => 'wpseo_manage_options',
|
145 |
-
|
146 |
|
147 |
$notification = new Yoast_Notification( $info_message, $notification_options );
|
148 |
|
@@ -170,11 +170,11 @@ class WPSEO_Admin_Init {
|
|
170 |
'</a>'
|
171 |
);
|
172 |
|
173 |
-
$notification_options =
|
174 |
'type' => Yoast_Notification::WARNING,
|
175 |
'id' => 'wpseo-dismiss-page_comments-notice',
|
176 |
'capabilities' => 'wpseo_manage_options',
|
177 |
-
|
178 |
|
179 |
$tagline_notification = new Yoast_Notification( $info_message, $notification_options );
|
180 |
|
@@ -217,12 +217,12 @@ class WPSEO_Admin_Init {
|
|
217 |
'</a>'
|
218 |
);
|
219 |
|
220 |
-
$notification_options =
|
221 |
'type' => Yoast_Notification::WARNING,
|
222 |
'id' => 'wpseo-dismiss-permalink-notice',
|
223 |
'capabilities' => 'wpseo_manage_options',
|
224 |
'priority' => 0.8,
|
225 |
-
|
226 |
|
227 |
$notification = new Yoast_Notification( $info_message, $notification_options );
|
228 |
|
@@ -302,10 +302,10 @@ class WPSEO_Admin_Init {
|
|
302 |
|
303 |
return new Yoast_Notification(
|
304 |
$info_message,
|
305 |
-
|
306 |
'id' => 'wpseo-suggested-plugin-' . $name,
|
307 |
'type' => Yoast_Notification::WARNING,
|
308 |
-
|
309 |
);
|
310 |
}
|
311 |
|
@@ -338,11 +338,11 @@ class WPSEO_Admin_Init {
|
|
338 |
'<a href="' . admin_url( 'admin.php?page=wpseo_tools&recalculate=1' ) . '">',
|
339 |
'</a>'
|
340 |
),
|
341 |
-
|
342 |
'type' => 'updated yoast-dismissible',
|
343 |
'id' => 'wpseo-dismiss-recalculate',
|
344 |
'nonce' => wp_create_nonce( 'wpseo-dismiss-recalculate' ),
|
345 |
-
|
346 |
)
|
347 |
);
|
348 |
}
|
@@ -363,7 +363,7 @@ class WPSEO_Admin_Init {
|
|
363 |
* @return float The latest released major WordPress version. 0 The stable-check api doesn't respond.
|
364 |
*/
|
365 |
private function get_latest_major_wordpress_version() {
|
366 |
-
$core_updates = get_core_updates(
|
367 |
|
368 |
if ( $core_updates === false ) {
|
369 |
return 0;
|
@@ -440,7 +440,7 @@ class WPSEO_Admin_Init {
|
|
440 |
* Loads admin page class for all admin pages starting with `wpseo_`.
|
441 |
*/
|
442 |
private function load_admin_user_class() {
|
443 |
-
if ( in_array( $this->pagenow,
|
444 |
&& current_user_can( 'edit_users' )
|
445 |
) {
|
446 |
new WPSEO_Admin_User_Profile();
|
@@ -494,11 +494,11 @@ class WPSEO_Admin_Init {
|
|
494 |
private function register_i18n_promo_class() {
|
495 |
// BC, because an older version of the i18n-module didn't have this class.
|
496 |
$i18n_module = new Yoast_I18n_WordPressOrg_v3(
|
497 |
-
|
498 |
'textdomain' => 'wordpress-seo',
|
499 |
'plugin_name' => 'Yoast SEO',
|
500 |
'hook' => 'wpseo_admin_promo_footer',
|
501 |
-
|
502 |
false
|
503 |
);
|
504 |
|
@@ -512,10 +512,10 @@ class WPSEO_Admin_Init {
|
|
512 |
|
513 |
$notification = new Yoast_Notification(
|
514 |
$message,
|
515 |
-
|
516 |
'type' => Yoast_Notification::WARNING,
|
517 |
'id' => 'i18nModuleTranslationAssistance',
|
518 |
-
|
519 |
);
|
520 |
|
521 |
if ( $message ) {
|
@@ -556,12 +556,12 @@ class WPSEO_Admin_Init {
|
|
556 |
}
|
557 |
|
558 |
// WordPress hooks that have been deprecated since a Yoast SEO version.
|
559 |
-
$deprecated_filters =
|
560 |
-
'wpseo_genesis_force_adjacent_rel_home' =>
|
561 |
'version' => '9.4',
|
562 |
'alternative' => null,
|
563 |
-
|
564 |
-
|
565 |
|
566 |
// Determine which filters have been registered.
|
567 |
$deprecated_notices = array_intersect(
|
34 |
|
35 |
$this->asset_manager = new WPSEO_Admin_Asset_Manager();
|
36 |
|
37 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_dismissible' ] );
|
38 |
+
add_action( 'admin_init', [ $this, 'tagline_notice' ], 15 );
|
39 |
+
add_action( 'admin_init', [ $this, 'blog_public_notice' ], 15 );
|
40 |
+
add_action( 'admin_init', [ $this, 'permalink_notice' ], 15 );
|
41 |
+
add_action( 'admin_init', [ $this, 'page_comments_notice' ], 15 );
|
42 |
+
add_action( 'admin_init', [ $this, 'yoast_plugin_suggestions_notification' ], 15 );
|
43 |
+
add_action( 'admin_init', [ $this, 'recalculate_notice' ], 15 );
|
44 |
+
add_action( 'admin_init', [ $this, 'unsupported_php_notice' ], 15 );
|
45 |
+
add_action( 'admin_init', [ $this->asset_manager, 'register_assets' ] );
|
46 |
+
add_action( 'admin_init', [ $this, 'show_hook_deprecation_warnings' ] );
|
47 |
+
add_action( 'admin_init', [ 'WPSEO_Plugin_Conflict', 'hook_check_for_plugin_conflicts' ] );
|
48 |
+
add_action( 'admin_init', [ $this, 'handle_notifications' ], 15 );
|
49 |
+
add_action( 'admin_notices', [ $this, 'permalink_settings_notice' ] );
|
50 |
+
add_action( 'admin_enqueue_scripts', [ $this->asset_manager, 'register_wp_assets' ], PHP_INT_MAX );
|
51 |
+
|
52 |
+
$listeners = [];
|
53 |
$listeners[] = new WPSEO_Post_Type_Archive_Notification_Handler();
|
54 |
|
55 |
/**
|
80 |
*
|
81 |
* @var WPSEO_Notification_Handler[] $handlers
|
82 |
*/
|
83 |
+
$handlers = [];
|
84 |
$handlers[] = new WPSEO_Post_Type_Archive_Notification_Handler();
|
85 |
|
86 |
$notification_center = Yoast_Notification_Center::get();
|
100 |
* Notify about the default tagline if the user hasn't changed it.
|
101 |
*/
|
102 |
public function tagline_notice() {
|
103 |
+
$query_args = [
|
104 |
'autofocus[control]' => 'blogdescription',
|
105 |
+
];
|
106 |
$customize_url = add_query_arg( $query_args, wp_customize_url() );
|
107 |
|
108 |
$info_message = sprintf(
|
112 |
'</a>'
|
113 |
);
|
114 |
|
115 |
+
$notification_options = [
|
116 |
'type' => Yoast_Notification::ERROR,
|
117 |
'id' => 'wpseo-dismiss-tagline-notice',
|
118 |
'capabilities' => 'wpseo_manage_options',
|
119 |
+
];
|
120 |
|
121 |
$tagline_notification = new Yoast_Notification( $info_message, $notification_options );
|
122 |
|
137 |
'</a>'
|
138 |
);
|
139 |
|
140 |
+
$notification_options = [
|
141 |
'type' => Yoast_Notification::ERROR,
|
142 |
'id' => 'wpseo-dismiss-blog-public-notice',
|
143 |
'priority' => 1.0,
|
144 |
'capabilities' => 'wpseo_manage_options',
|
145 |
+
];
|
146 |
|
147 |
$notification = new Yoast_Notification( $info_message, $notification_options );
|
148 |
|
170 |
'</a>'
|
171 |
);
|
172 |
|
173 |
+
$notification_options = [
|
174 |
'type' => Yoast_Notification::WARNING,
|
175 |
'id' => 'wpseo-dismiss-page_comments-notice',
|
176 |
'capabilities' => 'wpseo_manage_options',
|
177 |
+
];
|
178 |
|
179 |
$tagline_notification = new Yoast_Notification( $info_message, $notification_options );
|
180 |
|
217 |
'</a>'
|
218 |
);
|
219 |
|
220 |
+
$notification_options = [
|
221 |
'type' => Yoast_Notification::WARNING,
|
222 |
'id' => 'wpseo-dismiss-permalink-notice',
|
223 |
'capabilities' => 'wpseo_manage_options',
|
224 |
'priority' => 0.8,
|
225 |
+
];
|
226 |
|
227 |
$notification = new Yoast_Notification( $info_message, $notification_options );
|
228 |
|
302 |
|
303 |
return new Yoast_Notification(
|
304 |
$info_message,
|
305 |
+
[
|
306 |
'id' => 'wpseo-suggested-plugin-' . $name,
|
307 |
'type' => Yoast_Notification::WARNING,
|
308 |
+
]
|
309 |
);
|
310 |
}
|
311 |
|
338 |
'<a href="' . admin_url( 'admin.php?page=wpseo_tools&recalculate=1' ) . '">',
|
339 |
'</a>'
|
340 |
),
|
341 |
+
[
|
342 |
'type' => 'updated yoast-dismissible',
|
343 |
'id' => 'wpseo-dismiss-recalculate',
|
344 |
'nonce' => wp_create_nonce( 'wpseo-dismiss-recalculate' ),
|
345 |
+
]
|
346 |
)
|
347 |
);
|
348 |
}
|
363 |
* @return float The latest released major WordPress version. 0 The stable-check api doesn't respond.
|
364 |
*/
|
365 |
private function get_latest_major_wordpress_version() {
|
366 |
+
$core_updates = get_core_updates( [ 'dismissed' => true ] );
|
367 |
|
368 |
if ( $core_updates === false ) {
|
369 |
return 0;
|
440 |
* Loads admin page class for all admin pages starting with `wpseo_`.
|
441 |
*/
|
442 |
private function load_admin_user_class() {
|
443 |
+
if ( in_array( $this->pagenow, [ 'user-edit.php', 'profile.php' ], true )
|
444 |
&& current_user_can( 'edit_users' )
|
445 |
) {
|
446 |
new WPSEO_Admin_User_Profile();
|
494 |
private function register_i18n_promo_class() {
|
495 |
// BC, because an older version of the i18n-module didn't have this class.
|
496 |
$i18n_module = new Yoast_I18n_WordPressOrg_v3(
|
497 |
+
[
|
498 |
'textdomain' => 'wordpress-seo',
|
499 |
'plugin_name' => 'Yoast SEO',
|
500 |
'hook' => 'wpseo_admin_promo_footer',
|
501 |
+
],
|
502 |
false
|
503 |
);
|
504 |
|
512 |
|
513 |
$notification = new Yoast_Notification(
|
514 |
$message,
|
515 |
+
[
|
516 |
'type' => Yoast_Notification::WARNING,
|
517 |
'id' => 'i18nModuleTranslationAssistance',
|
518 |
+
]
|
519 |
);
|
520 |
|
521 |
if ( $message ) {
|
556 |
}
|
557 |
|
558 |
// WordPress hooks that have been deprecated since a Yoast SEO version.
|
559 |
+
$deprecated_filters = [
|
560 |
+
'wpseo_genesis_force_adjacent_rel_home' => [
|
561 |
'version' => '9.4',
|
562 |
'alternative' => null,
|
563 |
+
],
|
564 |
+
];
|
565 |
|
566 |
// Determine which filters have been registered.
|
567 |
$deprecated_notices = array_intersect(
|
admin/class-admin-media-purge-notification.php
CHANGED
@@ -23,8 +23,8 @@ class WPSEO_Admin_Media_Purge_Notification implements WPSEO_WordPress_Integratio
|
|
23 |
* @return void
|
24 |
*/
|
25 |
public function register_hooks() {
|
26 |
-
add_action( 'admin_init',
|
27 |
-
add_filter( 'wpseo_option_tab-metas_media',
|
28 |
|
29 |
// Dismissing is just setting the relevancy to false, which cancels out any functionality.
|
30 |
if ( WPSEO_Utils::is_yoast_seo_page() && filter_input( INPUT_GET, 'dismiss' ) === $this->notification_id ) {
|
@@ -81,12 +81,12 @@ class WPSEO_Admin_Media_Purge_Notification implements WPSEO_WordPress_Integratio
|
|
81 |
|
82 |
return new Yoast_Notification(
|
83 |
$content,
|
84 |
-
|
85 |
'type' => Yoast_Notification::ERROR,
|
86 |
'id' => $this->notification_id,
|
87 |
'capabilities' => 'wpseo_manage_options',
|
88 |
'priority' => 1,
|
89 |
-
|
90 |
);
|
91 |
}
|
92 |
|
23 |
* @return void
|
24 |
*/
|
25 |
public function register_hooks() {
|
26 |
+
add_action( 'admin_init', [ $this, 'manage_notification' ] );
|
27 |
+
add_filter( 'wpseo_option_tab-metas_media', [ $this, 'output_hidden_setting' ] );
|
28 |
|
29 |
// Dismissing is just setting the relevancy to false, which cancels out any functionality.
|
30 |
if ( WPSEO_Utils::is_yoast_seo_page() && filter_input( INPUT_GET, 'dismiss' ) === $this->notification_id ) {
|
81 |
|
82 |
return new Yoast_Notification(
|
83 |
$content,
|
84 |
+
[
|
85 |
'type' => Yoast_Notification::ERROR,
|
86 |
'id' => $this->notification_id,
|
87 |
'capabilities' => 'wpseo_manage_options',
|
88 |
'priority' => 1,
|
89 |
+
]
|
90 |
);
|
91 |
}
|
92 |
|
admin/class-admin-recommended-replace-vars.php
CHANGED
@@ -15,32 +15,32 @@ class WPSEO_Admin_Recommended_Replace_Vars {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $recommended_replace_vars =
|
19 |
// Posts types.
|
20 |
-
'page' =>
|
21 |
-
'post' =>
|
22 |
// Homepage.
|
23 |
-
'homepage' =>
|
24 |
// Custom post type.
|
25 |
-
'custom_post_type' =>
|
26 |
|
27 |
// Taxonomies.
|
28 |
-
'category' =>
|
29 |
-
'post_tag' =>
|
30 |
-
'post_format' =>
|
31 |
|
32 |
// Custom taxonomy.
|
33 |
-
'term-in-custom-taxomomy' =>
|
34 |
|
35 |
// Settings - archive pages.
|
36 |
-
'author_archive' =>
|
37 |
-
'date_archive' =>
|
38 |
-
'custom-post-type_archive' =>
|
39 |
|
40 |
// Settings - special pages.
|
41 |
-
'search' =>
|
42 |
-
'404' =>
|
43 |
-
|
44 |
|
45 |
/**
|
46 |
* Determines the page type of the current term.
|
@@ -134,7 +134,7 @@ class WPSEO_Admin_Recommended_Replace_Vars {
|
|
134 |
$has_recommended_replace_vars = $this->has_recommended_replace_vars( $recommended_replace_vars, $page_type );
|
135 |
|
136 |
if ( ! $has_recommended_replace_vars ) {
|
137 |
-
return
|
138 |
}
|
139 |
|
140 |
return $recommended_replace_vars[ $page_type ];
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $recommended_replace_vars = [
|
19 |
// Posts types.
|
20 |
+
'page' => [ 'sitename', 'title', 'sep', 'primary_category' ],
|
21 |
+
'post' => [ 'sitename', 'title', 'sep', 'primary_category' ],
|
22 |
// Homepage.
|
23 |
+
'homepage' => [ 'sitename', 'sitedesc', 'sep' ],
|
24 |
// Custom post type.
|
25 |
+
'custom_post_type' => [ 'sitename', 'title', 'sep' ],
|
26 |
|
27 |
// Taxonomies.
|
28 |
+
'category' => [ 'sitename', 'term_title', 'sep' ],
|
29 |
+
'post_tag' => [ 'sitename', 'term_title', 'sep' ],
|
30 |
+
'post_format' => [ 'sitename', 'term_title', 'sep', 'page' ],
|
31 |
|
32 |
// Custom taxonomy.
|
33 |
+
'term-in-custom-taxomomy' => [ 'sitename', 'term_title', 'sep' ],
|
34 |
|
35 |
// Settings - archive pages.
|
36 |
+
'author_archive' => [ 'sitename', 'title', 'sep', 'page' ],
|
37 |
+
'date_archive' => [ 'sitename', 'sep', 'date', 'page' ],
|
38 |
+
'custom-post-type_archive' => [ 'sitename', 'title', 'sep', 'page' ],
|
39 |
|
40 |
// Settings - special pages.
|
41 |
+
'search' => [ 'sitename', 'searchphrase', 'sep', 'page' ],
|
42 |
+
'404' => [ 'sitename', 'sep' ],
|
43 |
+
];
|
44 |
|
45 |
/**
|
46 |
* Determines the page type of the current term.
|
134 |
$has_recommended_replace_vars = $this->has_recommended_replace_vars( $recommended_replace_vars, $page_type );
|
135 |
|
136 |
if ( ! $has_recommended_replace_vars ) {
|
137 |
+
return [];
|
138 |
}
|
139 |
|
140 |
return $recommended_replace_vars[ $page_type ];
|
admin/class-admin-user-profile.php
CHANGED
@@ -15,12 +15,12 @@ class WPSEO_Admin_User_Profile {
|
|
15 |
* Class constructor.
|
16 |
*/
|
17 |
public function __construct() {
|
18 |
-
add_action( 'show_user_profile',
|
19 |
-
add_action( 'edit_user_profile',
|
20 |
-
add_action( 'personal_options_update',
|
21 |
-
add_action( 'edit_user_profile_update',
|
22 |
|
23 |
-
add_action( 'update_user_meta',
|
24 |
}
|
25 |
|
26 |
/**
|
@@ -34,7 +34,7 @@ class WPSEO_Admin_User_Profile {
|
|
34 |
*/
|
35 |
public function clear_author_sitemap_cache( $meta_id, $object_id, $meta_key ) {
|
36 |
if ( '_yoast_wpseo_profile_updated' === $meta_key ) {
|
37 |
-
WPSEO_Sitemaps_Cache::clear(
|
38 |
}
|
39 |
}
|
40 |
|
15 |
* Class constructor.
|
16 |
*/
|
17 |
public function __construct() {
|
18 |
+
add_action( 'show_user_profile', [ $this, 'user_profile' ] );
|
19 |
+
add_action( 'edit_user_profile', [ $this, 'user_profile' ] );
|
20 |
+
add_action( 'personal_options_update', [ $this, 'process_user_option_update' ] );
|
21 |
+
add_action( 'edit_user_profile_update', [ $this, 'process_user_option_update' ] );
|
22 |
|
23 |
+
add_action( 'update_user_meta', [ $this, 'clear_author_sitemap_cache' ], 10, 3 );
|
24 |
}
|
25 |
|
26 |
/**
|
34 |
*/
|
35 |
public function clear_author_sitemap_cache( $meta_id, $object_id, $meta_key ) {
|
36 |
if ( '_yoast_wpseo_profile_updated' === $meta_key ) {
|
37 |
+
WPSEO_Sitemaps_Cache::clear( [ 'author' ] );
|
38 |
}
|
39 |
}
|
40 |
|
admin/class-admin.php
CHANGED
@@ -30,7 +30,7 @@ class WPSEO_Admin {
|
|
30 |
* Class constructor.
|
31 |
*/
|
32 |
public function __construct() {
|
33 |
-
$integrations =
|
34 |
|
35 |
global $pagenow;
|
36 |
|
@@ -42,40 +42,40 @@ class WPSEO_Admin {
|
|
42 |
}
|
43 |
|
44 |
if ( WPSEO_Options::get( 'stripcategorybase' ) === true ) {
|
45 |
-
add_action( 'created_category',
|
46 |
-
add_action( 'edited_category',
|
47 |
-
add_action( 'delete_category',
|
48 |
}
|
49 |
|
50 |
if ( WPSEO_Options::get( 'disable-attachment' ) === true ) {
|
51 |
-
add_filter( 'wpseo_accessible_post_types',
|
52 |
}
|
53 |
|
54 |
if ( filter_input( INPUT_GET, 'page' ) === 'wpseo_tools' && filter_input( INPUT_GET, 'tool' ) === null ) {
|
55 |
new WPSEO_Recalculate_Scores();
|
56 |
}
|
57 |
|
58 |
-
add_filter( 'plugin_action_links_' . WPSEO_BASENAME,
|
59 |
|
60 |
-
add_action( 'admin_enqueue_scripts',
|
61 |
-
add_action( 'admin_enqueue_scripts',
|
62 |
|
63 |
-
add_filter( 'user_contactmethods',
|
64 |
|
65 |
-
add_action( 'after_switch_theme',
|
66 |
-
add_action( 'switch_theme',
|
67 |
|
68 |
-
add_filter( 'set-screen-option',
|
69 |
|
70 |
-
add_action( 'admin_init',
|
71 |
|
72 |
-
add_action( 'admin_init',
|
73 |
|
74 |
WPSEO_Sitemaps_Cache::register_clear_on_option_update( 'wpseo' );
|
75 |
WPSEO_Sitemaps_Cache::register_clear_on_option_update( 'home' );
|
76 |
|
77 |
if ( WPSEO_Utils::is_yoast_seo_page() ) {
|
78 |
-
add_action( 'admin_enqueue_scripts',
|
79 |
}
|
80 |
|
81 |
if ( WPSEO_Utils::is_api_available() ) {
|
@@ -92,9 +92,9 @@ class WPSEO_Admin {
|
|
92 |
$integrations[] = new Yoast_Network_Admin();
|
93 |
}
|
94 |
|
95 |
-
$this->admin_features =
|
96 |
'dashboard_widget' => new Yoast_Dashboard_Widget(),
|
97 |
-
|
98 |
|
99 |
if ( WPSEO_Metabox::is_post_overview( $pagenow ) || WPSEO_Metabox::is_post_edit( $pagenow ) ) {
|
100 |
$this->admin_features['primary_category'] = new WPSEO_Primary_Term_Admin();
|
@@ -173,7 +173,7 @@ class WPSEO_Admin {
|
|
173 |
$option_page = ! empty( $_POST['option_page'] ) ? $_POST['option_page'] : ''; // WPCS: CSRF ok.
|
174 |
|
175 |
if ( strpos( $option_page, 'yoast_wpseo' ) === 0 ) {
|
176 |
-
add_filter( 'option_page_capability_' . $option_page,
|
177 |
}
|
178 |
}
|
179 |
|
@@ -183,11 +183,11 @@ class WPSEO_Admin {
|
|
183 |
*/
|
184 |
public function bulk_edit_options() {
|
185 |
$option = 'per_page';
|
186 |
-
$args =
|
187 |
'label' => __( 'Posts', 'wordpress-seo' ),
|
188 |
'default' => 10,
|
189 |
'option' => 'wpseo_posts_per_page',
|
190 |
-
|
191 |
add_screen_option( $option, $args );
|
192 |
}
|
193 |
|
@@ -288,8 +288,8 @@ class WPSEO_Admin {
|
|
288 |
* Log the updated timestamp for user profiles when theme is changed.
|
289 |
*/
|
290 |
public function switch_theme() {
|
291 |
-
$users = get_users(
|
292 |
-
if ( is_array( $users ) && $users !==
|
293 |
foreach ( $users as $user ) {
|
294 |
update_user_meta( $user->ID, '_yoast_wpseo_profile_updated', time() );
|
295 |
}
|
@@ -302,7 +302,7 @@ class WPSEO_Admin {
|
|
302 |
* @return array
|
303 |
*/
|
304 |
private function localize_admin_global_script() {
|
305 |
-
return
|
306 |
/* translators: %1$s: '%%term_title%%' variable used in titles and meta's template that's not compatible with the given template, %2$s: expands to 'HelpScout beacon' */
|
307 |
'variable_warning' => sprintf(
|
308 |
__( 'Warning: the variable %1$s cannot be used in this template. See the %2$s for more info.', 'wordpress-seo' ),
|
@@ -314,7 +314,7 @@ class WPSEO_Admin {
|
|
314 |
/* translators: %s: expends to Yoast SEO */
|
315 |
'help_video_iframe_title' => sprintf( __( '%s video tutorial', 'wordpress-seo' ), 'Yoast SEO' ),
|
316 |
'scrollable_table_hint' => __( 'Scroll to see the table content.', 'wordpress-seo' ),
|
317 |
-
|
318 |
}
|
319 |
|
320 |
/**
|
@@ -325,10 +325,10 @@ class WPSEO_Admin {
|
|
325 |
* @return string
|
326 |
*/
|
327 |
private function get_dismiss_url( $dismiss_param ) {
|
328 |
-
$arr_params =
|
329 |
$dismiss_param => '1',
|
330 |
'nonce' => wp_create_nonce( $dismiss_param ),
|
331 |
-
|
332 |
|
333 |
return esc_url( add_query_arg( $arr_params ) );
|
334 |
}
|
@@ -358,12 +358,12 @@ class WPSEO_Admin {
|
|
358 |
*/
|
359 |
protected function initialize_cornerstone_content() {
|
360 |
if ( ! WPSEO_Options::get( 'enable_cornerstone_content' ) ) {
|
361 |
-
return
|
362 |
}
|
363 |
|
364 |
-
return
|
365 |
'cornerstone_filter' => new WPSEO_Cornerstone_Filter(),
|
366 |
-
|
367 |
}
|
368 |
|
369 |
/**
|
@@ -372,7 +372,7 @@ class WPSEO_Admin {
|
|
372 |
* @returns WPSEO_WordPress_Integration[]
|
373 |
*/
|
374 |
protected function initialize_seo_links() {
|
375 |
-
$integrations =
|
376 |
|
377 |
$link_table_compatibility_notifier = new WPSEO_Link_Compatibility_Notifier();
|
378 |
$link_table_accessible_notifier = new WPSEO_Link_Table_Accessible_Notifier();
|
@@ -416,7 +416,7 @@ class WPSEO_Admin {
|
|
416 |
$integrations[] = new WPSEO_Link_Notifier();
|
417 |
|
418 |
// Adds a filter to exclude the attachments from the link count.
|
419 |
-
add_filter( 'wpseo_link_count_post_types',
|
420 |
|
421 |
return $integrations;
|
422 |
}
|
@@ -427,19 +427,19 @@ class WPSEO_Admin {
|
|
427 |
* @return WPSEO_HelpScout The instance of the HelpScout beacon.
|
428 |
*/
|
429 |
private function get_helpscout_beacon() {
|
430 |
-
$helpscout_settings =
|
431 |
'beacon_id' => '2496aba6-0292-489c-8f5d-1c0fba417c2f',
|
432 |
-
'pages' =>
|
433 |
'wpseo_dashboard',
|
434 |
'wpseo_titles',
|
435 |
'wpseo_search_console',
|
436 |
'wpseo_social',
|
437 |
'wpseo_tools',
|
438 |
'wpseo_licenses',
|
439 |
-
|
440 |
-
'products' =>
|
441 |
'ask_consent' => true,
|
442 |
-
|
443 |
|
444 |
/**
|
445 |
* Filter: 'wpseo_helpscout_beacon_settings' - Allows overriding the HelpScout beacon settings.
|
30 |
* Class constructor.
|
31 |
*/
|
32 |
public function __construct() {
|
33 |
+
$integrations = [];
|
34 |
|
35 |
global $pagenow;
|
36 |
|
42 |
}
|
43 |
|
44 |
if ( WPSEO_Options::get( 'stripcategorybase' ) === true ) {
|
45 |
+
add_action( 'created_category', [ $this, 'schedule_rewrite_flush' ] );
|
46 |
+
add_action( 'edited_category', [ $this, 'schedule_rewrite_flush' ] );
|
47 |
+
add_action( 'delete_category', [ $this, 'schedule_rewrite_flush' ] );
|
48 |
}
|
49 |
|
50 |
if ( WPSEO_Options::get( 'disable-attachment' ) === true ) {
|
51 |
+
add_filter( 'wpseo_accessible_post_types', [ 'WPSEO_Post_Type', 'filter_attachment_post_type' ] );
|
52 |
}
|
53 |
|
54 |
if ( filter_input( INPUT_GET, 'page' ) === 'wpseo_tools' && filter_input( INPUT_GET, 'tool' ) === null ) {
|
55 |
new WPSEO_Recalculate_Scores();
|
56 |
}
|
57 |
|
58 |
+
add_filter( 'plugin_action_links_' . WPSEO_BASENAME, [ $this, 'add_action_link' ], 10, 2 );
|
59 |
|
60 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'config_page_scripts' ] );
|
61 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_global_style' ] );
|
62 |
|
63 |
+
add_filter( 'user_contactmethods', [ $this, 'update_contactmethods' ], 10, 1 );
|
64 |
|
65 |
+
add_action( 'after_switch_theme', [ $this, 'switch_theme' ] );
|
66 |
+
add_action( 'switch_theme', [ $this, 'switch_theme' ] );
|
67 |
|
68 |
+
add_filter( 'set-screen-option', [ $this, 'save_bulk_edit_options' ], 10, 3 );
|
69 |
|
70 |
+
add_action( 'admin_init', [ 'WPSEO_Plugin_Conflict', 'hook_check_for_plugin_conflicts' ], 10, 1 );
|
71 |
|
72 |
+
add_action( 'admin_init', [ $this, 'map_manage_options_cap' ] );
|
73 |
|
74 |
WPSEO_Sitemaps_Cache::register_clear_on_option_update( 'wpseo' );
|
75 |
WPSEO_Sitemaps_Cache::register_clear_on_option_update( 'home' );
|
76 |
|
77 |
if ( WPSEO_Utils::is_yoast_seo_page() ) {
|
78 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
79 |
}
|
80 |
|
81 |
if ( WPSEO_Utils::is_api_available() ) {
|
92 |
$integrations[] = new Yoast_Network_Admin();
|
93 |
}
|
94 |
|
95 |
+
$this->admin_features = [
|
96 |
'dashboard_widget' => new Yoast_Dashboard_Widget(),
|
97 |
+
];
|
98 |
|
99 |
if ( WPSEO_Metabox::is_post_overview( $pagenow ) || WPSEO_Metabox::is_post_edit( $pagenow ) ) {
|
100 |
$this->admin_features['primary_category'] = new WPSEO_Primary_Term_Admin();
|
173 |
$option_page = ! empty( $_POST['option_page'] ) ? $_POST['option_page'] : ''; // WPCS: CSRF ok.
|
174 |
|
175 |
if ( strpos( $option_page, 'yoast_wpseo' ) === 0 ) {
|
176 |
+
add_filter( 'option_page_capability_' . $option_page, [ $this, 'get_manage_options_cap' ] );
|
177 |
}
|
178 |
}
|
179 |
|
183 |
*/
|
184 |
public function bulk_edit_options() {
|
185 |
$option = 'per_page';
|
186 |
+
$args = [
|
187 |
'label' => __( 'Posts', 'wordpress-seo' ),
|
188 |
'default' => 10,
|
189 |
'option' => 'wpseo_posts_per_page',
|
190 |
+
];
|
191 |
add_screen_option( $option, $args );
|
192 |
}
|
193 |
|
288 |
* Log the updated timestamp for user profiles when theme is changed.
|
289 |
*/
|
290 |
public function switch_theme() {
|
291 |
+
$users = get_users( [ 'who' => 'authors' ] );
|
292 |
+
if ( is_array( $users ) && $users !== [] ) {
|
293 |
foreach ( $users as $user ) {
|
294 |
update_user_meta( $user->ID, '_yoast_wpseo_profile_updated', time() );
|
295 |
}
|
302 |
* @return array
|
303 |
*/
|
304 |
private function localize_admin_global_script() {
|
305 |
+
return [
|
306 |
/* translators: %1$s: '%%term_title%%' variable used in titles and meta's template that's not compatible with the given template, %2$s: expands to 'HelpScout beacon' */
|
307 |
'variable_warning' => sprintf(
|
308 |
__( 'Warning: the variable %1$s cannot be used in this template. See the %2$s for more info.', 'wordpress-seo' ),
|
314 |
/* translators: %s: expends to Yoast SEO */
|
315 |
'help_video_iframe_title' => sprintf( __( '%s video tutorial', 'wordpress-seo' ), 'Yoast SEO' ),
|
316 |
'scrollable_table_hint' => __( 'Scroll to see the table content.', 'wordpress-seo' ),
|
317 |
+
];
|
318 |
}
|
319 |
|
320 |
/**
|
325 |
* @return string
|
326 |
*/
|
327 |
private function get_dismiss_url( $dismiss_param ) {
|
328 |
+
$arr_params = [
|
329 |
$dismiss_param => '1',
|
330 |
'nonce' => wp_create_nonce( $dismiss_param ),
|
331 |
+
];
|
332 |
|
333 |
return esc_url( add_query_arg( $arr_params ) );
|
334 |
}
|
358 |
*/
|
359 |
protected function initialize_cornerstone_content() {
|
360 |
if ( ! WPSEO_Options::get( 'enable_cornerstone_content' ) ) {
|
361 |
+
return [];
|
362 |
}
|
363 |
|
364 |
+
return [
|
365 |
'cornerstone_filter' => new WPSEO_Cornerstone_Filter(),
|
366 |
+
];
|
367 |
}
|
368 |
|
369 |
/**
|
372 |
* @returns WPSEO_WordPress_Integration[]
|
373 |
*/
|
374 |
protected function initialize_seo_links() {
|
375 |
+
$integrations = [];
|
376 |
|
377 |
$link_table_compatibility_notifier = new WPSEO_Link_Compatibility_Notifier();
|
378 |
$link_table_accessible_notifier = new WPSEO_Link_Table_Accessible_Notifier();
|
416 |
$integrations[] = new WPSEO_Link_Notifier();
|
417 |
|
418 |
// Adds a filter to exclude the attachments from the link count.
|
419 |
+
add_filter( 'wpseo_link_count_post_types', [ 'WPSEO_Post_Type', 'filter_attachment_post_type' ] );
|
420 |
|
421 |
return $integrations;
|
422 |
}
|
427 |
* @return WPSEO_HelpScout The instance of the HelpScout beacon.
|
428 |
*/
|
429 |
private function get_helpscout_beacon() {
|
430 |
+
$helpscout_settings = [
|
431 |
'beacon_id' => '2496aba6-0292-489c-8f5d-1c0fba417c2f',
|
432 |
+
'pages' => [
|
433 |
'wpseo_dashboard',
|
434 |
'wpseo_titles',
|
435 |
'wpseo_search_console',
|
436 |
'wpseo_social',
|
437 |
'wpseo_tools',
|
438 |
'wpseo_licenses',
|
439 |
+
],
|
440 |
+
'products' => [],
|
441 |
'ask_consent' => true,
|
442 |
+
];
|
443 |
|
444 |
/**
|
445 |
* Filter: 'wpseo_helpscout_beacon_settings' - Allows overriding the HelpScout beacon settings.
|
admin/class-asset.php
CHANGED
@@ -140,14 +140,14 @@ class WPSEO_Admin_Asset {
|
|
140 |
*
|
141 |
* @var array
|
142 |
*/
|
143 |
-
private $defaults =
|
144 |
-
'deps' =>
|
145 |
'version' => WPSEO_VERSION,
|
146 |
'in_footer' => true,
|
147 |
'rtl' => true,
|
148 |
'media' => 'all',
|
149 |
'suffix' => WPSEO_CSSJS_SUFFIX,
|
150 |
-
|
151 |
|
152 |
/**
|
153 |
* Constructs an instance of the WPSEO_Admin_Asset class.
|
140 |
*
|
141 |
* @var array
|
142 |
*/
|
143 |
+
private $defaults = [
|
144 |
+
'deps' => [],
|
145 |
'version' => WPSEO_VERSION,
|
146 |
'in_footer' => true,
|
147 |
'rtl' => true,
|
148 |
'media' => 'all',
|
149 |
'suffix' => WPSEO_CSSJS_SUFFIX,
|
150 |
+
];
|
151 |
|
152 |
/**
|
153 |
* Constructs an instance of the WPSEO_Admin_Asset class.
|
admin/class-bulk-description-editor-list-table.php
CHANGED
@@ -23,11 +23,11 @@ class WPSEO_Bulk_Description_List_Table extends WPSEO_Bulk_List_Table {
|
|
23 |
*
|
24 |
* @var array
|
25 |
*/
|
26 |
-
protected $settings =
|
27 |
'singular' => 'wpseo_bulk_description',
|
28 |
'plural' => 'wpseo_bulk_descriptions',
|
29 |
'ajax' => true,
|
30 |
-
|
31 |
|
32 |
/**
|
33 |
* The field in the database where meta field is saved.
|
@@ -42,10 +42,10 @@ class WPSEO_Bulk_Description_List_Table extends WPSEO_Bulk_List_Table {
|
|
42 |
* @return array
|
43 |
*/
|
44 |
public function get_columns() {
|
45 |
-
$columns =
|
46 |
'col_existing_yoast_seo_metadesc' => __( 'Existing Yoast Meta Description', 'wordpress-seo' ),
|
47 |
'col_new_yoast_seo_metadesc' => __( 'New Yoast Meta Description', 'wordpress-seo' ),
|
48 |
-
|
49 |
|
50 |
return $this->merge_columns( $columns );
|
51 |
}
|
23 |
*
|
24 |
* @var array
|
25 |
*/
|
26 |
+
protected $settings = [
|
27 |
'singular' => 'wpseo_bulk_description',
|
28 |
'plural' => 'wpseo_bulk_descriptions',
|
29 |
'ajax' => true,
|
30 |
+
];
|
31 |
|
32 |
/**
|
33 |
* The field in the database where meta field is saved.
|
42 |
* @return array
|
43 |
*/
|
44 |
public function get_columns() {
|
45 |
+
$columns = [
|
46 |
'col_existing_yoast_seo_metadesc' => __( 'Existing Yoast Meta Description', 'wordpress-seo' ),
|
47 |
'col_new_yoast_seo_metadesc' => __( 'New Yoast Meta Description', 'wordpress-seo' ),
|
48 |
+
];
|
49 |
|
50 |
return $this->merge_columns( $columns );
|
51 |
}
|
admin/class-bulk-editor-list-table.php
CHANGED
@@ -37,7 +37,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
37 |
*
|
38 |
* @var array
|
39 |
*/
|
40 |
-
protected $meta_data =
|
41 |
|
42 |
/**
|
43 |
* The current requested page_url.
|
@@ -101,29 +101,29 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
101 |
*
|
102 |
* @var array
|
103 |
*/
|
104 |
-
protected $pagination =
|
105 |
|
106 |
/**
|
107 |
* Holds the sanitized data from the user input.
|
108 |
*
|
109 |
* @var array
|
110 |
*/
|
111 |
-
protected $input_fields =
|
112 |
|
113 |
/**
|
114 |
* Class constructor.
|
115 |
*
|
116 |
* @param array $args The arguments.
|
117 |
*/
|
118 |
-
public function __construct( $args =
|
119 |
parent::__construct( $this->settings );
|
120 |
|
121 |
$args = wp_parse_args(
|
122 |
$args,
|
123 |
-
|
124 |
'nonce' => '',
|
125 |
-
'input_fields' =>
|
126 |
-
|
127 |
);
|
128 |
|
129 |
$this->input_fields = $args['input_fields'];
|
@@ -134,10 +134,10 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
134 |
$this->current_page = ( ! empty( $this->input_fields['paged'] ) ) ? $this->input_fields['paged'] : 1;
|
135 |
$this->current_filter = ( ! empty( $this->input_fields['post_type_filter'] ) ) ? $this->input_fields['post_type_filter'] : 1;
|
136 |
$this->current_status = ( ! empty( $this->input_fields['post_status'] ) ) ? $this->input_fields['post_status'] : 1;
|
137 |
-
$this->current_order =
|
138 |
'order' => ( ! empty( $this->input_fields['order'] ) ) ? $this->input_fields['order'] : 'asc',
|
139 |
'orderby' => ( ! empty( $this->input_fields['orderby'] ) ) ? $this->input_fields['orderby'] : 'post_title',
|
140 |
-
|
141 |
|
142 |
$this->nonce = $args['nonce'];
|
143 |
$this->page_url = "&nonce={$this->nonce}&type={$this->page_type}#top#{$this->page_type}";
|
@@ -161,17 +161,17 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
161 |
*/
|
162 |
protected function populate_editable_post_types() {
|
163 |
$post_types = get_post_types(
|
164 |
-
|
165 |
'public' => true,
|
166 |
'exclude_from_search' => false,
|
167 |
-
|
168 |
'object'
|
169 |
);
|
170 |
|
171 |
-
$this->all_posts =
|
172 |
-
$this->own_posts =
|
173 |
|
174 |
-
if ( is_array( $post_types ) && $post_types !==
|
175 |
foreach ( $post_types as $post_type ) {
|
176 |
if ( ! current_user_can( $post_type->cap->edit_posts ) ) {
|
177 |
continue;
|
@@ -266,9 +266,9 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
266 |
public function get_views() {
|
267 |
global $wpdb;
|
268 |
|
269 |
-
$status_links =
|
270 |
|
271 |
-
$states = get_post_stati(
|
272 |
$states = esc_sql( $states );
|
273 |
$all_states = "'" . implode( "', '", $states ) . "'";
|
274 |
|
@@ -292,8 +292,8 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
292 |
|
293 |
$status_links['all'] = '<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_tools&tool=bulk-editor' . $this->page_url ) ) . '"' . $current_link_attributes . '>' . $localized_text . '</a>';
|
294 |
|
295 |
-
$post_stati = get_post_stati(
|
296 |
-
if ( is_array( $post_stati ) && $post_stati !==
|
297 |
foreach ( $post_stati as $status ) {
|
298 |
|
299 |
$status_name = esc_sql( $status->name );
|
@@ -317,7 +317,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
317 |
$current_link_attributes = ' class="current" aria-current="page"';
|
318 |
}
|
319 |
|
320 |
-
$status_links[ $status_name ] = '<a href="' . esc_url( add_query_arg(
|
321 |
}
|
322 |
}
|
323 |
unset( $post_stati, $status, $status_name, $total, $current_link_attributes );
|
@@ -354,15 +354,15 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
354 |
|
355 |
if ( 'top' === $which ) {
|
356 |
$post_types = get_post_types(
|
357 |
-
|
358 |
'public' => true,
|
359 |
'exclude_from_search' => false,
|
360 |
-
|
361 |
);
|
362 |
|
363 |
$instance_type = esc_attr( $this->page_type );
|
364 |
|
365 |
-
if ( is_array( $post_types ) && $post_types !==
|
366 |
global $wpdb;
|
367 |
|
368 |
echo '<div class="alignleft actions">';
|
@@ -370,7 +370,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
370 |
$post_types = esc_sql( $post_types );
|
371 |
$post_types = "'" . implode( "', '", $post_types ) . "'";
|
372 |
|
373 |
-
$states = get_post_stati(
|
374 |
$states['trash'] = 'trash';
|
375 |
$states = esc_sql( $states );
|
376 |
$all_states = "'" . implode( "', '", $states ) . "'";
|
@@ -390,7 +390,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
390 |
|
391 |
$options = '<option value="-1">' . esc_html__( 'Show All Content Types', 'wordpress-seo' ) . '</option>';
|
392 |
|
393 |
-
if ( is_array( $post_types ) && $post_types !==
|
394 |
foreach ( $post_types as $post_type ) {
|
395 |
$obj = get_post_type_object( $post_type->post_type );
|
396 |
$options .= sprintf(
|
@@ -414,7 +414,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
414 |
esc_attr( 'post-type-filter-' . $instance_type )
|
415 |
);
|
416 |
|
417 |
-
submit_button( esc_html__( 'Filter', 'wordpress-seo' ), 'button', false, false,
|
418 |
echo '</div>';
|
419 |
}
|
420 |
}
|
@@ -428,11 +428,11 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
428 |
* @return array
|
429 |
*/
|
430 |
public function get_sortable_columns() {
|
431 |
-
return
|
432 |
-
'col_page_title' =>
|
433 |
-
'col_post_type' =>
|
434 |
-
'col_post_date' =>
|
435 |
-
|
436 |
}
|
437 |
|
438 |
/**
|
@@ -462,10 +462,10 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
462 |
$current_page = 1;
|
463 |
$current_filter = '-1';
|
464 |
$current_status = '';
|
465 |
-
$current_order =
|
466 |
'orderby' => 'post_title',
|
467 |
'order' => 'asc',
|
468 |
-
|
469 |
}
|
470 |
|
471 |
$_SERVER['REQUEST_URI'] = $request_url;
|
@@ -517,9 +517,9 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
517 |
*/
|
518 |
protected function set_column_headers() {
|
519 |
$columns = $this->get_columns();
|
520 |
-
$hidden =
|
521 |
$sortable = $this->get_sortable_columns();
|
522 |
-
$this->_column_headers =
|
523 |
}
|
524 |
|
525 |
/**
|
@@ -581,17 +581,17 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
581 |
}
|
582 |
|
583 |
$this->set_pagination_args(
|
584 |
-
|
585 |
'total_items' => $total_items,
|
586 |
'total_pages' => ceil( $total_items / $per_page ),
|
587 |
'per_page' => $per_page,
|
588 |
-
|
589 |
);
|
590 |
|
591 |
-
$this->pagination =
|
592 |
'per_page' => $per_page,
|
593 |
-
'offset' => ( $paged - 1 ) * $per_page,
|
594 |
-
|
595 |
}
|
596 |
|
597 |
/**
|
@@ -639,11 +639,11 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
639 |
* @return string $orderby
|
640 |
*/
|
641 |
protected function sanitize_orderby( $orderby ) {
|
642 |
-
$valid_column_names =
|
643 |
'post_title',
|
644 |
'post_type',
|
645 |
'post_date',
|
646 |
-
|
647 |
|
648 |
if ( in_array( $orderby, $valid_column_names, true ) ) {
|
649 |
return $orderby;
|
@@ -661,7 +661,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
661 |
* @return string $order SQL order string (ASC, DESC).
|
662 |
*/
|
663 |
protected function sanitize_order( $order ) {
|
664 |
-
if ( in_array( strtoupper( $order ),
|
665 |
return $order;
|
666 |
}
|
667 |
|
@@ -691,13 +691,13 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
691 |
* @return string
|
692 |
*/
|
693 |
protected function get_all_states() {
|
694 |
-
$states = get_post_stati(
|
695 |
$states['trash'] = 'trash';
|
696 |
|
697 |
if ( ! empty( $this->input_fields['post_status'] ) ) {
|
698 |
$requested_state = $this->input_fields['post_status'];
|
699 |
if ( in_array( $requested_state, $states, true ) ) {
|
700 |
-
$states =
|
701 |
}
|
702 |
|
703 |
if ( $requested_state !== 'trash' ) {
|
@@ -720,7 +720,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
720 |
|
721 |
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
722 |
|
723 |
-
if ( ( is_array( $records ) && $records !==
|
724 |
|
725 |
foreach ( $records as $rec ) {
|
726 |
|
@@ -764,7 +764,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
764 |
protected function column_attributes( $column_name, $hidden, $classes, $column_display_name ) {
|
765 |
|
766 |
$attributes = '';
|
767 |
-
$class =
|
768 |
|
769 |
if ( in_array( $column_name, $hidden, true ) ) {
|
770 |
$class[] = 'hidden';
|
@@ -795,7 +795,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
795 |
$post_type_object = get_post_type_object( $rec->post_type );
|
796 |
$can_edit_post = current_user_can( $post_type_object->cap->edit_post, $rec->ID );
|
797 |
|
798 |
-
$actions =
|
799 |
|
800 |
if ( $can_edit_post && 'trash' !== $rec->post_status ) {
|
801 |
$actions['edit'] = sprintf(
|
@@ -808,7 +808,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
808 |
}
|
809 |
|
810 |
if ( $post_type_object->public ) {
|
811 |
-
if ( in_array( $rec->post_status,
|
812 |
if ( $can_edit_post ) {
|
813 |
$actions['view'] = sprintf(
|
814 |
'<a href="%s" aria-label="%s">%s</a>',
|
@@ -903,7 +903,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
903 |
protected function parse_meta_data_field( $record_id, $attributes, $values = false ) {
|
904 |
|
905 |
// Fill meta data if exists in $this->meta_data.
|
906 |
-
$meta_data = ( ! empty( $this->meta_data[ $record_id ] ) ) ? $this->meta_data[ $record_id ] :
|
907 |
$meta_key = WPSEO_Meta::$meta_prefix . $this->target_db_field;
|
908 |
$meta_value = ( ! empty( $meta_data[ $meta_key ] ) ) ? $meta_data[ $meta_key ] : '';
|
909 |
|
@@ -941,7 +941,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
941 |
* @return string
|
942 |
*/
|
943 |
protected function get_post_ids() {
|
944 |
-
$needed_ids =
|
945 |
foreach ( $this->items as $item ) {
|
946 |
$needed_ids[] = $item->ID;
|
947 |
}
|
@@ -991,15 +991,15 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
991 |
*
|
992 |
* @return array
|
993 |
*/
|
994 |
-
protected function merge_columns( $columns =
|
995 |
$columns = array_merge(
|
996 |
-
|
997 |
'col_page_title' => __( 'WP Page Title', 'wordpress-seo' ),
|
998 |
'col_post_type' => __( 'Content Type', 'wordpress-seo' ),
|
999 |
'col_post_status' => __( 'Post Status', 'wordpress-seo' ),
|
1000 |
'col_post_date' => __( 'Publication date', 'wordpress-seo' ),
|
1001 |
'col_page_slug' => __( 'Page URL/Slug', 'wordpress-seo' ),
|
1002 |
-
|
1003 |
$columns
|
1004 |
);
|
1005 |
|
37 |
*
|
38 |
* @var array
|
39 |
*/
|
40 |
+
protected $meta_data = [];
|
41 |
|
42 |
/**
|
43 |
* The current requested page_url.
|
101 |
*
|
102 |
* @var array
|
103 |
*/
|
104 |
+
protected $pagination = [];
|
105 |
|
106 |
/**
|
107 |
* Holds the sanitized data from the user input.
|
108 |
*
|
109 |
* @var array
|
110 |
*/
|
111 |
+
protected $input_fields = [];
|
112 |
|
113 |
/**
|
114 |
* Class constructor.
|
115 |
*
|
116 |
* @param array $args The arguments.
|
117 |
*/
|
118 |
+
public function __construct( $args = [] ) {
|
119 |
parent::__construct( $this->settings );
|
120 |
|
121 |
$args = wp_parse_args(
|
122 |
$args,
|
123 |
+
[
|
124 |
'nonce' => '',
|
125 |
+
'input_fields' => [],
|
126 |
+
]
|
127 |
);
|
128 |
|
129 |
$this->input_fields = $args['input_fields'];
|
134 |
$this->current_page = ( ! empty( $this->input_fields['paged'] ) ) ? $this->input_fields['paged'] : 1;
|
135 |
$this->current_filter = ( ! empty( $this->input_fields['post_type_filter'] ) ) ? $this->input_fields['post_type_filter'] : 1;
|
136 |
$this->current_status = ( ! empty( $this->input_fields['post_status'] ) ) ? $this->input_fields['post_status'] : 1;
|
137 |
+
$this->current_order = [
|
138 |
'order' => ( ! empty( $this->input_fields['order'] ) ) ? $this->input_fields['order'] : 'asc',
|
139 |
'orderby' => ( ! empty( $this->input_fields['orderby'] ) ) ? $this->input_fields['orderby'] : 'post_title',
|
140 |
+
];
|
141 |
|
142 |
$this->nonce = $args['nonce'];
|
143 |
$this->page_url = "&nonce={$this->nonce}&type={$this->page_type}#top#{$this->page_type}";
|
161 |
*/
|
162 |
protected function populate_editable_post_types() {
|
163 |
$post_types = get_post_types(
|
164 |
+
[
|
165 |
'public' => true,
|
166 |
'exclude_from_search' => false,
|
167 |
+
],
|
168 |
'object'
|
169 |
);
|
170 |
|
171 |
+
$this->all_posts = [];
|
172 |
+
$this->own_posts = [];
|
173 |
|
174 |
+
if ( is_array( $post_types ) && $post_types !== [] ) {
|
175 |
foreach ( $post_types as $post_type ) {
|
176 |
if ( ! current_user_can( $post_type->cap->edit_posts ) ) {
|
177 |
continue;
|
266 |
public function get_views() {
|
267 |
global $wpdb;
|
268 |
|
269 |
+
$status_links = [];
|
270 |
|
271 |
+
$states = get_post_stati( [ 'show_in_admin_all_list' => true ] );
|
272 |
$states = esc_sql( $states );
|
273 |
$all_states = "'" . implode( "', '", $states ) . "'";
|
274 |
|
292 |
|
293 |
$status_links['all'] = '<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_tools&tool=bulk-editor' . $this->page_url ) ) . '"' . $current_link_attributes . '>' . $localized_text . '</a>';
|
294 |
|
295 |
+
$post_stati = get_post_stati( [ 'show_in_admin_all_list' => true ], 'objects' );
|
296 |
+
if ( is_array( $post_stati ) && $post_stati !== [] ) {
|
297 |
foreach ( $post_stati as $status ) {
|
298 |
|
299 |
$status_name = esc_sql( $status->name );
|
317 |
$current_link_attributes = ' class="current" aria-current="page"';
|
318 |
}
|
319 |
|
320 |
+
$status_links[ $status_name ] = '<a href="' . esc_url( add_query_arg( [ 'post_status' => $status_name ], admin_url( 'admin.php?page=wpseo_tools&tool=bulk-editor' . $this->page_url ) ) ) . '"' . $current_link_attributes . '>' . sprintf( translate_nooped_plural( $status->label_count, $total ), number_format_i18n( $total ) ) . '</a>';
|
321 |
}
|
322 |
}
|
323 |
unset( $post_stati, $status, $status_name, $total, $current_link_attributes );
|
354 |
|
355 |
if ( 'top' === $which ) {
|
356 |
$post_types = get_post_types(
|
357 |
+
[
|
358 |
'public' => true,
|
359 |
'exclude_from_search' => false,
|
360 |
+
]
|
361 |
);
|
362 |
|
363 |
$instance_type = esc_attr( $this->page_type );
|
364 |
|
365 |
+
if ( is_array( $post_types ) && $post_types !== [] ) {
|
366 |
global $wpdb;
|
367 |
|
368 |
echo '<div class="alignleft actions">';
|
370 |
$post_types = esc_sql( $post_types );
|
371 |
$post_types = "'" . implode( "', '", $post_types ) . "'";
|
372 |
|
373 |
+
$states = get_post_stati( [ 'show_in_admin_all_list' => true ] );
|
374 |
$states['trash'] = 'trash';
|
375 |
$states = esc_sql( $states );
|
376 |
$all_states = "'" . implode( "', '", $states ) . "'";
|
390 |
|
391 |
$options = '<option value="-1">' . esc_html__( 'Show All Content Types', 'wordpress-seo' ) . '</option>';
|
392 |
|
393 |
+
if ( is_array( $post_types ) && $post_types !== [] ) {
|
394 |
foreach ( $post_types as $post_type ) {
|
395 |
$obj = get_post_type_object( $post_type->post_type );
|
396 |
$options .= sprintf(
|
414 |
esc_attr( 'post-type-filter-' . $instance_type )
|
415 |
);
|
416 |
|
417 |
+
submit_button( esc_html__( 'Filter', 'wordpress-seo' ), 'button', false, false, [ 'id' => 'post-query-submit' ] );
|
418 |
echo '</div>';
|
419 |
}
|
420 |
}
|
428 |
* @return array
|
429 |
*/
|
430 |
public function get_sortable_columns() {
|
431 |
+
return [
|
432 |
+
'col_page_title' => [ 'post_title', true ],
|
433 |
+
'col_post_type' => [ 'post_type', false ],
|
434 |
+
'col_post_date' => [ 'post_date', false ],
|
435 |
+
];
|
436 |
}
|
437 |
|
438 |
/**
|
462 |
$current_page = 1;
|
463 |
$current_filter = '-1';
|
464 |
$current_status = '';
|
465 |
+
$current_order = [
|
466 |
'orderby' => 'post_title',
|
467 |
'order' => 'asc',
|
468 |
+
];
|
469 |
}
|
470 |
|
471 |
$_SERVER['REQUEST_URI'] = $request_url;
|
517 |
*/
|
518 |
protected function set_column_headers() {
|
519 |
$columns = $this->get_columns();
|
520 |
+
$hidden = [];
|
521 |
$sortable = $this->get_sortable_columns();
|
522 |
+
$this->_column_headers = [ $columns, $hidden, $sortable ];
|
523 |
}
|
524 |
|
525 |
/**
|
581 |
}
|
582 |
|
583 |
$this->set_pagination_args(
|
584 |
+
[
|
585 |
'total_items' => $total_items,
|
586 |
'total_pages' => ceil( $total_items / $per_page ),
|
587 |
'per_page' => $per_page,
|
588 |
+
]
|
589 |
);
|
590 |
|
591 |
+
$this->pagination = [
|
592 |
'per_page' => $per_page,
|
593 |
+
'offset' => ( ( $paged - 1 ) * $per_page ),
|
594 |
+
];
|
595 |
}
|
596 |
|
597 |
/**
|
639 |
* @return string $orderby
|
640 |
*/
|
641 |
protected function sanitize_orderby( $orderby ) {
|
642 |
+
$valid_column_names = [
|
643 |
'post_title',
|
644 |
'post_type',
|
645 |
'post_date',
|
646 |
+
];
|
647 |
|
648 |
if ( in_array( $orderby, $valid_column_names, true ) ) {
|
649 |
return $orderby;
|
661 |
* @return string $order SQL order string (ASC, DESC).
|
662 |
*/
|
663 |
protected function sanitize_order( $order ) {
|
664 |
+
if ( in_array( strtoupper( $order ), [ 'ASC', 'DESC' ], true ) ) {
|
665 |
return $order;
|
666 |
}
|
667 |
|
691 |
* @return string
|
692 |
*/
|
693 |
protected function get_all_states() {
|
694 |
+
$states = get_post_stati( [ 'show_in_admin_all_list' => true ] );
|
695 |
$states['trash'] = 'trash';
|
696 |
|
697 |
if ( ! empty( $this->input_fields['post_status'] ) ) {
|
698 |
$requested_state = $this->input_fields['post_status'];
|
699 |
if ( in_array( $requested_state, $states, true ) ) {
|
700 |
+
$states = [ $requested_state ];
|
701 |
}
|
702 |
|
703 |
if ( $requested_state !== 'trash' ) {
|
720 |
|
721 |
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
722 |
|
723 |
+
if ( ( is_array( $records ) && $records !== [] ) && ( is_array( $columns ) && $columns !== [] ) ) {
|
724 |
|
725 |
foreach ( $records as $rec ) {
|
726 |
|
764 |
protected function column_attributes( $column_name, $hidden, $classes, $column_display_name ) {
|
765 |
|
766 |
$attributes = '';
|
767 |
+
$class = [ $column_name, "column-$column_name$classes" ];
|
768 |
|
769 |
if ( in_array( $column_name, $hidden, true ) ) {
|
770 |
$class[] = 'hidden';
|
795 |
$post_type_object = get_post_type_object( $rec->post_type );
|
796 |
$can_edit_post = current_user_can( $post_type_object->cap->edit_post, $rec->ID );
|
797 |
|
798 |
+
$actions = [];
|
799 |
|
800 |
if ( $can_edit_post && 'trash' !== $rec->post_status ) {
|
801 |
$actions['edit'] = sprintf(
|
808 |
}
|
809 |
|
810 |
if ( $post_type_object->public ) {
|
811 |
+
if ( in_array( $rec->post_status, [ 'pending', 'draft', 'future' ], true ) ) {
|
812 |
if ( $can_edit_post ) {
|
813 |
$actions['view'] = sprintf(
|
814 |
'<a href="%s" aria-label="%s">%s</a>',
|
903 |
protected function parse_meta_data_field( $record_id, $attributes, $values = false ) {
|
904 |
|
905 |
// Fill meta data if exists in $this->meta_data.
|
906 |
+
$meta_data = ( ! empty( $this->meta_data[ $record_id ] ) ) ? $this->meta_data[ $record_id ] : [];
|
907 |
$meta_key = WPSEO_Meta::$meta_prefix . $this->target_db_field;
|
908 |
$meta_value = ( ! empty( $meta_data[ $meta_key ] ) ) ? $meta_data[ $meta_key ] : '';
|
909 |
|
941 |
* @return string
|
942 |
*/
|
943 |
protected function get_post_ids() {
|
944 |
+
$needed_ids = [];
|
945 |
foreach ( $this->items as $item ) {
|
946 |
$needed_ids[] = $item->ID;
|
947 |
}
|
991 |
*
|
992 |
* @return array
|
993 |
*/
|
994 |
+
protected function merge_columns( $columns = [] ) {
|
995 |
$columns = array_merge(
|
996 |
+
[
|
997 |
'col_page_title' => __( 'WP Page Title', 'wordpress-seo' ),
|
998 |
'col_post_type' => __( 'Content Type', 'wordpress-seo' ),
|
999 |
'col_post_status' => __( 'Post Status', 'wordpress-seo' ),
|
1000 |
'col_post_date' => __( 'Publication date', 'wordpress-seo' ),
|
1001 |
'col_page_slug' => __( 'Page URL/Slug', 'wordpress-seo' ),
|
1002 |
+
],
|
1003 |
$columns
|
1004 |
);
|
1005 |
|
admin/class-bulk-title-editor-list-table.php
CHANGED
@@ -23,11 +23,11 @@ class WPSEO_Bulk_Title_Editor_List_Table extends WPSEO_Bulk_List_Table {
|
|
23 |
*
|
24 |
* @var array
|
25 |
*/
|
26 |
-
protected $settings =
|
27 |
'singular' => 'wpseo_bulk_title',
|
28 |
'plural' => 'wpseo_bulk_titles',
|
29 |
'ajax' => true,
|
30 |
-
|
31 |
|
32 |
/**
|
33 |
* The field in the database where meta field is saved.
|
@@ -43,12 +43,12 @@ class WPSEO_Bulk_Title_Editor_List_Table extends WPSEO_Bulk_List_Table {
|
|
43 |
*/
|
44 |
public function get_columns() {
|
45 |
|
46 |
-
$columns =
|
47 |
/* translators: %1$s expands to Yoast SEO */
|
48 |
'col_existing_yoast_seo_title' => sprintf( __( 'Existing %1$s Title', 'wordpress-seo' ), 'Yoast SEO' ),
|
49 |
/* translators: %1$s expands to Yoast SEO */
|
50 |
'col_new_yoast_seo_title' => sprintf( __( 'New %1$s Title', 'wordpress-seo' ), 'Yoast SEO' ),
|
51 |
-
|
52 |
|
53 |
return $this->merge_columns( $columns );
|
54 |
}
|
@@ -65,7 +65,7 @@ class WPSEO_Bulk_Title_Editor_List_Table extends WPSEO_Bulk_List_Table {
|
|
65 |
protected function parse_page_specific_column( $column_name, $record, $attributes ) {
|
66 |
|
67 |
// Fill meta data if exists in $this->meta_data.
|
68 |
-
$meta_data = ( ! empty( $this->meta_data[ $record->ID ] ) ) ? $this->meta_data[ $record->ID ] :
|
69 |
|
70 |
switch ( $column_name ) {
|
71 |
case 'col_existing_yoast_seo_title':
|
23 |
*
|
24 |
* @var array
|
25 |
*/
|
26 |
+
protected $settings = [
|
27 |
'singular' => 'wpseo_bulk_title',
|
28 |
'plural' => 'wpseo_bulk_titles',
|
29 |
'ajax' => true,
|
30 |
+
];
|
31 |
|
32 |
/**
|
33 |
* The field in the database where meta field is saved.
|
43 |
*/
|
44 |
public function get_columns() {
|
45 |
|
46 |
+
$columns = [
|
47 |
/* translators: %1$s expands to Yoast SEO */
|
48 |
'col_existing_yoast_seo_title' => sprintf( __( 'Existing %1$s Title', 'wordpress-seo' ), 'Yoast SEO' ),
|
49 |
/* translators: %1$s expands to Yoast SEO */
|
50 |
'col_new_yoast_seo_title' => sprintf( __( 'New %1$s Title', 'wordpress-seo' ), 'Yoast SEO' ),
|
51 |
+
];
|
52 |
|
53 |
return $this->merge_columns( $columns );
|
54 |
}
|
65 |
protected function parse_page_specific_column( $column_name, $record, $attributes ) {
|
66 |
|
67 |
// Fill meta data if exists in $this->meta_data.
|
68 |
+
$meta_data = ( ! empty( $this->meta_data[ $record->ID ] ) ) ? $this->meta_data[ $record->ID ] : [];
|
69 |
|
70 |
switch ( $column_name ) {
|
71 |
case 'col_existing_yoast_seo_title':
|
admin/class-collector.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Collector {
|
|
15 |
*
|
16 |
* @var WPSEO_Collection[]
|
17 |
*/
|
18 |
-
protected $collections =
|
19 |
|
20 |
/**
|
21 |
* Adds a collection object to the collections.
|
@@ -32,7 +32,7 @@ class WPSEO_Collector {
|
|
32 |
* @return array The collected data.
|
33 |
*/
|
34 |
public function collect() {
|
35 |
-
$data =
|
36 |
|
37 |
foreach ( $this->collections as $collection ) {
|
38 |
$data = array_merge( $data, $collection->get() );
|
15 |
*
|
16 |
* @var WPSEO_Collection[]
|
17 |
*/
|
18 |
+
protected $collections = [];
|
19 |
|
20 |
/**
|
21 |
* Adds a collection object to the collections.
|
32 |
* @return array The collected data.
|
33 |
*/
|
34 |
public function collect() {
|
35 |
+
$data = [];
|
36 |
|
37 |
foreach ( $this->collections as $collection ) {
|
38 |
$data = array_merge( $data, $collection->get() );
|
admin/class-config.php
CHANGED
@@ -30,7 +30,7 @@ class WPSEO_Admin_Pages {
|
|
30 |
* Class constructor, which basically only hooks the init function on the init hook.
|
31 |
*/
|
32 |
public function __construct() {
|
33 |
-
add_action( 'init',
|
34 |
$this->asset_manager = new WPSEO_Admin_Asset_Manager();
|
35 |
}
|
36 |
|
@@ -43,8 +43,8 @@ class WPSEO_Admin_Pages {
|
|
43 |
wp_redirect( admin_url( 'admin.php?page=' . WPSEO_Configuration_Page::PAGE_IDENTIFIER ) );
|
44 |
}
|
45 |
|
46 |
-
add_action( 'admin_enqueue_scripts',
|
47 |
-
add_action( 'admin_enqueue_scripts',
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -88,7 +88,7 @@ class WPSEO_Admin_Pages {
|
|
88 |
|
89 |
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'admin-script', 'wpseoSelect2Locale', WPSEO_Language_Utils::get_language( WPSEO_Language_Utils::get_user_locale() ) );
|
90 |
|
91 |
-
if ( in_array( $page,
|
92 |
wp_enqueue_media();
|
93 |
|
94 |
$this->asset_manager->enqueue_script( 'admin-media' );
|
@@ -106,9 +106,9 @@ class WPSEO_Admin_Pages {
|
|
106 |
* @return array The upload module variables.
|
107 |
*/
|
108 |
public function localize_media_script() {
|
109 |
-
return
|
110 |
'choose_image' => __( 'Use Image', 'wordpress-seo' ),
|
111 |
-
|
112 |
}
|
113 |
|
114 |
/**
|
@@ -122,12 +122,12 @@ class WPSEO_Admin_Pages {
|
|
122 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
123 |
$replace_vars_list = $replace_vars->get_replacement_variables_list();
|
124 |
|
125 |
-
return
|
126 |
'replace_vars' => $replace_vars_list,
|
127 |
'recommended_replace_vars' => $recommended_replace_vars->get_recommended_replacevars(),
|
128 |
'editor_specific_replace_vars' => $editor_specific_replace_vars->get(),
|
129 |
'shared_replace_vars' => $editor_specific_replace_vars->get_generic( $replace_vars_list ),
|
130 |
-
|
131 |
}
|
132 |
|
133 |
/**
|
@@ -136,13 +136,13 @@ class WPSEO_Admin_Pages {
|
|
136 |
* @return array The search appearance variables.
|
137 |
*/
|
138 |
public function localize_search_appearance_script() {
|
139 |
-
$search_appearance_l10n =
|
140 |
'isRtl' => is_rtl(),
|
141 |
'userEditUrl' => add_query_arg( 'user_id', '{user_id}', admin_url( 'user-edit.php' ) ),
|
142 |
'brushstrokeBackgroundURL' => plugins_url( 'images/brushstroke_background.svg', WPSEO_FILE ),
|
143 |
'showLocalSEOUpsell' => $this->should_show_local_seo_upsell(),
|
144 |
'localSEOUpsellURL' => WPSEO_Shortlinker::get( 'https://yoa.st/3mp' ),
|
145 |
-
|
146 |
|
147 |
$search_appearance_l10n['knowledgeGraphCompanyInfoMissing'] = WPSEO_Language_Utils::get_knowledge_graph_company_info_missing_l10n();
|
148 |
|
30 |
* Class constructor, which basically only hooks the init function on the init hook.
|
31 |
*/
|
32 |
public function __construct() {
|
33 |
+
add_action( 'init', [ $this, 'init' ], 20 );
|
34 |
$this->asset_manager = new WPSEO_Admin_Asset_Manager();
|
35 |
}
|
36 |
|
43 |
wp_redirect( admin_url( 'admin.php?page=' . WPSEO_Configuration_Page::PAGE_IDENTIFIER ) );
|
44 |
}
|
45 |
|
46 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'config_page_scripts' ] );
|
47 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'config_page_styles' ] );
|
48 |
}
|
49 |
|
50 |
/**
|
88 |
|
89 |
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'admin-script', 'wpseoSelect2Locale', WPSEO_Language_Utils::get_language( WPSEO_Language_Utils::get_user_locale() ) );
|
90 |
|
91 |
+
if ( in_array( $page, [ 'wpseo_social', WPSEO_Admin::PAGE_IDENTIFIER, 'wpseo_titles' ], true ) ) {
|
92 |
wp_enqueue_media();
|
93 |
|
94 |
$this->asset_manager->enqueue_script( 'admin-media' );
|
106 |
* @return array The upload module variables.
|
107 |
*/
|
108 |
public function localize_media_script() {
|
109 |
+
return [
|
110 |
'choose_image' => __( 'Use Image', 'wordpress-seo' ),
|
111 |
+
];
|
112 |
}
|
113 |
|
114 |
/**
|
122 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
123 |
$replace_vars_list = $replace_vars->get_replacement_variables_list();
|
124 |
|
125 |
+
return [
|
126 |
'replace_vars' => $replace_vars_list,
|
127 |
'recommended_replace_vars' => $recommended_replace_vars->get_recommended_replacevars(),
|
128 |
'editor_specific_replace_vars' => $editor_specific_replace_vars->get(),
|
129 |
'shared_replace_vars' => $editor_specific_replace_vars->get_generic( $replace_vars_list ),
|
130 |
+
];
|
131 |
}
|
132 |
|
133 |
/**
|
136 |
* @return array The search appearance variables.
|
137 |
*/
|
138 |
public function localize_search_appearance_script() {
|
139 |
+
$search_appearance_l10n = [
|
140 |
'isRtl' => is_rtl(),
|
141 |
'userEditUrl' => add_query_arg( 'user_id', '{user_id}', admin_url( 'user-edit.php' ) ),
|
142 |
'brushstrokeBackgroundURL' => plugins_url( 'images/brushstroke_background.svg', WPSEO_FILE ),
|
143 |
'showLocalSEOUpsell' => $this->should_show_local_seo_upsell(),
|
144 |
'localSEOUpsellURL' => WPSEO_Shortlinker::get( 'https://yoa.st/3mp' ),
|
145 |
+
];
|
146 |
|
147 |
$search_appearance_l10n['knowledgeGraphCompanyInfoMissing'] = WPSEO_Language_Utils::get_knowledge_graph_company_info_missing_l10n();
|
148 |
|
admin/class-customizer.php
CHANGED
@@ -29,30 +29,30 @@ class WPSEO_Customizer {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
private $default_setting_args =
|
33 |
'default' => '',
|
34 |
'type' => 'option',
|
35 |
'transport' => 'refresh',
|
36 |
-
|
37 |
|
38 |
/**
|
39 |
* Default arguments for the breadcrumbs customizer control object.
|
40 |
*
|
41 |
* @var array
|
42 |
*/
|
43 |
-
private $default_control_args =
|
44 |
'label' => '',
|
45 |
'type' => 'text',
|
46 |
'section' => 'wpseo_breadcrumbs_customizer_section',
|
47 |
'settings' => '',
|
48 |
'context' => '',
|
49 |
-
|
50 |
|
51 |
/**
|
52 |
* Construct Method.
|
53 |
*/
|
54 |
public function __construct() {
|
55 |
-
add_action( 'customize_register',
|
56 |
}
|
57 |
|
58 |
/**
|
@@ -81,12 +81,12 @@ class WPSEO_Customizer {
|
|
81 |
* Add the breadcrumbs section to the customizer.
|
82 |
*/
|
83 |
private function breadcrumbs_section() {
|
84 |
-
$section_args =
|
85 |
/* translators: %s is the name of the plugin */
|
86 |
'title' => sprintf( __( '%s Breadcrumbs', 'wordpress-seo' ), 'Yoast SEO' ),
|
87 |
'priority' => 999,
|
88 |
-
'active_callback' =>
|
89 |
-
|
90 |
|
91 |
$this->wp_customize->add_section( 'wpseo_breadcrumbs_customizer_section', $section_args );
|
92 |
}
|
@@ -105,11 +105,11 @@ class WPSEO_Customizer {
|
|
105 |
*/
|
106 |
private function breadcrumbs_blog_show_setting() {
|
107 |
$index = 'breadcrumbs-display-blog-page';
|
108 |
-
$control_args =
|
109 |
'label' => __( 'Show blog page in breadcrumbs', 'wordpress-seo' ),
|
110 |
'type' => 'checkbox',
|
111 |
-
'active_callback' =>
|
112 |
-
|
113 |
|
114 |
$this->add_setting_and_control( $index, $control_args );
|
115 |
}
|
@@ -128,9 +128,9 @@ class WPSEO_Customizer {
|
|
128 |
*/
|
129 |
private function breadcrumbs_separator_setting() {
|
130 |
$index = 'breadcrumbs-sep';
|
131 |
-
$control_args =
|
132 |
'label' => __( 'Breadcrumbs separator:', 'wordpress-seo' ),
|
133 |
-
|
134 |
$id = 'wpseo-breadcrumbs-separator';
|
135 |
|
136 |
$this->add_setting_and_control( $index, $control_args, $id );
|
@@ -141,9 +141,9 @@ class WPSEO_Customizer {
|
|
141 |
*/
|
142 |
private function breadcrumbs_home_setting() {
|
143 |
$index = 'breadcrumbs-home';
|
144 |
-
$control_args =
|
145 |
'label' => __( 'Anchor text for the homepage:', 'wordpress-seo' ),
|
146 |
-
|
147 |
|
148 |
$this->add_setting_and_control( $index, $control_args );
|
149 |
}
|
@@ -153,9 +153,9 @@ class WPSEO_Customizer {
|
|
153 |
*/
|
154 |
private function breadcrumbs_prefix_setting() {
|
155 |
$index = 'breadcrumbs-prefix';
|
156 |
-
$control_args =
|
157 |
'label' => __( 'Prefix for breadcrumbs:', 'wordpress-seo' ),
|
158 |
-
|
159 |
|
160 |
$this->add_setting_and_control( $index, $control_args );
|
161 |
}
|
@@ -165,9 +165,9 @@ class WPSEO_Customizer {
|
|
165 |
*/
|
166 |
private function breadcrumbs_archiveprefix_setting() {
|
167 |
$index = 'breadcrumbs-archiveprefix';
|
168 |
-
$control_args =
|
169 |
'label' => __( 'Prefix for archive pages:', 'wordpress-seo' ),
|
170 |
-
|
171 |
|
172 |
$this->add_setting_and_control( $index, $control_args );
|
173 |
}
|
@@ -177,9 +177,9 @@ class WPSEO_Customizer {
|
|
177 |
*/
|
178 |
private function breadcrumbs_searchprefix_setting() {
|
179 |
$index = 'breadcrumbs-searchprefix';
|
180 |
-
$control_args =
|
181 |
'label' => __( 'Prefix for search result pages:', 'wordpress-seo' ),
|
182 |
-
|
183 |
|
184 |
$this->add_setting_and_control( $index, $control_args );
|
185 |
}
|
@@ -189,9 +189,9 @@ class WPSEO_Customizer {
|
|
189 |
*/
|
190 |
private function breadcrumbs_404_setting() {
|
191 |
$index = 'breadcrumbs-404crumb';
|
192 |
-
$control_args =
|
193 |
'label' => __( 'Breadcrumb for 404 pages:', 'wordpress-seo' ),
|
194 |
-
|
195 |
|
196 |
$this->add_setting_and_control( $index, $control_args );
|
197 |
}
|
@@ -207,7 +207,7 @@ class WPSEO_Customizer {
|
|
207 |
* @param array $custom_settings Optional. Customizer setting arguments.
|
208 |
* Only those different from the default need to be passed.
|
209 |
*/
|
210 |
-
private function add_setting_and_control( $index, $control_args, $id = null, $custom_settings =
|
211 |
$setting = sprintf( $this->setting_template, $index );
|
212 |
$control_args = array_merge( $this->default_control_args, $control_args );
|
213 |
$control_args['settings'] = $setting;
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
private $default_setting_args = [
|
33 |
'default' => '',
|
34 |
'type' => 'option',
|
35 |
'transport' => 'refresh',
|
36 |
+
];
|
37 |
|
38 |
/**
|
39 |
* Default arguments for the breadcrumbs customizer control object.
|
40 |
*
|
41 |
* @var array
|
42 |
*/
|
43 |
+
private $default_control_args = [
|
44 |
'label' => '',
|
45 |
'type' => 'text',
|
46 |
'section' => 'wpseo_breadcrumbs_customizer_section',
|
47 |
'settings' => '',
|
48 |
'context' => '',
|
49 |
+
];
|
50 |
|
51 |
/**
|
52 |
* Construct Method.
|
53 |
*/
|
54 |
public function __construct() {
|
55 |
+
add_action( 'customize_register', [ $this, 'wpseo_customize_register' ] );
|
56 |
}
|
57 |
|
58 |
/**
|
81 |
* Add the breadcrumbs section to the customizer.
|
82 |
*/
|
83 |
private function breadcrumbs_section() {
|
84 |
+
$section_args = [
|
85 |
/* translators: %s is the name of the plugin */
|
86 |
'title' => sprintf( __( '%s Breadcrumbs', 'wordpress-seo' ), 'Yoast SEO' ),
|
87 |
'priority' => 999,
|
88 |
+
'active_callback' => [ $this, 'breadcrumbs_active_callback' ],
|
89 |
+
];
|
90 |
|
91 |
$this->wp_customize->add_section( 'wpseo_breadcrumbs_customizer_section', $section_args );
|
92 |
}
|
105 |
*/
|
106 |
private function breadcrumbs_blog_show_setting() {
|
107 |
$index = 'breadcrumbs-display-blog-page';
|
108 |
+
$control_args = [
|
109 |
'label' => __( 'Show blog page in breadcrumbs', 'wordpress-seo' ),
|
110 |
'type' => 'checkbox',
|
111 |
+
'active_callback' => [ $this, 'breadcrumbs_blog_show_active_cb' ],
|
112 |
+
];
|
113 |
|
114 |
$this->add_setting_and_control( $index, $control_args );
|
115 |
}
|
128 |
*/
|
129 |
private function breadcrumbs_separator_setting() {
|
130 |
$index = 'breadcrumbs-sep';
|
131 |
+
$control_args = [
|
132 |
'label' => __( 'Breadcrumbs separator:', 'wordpress-seo' ),
|
133 |
+
];
|
134 |
$id = 'wpseo-breadcrumbs-separator';
|
135 |
|
136 |
$this->add_setting_and_control( $index, $control_args, $id );
|
141 |
*/
|
142 |
private function breadcrumbs_home_setting() {
|
143 |
$index = 'breadcrumbs-home';
|
144 |
+
$control_args = [
|
145 |
'label' => __( 'Anchor text for the homepage:', 'wordpress-seo' ),
|
146 |
+
];
|
147 |
|
148 |
$this->add_setting_and_control( $index, $control_args );
|
149 |
}
|
153 |
*/
|
154 |
private function breadcrumbs_prefix_setting() {
|
155 |
$index = 'breadcrumbs-prefix';
|
156 |
+
$control_args = [
|
157 |
'label' => __( 'Prefix for breadcrumbs:', 'wordpress-seo' ),
|
158 |
+
];
|
159 |
|
160 |
$this->add_setting_and_control( $index, $control_args );
|
161 |
}
|
165 |
*/
|
166 |
private function breadcrumbs_archiveprefix_setting() {
|
167 |
$index = 'breadcrumbs-archiveprefix';
|
168 |
+
$control_args = [
|
169 |
'label' => __( 'Prefix for archive pages:', 'wordpress-seo' ),
|
170 |
+
];
|
171 |
|
172 |
$this->add_setting_and_control( $index, $control_args );
|
173 |
}
|
177 |
*/
|
178 |
private function breadcrumbs_searchprefix_setting() {
|
179 |
$index = 'breadcrumbs-searchprefix';
|
180 |
+
$control_args = [
|
181 |
'label' => __( 'Prefix for search result pages:', 'wordpress-seo' ),
|
182 |
+
];
|
183 |
|
184 |
$this->add_setting_and_control( $index, $control_args );
|
185 |
}
|
189 |
*/
|
190 |
private function breadcrumbs_404_setting() {
|
191 |
$index = 'breadcrumbs-404crumb';
|
192 |
+
$control_args = [
|
193 |
'label' => __( 'Breadcrumb for 404 pages:', 'wordpress-seo' ),
|
194 |
+
];
|
195 |
|
196 |
$this->add_setting_and_control( $index, $control_args );
|
197 |
}
|
207 |
* @param array $custom_settings Optional. Customizer setting arguments.
|
208 |
* Only those different from the default need to be passed.
|
209 |
*/
|
210 |
+
private function add_setting_and_control( $index, $control_args, $id = null, $custom_settings = [] ) {
|
211 |
$setting = sprintf( $this->setting_template, $index );
|
212 |
$control_args = array_merge( $this->default_control_args, $control_args );
|
213 |
$control_args['settings'] = $setting;
|
admin/class-database-proxy.php
CHANGED
@@ -127,8 +127,8 @@ class WPSEO_Database_Proxy {
|
|
127 |
|
128 |
$this->pre_execution();
|
129 |
|
130 |
-
$update =
|
131 |
-
$keys =
|
132 |
$columns = array_keys( $data );
|
133 |
foreach ( $columns as $column ) {
|
134 |
$keys[] = '`' . $column . '`';
|
@@ -198,7 +198,7 @@ class WPSEO_Database_Proxy {
|
|
198 |
*
|
199 |
* @return bool True when creation is successful.
|
200 |
*/
|
201 |
-
public function create_table( array $columns, array $indexes =
|
202 |
$create_table = sprintf(
|
203 |
'CREATE TABLE IF NOT EXISTS %1$s ( %2$s ) %3$s',
|
204 |
$this->get_table_name(),
|
127 |
|
128 |
$this->pre_execution();
|
129 |
|
130 |
+
$update = [];
|
131 |
+
$keys = [];
|
132 |
$columns = array_keys( $data );
|
133 |
foreach ( $columns as $column ) {
|
134 |
$keys[] = '`' . $column . '`';
|
198 |
*
|
199 |
* @return bool True when creation is successful.
|
200 |
*/
|
201 |
+
public function create_table( array $columns, array $indexes = [] ) {
|
202 |
$create_table = sprintf(
|
203 |
'CREATE TABLE IF NOT EXISTS %1$s ( %2$s ) %3$s',
|
204 |
$this->get_table_name(),
|
admin/class-expose-shortlinks.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
private $shortlinks =
|
19 |
'shortlinks.focus_keyword_info' => 'https://yoa.st/focus-keyword',
|
20 |
'shortlinks.snippet_preview_info' => 'https://yoa.st/snippet-preview',
|
21 |
'shortlinks.cornerstone_content_info' => 'https://yoa.st/1i9',
|
@@ -37,7 +37,7 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
|
|
37 |
'shortlinks.activate_premium_info' => 'https://yoa.st/activate-subscription',
|
38 |
'shortlinks.upsell.sidebar.morphology_upsell_metabox' => 'https://yoa.st/morphology-upsell-metabox',
|
39 |
'shortlinks.upsell.sidebar.morphology_upsell_sidebar' => 'https://yoa.st/morphology-upsell-sidebar',
|
40 |
-
|
41 |
|
42 |
/**
|
43 |
* Registers all hooks to WordPress.
|
@@ -45,7 +45,7 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
|
|
45 |
* @return void
|
46 |
*/
|
47 |
public function register_hooks() {
|
48 |
-
add_filter( 'wpseo_admin_l10n',
|
49 |
}
|
50 |
|
51 |
/**
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
private $shortlinks = [
|
19 |
'shortlinks.focus_keyword_info' => 'https://yoa.st/focus-keyword',
|
20 |
'shortlinks.snippet_preview_info' => 'https://yoa.st/snippet-preview',
|
21 |
'shortlinks.cornerstone_content_info' => 'https://yoa.st/1i9',
|
37 |
'shortlinks.activate_premium_info' => 'https://yoa.st/activate-subscription',
|
38 |
'shortlinks.upsell.sidebar.morphology_upsell_metabox' => 'https://yoa.st/morphology-upsell-metabox',
|
39 |
'shortlinks.upsell.sidebar.morphology_upsell_sidebar' => 'https://yoa.st/morphology-upsell-sidebar',
|
40 |
+
];
|
41 |
|
42 |
/**
|
43 |
* Registers all hooks to WordPress.
|
45 |
* @return void
|
46 |
*/
|
47 |
public function register_hooks() {
|
48 |
+
add_filter( 'wpseo_admin_l10n', [ $this, 'expose_shortlinks' ] );
|
49 |
}
|
50 |
|
51 |
/**
|
admin/class-extension-manager.php
CHANGED
@@ -22,7 +22,7 @@ class WPSEO_Extension_Manager {
|
|
22 |
*
|
23 |
* @var WPSEO_Extension[]
|
24 |
*/
|
25 |
-
protected $extensions =
|
26 |
|
27 |
/**
|
28 |
* List of active plugins.
|
@@ -117,7 +117,7 @@ class WPSEO_Extension_Manager {
|
|
117 |
* @return array Array containing the active extensions.
|
118 |
*/
|
119 |
protected function retrieve_active_extensions() {
|
120 |
-
return (array) apply_filters( 'yoast-active-extensions',
|
121 |
}
|
122 |
|
123 |
/**
|
22 |
*
|
23 |
* @var WPSEO_Extension[]
|
24 |
*/
|
25 |
+
protected $extensions = [];
|
26 |
|
27 |
/**
|
28 |
* List of active plugins.
|
117 |
* @return array Array containing the active extensions.
|
118 |
*/
|
119 |
protected function retrieve_active_extensions() {
|
120 |
+
return (array) apply_filters( 'yoast-active-extensions', [] );
|
121 |
}
|
122 |
|
123 |
/**
|
admin/class-extension.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Extension {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $config =
|
19 |
|
20 |
/**
|
21 |
* WPSEO_Extension constructor.
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $config = [];
|
19 |
|
20 |
/**
|
21 |
* WPSEO_Extension constructor.
|
admin/class-extensions.php
CHANGED
@@ -15,38 +15,38 @@ class WPSEO_Extensions {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $extensions =
|
19 |
-
'Yoast SEO Premium' =>
|
20 |
'slug' => 'yoast-seo-premium',
|
21 |
'identifier' => 'wordpress-seo-premium',
|
22 |
'classname' => 'WPSEO_Premium',
|
23 |
'my-yoast-slug' => WPSEO_Addon_Manager::PREMIUM_SLUG,
|
24 |
-
|
25 |
-
'News SEO' =>
|
26 |
'slug' => 'news-seo',
|
27 |
'identifier' => 'wpseo-news',
|
28 |
'classname' => 'WPSEO_News',
|
29 |
'my-yoast-slug' => WPSEO_Addon_Manager::NEWS_SLUG,
|
30 |
-
|
31 |
-
'Yoast WooCommerce SEO' =>
|
32 |
'slug' => 'woocommerce-yoast-seo',
|
33 |
'identifier' => 'wpseo-woocommerce',
|
34 |
'classname' => 'Yoast_WooCommerce_SEO',
|
35 |
'my-yoast-slug' => WPSEO_Addon_Manager::WOOCOMMERCE_SLUG,
|
36 |
-
|
37 |
-
'Video SEO' =>
|
38 |
'slug' => 'video-seo-for-wordpress',
|
39 |
'identifier' => 'wpseo-video',
|
40 |
'classname' => 'WPSEO_Video_Sitemap',
|
41 |
'my-yoast-slug' => WPSEO_Addon_Manager::VIDEO_SLUG,
|
42 |
-
|
43 |
-
'Local SEO' =>
|
44 |
'slug' => 'local-seo-for-wordpress',
|
45 |
'identifier' => 'wpseo-local',
|
46 |
'classname' => 'WPSEO_Local_Core',
|
47 |
'my-yoast-slug' => WPSEO_Addon_Manager::LOCAL_SLUG,
|
48 |
-
|
49 |
-
|
50 |
|
51 |
/**
|
52 |
* Returns the set extensions.
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $extensions = [
|
19 |
+
'Yoast SEO Premium' => [
|
20 |
'slug' => 'yoast-seo-premium',
|
21 |
'identifier' => 'wordpress-seo-premium',
|
22 |
'classname' => 'WPSEO_Premium',
|
23 |
'my-yoast-slug' => WPSEO_Addon_Manager::PREMIUM_SLUG,
|
24 |
+
],
|
25 |
+
'News SEO' => [
|
26 |
'slug' => 'news-seo',
|
27 |
'identifier' => 'wpseo-news',
|
28 |
'classname' => 'WPSEO_News',
|
29 |
'my-yoast-slug' => WPSEO_Addon_Manager::NEWS_SLUG,
|
30 |
+
],
|
31 |
+
'Yoast WooCommerce SEO' => [
|
32 |
'slug' => 'woocommerce-yoast-seo',
|
33 |
'identifier' => 'wpseo-woocommerce',
|
34 |
'classname' => 'Yoast_WooCommerce_SEO',
|
35 |
'my-yoast-slug' => WPSEO_Addon_Manager::WOOCOMMERCE_SLUG,
|
36 |
+
],
|
37 |
+
'Video SEO' => [
|
38 |
'slug' => 'video-seo-for-wordpress',
|
39 |
'identifier' => 'wpseo-video',
|
40 |
'classname' => 'WPSEO_Video_Sitemap',
|
41 |
'my-yoast-slug' => WPSEO_Addon_Manager::VIDEO_SLUG,
|
42 |
+
],
|
43 |
+
'Local SEO' => [
|
44 |
'slug' => 'local-seo-for-wordpress',
|
45 |
'identifier' => 'wpseo-local',
|
46 |
'classname' => 'WPSEO_Local_Core',
|
47 |
'my-yoast-slug' => WPSEO_Addon_Manager::LOCAL_SLUG,
|
48 |
+
],
|
49 |
+
];
|
50 |
|
51 |
/**
|
52 |
* Returns the set extensions.
|
admin/class-helpscout.php
CHANGED
@@ -61,8 +61,8 @@ class WPSEO_HelpScout implements WPSEO_WordPress_Integration {
|
|
61 |
return;
|
62 |
}
|
63 |
|
64 |
-
add_action( 'admin_enqueue_scripts',
|
65 |
-
add_action( 'admin_footer',
|
66 |
}
|
67 |
|
68 |
/**
|
@@ -116,14 +116,14 @@ class WPSEO_HelpScout implements WPSEO_WordPress_Integration {
|
|
116 |
// Do not make these strings translatable! They are for our support agents, the user won't see them!
|
117 |
$current_user = wp_get_current_user();
|
118 |
|
119 |
-
$data =
|
120 |
'name' => trim( $current_user->user_firstname . ' ' . $current_user->user_lastname ),
|
121 |
'email' => $current_user->user_email,
|
122 |
'WordPress Version' => $this->get_wordpress_version(),
|
123 |
'Server' => $this->get_server_info(),
|
124 |
'<a href="' . admin_url( 'themes.php' ) . '">Theme</a>' => $this->get_theme_info(),
|
125 |
'<a href="' . admin_url( 'plugins.php' ) . '">Plugins</a>' => $this->get_active_plugins(),
|
126 |
-
|
127 |
|
128 |
if ( ! empty( $this->products ) ) {
|
129 |
$addon_manager = new WPSEO_Addon_Manager();
|
@@ -151,13 +151,13 @@ class WPSEO_HelpScout implements WPSEO_WordPress_Integration {
|
|
151 |
$server_data = $server_tracking_data->get();
|
152 |
$server_data = $server_data['server'];
|
153 |
|
154 |
-
$fields_to_use =
|
155 |
'IP' => 'ip',
|
156 |
'Hostname' => 'Hostname',
|
157 |
'OS' => 'os',
|
158 |
'PHP' => 'PhpVersion',
|
159 |
'CURL' => 'CurlVersion',
|
160 |
-
|
161 |
|
162 |
$server_data['CurlVersion'] = $server_data['CurlVersion']['version'] . '(SSL Support' . $server_data['CurlVersion']['sslSupport'] . ')';
|
163 |
|
61 |
return;
|
62 |
}
|
63 |
|
64 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_help_scout_script' ] );
|
65 |
+
add_action( 'admin_footer', [ $this, 'output_beacon_js' ] );
|
66 |
}
|
67 |
|
68 |
/**
|
116 |
// Do not make these strings translatable! They are for our support agents, the user won't see them!
|
117 |
$current_user = wp_get_current_user();
|
118 |
|
119 |
+
$data = [
|
120 |
'name' => trim( $current_user->user_firstname . ' ' . $current_user->user_lastname ),
|
121 |
'email' => $current_user->user_email,
|
122 |
'WordPress Version' => $this->get_wordpress_version(),
|
123 |
'Server' => $this->get_server_info(),
|
124 |
'<a href="' . admin_url( 'themes.php' ) . '">Theme</a>' => $this->get_theme_info(),
|
125 |
'<a href="' . admin_url( 'plugins.php' ) . '">Plugins</a>' => $this->get_active_plugins(),
|
126 |
+
];
|
127 |
|
128 |
if ( ! empty( $this->products ) ) {
|
129 |
$addon_manager = new WPSEO_Addon_Manager();
|
151 |
$server_data = $server_tracking_data->get();
|
152 |
$server_data = $server_data['server'];
|
153 |
|
154 |
+
$fields_to_use = [
|
155 |
'IP' => 'ip',
|
156 |
'Hostname' => 'Hostname',
|
157 |
'OS' => 'os',
|
158 |
'PHP' => 'PhpVersion',
|
159 |
'CURL' => 'CurlVersion',
|
160 |
+
];
|
161 |
|
162 |
$server_data['CurlVersion'] = $server_data['CurlVersion']['version'] . '(SSL Support' . $server_data['CurlVersion']['sslSupport'] . ')';
|
163 |
|
admin/class-keyword-synonyms-modal.php
CHANGED
@@ -19,7 +19,7 @@ class WPSEO_Keyword_Synonyms_Modal {
|
|
19 |
* @return array Translated text strings for the Keyword Synonyms modal.
|
20 |
*/
|
21 |
public function get_translations() {
|
22 |
-
return
|
23 |
'title' => __( 'Would you like to add keyphrase synonyms?', 'wordpress-seo' ),
|
24 |
'intro' => sprintf(
|
25 |
/* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
|
@@ -40,7 +40,7 @@ class WPSEO_Keyword_Synonyms_Modal {
|
|
40 |
),
|
41 |
'small' => __( '1 year free support and updates included!', 'wordpress-seo' ),
|
42 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
43 |
-
|
44 |
}
|
45 |
|
46 |
/**
|
@@ -51,10 +51,10 @@ class WPSEO_Keyword_Synonyms_Modal {
|
|
51 |
public function get_translations_for_js() {
|
52 |
$translations = $this->get_translations();
|
53 |
|
54 |
-
return
|
55 |
'locale' => WPSEO_Language_Utils::get_user_locale(),
|
56 |
'intl' => $translations,
|
57 |
-
|
58 |
}
|
59 |
|
60 |
/**
|
19 |
* @return array Translated text strings for the Keyword Synonyms modal.
|
20 |
*/
|
21 |
public function get_translations() {
|
22 |
+
return [
|
23 |
'title' => __( 'Would you like to add keyphrase synonyms?', 'wordpress-seo' ),
|
24 |
'intro' => sprintf(
|
25 |
/* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
|
40 |
),
|
41 |
'small' => __( '1 year free support and updates included!', 'wordpress-seo' ),
|
42 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
43 |
+
];
|
44 |
}
|
45 |
|
46 |
/**
|
51 |
public function get_translations_for_js() {
|
52 |
$translations = $this->get_translations();
|
53 |
|
54 |
+
return [
|
55 |
'locale' => WPSEO_Language_Utils::get_user_locale(),
|
56 |
'intl' => $translations,
|
57 |
+
];
|
58 |
}
|
59 |
|
60 |
/**
|
admin/class-license-page-manager.php
CHANGED
@@ -28,15 +28,15 @@ class WPSEO_License_Page_Manager implements WPSEO_WordPress_Integration {
|
|
28 |
* Registers all hooks to WordPress.
|
29 |
*/
|
30 |
public function register_hooks() {
|
31 |
-
add_filter( 'http_response',
|
32 |
|
33 |
if ( $this->get_version() === self::VERSION_BACKWARDS_COMPATIBILITY ) {
|
34 |
add_filter( 'yoast-license-valid', '__return_true' );
|
35 |
add_filter( 'yoast-show-license-notice', '__return_false' );
|
36 |
-
add_action( 'admin_init',
|
37 |
}
|
38 |
else {
|
39 |
-
add_action( 'admin_init',
|
40 |
}
|
41 |
}
|
42 |
|
@@ -52,7 +52,7 @@ class WPSEO_License_Page_Manager implements WPSEO_WordPress_Integration {
|
|
52 |
*
|
53 |
* @api array $extensions The array with extensions.
|
54 |
*/
|
55 |
-
apply_filters( 'yoast-active-extensions',
|
56 |
}
|
57 |
|
58 |
$extension_list = new WPSEO_Extensions();
|
@@ -180,7 +180,7 @@ class WPSEO_License_Page_Manager implements WPSEO_WordPress_Integration {
|
|
180 |
protected function is_expected_endpoint( $url ) {
|
181 |
$url_parts = wp_parse_url( $url );
|
182 |
|
183 |
-
$is_yoast_com = ( in_array( $url_parts['host'],
|
184 |
$is_edd_api = ( isset( $url_parts['path'] ) && $url_parts['path'] === '/edd-sl-api' );
|
185 |
|
186 |
return $is_yoast_com && $is_edd_api;
|
@@ -194,11 +194,11 @@ class WPSEO_License_Page_Manager implements WPSEO_WordPress_Integration {
|
|
194 |
* @return Yoast_Notification The created notification.
|
195 |
*/
|
196 |
protected function create_notification( $product_name ) {
|
197 |
-
$notification_options =
|
198 |
'type' => Yoast_Notification::ERROR,
|
199 |
'id' => 'wpseo-dismiss-' . sanitize_title_with_dashes( $product_name, null, 'save' ),
|
200 |
'capabilities' => 'wpseo_manage_options',
|
201 |
-
|
202 |
|
203 |
$notification = new Yoast_Notification(
|
204 |
sprintf(
|
28 |
* Registers all hooks to WordPress.
|
29 |
*/
|
30 |
public function register_hooks() {
|
31 |
+
add_filter( 'http_response', [ $this, 'handle_response' ], 10, 3 );
|
32 |
|
33 |
if ( $this->get_version() === self::VERSION_BACKWARDS_COMPATIBILITY ) {
|
34 |
add_filter( 'yoast-license-valid', '__return_true' );
|
35 |
add_filter( 'yoast-show-license-notice', '__return_false' );
|
36 |
+
add_action( 'admin_init', [ $this, 'validate_extensions' ], 15 );
|
37 |
}
|
38 |
else {
|
39 |
+
add_action( 'admin_init', [ $this, 'remove_faulty_notifications' ], 15 );
|
40 |
}
|
41 |
}
|
42 |
|
52 |
*
|
53 |
* @api array $extensions The array with extensions.
|
54 |
*/
|
55 |
+
apply_filters( 'yoast-active-extensions', [] );
|
56 |
}
|
57 |
|
58 |
$extension_list = new WPSEO_Extensions();
|
180 |
protected function is_expected_endpoint( $url ) {
|
181 |
$url_parts = wp_parse_url( $url );
|
182 |
|
183 |
+
$is_yoast_com = ( in_array( $url_parts['host'], [ 'yoast.com', 'my.yoast.com' ], true ) );
|
184 |
$is_edd_api = ( isset( $url_parts['path'] ) && $url_parts['path'] === '/edd-sl-api' );
|
185 |
|
186 |
return $is_yoast_com && $is_edd_api;
|
194 |
* @return Yoast_Notification The created notification.
|
195 |
*/
|
196 |
protected function create_notification( $product_name ) {
|
197 |
+
$notification_options = [
|
198 |
'type' => Yoast_Notification::ERROR,
|
199 |
'id' => 'wpseo-dismiss-' . sanitize_title_with_dashes( $product_name, null, 'save' ),
|
200 |
'capabilities' => 'wpseo_manage_options',
|
201 |
+
];
|
202 |
|
203 |
$notification = new Yoast_Notification(
|
204 |
sprintf(
|
admin/class-meta-columns.php
CHANGED
@@ -29,7 +29,7 @@ class WPSEO_Meta_Columns {
|
|
29 |
*/
|
30 |
public function __construct() {
|
31 |
if ( apply_filters( 'wpseo_use_page_analysis', true ) === true ) {
|
32 |
-
add_action( 'admin_init',
|
33 |
}
|
34 |
|
35 |
$this->analysis_seo = new WPSEO_Metabox_Analysis_SEO();
|
@@ -43,14 +43,14 @@ class WPSEO_Meta_Columns {
|
|
43 |
$this->set_post_type_hooks();
|
44 |
|
45 |
if ( $this->analysis_seo->is_enabled() ) {
|
46 |
-
add_action( 'restrict_manage_posts',
|
47 |
}
|
48 |
|
49 |
if ( $this->analysis_readability->is_enabled() ) {
|
50 |
-
add_action( 'restrict_manage_posts',
|
51 |
}
|
52 |
|
53 |
-
add_filter( 'request',
|
54 |
}
|
55 |
|
56 |
/**
|
@@ -65,7 +65,7 @@ class WPSEO_Meta_Columns {
|
|
65 |
return $columns;
|
66 |
}
|
67 |
|
68 |
-
$added_columns =
|
69 |
|
70 |
if ( $this->analysis_seo->is_enabled() ) {
|
71 |
$added_columns['wpseo-score'] = '<span class="yoast-tooltip yoast-tooltip-n yoast-tooltip-alt" data-label="' . esc_attr__( 'SEO score', 'wordpress-seo' ) . '"><span class="yoast-column-seo-score yoast-column-header-has-tooltip"><span class="screen-reader-text">' . __( 'SEO score', 'wordpress-seo' ) . '</span></span></span>';
|
@@ -183,7 +183,7 @@ class WPSEO_Meta_Columns {
|
|
183 |
}
|
184 |
|
185 |
if ( ! is_array( $result ) ) {
|
186 |
-
$result =
|
187 |
}
|
188 |
|
189 |
array_push( $result, 'wpseo-title', 'wpseo-metadesc' );
|
@@ -300,11 +300,11 @@ class WPSEO_Meta_Columns {
|
|
300 |
* @return array The keyword filter.
|
301 |
*/
|
302 |
protected function get_keyword_filter( $keyword_filter ) {
|
303 |
-
return
|
304 |
'post_type' => get_query_var( 'post_type', 'post' ),
|
305 |
'key' => WPSEO_Meta::$meta_prefix . 'focuskw',
|
306 |
'value' => sanitize_text_field( $keyword_filter ),
|
307 |
-
|
308 |
}
|
309 |
|
310 |
/**
|
@@ -324,7 +324,7 @@ class WPSEO_Meta_Columns {
|
|
324 |
* @return array Array containing all the applicable filters.
|
325 |
*/
|
326 |
protected function collect_filters() {
|
327 |
-
$active_filters =
|
328 |
|
329 |
$seo_filter = $this->get_current_seo_filter();
|
330 |
$readability_filter = $this->get_current_readability_filter();
|
@@ -377,18 +377,18 @@ class WPSEO_Meta_Columns {
|
|
377 |
* @return array Array containing the query parameters regarding meta robots.
|
378 |
*/
|
379 |
protected function get_meta_robots_query_values() {
|
380 |
-
return
|
381 |
'relation' => 'OR',
|
382 |
-
|
383 |
'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
384 |
'compare' => 'NOT EXISTS',
|
385 |
-
|
386 |
-
|
387 |
'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
388 |
'value' => '1',
|
389 |
'compare' => '!=',
|
390 |
-
|
391 |
-
|
392 |
}
|
393 |
|
394 |
/**
|
@@ -400,7 +400,7 @@ class WPSEO_Meta_Columns {
|
|
400 |
*/
|
401 |
protected function determine_score_filters( $score_filters ) {
|
402 |
if ( count( $score_filters ) > 1 ) {
|
403 |
-
return array_merge(
|
404 |
}
|
405 |
|
406 |
return $score_filters;
|
@@ -456,14 +456,14 @@ class WPSEO_Meta_Columns {
|
|
456 |
return $vars;
|
457 |
}
|
458 |
|
459 |
-
$result =
|
460 |
-
$result['meta_query'] = array_merge( $result['meta_query'],
|
461 |
|
462 |
$current_seo_filter = $this->get_current_seo_filter();
|
463 |
|
464 |
// This only applies for the SEO score filter because it can because the SEO score can be altered by the no-index option.
|
465 |
-
if ( $this->is_valid_filter( $current_seo_filter ) && ! in_array( $current_seo_filter,
|
466 |
-
$result['meta_query'] = array_merge( $result['meta_query'],
|
467 |
}
|
468 |
|
469 |
return array_merge( $vars, $result );
|
@@ -478,14 +478,14 @@ class WPSEO_Meta_Columns {
|
|
478 |
* @return array The Readability Score filter.
|
479 |
*/
|
480 |
protected function create_readability_score_filter( $low, $high ) {
|
481 |
-
return
|
482 |
-
|
483 |
'key' => WPSEO_Meta::$meta_prefix . 'content_score',
|
484 |
-
'value' =>
|
485 |
'type' => 'numeric',
|
486 |
'compare' => 'BETWEEN',
|
487 |
-
|
488 |
-
|
489 |
}
|
490 |
|
491 |
/**
|
@@ -497,14 +497,14 @@ class WPSEO_Meta_Columns {
|
|
497 |
* @return array The SEO score filter.
|
498 |
*/
|
499 |
protected function create_seo_score_filter( $low, $high ) {
|
500 |
-
return
|
501 |
-
|
502 |
'key' => WPSEO_Meta::$meta_prefix . 'linkdex',
|
503 |
-
'value' =>
|
504 |
'type' => 'numeric',
|
505 |
'compare' => 'BETWEEN',
|
506 |
-
|
507 |
-
|
508 |
}
|
509 |
|
510 |
/**
|
@@ -513,13 +513,13 @@ class WPSEO_Meta_Columns {
|
|
513 |
* @return array Array containin the no-index filter.
|
514 |
*/
|
515 |
protected function create_no_index_filter() {
|
516 |
-
return
|
517 |
-
|
518 |
'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
519 |
'value' => '1',
|
520 |
'compare' => '=',
|
521 |
-
|
522 |
-
|
523 |
}
|
524 |
|
525 |
/**
|
@@ -528,18 +528,18 @@ class WPSEO_Meta_Columns {
|
|
528 |
* @return array Array containing the no focus keyword filter.
|
529 |
*/
|
530 |
protected function create_no_focus_keyword_filter() {
|
531 |
-
return
|
532 |
-
|
533 |
'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
534 |
'value' => 'needs-a-value-anyway',
|
535 |
'compare' => 'NOT EXISTS',
|
536 |
-
|
537 |
-
|
538 |
'key' => WPSEO_Meta::$meta_prefix . 'linkdex',
|
539 |
'value' => 'needs-a-value-anyway',
|
540 |
'compare' => 'NOT EXISTS',
|
541 |
-
|
542 |
-
|
543 |
}
|
544 |
|
545 |
/**
|
@@ -585,19 +585,19 @@ class WPSEO_Meta_Columns {
|
|
585 |
private function filter_order_by( $order_by ) {
|
586 |
switch ( $order_by ) {
|
587 |
case 'wpseo-metadesc':
|
588 |
-
return
|
589 |
'meta_key' => WPSEO_Meta::$meta_prefix . 'metadesc',
|
590 |
'orderby' => 'meta_value',
|
591 |
-
|
592 |
|
593 |
case 'wpseo-focuskw':
|
594 |
-
return
|
595 |
'meta_key' => WPSEO_Meta::$meta_prefix . 'focuskw',
|
596 |
'orderby' => 'meta_value',
|
597 |
-
|
598 |
}
|
599 |
|
600 |
-
return
|
601 |
}
|
602 |
|
603 |
/**
|
@@ -651,7 +651,7 @@ class WPSEO_Meta_Columns {
|
|
651 |
private function set_post_type_hooks() {
|
652 |
$post_types = WPSEO_Post_Type::get_accessible_post_types();
|
653 |
|
654 |
-
if ( ! is_array( $post_types ) || $post_types ===
|
655 |
return;
|
656 |
}
|
657 |
|
@@ -660,9 +660,9 @@ class WPSEO_Meta_Columns {
|
|
660 |
continue;
|
661 |
}
|
662 |
|
663 |
-
add_filter( 'manage_' . $post_type . '_posts_columns',
|
664 |
-
add_action( 'manage_' . $post_type . '_posts_custom_column',
|
665 |
-
add_action( 'manage_edit-' . $post_type . '_sortable_columns',
|
666 |
|
667 |
/*
|
668 |
* Use the `get_user_option_{$option}` filter to change the output of the get_user_option
|
@@ -671,7 +671,7 @@ class WPSEO_Meta_Columns {
|
|
671 |
*/
|
672 |
$filter = sprintf( 'get_user_option_%s', sprintf( 'manage%scolumnshidden', 'edit-' . $post_type ) );
|
673 |
|
674 |
-
add_filter( $filter,
|
675 |
}
|
676 |
|
677 |
unset( $post_type );
|
29 |
*/
|
30 |
public function __construct() {
|
31 |
if ( apply_filters( 'wpseo_use_page_analysis', true ) === true ) {
|
32 |
+
add_action( 'admin_init', [ $this, 'setup_hooks' ] );
|
33 |
}
|
34 |
|
35 |
$this->analysis_seo = new WPSEO_Metabox_Analysis_SEO();
|
43 |
$this->set_post_type_hooks();
|
44 |
|
45 |
if ( $this->analysis_seo->is_enabled() ) {
|
46 |
+
add_action( 'restrict_manage_posts', [ $this, 'posts_filter_dropdown' ] );
|
47 |
}
|
48 |
|
49 |
if ( $this->analysis_readability->is_enabled() ) {
|
50 |
+
add_action( 'restrict_manage_posts', [ $this, 'posts_filter_dropdown_readability' ] );
|
51 |
}
|
52 |
|
53 |
+
add_filter( 'request', [ $this, 'column_sort_orderby' ] );
|
54 |
}
|
55 |
|
56 |
/**
|
65 |
return $columns;
|
66 |
}
|
67 |
|
68 |
+
$added_columns = [];
|
69 |
|
70 |
if ( $this->analysis_seo->is_enabled() ) {
|
71 |
$added_columns['wpseo-score'] = '<span class="yoast-tooltip yoast-tooltip-n yoast-tooltip-alt" data-label="' . esc_attr__( 'SEO score', 'wordpress-seo' ) . '"><span class="yoast-column-seo-score yoast-column-header-has-tooltip"><span class="screen-reader-text">' . __( 'SEO score', 'wordpress-seo' ) . '</span></span></span>';
|
183 |
}
|
184 |
|
185 |
if ( ! is_array( $result ) ) {
|
186 |
+
$result = [];
|
187 |
}
|
188 |
|
189 |
array_push( $result, 'wpseo-title', 'wpseo-metadesc' );
|
300 |
* @return array The keyword filter.
|
301 |
*/
|
302 |
protected function get_keyword_filter( $keyword_filter ) {
|
303 |
+
return [
|
304 |
'post_type' => get_query_var( 'post_type', 'post' ),
|
305 |
'key' => WPSEO_Meta::$meta_prefix . 'focuskw',
|
306 |
'value' => sanitize_text_field( $keyword_filter ),
|
307 |
+
];
|
308 |
}
|
309 |
|
310 |
/**
|
324 |
* @return array Array containing all the applicable filters.
|
325 |
*/
|
326 |
protected function collect_filters() {
|
327 |
+
$active_filters = [];
|
328 |
|
329 |
$seo_filter = $this->get_current_seo_filter();
|
330 |
$readability_filter = $this->get_current_readability_filter();
|
377 |
* @return array Array containing the query parameters regarding meta robots.
|
378 |
*/
|
379 |
protected function get_meta_robots_query_values() {
|
380 |
+
return [
|
381 |
'relation' => 'OR',
|
382 |
+
[
|
383 |
'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
384 |
'compare' => 'NOT EXISTS',
|
385 |
+
],
|
386 |
+
[
|
387 |
'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
388 |
'value' => '1',
|
389 |
'compare' => '!=',
|
390 |
+
],
|
391 |
+
];
|
392 |
}
|
393 |
|
394 |
/**
|
400 |
*/
|
401 |
protected function determine_score_filters( $score_filters ) {
|
402 |
if ( count( $score_filters ) > 1 ) {
|
403 |
+
return array_merge( [ 'relation' => 'AND' ], $score_filters );
|
404 |
}
|
405 |
|
406 |
return $score_filters;
|
456 |
return $vars;
|
457 |
}
|
458 |
|
459 |
+
$result = [ 'meta_query' => [] ];
|
460 |
+
$result['meta_query'] = array_merge( $result['meta_query'], [ $this->determine_score_filters( $filters ) ] );
|
461 |
|
462 |
$current_seo_filter = $this->get_current_seo_filter();
|
463 |
|
464 |
// This only applies for the SEO score filter because it can because the SEO score can be altered by the no-index option.
|
465 |
+
if ( $this->is_valid_filter( $current_seo_filter ) && ! in_array( $current_seo_filter, [ WPSEO_Rank::NO_INDEX, WPSEO_Rank::NO_FOCUS ], true ) ) {
|
466 |
+
$result['meta_query'] = array_merge( $result['meta_query'], [ $this->get_meta_robots_query_values() ] );
|
467 |
}
|
468 |
|
469 |
return array_merge( $vars, $result );
|
478 |
* @return array The Readability Score filter.
|
479 |
*/
|
480 |
protected function create_readability_score_filter( $low, $high ) {
|
481 |
+
return [
|
482 |
+
[
|
483 |
'key' => WPSEO_Meta::$meta_prefix . 'content_score',
|
484 |
+
'value' => [ $low, $high ],
|
485 |
'type' => 'numeric',
|
486 |
'compare' => 'BETWEEN',
|
487 |
+
],
|
488 |
+
];
|
489 |
}
|
490 |
|
491 |
/**
|
497 |
* @return array The SEO score filter.
|
498 |
*/
|
499 |
protected function create_seo_score_filter( $low, $high ) {
|
500 |
+
return [
|
501 |
+
[
|
502 |
'key' => WPSEO_Meta::$meta_prefix . 'linkdex',
|
503 |
+
'value' => [ $low, $high ],
|
504 |
'type' => 'numeric',
|
505 |
'compare' => 'BETWEEN',
|
506 |
+
],
|
507 |
+
];
|
508 |
}
|
509 |
|
510 |
/**
|
513 |
* @return array Array containin the no-index filter.
|
514 |
*/
|
515 |
protected function create_no_index_filter() {
|
516 |
+
return [
|
517 |
+
[
|
518 |
'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
519 |
'value' => '1',
|
520 |
'compare' => '=',
|
521 |
+
],
|
522 |
+
];
|
523 |
}
|
524 |
|
525 |
/**
|
528 |
* @return array Array containing the no focus keyword filter.
|
529 |
*/
|
530 |
protected function create_no_focus_keyword_filter() {
|
531 |
+
return [
|
532 |
+
[
|
533 |
'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
534 |
'value' => 'needs-a-value-anyway',
|
535 |
'compare' => 'NOT EXISTS',
|
536 |
+
],
|
537 |
+
[
|
538 |
'key' => WPSEO_Meta::$meta_prefix . 'linkdex',
|
539 |
'value' => 'needs-a-value-anyway',
|
540 |
'compare' => 'NOT EXISTS',
|
541 |
+
],
|
542 |
+
];
|
543 |
}
|
544 |
|
545 |
/**
|
585 |
private function filter_order_by( $order_by ) {
|
586 |
switch ( $order_by ) {
|
587 |
case 'wpseo-metadesc':
|
588 |
+
return [
|
589 |
'meta_key' => WPSEO_Meta::$meta_prefix . 'metadesc',
|
590 |
'orderby' => 'meta_value',
|
591 |
+
];
|
592 |
|
593 |
case 'wpseo-focuskw':
|
594 |
+
return [
|
595 |
'meta_key' => WPSEO_Meta::$meta_prefix . 'focuskw',
|
596 |
'orderby' => 'meta_value',
|
597 |
+
];
|
598 |
}
|
599 |
|
600 |
+
return [];
|
601 |
}
|
602 |
|
603 |
/**
|
651 |
private function set_post_type_hooks() {
|
652 |
$post_types = WPSEO_Post_Type::get_accessible_post_types();
|
653 |
|
654 |
+
if ( ! is_array( $post_types ) || $post_types === [] ) {
|
655 |
return;
|
656 |
}
|
657 |
|
660 |
continue;
|
661 |
}
|
662 |
|
663 |
+
add_filter( 'manage_' . $post_type . '_posts_columns', [ $this, 'column_heading' ], 10, 1 );
|
664 |
+
add_action( 'manage_' . $post_type . '_posts_custom_column', [ $this, 'column_content' ], 10, 2 );
|
665 |
+
add_action( 'manage_edit-' . $post_type . '_sortable_columns', [ $this, 'column_sort' ], 10, 2 );
|
666 |
|
667 |
/*
|
668 |
* Use the `get_user_option_{$option}` filter to change the output of the get_user_option
|
671 |
*/
|
672 |
$filter = sprintf( 'get_user_option_%s', sprintf( 'manage%scolumnshidden', 'edit-' . $post_type ) );
|
673 |
|
674 |
+
add_filter( $filter, [ $this, 'column_hidden' ], 10, 3 );
|
675 |
}
|
676 |
|
677 |
unset( $post_type );
|
admin/class-meta-storage.php
CHANGED
@@ -62,14 +62,14 @@ class WPSEO_Meta_Storage implements WPSEO_Installable {
|
|
62 |
*/
|
63 |
public function install() {
|
64 |
return $this->database_proxy->create_table(
|
65 |
-
|
66 |
'object_id bigint(20) UNSIGNED NOT NULL',
|
67 |
'internal_link_count int(10) UNSIGNED NULL DEFAULT NULL',
|
68 |
'incoming_link_count int(10) UNSIGNED NULL DEFAULT NULL',
|
69 |
-
|
70 |
-
|
71 |
'UNIQUE KEY object_id (object_id)',
|
72 |
-
|
73 |
);
|
74 |
}
|
75 |
|
@@ -80,7 +80,7 @@ class WPSEO_Meta_Storage implements WPSEO_Installable {
|
|
80 |
* @param array $meta_data The total amount of links.
|
81 |
*/
|
82 |
public function save_meta_data( $meta_id, array $meta_data ) {
|
83 |
-
$where =
|
84 |
|
85 |
$saved = $this->database_proxy->upsert(
|
86 |
array_merge( $where, $meta_data ),
|
@@ -112,15 +112,15 @@ class WPSEO_Meta_Storage implements WPSEO_Installable {
|
|
112 |
|
113 |
$results = $wpdb->get_results( $query );
|
114 |
|
115 |
-
$post_ids_non_zero =
|
116 |
foreach ( $results as $result ) {
|
117 |
-
$this->save_meta_data( $result->post_id,
|
118 |
$post_ids_non_zero[] = $result->post_id;
|
119 |
}
|
120 |
|
121 |
$post_ids_zero = array_diff( $post_ids, $post_ids_non_zero );
|
122 |
foreach ( $post_ids_zero as $post_id ) {
|
123 |
-
$this->save_meta_data( $post_id,
|
124 |
}
|
125 |
}
|
126 |
}
|
62 |
*/
|
63 |
public function install() {
|
64 |
return $this->database_proxy->create_table(
|
65 |
+
[
|
66 |
'object_id bigint(20) UNSIGNED NOT NULL',
|
67 |
'internal_link_count int(10) UNSIGNED NULL DEFAULT NULL',
|
68 |
'incoming_link_count int(10) UNSIGNED NULL DEFAULT NULL',
|
69 |
+
],
|
70 |
+
[
|
71 |
'UNIQUE KEY object_id (object_id)',
|
72 |
+
]
|
73 |
);
|
74 |
}
|
75 |
|
80 |
* @param array $meta_data The total amount of links.
|
81 |
*/
|
82 |
public function save_meta_data( $meta_id, array $meta_data ) {
|
83 |
+
$where = [ 'object_id' => $meta_id ];
|
84 |
|
85 |
$saved = $this->database_proxy->upsert(
|
86 |
array_merge( $where, $meta_data ),
|
112 |
|
113 |
$results = $wpdb->get_results( $query );
|
114 |
|
115 |
+
$post_ids_non_zero = [];
|
116 |
foreach ( $results as $result ) {
|
117 |
+
$this->save_meta_data( $result->post_id, [ 'incoming_link_count' => $result->incoming ] );
|
118 |
$post_ids_non_zero[] = $result->post_id;
|
119 |
}
|
120 |
|
121 |
$post_ids_zero = array_diff( $post_ids, $post_ids_non_zero );
|
122 |
foreach ( $post_ids_zero as $post_id ) {
|
123 |
+
$this->save_meta_data( $post_id, [ 'incoming_link_count' => 0 ] );
|
124 |
}
|
125 |
}
|
126 |
}
|
admin/class-multiple-keywords-modal.php
CHANGED
@@ -19,7 +19,7 @@ class WPSEO_Multiple_Keywords_Modal {
|
|
19 |
* @return array Translated text strings for the Multiple Keywords modal.
|
20 |
*/
|
21 |
public function get_translations() {
|
22 |
-
return
|
23 |
'title' => __( 'Would you like to add another keyphrase?', 'wordpress-seo' ),
|
24 |
'intro' => sprintf(
|
25 |
/* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
|
@@ -40,7 +40,7 @@ class WPSEO_Multiple_Keywords_Modal {
|
|
40 |
),
|
41 |
'small' => __( '1 year free support and updates included!', 'wordpress-seo' ),
|
42 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
43 |
-
|
44 |
}
|
45 |
|
46 |
/**
|
@@ -51,10 +51,10 @@ class WPSEO_Multiple_Keywords_Modal {
|
|
51 |
public function get_translations_for_js() {
|
52 |
$translations = $this->get_translations();
|
53 |
|
54 |
-
return
|
55 |
'locale' => WPSEO_Language_Utils::get_user_locale(),
|
56 |
'intl' => $translations,
|
57 |
-
|
58 |
}
|
59 |
|
60 |
/**
|
19 |
* @return array Translated text strings for the Multiple Keywords modal.
|
20 |
*/
|
21 |
public function get_translations() {
|
22 |
+
return [
|
23 |
'title' => __( 'Would you like to add another keyphrase?', 'wordpress-seo' ),
|
24 |
'intro' => sprintf(
|
25 |
/* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
|
40 |
),
|
41 |
'small' => __( '1 year free support and updates included!', 'wordpress-seo' ),
|
42 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
43 |
+
];
|
44 |
}
|
45 |
|
46 |
/**
|
51 |
public function get_translations_for_js() {
|
52 |
$translations = $this->get_translations();
|
53 |
|
54 |
+
return [
|
55 |
'locale' => WPSEO_Language_Utils::get_user_locale(),
|
56 |
'intl' => $translations,
|
57 |
+
];
|
58 |
}
|
59 |
|
60 |
/**
|
admin/class-my-yoast-proxy.php
CHANGED
@@ -40,8 +40,8 @@ class WPSEO_MyYoast_Proxy implements WPSEO_WordPress_Integration {
|
|
40 |
}
|
41 |
|
42 |
// Register the page for the proxy.
|
43 |
-
add_action( 'admin_menu',
|
44 |
-
add_action( 'admin_init',
|
45 |
}
|
46 |
|
47 |
/**
|
@@ -78,7 +78,7 @@ class WPSEO_MyYoast_Proxy implements WPSEO_WordPress_Integration {
|
|
78 |
*/
|
79 |
public function render_proxy_page() {
|
80 |
$proxy_options = $this->determine_proxy_options();
|
81 |
-
if ( $proxy_options ===
|
82 |
// Do not accept any other file than implemented.
|
83 |
$this->set_header( 'HTTP/1.0 501 Requested file not implemented' );
|
84 |
return;
|
@@ -171,13 +171,13 @@ class WPSEO_MyYoast_Proxy implements WPSEO_WordPress_Integration {
|
|
171 |
*/
|
172 |
protected function determine_proxy_options() {
|
173 |
if ( $this->get_proxy_file() === 'research-webworker' ) {
|
174 |
-
return
|
175 |
'content_type' => 'text/javascript; charset=UTF-8',
|
176 |
'url' => 'https://my.yoast.com/api/downloads/file/analysis-worker?plugin_version=' . $this->get_plugin_version(),
|
177 |
-
|
178 |
}
|
179 |
|
180 |
-
return
|
181 |
}
|
182 |
|
183 |
/**
|
@@ -225,7 +225,7 @@ class WPSEO_MyYoast_Proxy implements WPSEO_WordPress_Integration {
|
|
225 |
protected function get_plugin_version() {
|
226 |
$plugin_version = filter_input( INPUT_GET, 'plugin_version', FILTER_SANITIZE_STRING );
|
227 |
// Replace slashes to secure against requiring a file from another path.
|
228 |
-
$plugin_version = str_replace(
|
229 |
|
230 |
return $plugin_version;
|
231 |
}
|
40 |
}
|
41 |
|
42 |
// Register the page for the proxy.
|
43 |
+
add_action( 'admin_menu', [ $this, 'add_proxy_page' ] );
|
44 |
+
add_action( 'admin_init', [ $this, 'handle_proxy_page' ] );
|
45 |
}
|
46 |
|
47 |
/**
|
78 |
*/
|
79 |
public function render_proxy_page() {
|
80 |
$proxy_options = $this->determine_proxy_options();
|
81 |
+
if ( $proxy_options === [] ) {
|
82 |
// Do not accept any other file than implemented.
|
83 |
$this->set_header( 'HTTP/1.0 501 Requested file not implemented' );
|
84 |
return;
|
171 |
*/
|
172 |
protected function determine_proxy_options() {
|
173 |
if ( $this->get_proxy_file() === 'research-webworker' ) {
|
174 |
+
return [
|
175 |
'content_type' => 'text/javascript; charset=UTF-8',
|
176 |
'url' => 'https://my.yoast.com/api/downloads/file/analysis-worker?plugin_version=' . $this->get_plugin_version(),
|
177 |
+
];
|
178 |
}
|
179 |
|
180 |
+
return [];
|
181 |
}
|
182 |
|
183 |
/**
|
225 |
protected function get_plugin_version() {
|
226 |
$plugin_version = filter_input( INPUT_GET, 'plugin_version', FILTER_SANITIZE_STRING );
|
227 |
// Replace slashes to secure against requiring a file from another path.
|
228 |
+
$plugin_version = str_replace( [ '/', '\\' ], '_', $plugin_version );
|
229 |
|
230 |
return $plugin_version;
|
231 |
}
|
admin/class-my-yoast-route.php
CHANGED
@@ -34,7 +34,7 @@ class WPSEO_MyYoast_Route implements WPSEO_WordPress_Integration {
|
|
34 |
*
|
35 |
* @var array
|
36 |
*/
|
37 |
-
protected static $allowed_actions =
|
38 |
|
39 |
/**
|
40 |
* Sets the hooks when the user has enough rights and is on the right page.
|
@@ -51,8 +51,8 @@ class WPSEO_MyYoast_Route implements WPSEO_WordPress_Integration {
|
|
51 |
return;
|
52 |
}
|
53 |
|
54 |
-
add_action( 'admin_menu',
|
55 |
-
add_action( 'admin_init',
|
56 |
}
|
57 |
|
58 |
/**
|
@@ -121,14 +121,14 @@ class WPSEO_MyYoast_Route implements WPSEO_WordPress_Integration {
|
|
121 |
|
122 |
$this->redirect(
|
123 |
'https://my.yoast.com/connect',
|
124 |
-
|
125 |
'url' => WPSEO_Utils::get_home_url(),
|
126 |
'client_id' => $client_id,
|
127 |
'extensions' => $this->get_extensions(),
|
128 |
'redirect_url' => admin_url( 'admin.php?page=' . self::PAGE_IDENTIFIER . '&action=complete' ),
|
129 |
'credentials_url' => rest_url( 'yoast/v1/myyoast/connect' ),
|
130 |
'type' => 'wordpress',
|
131 |
-
|
132 |
);
|
133 |
}
|
134 |
|
@@ -166,9 +166,9 @@ class WPSEO_MyYoast_Route implements WPSEO_WordPress_Integration {
|
|
166 |
->get_provider()
|
167 |
->getAccessToken(
|
168 |
'authorization_code',
|
169 |
-
|
170 |
'code' => $this->get_authorization_code(),
|
171 |
-
|
172 |
);
|
173 |
|
174 |
$client->save_access_token(
|
@@ -195,9 +195,9 @@ class WPSEO_MyYoast_Route implements WPSEO_WordPress_Integration {
|
|
195 |
*/
|
196 |
protected function save_client_id( $client_id ) {
|
197 |
$this->get_client()->save_configuration(
|
198 |
-
|
199 |
'clientId' => $client_id,
|
200 |
-
|
201 |
);
|
202 |
}
|
203 |
|
@@ -261,7 +261,7 @@ class WPSEO_MyYoast_Route implements WPSEO_WordPress_Integration {
|
|
261 |
*
|
262 |
* @return void
|
263 |
*/
|
264 |
-
protected function redirect( $url, $query_args =
|
265 |
if ( ! empty( $query_args ) ) {
|
266 |
$url .= '?' . http_build_query( $query_args );
|
267 |
}
|
34 |
*
|
35 |
* @var array
|
36 |
*/
|
37 |
+
protected static $allowed_actions = [ 'connect', 'authorize', 'complete' ];
|
38 |
|
39 |
/**
|
40 |
* Sets the hooks when the user has enough rights and is on the right page.
|
51 |
return;
|
52 |
}
|
53 |
|
54 |
+
add_action( 'admin_menu', [ $this, 'register_route' ] );
|
55 |
+
add_action( 'admin_init', [ $this, 'handle_route' ] );
|
56 |
}
|
57 |
|
58 |
/**
|
121 |
|
122 |
$this->redirect(
|
123 |
'https://my.yoast.com/connect',
|
124 |
+
[
|
125 |
'url' => WPSEO_Utils::get_home_url(),
|
126 |
'client_id' => $client_id,
|
127 |
'extensions' => $this->get_extensions(),
|
128 |
'redirect_url' => admin_url( 'admin.php?page=' . self::PAGE_IDENTIFIER . '&action=complete' ),
|
129 |
'credentials_url' => rest_url( 'yoast/v1/myyoast/connect' ),
|
130 |
'type' => 'wordpress',
|
131 |
+
]
|
132 |
);
|
133 |
}
|
134 |
|
166 |
->get_provider()
|
167 |
->getAccessToken(
|
168 |
'authorization_code',
|
169 |
+
[
|
170 |
'code' => $this->get_authorization_code(),
|
171 |
+
]
|
172 |
);
|
173 |
|
174 |
$client->save_access_token(
|
195 |
*/
|
196 |
protected function save_client_id( $client_id ) {
|
197 |
$this->get_client()->save_configuration(
|
198 |
+
[
|
199 |
'clientId' => $client_id,
|
200 |
+
]
|
201 |
);
|
202 |
}
|
203 |
|
261 |
*
|
262 |
* @return void
|
263 |
*/
|
264 |
+
protected function redirect( $url, $query_args = [] ) {
|
265 |
if ( ! empty( $query_args ) ) {
|
266 |
$url .= '?' . http_build_query( $query_args );
|
267 |
}
|
admin/class-option-tab.php
CHANGED
@@ -38,7 +38,7 @@ class WPSEO_Option_Tab {
|
|
38 |
* @param string $label Localized label of the tab.
|
39 |
* @param array $arguments Optional arguments.
|
40 |
*/
|
41 |
-
public function __construct( $name, $label, array $arguments =
|
42 |
$this->name = sanitize_title( $name );
|
43 |
$this->label = $label;
|
44 |
$this->arguments = $arguments;
|
38 |
* @param string $label Localized label of the tab.
|
39 |
* @param array $arguments Optional arguments.
|
40 |
*/
|
41 |
+
public function __construct( $name, $label, array $arguments = [] ) {
|
42 |
$this->name = sanitize_title( $name );
|
43 |
$this->label = $label;
|
44 |
$this->arguments = $arguments;
|
admin/class-option-tabs.php
CHANGED
@@ -22,7 +22,7 @@ class WPSEO_Option_Tabs {
|
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
-
private $tabs =
|
26 |
|
27 |
/**
|
28 |
* Name of the active tab.
|
@@ -78,7 +78,7 @@ class WPSEO_Option_Tabs {
|
|
78 |
return null;
|
79 |
}
|
80 |
|
81 |
-
$active_tabs = array_filter( $this->tabs,
|
82 |
if ( ! empty( $active_tabs ) ) {
|
83 |
$active_tabs = array_values( $active_tabs );
|
84 |
if ( count( $active_tabs ) === 1 ) {
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
+
private $tabs = [];
|
26 |
|
27 |
/**
|
28 |
* Name of the active tab.
|
78 |
return null;
|
79 |
}
|
80 |
|
81 |
+
$active_tabs = array_filter( $this->tabs, [ $this, 'is_active_tab' ] );
|
82 |
if ( ! empty( $active_tabs ) ) {
|
83 |
$active_tabs = array_values( $active_tabs );
|
84 |
if ( count( $active_tabs ) === 1 ) {
|
admin/class-paper-presenter.php
CHANGED
@@ -39,8 +39,8 @@ class WPSEO_Paper_Presenter {
|
|
39 |
* a view file.
|
40 |
* @param array $settings Optional. Settings for the paper.
|
41 |
*/
|
42 |
-
public function __construct( $title, $view_file = null, array $settings =
|
43 |
-
$defaults =
|
44 |
'paper_id' => null,
|
45 |
'paper_id_prefix' => 'wpseo-',
|
46 |
'collapsible' => false,
|
@@ -50,8 +50,8 @@ class WPSEO_Paper_Presenter {
|
|
50 |
'title_after' => '',
|
51 |
'class' => '',
|
52 |
'content' => '',
|
53 |
-
'view_data' =>
|
54 |
-
|
55 |
|
56 |
$this->settings = wp_parse_args( $settings, $defaults );
|
57 |
$this->title = $title;
|
@@ -93,7 +93,7 @@ class WPSEO_Paper_Presenter {
|
|
93 |
$this->settings['help_text'] = new WPSEO_Admin_Help_Panel( '', '', '' );
|
94 |
}
|
95 |
|
96 |
-
$view_variables =
|
97 |
'class' => $this->settings['class'],
|
98 |
'collapsible' => $this->settings['collapsible'],
|
99 |
'collapsible_config' => $this->collapsible_config(),
|
@@ -105,7 +105,7 @@ class WPSEO_Paper_Presenter {
|
|
105 |
'paper_id' => $this->settings['paper_id'],
|
106 |
'paper_id_prefix' => $this->settings['paper_id_prefix'],
|
107 |
'yform' => Yoast_Form::get_instance(),
|
108 |
-
|
109 |
|
110 |
return array_merge( $this->settings['view_data'], $view_variables );
|
111 |
}
|
@@ -117,25 +117,25 @@ class WPSEO_Paper_Presenter {
|
|
117 |
*/
|
118 |
protected function collapsible_config() {
|
119 |
if ( empty( $this->settings['collapsible'] ) ) {
|
120 |
-
return
|
121 |
'toggle_icon' => '',
|
122 |
'class' => '',
|
123 |
'expanded' => '',
|
124 |
-
|
125 |
}
|
126 |
|
127 |
if ( ! empty( $this->settings['expanded'] ) ) {
|
128 |
-
return
|
129 |
'toggle_icon' => 'dashicons-arrow-up-alt2',
|
130 |
'class' => 'toggleable-container',
|
131 |
'expanded' => 'true',
|
132 |
-
|
133 |
}
|
134 |
|
135 |
-
return
|
136 |
'toggle_icon' => 'dashicons-arrow-down-alt2',
|
137 |
'class' => 'toggleable-container toggleable-container-hidden',
|
138 |
'expanded' => 'false',
|
139 |
-
|
140 |
}
|
141 |
}
|
39 |
* a view file.
|
40 |
* @param array $settings Optional. Settings for the paper.
|
41 |
*/
|
42 |
+
public function __construct( $title, $view_file = null, array $settings = [] ) {
|
43 |
+
$defaults = [
|
44 |
'paper_id' => null,
|
45 |
'paper_id_prefix' => 'wpseo-',
|
46 |
'collapsible' => false,
|
50 |
'title_after' => '',
|
51 |
'class' => '',
|
52 |
'content' => '',
|
53 |
+
'view_data' => [],
|
54 |
+
];
|
55 |
|
56 |
$this->settings = wp_parse_args( $settings, $defaults );
|
57 |
$this->title = $title;
|
93 |
$this->settings['help_text'] = new WPSEO_Admin_Help_Panel( '', '', '' );
|
94 |
}
|
95 |
|
96 |
+
$view_variables = [
|
97 |
'class' => $this->settings['class'],
|
98 |
'collapsible' => $this->settings['collapsible'],
|
99 |
'collapsible_config' => $this->collapsible_config(),
|
105 |
'paper_id' => $this->settings['paper_id'],
|
106 |
'paper_id_prefix' => $this->settings['paper_id_prefix'],
|
107 |
'yform' => Yoast_Form::get_instance(),
|
108 |
+
];
|
109 |
|
110 |
return array_merge( $this->settings['view_data'], $view_variables );
|
111 |
}
|
117 |
*/
|
118 |
protected function collapsible_config() {
|
119 |
if ( empty( $this->settings['collapsible'] ) ) {
|
120 |
+
return [
|
121 |
'toggle_icon' => '',
|
122 |
'class' => '',
|
123 |
'expanded' => '',
|
124 |
+
];
|
125 |
}
|
126 |
|
127 |
if ( ! empty( $this->settings['expanded'] ) ) {
|
128 |
+
return [
|
129 |
'toggle_icon' => 'dashicons-arrow-up-alt2',
|
130 |
'class' => 'toggleable-container',
|
131 |
'expanded' => 'true',
|
132 |
+
];
|
133 |
}
|
134 |
|
135 |
+
return [
|
136 |
'toggle_icon' => 'dashicons-arrow-down-alt2',
|
137 |
'class' => 'toggleable-container toggleable-container-hidden',
|
138 |
'expanded' => 'false',
|
139 |
+
];
|
140 |
}
|
141 |
}
|
admin/class-plugin-availability.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Plugin_Availability {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $plugins =
|
19 |
|
20 |
/**
|
21 |
* Registers the plugins so we can access them.
|
@@ -29,8 +29,8 @@ class WPSEO_Plugin_Availability {
|
|
29 |
* Registers all the available Yoast SEO plugins.
|
30 |
*/
|
31 |
protected function register_yoast_plugins() {
|
32 |
-
$this->plugins =
|
33 |
-
'yoast-seo-premium' =>
|
34 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1y7' ),
|
35 |
'title' => 'Yoast SEO Premium',
|
36 |
'description' => sprintf(
|
@@ -42,9 +42,9 @@ class WPSEO_Plugin_Availability {
|
|
42 |
'slug' => 'wordpress-seo-premium/wp-seo-premium.php',
|
43 |
'version_sync' => true,
|
44 |
'premium' => true,
|
45 |
-
|
46 |
|
47 |
-
'video-seo-for-wordpress-seo-by-yoast' =>
|
48 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1y8' ),
|
49 |
'title' => 'Video SEO',
|
50 |
'description' => __( 'Optimize your videos to show them off in search results and get more clicks!', 'wordpress-seo' ),
|
@@ -52,9 +52,9 @@ class WPSEO_Plugin_Availability {
|
|
52 |
'slug' => 'wpseo-video/video-seo.php',
|
53 |
'version_sync' => true,
|
54 |
'premium' => true,
|
55 |
-
|
56 |
|
57 |
-
'yoast-news-seo' =>
|
58 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1y9' ),
|
59 |
'title' => 'News SEO',
|
60 |
'description' => __( 'Are you in Google News? Increase your traffic from Google News by optimizing for it!', 'wordpress-seo' ),
|
@@ -62,9 +62,9 @@ class WPSEO_Plugin_Availability {
|
|
62 |
'slug' => 'wpseo-news/wpseo-news.php',
|
63 |
'version_sync' => true,
|
64 |
'premium' => true,
|
65 |
-
|
66 |
|
67 |
-
'local-seo-for-yoast-seo' =>
|
68 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1ya' ),
|
69 |
'title' => 'Local SEO',
|
70 |
'description' => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ),
|
@@ -72,9 +72,9 @@ class WPSEO_Plugin_Availability {
|
|
72 |
'slug' => 'wordpress-seo-local/local-seo.php',
|
73 |
'version_sync' => true,
|
74 |
'premium' => true,
|
75 |
-
|
76 |
|
77 |
-
'yoast-woocommerce-seo' =>
|
78 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1o0' ),
|
79 |
'title' => 'Yoast WooCommerce SEO',
|
80 |
'description' => sprintf(
|
@@ -82,18 +82,18 @@ class WPSEO_Plugin_Availability {
|
|
82 |
__( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ),
|
83 |
'Yoast SEO'
|
84 |
),
|
85 |
-
'_dependencies' =>
|
86 |
-
'WooCommerce' =>
|
87 |
'slug' => 'woocommerce/woocommerce.php',
|
88 |
-
|
89 |
-
|
90 |
'installed' => false,
|
91 |
'slug' => 'wpseo-woocommerce/wpseo-woocommerce.php',
|
92 |
'version_sync' => true,
|
93 |
'premium' => true,
|
94 |
-
|
95 |
|
96 |
-
'yoast-acf-analysis' =>
|
97 |
'url' => 'https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/',
|
98 |
'title' => 'ACF Content Analysis for Yoast SEO',
|
99 |
'description' => sprintf(
|
@@ -104,14 +104,14 @@ class WPSEO_Plugin_Availability {
|
|
104 |
),
|
105 |
'installed' => false,
|
106 |
'slug' => 'acf-content-analysis-for-yoast-seo/yoast-acf-analysis.php',
|
107 |
-
'_dependencies' =>
|
108 |
-
'Advanced Custom Fields' =>
|
109 |
'slug' => 'advanced-custom-fields/acf.php',
|
110 |
-
|
111 |
-
|
112 |
'version_sync' => false,
|
113 |
-
|
114 |
-
|
115 |
}
|
116 |
|
117 |
/**
|
@@ -162,7 +162,7 @@ class WPSEO_Plugin_Availability {
|
|
162 |
*/
|
163 |
public function get_plugin( $plugin ) {
|
164 |
if ( ! $this->plugin_exists( $plugin ) ) {
|
165 |
-
return
|
166 |
}
|
167 |
|
168 |
return $this->plugins[ $plugin ];
|
@@ -203,7 +203,7 @@ class WPSEO_Plugin_Availability {
|
|
203 |
*/
|
204 |
public function get_dependencies( $plugin ) {
|
205 |
if ( ! $this->has_dependencies( $plugin ) ) {
|
206 |
-
return
|
207 |
}
|
208 |
|
209 |
return $plugin['_dependencies'];
|
@@ -222,7 +222,7 @@ class WPSEO_Plugin_Availability {
|
|
222 |
}
|
223 |
|
224 |
$dependencies = $this->get_dependencies( $plugin );
|
225 |
-
$installed_dependencies = array_filter( $dependencies,
|
226 |
|
227 |
return count( $installed_dependencies ) === count( $dependencies );
|
228 |
}
|
@@ -248,7 +248,7 @@ class WPSEO_Plugin_Availability {
|
|
248 |
* @return array The installed plugins.
|
249 |
*/
|
250 |
public function get_installed_plugins() {
|
251 |
-
$installed =
|
252 |
|
253 |
foreach ( $this->plugins as $plugin_key => $plugin ) {
|
254 |
if ( $this->is_installed( $plugin ) ) {
|
@@ -290,7 +290,7 @@ class WPSEO_Plugin_Availability {
|
|
290 |
*/
|
291 |
public function get_dependency_names( $plugin ) {
|
292 |
if ( ! $this->has_dependencies( $plugin ) ) {
|
293 |
-
return
|
294 |
}
|
295 |
|
296 |
return array_keys( $plugin['_dependencies'] );
|
@@ -302,7 +302,7 @@ class WPSEO_Plugin_Availability {
|
|
302 |
* @return array Array of the plugins that have dependencies.
|
303 |
*/
|
304 |
public function get_plugins_with_dependencies() {
|
305 |
-
return array_filter( $this->plugins,
|
306 |
}
|
307 |
|
308 |
/**
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $plugins = [];
|
19 |
|
20 |
/**
|
21 |
* Registers the plugins so we can access them.
|
29 |
* Registers all the available Yoast SEO plugins.
|
30 |
*/
|
31 |
protected function register_yoast_plugins() {
|
32 |
+
$this->plugins = [
|
33 |
+
'yoast-seo-premium' => [
|
34 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1y7' ),
|
35 |
'title' => 'Yoast SEO Premium',
|
36 |
'description' => sprintf(
|
42 |
'slug' => 'wordpress-seo-premium/wp-seo-premium.php',
|
43 |
'version_sync' => true,
|
44 |
'premium' => true,
|
45 |
+
],
|
46 |
|
47 |
+
'video-seo-for-wordpress-seo-by-yoast' => [
|
48 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1y8' ),
|
49 |
'title' => 'Video SEO',
|
50 |
'description' => __( 'Optimize your videos to show them off in search results and get more clicks!', 'wordpress-seo' ),
|
52 |
'slug' => 'wpseo-video/video-seo.php',
|
53 |
'version_sync' => true,
|
54 |
'premium' => true,
|
55 |
+
],
|
56 |
|
57 |
+
'yoast-news-seo' => [
|
58 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1y9' ),
|
59 |
'title' => 'News SEO',
|
60 |
'description' => __( 'Are you in Google News? Increase your traffic from Google News by optimizing for it!', 'wordpress-seo' ),
|
62 |
'slug' => 'wpseo-news/wpseo-news.php',
|
63 |
'version_sync' => true,
|
64 |
'premium' => true,
|
65 |
+
],
|
66 |
|
67 |
+
'local-seo-for-yoast-seo' => [
|
68 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1ya' ),
|
69 |
'title' => 'Local SEO',
|
70 |
'description' => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ),
|
72 |
'slug' => 'wordpress-seo-local/local-seo.php',
|
73 |
'version_sync' => true,
|
74 |
'premium' => true,
|
75 |
+
],
|
76 |
|
77 |
+
'yoast-woocommerce-seo' => [
|
78 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/1o0' ),
|
79 |
'title' => 'Yoast WooCommerce SEO',
|
80 |
'description' => sprintf(
|
82 |
__( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ),
|
83 |
'Yoast SEO'
|
84 |
),
|
85 |
+
'_dependencies' => [
|
86 |
+
'WooCommerce' => [
|
87 |
'slug' => 'woocommerce/woocommerce.php',
|
88 |
+
],
|
89 |
+
],
|
90 |
'installed' => false,
|
91 |
'slug' => 'wpseo-woocommerce/wpseo-woocommerce.php',
|
92 |
'version_sync' => true,
|
93 |
'premium' => true,
|
94 |
+
],
|
95 |
|
96 |
+
'yoast-acf-analysis' => [
|
97 |
'url' => 'https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/',
|
98 |
'title' => 'ACF Content Analysis for Yoast SEO',
|
99 |
'description' => sprintf(
|
104 |
),
|
105 |
'installed' => false,
|
106 |
'slug' => 'acf-content-analysis-for-yoast-seo/yoast-acf-analysis.php',
|
107 |
+
'_dependencies' => [
|
108 |
+
'Advanced Custom Fields' => [
|
109 |
'slug' => 'advanced-custom-fields/acf.php',
|
110 |
+
],
|
111 |
+
],
|
112 |
'version_sync' => false,
|
113 |
+
],
|
114 |
+
];
|
115 |
}
|
116 |
|
117 |
/**
|
162 |
*/
|
163 |
public function get_plugin( $plugin ) {
|
164 |
if ( ! $this->plugin_exists( $plugin ) ) {
|
165 |
+
return [];
|
166 |
}
|
167 |
|
168 |
return $this->plugins[ $plugin ];
|
203 |
*/
|
204 |
public function get_dependencies( $plugin ) {
|
205 |
if ( ! $this->has_dependencies( $plugin ) ) {
|
206 |
+
return [];
|
207 |
}
|
208 |
|
209 |
return $plugin['_dependencies'];
|
222 |
}
|
223 |
|
224 |
$dependencies = $this->get_dependencies( $plugin );
|
225 |
+
$installed_dependencies = array_filter( $dependencies, [ $this, 'is_dependency_available' ] );
|
226 |
|
227 |
return count( $installed_dependencies ) === count( $dependencies );
|
228 |
}
|
248 |
* @return array The installed plugins.
|
249 |
*/
|
250 |
public function get_installed_plugins() {
|
251 |
+
$installed = [];
|
252 |
|
253 |
foreach ( $this->plugins as $plugin_key => $plugin ) {
|
254 |
if ( $this->is_installed( $plugin ) ) {
|
290 |
*/
|
291 |
public function get_dependency_names( $plugin ) {
|
292 |
if ( ! $this->has_dependencies( $plugin ) ) {
|
293 |
+
return [];
|
294 |
}
|
295 |
|
296 |
return array_keys( $plugin['_dependencies'] );
|
302 |
* @return array Array of the plugins that have dependencies.
|
303 |
*/
|
304 |
public function get_plugins_with_dependencies() {
|
305 |
+
return array_filter( $this->plugins, [ $this, 'has_dependencies' ] );
|
306 |
}
|
307 |
|
308 |
/**
|
admin/class-plugin-conflict.php
CHANGED
@@ -18,9 +18,9 @@ class WPSEO_Plugin_Conflict extends Yoast_Plugin_Conflict {
|
|
18 |
*
|
19 |
* @var array
|
20 |
*/
|
21 |
-
protected $plugins =
|
22 |
// The plugin which are writing OG metadata.
|
23 |
-
'open_graph' =>
|
24 |
'2-click-socialmedia-buttons/2-click-socialmedia-buttons.php',
|
25 |
// 2 Click Social Media Buttons.
|
26 |
'add-link-to-facebook/add-link-to-facebook.php', // Add Link to Facebook.
|
@@ -60,8 +60,8 @@ class WPSEO_Plugin_Conflict extends Yoast_Plugin_Conflict {
|
|
60 |
'wp-facebook-open-graph-protocol/wp-facebook-ogp.php', // WP Facebook Open Graph protocol.
|
61 |
'wp-ogp/wp-ogp.php', // WP-OGP.
|
62 |
'zoltonorg-social-plugin/zosp.php', // Zolton.org Social Plugin.
|
63 |
-
|
64 |
-
'xml_sitemaps' =>
|
65 |
'google-sitemap-plugin/google-sitemap-plugin.php',
|
66 |
// Google Sitemap (BestWebSoft).
|
67 |
'xml-sitemaps/xml-sitemaps.php',
|
@@ -92,18 +92,18 @@ class WPSEO_Plugin_Conflict extends Yoast_Plugin_Conflict {
|
|
92 |
// Sewn In XML Sitemap (jcow).
|
93 |
'rps-sitemap-generator/rps-sitemap-generator.php',
|
94 |
// RPS Sitemap Generator (redpixelstudios).
|
95 |
-
|
96 |
-
'cloaking' =>
|
97 |
'rs-head-cleaner/rs-head-cleaner.php',
|
98 |
// RS Head Cleaner Plus https://wordpress.org/plugins/rs-head-cleaner/.
|
99 |
'rs-head-cleaner-lite/rs-head-cleaner-lite.php',
|
100 |
// RS Head Cleaner Lite https://wordpress.org/plugins/rs-head-cleaner-lite/.
|
101 |
-
|
102 |
-
'seo' =>
|
103 |
'all-in-one-seo-pack/all_in_one_seo_pack.php', // All in One SEO Pack.
|
104 |
'seo-ultimate/seo-ultimate.php', // SEO Ultimate.
|
105 |
-
|
106 |
-
|
107 |
|
108 |
/**
|
109 |
* Overrides instance to set with this class as class.
|
@@ -134,7 +134,7 @@ class WPSEO_Plugin_Conflict extends Yoast_Plugin_Conflict {
|
|
134 |
$instance->add_active_plugin( $instance->find_plugin_category( $plugin ), $plugin );
|
135 |
}
|
136 |
|
137 |
-
$plugin_sections =
|
138 |
|
139 |
// Only check for open graph problems when they are enabled.
|
140 |
if ( WPSEO_Options::get( 'opengraph' ) ) {
|
18 |
*
|
19 |
* @var array
|
20 |
*/
|
21 |
+
protected $plugins = [
|
22 |
// The plugin which are writing OG metadata.
|
23 |
+
'open_graph' => [
|
24 |
'2-click-socialmedia-buttons/2-click-socialmedia-buttons.php',
|
25 |
// 2 Click Social Media Buttons.
|
26 |
'add-link-to-facebook/add-link-to-facebook.php', // Add Link to Facebook.
|
60 |
'wp-facebook-open-graph-protocol/wp-facebook-ogp.php', // WP Facebook Open Graph protocol.
|
61 |
'wp-ogp/wp-ogp.php', // WP-OGP.
|
62 |
'zoltonorg-social-plugin/zosp.php', // Zolton.org Social Plugin.
|
63 |
+
],
|
64 |
+
'xml_sitemaps' => [
|
65 |
'google-sitemap-plugin/google-sitemap-plugin.php',
|
66 |
// Google Sitemap (BestWebSoft).
|
67 |
'xml-sitemaps/xml-sitemaps.php',
|
92 |
// Sewn In XML Sitemap (jcow).
|
93 |
'rps-sitemap-generator/rps-sitemap-generator.php',
|
94 |
// RPS Sitemap Generator (redpixelstudios).
|
95 |
+
],
|
96 |
+
'cloaking' => [
|
97 |
'rs-head-cleaner/rs-head-cleaner.php',
|
98 |
// RS Head Cleaner Plus https://wordpress.org/plugins/rs-head-cleaner/.
|
99 |
'rs-head-cleaner-lite/rs-head-cleaner-lite.php',
|
100 |
// RS Head Cleaner Lite https://wordpress.org/plugins/rs-head-cleaner-lite/.
|
101 |
+
],
|
102 |
+
'seo' => [
|
103 |
'all-in-one-seo-pack/all_in_one_seo_pack.php', // All in One SEO Pack.
|
104 |
'seo-ultimate/seo-ultimate.php', // SEO Ultimate.
|
105 |
+
],
|
106 |
+
];
|
107 |
|
108 |
/**
|
109 |
* Overrides instance to set with this class as class.
|
134 |
$instance->add_active_plugin( $instance->find_plugin_category( $plugin ), $plugin );
|
135 |
}
|
136 |
|
137 |
+
$plugin_sections = [];
|
138 |
|
139 |
// Only check for open graph problems when they are enabled.
|
140 |
if ( WPSEO_Options::get( 'opengraph' ) ) {
|
admin/class-premium-upsell-admin-block.php
CHANGED
@@ -39,7 +39,7 @@ class WPSEO_Premium_Upsell_Admin_Block {
|
|
39 |
* @return void
|
40 |
*/
|
41 |
public function register_hooks() {
|
42 |
-
add_action( $this->hook,
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -50,16 +50,16 @@ class WPSEO_Premium_Upsell_Admin_Block {
|
|
50 |
public function render() {
|
51 |
$url = WPSEO_Shortlinker::get( 'https://yoa.st/17h' );
|
52 |
|
53 |
-
$arguments =
|
54 |
'<strong>' . esc_html__( 'Multiple keyphrases', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Increase your SEO reach', 'wordpress-seo' ),
|
55 |
'<strong>' . esc_html__( 'No more dead links', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Easy redirect manager', 'wordpress-seo' ),
|
56 |
'<strong>' . esc_html__( 'Superfast internal linking suggestions', 'wordpress-seo' ) . '</strong>',
|
57 |
'<strong>' . esc_html__( 'Social media preview', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Facebook & Twitter', 'wordpress-seo' ),
|
58 |
'<strong>' . esc_html__( '24/7 email support', 'wordpress-seo' ) . '</strong>',
|
59 |
'<strong>' . esc_html__( 'No ads!', 'wordpress-seo' ) . '</strong>',
|
60 |
-
|
61 |
|
62 |
-
$arguments_html = implode( '', array_map(
|
63 |
|
64 |
$class = $this->get_html_class();
|
65 |
|
39 |
* @return void
|
40 |
*/
|
41 |
public function register_hooks() {
|
42 |
+
add_action( $this->hook, [ $this, 'render' ] );
|
43 |
}
|
44 |
|
45 |
/**
|
50 |
public function render() {
|
51 |
$url = WPSEO_Shortlinker::get( 'https://yoa.st/17h' );
|
52 |
|
53 |
+
$arguments = [
|
54 |
'<strong>' . esc_html__( 'Multiple keyphrases', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Increase your SEO reach', 'wordpress-seo' ),
|
55 |
'<strong>' . esc_html__( 'No more dead links', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Easy redirect manager', 'wordpress-seo' ),
|
56 |
'<strong>' . esc_html__( 'Superfast internal linking suggestions', 'wordpress-seo' ) . '</strong>',
|
57 |
'<strong>' . esc_html__( 'Social media preview', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Facebook & Twitter', 'wordpress-seo' ),
|
58 |
'<strong>' . esc_html__( '24/7 email support', 'wordpress-seo' ) . '</strong>',
|
59 |
'<strong>' . esc_html__( 'No ads!', 'wordpress-seo' ) . '</strong>',
|
60 |
+
];
|
61 |
|
62 |
+
$arguments_html = implode( '', array_map( [ $this, 'get_argument_html' ], $arguments ) );
|
63 |
|
64 |
$class = $this->get_html_class();
|
65 |
|
admin/class-primary-term-admin.php
CHANGED
@@ -14,13 +14,13 @@ class WPSEO_Primary_Term_Admin implements WPSEO_WordPress_Integration {
|
|
14 |
* Constructor.
|
15 |
*/
|
16 |
public function register_hooks() {
|
17 |
-
add_filter( 'wpseo_content_meta_section_content',
|
18 |
|
19 |
-
add_action( 'admin_footer',
|
20 |
|
21 |
-
add_action( 'admin_enqueue_scripts',
|
22 |
|
23 |
-
add_action( 'save_post',
|
24 |
|
25 |
$primary_term = new WPSEO_Frontend_Primary_Category();
|
26 |
$primary_term->register_hooks();
|
@@ -131,9 +131,9 @@ class WPSEO_Primary_Term_Admin implements WPSEO_WordPress_Integration {
|
|
131 |
|
132 |
$mapped_taxonomies = $this->get_mapped_taxonomies_for_js( $taxonomies );
|
133 |
|
134 |
-
$data =
|
135 |
'taxonomies' => $mapped_taxonomies,
|
136 |
-
|
137 |
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'primary-category', 'wpseoPrimaryCategoryL10n', $data );
|
138 |
}
|
139 |
|
@@ -224,7 +224,7 @@ class WPSEO_Primary_Term_Admin implements WPSEO_WordPress_Integration {
|
|
224 |
protected function generate_primary_term_taxonomies( $post_id ) {
|
225 |
$post_type = get_post_type( $post_id );
|
226 |
$all_taxonomies = get_object_taxonomies( $post_type, 'objects' );
|
227 |
-
$all_taxonomies = array_filter( $all_taxonomies,
|
228 |
|
229 |
/**
|
230 |
* Filters which taxonomies for which the user can choose the primary term.
|
@@ -248,7 +248,7 @@ class WPSEO_Primary_Term_Admin implements WPSEO_WordPress_Integration {
|
|
248 |
* @return array The mapped taxonomies.
|
249 |
*/
|
250 |
protected function get_mapped_taxonomies_for_js( $taxonomies ) {
|
251 |
-
return array_map(
|
252 |
}
|
253 |
|
254 |
/**
|
@@ -267,15 +267,15 @@ class WPSEO_Primary_Term_Admin implements WPSEO_WordPress_Integration {
|
|
267 |
|
268 |
$terms = get_terms( $taxonomy->name );
|
269 |
|
270 |
-
return
|
271 |
'title' => $taxonomy->labels->singular_name,
|
272 |
'name' => $taxonomy->name,
|
273 |
'primary' => $primary_term,
|
274 |
'singularLabel' => $taxonomy->labels->singular_name,
|
275 |
'fieldId' => $this->generate_field_id( $taxonomy->name ),
|
276 |
'restBase' => ( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name,
|
277 |
-
'terms' => array_map(
|
278 |
-
|
279 |
}
|
280 |
|
281 |
/**
|
@@ -286,10 +286,10 @@ class WPSEO_Primary_Term_Admin implements WPSEO_WordPress_Integration {
|
|
286 |
* @return array The mapped terms.
|
287 |
*/
|
288 |
private function map_terms_for_js( $term ) {
|
289 |
-
return
|
290 |
'id' => $term->term_id,
|
291 |
'name' => $term->name,
|
292 |
-
|
293 |
}
|
294 |
|
295 |
/**
|
14 |
* Constructor.
|
15 |
*/
|
16 |
public function register_hooks() {
|
17 |
+
add_filter( 'wpseo_content_meta_section_content', [ $this, 'add_input_fields' ] );
|
18 |
|
19 |
+
add_action( 'admin_footer', [ $this, 'wp_footer' ], 10 );
|
20 |
|
21 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
22 |
|
23 |
+
add_action( 'save_post', [ $this, 'save_primary_terms' ] );
|
24 |
|
25 |
$primary_term = new WPSEO_Frontend_Primary_Category();
|
26 |
$primary_term->register_hooks();
|
131 |
|
132 |
$mapped_taxonomies = $this->get_mapped_taxonomies_for_js( $taxonomies );
|
133 |
|
134 |
+
$data = [
|
135 |
'taxonomies' => $mapped_taxonomies,
|
136 |
+
];
|
137 |
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'primary-category', 'wpseoPrimaryCategoryL10n', $data );
|
138 |
}
|
139 |
|
224 |
protected function generate_primary_term_taxonomies( $post_id ) {
|
225 |
$post_type = get_post_type( $post_id );
|
226 |
$all_taxonomies = get_object_taxonomies( $post_type, 'objects' );
|
227 |
+
$all_taxonomies = array_filter( $all_taxonomies, [ $this, 'filter_hierarchical_taxonomies' ] );
|
228 |
|
229 |
/**
|
230 |
* Filters which taxonomies for which the user can choose the primary term.
|
248 |
* @return array The mapped taxonomies.
|
249 |
*/
|
250 |
protected function get_mapped_taxonomies_for_js( $taxonomies ) {
|
251 |
+
return array_map( [ $this, 'map_taxonomies_for_js' ], $taxonomies );
|
252 |
}
|
253 |
|
254 |
/**
|
267 |
|
268 |
$terms = get_terms( $taxonomy->name );
|
269 |
|
270 |
+
return [
|
271 |
'title' => $taxonomy->labels->singular_name,
|
272 |
'name' => $taxonomy->name,
|
273 |
'primary' => $primary_term,
|
274 |
'singularLabel' => $taxonomy->labels->singular_name,
|
275 |
'fieldId' => $this->generate_field_id( $taxonomy->name ),
|
276 |
'restBase' => ( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name,
|
277 |
+
'terms' => array_map( [ $this, 'map_terms_for_js' ], $terms ),
|
278 |
+
];
|
279 |
}
|
280 |
|
281 |
/**
|
286 |
* @return array The mapped terms.
|
287 |
*/
|
288 |
private function map_terms_for_js( $term ) {
|
289 |
+
return [
|
290 |
'id' => $term->term_id,
|
291 |
'name' => $term->name,
|
292 |
+
];
|
293 |
}
|
294 |
|
295 |
/**
|
admin/class-product-upsell-notice.php
CHANGED
@@ -161,12 +161,12 @@ class WPSEO_Product_Upsell_Notice {
|
|
161 |
|
162 |
$notification = new Yoast_Notification(
|
163 |
$message,
|
164 |
-
|
165 |
'type' => Yoast_Notification::WARNING,
|
166 |
'id' => 'wpseo-upsell-notice',
|
167 |
'capabilities' => 'wpseo_manage_options',
|
168 |
'priority' => 0.8,
|
169 |
-
|
170 |
);
|
171 |
|
172 |
return $notification;
|
161 |
|
162 |
$notification = new Yoast_Notification(
|
163 |
$message,
|
164 |
+
[
|
165 |
'type' => Yoast_Notification::WARNING,
|
166 |
'id' => 'wpseo-upsell-notice',
|
167 |
'capabilities' => 'wpseo_manage_options',
|
168 |
'priority' => 0.8,
|
169 |
+
]
|
170 |
);
|
171 |
|
172 |
return $notification;
|
admin/class-recalculate-scores.php
CHANGED
@@ -16,8 +16,8 @@ class WPSEO_Recalculate_Scores {
|
|
16 |
* Constructing the object by modalbox, the localization and the totals.
|
17 |
*/
|
18 |
public function __construct() {
|
19 |
-
add_action( 'admin_enqueue_scripts',
|
20 |
-
add_action( 'admin_footer',
|
21 |
}
|
22 |
|
23 |
/**
|
16 |
* Constructing the object by modalbox, the localization and the totals.
|
17 |
*/
|
18 |
public function __construct() {
|
19 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'recalculate_assets' ] );
|
20 |
+
add_action( 'admin_footer', [ $this, 'modal_box' ], 20 );
|
21 |
}
|
22 |
|
23 |
/**
|
admin/class-remote-request.php
CHANGED
@@ -36,10 +36,10 @@ class WPSEO_Remote_Request {
|
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
-
protected $args =
|
40 |
'blocking' => false,
|
41 |
'timeout' => 2,
|
42 |
-
|
43 |
|
44 |
/**
|
45 |
* Holds the response error.
|
@@ -61,7 +61,7 @@ class WPSEO_Remote_Request {
|
|
61 |
* @param string $endpoint The endpoint to send the request to.
|
62 |
* @param array $args The arguments to use in this request.
|
63 |
*/
|
64 |
-
public function __construct( $endpoint, array $args =
|
65 |
$this->endpoint = $endpoint;
|
66 |
$this->args = wp_parse_args( $this->args, $args );
|
67 |
}
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
+
protected $args = [
|
40 |
'blocking' => false,
|
41 |
'timeout' => 2,
|
42 |
+
];
|
43 |
|
44 |
/**
|
45 |
* Holds the response error.
|
61 |
* @param string $endpoint The endpoint to send the request to.
|
62 |
* @param array $args The arguments to use in this request.
|
63 |
*/
|
64 |
+
public function __construct( $endpoint, array $args = [] ) {
|
65 |
$this->endpoint = $endpoint;
|
66 |
$this->args = wp_parse_args( $this->args, $args );
|
67 |
}
|
admin/class-schema-person-upgrade-notification.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_Schema_Person_Upgrade_Notification implements WPSEO_WordPress_Integr
|
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
-
add_action( 'admin_init',
|
20 |
}
|
21 |
|
22 |
/**
|
@@ -63,12 +63,12 @@ class WPSEO_Schema_Person_Upgrade_Notification implements WPSEO_WordPress_Integr
|
|
63 |
|
64 |
$notification = new Yoast_Notification(
|
65 |
$message,
|
66 |
-
|
67 |
'type' => Yoast_Notification::WARNING,
|
68 |
'id' => 'wpseo-schema-person-upgrade',
|
69 |
'capabilities' => 'wpseo_manage_options',
|
70 |
'priority' => 0.8,
|
71 |
-
|
72 |
);
|
73 |
|
74 |
return $notification;
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
+
add_action( 'admin_init', [ $this, 'handle_notification' ] );
|
20 |
}
|
21 |
|
22 |
/**
|
63 |
|
64 |
$notification = new Yoast_Notification(
|
65 |
$message,
|
66 |
+
[
|
67 |
'type' => Yoast_Notification::WARNING,
|
68 |
'id' => 'wpseo-schema-person-upgrade',
|
69 |
'capabilities' => 'wpseo_manage_options',
|
70 |
'priority' => 0.8,
|
71 |
+
]
|
72 |
);
|
73 |
|
74 |
return $notification;
|
admin/class-social-admin.php
CHANGED
@@ -15,8 +15,8 @@ class WPSEO_Social_Admin extends WPSEO_Metabox {
|
|
15 |
*/
|
16 |
public function __construct() {
|
17 |
self::translate_meta_boxes();
|
18 |
-
add_filter( 'wpseo_save_metaboxes',
|
19 |
-
add_action( 'wpseo_save_compare_data',
|
20 |
}
|
21 |
|
22 |
/**
|
@@ -38,19 +38,19 @@ class WPSEO_Social_Admin extends WPSEO_Metabox {
|
|
38 |
/* translators: %1$s expands to the social network, %2$s to the recommended image size. */
|
39 |
$image_size_text = __( 'The recommended image size for %1$s is %2$s pixels.', 'wordpress-seo' );
|
40 |
|
41 |
-
$social_networks =
|
42 |
'opengraph' => __( 'Facebook', 'wordpress-seo' ),
|
43 |
'twitter' => __( 'Twitter', 'wordpress-seo' ),
|
44 |
-
|
45 |
|
46 |
// Source: https://blog.bufferapp.com/ideal-image-sizes-social-media-posts.
|
47 |
-
$recommended_image_sizes =
|
48 |
/* translators: %1$s expands to the image recommended width, %2$s to its height. */
|
49 |
'opengraph' => sprintf( __( '%1$s by %2$s', 'wordpress-seo' ), '1200', '630' ),
|
50 |
// Source: https://developers.facebook.com/docs/sharing/best-practices#images.
|
51 |
/* translators: %1$s expands to the image recommended width, %2$s to its height. */
|
52 |
'twitter' => sprintf( __( '%1$s by %2$s', 'wordpress-seo' ), '1024', '512' ),
|
53 |
-
|
54 |
|
55 |
foreach ( $social_networks as $network => $label ) {
|
56 |
if ( true === WPSEO_Options::get( $network, false ) ) {
|
@@ -75,7 +75,7 @@ class WPSEO_Social_Admin extends WPSEO_Metabox {
|
|
75 |
* @return WPSEO_Metabox_Collapsibles_Sections
|
76 |
*/
|
77 |
public function get_meta_section() {
|
78 |
-
$tabs =
|
79 |
$social_meta_fields = WPSEO_Meta::get_meta_field_defs( 'social' );
|
80 |
|
81 |
$opengraph = WPSEO_Options::get( 'opengraph' );
|
@@ -119,12 +119,12 @@ class WPSEO_Social_Admin extends WPSEO_Metabox {
|
|
119 |
* @return string
|
120 |
*/
|
121 |
private function get_social_tab_content( $medium, $meta_field_defs ) {
|
122 |
-
$field_names =
|
123 |
$medium . '-title',
|
124 |
$medium . '-description',
|
125 |
$medium . '-image',
|
126 |
$medium . '-image-id',
|
127 |
-
|
128 |
|
129 |
$tab_content = $this->get_premium_notice( $medium );
|
130 |
|
@@ -233,11 +233,11 @@ class WPSEO_Social_Admin extends WPSEO_Metabox {
|
|
233 |
return;
|
234 |
}
|
235 |
|
236 |
-
$fields_to_compare =
|
237 |
'opengraph-title',
|
238 |
'opengraph-description',
|
239 |
'opengraph-image',
|
240 |
-
|
241 |
|
242 |
$reset_facebook_cache = false;
|
243 |
|
15 |
*/
|
16 |
public function __construct() {
|
17 |
self::translate_meta_boxes();
|
18 |
+
add_filter( 'wpseo_save_metaboxes', [ $this, 'save_meta_boxes' ], 10, 1 );
|
19 |
+
add_action( 'wpseo_save_compare_data', [ $this, 'og_data_compare' ], 10, 1 );
|
20 |
}
|
21 |
|
22 |
/**
|
38 |
/* translators: %1$s expands to the social network, %2$s to the recommended image size. */
|
39 |
$image_size_text = __( 'The recommended image size for %1$s is %2$s pixels.', 'wordpress-seo' );
|
40 |
|
41 |
+
$social_networks = [
|
42 |
'opengraph' => __( 'Facebook', 'wordpress-seo' ),
|
43 |
'twitter' => __( 'Twitter', 'wordpress-seo' ),
|
44 |
+
];
|
45 |
|
46 |
// Source: https://blog.bufferapp.com/ideal-image-sizes-social-media-posts.
|
47 |
+
$recommended_image_sizes = [
|
48 |
/* translators: %1$s expands to the image recommended width, %2$s to its height. */
|
49 |
'opengraph' => sprintf( __( '%1$s by %2$s', 'wordpress-seo' ), '1200', '630' ),
|
50 |
// Source: https://developers.facebook.com/docs/sharing/best-practices#images.
|
51 |
/* translators: %1$s expands to the image recommended width, %2$s to its height. */
|
52 |
'twitter' => sprintf( __( '%1$s by %2$s', 'wordpress-seo' ), '1024', '512' ),
|
53 |
+
];
|
54 |
|
55 |
foreach ( $social_networks as $network => $label ) {
|
56 |
if ( true === WPSEO_Options::get( $network, false ) ) {
|
75 |
* @return WPSEO_Metabox_Collapsibles_Sections
|
76 |
*/
|
77 |
public function get_meta_section() {
|
78 |
+
$tabs = [];
|
79 |
$social_meta_fields = WPSEO_Meta::get_meta_field_defs( 'social' );
|
80 |
|
81 |
$opengraph = WPSEO_Options::get( 'opengraph' );
|
119 |
* @return string
|
120 |
*/
|
121 |
private function get_social_tab_content( $medium, $meta_field_defs ) {
|
122 |
+
$field_names = [
|
123 |
$medium . '-title',
|
124 |
$medium . '-description',
|
125 |
$medium . '-image',
|
126 |
$medium . '-image-id',
|
127 |
+
];
|
128 |
|
129 |
$tab_content = $this->get_premium_notice( $medium );
|
130 |
|
233 |
return;
|
234 |
}
|
235 |
|
236 |
+
$fields_to_compare = [
|
237 |
'opengraph-title',
|
238 |
'opengraph-description',
|
239 |
'opengraph-image',
|
240 |
+
];
|
241 |
|
242 |
$reset_facebook_cache = false;
|
243 |
|
admin/class-suggested-plugins.php
CHANGED
@@ -41,8 +41,8 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
|
|
41 |
* @return void
|
42 |
*/
|
43 |
public function register_hooks() {
|
44 |
-
add_action( 'admin_init',
|
45 |
-
add_action( 'admin_init',
|
46 |
}
|
47 |
|
48 |
/**
|
@@ -92,11 +92,11 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
|
|
92 |
|
93 |
return new Yoast_Notification(
|
94 |
$message,
|
95 |
-
|
96 |
'id' => 'wpseo-suggested-plugin-' . $name,
|
97 |
'type' => Yoast_Notification::WARNING,
|
98 |
-
'capabilities' =>
|
99 |
-
|
100 |
);
|
101 |
}
|
102 |
|
41 |
* @return void
|
42 |
*/
|
43 |
public function register_hooks() {
|
44 |
+
add_action( 'admin_init', [ $this->availability_checker, 'register' ] );
|
45 |
+
add_action( 'admin_init', [ $this, 'add_notifications' ] );
|
46 |
}
|
47 |
|
48 |
/**
|
92 |
|
93 |
return new Yoast_Notification(
|
94 |
$message,
|
95 |
+
[
|
96 |
'id' => 'wpseo-suggested-plugin-' . $name,
|
97 |
'type' => Yoast_Notification::WARNING,
|
98 |
+
'capabilities' => [ 'install_plugins' ],
|
99 |
+
]
|
100 |
);
|
101 |
}
|
102 |
|
admin/class-yoast-alerts.php
CHANGED
@@ -29,42 +29,42 @@ class Yoast_Alerts {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
private static $errors =
|
33 |
|
34 |
/**
|
35 |
* Active errors.
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
-
private static $active_errors =
|
40 |
|
41 |
/**
|
42 |
* Dismissed errors.
|
43 |
*
|
44 |
* @var array
|
45 |
*/
|
46 |
-
private static $dismissed_errors =
|
47 |
|
48 |
/**
|
49 |
* All warning notifications.
|
50 |
*
|
51 |
* @var array
|
52 |
*/
|
53 |
-
private static $warnings =
|
54 |
|
55 |
/**
|
56 |
* Active warnings.
|
57 |
*
|
58 |
* @var array
|
59 |
*/
|
60 |
-
private static $active_warnings =
|
61 |
|
62 |
/**
|
63 |
* Dismissed warnings.
|
64 |
*
|
65 |
* @var array
|
66 |
*/
|
67 |
-
private static $dismissed_warnings =
|
68 |
|
69 |
/**
|
70 |
* Yoast_Alerts constructor.
|
@@ -81,15 +81,15 @@ class Yoast_Alerts {
|
|
81 |
|
82 |
$page = filter_input( INPUT_GET, 'page' );
|
83 |
if ( self::ADMIN_PAGE === $page ) {
|
84 |
-
add_action( 'admin_enqueue_scripts',
|
85 |
}
|
86 |
|
87 |
// Needed for adminbar and Alerts page.
|
88 |
-
add_action( 'admin_init',
|
89 |
|
90 |
// Add AJAX hooks.
|
91 |
-
add_action( 'wp_ajax_yoast_dismiss_alert',
|
92 |
-
add_action( 'wp_ajax_yoast_restore_alert',
|
93 |
}
|
94 |
|
95 |
/**
|
@@ -143,10 +143,10 @@ class Yoast_Alerts {
|
|
143 |
$html = $this->get_view_html( $type );
|
144 |
// phpcs:disable WordPress.Security.EscapeOutput -- Reason: WPSEO_Utils::format_json_encode is safe.
|
145 |
echo WPSEO_Utils::format_json_encode(
|
146 |
-
|
147 |
'html' => $html,
|
148 |
'total' => self::get_active_alert_count(),
|
149 |
-
|
150 |
);
|
151 |
// phpcs:enable -- Reason: WPSEO_Utils::format_json_encode is safe.
|
152 |
}
|
@@ -226,12 +226,12 @@ class Yoast_Alerts {
|
|
226 |
$notifications = $notification_center->get_sorted_notifications();
|
227 |
self::$notification_count = count( $notifications );
|
228 |
|
229 |
-
self::$errors = array_filter( $notifications,
|
230 |
-
self::$dismissed_errors = array_filter( self::$errors,
|
231 |
self::$active_errors = array_diff( self::$errors, self::$dismissed_errors );
|
232 |
|
233 |
-
self::$warnings = array_filter( $notifications,
|
234 |
-
self::$dismissed_warnings = array_filter( self::$warnings,
|
235 |
self::$active_warnings = array_diff( self::$warnings, self::$dismissed_warnings );
|
236 |
}
|
237 |
|
@@ -242,22 +242,22 @@ class Yoast_Alerts {
|
|
242 |
*/
|
243 |
public static function get_template_variables() {
|
244 |
|
245 |
-
return
|
246 |
-
'metrics' =>
|
247 |
'total' => self::$notification_count,
|
248 |
'active' => self::get_active_alert_count(),
|
249 |
'errors' => count( self::$errors ),
|
250 |
'warnings' => count( self::$warnings ),
|
251 |
-
|
252 |
-
'errors' =>
|
253 |
'dismissed' => self::$dismissed_errors,
|
254 |
'active' => self::$active_errors,
|
255 |
-
|
256 |
-
'warnings' =>
|
257 |
'dismissed' => self::$dismissed_warnings,
|
258 |
'active' => self::$active_warnings,
|
259 |
-
|
260 |
-
|
261 |
}
|
262 |
|
263 |
/**
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
private static $errors = [];
|
33 |
|
34 |
/**
|
35 |
* Active errors.
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
+
private static $active_errors = [];
|
40 |
|
41 |
/**
|
42 |
* Dismissed errors.
|
43 |
*
|
44 |
* @var array
|
45 |
*/
|
46 |
+
private static $dismissed_errors = [];
|
47 |
|
48 |
/**
|
49 |
* All warning notifications.
|
50 |
*
|
51 |
* @var array
|
52 |
*/
|
53 |
+
private static $warnings = [];
|
54 |
|
55 |
/**
|
56 |
* Active warnings.
|
57 |
*
|
58 |
* @var array
|
59 |
*/
|
60 |
+
private static $active_warnings = [];
|
61 |
|
62 |
/**
|
63 |
* Dismissed warnings.
|
64 |
*
|
65 |
* @var array
|
66 |
*/
|
67 |
+
private static $dismissed_warnings = [];
|
68 |
|
69 |
/**
|
70 |
* Yoast_Alerts constructor.
|
81 |
|
82 |
$page = filter_input( INPUT_GET, 'page' );
|
83 |
if ( self::ADMIN_PAGE === $page ) {
|
84 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
85 |
}
|
86 |
|
87 |
// Needed for adminbar and Alerts page.
|
88 |
+
add_action( 'admin_init', [ __CLASS__, 'collect_alerts' ], 99 );
|
89 |
|
90 |
// Add AJAX hooks.
|
91 |
+
add_action( 'wp_ajax_yoast_dismiss_alert', [ $this, 'ajax_dismiss_alert' ] );
|
92 |
+
add_action( 'wp_ajax_yoast_restore_alert', [ $this, 'ajax_restore_alert' ] );
|
93 |
}
|
94 |
|
95 |
/**
|
143 |
$html = $this->get_view_html( $type );
|
144 |
// phpcs:disable WordPress.Security.EscapeOutput -- Reason: WPSEO_Utils::format_json_encode is safe.
|
145 |
echo WPSEO_Utils::format_json_encode(
|
146 |
+
[
|
147 |
'html' => $html,
|
148 |
'total' => self::get_active_alert_count(),
|
149 |
+
]
|
150 |
);
|
151 |
// phpcs:enable -- Reason: WPSEO_Utils::format_json_encode is safe.
|
152 |
}
|
226 |
$notifications = $notification_center->get_sorted_notifications();
|
227 |
self::$notification_count = count( $notifications );
|
228 |
|
229 |
+
self::$errors = array_filter( $notifications, [ __CLASS__, 'filter_error_alerts' ] );
|
230 |
+
self::$dismissed_errors = array_filter( self::$errors, [ __CLASS__, 'filter_dismissed_alerts' ] );
|
231 |
self::$active_errors = array_diff( self::$errors, self::$dismissed_errors );
|
232 |
|
233 |
+
self::$warnings = array_filter( $notifications, [ __CLASS__, 'filter_warning_alerts' ] );
|
234 |
+
self::$dismissed_warnings = array_filter( self::$warnings, [ __CLASS__, 'filter_dismissed_alerts' ] );
|
235 |
self::$active_warnings = array_diff( self::$warnings, self::$dismissed_warnings );
|
236 |
}
|
237 |
|
242 |
*/
|
243 |
public static function get_template_variables() {
|
244 |
|
245 |
+
return [
|
246 |
+
'metrics' => [
|
247 |
'total' => self::$notification_count,
|
248 |
'active' => self::get_active_alert_count(),
|
249 |
'errors' => count( self::$errors ),
|
250 |
'warnings' => count( self::$warnings ),
|
251 |
+
],
|
252 |
+
'errors' => [
|
253 |
'dismissed' => self::$dismissed_errors,
|
254 |
'active' => self::$active_errors,
|
255 |
+
],
|
256 |
+
'warnings' => [
|
257 |
'dismissed' => self::$dismissed_warnings,
|
258 |
'active' => self::$active_warnings,
|
259 |
+
],
|
260 |
+
];
|
261 |
}
|
262 |
|
263 |
/**
|
admin/class-yoast-columns.php
CHANGED
@@ -14,7 +14,7 @@ class WPSEO_Yoast_Columns implements WPSEO_WordPress_Integration {
|
|
14 |
* Registers all hooks to WordPress.
|
15 |
*/
|
16 |
public function register_hooks() {
|
17 |
-
add_action( 'load-edit.php',
|
18 |
}
|
19 |
|
20 |
/**
|
@@ -23,7 +23,7 @@ class WPSEO_Yoast_Columns implements WPSEO_WordPress_Integration {
|
|
23 |
public function add_help_tab() {
|
24 |
$screen = get_current_screen();
|
25 |
$screen->add_help_tab(
|
26 |
-
|
27 |
/* translators: %s expands to Yoast */
|
28 |
'title' => sprintf( __( '%s Columns', 'wordpress-seo' ), 'Yoast' ),
|
29 |
'id' => 'yst-columns',
|
@@ -38,7 +38,7 @@ class WPSEO_Yoast_Columns implements WPSEO_WordPress_Integration {
|
|
38 |
'</em>'
|
39 |
),
|
40 |
'priority' => 15,
|
41 |
-
|
42 |
);
|
43 |
}
|
44 |
}
|
14 |
* Registers all hooks to WordPress.
|
15 |
*/
|
16 |
public function register_hooks() {
|
17 |
+
add_action( 'load-edit.php', [ $this, 'add_help_tab' ] );
|
18 |
}
|
19 |
|
20 |
/**
|
23 |
public function add_help_tab() {
|
24 |
$screen = get_current_screen();
|
25 |
$screen->add_help_tab(
|
26 |
+
[
|
27 |
/* translators: %s expands to Yoast */
|
28 |
'title' => sprintf( __( '%s Columns', 'wordpress-seo' ), 'Yoast' ),
|
29 |
'id' => 'yst-columns',
|
38 |
'</em>'
|
39 |
),
|
40 |
'priority' => 15,
|
41 |
+
]
|
42 |
);
|
43 |
}
|
44 |
}
|
admin/class-yoast-dashboard-widget.php
CHANGED
@@ -49,8 +49,8 @@ class Yoast_Dashboard_Widget implements WPSEO_WordPress_Integration {
|
|
49 |
* Register WordPress hooks.
|
50 |
*/
|
51 |
public function register_hooks() {
|
52 |
-
add_action( 'admin_enqueue_scripts',
|
53 |
-
add_action( 'admin_init',
|
54 |
}
|
55 |
|
56 |
/**
|
@@ -60,7 +60,7 @@ class Yoast_Dashboard_Widget implements WPSEO_WordPress_Integration {
|
|
60 |
*/
|
61 |
public function queue_dashboard_widget() {
|
62 |
if ( $this->show_widget() ) {
|
63 |
-
add_action( 'wp_dashboard_setup',
|
64 |
}
|
65 |
}
|
66 |
|
@@ -68,12 +68,12 @@ class Yoast_Dashboard_Widget implements WPSEO_WordPress_Integration {
|
|
68 |
* Adds dashboard widget to WordPress.
|
69 |
*/
|
70 |
public function add_dashboard_widget() {
|
71 |
-
add_filter( 'postbox_classes_dashboard_wpseo-dashboard-overview',
|
72 |
wp_add_dashboard_widget(
|
73 |
'wpseo-dashboard-overview',
|
74 |
/* translators: %s is the plugin name */
|
75 |
sprintf( __( '%s Posts Overview', 'wordpress-seo' ), 'Yoast SEO' ),
|
76 |
-
|
77 |
);
|
78 |
}
|
79 |
|
@@ -117,7 +117,7 @@ class Yoast_Dashboard_Widget implements WPSEO_WordPress_Integration {
|
|
117 |
* @return array The translated strings.
|
118 |
*/
|
119 |
public function localize_dashboard_script() {
|
120 |
-
return
|
121 |
'feed_header' => sprintf(
|
122 |
/* translators: %1$s resolves to Yoast.com */
|
123 |
__( 'Latest blog posts on %1$s', 'wordpress-seo' ),
|
@@ -135,9 +135,8 @@ class Yoast_Dashboard_Widget implements WPSEO_WordPress_Integration {
|
|
135 |
'ryte_fetch_url' => esc_attr( add_query_arg( 'wpseo-redo-onpage', '1' ) ) . '#wpseo-dashboard-overview',
|
136 |
'ryte_landing_url' => WPSEO_Shortlinker::get( 'https://yoa.st/rytelp' ),
|
137 |
'wp_version' => substr( $GLOBALS['wp_version'], 0, 3 ) . '-' . ( is_plugin_active( 'classic-editor/classic-editor.php' ) ? '1' : '0' ),
|
138 |
-
|
139 |
-
|
140 |
-
);
|
141 |
}
|
142 |
|
143 |
/**
|
49 |
* Register WordPress hooks.
|
50 |
*/
|
51 |
public function register_hooks() {
|
52 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_dashboard_assets' ] );
|
53 |
+
add_action( 'admin_init', [ $this, 'queue_dashboard_widget' ] );
|
54 |
}
|
55 |
|
56 |
/**
|
60 |
*/
|
61 |
public function queue_dashboard_widget() {
|
62 |
if ( $this->show_widget() ) {
|
63 |
+
add_action( 'wp_dashboard_setup', [ $this, 'add_dashboard_widget' ] );
|
64 |
}
|
65 |
}
|
66 |
|
68 |
* Adds dashboard widget to WordPress.
|
69 |
*/
|
70 |
public function add_dashboard_widget() {
|
71 |
+
add_filter( 'postbox_classes_dashboard_wpseo-dashboard-overview', [ $this, 'wpseo_dashboard_overview_class' ] );
|
72 |
wp_add_dashboard_widget(
|
73 |
'wpseo-dashboard-overview',
|
74 |
/* translators: %s is the plugin name */
|
75 |
sprintf( __( '%s Posts Overview', 'wordpress-seo' ), 'Yoast SEO' ),
|
76 |
+
[ $this, 'display_dashboard_widget' ]
|
77 |
);
|
78 |
}
|
79 |
|
117 |
* @return array The translated strings.
|
118 |
*/
|
119 |
public function localize_dashboard_script() {
|
120 |
+
return [
|
121 |
'feed_header' => sprintf(
|
122 |
/* translators: %1$s resolves to Yoast.com */
|
123 |
__( 'Latest blog posts on %1$s', 'wordpress-seo' ),
|
135 |
'ryte_fetch_url' => esc_attr( add_query_arg( 'wpseo-redo-onpage', '1' ) ) . '#wpseo-dashboard-overview',
|
136 |
'ryte_landing_url' => WPSEO_Shortlinker::get( 'https://yoa.st/rytelp' ),
|
137 |
'wp_version' => substr( $GLOBALS['wp_version'], 0, 3 ) . '-' . ( is_plugin_active( 'classic-editor/classic-editor.php' ) ? '1' : '0' ),
|
138 |
+
'php_version' => PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,
|
139 |
+
];
|
|
|
140 |
}
|
141 |
|
142 |
/**
|
admin/class-yoast-form.php
CHANGED
@@ -34,7 +34,7 @@ class Yoast_Form {
|
|
34 |
* @var array
|
35 |
* @since 2.0
|
36 |
*/
|
37 |
-
public $options =
|
38 |
|
39 |
/**
|
40 |
* Option instance.
|
@@ -94,7 +94,7 @@ class Yoast_Form {
|
|
94 |
$network_admin = new Yoast_Network_Admin();
|
95 |
if ( $network_admin->meets_requirements() ) {
|
96 |
$action_url = network_admin_url( 'settings.php' );
|
97 |
-
$hidden_fields_cb =
|
98 |
}
|
99 |
else {
|
100 |
$action_url = admin_url( 'options.php' );
|
@@ -119,7 +119,7 @@ class Yoast_Form {
|
|
119 |
|
120 |
$this->options = WPSEO_Options::get_option( $option_name );
|
121 |
if ( $this->options === null ) {
|
122 |
-
$this->options = (array) get_option( $option_name,
|
123 |
}
|
124 |
|
125 |
$this->option_instance = WPSEO_Options::get_option_instance( $option_name );
|
@@ -221,12 +221,12 @@ class Yoast_Form {
|
|
221 |
* @param array $attr HTML attributes set.
|
222 |
*/
|
223 |
public function label( $text, $attr ) {
|
224 |
-
$defaults =
|
225 |
'class' => 'checkbox',
|
226 |
'close' => true,
|
227 |
'for' => '',
|
228 |
'aria_label' => '',
|
229 |
-
|
230 |
|
231 |
$attr = wp_parse_args( $attr, $defaults );
|
232 |
$aria_label = '';
|
@@ -249,10 +249,10 @@ class Yoast_Form {
|
|
249 |
* @param array $attr HTML attributes set.
|
250 |
*/
|
251 |
public function legend( $text, $attr ) {
|
252 |
-
$defaults =
|
253 |
'id' => '',
|
254 |
'class' => '',
|
255 |
-
|
256 |
$attr = wp_parse_args( $attr, $defaults );
|
257 |
|
258 |
$id = ( '' === $attr['id'] ) ? '' : ' id="' . esc_attr( $attr['id'] ) . '"';
|
@@ -279,7 +279,7 @@ class Yoast_Form {
|
|
279 |
|
280 |
$class = '';
|
281 |
if ( $label_left !== false ) {
|
282 |
-
$this->label( $label_left,
|
283 |
}
|
284 |
else {
|
285 |
$class = 'double';
|
@@ -288,7 +288,7 @@ class Yoast_Form {
|
|
288 |
echo '<input class="checkbox ', esc_attr( $class ), '" type="checkbox" id="', esc_attr( $var ), '" name="', esc_attr( $this->option_name ), '[', esc_attr( $var ), ']" value="on"', checked( $this->options[ $var ], 'on', false ), disabled( $this->is_control_disabled( $var ), true, false ), '/>';
|
289 |
|
290 |
if ( ! empty( $label ) ) {
|
291 |
-
$this->label( $label,
|
292 |
}
|
293 |
|
294 |
echo '<br class="clear" />';
|
@@ -306,7 +306,7 @@ class Yoast_Form {
|
|
306 |
* @param string $help Inline Help that will be printed out before the visible toggles text.
|
307 |
* @param bool $strong Whether the visual label is displayed in strong text. Default is false.
|
308 |
*/
|
309 |
-
public function light_switch( $var, $label, $buttons =
|
310 |
|
311 |
if ( ! isset( $this->options[ $var ] ) ) {
|
312 |
$this->options[ $var ] = false;
|
@@ -323,7 +323,7 @@ class Yoast_Form {
|
|
323 |
}
|
324 |
|
325 |
if ( empty( $buttons ) ) {
|
326 |
-
$buttons =
|
327 |
}
|
328 |
|
329 |
list( $off_button, $on_button ) = $buttons;
|
@@ -357,18 +357,18 @@ class Yoast_Form {
|
|
357 |
* @param string $label The label to show for the variable.
|
358 |
* @param array|string $attr Extra attributes to add to the input field. Can be class, disabled, autocomplete.
|
359 |
*/
|
360 |
-
public function textinput( $var, $label, $attr =
|
361 |
if ( ! is_array( $attr ) ) {
|
362 |
-
$attr =
|
363 |
'class' => $attr,
|
364 |
'disabled' => false,
|
365 |
-
|
366 |
}
|
367 |
|
368 |
-
$defaults =
|
369 |
'placeholder' => '',
|
370 |
'class' => '',
|
371 |
-
|
372 |
$attr = wp_parse_args( $attr, $defaults );
|
373 |
$val = isset( $this->options[ $var ] ) ? $this->options[ $var ] : '';
|
374 |
$attributes = isset( $attr['autocomplete'] ) ? ' autocomplete="' . esc_attr( $attr['autocomplete'] ) . '"' : '';
|
@@ -378,10 +378,10 @@ class Yoast_Form {
|
|
378 |
|
379 |
$this->label(
|
380 |
$label,
|
381 |
-
|
382 |
'for' => $var,
|
383 |
'class' => 'textinput',
|
384 |
-
|
385 |
);
|
386 |
|
387 |
$has_input_error = Yoast_Input_Validation::yoast_form_control_has_error( $var );
|
@@ -403,27 +403,27 @@ class Yoast_Form {
|
|
403 |
* @param string $label The label to show for the variable.
|
404 |
* @param string|array $attr The CSS class or an array of attributes to assign to the textarea.
|
405 |
*/
|
406 |
-
public function textarea( $var, $label, $attr =
|
407 |
if ( ! is_array( $attr ) ) {
|
408 |
-
$attr =
|
409 |
'class' => $attr,
|
410 |
-
|
411 |
}
|
412 |
|
413 |
-
$defaults =
|
414 |
'cols' => '',
|
415 |
'rows' => '',
|
416 |
'class' => '',
|
417 |
-
|
418 |
$attr = wp_parse_args( $attr, $defaults );
|
419 |
$val = ( isset( $this->options[ $var ] ) ) ? $this->options[ $var ] : '';
|
420 |
|
421 |
$this->label(
|
422 |
$label,
|
423 |
-
|
424 |
'for' => $var,
|
425 |
'class' => 'textinput',
|
426 |
-
|
427 |
);
|
428 |
echo '<textarea cols="' . esc_attr( $attr['cols'] ) . '" rows="' . esc_attr( $attr['rows'] ) . '" class="textinput ' . esc_attr( $attr['class'] ) . '" id="' . esc_attr( $var ) . '" name="' . esc_attr( $this->option_name ) . '[' . esc_attr( $var ) . ']"', disabled( $this->is_control_disabled( $var ), true, false ), '>' . esc_textarea( $val ) . '</textarea><br class="clear" />';
|
429 |
}
|
@@ -469,11 +469,11 @@ class Yoast_Form {
|
|
469 |
if ( $show_label ) {
|
470 |
$this->label(
|
471 |
$label,
|
472 |
-
|
473 |
'for' => $var,
|
474 |
'class' => 'select',
|
475 |
|
476 |
-
|
477 |
);
|
478 |
}
|
479 |
|
@@ -519,10 +519,10 @@ class Yoast_Form {
|
|
519 |
$var_esc = esc_attr( $var );
|
520 |
$this->label(
|
521 |
$label,
|
522 |
-
|
523 |
'for' => $var,
|
524 |
'class' => 'select',
|
525 |
-
|
526 |
);
|
527 |
echo '<input type="file" value="' . esc_attr( $val ) . '" class="textinput" name="' . esc_attr( $this->option_name ) . '[' . $var_esc . ']" id="' . $var_esc . '"', disabled( $this->is_control_disabled( $var ), true, false ), '/>';
|
528 |
|
@@ -558,10 +558,10 @@ class Yoast_Form {
|
|
558 |
|
559 |
$this->label(
|
560 |
$label,
|
561 |
-
|
562 |
'for' => 'wpseo_' . $var,
|
563 |
'class' => 'select',
|
564 |
-
|
565 |
);
|
566 |
|
567 |
$id_field_id = 'wpseo_' . $var_esc . '_id';
|
@@ -609,8 +609,8 @@ class Yoast_Form {
|
|
609 |
* @param string $legend Optional. The legend to show for the field set, if any.
|
610 |
* @param array $legend_attr Optional. The attributes for the legend, if any.
|
611 |
*/
|
612 |
-
public function radio( $var, $values, $legend = '', $legend_attr =
|
613 |
-
if ( ! is_array( $values ) || $values ===
|
614 |
return;
|
615 |
}
|
616 |
if ( ! isset( $this->options[ $var ] ) ) {
|
@@ -623,10 +623,10 @@ class Yoast_Form {
|
|
623 |
|
624 |
if ( is_string( $legend ) && '' !== $legend ) {
|
625 |
|
626 |
-
$defaults =
|
627 |
'id' => '',
|
628 |
'class' => 'radiogroup',
|
629 |
-
|
630 |
|
631 |
$legend_attr = wp_parse_args( $legend_attr, $defaults );
|
632 |
|
@@ -646,11 +646,11 @@ class Yoast_Form {
|
|
646 |
echo '<input type="radio" class="radio" id="' . $var_esc . '-' . $key_esc . '" name="' . esc_attr( $this->option_name ) . '[' . $var_esc . ']" value="' . $key_esc . '" ' . checked( $this->options[ $var ], $key_esc, false ) . disabled( $this->is_control_disabled( $var ), true, false ) . ' />';
|
647 |
$this->label(
|
648 |
$label,
|
649 |
-
|
650 |
'for' => $var_esc . '-' . $key_esc,
|
651 |
'class' => 'radio',
|
652 |
'aria_label' => $aria_label,
|
653 |
-
|
654 |
);
|
655 |
}
|
656 |
echo '</fieldset>';
|
@@ -669,7 +669,7 @@ class Yoast_Form {
|
|
669 |
* @param string $help Inline Help that will be printed out before the visible toggles text.
|
670 |
*/
|
671 |
public function toggle_switch( $var, $values, $label, $help = '' ) {
|
672 |
-
if ( ! is_array( $values ) || $values ===
|
673 |
return;
|
674 |
}
|
675 |
if ( ! isset( $this->options[ $var ] ) ) {
|
@@ -720,10 +720,10 @@ class Yoast_Form {
|
|
720 |
* @return void
|
721 |
*/
|
722 |
public function index_switch( $var, $label, $help = '' ) {
|
723 |
-
$index_switch_values =
|
724 |
'off' => __( 'Yes', 'wordpress-seo' ),
|
725 |
'on' => __( 'No', 'wordpress-seo' ),
|
726 |
-
|
727 |
|
728 |
$this->toggle_switch(
|
729 |
$var,
|
@@ -751,10 +751,10 @@ class Yoast_Form {
|
|
751 |
$on_key = ( $inverse_keys ) ? 'off' : 'on';
|
752 |
$off_key = ( $inverse_keys ) ? 'on' : 'off';
|
753 |
|
754 |
-
$show_hide_switch =
|
755 |
$on_key => __( 'Show', 'wordpress-seo' ),
|
756 |
$off_key => __( 'Hide', 'wordpress-seo' ),
|
757 |
-
|
758 |
|
759 |
$this->toggle_switch( $var, $show_hide_switch, $label, $help );
|
760 |
}
|
34 |
* @var array
|
35 |
* @since 2.0
|
36 |
*/
|
37 |
+
public $options = [];
|
38 |
|
39 |
/**
|
40 |
* Option instance.
|
94 |
$network_admin = new Yoast_Network_Admin();
|
95 |
if ( $network_admin->meets_requirements() ) {
|
96 |
$action_url = network_admin_url( 'settings.php' );
|
97 |
+
$hidden_fields_cb = [ $network_admin, 'settings_fields' ];
|
98 |
}
|
99 |
else {
|
100 |
$action_url = admin_url( 'options.php' );
|
119 |
|
120 |
$this->options = WPSEO_Options::get_option( $option_name );
|
121 |
if ( $this->options === null ) {
|
122 |
+
$this->options = (array) get_option( $option_name, [] );
|
123 |
}
|
124 |
|
125 |
$this->option_instance = WPSEO_Options::get_option_instance( $option_name );
|
221 |
* @param array $attr HTML attributes set.
|
222 |
*/
|
223 |
public function label( $text, $attr ) {
|
224 |
+
$defaults = [
|
225 |
'class' => 'checkbox',
|
226 |
'close' => true,
|
227 |
'for' => '',
|
228 |
'aria_label' => '',
|
229 |
+
];
|
230 |
|
231 |
$attr = wp_parse_args( $attr, $defaults );
|
232 |
$aria_label = '';
|
249 |
* @param array $attr HTML attributes set.
|
250 |
*/
|
251 |
public function legend( $text, $attr ) {
|
252 |
+
$defaults = [
|
253 |
'id' => '',
|
254 |
'class' => '',
|
255 |
+
];
|
256 |
$attr = wp_parse_args( $attr, $defaults );
|
257 |
|
258 |
$id = ( '' === $attr['id'] ) ? '' : ' id="' . esc_attr( $attr['id'] ) . '"';
|
279 |
|
280 |
$class = '';
|
281 |
if ( $label_left !== false ) {
|
282 |
+
$this->label( $label_left, [ 'for' => $var ] );
|
283 |
}
|
284 |
else {
|
285 |
$class = 'double';
|
288 |
echo '<input class="checkbox ', esc_attr( $class ), '" type="checkbox" id="', esc_attr( $var ), '" name="', esc_attr( $this->option_name ), '[', esc_attr( $var ), ']" value="on"', checked( $this->options[ $var ], 'on', false ), disabled( $this->is_control_disabled( $var ), true, false ), '/>';
|
289 |
|
290 |
if ( ! empty( $label ) ) {
|
291 |
+
$this->label( $label, [ 'for' => $var ] );
|
292 |
}
|
293 |
|
294 |
echo '<br class="clear" />';
|
306 |
* @param string $help Inline Help that will be printed out before the visible toggles text.
|
307 |
* @param bool $strong Whether the visual label is displayed in strong text. Default is false.
|
308 |
*/
|
309 |
+
public function light_switch( $var, $label, $buttons = [], $reverse = true, $help = '', $strong = false ) {
|
310 |
|
311 |
if ( ! isset( $this->options[ $var ] ) ) {
|
312 |
$this->options[ $var ] = false;
|
323 |
}
|
324 |
|
325 |
if ( empty( $buttons ) ) {
|
326 |
+
$buttons = [ __( 'Disabled', 'wordpress-seo' ), __( 'Enabled', 'wordpress-seo' ) ];
|
327 |
}
|
328 |
|
329 |
list( $off_button, $on_button ) = $buttons;
|
357 |
* @param string $label The label to show for the variable.
|
358 |
* @param array|string $attr Extra attributes to add to the input field. Can be class, disabled, autocomplete.
|
359 |
*/
|
360 |
+
public function textinput( $var, $label, $attr = [] ) {
|
361 |
if ( ! is_array( $attr ) ) {
|
362 |
+
$attr = [
|
363 |
'class' => $attr,
|
364 |
'disabled' => false,
|
365 |
+
];
|
366 |
}
|
367 |
|
368 |
+
$defaults = [
|
369 |
'placeholder' => '',
|
370 |
'class' => '',
|
371 |
+
];
|
372 |
$attr = wp_parse_args( $attr, $defaults );
|
373 |
$val = isset( $this->options[ $var ] ) ? $this->options[ $var ] : '';
|
374 |
$attributes = isset( $attr['autocomplete'] ) ? ' autocomplete="' . esc_attr( $attr['autocomplete'] ) . '"' : '';
|
378 |
|
379 |
$this->label(
|
380 |
$label,
|
381 |
+
[
|
382 |
'for' => $var,
|
383 |
'class' => 'textinput',
|
384 |
+
]
|
385 |
);
|
386 |
|
387 |
$has_input_error = Yoast_Input_Validation::yoast_form_control_has_error( $var );
|
403 |
* @param string $label The label to show for the variable.
|
404 |
* @param string|array $attr The CSS class or an array of attributes to assign to the textarea.
|
405 |
*/
|
406 |
+
public function textarea( $var, $label, $attr = [] ) {
|
407 |
if ( ! is_array( $attr ) ) {
|
408 |
+
$attr = [
|
409 |
'class' => $attr,
|
410 |
+
];
|
411 |
}
|
412 |
|
413 |
+
$defaults = [
|
414 |
'cols' => '',
|
415 |
'rows' => '',
|
416 |
'class' => '',
|
417 |
+
];
|
418 |
$attr = wp_parse_args( $attr, $defaults );
|
419 |
$val = ( isset( $this->options[ $var ] ) ) ? $this->options[ $var ] : '';
|
420 |
|
421 |
$this->label(
|
422 |
$label,
|
423 |
+
[
|
424 |
'for' => $var,
|
425 |
'class' => 'textinput',
|
426 |
+
]
|
427 |
);
|
428 |
echo '<textarea cols="' . esc_attr( $attr['cols'] ) . '" rows="' . esc_attr( $attr['rows'] ) . '" class="textinput ' . esc_attr( $attr['class'] ) . '" id="' . esc_attr( $var ) . '" name="' . esc_attr( $this->option_name ) . '[' . esc_attr( $var ) . ']"', disabled( $this->is_control_disabled( $var ), true, false ), '>' . esc_textarea( $val ) . '</textarea><br class="clear" />';
|
429 |
}
|
469 |
if ( $show_label ) {
|
470 |
$this->label(
|
471 |
$label,
|
472 |
+
[
|
473 |
'for' => $var,
|
474 |
'class' => 'select',
|
475 |
|
476 |
+
]
|
477 |
);
|
478 |
}
|
479 |
|
519 |
$var_esc = esc_attr( $var );
|
520 |
$this->label(
|
521 |
$label,
|
522 |
+
[
|
523 |
'for' => $var,
|
524 |
'class' => 'select',
|
525 |
+
]
|
526 |
);
|
527 |
echo '<input type="file" value="' . esc_attr( $val ) . '" class="textinput" name="' . esc_attr( $this->option_name ) . '[' . $var_esc . ']" id="' . $var_esc . '"', disabled( $this->is_control_disabled( $var ), true, false ), '/>';
|
528 |
|
558 |
|
559 |
$this->label(
|
560 |
$label,
|
561 |
+
[
|
562 |
'for' => 'wpseo_' . $var,
|
563 |
'class' => 'select',
|
564 |
+
]
|
565 |
);
|
566 |
|
567 |
$id_field_id = 'wpseo_' . $var_esc . '_id';
|
609 |
* @param string $legend Optional. The legend to show for the field set, if any.
|
610 |
* @param array $legend_attr Optional. The attributes for the legend, if any.
|
611 |
*/
|
612 |
+
public function radio( $var, $values, $legend = '', $legend_attr = [] ) {
|
613 |
+
if ( ! is_array( $values ) || $values === [] ) {
|
614 |
return;
|
615 |
}
|
616 |
if ( ! isset( $this->options[ $var ] ) ) {
|
623 |
|
624 |
if ( is_string( $legend ) && '' !== $legend ) {
|
625 |
|
626 |
+
$defaults = [
|
627 |
'id' => '',
|
628 |
'class' => 'radiogroup',
|
629 |
+
];
|
630 |
|
631 |
$legend_attr = wp_parse_args( $legend_attr, $defaults );
|
632 |
|
646 |
echo '<input type="radio" class="radio" id="' . $var_esc . '-' . $key_esc . '" name="' . esc_attr( $this->option_name ) . '[' . $var_esc . ']" value="' . $key_esc . '" ' . checked( $this->options[ $var ], $key_esc, false ) . disabled( $this->is_control_disabled( $var ), true, false ) . ' />';
|
647 |
$this->label(
|
648 |
$label,
|
649 |
+
[
|
650 |
'for' => $var_esc . '-' . $key_esc,
|
651 |
'class' => 'radio',
|
652 |
'aria_label' => $aria_label,
|
653 |
+
]
|
654 |
);
|
655 |
}
|
656 |
echo '</fieldset>';
|
669 |
* @param string $help Inline Help that will be printed out before the visible toggles text.
|
670 |
*/
|
671 |
public function toggle_switch( $var, $values, $label, $help = '' ) {
|
672 |
+
if ( ! is_array( $values ) || $values === [] ) {
|
673 |
return;
|
674 |
}
|
675 |
if ( ! isset( $this->options[ $var ] ) ) {
|
720 |
* @return void
|
721 |
*/
|
722 |
public function index_switch( $var, $label, $help = '' ) {
|
723 |
+
$index_switch_values = [
|
724 |
'off' => __( 'Yes', 'wordpress-seo' ),
|
725 |
'on' => __( 'No', 'wordpress-seo' ),
|
726 |
+
];
|
727 |
|
728 |
$this->toggle_switch(
|
729 |
$var,
|
751 |
$on_key = ( $inverse_keys ) ? 'off' : 'on';
|
752 |
$off_key = ( $inverse_keys ) ? 'on' : 'off';
|
753 |
|
754 |
+
$show_hide_switch = [
|
755 |
$on_key => __( 'Show', 'wordpress-seo' ),
|
756 |
$off_key => __( 'Hide', 'wordpress-seo' ),
|
757 |
+
];
|
758 |
|
759 |
$this->toggle_switch( $var, $show_hide_switch, $label, $help );
|
760 |
}
|
admin/class-yoast-input-validation.php
CHANGED
@@ -19,7 +19,7 @@ class Yoast_Input_Validation {
|
|
19 |
*
|
20 |
* @var array
|
21 |
*/
|
22 |
-
private static $error_descriptions =
|
23 |
|
24 |
/**
|
25 |
* Check whether an option group is a Yoast SEO setting.
|
@@ -100,8 +100,8 @@ class Yoast_Input_Validation {
|
|
100 |
* @param array $descriptions An associative array of error descriptions. For
|
101 |
* each entry, the key must be the setting variable.
|
102 |
*/
|
103 |
-
public static function set_error_descriptions( $descriptions =
|
104 |
-
$defaults =
|
105 |
'baiduverify' => sprintf(
|
106 |
/* translators: %s: additional message with the submitted invalid value */
|
107 |
esc_html__( 'Baidu verification codes can only contain letters, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
|
@@ -172,7 +172,7 @@ class Yoast_Input_Validation {
|
|
172 |
esc_html__( 'Please check the format of the Youtube URL you entered. %s', 'wordpress-seo' ),
|
173 |
self::get_dirty_value_message( 'youtube_url' )
|
174 |
),
|
175 |
-
|
176 |
|
177 |
$descriptions = wp_parse_args( $descriptions, $defaults );
|
178 |
|
19 |
*
|
20 |
* @var array
|
21 |
*/
|
22 |
+
private static $error_descriptions = [];
|
23 |
|
24 |
/**
|
25 |
* Check whether an option group is a Yoast SEO setting.
|
100 |
* @param array $descriptions An associative array of error descriptions. For
|
101 |
* each entry, the key must be the setting variable.
|
102 |
*/
|
103 |
+
public static function set_error_descriptions( $descriptions = [] ) {
|
104 |
+
$defaults = [
|
105 |
'baiduverify' => sprintf(
|
106 |
/* translators: %s: additional message with the submitted invalid value */
|
107 |
esc_html__( 'Baidu verification codes can only contain letters, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
|
172 |
esc_html__( 'Please check the format of the Youtube URL you entered. %s', 'wordpress-seo' ),
|
173 |
self::get_dirty_value_message( 'youtube_url' )
|
174 |
),
|
175 |
+
];
|
176 |
|
177 |
$descriptions = wp_parse_args( $descriptions, $defaults );
|
178 |
|
admin/class-yoast-network-admin.php
CHANGED
@@ -37,16 +37,16 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
|
|
37 |
* @return array Choices as $site_id => $site_label pairs.
|
38 |
*/
|
39 |
public function get_site_choices( $include_empty = false, $show_title = false ) {
|
40 |
-
$choices =
|
41 |
|
42 |
if ( $include_empty ) {
|
43 |
$choices['-'] = __( 'None', 'wordpress-seo' );
|
44 |
}
|
45 |
|
46 |
-
$criteria =
|
47 |
'deleted' => 0,
|
48 |
'network_id' => get_current_network_id(),
|
49 |
-
|
50 |
$sites = get_sites( $criteria );
|
51 |
|
52 |
foreach ( $sites as $site ) {
|
@@ -73,15 +73,15 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
|
|
73 |
* @return array Array of $state_slug => $state_label pairs.
|
74 |
*/
|
75 |
public function get_site_states( $site ) {
|
76 |
-
$available_states =
|
77 |
'public' => __( 'public', 'wordpress-seo' ),
|
78 |
'archived' => __( 'archived', 'wordpress-seo' ),
|
79 |
'mature' => __( 'mature', 'wordpress-seo' ),
|
80 |
'spam' => __( 'spam', 'wordpress-seo' ),
|
81 |
'deleted' => __( 'deleted', 'wordpress-seo' ),
|
82 |
-
|
83 |
|
84 |
-
$site_states =
|
85 |
foreach ( $available_states as $state_slug => $state_label ) {
|
86 |
if ( $site->$state_slug === '1' ) {
|
87 |
$site_states[ $state_slug ] = $state_label;
|
@@ -188,12 +188,12 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
|
|
188 |
$asset_manager = new WPSEO_Admin_Asset_Manager();
|
189 |
$asset_manager->enqueue_script( 'network-admin-script' );
|
190 |
|
191 |
-
$translations =
|
192 |
/* translators: %s: success message */
|
193 |
'success_prefix' => __( 'Success: %s', 'wordpress-seo' ),
|
194 |
/* translators: %s: error message */
|
195 |
'error_prefix' => __( 'Error: %s', 'wordpress-seo' ),
|
196 |
-
|
197 |
wp_localize_script(
|
198 |
WPSEO_Admin_Asset_Manager::PREFIX . 'network-admin-script',
|
199 |
'wpseoNetworkAdminGlobalL10n',
|
@@ -212,10 +212,10 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
|
|
212 |
return;
|
213 |
}
|
214 |
|
215 |
-
add_action( 'admin_enqueue_scripts',
|
216 |
|
217 |
-
add_action( 'admin_action_' . self::UPDATE_OPTIONS_ACTION,
|
218 |
-
add_action( 'admin_action_' . self::RESTORE_SITE_ACTION,
|
219 |
}
|
220 |
|
221 |
/**
|
@@ -224,8 +224,8 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
|
|
224 |
* @return void
|
225 |
*/
|
226 |
public function register_ajax_hooks() {
|
227 |
-
add_action( 'wp_ajax_' . self::UPDATE_OPTIONS_ACTION,
|
228 |
-
add_action( 'wp_ajax_' . self::RESTORE_SITE_ACTION,
|
229 |
}
|
230 |
|
231 |
/**
|
@@ -281,7 +281,7 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
|
|
281 |
}
|
282 |
|
283 |
$this->persist_settings_errors();
|
284 |
-
$this->redirect_back(
|
285 |
}
|
286 |
|
287 |
/**
|
@@ -308,7 +308,7 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
|
|
308 |
*
|
309 |
* @return void
|
310 |
*/
|
311 |
-
protected function redirect_back( $query_args =
|
312 |
$sendback = wp_get_referer();
|
313 |
|
314 |
if ( ! empty( $query_args ) ) {
|
37 |
* @return array Choices as $site_id => $site_label pairs.
|
38 |
*/
|
39 |
public function get_site_choices( $include_empty = false, $show_title = false ) {
|
40 |
+
$choices = [];
|
41 |
|
42 |
if ( $include_empty ) {
|
43 |
$choices['-'] = __( 'None', 'wordpress-seo' );
|
44 |
}
|
45 |
|
46 |
+
$criteria = [
|
47 |
'deleted' => 0,
|
48 |
'network_id' => get_current_network_id(),
|
49 |
+
];
|
50 |
$sites = get_sites( $criteria );
|
51 |
|
52 |
foreach ( $sites as $site ) {
|
73 |
* @return array Array of $state_slug => $state_label pairs.
|
74 |
*/
|
75 |
public function get_site_states( $site ) {
|
76 |
+
$available_states = [
|
77 |
'public' => __( 'public', 'wordpress-seo' ),
|
78 |
'archived' => __( 'archived', 'wordpress-seo' ),
|
79 |
'mature' => __( 'mature', 'wordpress-seo' ),
|
80 |
'spam' => __( 'spam', 'wordpress-seo' ),
|
81 |
'deleted' => __( 'deleted', 'wordpress-seo' ),
|
82 |
+
];
|
83 |
|
84 |
+
$site_states = [];
|
85 |
foreach ( $available_states as $state_slug => $state_label ) {
|
86 |
if ( $site->$state_slug === '1' ) {
|
87 |
$site_states[ $state_slug ] = $state_label;
|
188 |
$asset_manager = new WPSEO_Admin_Asset_Manager();
|
189 |
$asset_manager->enqueue_script( 'network-admin-script' );
|
190 |
|
191 |
+
$translations = [
|
192 |
/* translators: %s: success message */
|
193 |
'success_prefix' => __( 'Success: %s', 'wordpress-seo' ),
|
194 |
/* translators: %s: error message */
|
195 |
'error_prefix' => __( 'Error: %s', 'wordpress-seo' ),
|
196 |
+
];
|
197 |
wp_localize_script(
|
198 |
WPSEO_Admin_Asset_Manager::PREFIX . 'network-admin-script',
|
199 |
'wpseoNetworkAdminGlobalL10n',
|
212 |
return;
|
213 |
}
|
214 |
|
215 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
216 |
|
217 |
+
add_action( 'admin_action_' . self::UPDATE_OPTIONS_ACTION, [ $this, 'handle_update_options_request' ] );
|
218 |
+
add_action( 'admin_action_' . self::RESTORE_SITE_ACTION, [ $this, 'handle_restore_site_request' ] );
|
219 |
}
|
220 |
|
221 |
/**
|
224 |
* @return void
|
225 |
*/
|
226 |
public function register_ajax_hooks() {
|
227 |
+
add_action( 'wp_ajax_' . self::UPDATE_OPTIONS_ACTION, [ $this, 'handle_update_options_request' ] );
|
228 |
+
add_action( 'wp_ajax_' . self::RESTORE_SITE_ACTION, [ $this, 'handle_restore_site_request' ] );
|
229 |
}
|
230 |
|
231 |
/**
|
281 |
}
|
282 |
|
283 |
$this->persist_settings_errors();
|
284 |
+
$this->redirect_back( [ 'settings-updated' => 'true' ] );
|
285 |
}
|
286 |
|
287 |
/**
|
308 |
*
|
309 |
* @return void
|
310 |
*/
|
311 |
+
protected function redirect_back( $query_args = [] ) {
|
312 |
$sendback = wp_get_referer();
|
313 |
|
314 |
if ( ! empty( $query_args ) ) {
|
admin/class-yoast-network-settings-api.php
CHANGED
@@ -15,14 +15,14 @@ class Yoast_Network_Settings_API {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
private $registered_settings =
|
19 |
|
20 |
/**
|
21 |
* Options whitelist, keyed by option group.
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
-
private $whitelist_options =
|
26 |
|
27 |
/**
|
28 |
* The singleton instance of this class.
|
@@ -45,26 +45,26 @@ class Yoast_Network_Settings_API {
|
|
45 |
*
|
46 |
* @return void
|
47 |
*/
|
48 |
-
public function register_setting( $option_group, $option_name, $args =
|
49 |
|
50 |
-
$defaults =
|
51 |
'group' => $option_group,
|
52 |
'sanitize_callback' => null,
|
53 |
-
|
54 |
$args = wp_parse_args( $args, $defaults );
|
55 |
|
56 |
if ( ! isset( $this->whitelist_options[ $option_group ] ) ) {
|
57 |
-
$this->whitelist_options[ $option_group ] =
|
58 |
}
|
59 |
|
60 |
$this->whitelist_options[ $option_group ][] = $option_name;
|
61 |
|
62 |
if ( ! empty( $args['sanitize_callback'] ) ) {
|
63 |
-
add_filter( "sanitize_option_{$option_name}",
|
64 |
}
|
65 |
|
66 |
if ( array_key_exists( 'default', $args ) ) {
|
67 |
-
add_filter( "default_site_option_{$option_name}",
|
68 |
}
|
69 |
|
70 |
$this->registered_settings[ $option_name ] = $args;
|
@@ -88,7 +88,7 @@ class Yoast_Network_Settings_API {
|
|
88 |
*/
|
89 |
public function get_whitelist_options( $option_group ) {
|
90 |
if ( ! isset( $this->whitelist_options[ $option_group ] ) ) {
|
91 |
-
return
|
92 |
}
|
93 |
|
94 |
return $this->whitelist_options[ $option_group ];
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
private $registered_settings = [];
|
19 |
|
20 |
/**
|
21 |
* Options whitelist, keyed by option group.
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
+
private $whitelist_options = [];
|
26 |
|
27 |
/**
|
28 |
* The singleton instance of this class.
|
45 |
*
|
46 |
* @return void
|
47 |
*/
|
48 |
+
public function register_setting( $option_group, $option_name, $args = [] ) {
|
49 |
|
50 |
+
$defaults = [
|
51 |
'group' => $option_group,
|
52 |
'sanitize_callback' => null,
|
53 |
+
];
|
54 |
$args = wp_parse_args( $args, $defaults );
|
55 |
|
56 |
if ( ! isset( $this->whitelist_options[ $option_group ] ) ) {
|
57 |
+
$this->whitelist_options[ $option_group ] = [];
|
58 |
}
|
59 |
|
60 |
$this->whitelist_options[ $option_group ][] = $option_name;
|
61 |
|
62 |
if ( ! empty( $args['sanitize_callback'] ) ) {
|
63 |
+
add_filter( "sanitize_option_{$option_name}", [ $this, 'filter_sanitize_option' ], 10, 2 );
|
64 |
}
|
65 |
|
66 |
if ( array_key_exists( 'default', $args ) ) {
|
67 |
+
add_filter( "default_site_option_{$option_name}", [ $this, 'filter_default_option' ], 10, 2 );
|
68 |
}
|
69 |
|
70 |
$this->registered_settings[ $option_name ] = $args;
|
88 |
*/
|
89 |
public function get_whitelist_options( $option_group ) {
|
90 |
if ( ! isset( $this->whitelist_options[ $option_group ] ) ) {
|
91 |
+
return [];
|
92 |
}
|
93 |
|
94 |
return $this->whitelist_options[ $option_group ];
|
admin/class-yoast-notification-center.php
CHANGED
@@ -29,14 +29,14 @@ class Yoast_Notification_Center {
|
|
29 |
*
|
30 |
* @var \Yoast_Notification[]
|
31 |
*/
|
32 |
-
private $notifications =
|
33 |
|
34 |
/**
|
35 |
* Notifications there are newly added.
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
-
private $new =
|
40 |
|
41 |
/**
|
42 |
* Notifications that were resolved this execution.
|
@@ -50,7 +50,7 @@ class Yoast_Notification_Center {
|
|
50 |
*
|
51 |
* @var array
|
52 |
*/
|
53 |
-
private $queued_transactions =
|
54 |
|
55 |
/**
|
56 |
* Internal flag for whether notifications have been retrieved from storage.
|
@@ -64,14 +64,14 @@ class Yoast_Notification_Center {
|
|
64 |
*/
|
65 |
private function __construct() {
|
66 |
|
67 |
-
add_action( 'init',
|
68 |
|
69 |
-
add_action( 'all_admin_notices',
|
70 |
|
71 |
-
add_action( 'wp_ajax_yoast_get_notifications',
|
72 |
|
73 |
-
add_action( 'wpseo_deactivate',
|
74 |
-
add_action( 'shutdown',
|
75 |
}
|
76 |
|
77 |
/**
|
@@ -104,10 +104,10 @@ class Yoast_Notification_Center {
|
|
104 |
if ( false === ( $notification instanceof Yoast_Notification ) ) {
|
105 |
|
106 |
// Permit legacy.
|
107 |
-
$options =
|
108 |
'id' => $notification_id,
|
109 |
'dismissal_key' => $notification_id,
|
110 |
-
|
111 |
$notification = new Yoast_Notification( '', $options );
|
112 |
}
|
113 |
|
@@ -279,7 +279,7 @@ class Yoast_Notification_Center {
|
|
279 |
call_user_func_array( $callback, $args );
|
280 |
}
|
281 |
|
282 |
-
$this->queued_transactions =
|
283 |
}
|
284 |
|
285 |
/**
|
@@ -289,7 +289,7 @@ class Yoast_Notification_Center {
|
|
289 |
*/
|
290 |
public function add_notification( Yoast_Notification $notification ) {
|
291 |
|
292 |
-
$callback =
|
293 |
$args = func_get_args();
|
294 |
if ( $this->queue_transaction( $callback, $args ) ) {
|
295 |
return;
|
@@ -353,17 +353,17 @@ class Yoast_Notification_Center {
|
|
353 |
}
|
354 |
|
355 |
$sorted_notifications = $this->get_sorted_notifications();
|
356 |
-
$notifications = array_filter( $sorted_notifications,
|
357 |
|
358 |
if ( empty( $notifications ) ) {
|
359 |
return;
|
360 |
}
|
361 |
|
362 |
-
array_walk( $notifications,
|
363 |
|
364 |
$notifications = array_unique( $notifications );
|
365 |
if ( $echo_as_json ) {
|
366 |
-
$notification_json =
|
367 |
|
368 |
foreach ( $notifications as $notification ) {
|
369 |
$notification_json[] = $notification->render();
|
@@ -389,7 +389,7 @@ class Yoast_Notification_Center {
|
|
389 |
*/
|
390 |
public function remove_notification( Yoast_Notification $notification, $resolve = true ) {
|
391 |
|
392 |
-
$callback =
|
393 |
$args = func_get_args();
|
394 |
if ( $this->queue_transaction( $callback, $args ) ) {
|
395 |
return;
|
@@ -451,10 +451,10 @@ class Yoast_Notification_Center {
|
|
451 |
public function get_notification_count( $dismissed = false ) {
|
452 |
|
453 |
$notifications = $this->get_notifications();
|
454 |
-
$notifications = array_filter( $notifications,
|
455 |
|
456 |
if ( ! $dismissed ) {
|
457 |
-
$notifications = array_filter( $notifications,
|
458 |
}
|
459 |
|
460 |
return count( $notifications );
|
@@ -481,11 +481,11 @@ class Yoast_Notification_Center {
|
|
481 |
|
482 |
$notifications = $this->get_notifications();
|
483 |
if ( empty( $notifications ) ) {
|
484 |
-
return
|
485 |
}
|
486 |
|
487 |
// Sort by severity, error first.
|
488 |
-
usort( $notifications,
|
489 |
|
490 |
return $notifications;
|
491 |
}
|
@@ -538,7 +538,7 @@ class Yoast_Notification_Center {
|
|
538 |
return;
|
539 |
}
|
540 |
|
541 |
-
$notifications = array_map(
|
542 |
|
543 |
// Save the notifications to the storage.
|
544 |
update_user_option( get_current_user_id(), self::STORAGE_KEY, $notifications );
|
@@ -561,7 +561,7 @@ class Yoast_Notification_Center {
|
|
561 |
*/
|
562 |
public function get_new_notifications() {
|
563 |
|
564 |
-
return array_map(
|
565 |
}
|
566 |
|
567 |
/**
|
@@ -603,9 +603,9 @@ class Yoast_Notification_Center {
|
|
603 |
}
|
604 |
|
605 |
if ( is_array( $stored_notifications ) ) {
|
606 |
-
$notifications = array_map(
|
607 |
// Apply array_values to ensure we get a 0-indexed array.
|
608 |
-
$notifications = array_values( array_filter( $notifications,
|
609 |
|
610 |
$this->notifications = $notifications;
|
611 |
}
|
@@ -644,7 +644,7 @@ class Yoast_Notification_Center {
|
|
644 |
*/
|
645 |
private function clear_notifications() {
|
646 |
|
647 |
-
$this->notifications =
|
648 |
$this->notifications_retrieved = false;
|
649 |
}
|
650 |
|
@@ -760,7 +760,7 @@ class Yoast_Notification_Center {
|
|
760 |
* @param array $args Arguments to pass to the callback.
|
761 |
*/
|
762 |
private function add_transaction_to_queue( $callback, $args ) {
|
763 |
-
$this->queued_transactions[] =
|
764 |
}
|
765 |
|
766 |
/**
|
29 |
*
|
30 |
* @var \Yoast_Notification[]
|
31 |
*/
|
32 |
+
private $notifications = [];
|
33 |
|
34 |
/**
|
35 |
* Notifications there are newly added.
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
+
private $new = [];
|
40 |
|
41 |
/**
|
42 |
* Notifications that were resolved this execution.
|
50 |
*
|
51 |
* @var array
|
52 |
*/
|
53 |
+
private $queued_transactions = [];
|
54 |
|
55 |
/**
|
56 |
* Internal flag for whether notifications have been retrieved from storage.
|
64 |
*/
|
65 |
private function __construct() {
|
66 |
|
67 |
+
add_action( 'init', [ $this, 'setup_current_notifications' ], 1 );
|
68 |
|
69 |
+
add_action( 'all_admin_notices', [ $this, 'display_notifications' ] );
|
70 |
|
71 |
+
add_action( 'wp_ajax_yoast_get_notifications', [ $this, 'ajax_get_notifications' ] );
|
72 |
|
73 |
+
add_action( 'wpseo_deactivate', [ $this, 'deactivate_hook' ] );
|
74 |
+
add_action( 'shutdown', [ $this, 'update_storage' ] );
|
75 |
}
|
76 |
|
77 |
/**
|
104 |
if ( false === ( $notification instanceof Yoast_Notification ) ) {
|
105 |
|
106 |
// Permit legacy.
|
107 |
+
$options = [
|
108 |
'id' => $notification_id,
|
109 |
'dismissal_key' => $notification_id,
|
110 |
+
];
|
111 |
$notification = new Yoast_Notification( '', $options );
|
112 |
}
|
113 |
|
279 |
call_user_func_array( $callback, $args );
|
280 |
}
|
281 |
|
282 |
+
$this->queued_transactions = [];
|
283 |
}
|
284 |
|
285 |
/**
|
289 |
*/
|
290 |
public function add_notification( Yoast_Notification $notification ) {
|
291 |
|
292 |
+
$callback = [ $this, __METHOD__ ];
|
293 |
$args = func_get_args();
|
294 |
if ( $this->queue_transaction( $callback, $args ) ) {
|
295 |
return;
|
353 |
}
|
354 |
|
355 |
$sorted_notifications = $this->get_sorted_notifications();
|
356 |
+
$notifications = array_filter( $sorted_notifications, [ $this, 'is_notification_persistent' ] );
|
357 |
|
358 |
if ( empty( $notifications ) ) {
|
359 |
return;
|
360 |
}
|
361 |
|
362 |
+
array_walk( $notifications, [ $this, 'remove_notification' ] );
|
363 |
|
364 |
$notifications = array_unique( $notifications );
|
365 |
if ( $echo_as_json ) {
|
366 |
+
$notification_json = [];
|
367 |
|
368 |
foreach ( $notifications as $notification ) {
|
369 |
$notification_json[] = $notification->render();
|
389 |
*/
|
390 |
public function remove_notification( Yoast_Notification $notification, $resolve = true ) {
|
391 |
|
392 |
+
$callback = [ $this, __METHOD__ ];
|
393 |
$args = func_get_args();
|
394 |
if ( $this->queue_transaction( $callback, $args ) ) {
|
395 |
return;
|
451 |
public function get_notification_count( $dismissed = false ) {
|
452 |
|
453 |
$notifications = $this->get_notifications();
|
454 |
+
$notifications = array_filter( $notifications, [ $this, 'filter_persistent_notifications' ] );
|
455 |
|
456 |
if ( ! $dismissed ) {
|
457 |
+
$notifications = array_filter( $notifications, [ $this, 'filter_dismissed_notifications' ] );
|
458 |
}
|
459 |
|
460 |
return count( $notifications );
|
481 |
|
482 |
$notifications = $this->get_notifications();
|
483 |
if ( empty( $notifications ) ) {
|
484 |
+
return [];
|
485 |
}
|
486 |
|
487 |
// Sort by severity, error first.
|
488 |
+
usort( $notifications, [ $this, 'sort_notifications' ] );
|
489 |
|
490 |
return $notifications;
|
491 |
}
|
538 |
return;
|
539 |
}
|
540 |
|
541 |
+
$notifications = array_map( [ $this, 'notification_to_array' ], $notifications );
|
542 |
|
543 |
// Save the notifications to the storage.
|
544 |
update_user_option( get_current_user_id(), self::STORAGE_KEY, $notifications );
|
561 |
*/
|
562 |
public function get_new_notifications() {
|
563 |
|
564 |
+
return array_map( [ $this, 'get_notification_by_id' ], $this->new );
|
565 |
}
|
566 |
|
567 |
/**
|
603 |
}
|
604 |
|
605 |
if ( is_array( $stored_notifications ) ) {
|
606 |
+
$notifications = array_map( [ $this, 'array_to_notification' ], $stored_notifications );
|
607 |
// Apply array_values to ensure we get a 0-indexed array.
|
608 |
+
$notifications = array_values( array_filter( $notifications, [ $this, 'filter_notification_current_user' ] ) );
|
609 |
|
610 |
$this->notifications = $notifications;
|
611 |
}
|
644 |
*/
|
645 |
private function clear_notifications() {
|
646 |
|
647 |
+
$this->notifications = [];
|
648 |
$this->notifications_retrieved = false;
|
649 |
}
|
650 |
|
760 |
* @param array $args Arguments to pass to the callback.
|
761 |
*/
|
762 |
private function add_transaction_to_queue( $callback, $args ) {
|
763 |
+
$this->queued_transactions[] = [ $callback, $args ];
|
764 |
}
|
765 |
|
766 |
/**
|
admin/class-yoast-notification.php
CHANGED
@@ -62,24 +62,24 @@ class Yoast_Notification {
|
|
62 |
*
|
63 |
* @var array
|
64 |
*/
|
65 |
-
private $options =
|
66 |
|
67 |
/**
|
68 |
* Contains default values for the optional arguments.
|
69 |
*
|
70 |
* @var array
|
71 |
*/
|
72 |
-
private $defaults =
|
73 |
'type' => self::UPDATED,
|
74 |
'id' => '',
|
75 |
'nonce' => null,
|
76 |
'priority' => 0.5,
|
77 |
-
'data_json' =>
|
78 |
'dismissal_key' => null,
|
79 |
-
'capabilities' =>
|
80 |
'capability_check' => self::MATCH_ALL,
|
81 |
'yoast_branding' => false,
|
82 |
-
|
83 |
|
84 |
/**
|
85 |
* The message for the notification.
|
@@ -94,7 +94,7 @@ class Yoast_Notification {
|
|
94 |
* @param string $message Message string.
|
95 |
* @param array $options Set of options.
|
96 |
*/
|
97 |
-
public function __construct( $message, $options =
|
98 |
$this->message = $message;
|
99 |
$this->options = $this->normalize_options( $options );
|
100 |
}
|
@@ -229,13 +229,13 @@ class Yoast_Notification {
|
|
229 |
*/
|
230 |
$capability_check = apply_filters( 'wpseo_notification_capability_check', $this->options['capability_check'], $this );
|
231 |
|
232 |
-
if ( ! in_array( $capability_check,
|
233 |
$capability_check = self::MATCH_ALL;
|
234 |
}
|
235 |
|
236 |
if ( ! empty( $capabilities ) ) {
|
237 |
|
238 |
-
$has_capabilities = array_filter( $capabilities,
|
239 |
|
240 |
switch ( $capability_check ) {
|
241 |
case self::MATCH_ALL:
|
@@ -265,10 +265,10 @@ class Yoast_Notification {
|
|
265 |
* @return array
|
266 |
*/
|
267 |
public function to_array() {
|
268 |
-
return
|
269 |
'message' => $this->message,
|
270 |
'options' => $this->options,
|
271 |
-
|
272 |
}
|
273 |
|
274 |
/**
|
@@ -286,12 +286,12 @@ class Yoast_Notification {
|
|
286 |
* @return string The rendered notification.
|
287 |
*/
|
288 |
public function render() {
|
289 |
-
$attributes =
|
290 |
|
291 |
// Default notification classes.
|
292 |
-
$classes =
|
293 |
'yoast-alert',
|
294 |
-
|
295 |
|
296 |
// Maintain WordPress visualisation of alerts when they are not persistent.
|
297 |
if ( ! $this->is_persistent() ) {
|
@@ -304,7 +304,7 @@ class Yoast_Notification {
|
|
304 |
}
|
305 |
|
306 |
// Combined attribute key and value into a string.
|
307 |
-
array_walk( $attributes,
|
308 |
|
309 |
$message = null;
|
310 |
if ( $this->options['yoast_branding'] ) {
|
@@ -367,8 +367,8 @@ class Yoast_Notification {
|
|
367 |
$options['priority'] = min( 1, max( 0, $options['priority'] ) );
|
368 |
|
369 |
// Set default capabilities when not supplied.
|
370 |
-
if ( empty( $options['capabilities'] ) ||
|
371 |
-
$options['capabilities'] =
|
372 |
}
|
373 |
|
374 |
return $options;
|
62 |
*
|
63 |
* @var array
|
64 |
*/
|
65 |
+
private $options = [];
|
66 |
|
67 |
/**
|
68 |
* Contains default values for the optional arguments.
|
69 |
*
|
70 |
* @var array
|
71 |
*/
|
72 |
+
private $defaults = [
|
73 |
'type' => self::UPDATED,
|
74 |
'id' => '',
|
75 |
'nonce' => null,
|
76 |
'priority' => 0.5,
|
77 |
+
'data_json' => [],
|
78 |
'dismissal_key' => null,
|
79 |
+
'capabilities' => [],
|
80 |
'capability_check' => self::MATCH_ALL,
|
81 |
'yoast_branding' => false,
|
82 |
+
];
|
83 |
|
84 |
/**
|
85 |
* The message for the notification.
|
94 |
* @param string $message Message string.
|
95 |
* @param array $options Set of options.
|
96 |
*/
|
97 |
+
public function __construct( $message, $options = [] ) {
|
98 |
$this->message = $message;
|
99 |
$this->options = $this->normalize_options( $options );
|
100 |
}
|
229 |
*/
|
230 |
$capability_check = apply_filters( 'wpseo_notification_capability_check', $this->options['capability_check'], $this );
|
231 |
|
232 |
+
if ( ! in_array( $capability_check, [ self::MATCH_ALL, self::MATCH_ANY ], true ) ) {
|
233 |
$capability_check = self::MATCH_ALL;
|
234 |
}
|
235 |
|
236 |
if ( ! empty( $capabilities ) ) {
|
237 |
|
238 |
+
$has_capabilities = array_filter( $capabilities, [ $this, 'has_capability' ] );
|
239 |
|
240 |
switch ( $capability_check ) {
|
241 |
case self::MATCH_ALL:
|
265 |
* @return array
|
266 |
*/
|
267 |
public function to_array() {
|
268 |
+
return [
|
269 |
'message' => $this->message,
|
270 |
'options' => $this->options,
|
271 |
+
];
|
272 |
}
|
273 |
|
274 |
/**
|
286 |
* @return string The rendered notification.
|
287 |
*/
|
288 |
public function render() {
|
289 |
+
$attributes = [];
|
290 |
|
291 |
// Default notification classes.
|
292 |
+
$classes = [
|
293 |
'yoast-alert',
|
294 |
+
];
|
295 |
|
296 |
// Maintain WordPress visualisation of alerts when they are not persistent.
|
297 |
if ( ! $this->is_persistent() ) {
|
304 |
}
|
305 |
|
306 |
// Combined attribute key and value into a string.
|
307 |
+
array_walk( $attributes, [ $this, 'parse_attributes' ] );
|
308 |
|
309 |
$message = null;
|
310 |
if ( $this->options['yoast_branding'] ) {
|
367 |
$options['priority'] = min( 1, max( 0, $options['priority'] ) );
|
368 |
|
369 |
// Set default capabilities when not supplied.
|
370 |
+
if ( empty( $options['capabilities'] ) || [] === $options['capabilities'] ) {
|
371 |
+
$options['capabilities'] = [ 'wpseo_manage_options' ];
|
372 |
}
|
373 |
|
374 |
return $options;
|
admin/class-yoast-plugin-conflict.php
CHANGED
@@ -18,14 +18,14 @@ class Yoast_Plugin_Conflict {
|
|
18 |
*
|
19 |
* @var array
|
20 |
*/
|
21 |
-
protected $plugins =
|
22 |
|
23 |
/**
|
24 |
* All the current active plugins will be stored in this private var.
|
25 |
*
|
26 |
* @var array
|
27 |
*/
|
28 |
-
protected $all_active_plugins =
|
29 |
|
30 |
/**
|
31 |
* After searching for active plugins that are in $this->plugins the active plugins will be stored in this
|
@@ -33,7 +33,7 @@ class Yoast_Plugin_Conflict {
|
|
33 |
*
|
34 |
* @var array
|
35 |
*/
|
36 |
-
protected $active_plugins =
|
37 |
|
38 |
/**
|
39 |
* Property for holding instance of itself.
|
@@ -93,7 +93,7 @@ class Yoast_Plugin_Conflict {
|
|
93 |
static $sections_checked;
|
94 |
|
95 |
if ( $sections_checked === null ) {
|
96 |
-
$sections_checked =
|
97 |
}
|
98 |
|
99 |
if ( ! in_array( $plugin_section, $sections_checked, true ) ) {
|
@@ -124,7 +124,7 @@ class Yoast_Plugin_Conflict {
|
|
124 |
// Getting the active plugins by given section.
|
125 |
$plugins = $this->active_plugins[ $plugin_section ];
|
126 |
|
127 |
-
$plugin_names =
|
128 |
foreach ( $plugins as $plugin ) {
|
129 |
$name = WPSEO_Utils::get_plugin_name( $plugin );
|
130 |
if ( ! empty( $name ) ) {
|
@@ -165,7 +165,7 @@ class Yoast_Plugin_Conflict {
|
|
165 |
$inactive_sections = array_diff( $all_plugin_sections, $sections );
|
166 |
if ( ! empty( $inactive_sections ) ) {
|
167 |
foreach ( $inactive_sections as $section ) {
|
168 |
-
array_walk( $this->plugins[ $section ],
|
169 |
}
|
170 |
}
|
171 |
|
@@ -179,7 +179,7 @@ class Yoast_Plugin_Conflict {
|
|
179 |
$inactive_plugins = array_diff( $this->plugins[ $section ], $this->active_plugins[ $section ] );
|
180 |
}
|
181 |
|
182 |
-
array_walk( $inactive_plugins,
|
183 |
}
|
184 |
}
|
185 |
|
@@ -211,10 +211,10 @@ class Yoast_Plugin_Conflict {
|
|
211 |
$notification_center->add_notification(
|
212 |
new Yoast_Notification(
|
213 |
$error_message,
|
214 |
-
|
215 |
'type' => Yoast_Notification::ERROR,
|
216 |
'id' => 'wpseo-conflict-' . $identifier,
|
217 |
-
|
218 |
)
|
219 |
);
|
220 |
}
|
@@ -280,7 +280,7 @@ class Yoast_Plugin_Conflict {
|
|
280 |
protected function add_active_plugin( $plugin_section, $plugin ) {
|
281 |
|
282 |
if ( ! array_key_exists( $plugin_section, $this->active_plugins ) ) {
|
283 |
-
$this->active_plugins[ $plugin_section ] =
|
284 |
}
|
285 |
|
286 |
if ( ! in_array( $plugin, $this->active_plugins[ $plugin_section ], true ) ) {
|
18 |
*
|
19 |
* @var array
|
20 |
*/
|
21 |
+
protected $plugins = [];
|
22 |
|
23 |
/**
|
24 |
* All the current active plugins will be stored in this private var.
|
25 |
*
|
26 |
* @var array
|
27 |
*/
|
28 |
+
protected $all_active_plugins = [];
|
29 |
|
30 |
/**
|
31 |
* After searching for active plugins that are in $this->plugins the active plugins will be stored in this
|
33 |
*
|
34 |
* @var array
|
35 |
*/
|
36 |
+
protected $active_plugins = [];
|
37 |
|
38 |
/**
|
39 |
* Property for holding instance of itself.
|
93 |
static $sections_checked;
|
94 |
|
95 |
if ( $sections_checked === null ) {
|
96 |
+
$sections_checked = [];
|
97 |
}
|
98 |
|
99 |
if ( ! in_array( $plugin_section, $sections_checked, true ) ) {
|
124 |
// Getting the active plugins by given section.
|
125 |
$plugins = $this->active_plugins[ $plugin_section ];
|
126 |
|
127 |
+
$plugin_names = [];
|
128 |
foreach ( $plugins as $plugin ) {
|
129 |
$name = WPSEO_Utils::get_plugin_name( $plugin );
|
130 |
if ( ! empty( $name ) ) {
|
165 |
$inactive_sections = array_diff( $all_plugin_sections, $sections );
|
166 |
if ( ! empty( $inactive_sections ) ) {
|
167 |
foreach ( $inactive_sections as $section ) {
|
168 |
+
array_walk( $this->plugins[ $section ], [ $this, 'clear_error' ] );
|
169 |
}
|
170 |
}
|
171 |
|
179 |
$inactive_plugins = array_diff( $this->plugins[ $section ], $this->active_plugins[ $section ] );
|
180 |
}
|
181 |
|
182 |
+
array_walk( $inactive_plugins, [ $this, 'clear_error' ] );
|
183 |
}
|
184 |
}
|
185 |
|
211 |
$notification_center->add_notification(
|
212 |
new Yoast_Notification(
|
213 |
$error_message,
|
214 |
+
[
|
215 |
'type' => Yoast_Notification::ERROR,
|
216 |
'id' => 'wpseo-conflict-' . $identifier,
|
217 |
+
]
|
218 |
)
|
219 |
);
|
220 |
}
|
280 |
protected function add_active_plugin( $plugin_section, $plugin ) {
|
281 |
|
282 |
if ( ! array_key_exists( $plugin_section, $this->active_plugins ) ) {
|
283 |
+
$this->active_plugins[ $plugin_section ] = [];
|
284 |
}
|
285 |
|
286 |
if ( ! in_array( $plugin, $this->active_plugins[ $plugin_section ], true ) ) {
|
admin/config-ui/class-configuration-components.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Configuration_Components {
|
|
15 |
*
|
16 |
* @var WPSEO_Config_Component[]
|
17 |
*/
|
18 |
-
protected $components =
|
19 |
|
20 |
/**
|
21 |
* Adapter.
|
@@ -65,14 +65,14 @@ class WPSEO_Configuration_Components {
|
|
65 |
foreach ( $this->components as $component ) {
|
66 |
$adapter->add_custom_lookup(
|
67 |
$component->get_field()->get_identifier(),
|
68 |
-
|
69 |
$component,
|
70 |
'get_data',
|
71 |
-
|
72 |
-
|
73 |
$component,
|
74 |
'set_data',
|
75 |
-
|
76 |
);
|
77 |
}
|
78 |
}
|
15 |
*
|
16 |
* @var WPSEO_Config_Component[]
|
17 |
*/
|
18 |
+
protected $components = [];
|
19 |
|
20 |
/**
|
21 |
* Adapter.
|
65 |
foreach ( $this->components as $component ) {
|
66 |
$adapter->add_custom_lookup(
|
67 |
$component->get_field()->get_identifier(),
|
68 |
+
[
|
69 |
$component,
|
70 |
'get_data',
|
71 |
+
],
|
72 |
+
[
|
73 |
$component,
|
74 |
'set_data',
|
75 |
+
]
|
76 |
);
|
77 |
}
|
78 |
}
|
admin/config-ui/class-configuration-endpoint.php
CHANGED
@@ -66,19 +66,19 @@ class WPSEO_Configuration_Endpoint {
|
|
66 |
*/
|
67 |
public function register() {
|
68 |
// Register fetch config.
|
69 |
-
$route_args =
|
70 |
'methods' => 'GET',
|
71 |
-
'callback' =>
|
72 |
-
'permission_callback' =>
|
73 |
-
|
74 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_RETRIEVE, $route_args );
|
75 |
|
76 |
// Register save changes.
|
77 |
-
$route_args =
|
78 |
'methods' => 'POST',
|
79 |
-
'callback' =>
|
80 |
-
'permission_callback' =>
|
81 |
-
|
82 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_STORE, $route_args );
|
83 |
}
|
84 |
|
66 |
*/
|
67 |
public function register() {
|
68 |
// Register fetch config.
|
69 |
+
$route_args = [
|
70 |
'methods' => 'GET',
|
71 |
+
'callback' => [ $this->service, 'get_configuration' ],
|
72 |
+
'permission_callback' => [ $this, 'can_retrieve_data' ],
|
73 |
+
];
|
74 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_RETRIEVE, $route_args );
|
75 |
|
76 |
// Register save changes.
|
77 |
+
$route_args = [
|
78 |
'methods' => 'POST',
|
79 |
+
'callback' => [ $this->service, 'set_configuration' ],
|
80 |
+
'permission_callback' => [ $this, 'can_save_data' ],
|
81 |
+
];
|
82 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_STORE, $route_args );
|
83 |
}
|
84 |
|
admin/config-ui/class-configuration-options-adapter.php
CHANGED
@@ -40,7 +40,7 @@ class WPSEO_Configuration_Options_Adapter {
|
|
40 |
*
|
41 |
* @var array
|
42 |
*/
|
43 |
-
protected $lookup =
|
44 |
|
45 |
/**
|
46 |
* Add a lookup for a WordPress native option.
|
@@ -96,7 +96,7 @@ class WPSEO_Configuration_Options_Adapter {
|
|
96 |
$this->add_lookup(
|
97 |
$class_name,
|
98 |
self::OPTION_TYPE_CUSTOM,
|
99 |
-
|
100 |
);
|
101 |
}
|
102 |
|
@@ -110,10 +110,10 @@ class WPSEO_Configuration_Options_Adapter {
|
|
110 |
* @throws Exception Thrown when invalid input is provided.
|
111 |
*/
|
112 |
protected function add_lookup( $class_name, $type, $option ) {
|
113 |
-
$this->lookup[ $class_name ] =
|
114 |
'type' => $type,
|
115 |
'option' => $option,
|
116 |
-
|
117 |
}
|
118 |
|
119 |
/**
|
40 |
*
|
41 |
* @var array
|
42 |
*/
|
43 |
+
protected $lookup = [];
|
44 |
|
45 |
/**
|
46 |
* Add a lookup for a WordPress native option.
|
96 |
$this->add_lookup(
|
97 |
$class_name,
|
98 |
self::OPTION_TYPE_CUSTOM,
|
99 |
+
[ $callback_get, $callback_set ]
|
100 |
);
|
101 |
}
|
102 |
|
110 |
* @throws Exception Thrown when invalid input is provided.
|
111 |
*/
|
112 |
protected function add_lookup( $class_name, $type, $option ) {
|
113 |
+
$this->lookup[ $class_name ] = [
|
114 |
'type' => $type,
|
115 |
'option' => $option,
|
116 |
+
];
|
117 |
}
|
118 |
|
119 |
/**
|
admin/config-ui/class-configuration-page.php
CHANGED
@@ -30,9 +30,9 @@ class WPSEO_Configuration_Page {
|
|
30 |
}
|
31 |
|
32 |
// Register the page for the wizard.
|
33 |
-
add_action( 'admin_menu',
|
34 |
-
add_action( 'admin_enqueue_scripts',
|
35 |
-
add_action( 'admin_init',
|
36 |
}
|
37 |
|
38 |
/**
|
@@ -170,7 +170,7 @@ class WPSEO_Configuration_Page {
|
|
170 |
* @return array The API endpoint config.
|
171 |
*/
|
172 |
public function get_config() {
|
173 |
-
$config =
|
174 |
'namespace' => WPSEO_Configuration_Endpoint::REST_NAMESPACE,
|
175 |
'endpoint_retrieve' => WPSEO_Configuration_Endpoint::ENDPOINT_RETRIEVE,
|
176 |
'endpoint_store' => WPSEO_Configuration_Endpoint::ENDPOINT_STORE,
|
@@ -178,7 +178,7 @@ class WPSEO_Configuration_Page {
|
|
178 |
'root' => esc_url_raw( rest_url() ),
|
179 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
180 |
'finishUrl' => admin_url( 'admin.php?page=wpseo_dashboard&configuration=finished' ),
|
181 |
-
|
182 |
|
183 |
return $config;
|
184 |
}
|
@@ -226,12 +226,12 @@ class WPSEO_Configuration_Page {
|
|
226 |
|
227 |
$notification = new Yoast_Notification(
|
228 |
$message,
|
229 |
-
|
230 |
'type' => Yoast_Notification::WARNING,
|
231 |
'id' => 'wpseo-dismiss-onboarding-notice',
|
232 |
'capabilities' => 'wpseo_manage_options',
|
233 |
'priority' => 0.8,
|
234 |
-
|
235 |
);
|
236 |
|
237 |
return $notification;
|
30 |
}
|
31 |
|
32 |
// Register the page for the wizard.
|
33 |
+
add_action( 'admin_menu', [ $this, 'add_wizard_page' ] );
|
34 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
35 |
+
add_action( 'admin_init', [ $this, 'render_wizard_page' ] );
|
36 |
}
|
37 |
|
38 |
/**
|
170 |
* @return array The API endpoint config.
|
171 |
*/
|
172 |
public function get_config() {
|
173 |
+
$config = [
|
174 |
'namespace' => WPSEO_Configuration_Endpoint::REST_NAMESPACE,
|
175 |
'endpoint_retrieve' => WPSEO_Configuration_Endpoint::ENDPOINT_RETRIEVE,
|
176 |
'endpoint_store' => WPSEO_Configuration_Endpoint::ENDPOINT_STORE,
|
178 |
'root' => esc_url_raw( rest_url() ),
|
179 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
180 |
'finishUrl' => admin_url( 'admin.php?page=wpseo_dashboard&configuration=finished' ),
|
181 |
+
];
|
182 |
|
183 |
return $config;
|
184 |
}
|
226 |
|
227 |
$notification = new Yoast_Notification(
|
228 |
$message,
|
229 |
+
[
|
230 |
'type' => Yoast_Notification::WARNING,
|
231 |
'id' => 'wpseo-dismiss-onboarding-notice',
|
232 |
'capabilities' => 'wpseo_manage_options',
|
233 |
'priority' => 0.8,
|
234 |
+
]
|
235 |
);
|
236 |
|
237 |
return $notification;
|
admin/config-ui/class-configuration-service.php
CHANGED
@@ -162,11 +162,11 @@ class WPSEO_Configuration_Service {
|
|
162 |
$steps = $this->structure->retrieve();
|
163 |
$translations = $this->translations->retrieve();
|
164 |
|
165 |
-
return
|
166 |
'fields' => $fields,
|
167 |
'steps' => $steps,
|
168 |
'translations' => $translations,
|
169 |
-
|
170 |
}
|
171 |
|
172 |
/**
|
162 |
$steps = $this->structure->retrieve();
|
163 |
$translations = $this->translations->retrieve();
|
164 |
|
165 |
+
return [
|
166 |
'fields' => $fields,
|
167 |
'steps' => $steps,
|
168 |
'translations' => $translations,
|
169 |
+
];
|
170 |
}
|
171 |
|
172 |
/**
|
admin/config-ui/class-configuration-storage.php
CHANGED
@@ -22,13 +22,13 @@ class WPSEO_Configuration_Storage {
|
|
22 |
*
|
23 |
* @var \WPSEO_Config_Field[]
|
24 |
*/
|
25 |
-
protected $fields =
|
26 |
|
27 |
/**
|
28 |
* Add default fields.
|
29 |
*/
|
30 |
public function add_default_fields() {
|
31 |
-
$fields =
|
32 |
new WPSEO_Config_Field_Upsell_Configuration_Service(),
|
33 |
new WPSEO_Config_Field_Upsell_Site_Review(),
|
34 |
new WPSEO_Config_Field_Success_Message(),
|
@@ -53,7 +53,7 @@ class WPSEO_Configuration_Storage {
|
|
53 |
new WPSEO_Config_Field_Company_Logo(),
|
54 |
new WPSEO_Config_Field_Person(),
|
55 |
new WPSEO_Config_Field_Post_Type_Visibility(),
|
56 |
-
|
57 |
|
58 |
$post_type_factory = new WPSEO_Config_Factory_Post_Type();
|
59 |
$fields = array_merge( $fields, $post_type_factory->get_fields() );
|
@@ -104,7 +104,7 @@ class WPSEO_Configuration_Storage {
|
|
104 |
* @returns array List of settings.
|
105 |
*/
|
106 |
public function retrieve() {
|
107 |
-
$output =
|
108 |
|
109 |
foreach ( $this->fields as $field ) {
|
110 |
|
@@ -129,7 +129,7 @@ class WPSEO_Configuration_Storage {
|
|
129 |
* @return string Results
|
130 |
*/
|
131 |
public function store( $data_to_store ) {
|
132 |
-
$output =
|
133 |
|
134 |
foreach ( $this->fields as $field ) {
|
135 |
|
@@ -139,16 +139,16 @@ class WPSEO_Configuration_Storage {
|
|
139 |
continue;
|
140 |
}
|
141 |
|
142 |
-
$field_data =
|
143 |
if ( isset( $data_to_store[ $field_identifier ] ) ) {
|
144 |
$field_data = $data_to_store[ $field_identifier ];
|
145 |
}
|
146 |
|
147 |
$result = $this->adapter->set( $field, $field_data );
|
148 |
|
149 |
-
$build =
|
150 |
'result' => $result,
|
151 |
-
|
152 |
|
153 |
// Set current data to object to be displayed.
|
154 |
$data = $this->get_field_data( $field );
|
@@ -187,7 +187,7 @@ class WPSEO_Configuration_Storage {
|
|
187 |
$defaults = $field->get_data();
|
188 |
|
189 |
// Remove 'null' values from input.
|
190 |
-
$data = array_filter( $data,
|
191 |
|
192 |
// Merge defaults with data.
|
193 |
$data = array_merge( $defaults, $data );
|
22 |
*
|
23 |
* @var \WPSEO_Config_Field[]
|
24 |
*/
|
25 |
+
protected $fields = [];
|
26 |
|
27 |
/**
|
28 |
* Add default fields.
|
29 |
*/
|
30 |
public function add_default_fields() {
|
31 |
+
$fields = [
|
32 |
new WPSEO_Config_Field_Upsell_Configuration_Service(),
|
33 |
new WPSEO_Config_Field_Upsell_Site_Review(),
|
34 |
new WPSEO_Config_Field_Success_Message(),
|
53 |
new WPSEO_Config_Field_Company_Logo(),
|
54 |
new WPSEO_Config_Field_Person(),
|
55 |
new WPSEO_Config_Field_Post_Type_Visibility(),
|
56 |
+
];
|
57 |
|
58 |
$post_type_factory = new WPSEO_Config_Factory_Post_Type();
|
59 |
$fields = array_merge( $fields, $post_type_factory->get_fields() );
|
104 |
* @returns array List of settings.
|
105 |
*/
|
106 |
public function retrieve() {
|
107 |
+
$output = [];
|
108 |
|
109 |
foreach ( $this->fields as $field ) {
|
110 |
|
129 |
* @return string Results
|
130 |
*/
|
131 |
public function store( $data_to_store ) {
|
132 |
+
$output = [];
|
133 |
|
134 |
foreach ( $this->fields as $field ) {
|
135 |
|
139 |
continue;
|
140 |
}
|
141 |
|
142 |
+
$field_data = [];
|
143 |
if ( isset( $data_to_store[ $field_identifier ] ) ) {
|
144 |
$field_data = $data_to_store[ $field_identifier ];
|
145 |
}
|
146 |
|
147 |
$result = $this->adapter->set( $field, $field_data );
|
148 |
|
149 |
+
$build = [
|
150 |
'result' => $result,
|
151 |
+
];
|
152 |
|
153 |
// Set current data to object to be displayed.
|
154 |
$data = $this->get_field_data( $field );
|
187 |
$defaults = $field->get_data();
|
188 |
|
189 |
// Remove 'null' values from input.
|
190 |
+
$data = array_filter( $data, [ $this, 'is_not_null' ] );
|
191 |
|
192 |
// Merge defaults with data.
|
193 |
$data = array_merge( $defaults, $data );
|
admin/config-ui/class-configuration-structure.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Configuration_Structure {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $steps =
|
19 |
|
20 |
/**
|
21 |
* List of fields for each configuration step.
|
@@ -25,10 +25,10 @@ class WPSEO_Configuration_Structure {
|
|
25 |
*
|
26 |
* @var array
|
27 |
*/
|
28 |
-
private $fields =
|
29 |
-
'environment_type' =>
|
30 |
-
'siteType' =>
|
31 |
-
'publishingEntity' =>
|
32 |
'publishingEntity',
|
33 |
'publishingEntityType',
|
34 |
'publishingEntityCompanyInfo',
|
@@ -43,19 +43,19 @@ class WPSEO_Configuration_Structure {
|
|
43 |
'profileUrlPinterest',
|
44 |
'profileUrlYouTube',
|
45 |
'profileUrlWikipedia',
|
46 |
-
|
47 |
-
'multipleAuthors' =>
|
48 |
-
'titleTemplate' =>
|
49 |
'titleIntro',
|
50 |
'siteName',
|
51 |
'separator',
|
52 |
-
|
53 |
-
'newsletter' =>
|
54 |
'mailchimpSignup',
|
55 |
'suggestions',
|
56 |
-
|
57 |
-
'success' =>
|
58 |
-
|
59 |
|
60 |
/**
|
61 |
* WPSEO_Configuration_Structure constructor.
|
@@ -69,7 +69,7 @@ class WPSEO_Configuration_Structure {
|
|
69 |
$this->fields['publishingEntity']
|
70 |
);
|
71 |
|
72 |
-
$fields =
|
73 |
|
74 |
$post_type_factory = new WPSEO_Config_Factory_Post_Type();
|
75 |
foreach ( $post_type_factory->get_fields() as $post_type_field ) {
|
@@ -98,12 +98,12 @@ class WPSEO_Configuration_Structure {
|
|
98 |
* @param bool $full_width Wheter the step content is full width or not.
|
99 |
*/
|
100 |
protected function add_step( $identifier, $title, $fields, $navigation = true, $full_width = false ) {
|
101 |
-
$this->steps[ $identifier ] =
|
102 |
'title' => $title,
|
103 |
'fields' => $fields,
|
104 |
'hideNavigation' => ! (bool) $navigation,
|
105 |
'fullWidth' => $full_width,
|
106 |
-
|
107 |
}
|
108 |
|
109 |
/**
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $steps = [];
|
19 |
|
20 |
/**
|
21 |
* List of fields for each configuration step.
|
25 |
*
|
26 |
* @var array
|
27 |
*/
|
28 |
+
private $fields = [
|
29 |
+
'environment_type' => [ 'environment_type' ],
|
30 |
+
'siteType' => [ 'siteType' ],
|
31 |
+
'publishingEntity' => [
|
32 |
'publishingEntity',
|
33 |
'publishingEntityType',
|
34 |
'publishingEntityCompanyInfo',
|
43 |
'profileUrlPinterest',
|
44 |
'profileUrlYouTube',
|
45 |
'profileUrlWikipedia',
|
46 |
+
],
|
47 |
+
'multipleAuthors' => [ 'multipleAuthors' ],
|
48 |
+
'titleTemplate' => [
|
49 |
'titleIntro',
|
50 |
'siteName',
|
51 |
'separator',
|
52 |
+
],
|
53 |
+
'newsletter' => [
|
54 |
'mailchimpSignup',
|
55 |
'suggestions',
|
56 |
+
],
|
57 |
+
'success' => [ 'successMessage' ],
|
58 |
+
];
|
59 |
|
60 |
/**
|
61 |
* WPSEO_Configuration_Structure constructor.
|
69 |
$this->fields['publishingEntity']
|
70 |
);
|
71 |
|
72 |
+
$fields = [ 'postTypeVisibility' ];
|
73 |
|
74 |
$post_type_factory = new WPSEO_Config_Factory_Post_Type();
|
75 |
foreach ( $post_type_factory->get_fields() as $post_type_field ) {
|
98 |
* @param bool $full_width Wheter the step content is full width or not.
|
99 |
*/
|
100 |
protected function add_step( $identifier, $title, $fields, $navigation = true, $full_width = false ) {
|
101 |
+
$this->steps[ $identifier ] = [
|
102 |
'title' => $title,
|
103 |
'fields' => $fields,
|
104 |
'hideNavigation' => ! (bool) $navigation,
|
105 |
'fullWidth' => $full_width,
|
106 |
+
];
|
107 |
}
|
108 |
|
109 |
/**
|
admin/config-ui/class-configuration-translations.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Configuration_Translations {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $translations =
|
19 |
|
20 |
/**
|
21 |
* The locale.
|
@@ -58,6 +58,6 @@ class WPSEO_Configuration_Translations {
|
|
58 |
}
|
59 |
}
|
60 |
|
61 |
-
return
|
62 |
}
|
63 |
}
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $translations = [];
|
19 |
|
20 |
/**
|
21 |
* The locale.
|
58 |
}
|
59 |
}
|
60 |
|
61 |
+
return [];
|
62 |
}
|
63 |
}
|
admin/config-ui/components/class-component-mailchimp-signup.php
CHANGED
@@ -41,9 +41,9 @@ class WPSEO_Config_Component_Mailchimp_Signup implements WPSEO_Config_Component
|
|
41 |
* @return mixed
|
42 |
*/
|
43 |
public function get_data() {
|
44 |
-
$data =
|
45 |
'hasSignup' => $this->has_mailchimp_signup(),
|
46 |
-
|
47 |
|
48 |
return $data;
|
49 |
}
|
@@ -66,9 +66,9 @@ class WPSEO_Config_Component_Mailchimp_Signup implements WPSEO_Config_Component
|
|
66 |
}
|
67 |
|
68 |
// Collect results to return to the configurator.
|
69 |
-
$results =
|
70 |
'hasSignup' => $has_saved,
|
71 |
-
|
72 |
|
73 |
return $results;
|
74 |
}
|
41 |
* @return mixed
|
42 |
*/
|
43 |
public function get_data() {
|
44 |
+
$data = [
|
45 |
'hasSignup' => $this->has_mailchimp_signup(),
|
46 |
+
];
|
47 |
|
48 |
return $data;
|
49 |
}
|
66 |
}
|
67 |
|
68 |
// Collect results to return to the configurator.
|
69 |
+
$results = [
|
70 |
'hasSignup' => $has_saved,
|
71 |
+
];
|
72 |
|
73 |
return $results;
|
74 |
}
|
admin/config-ui/components/class-component-suggestions.php
CHANGED
@@ -34,19 +34,19 @@ class WPSEO_Config_Component_Suggestions implements WPSEO_Config_Component {
|
|
34 |
sprintf( __( 'Outrank the competition with %s', 'wordpress-seo' ), 'Yoast SEO Premium' ),
|
35 |
/* translators: %1$s resolves to Yoast SEO Premium */
|
36 |
sprintf( __( 'Do you want to outrank your competition? %1$s gives you awesome additional features that\'ll help you to set up your SEO strategy like a professional. Add synonyms and related keywords, use our Premium SEO analysis, the redirect manager and our internal linking tool. %1$s will also give you access to premium support.', 'wordpress-seo' ), 'Yoast SEO Premium' ),
|
37 |
-
|
38 |
'label' => __( 'Upgrade to Premium', 'wordpress-seo' ),
|
39 |
'type' => 'primary',
|
40 |
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/wizard-suggestion-premium' ),
|
41 |
-
|
42 |
-
|
43 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/video-yoast-seo-premium' ),
|
44 |
'title' => sprintf(
|
45 |
/* translators: %1$s expands to Yoast SEO Premium. */
|
46 |
__( '%1$s video', 'wordpress-seo' ),
|
47 |
'Yoast SEO Premium'
|
48 |
),
|
49 |
-
|
50 |
);
|
51 |
}
|
52 |
|
@@ -57,19 +57,19 @@ class WPSEO_Config_Component_Suggestions implements WPSEO_Config_Component {
|
|
57 |
__( 'Keyword research is essential in any SEO strategy. You decide the search terms you want to be found for, and figure out what words your audience uses to find you. Great keyword research tells you what content you need to start ranking for the terms you want to rank for. Make sure your efforts go into the keywords you actually have a chance at ranking for! The %1$s walks you through this process, step by step.', 'wordpress-seo' ),
|
58 |
'Keyword research training'
|
59 |
),
|
60 |
-
|
61 |
'label' => 'Keyword research training',
|
62 |
'type' => 'link',
|
63 |
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/3lg' ),
|
64 |
-
|
65 |
-
|
66 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/3lf' ),
|
67 |
'title' => sprintf(
|
68 |
/* translators: %1$s expands to Keyword research training. */
|
69 |
__( '%1$s video', 'wordpress-seo' ),
|
70 |
'Keyword research training'
|
71 |
),
|
72 |
-
|
73 |
);
|
74 |
|
75 |
// When we are running in Yoast SEO Premium and don't have Local SEO installed, show Local SEO as suggestion.
|
@@ -78,19 +78,19 @@ class WPSEO_Config_Component_Suggestions implements WPSEO_Config_Component {
|
|
78 |
__( 'Attract more customers near you', 'wordpress-seo' ),
|
79 |
/* translators: %1$s resolves to Local SEO */
|
80 |
sprintf( __( 'If you want to outrank the competition in a specific town or region, check out our %1$s plugin! You’ll be able to easily insert Google maps, opening hours, contact information and a store locator. Besides that %1$s helps you to improve the usability of your contact page.', 'wordpress-seo' ), 'Local SEO' ),
|
81 |
-
|
82 |
'label' => 'Local SEO',
|
83 |
'type' => 'link',
|
84 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/wizard-suggestion-localseo' ),
|
85 |
-
|
86 |
-
|
87 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/video-localseo' ),
|
88 |
'title' => sprintf(
|
89 |
/* translators: %1$s expands to Local SEO. */
|
90 |
__( '%1$s video', 'wordpress-seo' ),
|
91 |
'Local SEO'
|
92 |
),
|
93 |
-
|
94 |
);
|
95 |
}
|
96 |
|
@@ -103,7 +103,7 @@ class WPSEO_Config_Component_Suggestions implements WPSEO_Config_Component {
|
|
103 |
* @return array
|
104 |
*/
|
105 |
public function get_data() {
|
106 |
-
return
|
107 |
}
|
108 |
|
109 |
/**
|
34 |
sprintf( __( 'Outrank the competition with %s', 'wordpress-seo' ), 'Yoast SEO Premium' ),
|
35 |
/* translators: %1$s resolves to Yoast SEO Premium */
|
36 |
sprintf( __( 'Do you want to outrank your competition? %1$s gives you awesome additional features that\'ll help you to set up your SEO strategy like a professional. Add synonyms and related keywords, use our Premium SEO analysis, the redirect manager and our internal linking tool. %1$s will also give you access to premium support.', 'wordpress-seo' ), 'Yoast SEO Premium' ),
|
37 |
+
[
|
38 |
'label' => __( 'Upgrade to Premium', 'wordpress-seo' ),
|
39 |
'type' => 'primary',
|
40 |
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/wizard-suggestion-premium' ),
|
41 |
+
],
|
42 |
+
[
|
43 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/video-yoast-seo-premium' ),
|
44 |
'title' => sprintf(
|
45 |
/* translators: %1$s expands to Yoast SEO Premium. */
|
46 |
__( '%1$s video', 'wordpress-seo' ),
|
47 |
'Yoast SEO Premium'
|
48 |
),
|
49 |
+
]
|
50 |
);
|
51 |
}
|
52 |
|
57 |
__( 'Keyword research is essential in any SEO strategy. You decide the search terms you want to be found for, and figure out what words your audience uses to find you. Great keyword research tells you what content you need to start ranking for the terms you want to rank for. Make sure your efforts go into the keywords you actually have a chance at ranking for! The %1$s walks you through this process, step by step.', 'wordpress-seo' ),
|
58 |
'Keyword research training'
|
59 |
),
|
60 |
+
[
|
61 |
'label' => 'Keyword research training',
|
62 |
'type' => 'link',
|
63 |
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/3lg' ),
|
64 |
+
],
|
65 |
+
[
|
66 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/3lf' ),
|
67 |
'title' => sprintf(
|
68 |
/* translators: %1$s expands to Keyword research training. */
|
69 |
__( '%1$s video', 'wordpress-seo' ),
|
70 |
'Keyword research training'
|
71 |
),
|
72 |
+
]
|
73 |
);
|
74 |
|
75 |
// When we are running in Yoast SEO Premium and don't have Local SEO installed, show Local SEO as suggestion.
|
78 |
__( 'Attract more customers near you', 'wordpress-seo' ),
|
79 |
/* translators: %1$s resolves to Local SEO */
|
80 |
sprintf( __( 'If you want to outrank the competition in a specific town or region, check out our %1$s plugin! You’ll be able to easily insert Google maps, opening hours, contact information and a store locator. Besides that %1$s helps you to improve the usability of your contact page.', 'wordpress-seo' ), 'Local SEO' ),
|
81 |
+
[
|
82 |
'label' => 'Local SEO',
|
83 |
'type' => 'link',
|
84 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/wizard-suggestion-localseo' ),
|
85 |
+
],
|
86 |
+
[
|
87 |
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/video-localseo' ),
|
88 |
'title' => sprintf(
|
89 |
/* translators: %1$s expands to Local SEO. */
|
90 |
__( '%1$s video', 'wordpress-seo' ),
|
91 |
'Local SEO'
|
92 |
),
|
93 |
+
]
|
94 |
);
|
95 |
}
|
96 |
|
103 |
* @return array
|
104 |
*/
|
105 |
public function get_data() {
|
106 |
+
return [];
|
107 |
}
|
108 |
|
109 |
/**
|
admin/config-ui/factories/class-factory-post-type.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Config_Factory_Post_Type {
|
|
15 |
*
|
16 |
* @var WPSEO_Config_Field_Choice_Post_Type[]
|
17 |
*/
|
18 |
-
protected static $fields =
|
19 |
|
20 |
/**
|
21 |
* Retrieves a list of fields.
|
@@ -26,10 +26,10 @@ class WPSEO_Config_Factory_Post_Type {
|
|
26 |
|
27 |
if ( empty( self::$fields ) ) {
|
28 |
|
29 |
-
$fields =
|
30 |
|
31 |
// WPSEO_Post_type::get_accessible_post_types() should *not* be used to get a similar experience from the settings.
|
32 |
-
$post_types = get_post_types(
|
33 |
$post_types = WPSEO_Post_Type::filter_attachment_post_type( $post_types );
|
34 |
if ( ! empty( $post_types ) ) {
|
35 |
foreach ( $post_types as $post_type => $post_type_object ) {
|
15 |
*
|
16 |
* @var WPSEO_Config_Field_Choice_Post_Type[]
|
17 |
*/
|
18 |
+
protected static $fields = [];
|
19 |
|
20 |
/**
|
21 |
* Retrieves a list of fields.
|
26 |
|
27 |
if ( empty( self::$fields ) ) {
|
28 |
|
29 |
+
$fields = [];
|
30 |
|
31 |
// WPSEO_Post_type::get_accessible_post_types() should *not* be used to get a similar experience from the settings.
|
32 |
+
$post_types = get_post_types( [ 'public' => true ], 'objects' );
|
33 |
$post_types = WPSEO_Post_Type::filter_attachment_post_type( $post_types );
|
34 |
if ( ! empty( $post_types ) ) {
|
35 |
foreach ( $post_types as $post_type => $post_type_object ) {
|
admin/config-ui/fields/class-field-choice-post-type.php
CHANGED
@@ -43,8 +43,8 @@ class WPSEO_Config_Field_Choice_Post_Type extends WPSEO_Config_Field_Choice {
|
|
43 |
public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
|
44 |
$adapter->add_custom_lookup(
|
45 |
$this->get_identifier(),
|
46 |
-
|
47 |
-
|
48 |
);
|
49 |
}
|
50 |
|
43 |
public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
|
44 |
$adapter->add_custom_lookup(
|
45 |
$this->get_identifier(),
|
46 |
+
[ $this, 'get_data' ],
|
47 |
+
[ $this, 'set_data' ]
|
48 |
);
|
49 |
}
|
50 |
|
admin/config-ui/fields/class-field-choice.php
CHANGED
@@ -18,7 +18,7 @@ class WPSEO_Config_Field_Choice extends WPSEO_Config_Field {
|
|
18 |
public function __construct( $field ) {
|
19 |
parent::__construct( $field, 'Choice' );
|
20 |
|
21 |
-
$this->properties['choices'] =
|
22 |
}
|
23 |
|
24 |
/**
|
@@ -29,9 +29,9 @@ class WPSEO_Config_Field_Choice extends WPSEO_Config_Field {
|
|
29 |
* @param string $aria_label Optional. Aria label text to use.
|
30 |
*/
|
31 |
public function add_choice( $value, $label, $aria_label = '' ) {
|
32 |
-
$choice =
|
33 |
'label' => $label,
|
34 |
-
|
35 |
|
36 |
if ( $aria_label ) {
|
37 |
$choice['screenReaderText'] = $aria_label;
|
18 |
public function __construct( $field ) {
|
19 |
parent::__construct( $field, 'Choice' );
|
20 |
|
21 |
+
$this->properties['choices'] = [];
|
22 |
}
|
23 |
|
24 |
/**
|
29 |
* @param string $aria_label Optional. Aria label text to use.
|
30 |
*/
|
31 |
public function add_choice( $value, $label, $aria_label = '' ) {
|
32 |
+
$choice = [
|
33 |
'label' => $label,
|
34 |
+
];
|
35 |
|
36 |
if ( $aria_label ) {
|
37 |
$choice['screenReaderText'] = $aria_label;
|
admin/config-ui/fields/class-field-environment.php
CHANGED
@@ -32,8 +32,8 @@ class WPSEO_Config_Field_Environment extends WPSEO_Config_Field_Choice {
|
|
32 |
public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
|
33 |
$adapter->add_custom_lookup(
|
34 |
$this->get_identifier(),
|
35 |
-
|
36 |
-
|
37 |
);
|
38 |
}
|
39 |
|
32 |
public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
|
33 |
$adapter->add_custom_lookup(
|
34 |
$this->get_identifier(),
|
35 |
+
[ $this, 'get_data' ],
|
36 |
+
[ $this, 'set_data' ]
|
37 |
);
|
38 |
}
|
39 |
|
admin/config-ui/fields/class-field-mailchimp-signup.php
CHANGED
@@ -48,9 +48,9 @@ class WPSEO_Config_Field_Mailchimp_Signup extends WPSEO_Config_Field {
|
|
48 |
* @return array
|
49 |
*/
|
50 |
public function get_data() {
|
51 |
-
return
|
52 |
'hasSignup' => $this->has_mailchimp_signup(),
|
53 |
-
|
54 |
}
|
55 |
|
56 |
/**
|
48 |
* @return array
|
49 |
*/
|
50 |
public function get_data() {
|
51 |
+
return [
|
52 |
'hasSignup' => $this->has_mailchimp_signup(),
|
53 |
+
];
|
54 |
}
|
55 |
|
56 |
/**
|
admin/config-ui/fields/class-field-multiple-authors.php
CHANGED
@@ -32,8 +32,8 @@ class WPSEO_Config_Field_Multiple_Authors extends WPSEO_Config_Field_Choice {
|
|
32 |
public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
|
33 |
$adapter->add_custom_lookup(
|
34 |
$this->get_identifier(),
|
35 |
-
|
36 |
-
|
37 |
);
|
38 |
}
|
39 |
|
@@ -50,10 +50,10 @@ class WPSEO_Config_Field_Multiple_Authors extends WPSEO_Config_Field_Choice {
|
|
50 |
|
51 |
if ( ! isset( $value ) || is_null( $value ) ) {
|
52 |
// If there are more than one users with level > 1 default to multiple authors.
|
53 |
-
$user_criteria =
|
54 |
'fields' => 'IDs',
|
55 |
'who' => 'authors',
|
56 |
-
|
57 |
$users = get_users( $user_criteria );
|
58 |
|
59 |
$value = count( $users ) > 1;
|
32 |
public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
|
33 |
$adapter->add_custom_lookup(
|
34 |
$this->get_identifier(),
|
35 |
+
[ $this, 'get_data' ],
|
36 |
+
[ $this, 'set_data' ]
|
37 |
);
|
38 |
}
|
39 |
|
50 |
|
51 |
if ( ! isset( $value ) || is_null( $value ) ) {
|
52 |
// If there are more than one users with level > 1 default to multiple authors.
|
53 |
+
$user_criteria = [
|
54 |
'fields' => 'IDs',
|
55 |
'who' => 'authors',
|
56 |
+
];
|
57 |
$users = get_users( $user_criteria );
|
58 |
|
59 |
$value = count( $users ) > 1;
|
admin/config-ui/fields/class-field-site-name.php
CHANGED
@@ -29,8 +29,8 @@ class WPSEO_Config_Field_Site_Name extends WPSEO_Config_Field {
|
|
29 |
public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
|
30 |
$adapter->add_custom_lookup(
|
31 |
$this->get_identifier(),
|
32 |
-
|
33 |
-
|
34 |
);
|
35 |
}
|
36 |
|
29 |
public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
|
30 |
$adapter->add_custom_lookup(
|
31 |
$this->get_identifier(),
|
32 |
+
[ $this, 'get_data' ],
|
33 |
+
[ $this, 'set_data' ]
|
34 |
);
|
35 |
}
|
36 |
|
admin/config-ui/fields/class-field-success-message.php
CHANGED
@@ -28,10 +28,10 @@ class WPSEO_Config_Field_Success_Message extends WPSEO_Config_Field {
|
|
28 |
|
29 |
/* translators: %1$s expands to Yoast SEO. */
|
30 |
$img_alt = __( '%1$s video tutorial', 'wordpress-seo' );
|
31 |
-
$img_args =
|
32 |
'src' => plugin_dir_url( WPSEO_FILE ) . ( 'images/Yoast_Academy_video.png' ),
|
33 |
'alt' => sprintf( $img_alt, 'Yoast SEO' ),
|
34 |
-
|
35 |
|
36 |
$this->set_property( 'image', $img_args );
|
37 |
}
|
28 |
|
29 |
/* translators: %1$s expands to Yoast SEO. */
|
30 |
$img_alt = __( '%1$s video tutorial', 'wordpress-seo' );
|
31 |
+
$img_args = [
|
32 |
'src' => plugin_dir_url( WPSEO_FILE ) . ( 'images/Yoast_Academy_video.png' ),
|
33 |
'alt' => sprintf( $img_alt, 'Yoast SEO' ),
|
34 |
+
];
|
35 |
|
36 |
$this->set_property( 'image', $img_args );
|
37 |
}
|
admin/config-ui/fields/class-field-suggestions.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_Config_Field_Suggestions extends WPSEO_Config_Field {
|
|
16 |
public function __construct() {
|
17 |
parent::__construct( 'suggestions', 'Suggestions' );
|
18 |
|
19 |
-
$this->properties['suggestions'] =
|
20 |
}
|
21 |
|
22 |
/**
|
@@ -27,12 +27,12 @@ class WPSEO_Config_Field_Suggestions extends WPSEO_Config_Field {
|
|
27 |
* @param array $button The button details.
|
28 |
* @param array $video URL and title of the video accompanying the choice.
|
29 |
*/
|
30 |
-
public function add_suggestion( $title, $copy, $button, array $video =
|
31 |
-
$suggestion =
|
32 |
'title' => $title,
|
33 |
'copy' => $copy,
|
34 |
'button' => $button,
|
35 |
-
|
36 |
|
37 |
if ( ! empty( $video ) ) {
|
38 |
$suggestion['video'] = $video;
|
16 |
public function __construct() {
|
17 |
parent::__construct( 'suggestions', 'Suggestions' );
|
18 |
|
19 |
+
$this->properties['suggestions'] = [];
|
20 |
}
|
21 |
|
22 |
/**
|
27 |
* @param array $button The button details.
|
28 |
* @param array $video URL and title of the video accompanying the choice.
|
29 |
*/
|
30 |
+
public function add_suggestion( $title, $copy, $button, array $video = [] ) {
|
31 |
+
$suggestion = [
|
32 |
'title' => $title,
|
33 |
'copy' => $copy,
|
34 |
'button' => $button,
|
35 |
+
];
|
36 |
|
37 |
if ( ! empty( $video ) ) {
|
38 |
$suggestion['video'] = $video;
|
admin/config-ui/fields/class-field-upsell-configuration-service.php
CHANGED
@@ -15,12 +15,12 @@ class WPSEO_Config_Field_Upsell_Configuration_Service extends WPSEO_Config_Field
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
private $allowed_html =
|
19 |
-
'a' =>
|
20 |
-
'href' =>
|
21 |
-
'target' =>
|
22 |
-
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* WPSEO_Config_Field_Upsell_Configuration_Service constructor.
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
private $allowed_html = [
|
19 |
+
'a' => [
|
20 |
+
'href' => [],
|
21 |
+
'target' => [ '_blank' ],
|
22 |
+
],
|
23 |
+
];
|
24 |
|
25 |
/**
|
26 |
* WPSEO_Config_Field_Upsell_Configuration_Service constructor.
|
admin/config-ui/fields/class-field-upsell-site-review.php
CHANGED
@@ -15,12 +15,12 @@ class WPSEO_Config_Field_Upsell_Site_Review extends WPSEO_Config_Field {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
private $allowed_html =
|
19 |
-
'a' =>
|
20 |
-
'href' =>
|
21 |
-
'target' =>
|
22 |
-
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* WPSEO_Config_Field_Upsell_Site_Review constructor.
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
private $allowed_html = [
|
19 |
+
'a' => [
|
20 |
+
'href' => [],
|
21 |
+
'target' => [ '_blank' ],
|
22 |
+
],
|
23 |
+
];
|
24 |
|
25 |
/**
|
26 |
* WPSEO_Config_Field_Upsell_Site_Review constructor.
|
admin/config-ui/fields/class-field.php
CHANGED
@@ -29,21 +29,21 @@ class WPSEO_Config_Field {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $properties =
|
33 |
|
34 |
/**
|
35 |
* Field requirements.
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
-
protected $requires =
|
40 |
|
41 |
/**
|
42 |
* Value of this field.
|
43 |
*
|
44 |
* @var array|mixed
|
45 |
*/
|
46 |
-
protected $data =
|
47 |
|
48 |
/**
|
49 |
* WPSEO_Config_Field constructor.
|
@@ -108,9 +108,9 @@ class WPSEO_Config_Field {
|
|
108 |
* @return array
|
109 |
*/
|
110 |
public function to_array() {
|
111 |
-
$output =
|
112 |
'componentName' => $this->get_component(),
|
113 |
-
|
114 |
|
115 |
$properties = $this->get_properties();
|
116 |
if ( $properties ) {
|
@@ -140,10 +140,10 @@ class WPSEO_Config_Field {
|
|
140 |
* @param mixed $value Value of the field.
|
141 |
*/
|
142 |
public function set_requires( $field, $value ) {
|
143 |
-
$this->requires =
|
144 |
'field' => $field,
|
145 |
'value' => $value,
|
146 |
-
|
147 |
}
|
148 |
|
149 |
/**
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $properties = [];
|
33 |
|
34 |
/**
|
35 |
* Field requirements.
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
+
protected $requires = [];
|
40 |
|
41 |
/**
|
42 |
* Value of this field.
|
43 |
*
|
44 |
* @var array|mixed
|
45 |
*/
|
46 |
+
protected $data = [];
|
47 |
|
48 |
/**
|
49 |
* WPSEO_Config_Field constructor.
|
108 |
* @return array
|
109 |
*/
|
110 |
public function to_array() {
|
111 |
+
$output = [
|
112 |
'componentName' => $this->get_component(),
|
113 |
+
];
|
114 |
|
115 |
$properties = $this->get_properties();
|
116 |
if ( $properties ) {
|
140 |
* @param mixed $value Value of the field.
|
141 |
*/
|
142 |
public function set_requires( $field, $value ) {
|
143 |
+
$this->requires = [
|
144 |
'field' => $field,
|
145 |
'value' => $value,
|
146 |
+
];
|
147 |
}
|
148 |
|
149 |
/**
|
admin/endpoints/class-endpoint-file-size.php
CHANGED
@@ -53,24 +53,24 @@ class WPSEO_Endpoint_File_Size implements WPSEO_Endpoint {
|
|
53 |
* @return void
|
54 |
*/
|
55 |
public function register() {
|
56 |
-
$route_args =
|
57 |
'methods' => 'GET',
|
58 |
-
'args' =>
|
59 |
-
'url' =>
|
60 |
'required' => true,
|
61 |
'type' => 'string',
|
62 |
'description' => 'The url to retrieve',
|
63 |
-
|
64 |
-
|
65 |
-
'callback' =>
|
66 |
$this->service,
|
67 |
'get',
|
68 |
-
|
69 |
-
'permission_callback' =>
|
70 |
$this,
|
71 |
'can_retrieve_data',
|
72 |
-
|
73 |
-
|
74 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_SINGULAR, $route_args );
|
75 |
}
|
76 |
|
53 |
* @return void
|
54 |
*/
|
55 |
public function register() {
|
56 |
+
$route_args = [
|
57 |
'methods' => 'GET',
|
58 |
+
'args' => [
|
59 |
+
'url' => [
|
60 |
'required' => true,
|
61 |
'type' => 'string',
|
62 |
'description' => 'The url to retrieve',
|
63 |
+
],
|
64 |
+
],
|
65 |
+
'callback' => [
|
66 |
$this->service,
|
67 |
'get',
|
68 |
+
],
|
69 |
+
'permission_callback' => [
|
70 |
$this,
|
71 |
'can_retrieve_data',
|
72 |
+
],
|
73 |
+
];
|
74 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_SINGULAR, $route_args );
|
75 |
}
|
76 |
|
admin/endpoints/class-endpoint-indexable.php
CHANGED
@@ -60,20 +60,20 @@ class WPSEO_Endpoint_Indexable implements WPSEO_Endpoint, WPSEO_Endpoint_Storabl
|
|
60 |
* @return void
|
61 |
*/
|
62 |
public function register() {
|
63 |
-
$endpoints =
|
64 |
|
65 |
$endpoints[] = new WPSEO_Endpoint_Factory(
|
66 |
self::REST_NAMESPACE,
|
67 |
self::ENDPOINT_SINGULAR,
|
68 |
-
|
69 |
-
|
70 |
);
|
71 |
|
72 |
$endpoints[] = new WPSEO_Endpoint_Factory(
|
73 |
self::REST_NAMESPACE,
|
74 |
self::ENDPOINT_SINGULAR,
|
75 |
-
|
76 |
-
|
77 |
'PATCH'
|
78 |
);
|
79 |
|
60 |
* @return void
|
61 |
*/
|
62 |
public function register() {
|
63 |
+
$endpoints = [];
|
64 |
|
65 |
$endpoints[] = new WPSEO_Endpoint_Factory(
|
66 |
self::REST_NAMESPACE,
|
67 |
self::ENDPOINT_SINGULAR,
|
68 |
+
[ $this->service, 'get_indexable' ],
|
69 |
+
[ $this, 'can_retrieve_data' ]
|
70 |
);
|
71 |
|
72 |
$endpoints[] = new WPSEO_Endpoint_Factory(
|
73 |
self::REST_NAMESPACE,
|
74 |
self::ENDPOINT_SINGULAR,
|
75 |
+
[ $this->service, 'patch_indexable' ],
|
76 |
+
[ $this, 'can_store_data' ],
|
77 |
'PATCH'
|
78 |
);
|
79 |
|
admin/endpoints/class-endpoint-ryte.php
CHANGED
@@ -52,11 +52,11 @@ class WPSEO_Endpoint_Ryte implements WPSEO_Endpoint {
|
|
52 |
*/
|
53 |
public function register() {
|
54 |
// Register fetch config.
|
55 |
-
$route_args =
|
56 |
'methods' => 'GET',
|
57 |
-
'callback' =>
|
58 |
-
'permission_callback' =>
|
59 |
-
|
60 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_RETRIEVE, $route_args );
|
61 |
}
|
62 |
|
52 |
*/
|
53 |
public function register() {
|
54 |
// Register fetch config.
|
55 |
+
$route_args = [
|
56 |
'methods' => 'GET',
|
57 |
+
'callback' => [ $this->service, 'get_statistics' ],
|
58 |
+
'permission_callback' => [ $this, 'can_retrieve_data' ],
|
59 |
+
];
|
60 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_RETRIEVE, $route_args );
|
61 |
}
|
62 |
|
admin/endpoints/class-endpoint-statistics.php
CHANGED
@@ -52,11 +52,11 @@ class WPSEO_Endpoint_Statistics implements WPSEO_Endpoint {
|
|
52 |
*/
|
53 |
public function register() {
|
54 |
// Register fetch config.
|
55 |
-
$route_args =
|
56 |
'methods' => 'GET',
|
57 |
-
'callback' =>
|
58 |
-
'permission_callback' =>
|
59 |
-
|
60 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_RETRIEVE, $route_args );
|
61 |
}
|
62 |
|
52 |
*/
|
53 |
public function register() {
|
54 |
// Register fetch config.
|
55 |
+
$route_args = [
|
56 |
'methods' => 'GET',
|
57 |
+
'callback' => [ $this->service, 'get_statistics' ],
|
58 |
+
'permission_callback' => [ $this, 'can_retrieve_data' ],
|
59 |
+
];
|
60 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_RETRIEVE, $route_args );
|
61 |
}
|
62 |
|
admin/filters/class-abstract-post-filter.php
CHANGED
@@ -51,16 +51,16 @@ abstract class WPSEO_Abstract_Post_Filter implements WPSEO_WordPress_Integration
|
|
51 |
* Registers the hooks.
|
52 |
*/
|
53 |
public function register_hooks() {
|
54 |
-
add_action( 'admin_init',
|
55 |
|
56 |
-
add_filter( 'posts_where',
|
57 |
|
58 |
if ( $this->is_filter_active() ) {
|
59 |
-
add_action( 'restrict_manage_posts',
|
60 |
}
|
61 |
|
62 |
if ( $this->is_filter_active() && $this->get_explanation() !== null ) {
|
63 |
-
add_action( 'admin_enqueue_scripts',
|
64 |
}
|
65 |
}
|
66 |
|
@@ -71,7 +71,7 @@ abstract class WPSEO_Abstract_Post_Filter implements WPSEO_WordPress_Integration
|
|
71 |
*/
|
72 |
public function add_filter_links() {
|
73 |
foreach ( $this->get_post_types() as $post_type ) {
|
74 |
-
add_filter( 'views_edit-' . $post_type,
|
75 |
}
|
76 |
}
|
77 |
|
@@ -87,7 +87,7 @@ abstract class WPSEO_Abstract_Post_Filter implements WPSEO_WordPress_Integration
|
|
87 |
wp_localize_script(
|
88 |
WPSEO_Admin_Asset_Manager::PREFIX . 'filter-explanation',
|
89 |
'yoastFilterExplanation',
|
90 |
-
|
91 |
);
|
92 |
}
|
93 |
|
@@ -134,10 +134,10 @@ abstract class WPSEO_Abstract_Post_Filter implements WPSEO_WordPress_Integration
|
|
134 |
* @return string The url to activate this filter.
|
135 |
*/
|
136 |
protected function get_filter_url() {
|
137 |
-
$query_args =
|
138 |
self::FILTER_QUERY_ARG => $this->get_query_val(),
|
139 |
'post_type' => $this->get_current_post_type(),
|
140 |
-
|
141 |
|
142 |
return add_query_arg( $query_args, 'edit.php' );
|
143 |
}
|
@@ -158,9 +158,9 @@ abstract class WPSEO_Abstract_Post_Filter implements WPSEO_WordPress_Integration
|
|
158 |
* @return string The current post type.
|
159 |
*/
|
160 |
protected function get_current_post_type() {
|
161 |
-
$filter_options =
|
162 |
-
'options' =>
|
163 |
-
|
164 |
|
165 |
return filter_input( INPUT_GET, 'post_type', FILTER_DEFAULT, $filter_options );
|
166 |
}
|
51 |
* Registers the hooks.
|
52 |
*/
|
53 |
public function register_hooks() {
|
54 |
+
add_action( 'admin_init', [ $this, 'add_filter_links' ], 11 );
|
55 |
|
56 |
+
add_filter( 'posts_where', [ $this, 'filter_posts' ] );
|
57 |
|
58 |
if ( $this->is_filter_active() ) {
|
59 |
+
add_action( 'restrict_manage_posts', [ $this, 'render_hidden_input' ] );
|
60 |
}
|
61 |
|
62 |
if ( $this->is_filter_active() && $this->get_explanation() !== null ) {
|
63 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_explanation_assets' ] );
|
64 |
}
|
65 |
}
|
66 |
|
71 |
*/
|
72 |
public function add_filter_links() {
|
73 |
foreach ( $this->get_post_types() as $post_type ) {
|
74 |
+
add_filter( 'views_edit-' . $post_type, [ $this, 'add_filter_link' ] );
|
75 |
}
|
76 |
}
|
77 |
|
87 |
wp_localize_script(
|
88 |
WPSEO_Admin_Asset_Manager::PREFIX . 'filter-explanation',
|
89 |
'yoastFilterExplanation',
|
90 |
+
[ 'text' => $this->get_explanation() ]
|
91 |
);
|
92 |
}
|
93 |
|
134 |
* @return string The url to activate this filter.
|
135 |
*/
|
136 |
protected function get_filter_url() {
|
137 |
+
$query_args = [
|
138 |
self::FILTER_QUERY_ARG => $this->get_query_val(),
|
139 |
'post_type' => $this->get_current_post_type(),
|
140 |
+
];
|
141 |
|
142 |
return add_query_arg( $query_args, 'edit.php' );
|
143 |
}
|
158 |
* @return string The current post type.
|
159 |
*/
|
160 |
protected function get_current_post_type() {
|
161 |
+
$filter_options = [
|
162 |
+
'options' => [ 'default' => 'post' ],
|
163 |
+
];
|
164 |
|
165 |
return filter_input( INPUT_GET, 'post_type', FILTER_DEFAULT, $filter_options );
|
166 |
}
|
admin/filters/class-cornerstone-filter.php
CHANGED
@@ -25,8 +25,8 @@ class WPSEO_Cornerstone_Filter extends WPSEO_Abstract_Post_Filter {
|
|
25 |
public function register_hooks() {
|
26 |
parent::register_hooks();
|
27 |
|
28 |
-
add_filter( 'wpseo_cornerstone_post_types',
|
29 |
-
add_filter( 'wpseo_cornerstone_post_types',
|
30 |
}
|
31 |
|
32 |
/**
|
@@ -66,7 +66,7 @@ class WPSEO_Cornerstone_Filter extends WPSEO_Abstract_Post_Filter {
|
|
66 |
* @return array The filtered post types.
|
67 |
*/
|
68 |
public function filter_metabox_disabled( $post_types ) {
|
69 |
-
$filtered_post_types =
|
70 |
foreach ( $post_types as $post_type_key => $post_type ) {
|
71 |
if ( ! WPSEO_Post_Type::has_metabox_enabled( $post_type_key ) ) {
|
72 |
continue;
|
@@ -143,7 +143,7 @@ class WPSEO_Cornerstone_Filter extends WPSEO_Abstract_Post_Filter {
|
|
143 |
*/
|
144 |
$post_types = apply_filters( 'wpseo_cornerstone_post_types', parent::get_post_types() );
|
145 |
if ( ! is_array( $post_types ) ) {
|
146 |
-
return
|
147 |
}
|
148 |
|
149 |
return $post_types;
|
25 |
public function register_hooks() {
|
26 |
parent::register_hooks();
|
27 |
|
28 |
+
add_filter( 'wpseo_cornerstone_post_types', [ 'WPSEO_Post_Type', 'filter_attachment_post_type' ] );
|
29 |
+
add_filter( 'wpseo_cornerstone_post_types', [ $this, 'filter_metabox_disabled' ] );
|
30 |
}
|
31 |
|
32 |
/**
|
66 |
* @return array The filtered post types.
|
67 |
*/
|
68 |
public function filter_metabox_disabled( $post_types ) {
|
69 |
+
$filtered_post_types = [];
|
70 |
foreach ( $post_types as $post_type_key => $post_type ) {
|
71 |
if ( ! WPSEO_Post_Type::has_metabox_enabled( $post_type_key ) ) {
|
72 |
continue;
|
143 |
*/
|
144 |
$post_types = apply_filters( 'wpseo_cornerstone_post_types', parent::get_post_types() );
|
145 |
if ( ! is_array( $post_types ) ) {
|
146 |
+
return [];
|
147 |
}
|
148 |
|
149 |
return $post_types;
|
admin/formatter/class-metabox-formatter.php
CHANGED
@@ -47,7 +47,7 @@ class WPSEO_Metabox_Formatter {
|
|
47 |
$analysis_seo = new WPSEO_Metabox_Analysis_SEO();
|
48 |
$analysis_readability = new WPSEO_Metabox_Analysis_Readability();
|
49 |
|
50 |
-
return
|
51 |
'language' => WPSEO_Language_Utils::get_site_language_name(),
|
52 |
'settings_link' => $this->get_settings_link(),
|
53 |
'search_url' => '',
|
@@ -59,7 +59,7 @@ class WPSEO_Metabox_Formatter {
|
|
59 |
'contentLocale' => get_locale(),
|
60 |
'userLocale' => WPSEO_Language_Utils::get_user_locale(),
|
61 |
'translations' => $this->get_translations(),
|
62 |
-
'keyword_usage' =>
|
63 |
'title_template' => '',
|
64 |
'metadesc_template' => '',
|
65 |
'contentAnalysisActive' => $analysis_readability->is_enabled() ? 1 : 0,
|
@@ -78,9 +78,9 @@ class WPSEO_Metabox_Formatter {
|
|
78 |
* @param bool $showMarkers Should the markers being enabled. Default = true.
|
79 |
*/
|
80 |
'show_markers' => apply_filters( 'wpseo_enable_assessment_markers', true ),
|
81 |
-
'publish_box' =>
|
82 |
-
'labels' =>
|
83 |
-
'content' =>
|
84 |
'na' => sprintf(
|
85 |
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
|
86 |
__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
|
@@ -109,8 +109,8 @@ class WPSEO_Metabox_Formatter {
|
|
109 |
'</a>',
|
110 |
'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
|
111 |
),
|
112 |
-
|
113 |
-
'keyword' =>
|
114 |
'na' => sprintf(
|
115 |
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
|
116 |
__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
|
@@ -139,12 +139,12 @@ class WPSEO_Metabox_Formatter {
|
|
139 |
'</a>',
|
140 |
'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
|
141 |
),
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
'markdownEnabled' => $this->is_markdown_enabled(),
|
146 |
'analysisHeadingTitle' => __( 'Analysis', 'wordpress-seo' ),
|
147 |
-
|
148 |
}
|
149 |
|
150 |
/**
|
@@ -168,7 +168,7 @@ class WPSEO_Metabox_Formatter {
|
|
168 |
*/
|
169 |
private function get_content_analysis_component_translations() {
|
170 |
// Esc_html is not needed because React already handles HTML in the (translations of) these strings.
|
171 |
-
return
|
172 |
'locale' => WPSEO_Language_Utils::get_user_locale(),
|
173 |
'content-analysis.language-notice-link' => __( 'Change language', 'wordpress-seo' ),
|
174 |
'content-analysis.errors' => __( 'Errors', 'wordpress-seo' ),
|
@@ -182,7 +182,7 @@ class WPSEO_Metabox_Formatter {
|
|
182 |
'content-analysis.nohighlight' => __( 'Remove highlight from the text', 'wordpress-seo' ),
|
183 |
'content-analysis.disabledButton' => __( 'Marks are disabled in current view', 'wordpress-seo' ),
|
184 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
185 |
-
|
186 |
}
|
187 |
|
188 |
/**
|
@@ -194,7 +194,7 @@ class WPSEO_Metabox_Formatter {
|
|
194 |
* @return array Translated text strings for the Add Keyword modal.
|
195 |
*/
|
196 |
public function get_add_keyword_upsell_translations() {
|
197 |
-
return
|
198 |
'title' => __( 'Would you like to add more than one keyphrase?', 'wordpress-seo' ),
|
199 |
'intro' => sprintf(
|
200 |
/* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
|
@@ -215,7 +215,7 @@ class WPSEO_Metabox_Formatter {
|
|
215 |
),
|
216 |
'small' => __( '1 year free support and updates included!', 'wordpress-seo' ),
|
217 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
218 |
-
|
219 |
}
|
220 |
|
221 |
/**
|
@@ -234,7 +234,7 @@ class WPSEO_Metabox_Formatter {
|
|
234 |
}
|
235 |
}
|
236 |
|
237 |
-
return
|
238 |
}
|
239 |
|
240 |
/**
|
47 |
$analysis_seo = new WPSEO_Metabox_Analysis_SEO();
|
48 |
$analysis_readability = new WPSEO_Metabox_Analysis_Readability();
|
49 |
|
50 |
+
return [
|
51 |
'language' => WPSEO_Language_Utils::get_site_language_name(),
|
52 |
'settings_link' => $this->get_settings_link(),
|
53 |
'search_url' => '',
|
59 |
'contentLocale' => get_locale(),
|
60 |
'userLocale' => WPSEO_Language_Utils::get_user_locale(),
|
61 |
'translations' => $this->get_translations(),
|
62 |
+
'keyword_usage' => [],
|
63 |
'title_template' => '',
|
64 |
'metadesc_template' => '',
|
65 |
'contentAnalysisActive' => $analysis_readability->is_enabled() ? 1 : 0,
|
78 |
* @param bool $showMarkers Should the markers being enabled. Default = true.
|
79 |
*/
|
80 |
'show_markers' => apply_filters( 'wpseo_enable_assessment_markers', true ),
|
81 |
+
'publish_box' => [
|
82 |
+
'labels' => [
|
83 |
+
'content' => [
|
84 |
'na' => sprintf(
|
85 |
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
|
86 |
__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
|
109 |
'</a>',
|
110 |
'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
|
111 |
),
|
112 |
+
],
|
113 |
+
'keyword' => [
|
114 |
'na' => sprintf(
|
115 |
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
|
116 |
__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
|
139 |
'</a>',
|
140 |
'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
|
141 |
),
|
142 |
+
],
|
143 |
+
],
|
144 |
+
],
|
145 |
'markdownEnabled' => $this->is_markdown_enabled(),
|
146 |
'analysisHeadingTitle' => __( 'Analysis', 'wordpress-seo' ),
|
147 |
+
];
|
148 |
}
|
149 |
|
150 |
/**
|
168 |
*/
|
169 |
private function get_content_analysis_component_translations() {
|
170 |
// Esc_html is not needed because React already handles HTML in the (translations of) these strings.
|
171 |
+
return [
|
172 |
'locale' => WPSEO_Language_Utils::get_user_locale(),
|
173 |
'content-analysis.language-notice-link' => __( 'Change language', 'wordpress-seo' ),
|
174 |
'content-analysis.errors' => __( 'Errors', 'wordpress-seo' ),
|
182 |
'content-analysis.nohighlight' => __( 'Remove highlight from the text', 'wordpress-seo' ),
|
183 |
'content-analysis.disabledButton' => __( 'Marks are disabled in current view', 'wordpress-seo' ),
|
184 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
185 |
+
];
|
186 |
}
|
187 |
|
188 |
/**
|
194 |
* @return array Translated text strings for the Add Keyword modal.
|
195 |
*/
|
196 |
public function get_add_keyword_upsell_translations() {
|
197 |
+
return [
|
198 |
'title' => __( 'Would you like to add more than one keyphrase?', 'wordpress-seo' ),
|
199 |
'intro' => sprintf(
|
200 |
/* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
|
215 |
),
|
216 |
'small' => __( '1 year free support and updates included!', 'wordpress-seo' ),
|
217 |
'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
|
218 |
+
];
|
219 |
}
|
220 |
|
221 |
/**
|
234 |
}
|
235 |
}
|
236 |
|
237 |
+
return [];
|
238 |
}
|
239 |
|
240 |
/**
|
admin/formatter/class-post-metabox-formatter.php
CHANGED
@@ -50,22 +50,22 @@ class WPSEO_Post_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
50 |
* @return array
|
51 |
*/
|
52 |
public function get_values() {
|
53 |
-
$values =
|
54 |
'search_url' => $this->search_url(),
|
55 |
'post_edit_url' => $this->edit_url(),
|
56 |
'base_url' => $this->base_url_for_js(),
|
57 |
'metaDescriptionDate' => '',
|
58 |
|
59 |
-
|
60 |
|
61 |
if ( $this->post instanceof WP_Post ) {
|
62 |
-
$values_to_set =
|
63 |
'keyword_usage' => $this->get_focus_keyword_usage(),
|
64 |
'title_template' => $this->get_title_template(),
|
65 |
'metadesc_template' => $this->get_metadesc_template(),
|
66 |
'metaDescriptionDate' => $this->get_metadesc_date(),
|
67 |
'social_preview_image_url' => $this->get_image_url(),
|
68 |
-
|
69 |
|
70 |
$values = ( $values_to_set + $values );
|
71 |
}
|
@@ -137,7 +137,7 @@ class WPSEO_Post_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
137 |
*/
|
138 |
private function get_focus_keyword_usage() {
|
139 |
$keyword = WPSEO_Meta::get_value( 'focuskw', $this->post->ID );
|
140 |
-
$usage =
|
141 |
|
142 |
if ( WPSEO_Utils::is_yoast_seo_premium() ) {
|
143 |
return $this->get_premium_keywords( $usage );
|
50 |
* @return array
|
51 |
*/
|
52 |
public function get_values() {
|
53 |
+
$values = [
|
54 |
'search_url' => $this->search_url(),
|
55 |
'post_edit_url' => $this->edit_url(),
|
56 |
'base_url' => $this->base_url_for_js(),
|
57 |
'metaDescriptionDate' => '',
|
58 |
|
59 |
+
];
|
60 |
|
61 |
if ( $this->post instanceof WP_Post ) {
|
62 |
+
$values_to_set = [
|
63 |
'keyword_usage' => $this->get_focus_keyword_usage(),
|
64 |
'title_template' => $this->get_title_template(),
|
65 |
'metadesc_template' => $this->get_metadesc_template(),
|
66 |
'metaDescriptionDate' => $this->get_metadesc_date(),
|
67 |
'social_preview_image_url' => $this->get_image_url(),
|
68 |
+
];
|
69 |
|
70 |
$values = ( $values_to_set + $values );
|
71 |
}
|
137 |
*/
|
138 |
private function get_focus_keyword_usage() {
|
139 |
$keyword = WPSEO_Meta::get_value( 'focuskw', $this->post->ID );
|
140 |
+
$usage = [ $keyword => $this->get_keyword_usage_for_current_post( $keyword ) ];
|
141 |
|
142 |
if ( WPSEO_Utils::is_yoast_seo_premium() ) {
|
143 |
return $this->get_premium_keywords( $usage );
|
admin/formatter/class-term-metabox-formatter.php
CHANGED
@@ -48,11 +48,11 @@ class WPSEO_Term_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
48 |
* @return array
|
49 |
*/
|
50 |
public function get_values() {
|
51 |
-
$values =
|
52 |
|
53 |
// Todo: a column needs to be added on the termpages to add a filter for the keyword, so this can be used in the focus keyphrase doubles.
|
54 |
if ( is_object( $this->term ) && property_exists( $this->term, 'taxonomy' ) ) {
|
55 |
-
$values =
|
56 |
'search_url' => $this->search_url(),
|
57 |
'post_edit_url' => $this->edit_url(),
|
58 |
'base_url' => $this->base_url_for_js(),
|
@@ -61,7 +61,7 @@ class WPSEO_Term_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
61 |
'title_template' => $this->get_title_template(),
|
62 |
'metadesc_template' => $this->get_metadesc_template(),
|
63 |
'social_preview_image_url' => $this->get_image_url(),
|
64 |
-
|
65 |
}
|
66 |
|
67 |
return $values;
|
48 |
* @return array
|
49 |
*/
|
50 |
public function get_values() {
|
51 |
+
$values = [];
|
52 |
|
53 |
// Todo: a column needs to be added on the termpages to add a filter for the keyword, so this can be used in the focus keyphrase doubles.
|
54 |
if ( is_object( $this->term ) && property_exists( $this->term, 'taxonomy' ) ) {
|
55 |
+
$values = [
|
56 |
'search_url' => $this->search_url(),
|
57 |
'post_edit_url' => $this->edit_url(),
|
58 |
'base_url' => $this->base_url_for_js(),
|
61 |
'title_template' => $this->get_title_template(),
|
62 |
'metadesc_template' => $this->get_metadesc_template(),
|
63 |
'social_preview_image_url' => $this->get_image_url(),
|
64 |
+
];
|
65 |
}
|
66 |
|
67 |
return $values;
|
admin/import/class-import-detector.php
CHANGED
@@ -17,7 +17,7 @@ class WPSEO_Import_Plugins_Detector {
|
|
17 |
*
|
18 |
* @var array
|
19 |
*/
|
20 |
-
public $needs_import =
|
21 |
|
22 |
/**
|
23 |
* Detects whether we need to import anything.
|
17 |
*
|
18 |
* @var array
|
19 |
*/
|
20 |
+
public $needs_import = [];
|
21 |
|
22 |
/**
|
23 |
* Detects whether we need to import anything.
|
admin/import/class-import-settings.php
CHANGED
@@ -68,15 +68,9 @@ class WPSEO_Import_Settings {
|
|
68 |
* @return void
|
69 |
*/
|
70 |
protected function parse_options( $raw_options ) {
|
71 |
-
|
72 |
-
if ( ! defined( 'WPSEO_NAMESPACES' ) || ! WPSEO_NAMESPACES ) {
|
73 |
-
return;
|
74 |
-
}
|
75 |
-
|
76 |
-
// @codingStandardsIgnoreLine
|
77 |
-
$options = parse_ini_string( $raw_options, true, INI_SCANNER_RAW ); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.parse_ini_stringFound -- We won't get to this function if PHP < 5.3 due to the WPSEO_NAMESPACES check above.
|
78 |
|
79 |
-
if ( is_array( $options ) && $options !==
|
80 |
$this->import_options( $options );
|
81 |
|
82 |
return;
|
68 |
* @return void
|
69 |
*/
|
70 |
protected function parse_options( $raw_options ) {
|
71 |
+
$options = parse_ini_string( $raw_options, true, INI_SCANNER_RAW );
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
+
if ( is_array( $options ) && $options !== [] ) {
|
74 |
$this->import_options( $options );
|
75 |
|
76 |
return;
|
admin/import/plugins/class-abstract-plugin-importer.php
CHANGED
@@ -180,7 +180,7 @@ abstract class WPSEO_Plugin_Importer {
|
|
180 |
*
|
181 |
* @return bool Clone status.
|
182 |
*/
|
183 |
-
protected function meta_key_clone( $old_key, $new_key, $replace_values =
|
184 |
global $wpdb;
|
185 |
|
186 |
// First we create a temp table with all the values for meta_key.
|
@@ -237,7 +237,7 @@ abstract class WPSEO_Plugin_Importer {
|
|
237 |
*/
|
238 |
protected function meta_keys_clone( $clone_keys ) {
|
239 |
foreach ( $clone_keys as $clone_key ) {
|
240 |
-
$result = $this->meta_key_clone( $clone_key['old_key'], $clone_key['new_key'], isset( $clone_key['convert'] ) ? $clone_key['convert'] :
|
241 |
if ( ! $result ) {
|
242 |
return false;
|
243 |
}
|
@@ -307,7 +307,7 @@ abstract class WPSEO_Plugin_Importer {
|
|
307 |
global $wpdb;
|
308 |
|
309 |
// Now we replace values if needed.
|
310 |
-
if ( is_array( $replace_values ) && $replace_values !==
|
311 |
foreach ( $replace_values as $old_value => $new_value ) {
|
312 |
$wpdb->query(
|
313 |
$wpdb->prepare(
|
180 |
*
|
181 |
* @return bool Clone status.
|
182 |
*/
|
183 |
+
protected function meta_key_clone( $old_key, $new_key, $replace_values = [] ) {
|
184 |
global $wpdb;
|
185 |
|
186 |
// First we create a temp table with all the values for meta_key.
|
237 |
*/
|
238 |
protected function meta_keys_clone( $clone_keys ) {
|
239 |
foreach ( $clone_keys as $clone_key ) {
|
240 |
+
$result = $this->meta_key_clone( $clone_key['old_key'], $clone_key['new_key'], isset( $clone_key['convert'] ) ? $clone_key['convert'] : [] );
|
241 |
if ( ! $result ) {
|
242 |
return false;
|
243 |
}
|
307 |
global $wpdb;
|
308 |
|
309 |
// Now we replace values if needed.
|
310 |
+
if ( is_array( $replace_values ) && $replace_values !== [] ) {
|
311 |
foreach ( $replace_values as $old_value => $new_value ) {
|
312 |
$wpdb->query(
|
313 |
$wpdb->prepare(
|
admin/import/plugins/class-import-aioseo.php
CHANGED
@@ -29,38 +29,38 @@ class WPSEO_Import_AIOSEO extends WPSEO_Plugin_Importer {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $import_keys =
|
33 |
'aioseop_opengraph_settings_title' => 'opengraph-title',
|
34 |
'aioseop_opengraph_settings_desc' => 'opengraph-description',
|
35 |
'aioseop_opengraph_settings_customimg' => 'opengraph-image',
|
36 |
'aioseop_opengraph_settings_customimg_twitter' => 'twitter-image',
|
37 |
-
|
38 |
|
39 |
/**
|
40 |
* Array of meta keys to detect and import.
|
41 |
*
|
42 |
* @var array
|
43 |
*/
|
44 |
-
protected $clone_keys =
|
45 |
-
|
46 |
'old_key' => '_aioseop_title',
|
47 |
'new_key' => 'title',
|
48 |
-
|
49 |
-
|
50 |
'old_key' => '_aioseop_description',
|
51 |
'new_key' => 'metadesc',
|
52 |
-
|
53 |
-
|
54 |
'old_key' => '_aioseop_noindex',
|
55 |
'new_key' => 'meta-robots-noindex',
|
56 |
-
'convert' =>
|
57 |
-
|
58 |
-
|
59 |
'old_key' => '_aioseop_nofollow',
|
60 |
'new_key' => 'meta-robots-nofollow',
|
61 |
-
'convert' =>
|
62 |
-
|
63 |
-
|
64 |
|
65 |
/**
|
66 |
* Import All In One SEO meta values.
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $import_keys = [
|
33 |
'aioseop_opengraph_settings_title' => 'opengraph-title',
|
34 |
'aioseop_opengraph_settings_desc' => 'opengraph-description',
|
35 |
'aioseop_opengraph_settings_customimg' => 'opengraph-image',
|
36 |
'aioseop_opengraph_settings_customimg_twitter' => 'twitter-image',
|
37 |
+
];
|
38 |
|
39 |
/**
|
40 |
* Array of meta keys to detect and import.
|
41 |
*
|
42 |
* @var array
|
43 |
*/
|
44 |
+
protected $clone_keys = [
|
45 |
+
[
|
46 |
'old_key' => '_aioseop_title',
|
47 |
'new_key' => 'title',
|
48 |
+
],
|
49 |
+
[
|
50 |
'old_key' => '_aioseop_description',
|
51 |
'new_key' => 'metadesc',
|
52 |
+
],
|
53 |
+
[
|
54 |
'old_key' => '_aioseop_noindex',
|
55 |
'new_key' => 'meta-robots-noindex',
|
56 |
+
'convert' => [ 'on' => 1 ],
|
57 |
+
],
|
58 |
+
[
|
59 |
'old_key' => '_aioseop_nofollow',
|
60 |
'new_key' => 'meta-robots-nofollow',
|
61 |
+
'convert' => [ 'on' => 1 ],
|
62 |
+
],
|
63 |
+
];
|
64 |
|
65 |
/**
|
66 |
* Import All In One SEO meta values.
|
admin/import/plugins/class-import-greg-high-performance-seo.php
CHANGED
@@ -29,15 +29,15 @@ class WPSEO_Import_Greg_SEO extends WPSEO_Plugin_Importer {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $clone_keys =
|
33 |
-
|
34 |
'old_key' => '_ghpseo_alternative_description',
|
35 |
'new_key' => 'metadesc',
|
36 |
-
|
37 |
-
|
38 |
'old_key' => '_ghpseo_secondary_title',
|
39 |
'new_key' => 'title',
|
40 |
-
|
41 |
-
|
42 |
|
43 |
}
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $clone_keys = [
|
33 |
+
[
|
34 |
'old_key' => '_ghpseo_alternative_description',
|
35 |
'new_key' => 'metadesc',
|
36 |
+
],
|
37 |
+
[
|
38 |
'old_key' => '_ghpseo_secondary_title',
|
39 |
'new_key' => 'title',
|
40 |
+
],
|
41 |
+
];
|
42 |
|
43 |
}
|
admin/import/plugins/class-import-headspace.php
CHANGED
@@ -31,24 +31,24 @@ class WPSEO_Import_HeadSpace extends WPSEO_Plugin_Importer {
|
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
-
protected $clone_keys =
|
35 |
-
|
36 |
'old_key' => '_headspace_description',
|
37 |
'new_key' => 'metadesc',
|
38 |
-
|
39 |
-
|
40 |
'old_key' => '_headspace_page_title',
|
41 |
'new_key' => 'title',
|
42 |
-
|
43 |
-
|
44 |
'old_key' => '_headspace_noindex',
|
45 |
'new_key' => 'meta-robots-noindex',
|
46 |
-
'convert' =>
|
47 |
-
|
48 |
-
|
49 |
'old_key' => '_headspace_nofollow',
|
50 |
'new_key' => 'meta-robots-nofollow',
|
51 |
-
'convert' =>
|
52 |
-
|
53 |
-
|
54 |
}
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
+
protected $clone_keys = [
|
35 |
+
[
|
36 |
'old_key' => '_headspace_description',
|
37 |
'new_key' => 'metadesc',
|
38 |
+
],
|
39 |
+
[
|
40 |
'old_key' => '_headspace_page_title',
|
41 |
'new_key' => 'title',
|
42 |
+
],
|
43 |
+
[
|
44 |
'old_key' => '_headspace_noindex',
|
45 |
'new_key' => 'meta-robots-noindex',
|
46 |
+
'convert' => [ 'on' => 1 ],
|
47 |
+
],
|
48 |
+
[
|
49 |
'old_key' => '_headspace_nofollow',
|
50 |
'new_key' => 'meta-robots-nofollow',
|
51 |
+
'convert' => [ 'on' => 1 ],
|
52 |
+
],
|
53 |
+
];
|
54 |
}
|
admin/import/plugins/class-import-jetpack.php
CHANGED
@@ -31,11 +31,11 @@ class WPSEO_Import_Jetpack_SEO extends WPSEO_Plugin_Importer {
|
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
-
protected $clone_keys =
|
35 |
-
|
36 |
'old_key' => 'advanced_seo_description',
|
37 |
'new_key' => 'metadesc',
|
38 |
-
|
39 |
-
|
40 |
|
41 |
}
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
+
protected $clone_keys = [
|
35 |
+
[
|
36 |
'old_key' => 'advanced_seo_description',
|
37 |
'new_key' => 'metadesc',
|
38 |
+
],
|
39 |
+
];
|
40 |
|
41 |
}
|
admin/import/plugins/class-import-platinum-seo-pack.php
CHANGED
@@ -29,16 +29,16 @@ class WPSEO_Import_Platinum_SEO extends WPSEO_Plugin_Importer {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $clone_keys =
|
33 |
-
|
34 |
'old_key' => 'description',
|
35 |
'new_key' => 'metadesc',
|
36 |
-
|
37 |
-
|
38 |
'old_key' => 'title',
|
39 |
'new_key' => 'title',
|
40 |
-
|
41 |
-
|
42 |
|
43 |
/**
|
44 |
* Runs the import of post meta keys stored by Platinum SEO Pack.
|
@@ -86,9 +86,9 @@ class WPSEO_Import_Platinum_SEO extends WPSEO_Plugin_Importer {
|
|
86 |
* @return void
|
87 |
*/
|
88 |
protected function import_robots_meta() {
|
89 |
-
$this->import_by_meta_robots( 'index,nofollow',
|
90 |
-
$this->import_by_meta_robots( 'noindex,follow',
|
91 |
-
$this->import_by_meta_robots( 'noindex,nofollow',
|
92 |
}
|
93 |
|
94 |
/**
|
@@ -121,14 +121,14 @@ class WPSEO_Import_Platinum_SEO extends WPSEO_Plugin_Importer {
|
|
121 |
*/
|
122 |
protected function find_posts_by_robots_meta( $meta_value ) {
|
123 |
$posts = get_posts(
|
124 |
-
|
125 |
'post_type' => 'any',
|
126 |
'meta_key' => 'robotsmeta',
|
127 |
'meta_value' => $meta_value,
|
128 |
'order' => 'ASC',
|
129 |
'fields' => 'ids',
|
130 |
'nopaging' => true,
|
131 |
-
|
132 |
);
|
133 |
if ( empty( $posts ) ) {
|
134 |
return false;
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $clone_keys = [
|
33 |
+
[
|
34 |
'old_key' => 'description',
|
35 |
'new_key' => 'metadesc',
|
36 |
+
],
|
37 |
+
[
|
38 |
'old_key' => 'title',
|
39 |
'new_key' => 'title',
|
40 |
+
],
|
41 |
+
];
|
42 |
|
43 |
/**
|
44 |
* Runs the import of post meta keys stored by Platinum SEO Pack.
|
86 |
* @return void
|
87 |
*/
|
88 |
protected function import_robots_meta() {
|
89 |
+
$this->import_by_meta_robots( 'index,nofollow', [ 'nofollow' ] );
|
90 |
+
$this->import_by_meta_robots( 'noindex,follow', [ 'noindex' ] );
|
91 |
+
$this->import_by_meta_robots( 'noindex,nofollow', [ 'noindex', 'nofollow' ] );
|
92 |
}
|
93 |
|
94 |
/**
|
121 |
*/
|
122 |
protected function find_posts_by_robots_meta( $meta_value ) {
|
123 |
$posts = get_posts(
|
124 |
+
[
|
125 |
'post_type' => 'any',
|
126 |
'meta_key' => 'robotsmeta',
|
127 |
'meta_value' => $meta_value,
|
128 |
'order' => 'ASC',
|
129 |
'fields' => 'ids',
|
130 |
'nopaging' => true,
|
131 |
+
]
|
132 |
);
|
133 |
if ( empty( $posts ) ) {
|
134 |
return false;
|
admin/import/plugins/class-import-rankmath.php
CHANGED
@@ -29,60 +29,60 @@ class WPSEO_Import_RankMath extends WPSEO_Plugin_Importer {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $clone_keys =
|
33 |
-
|
34 |
'old_key' => 'rank_math_description',
|
35 |
'new_key' => 'metadesc',
|
36 |
-
|
37 |
-
|
38 |
'old_key' => 'rank_math_title',
|
39 |
'new_key' => 'title',
|
40 |
-
|
41 |
-
|
42 |
'old_key' => 'rank_math_canonical_url',
|
43 |
'new_key' => 'canonical',
|
44 |
-
|
45 |
-
|
46 |
'old_key' => 'rank_math_primary_category',
|
47 |
'new_key' => 'primary_category',
|
48 |
-
|
49 |
-
|
50 |
'old_key' => 'rank_math_facebook_title',
|
51 |
'new_key' => 'opengraph-title',
|
52 |
-
|
53 |
-
|
54 |
'old_key' => 'rank_math_facebook_description',
|
55 |
'new_key' => 'opengraph-description',
|
56 |
-
|
57 |
-
|
58 |
'old_key' => 'rank_math_facebook_image',
|
59 |
'new_key' => 'opengraph-image',
|
60 |
-
|
61 |
-
|
62 |
'old_key' => 'rank_math_facebook_image_id',
|
63 |
'new_key' => 'opengraph-image-id',
|
64 |
-
|
65 |
-
|
66 |
'old_key' => 'rank_math_twitter_title',
|
67 |
'new_key' => 'twitter-title',
|
68 |
-
|
69 |
-
|
70 |
'old_key' => 'rank_math_twitter_description',
|
71 |
'new_key' => 'twitter-description',
|
72 |
-
|
73 |
-
|
74 |
'old_key' => 'rank_math_twitter_image',
|
75 |
'new_key' => 'twitter-image',
|
76 |
-
|
77 |
-
|
78 |
'old_key' => 'rank_math_twitter_image_id',
|
79 |
'new_key' => 'twitter-image-id',
|
80 |
-
|
81 |
-
|
82 |
'old_key' => 'rank_math_focus_keyword',
|
83 |
'new_key' => 'focuskw',
|
84 |
-
|
85 |
-
|
86 |
|
87 |
/**
|
88 |
* Handles post meta data to import.
|
@@ -115,7 +115,7 @@ class WPSEO_Import_RankMath extends WPSEO_Plugin_Importer {
|
|
115 |
$post_metas = $wpdb->get_results( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'rank_math_robots'" );
|
116 |
foreach ( $post_metas as $post_meta ) {
|
117 |
$robots_values = unserialize( $post_meta->meta_value );
|
118 |
-
foreach (
|
119 |
$directive_key = array_search( $directive, $robots_values );
|
120 |
if ( $directive_key !== false ) {
|
121 |
update_post_meta( $post_meta->post_id, '_yoast_wpseo_meta-robots-' . $directive, 1 );
|
@@ -133,7 +133,7 @@ class WPSEO_Import_RankMath extends WPSEO_Plugin_Importer {
|
|
133 |
* Imports some of the RankMath settings.
|
134 |
*/
|
135 |
private function import_settings() {
|
136 |
-
$settings =
|
137 |
'title_separator' => 'separator',
|
138 |
'homepage_title' => 'title-home-wpseo',
|
139 |
'homepage_description' => 'metadesc-home-wpseo',
|
@@ -143,7 +143,7 @@ class WPSEO_Import_RankMath extends WPSEO_Plugin_Importer {
|
|
143 |
'404_title' => 'title-404-wpseo',
|
144 |
'pt_post_title' => 'title-post',
|
145 |
'pt_page_title' => 'title-page',
|
146 |
-
|
147 |
$options = get_option( 'rank-math-options-titles' );
|
148 |
|
149 |
foreach ( $settings as $import_setting_key => $setting_key ) {
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $clone_keys = [
|
33 |
+
[
|
34 |
'old_key' => 'rank_math_description',
|
35 |
'new_key' => 'metadesc',
|
36 |
+
],
|
37 |
+
[
|
38 |
'old_key' => 'rank_math_title',
|
39 |
'new_key' => 'title',
|
40 |
+
],
|
41 |
+
[
|
42 |
'old_key' => 'rank_math_canonical_url',
|
43 |
'new_key' => 'canonical',
|
44 |
+
],
|
45 |
+
[
|
46 |
'old_key' => 'rank_math_primary_category',
|
47 |
'new_key' => 'primary_category',
|
48 |
+
],
|
49 |
+
[
|
50 |
'old_key' => 'rank_math_facebook_title',
|
51 |
'new_key' => 'opengraph-title',
|
52 |
+
],
|
53 |
+
[
|
54 |
'old_key' => 'rank_math_facebook_description',
|
55 |
'new_key' => 'opengraph-description',
|
56 |
+
],
|
57 |
+
[
|
58 |
'old_key' => 'rank_math_facebook_image',
|
59 |
'new_key' => 'opengraph-image',
|
60 |
+
],
|
61 |
+
[
|
62 |
'old_key' => 'rank_math_facebook_image_id',
|
63 |
'new_key' => 'opengraph-image-id',
|
64 |
+
],
|
65 |
+
[
|
66 |
'old_key' => 'rank_math_twitter_title',
|
67 |
'new_key' => 'twitter-title',
|
68 |
+
],
|
69 |
+
[
|
70 |
'old_key' => 'rank_math_twitter_description',
|
71 |
'new_key' => 'twitter-description',
|
72 |
+
],
|
73 |
+
[
|
74 |
'old_key' => 'rank_math_twitter_image',
|
75 |
'new_key' => 'twitter-image',
|
76 |
+
],
|
77 |
+
[
|
78 |
'old_key' => 'rank_math_twitter_image_id',
|
79 |
'new_key' => 'twitter-image-id',
|
80 |
+
],
|
81 |
+
[
|
82 |
'old_key' => 'rank_math_focus_keyword',
|
83 |
'new_key' => 'focuskw',
|
84 |
+
],
|
85 |
+
];
|
86 |
|
87 |
/**
|
88 |
* Handles post meta data to import.
|
115 |
$post_metas = $wpdb->get_results( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'rank_math_robots'" );
|
116 |
foreach ( $post_metas as $post_meta ) {
|
117 |
$robots_values = unserialize( $post_meta->meta_value );
|
118 |
+
foreach ( [ 'noindex', 'nofollow' ] as $directive ) {
|
119 |
$directive_key = array_search( $directive, $robots_values );
|
120 |
if ( $directive_key !== false ) {
|
121 |
update_post_meta( $post_meta->post_id, '_yoast_wpseo_meta-robots-' . $directive, 1 );
|
133 |
* Imports some of the RankMath settings.
|
134 |
*/
|
135 |
private function import_settings() {
|
136 |
+
$settings = [
|
137 |
'title_separator' => 'separator',
|
138 |
'homepage_title' => 'title-home-wpseo',
|
139 |
'homepage_description' => 'metadesc-home-wpseo',
|
143 |
'404_title' => 'title-404-wpseo',
|
144 |
'pt_post_title' => 'title-post',
|
145 |
'pt_page_title' => 'title-page',
|
146 |
+
];
|
147 |
$options = get_option( 'rank-math-options-titles' );
|
148 |
|
149 |
foreach ( $settings as $import_setting_key => $setting_key ) {
|
admin/import/plugins/class-import-seo-framework.php
CHANGED
@@ -29,48 +29,48 @@ class WPSEO_Import_SEO_Framework extends WPSEO_Plugin_Importer {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $clone_keys =
|
33 |
-
|
34 |
'old_key' => '_genesis_description',
|
35 |
'new_key' => 'metadesc',
|
36 |
-
|
37 |
-
|
38 |
'old_key' => '_genesis_title',
|
39 |
'new_key' => 'title',
|
40 |
-
|
41 |
-
|
42 |
'old_key' => '_genesis_noindex',
|
43 |
'new_key' => 'meta-robots-noindex',
|
44 |
-
|
45 |
-
|
46 |
'old_key' => '_genesis_nofollow',
|
47 |
'new_key' => 'meta-robots-nofollow',
|
48 |
-
|
49 |
-
|
50 |
'old_key' => '_genesis_canonical_uri',
|
51 |
'new_key' => 'canonical',
|
52 |
-
|
53 |
-
|
54 |
'old_key' => '_open_graph_title',
|
55 |
'new_key' => 'opengraph-title',
|
56 |
-
|
57 |
-
|
58 |
'old_key' => '_open_graph_description',
|
59 |
'new_key' => 'opengraph-description',
|
60 |
-
|
61 |
-
|
62 |
'old_key' => '_social_image_url',
|
63 |
'new_key' => 'opengraph-image',
|
64 |
-
|
65 |
-
|
66 |
'old_key' => '_twitter_title',
|
67 |
'new_key' => 'twitter-title',
|
68 |
-
|
69 |
-
|
70 |
'old_key' => '_twitter_description',
|
71 |
'new_key' => 'twitter-description',
|
72 |
-
|
73 |
-
|
74 |
|
75 |
/**
|
76 |
* Removes all the metadata set by the SEO Framework plugin.
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $clone_keys = [
|
33 |
+
[
|
34 |
'old_key' => '_genesis_description',
|
35 |
'new_key' => 'metadesc',
|
36 |
+
],
|
37 |
+
[
|
38 |
'old_key' => '_genesis_title',
|
39 |
'new_key' => 'title',
|
40 |
+
],
|
41 |
+
[
|
42 |
'old_key' => '_genesis_noindex',
|
43 |
'new_key' => 'meta-robots-noindex',
|
44 |
+
],
|
45 |
+
[
|
46 |
'old_key' => '_genesis_nofollow',
|
47 |
'new_key' => 'meta-robots-nofollow',
|
48 |
+
],
|
49 |
+
[
|
50 |
'old_key' => '_genesis_canonical_uri',
|
51 |
'new_key' => 'canonical',
|
52 |
+
],
|
53 |
+
[
|
54 |
'old_key' => '_open_graph_title',
|
55 |
'new_key' => 'opengraph-title',
|
56 |
+
],
|
57 |
+
[
|
58 |
'old_key' => '_open_graph_description',
|
59 |
'new_key' => 'opengraph-description',
|
60 |
+
],
|
61 |
+
[
|
62 |
'old_key' => '_social_image_url',
|
63 |
'new_key' => 'opengraph-image',
|
64 |
+
],
|
65 |
+
[
|
66 |
'old_key' => '_twitter_title',
|
67 |
'new_key' => 'twitter-title',
|
68 |
+
],
|
69 |
+
[
|
70 |
'old_key' => '_twitter_description',
|
71 |
'new_key' => 'twitter-description',
|
72 |
+
],
|
73 |
+
];
|
74 |
|
75 |
/**
|
76 |
* Removes all the metadata set by the SEO Framework plugin.
|
admin/import/plugins/class-import-seopressor.php
CHANGED
@@ -31,11 +31,11 @@ class WPSEO_Import_SEOPressor extends WPSEO_Plugin_Importer {
|
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
-
protected $clone_keys =
|
35 |
-
|
36 |
'old_key' => '_seop_settings',
|
37 |
-
|
38 |
-
|
39 |
|
40 |
/**
|
41 |
* Imports the post meta values to Yoast SEO.
|
@@ -76,7 +76,7 @@ class WPSEO_Import_SEOPressor extends WPSEO_Plugin_Importer {
|
|
76 |
$settings = get_post_meta( $post_id, '_seop_settings', true );
|
77 |
|
78 |
foreach (
|
79 |
-
|
80 |
'fb_description' => 'opengraph-description',
|
81 |
'fb_title' => 'opengraph-title',
|
82 |
'fb_type' => 'og_type',
|
@@ -87,7 +87,7 @@ class WPSEO_Import_SEOPressor extends WPSEO_Plugin_Importer {
|
|
87 |
'tw_description' => 'twitter-description',
|
88 |
'tw_title' => 'twitter-title',
|
89 |
'tw_image' => 'twitter-image',
|
90 |
-
|
91 |
$this->import_meta_helper( $seopressor_key, $yoast_key, $settings, $post_id );
|
92 |
}
|
93 |
|
@@ -112,7 +112,7 @@ class WPSEO_Import_SEOPressor extends WPSEO_Plugin_Importer {
|
|
112 |
$focuskw2 = trim( get_post_meta( $post_id, '_seop_kw_2', true ) );
|
113 |
$focuskw3 = trim( get_post_meta( $post_id, '_seop_kw_3', true ) );
|
114 |
|
115 |
-
$focus_keywords =
|
116 |
if ( ! empty( $focuskw2 ) ) {
|
117 |
$focus_keywords[] = $focuskw2;
|
118 |
}
|
@@ -120,7 +120,7 @@ class WPSEO_Import_SEOPressor extends WPSEO_Plugin_Importer {
|
|
120 |
$focus_keywords[] = $focuskw3;
|
121 |
}
|
122 |
|
123 |
-
if ( $focus_keywords !==
|
124 |
$this->maybe_save_post_meta( 'focuskeywords', WPSEO_Utils::format_json_encode( $focus_keywords ), $post_id );
|
125 |
}
|
126 |
}
|
@@ -151,11 +151,11 @@ class WPSEO_Import_SEOPressor extends WPSEO_Plugin_Importer {
|
|
151 |
* @return array The robots values in Yoast format.
|
152 |
*/
|
153 |
private function get_robot_value( $seopressor_robots ) {
|
154 |
-
$return =
|
155 |
'index' => 2,
|
156 |
'follow' => 0,
|
157 |
'advanced' => '',
|
158 |
-
|
159 |
|
160 |
if ( in_array( 'noindex', $seopressor_robots, true ) ) {
|
161 |
$return['index'] = 1;
|
@@ -163,7 +163,7 @@ class WPSEO_Import_SEOPressor extends WPSEO_Plugin_Importer {
|
|
163 |
if ( in_array( 'nofollow', $seopressor_robots, true ) ) {
|
164 |
$return['follow'] = 1;
|
165 |
}
|
166 |
-
foreach (
|
167 |
if ( in_array( $needle, $seopressor_robots, true ) ) {
|
168 |
$return['advanced'] .= $needle . ',';
|
169 |
}
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
+
protected $clone_keys = [
|
35 |
+
[
|
36 |
'old_key' => '_seop_settings',
|
37 |
+
],
|
38 |
+
];
|
39 |
|
40 |
/**
|
41 |
* Imports the post meta values to Yoast SEO.
|
76 |
$settings = get_post_meta( $post_id, '_seop_settings', true );
|
77 |
|
78 |
foreach (
|
79 |
+
[
|
80 |
'fb_description' => 'opengraph-description',
|
81 |
'fb_title' => 'opengraph-title',
|
82 |
'fb_type' => 'og_type',
|
87 |
'tw_description' => 'twitter-description',
|
88 |
'tw_title' => 'twitter-title',
|
89 |
'tw_image' => 'twitter-image',
|
90 |
+
] as $seopressor_key => $yoast_key ) {
|
91 |
$this->import_meta_helper( $seopressor_key, $yoast_key, $settings, $post_id );
|
92 |
}
|
93 |
|
112 |
$focuskw2 = trim( get_post_meta( $post_id, '_seop_kw_2', true ) );
|
113 |
$focuskw3 = trim( get_post_meta( $post_id, '_seop_kw_3', true ) );
|
114 |
|
115 |
+
$focus_keywords = [];
|
116 |
if ( ! empty( $focuskw2 ) ) {
|
117 |
$focus_keywords[] = $focuskw2;
|
118 |
}
|
120 |
$focus_keywords[] = $focuskw3;
|
121 |
}
|
122 |
|
123 |
+
if ( $focus_keywords !== [] ) {
|
124 |
$this->maybe_save_post_meta( 'focuskeywords', WPSEO_Utils::format_json_encode( $focus_keywords ), $post_id );
|
125 |
}
|
126 |
}
|
151 |
* @return array The robots values in Yoast format.
|
152 |
*/
|
153 |
private function get_robot_value( $seopressor_robots ) {
|
154 |
+
$return = [
|
155 |
'index' => 2,
|
156 |
'follow' => 0,
|
157 |
'advanced' => '',
|
158 |
+
];
|
159 |
|
160 |
if ( in_array( 'noindex', $seopressor_robots, true ) ) {
|
161 |
$return['index'] = 1;
|
163 |
if ( in_array( 'nofollow', $seopressor_robots, true ) ) {
|
164 |
$return['follow'] = 1;
|
165 |
}
|
166 |
+
foreach ( [ 'noarchive', 'nosnippet', 'noimageindex' ] as $needle ) {
|
167 |
if ( in_array( $needle, $seopressor_robots, true ) ) {
|
168 |
$return['advanced'] .= $needle . ',';
|
169 |
}
|
admin/import/plugins/class-import-smartcrawl.php
CHANGED
@@ -29,39 +29,39 @@ class WPSEO_Import_Smartcrawl_SEO extends WPSEO_Plugin_Importer {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $clone_keys =
|
33 |
-
|
34 |
'old_key' => '_wds_metadesc',
|
35 |
'new_key' => 'metadesc',
|
36 |
-
|
37 |
-
|
38 |
'old_key' => '_wds_title',
|
39 |
'new_key' => 'title',
|
40 |
-
|
41 |
-
|
42 |
'old_key' => '_wds_canonical',
|
43 |
'new_key' => 'canonical',
|
44 |
-
|
45 |
-
|
46 |
'old_key' => '_wds_focus-keywords',
|
47 |
'new_key' => 'focuskw',
|
48 |
-
|
49 |
-
|
50 |
'old_key' => '_wds_meta-robots-noindex',
|
51 |
'new_key' => 'meta-robots-noindex',
|
52 |
-
|
53 |
-
|
54 |
'old_key' => '_wds_meta-robots-nofollow',
|
55 |
'new_key' => 'meta-robots-nofollow',
|
56 |
-
|
57 |
-
|
58 |
|
59 |
/**
|
60 |
* Used for importing Twitter and Facebook meta's.
|
61 |
*
|
62 |
* @var array
|
63 |
*/
|
64 |
-
protected $social_keys =
|
65 |
|
66 |
/**
|
67 |
* Handles post meta data to import.
|
@@ -84,11 +84,11 @@ class WPSEO_Import_Smartcrawl_SEO extends WPSEO_Plugin_Importer {
|
|
84 |
* @return bool Import status.
|
85 |
*/
|
86 |
protected function import_opengraph() {
|
87 |
-
$this->social_keys =
|
88 |
'title' => 'opengraph-title',
|
89 |
'description' => 'opengraph-description',
|
90 |
'images' => 'opengraph-image',
|
91 |
-
|
92 |
return $this->post_find_import( '_wds_opengraph' );
|
93 |
}
|
94 |
|
@@ -98,10 +98,10 @@ class WPSEO_Import_Smartcrawl_SEO extends WPSEO_Plugin_Importer {
|
|
98 |
* @return bool Import status.
|
99 |
*/
|
100 |
protected function import_twitter() {
|
101 |
-
$this->social_keys =
|
102 |
'title' => 'twitter-title',
|
103 |
'description' => 'twitter-description',
|
104 |
-
|
105 |
return $this->post_find_import( '_wds_twitter' );
|
106 |
}
|
107 |
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $clone_keys = [
|
33 |
+
[
|
34 |
'old_key' => '_wds_metadesc',
|
35 |
'new_key' => 'metadesc',
|
36 |
+
],
|
37 |
+
[
|
38 |
'old_key' => '_wds_title',
|
39 |
'new_key' => 'title',
|
40 |
+
],
|
41 |
+
[
|
42 |
'old_key' => '_wds_canonical',
|
43 |
'new_key' => 'canonical',
|
44 |
+
],
|
45 |
+
[
|
46 |
'old_key' => '_wds_focus-keywords',
|
47 |
'new_key' => 'focuskw',
|
48 |
+
],
|
49 |
+
[
|
50 |
'old_key' => '_wds_meta-robots-noindex',
|
51 |
'new_key' => 'meta-robots-noindex',
|
52 |
+
],
|
53 |
+
[
|
54 |
'old_key' => '_wds_meta-robots-nofollow',
|
55 |
'new_key' => 'meta-robots-nofollow',
|
56 |
+
],
|
57 |
+
];
|
58 |
|
59 |
/**
|
60 |
* Used for importing Twitter and Facebook meta's.
|
61 |
*
|
62 |
* @var array
|
63 |
*/
|
64 |
+
protected $social_keys = [];
|
65 |
|
66 |
/**
|
67 |
* Handles post meta data to import.
|
84 |
* @return bool Import status.
|
85 |
*/
|
86 |
protected function import_opengraph() {
|
87 |
+
$this->social_keys = [
|
88 |
'title' => 'opengraph-title',
|
89 |
'description' => 'opengraph-description',
|
90 |
'images' => 'opengraph-image',
|
91 |
+
];
|
92 |
return $this->post_find_import( '_wds_opengraph' );
|
93 |
}
|
94 |
|
98 |
* @return bool Import status.
|
99 |
*/
|
100 |
protected function import_twitter() {
|
101 |
+
$this->social_keys = [
|
102 |
'title' => 'twitter-title',
|
103 |
'description' => 'twitter-description',
|
104 |
+
];
|
105 |
return $this->post_find_import( '_wds_twitter' );
|
106 |
}
|
107 |
|
admin/import/plugins/class-import-squirrly.php
CHANGED
@@ -36,7 +36,7 @@ class WPSEO_Import_Squirrly extends WPSEO_Plugin_Importer {
|
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
-
protected $seo_field_keys =
|
40 |
'noindex' => 'meta-robots-noindex',
|
41 |
'nofollow' => 'meta-robots-nofollow',
|
42 |
'title' => 'title',
|
@@ -50,7 +50,7 @@ class WPSEO_Import_Squirrly extends WPSEO_Plugin_Importer {
|
|
50 |
'og_description' => 'opengraph-description',
|
51 |
'og_media' => 'opengraph-image',
|
52 |
'focuskw' => 'focuskw',
|
53 |
-
|
54 |
|
55 |
/**
|
56 |
* WPSEO_Import_Squirrly constructor.
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
+
protected $seo_field_keys = [
|
40 |
'noindex' => 'meta-robots-noindex',
|
41 |
'nofollow' => 'meta-robots-nofollow',
|
42 |
'title' => 'title',
|
50 |
'og_description' => 'opengraph-description',
|
51 |
'og_media' => 'opengraph-image',
|
52 |
'focuskw' => 'focuskw',
|
53 |
+
];
|
54 |
|
55 |
/**
|
56 |
* WPSEO_Import_Squirrly constructor.
|
admin/import/plugins/class-import-ultimate-seo.php
CHANGED
@@ -29,37 +29,37 @@ class WPSEO_Import_Ultimate_SEO extends WPSEO_Plugin_Importer {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $clone_keys =
|
33 |
-
|
34 |
'old_key' => '_su_description',
|
35 |
'new_key' => 'metadesc',
|
36 |
-
|
37 |
-
|
38 |
'old_key' => '_su_title',
|
39 |
'new_key' => 'title',
|
40 |
-
|
41 |
-
|
42 |
'old_key' => '_su_og_title',
|
43 |
'new_key' => 'opengraph-title',
|
44 |
-
|
45 |
-
|
46 |
'old_key' => '_su_og_description',
|
47 |
'new_key' => 'opengraph-description',
|
48 |
-
|
49 |
-
|
50 |
'old_key' => '_su_og_image',
|
51 |
'new_key' => 'opengraph-image',
|
52 |
-
|
53 |
-
|
54 |
'old_key' => '_su_meta_robots_noindex',
|
55 |
'new_key' => 'meta-robots-noindex',
|
56 |
-
'convert' =>
|
57 |
-
|
58 |
-
|
59 |
'old_key' => '_su_meta_robots_nofollow',
|
60 |
'new_key' => 'meta-robots-nofollow',
|
61 |
-
'convert' =>
|
62 |
-
|
63 |
-
|
64 |
|
65 |
}
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $clone_keys = [
|
33 |
+
[
|
34 |
'old_key' => '_su_description',
|
35 |
'new_key' => 'metadesc',
|
36 |
+
],
|
37 |
+
[
|
38 |
'old_key' => '_su_title',
|
39 |
'new_key' => 'title',
|
40 |
+
],
|
41 |
+
[
|
42 |
'old_key' => '_su_og_title',
|
43 |
'new_key' => 'opengraph-title',
|
44 |
+
],
|
45 |
+
[
|
46 |
'old_key' => '_su_og_description',
|
47 |
'new_key' => 'opengraph-description',
|
48 |
+
],
|
49 |
+
[
|
50 |
'old_key' => '_su_og_image',
|
51 |
'new_key' => 'opengraph-image',
|
52 |
+
],
|
53 |
+
[
|
54 |
'old_key' => '_su_meta_robots_noindex',
|
55 |
'new_key' => 'meta-robots-noindex',
|
56 |
+
'convert' => [ 'on' => 1 ],
|
57 |
+
],
|
58 |
+
[
|
59 |
'old_key' => '_su_meta_robots_nofollow',
|
60 |
'new_key' => 'meta-robots-nofollow',
|
61 |
+
'convert' => [ 'on' => 1 ],
|
62 |
+
],
|
63 |
+
];
|
64 |
|
65 |
}
|
admin/import/plugins/class-import-woothemes-seo.php
CHANGED
@@ -31,44 +31,44 @@ class WPSEO_Import_WooThemes_SEO extends WPSEO_Plugin_Importer {
|
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
-
protected $clone_keys =
|
35 |
-
|
36 |
'old_key' => 'seo_description',
|
37 |
'new_key' => 'metadesc',
|
38 |
-
|
39 |
-
|
40 |
'old_key' => 'seo_title',
|
41 |
'new_key' => 'title',
|
42 |
-
|
43 |
-
|
44 |
'old_key' => 'seo_noindex',
|
45 |
'new_key' => 'meta-robots-noindex',
|
46 |
-
|
47 |
-
|
48 |
'old_key' => 'seo_follow',
|
49 |
'new_key' => 'meta-robots-nofollow',
|
50 |
-
|
51 |
-
|
52 |
|
53 |
/**
|
54 |
* Holds the meta fields we can delete after import.
|
55 |
*
|
56 |
* @var array
|
57 |
*/
|
58 |
-
protected $cleanup_metas =
|
59 |
'seo_follow',
|
60 |
'seo_noindex',
|
61 |
'seo_title',
|
62 |
'seo_description',
|
63 |
'seo_keywords',
|
64 |
-
|
65 |
|
66 |
/**
|
67 |
* Holds the options we can delete after import.
|
68 |
*
|
69 |
* @var array
|
70 |
*/
|
71 |
-
protected $cleanup_options =
|
72 |
'seo_woo_archive_layout',
|
73 |
'seo_woo_single_layout',
|
74 |
'seo_woo_page_layout',
|
@@ -76,7 +76,7 @@ class WPSEO_Import_WooThemes_SEO extends WPSEO_Plugin_Importer {
|
|
76 |
'seo_woo_meta_single_desc',
|
77 |
'seo_woo_meta_single_key',
|
78 |
'seo_woo_home_layout',
|
79 |
-
|
80 |
|
81 |
/**
|
82 |
* Cleans up the WooThemes SEO settings.
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
+
protected $clone_keys = [
|
35 |
+
[
|
36 |
'old_key' => 'seo_description',
|
37 |
'new_key' => 'metadesc',
|
38 |
+
],
|
39 |
+
[
|
40 |
'old_key' => 'seo_title',
|
41 |
'new_key' => 'title',
|
42 |
+
],
|
43 |
+
[
|
44 |
'old_key' => 'seo_noindex',
|
45 |
'new_key' => 'meta-robots-noindex',
|
46 |
+
],
|
47 |
+
[
|
48 |
'old_key' => 'seo_follow',
|
49 |
'new_key' => 'meta-robots-nofollow',
|
50 |
+
],
|
51 |
+
];
|
52 |
|
53 |
/**
|
54 |
* Holds the meta fields we can delete after import.
|
55 |
*
|
56 |
* @var array
|
57 |
*/
|
58 |
+
protected $cleanup_metas = [
|
59 |
'seo_follow',
|
60 |
'seo_noindex',
|
61 |
'seo_title',
|
62 |
'seo_description',
|
63 |
'seo_keywords',
|
64 |
+
];
|
65 |
|
66 |
/**
|
67 |
* Holds the options we can delete after import.
|
68 |
*
|
69 |
* @var array
|
70 |
*/
|
71 |
+
protected $cleanup_options = [
|
72 |
'seo_woo_archive_layout',
|
73 |
'seo_woo_single_layout',
|
74 |
'seo_woo_page_layout',
|
76 |
'seo_woo_meta_single_desc',
|
77 |
'seo_woo_meta_single_key',
|
78 |
'seo_woo_home_layout',
|
79 |
+
];
|
80 |
|
81 |
/**
|
82 |
* Cleans up the WooThemes SEO settings.
|
admin/import/plugins/class-import-wp-meta-seo.php
CHANGED
@@ -29,54 +29,54 @@ class WPSEO_Import_WP_Meta_SEO extends WPSEO_Plugin_Importer {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $clone_keys =
|
33 |
-
|
34 |
'old_key' => '_metaseo_metadesc',
|
35 |
'new_key' => 'metadesc',
|
36 |
-
|
37 |
-
|
38 |
'old_key' => '_metaseo_metatitle',
|
39 |
'new_key' => 'title',
|
40 |
-
|
41 |
-
|
42 |
'old_key' => '_metaseo_metaopengraph-title',
|
43 |
'new_key' => 'opengraph-title',
|
44 |
-
|
45 |
-
|
46 |
'old_key' => '_metaseo_metaopengraph-desc',
|
47 |
'new_key' => 'opengraph-description',
|
48 |
-
|
49 |
-
|
50 |
'old_key' => '_metaseo_metaopengraph-image',
|
51 |
'new_key' => 'opengraph-image',
|
52 |
-
|
53 |
-
|
54 |
'old_key' => '_metaseo_metatwitter-title',
|
55 |
'new_key' => 'twitter-title',
|
56 |
-
|
57 |
-
|
58 |
'old_key' => '_metaseo_metatwitter-desc',
|
59 |
'new_key' => 'twitter-description',
|
60 |
-
|
61 |
-
|
62 |
'old_key' => '_metaseo_metatwitter-image',
|
63 |
'new_key' => 'twitter-image',
|
64 |
-
|
65 |
-
|
66 |
'old_key' => '_metaseo_metaindex',
|
67 |
'new_key' => 'meta-robots-noindex',
|
68 |
-
'convert' =>
|
69 |
'index' => 0,
|
70 |
'noindex' => 1,
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
'old_key' => '_metaseo_metafollow',
|
75 |
'new_key' => 'meta-robots-nofollow',
|
76 |
-
'convert' =>
|
77 |
'follow' => 0,
|
78 |
'nofollow' => 1,
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
}
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $clone_keys = [
|
33 |
+
[
|
34 |
'old_key' => '_metaseo_metadesc',
|
35 |
'new_key' => 'metadesc',
|
36 |
+
],
|
37 |
+
[
|
38 |
'old_key' => '_metaseo_metatitle',
|
39 |
'new_key' => 'title',
|
40 |
+
],
|
41 |
+
[
|
42 |
'old_key' => '_metaseo_metaopengraph-title',
|
43 |
'new_key' => 'opengraph-title',
|
44 |
+
],
|
45 |
+
[
|
46 |
'old_key' => '_metaseo_metaopengraph-desc',
|
47 |
'new_key' => 'opengraph-description',
|
48 |
+
],
|
49 |
+
[
|
50 |
'old_key' => '_metaseo_metaopengraph-image',
|
51 |
'new_key' => 'opengraph-image',
|
52 |
+
],
|
53 |
+
[
|
54 |
'old_key' => '_metaseo_metatwitter-title',
|
55 |
'new_key' => 'twitter-title',
|
56 |
+
],
|
57 |
+
[
|
58 |
'old_key' => '_metaseo_metatwitter-desc',
|
59 |
'new_key' => 'twitter-description',
|
60 |
+
],
|
61 |
+
[
|
62 |
'old_key' => '_metaseo_metatwitter-image',
|
63 |
'new_key' => 'twitter-image',
|
64 |
+
],
|
65 |
+
[
|
66 |
'old_key' => '_metaseo_metaindex',
|
67 |
'new_key' => 'meta-robots-noindex',
|
68 |
+
'convert' => [
|
69 |
'index' => 0,
|
70 |
'noindex' => 1,
|
71 |
+
],
|
72 |
+
],
|
73 |
+
[
|
74 |
'old_key' => '_metaseo_metafollow',
|
75 |
'new_key' => 'meta-robots-nofollow',
|
76 |
+
'convert' => [
|
77 |
'follow' => 0,
|
78 |
'nofollow' => 1,
|
79 |
+
],
|
80 |
+
],
|
81 |
+
];
|
82 |
}
|
admin/import/plugins/class-import-wpseo.php
CHANGED
@@ -31,44 +31,44 @@ class WPSEO_Import_WPSEO extends WPSEO_Plugin_Importer {
|
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
-
protected $clone_keys =
|
35 |
-
|
36 |
'old_key' => '_wpseo_edit_description',
|
37 |
'new_key' => 'metadesc',
|
38 |
-
|
39 |
-
|
40 |
'old_key' => '_wpseo_edit_title',
|
41 |
'new_key' => 'title',
|
42 |
-
|
43 |
-
|
44 |
'old_key' => '_wpseo_edit_canonical',
|
45 |
'new_key' => 'canonical',
|
46 |
-
|
47 |
-
|
48 |
'old_key' => '_wpseo_edit_og_title',
|
49 |
'new_key' => 'opengraph-title',
|
50 |
-
|
51 |
-
|
52 |
'old_key' => '_wpseo_edit_og_description',
|
53 |
'new_key' => 'opengraph-description',
|
54 |
-
|
55 |
-
|
56 |
'old_key' => '_wpseo_edit_og_image',
|
57 |
'new_key' => 'opengraph-image',
|
58 |
-
|
59 |
-
|
60 |
'old_key' => '_wpseo_edit_twittercard_title',
|
61 |
'new_key' => 'twitter-title',
|
62 |
-
|
63 |
-
|
64 |
'old_key' => '_wpseo_edit_twittercard_description',
|
65 |
'new_key' => 'twitter-description',
|
66 |
-
|
67 |
-
|
68 |
'old_key' => '_wpseo_edit_twittercard_image',
|
69 |
'new_key' => 'twitter-image',
|
70 |
-
|
71 |
-
|
72 |
|
73 |
/**
|
74 |
* The values 1 - 6 are the configured values from wpSEO. This array will map the values of wpSEO to our values.
|
@@ -78,38 +78,38 @@ class WPSEO_Import_WPSEO extends WPSEO_Plugin_Importer {
|
|
78 |
*
|
79 |
* @var array
|
80 |
*/
|
81 |
-
private $robot_values =
|
82 |
// In wpSEO: index, follow.
|
83 |
-
1 =>
|
84 |
'index' => 2,
|
85 |
'follow' => 0,
|
86 |
-
|
87 |
// In wpSEO: index, nofollow.
|
88 |
-
2 =>
|
89 |
'index' => 2,
|
90 |
'follow' => 1,
|
91 |
-
|
92 |
// In wpSEO: noindex.
|
93 |
-
3 =>
|
94 |
'index' => 1,
|
95 |
'follow' => 0,
|
96 |
-
|
97 |
// In wpSEO: noindex, follow.
|
98 |
-
4 =>
|
99 |
'index' => 1,
|
100 |
'follow' => 0,
|
101 |
-
|
102 |
// In wpSEO: noindex, nofollow.
|
103 |
-
5 =>
|
104 |
'index' => 1,
|
105 |
'follow' => 1,
|
106 |
-
|
107 |
// In wpSEO: index.
|
108 |
-
6 =>
|
109 |
'index' => 2,
|
110 |
'follow' => 0,
|
111 |
-
|
112 |
-
|
113 |
|
114 |
/**
|
115 |
* Imports wpSEO settings.
|
@@ -193,7 +193,7 @@ class WPSEO_Import_WPSEO extends WPSEO_Plugin_Importer {
|
|
193 |
* @return void
|
194 |
*/
|
195 |
private function import_taxonomy_metas() {
|
196 |
-
$terms = get_terms( get_taxonomies(),
|
197 |
$tax_meta = get_option( 'wpseo_taxonomy_meta' );
|
198 |
|
199 |
foreach ( $terms as $term ) {
|
@@ -238,7 +238,7 @@ class WPSEO_Import_WPSEO extends WPSEO_Plugin_Importer {
|
|
238 |
// The value 1, 2 and 6 are the index values in wpSEO.
|
239 |
$new_robot_value = 'noindex';
|
240 |
|
241 |
-
if ( in_array( (int) $wpseo_robots,
|
242 |
$new_robot_value = 'index';
|
243 |
}
|
244 |
|
@@ -291,7 +291,7 @@ class WPSEO_Import_WPSEO extends WPSEO_Plugin_Importer {
|
|
291 |
* @return void
|
292 |
*/
|
293 |
private function cleanup_term_meta() {
|
294 |
-
$terms = get_terms( get_taxonomies(),
|
295 |
foreach ( $terms as $term ) {
|
296 |
$this->delete_taxonomy_metas( $term->taxonomy, $term->term_id );
|
297 |
}
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
+
protected $clone_keys = [
|
35 |
+
[
|
36 |
'old_key' => '_wpseo_edit_description',
|
37 |
'new_key' => 'metadesc',
|
38 |
+
],
|
39 |
+
[
|
40 |
'old_key' => '_wpseo_edit_title',
|
41 |
'new_key' => 'title',
|
42 |
+
],
|
43 |
+
[
|
44 |
'old_key' => '_wpseo_edit_canonical',
|
45 |
'new_key' => 'canonical',
|
46 |
+
],
|
47 |
+
[
|
48 |
'old_key' => '_wpseo_edit_og_title',
|
49 |
'new_key' => 'opengraph-title',
|
50 |
+
],
|
51 |
+
[
|
52 |
'old_key' => '_wpseo_edit_og_description',
|
53 |
'new_key' => 'opengraph-description',
|
54 |
+
],
|
55 |
+
[
|
56 |
'old_key' => '_wpseo_edit_og_image',
|
57 |
'new_key' => 'opengraph-image',
|
58 |
+
],
|
59 |
+
[
|
60 |
'old_key' => '_wpseo_edit_twittercard_title',
|
61 |
'new_key' => 'twitter-title',
|
62 |
+
],
|
63 |
+
[
|
64 |
'old_key' => '_wpseo_edit_twittercard_description',
|
65 |
'new_key' => 'twitter-description',
|
66 |
+
],
|
67 |
+
[
|
68 |
'old_key' => '_wpseo_edit_twittercard_image',
|
69 |
'new_key' => 'twitter-image',
|
70 |
+
],
|
71 |
+
];
|
72 |
|
73 |
/**
|
74 |
* The values 1 - 6 are the configured values from wpSEO. This array will map the values of wpSEO to our values.
|
78 |
*
|
79 |
* @var array
|
80 |
*/
|
81 |
+
private $robot_values = [
|
82 |
// In wpSEO: index, follow.
|
83 |
+
1 => [
|
84 |
'index' => 2,
|
85 |
'follow' => 0,
|
86 |
+
],
|
87 |
// In wpSEO: index, nofollow.
|
88 |
+
2 => [
|
89 |
'index' => 2,
|
90 |
'follow' => 1,
|
91 |
+
],
|
92 |
// In wpSEO: noindex.
|
93 |
+
3 => [
|
94 |
'index' => 1,
|
95 |
'follow' => 0,
|
96 |
+
],
|
97 |
// In wpSEO: noindex, follow.
|
98 |
+
4 => [
|
99 |
'index' => 1,
|
100 |
'follow' => 0,
|
101 |
+
],
|
102 |
// In wpSEO: noindex, nofollow.
|
103 |
+
5 => [
|
104 |
'index' => 1,
|
105 |
'follow' => 1,
|
106 |
+
],
|
107 |
// In wpSEO: index.
|
108 |
+
6 => [
|
109 |
'index' => 2,
|
110 |
'follow' => 0,
|
111 |
+
],
|
112 |
+
];
|
113 |
|
114 |
/**
|
115 |
* Imports wpSEO settings.
|
193 |
* @return void
|
194 |
*/
|
195 |
private function import_taxonomy_metas() {
|
196 |
+
$terms = get_terms( get_taxonomies(), [ 'hide_empty' => false ] );
|
197 |
$tax_meta = get_option( 'wpseo_taxonomy_meta' );
|
198 |
|
199 |
foreach ( $terms as $term ) {
|
238 |
// The value 1, 2 and 6 are the index values in wpSEO.
|
239 |
$new_robot_value = 'noindex';
|
240 |
|
241 |
+
if ( in_array( (int) $wpseo_robots, [ 1, 2, 6 ], true ) ) {
|
242 |
$new_robot_value = 'index';
|
243 |
}
|
244 |
|
291 |
* @return void
|
292 |
*/
|
293 |
private function cleanup_term_meta() {
|
294 |
+
$terms = get_terms( get_taxonomies(), [ 'hide_empty' => false ] );
|
295 |
foreach ( $terms as $term ) {
|
296 |
$this->delete_taxonomy_metas( $term->taxonomy, $term->term_id );
|
297 |
}
|
admin/import/plugins/class-importers.php
CHANGED
@@ -17,7 +17,7 @@ class WPSEO_Plugin_Importers {
|
|
17 |
*
|
18 |
* @var array
|
19 |
*/
|
20 |
-
private static $importers =
|
21 |
'WPSEO_Import_AIOSEO',
|
22 |
'WPSEO_Import_Greg_SEO',
|
23 |
'WPSEO_Import_HeadSpace',
|
@@ -33,7 +33,7 @@ class WPSEO_Plugin_Importers {
|
|
33 |
'WPSEO_Import_Ultimate_SEO',
|
34 |
'WPSEO_Import_WooThemes_SEO',
|
35 |
'WPSEO_Import_WPSEO',
|
36 |
-
|
37 |
|
38 |
/**
|
39 |
* Returns an array of importers available.
|
17 |
*
|
18 |
* @var array
|
19 |
*/
|
20 |
+
private static $importers = [
|
21 |
'WPSEO_Import_AIOSEO',
|
22 |
'WPSEO_Import_Greg_SEO',
|
23 |
'WPSEO_Import_HeadSpace',
|
33 |
'WPSEO_Import_Ultimate_SEO',
|
34 |
'WPSEO_Import_WooThemes_SEO',
|
35 |
'WPSEO_Import_WPSEO',
|
36 |
+
];
|
37 |
|
38 |
/**
|
39 |
* Returns an array of importers available.
|
admin/links/class-link-cleanup-transient.php
CHANGED
@@ -14,7 +14,7 @@ class WPSEO_Link_Cleanup_Transient implements WPSEO_WordPress_Integration {
|
|
14 |
* Registers the hooks.
|
15 |
*/
|
16 |
public function register_hooks() {
|
17 |
-
add_action( 'update_option_wpseo',
|
18 |
}
|
19 |
|
20 |
/**
|
14 |
* Registers the hooks.
|
15 |
*/
|
16 |
public function register_hooks() {
|
17 |
+
add_action( 'update_option_wpseo', [ $this, 'remove_transients_on_updated_option' ], 10, 2 );
|
18 |
}
|
19 |
|
20 |
/**
|
admin/links/class-link-column-count.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Link_Column_Count {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $count =
|
19 |
|
20 |
/**
|
21 |
* Sets the counts for the set target field.
|
@@ -70,21 +70,21 @@ class WPSEO_Link_Column_Count {
|
|
70 |
ARRAY_A
|
71 |
);
|
72 |
|
73 |
-
$output =
|
74 |
foreach ( $results as $result ) {
|
75 |
-
$output[ (int) $result['object_id'] ] =
|
76 |
'internal_link_count' => $result['internal_link_count'],
|
77 |
'incoming_link_count' => (int) $result['incoming_link_count'],
|
78 |
-
|
79 |
}
|
80 |
|
81 |
// Set unfound items to zero.
|
82 |
foreach ( $post_ids as $post_id ) {
|
83 |
if ( ! array_key_exists( $post_id, $output ) ) {
|
84 |
-
$output[ $post_id ] =
|
85 |
'internal_link_count' => null,
|
86 |
'incoming_link_count' => 0,
|
87 |
-
|
88 |
}
|
89 |
}
|
90 |
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $count = [];
|
19 |
|
20 |
/**
|
21 |
* Sets the counts for the set target field.
|
70 |
ARRAY_A
|
71 |
);
|
72 |
|
73 |
+
$output = [];
|
74 |
foreach ( $results as $result ) {
|
75 |
+
$output[ (int) $result['object_id'] ] = [
|
76 |
'internal_link_count' => $result['internal_link_count'],
|
77 |
'incoming_link_count' => (int) $result['incoming_link_count'],
|
78 |
+
];
|
79 |
}
|
80 |
|
81 |
// Set unfound items to zero.
|
82 |
foreach ( $post_ids as $post_id ) {
|
83 |
if ( ! array_key_exists( $post_id, $output ) ) {
|
84 |
+
$output[ $post_id ] = [
|
85 |
'internal_link_count' => null,
|
86 |
'incoming_link_count' => 0,
|
87 |
+
];
|
88 |
}
|
89 |
}
|
90 |
|
admin/links/class-link-columns.php
CHANGED
@@ -43,7 +43,7 @@ class WPSEO_Link_Columns {
|
|
43 |
*
|
44 |
* @var array
|
45 |
*/
|
46 |
-
protected $public_post_types =
|
47 |
|
48 |
/**
|
49 |
* WPSEO_Link_Columns constructor.
|
@@ -71,16 +71,16 @@ class WPSEO_Link_Columns {
|
|
71 |
}
|
72 |
|
73 |
if ( $is_ajax_request ) {
|
74 |
-
add_action( 'admin_init',
|
75 |
}
|
76 |
|
77 |
// Hook into tablenav to calculate links and linked.
|
78 |
-
add_action( 'manage_posts_extra_tablenav',
|
79 |
|
80 |
-
add_filter( 'posts_clauses',
|
81 |
-
add_filter( 'posts_clauses',
|
82 |
|
83 |
-
add_filter( 'admin_init',
|
84 |
}
|
85 |
|
86 |
/**
|
@@ -89,8 +89,8 @@ class WPSEO_Link_Columns {
|
|
89 |
public function register_init_hooks() {
|
90 |
$this->public_post_types = apply_filters( 'wpseo_link_count_post_types', WPSEO_Post_Type::get_accessible_post_types() );
|
91 |
|
92 |
-
if ( is_array( $this->public_post_types ) && $this->public_post_types !==
|
93 |
-
array_walk( $this->public_post_types,
|
94 |
}
|
95 |
}
|
96 |
|
@@ -147,7 +147,7 @@ class WPSEO_Link_Columns {
|
|
147 |
$order = strtoupper( $query->get( 'order' ) );
|
148 |
|
149 |
// Make sure the order setting qualifies. If not, set default as ASC.
|
150 |
-
if ( ! in_array( $order,
|
151 |
$order = 'ASC';
|
152 |
}
|
153 |
|
@@ -165,9 +165,9 @@ class WPSEO_Link_Columns {
|
|
165 |
* @param string $post_type The post type.
|
166 |
*/
|
167 |
public function set_post_type_hooks( $post_type ) {
|
168 |
-
add_filter( 'manage_' . $post_type . '_posts_columns',
|
169 |
-
add_action( 'manage_' . $post_type . '_posts_custom_column',
|
170 |
-
add_filter( 'manage_edit-' . $post_type . '_sortable_columns',
|
171 |
}
|
172 |
|
173 |
/**
|
@@ -217,7 +217,7 @@ class WPSEO_Link_Columns {
|
|
217 |
global $wp_query;
|
218 |
|
219 |
$posts = empty( $wp_query->posts ) ? $wp_query->get_posts() : $wp_query->posts;
|
220 |
-
$post_ids =
|
221 |
|
222 |
// Post lists return a list of objects.
|
223 |
if ( isset( $posts[0] ) && is_object( $posts[0] ) ) {
|
43 |
*
|
44 |
* @var array
|
45 |
*/
|
46 |
+
protected $public_post_types = [];
|
47 |
|
48 |
/**
|
49 |
* WPSEO_Link_Columns constructor.
|
71 |
}
|
72 |
|
73 |
if ( $is_ajax_request ) {
|
74 |
+
add_action( 'admin_init', [ $this, 'set_count_objects' ] );
|
75 |
}
|
76 |
|
77 |
// Hook into tablenav to calculate links and linked.
|
78 |
+
add_action( 'manage_posts_extra_tablenav', [ $this, 'count_objects' ] );
|
79 |
|
80 |
+
add_filter( 'posts_clauses', [ $this, 'order_by_links' ], 1, 2 );
|
81 |
+
add_filter( 'posts_clauses', [ $this, 'order_by_linked' ], 1, 2 );
|
82 |
|
83 |
+
add_filter( 'admin_init', [ $this, 'register_init_hooks' ] );
|
84 |
}
|
85 |
|
86 |
/**
|
89 |
public function register_init_hooks() {
|
90 |
$this->public_post_types = apply_filters( 'wpseo_link_count_post_types', WPSEO_Post_Type::get_accessible_post_types() );
|
91 |
|
92 |
+
if ( is_array( $this->public_post_types ) && $this->public_post_types !== [] ) {
|
93 |
+
array_walk( $this->public_post_types, [ $this, 'set_post_type_hooks' ] );
|
94 |
}
|
95 |
}
|
96 |
|
147 |
$order = strtoupper( $query->get( 'order' ) );
|
148 |
|
149 |
// Make sure the order setting qualifies. If not, set default as ASC.
|
150 |
+
if ( ! in_array( $order, [ 'ASC', 'DESC' ], true ) ) {
|
151 |
$order = 'ASC';
|
152 |
}
|
153 |
|
165 |
* @param string $post_type The post type.
|
166 |
*/
|
167 |
public function set_post_type_hooks( $post_type ) {
|
168 |
+
add_filter( 'manage_' . $post_type . '_posts_columns', [ $this, 'add_post_columns' ] );
|
169 |
+
add_action( 'manage_' . $post_type . '_posts_custom_column', [ $this, 'column_content' ], 10, 2 );
|
170 |
+
add_filter( 'manage_edit-' . $post_type . '_sortable_columns', [ $this, 'column_sort' ] );
|
171 |
}
|
172 |
|
173 |
/**
|
217 |
global $wp_query;
|
218 |
|
219 |
$posts = empty( $wp_query->posts ) ? $wp_query->get_posts() : $wp_query->posts;
|
220 |
+
$post_ids = [];
|
221 |
|
222 |
// Post lists return a list of objects.
|
223 |
if ( isset( $posts[0] ) && is_object( $posts[0] ) ) {
|
admin/links/class-link-compatibility-notifier.php
CHANGED
@@ -59,12 +59,12 @@ class WPSEO_Link_Compatibility_Notifier {
|
|
59 |
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/16f' ) . '" target="_blank">',
|
60 |
'</a>'
|
61 |
),
|
62 |
-
|
63 |
'type' => Yoast_Notification::WARNING,
|
64 |
'id' => self::NOTIFICATION_ID,
|
65 |
'capabilities' => 'wpseo_manage_options',
|
66 |
'priority' => 0.8,
|
67 |
-
|
68 |
);
|
69 |
}
|
70 |
}
|
59 |
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/16f' ) . '" target="_blank">',
|
60 |
'</a>'
|
61 |
),
|
62 |
+
[
|
63 |
'type' => Yoast_Notification::WARNING,
|
64 |
'id' => self::NOTIFICATION_ID,
|
65 |
'capabilities' => 'wpseo_manage_options',
|
66 |
'priority' => 0.8,
|
67 |
+
]
|
68 |
);
|
69 |
}
|
70 |
}
|
admin/links/class-link-content-processor.php
CHANGED
@@ -54,7 +54,7 @@ class WPSEO_Link_Content_Processor {
|
|
54 |
$extracted_links = $link_extractor->extract();
|
55 |
$links = $link_processor->build( $extracted_links );
|
56 |
|
57 |
-
$internal_links = array_filter( $links,
|
58 |
|
59 |
$stored_links = $this->get_stored_internal_links( $post_id );
|
60 |
|
@@ -85,7 +85,7 @@ class WPSEO_Link_Content_Processor {
|
|
85 |
*/
|
86 |
public function get_stored_internal_links( $post_id ) {
|
87 |
$links = $this->storage->get_links( $post_id );
|
88 |
-
return array_filter( $links,
|
89 |
}
|
90 |
|
91 |
/**
|
@@ -108,7 +108,7 @@ class WPSEO_Link_Content_Processor {
|
|
108 |
* @return void
|
109 |
*/
|
110 |
protected function store_internal_link_count( $post_id, $internal_link_count ) {
|
111 |
-
$this->count_storage->save_meta_data( $post_id,
|
112 |
}
|
113 |
|
114 |
/**
|
@@ -121,7 +121,7 @@ class WPSEO_Link_Content_Processor {
|
|
121 |
*/
|
122 |
protected function update_incoming_links( $post_id, $links ) {
|
123 |
$post_ids = $this->get_internal_post_ids( $links );
|
124 |
-
$post_ids = array_merge(
|
125 |
$this->count_storage->update_incoming_link_count( $post_ids, $this->storage );
|
126 |
}
|
127 |
|
@@ -133,7 +133,7 @@ class WPSEO_Link_Content_Processor {
|
|
133 |
* @return int[] List of post IDs.
|
134 |
*/
|
135 |
protected function get_internal_post_ids( $links ) {
|
136 |
-
$post_ids =
|
137 |
foreach ( $links as $link ) {
|
138 |
$post_ids[] = $link->get_target_post_id();
|
139 |
}
|
54 |
$extracted_links = $link_extractor->extract();
|
55 |
$links = $link_processor->build( $extracted_links );
|
56 |
|
57 |
+
$internal_links = array_filter( $links, [ $this, 'filter_internal_link' ] );
|
58 |
|
59 |
$stored_links = $this->get_stored_internal_links( $post_id );
|
60 |
|
85 |
*/
|
86 |
public function get_stored_internal_links( $post_id ) {
|
87 |
$links = $this->storage->get_links( $post_id );
|
88 |
+
return array_filter( $links, [ $this, 'filter_internal_link' ] );
|
89 |
}
|
90 |
|
91 |
/**
|
108 |
* @return void
|
109 |
*/
|
110 |
protected function store_internal_link_count( $post_id, $internal_link_count ) {
|
111 |
+
$this->count_storage->save_meta_data( $post_id, [ 'internal_link_count' => $internal_link_count ] );
|
112 |
}
|
113 |
|
114 |
/**
|
121 |
*/
|
122 |
protected function update_incoming_links( $post_id, $links ) {
|
123 |
$post_ids = $this->get_internal_post_ids( $links );
|
124 |
+
$post_ids = array_merge( [ $post_id ], $post_ids );
|
125 |
$this->count_storage->update_incoming_link_count( $post_ids, $this->storage );
|
126 |
}
|
127 |
|
133 |
* @return int[] List of post IDs.
|
134 |
*/
|
135 |
protected function get_internal_post_ids( $links ) {
|
136 |
+
$post_ids = [];
|
137 |
foreach ( $links as $link ) {
|
138 |
$post_ids[] = $link->get_target_post_id();
|
139 |
}
|
admin/links/class-link-extractor.php
CHANGED
@@ -32,7 +32,7 @@ class WPSEO_Link_Extractor {
|
|
32 |
* @return array All the extracted links
|
33 |
*/
|
34 |
public function extract() {
|
35 |
-
$links =
|
36 |
|
37 |
if ( strpos( $this->content, 'href' ) === false ) {
|
38 |
return $links;
|
32 |
* @return array All the extracted links
|
33 |
*/
|
34 |
public function extract() {
|
35 |
+
$links = [];
|
36 |
|
37 |
if ( strpos( $this->content, 'href' ) === false ) {
|
38 |
return $links;
|
admin/links/class-link-factory.php
CHANGED
@@ -52,10 +52,10 @@ class WPSEO_Link_Factory {
|
|
52 |
* @return WPSEO_Link[] The formatted links.
|
53 |
*/
|
54 |
public function build( array $extracted_links ) {
|
55 |
-
$extracted_links = array_map(
|
56 |
$filtered_links = array_filter(
|
57 |
$extracted_links,
|
58 |
-
|
59 |
);
|
60 |
|
61 |
return $filtered_links;
|
52 |
* @return WPSEO_Link[] The formatted links.
|
53 |
*/
|
54 |
public function build( array $extracted_links ) {
|
55 |
+
$extracted_links = array_map( [ $this, 'build_link' ], $extracted_links );
|
56 |
$filtered_links = array_filter(
|
57 |
$extracted_links,
|
58 |
+
[ $this->filter, 'internal_link_with_fragment_filter' ]
|
59 |
);
|
60 |
|
61 |
return $filtered_links;
|
admin/links/class-link-installer.php
CHANGED
@@ -15,16 +15,16 @@ class WPSEO_Link_Installer {
|
|
15 |
*
|
16 |
* @var WPSEO_Installable[]
|
17 |
*/
|
18 |
-
protected $installables =
|
19 |
|
20 |
/**
|
21 |
* Sets the installables.
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
-
$this->installables =
|
25 |
new WPSEO_Link_Storage(),
|
26 |
new WPSEO_Meta_Storage(),
|
27 |
-
|
28 |
}
|
29 |
|
30 |
/**
|
15 |
*
|
16 |
* @var WPSEO_Installable[]
|
17 |
*/
|
18 |
+
protected $installables = [];
|
19 |
|
20 |
/**
|
21 |
* Sets the installables.
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
+
$this->installables = [
|
25 |
new WPSEO_Link_Storage(),
|
26 |
new WPSEO_Meta_Storage(),
|
27 |
+
];
|
28 |
}
|
29 |
|
30 |
/**
|
admin/links/class-link-notifier.php
CHANGED
@@ -22,14 +22,14 @@ class WPSEO_Link_Notifier {
|
|
22 |
*/
|
23 |
public function register_hooks() {
|
24 |
if ( filter_input( INPUT_GET, 'page' ) === 'wpseo_dashboard' ) {
|
25 |
-
add_action( 'admin_init',
|
26 |
}
|
27 |
|
28 |
if ( ! wp_next_scheduled( self::NOTIFICATION_ID ) ) {
|
29 |
wp_schedule_event( time(), 'daily', self::NOTIFICATION_ID );
|
30 |
}
|
31 |
|
32 |
-
add_action( self::NOTIFICATION_ID,
|
33 |
}
|
34 |
|
35 |
/**
|
@@ -100,12 +100,12 @@ class WPSEO_Link_Notifier {
|
|
100 |
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/15m' ) . '" target="_blank">',
|
101 |
'</a>'
|
102 |
),
|
103 |
-
|
104 |
'type' => Yoast_Notification::WARNING,
|
105 |
'id' => self::NOTIFICATION_ID,
|
106 |
'capabilities' => 'wpseo_manage_options',
|
107 |
'priority' => 0.8,
|
108 |
-
|
109 |
);
|
110 |
}
|
111 |
|
22 |
*/
|
23 |
public function register_hooks() {
|
24 |
if ( filter_input( INPUT_GET, 'page' ) === 'wpseo_dashboard' ) {
|
25 |
+
add_action( 'admin_init', [ $this, 'cleanup_notification' ] );
|
26 |
}
|
27 |
|
28 |
if ( ! wp_next_scheduled( self::NOTIFICATION_ID ) ) {
|
29 |
wp_schedule_event( time(), 'daily', self::NOTIFICATION_ID );
|
30 |
}
|
31 |
|
32 |
+
add_action( self::NOTIFICATION_ID, [ $this, 'manage_notification' ] );
|
33 |
}
|
34 |
|
35 |
/**
|
100 |
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/15m' ) . '" target="_blank">',
|
101 |
'</a>'
|
102 |
),
|
103 |
+
[
|
104 |
'type' => Yoast_Notification::WARNING,
|
105 |
'id' => self::NOTIFICATION_ID,
|
106 |
'capabilities' => 'wpseo_manage_options',
|
107 |
'priority' => 0.8,
|
108 |
+
]
|
109 |
);
|
110 |
}
|
111 |
|
admin/links/class-link-query.php
CHANGED
@@ -55,7 +55,7 @@ class WPSEO_Link_Query {
|
|
55 |
global $wpdb;
|
56 |
|
57 |
$post_ids = array_filter( $post_ids );
|
58 |
-
if ( empty( $post_ids ) ||
|
59 |
return $post_ids;
|
60 |
}
|
61 |
|
55 |
global $wpdb;
|
56 |
|
57 |
$post_ids = array_filter( $post_ids );
|
58 |
+
if ( empty( $post_ids ) || [] === $post_ids ) {
|
59 |
return $post_ids;
|
60 |
}
|
61 |
|
admin/links/class-link-reindex-dashboard.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Link_Reindex_Dashboard {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $public_post_types =
|
19 |
|
20 |
/**
|
21 |
* Number of unprocessed items.
|
@@ -34,12 +34,12 @@ class WPSEO_Link_Reindex_Dashboard {
|
|
34 |
return;
|
35 |
}
|
36 |
|
37 |
-
add_action( 'admin_enqueue_scripts',
|
38 |
-
add_action( 'admin_enqueue_scripts',
|
39 |
|
40 |
-
add_action( 'admin_footer',
|
41 |
|
42 |
-
add_action( 'wpseo_tools_overview_list_items',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -50,7 +50,7 @@ class WPSEO_Link_Reindex_Dashboard {
|
|
50 |
public function calculate_unprocessed() {
|
51 |
$this->public_post_types = apply_filters( 'wpseo_link_count_post_types', WPSEO_Post_Type::get_accessible_post_types() );
|
52 |
|
53 |
-
if ( is_array( $this->public_post_types ) && $this->public_post_types !==
|
54 |
$this->unprocessed = WPSEO_Link_Query::get_unprocessed_count( $this->public_post_types );
|
55 |
}
|
56 |
}
|
@@ -90,7 +90,7 @@ class WPSEO_Link_Reindex_Dashboard {
|
|
90 |
// Adding the thickbox.
|
91 |
add_thickbox();
|
92 |
|
93 |
-
$blocks =
|
94 |
|
95 |
if ( ! $this->has_unprocessed() ) {
|
96 |
$inner_text = sprintf(
|
@@ -137,23 +137,23 @@ class WPSEO_Link_Reindex_Dashboard {
|
|
137 |
$asset_manager = new WPSEO_Admin_Asset_Manager();
|
138 |
$asset_manager->enqueue_script( 'reindex-links' );
|
139 |
|
140 |
-
$data =
|
141 |
'amount' => $this->get_unprocessed_count(),
|
142 |
-
'restApi' =>
|
143 |
'root' => esc_url_raw( rest_url() ),
|
144 |
'endpoint' => WPSEO_Link_Reindex_Post_Endpoint::REST_NAMESPACE . '/' . WPSEO_Link_Reindex_Post_Endpoint::ENDPOINT_QUERY,
|
145 |
'nonce' => wp_create_nonce( 'wp_rest' ),
|
146 |
-
|
147 |
-
'message' =>
|
148 |
'indexingCompleted' => $this->message_already_indexed(),
|
149 |
-
|
150 |
-
'l10n' =>
|
151 |
'calculationInProgress' => __( 'Calculation in progress...', 'wordpress-seo' ),
|
152 |
'calculationCompleted' => __( 'Calculation completed.', 'wordpress-seo' ),
|
153 |
-
|
154 |
-
|
155 |
|
156 |
-
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'reindex-links', 'yoastReindexLinksData',
|
157 |
}
|
158 |
|
159 |
/**
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $public_post_types = [];
|
19 |
|
20 |
/**
|
21 |
* Number of unprocessed items.
|
34 |
return;
|
35 |
}
|
36 |
|
37 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'calculate_unprocessed' ], 9 );
|
38 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ], 10 );
|
39 |
|
40 |
+
add_action( 'admin_footer', [ $this, 'modal_box' ], 20 );
|
41 |
|
42 |
+
add_action( 'wpseo_tools_overview_list_items', [ $this, 'show_tools_overview_item' ], 10 );
|
43 |
}
|
44 |
|
45 |
/**
|
50 |
public function calculate_unprocessed() {
|
51 |
$this->public_post_types = apply_filters( 'wpseo_link_count_post_types', WPSEO_Post_Type::get_accessible_post_types() );
|
52 |
|
53 |
+
if ( is_array( $this->public_post_types ) && $this->public_post_types !== [] ) {
|
54 |
$this->unprocessed = WPSEO_Link_Query::get_unprocessed_count( $this->public_post_types );
|
55 |
}
|
56 |
}
|
90 |
// Adding the thickbox.
|
91 |
add_thickbox();
|
92 |
|
93 |
+
$blocks = [];
|
94 |
|
95 |
if ( ! $this->has_unprocessed() ) {
|
96 |
$inner_text = sprintf(
|
137 |
$asset_manager = new WPSEO_Admin_Asset_Manager();
|
138 |
$asset_manager->enqueue_script( 'reindex-links' );
|
139 |
|
140 |
+
$data = [
|
141 |
'amount' => $this->get_unprocessed_count(),
|
142 |
+
'restApi' => [
|
143 |
'root' => esc_url_raw( rest_url() ),
|
144 |
'endpoint' => WPSEO_Link_Reindex_Post_Endpoint::REST_NAMESPACE . '/' . WPSEO_Link_Reindex_Post_Endpoint::ENDPOINT_QUERY,
|
145 |
'nonce' => wp_create_nonce( 'wp_rest' ),
|
146 |
+
],
|
147 |
+
'message' => [
|
148 |
'indexingCompleted' => $this->message_already_indexed(),
|
149 |
+
],
|
150 |
+
'l10n' => [
|
151 |
'calculationInProgress' => __( 'Calculation in progress...', 'wordpress-seo' ),
|
152 |
'calculationCompleted' => __( 'Calculation completed.', 'wordpress-seo' ),
|
153 |
+
],
|
154 |
+
];
|
155 |
|
156 |
+
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'reindex-links', 'yoastReindexLinksData', [ 'data' => $data ] );
|
157 |
}
|
158 |
|
159 |
/**
|
admin/links/class-link-reindex-post-endpoint.php
CHANGED
@@ -51,11 +51,11 @@ class WPSEO_Link_Reindex_Post_Endpoint {
|
|
51 |
* Register the REST endpoint to WordPress.
|
52 |
*/
|
53 |
public function register() {
|
54 |
-
$route_args =
|
55 |
'methods' => 'GET',
|
56 |
-
'callback' =>
|
57 |
-
'permission_callback' =>
|
58 |
-
|
59 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_QUERY, $route_args );
|
60 |
}
|
61 |
|
51 |
* Register the REST endpoint to WordPress.
|
52 |
*/
|
53 |
public function register() {
|
54 |
+
$route_args = [
|
55 |
'methods' => 'GET',
|
56 |
+
'callback' => [ $this->service, 'reindex' ],
|
57 |
+
'permission_callback' => [ $this, 'can_retrieve_data' ],
|
58 |
+
];
|
59 |
register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_QUERY, $route_args );
|
60 |
}
|
61 |
|
admin/links/class-link-reindex-post-service.php
CHANGED
@@ -30,7 +30,7 @@ class WPSEO_Link_Reindex_Post_Service {
|
|
30 |
}
|
31 |
|
32 |
$posts = $this->get_unprocessed_posts();
|
33 |
-
array_walk( $posts,
|
34 |
|
35 |
return count( $posts );
|
36 |
}
|
@@ -43,7 +43,7 @@ class WPSEO_Link_Reindex_Post_Service {
|
|
43 |
protected function get_unprocessed_posts() {
|
44 |
$post_types = apply_filters( 'wpseo_link_count_post_types', WPSEO_Post_Type::get_accessible_post_types() );
|
45 |
if ( ! is_array( $post_types ) ) {
|
46 |
-
return
|
47 |
}
|
48 |
return WPSEO_Link_Query::get_unprocessed_posts( $post_types );
|
49 |
}
|
30 |
}
|
31 |
|
32 |
$posts = $this->get_unprocessed_posts();
|
33 |
+
array_walk( $posts, [ $this, 'process_post' ] );
|
34 |
|
35 |
return count( $posts );
|
36 |
}
|
43 |
protected function get_unprocessed_posts() {
|
44 |
$post_types = apply_filters( 'wpseo_link_count_post_types', WPSEO_Post_Type::get_accessible_post_types() );
|
45 |
if ( ! is_array( $post_types ) ) {
|
46 |
+
return [];
|
47 |
}
|
48 |
return WPSEO_Link_Query::get_unprocessed_posts( $post_types );
|
49 |
}
|
admin/links/class-link-storage.php
CHANGED
@@ -62,17 +62,17 @@ class WPSEO_Link_Storage implements WPSEO_Installable {
|
|
62 |
*/
|
63 |
public function install() {
|
64 |
return $this->database_proxy->create_table(
|
65 |
-
|
66 |
'id bigint(20) unsigned NOT NULL AUTO_INCREMENT',
|
67 |
'url varchar(255) NOT NULL',
|
68 |
'post_id bigint(20) unsigned NOT NULL',
|
69 |
'target_post_id bigint(20) unsigned NOT NULL',
|
70 |
'type VARCHAR(8) NOT NULL',
|
71 |
-
|
72 |
-
|
73 |
'PRIMARY KEY (id)',
|
74 |
'KEY link_direction (post_id, type)',
|
75 |
-
|
76 |
);
|
77 |
}
|
78 |
|
@@ -100,7 +100,7 @@ class WPSEO_Link_Storage implements WPSEO_Installable {
|
|
100 |
WPSEO_Link_Table_Accessible::set_inaccessible();
|
101 |
}
|
102 |
|
103 |
-
$links =
|
104 |
foreach ( $results as $link ) {
|
105 |
$links[] = WPSEO_Link_Factory::get_link( $link->url, $link->target_post_id, $link->type );
|
106 |
}
|
@@ -117,7 +117,7 @@ class WPSEO_Link_Storage implements WPSEO_Installable {
|
|
117 |
* @return void
|
118 |
*/
|
119 |
public function save_links( $post_id, array $links ) {
|
120 |
-
array_walk( $links,
|
121 |
}
|
122 |
|
123 |
/**
|
@@ -129,8 +129,8 @@ class WPSEO_Link_Storage implements WPSEO_Installable {
|
|
129 |
*/
|
130 |
public function cleanup( $post_id ) {
|
131 |
$is_deleted = $this->database_proxy->delete(
|
132 |
-
|
133 |
-
|
134 |
);
|
135 |
|
136 |
if ( $is_deleted === false ) {
|
@@ -151,13 +151,13 @@ class WPSEO_Link_Storage implements WPSEO_Installable {
|
|
151 |
*/
|
152 |
protected function save_link( WPSEO_Link $link, $link_key, $post_id ) {
|
153 |
$inserted = $this->database_proxy->insert(
|
154 |
-
|
155 |
'url' => $link->get_url(),
|
156 |
'post_id' => $post_id,
|
157 |
'target_post_id' => $link->get_target_post_id(),
|
158 |
'type' => $link->get_type(),
|
159 |
-
|
160 |
-
|
161 |
);
|
162 |
|
163 |
if ( $inserted === false ) {
|
62 |
*/
|
63 |
public function install() {
|
64 |
return $this->database_proxy->create_table(
|
65 |
+
[
|
66 |
'id bigint(20) unsigned NOT NULL AUTO_INCREMENT',
|
67 |
'url varchar(255) NOT NULL',
|
68 |
'post_id bigint(20) unsigned NOT NULL',
|
69 |
'target_post_id bigint(20) unsigned NOT NULL',
|
70 |
'type VARCHAR(8) NOT NULL',
|
71 |
+
],
|
72 |
+
[
|
73 |
'PRIMARY KEY (id)',
|
74 |
'KEY link_direction (post_id, type)',
|
75 |
+
]
|
76 |
);
|
77 |
}
|
78 |
|
100 |
WPSEO_Link_Table_Accessible::set_inaccessible();
|
101 |
}
|
102 |
|
103 |
+
$links = [];
|
104 |
foreach ( $results as $link ) {
|
105 |
$links[] = WPSEO_Link_Factory::get_link( $link->url, $link->target_post_id, $link->type );
|
106 |
}
|
117 |
* @return void
|
118 |
*/
|
119 |
public function save_links( $post_id, array $links ) {
|
120 |
+
array_walk( $links, [ $this, 'save_link' ], $post_id );
|
121 |
}
|
122 |
|
123 |
/**
|
129 |
*/
|
130 |
public function cleanup( $post_id ) {
|
131 |
$is_deleted = $this->database_proxy->delete(
|
132 |
+
[ 'post_id' => $post_id ],
|
133 |
+
[ '%d' ]
|
134 |
);
|
135 |
|
136 |
if ( $is_deleted === false ) {
|
151 |
*/
|
152 |
protected function save_link( WPSEO_Link $link, $link_key, $post_id ) {
|
153 |
$inserted = $this->database_proxy->insert(
|
154 |
+
[
|
155 |
'url' => $link->get_url(),
|
156 |
'post_id' => $post_id,
|
157 |
'target_post_id' => $link->get_target_post_id(),
|
158 |
'type' => $link->get_type(),
|
159 |
+
],
|
160 |
+
[ '%s', '%d', '%d', '%s' ]
|
161 |
);
|
162 |
|
163 |
if ( $inserted === false ) {
|
admin/links/class-link-table-accessible-notifier.php
CHANGED
@@ -57,12 +57,12 @@ class WPSEO_Link_Table_Accessible_Notifier {
|
|
57 |
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/15o' ) . '">',
|
58 |
'</a>'
|
59 |
),
|
60 |
-
|
61 |
'type' => Yoast_Notification::WARNING,
|
62 |
'id' => self::NOTIFICATION_ID,
|
63 |
'capabilities' => 'wpseo_manage_options',
|
64 |
'priority' => 0.8,
|
65 |
-
|
66 |
);
|
67 |
}
|
68 |
}
|
57 |
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/15o' ) . '">',
|
58 |
'</a>'
|
59 |
),
|
60 |
+
[
|
61 |
'type' => Yoast_Notification::WARNING,
|
62 |
'id' => self::NOTIFICATION_ID,
|
63 |
'capabilities' => 'wpseo_manage_options',
|
64 |
'priority' => 0.8,
|
65 |
+
]
|
66 |
);
|
67 |
}
|
68 |
}
|
admin/links/class-link-type-classifier.php
CHANGED
@@ -51,7 +51,7 @@ class WPSEO_Link_Type_Classifier {
|
|
51 |
|
52 |
// Because parse_url may return false.
|
53 |
if ( ! is_array( $url_parts ) ) {
|
54 |
-
$url_parts =
|
55 |
}
|
56 |
|
57 |
if ( $this->contains_protocol( $url_parts ) && $this->is_external_link( $url_parts ) ) {
|
@@ -80,7 +80,7 @@ class WPSEO_Link_Type_Classifier {
|
|
80 |
* @return bool True when the link doesn't contain the home url.
|
81 |
*/
|
82 |
protected function is_external_link( array $url_parts ) {
|
83 |
-
if ( isset( $url_parts['scheme'] ) && ! in_array( $url_parts['scheme'],
|
84 |
return true;
|
85 |
}
|
86 |
// When the base host is equal to the host.
|
51 |
|
52 |
// Because parse_url may return false.
|
53 |
if ( ! is_array( $url_parts ) ) {
|
54 |
+
$url_parts = [];
|
55 |
}
|
56 |
|
57 |
if ( $this->contains_protocol( $url_parts ) && $this->is_external_link( $url_parts ) ) {
|
80 |
* @return bool True when the link doesn't contain the home url.
|
81 |
*/
|
82 |
protected function is_external_link( array $url_parts ) {
|
83 |
+
if ( isset( $url_parts['scheme'] ) && ! in_array( $url_parts['scheme'], [ 'http', 'https' ], true ) ) {
|
84 |
return true;
|
85 |
}
|
86 |
// When the base host is equal to the host.
|
admin/links/class-link-watcher.php
CHANGED
@@ -32,8 +32,8 @@ class WPSEO_Link_Watcher {
|
|
32 |
* @returns void
|
33 |
*/
|
34 |
public function register_hooks() {
|
35 |
-
add_action( 'save_post',
|
36 |
-
add_action( 'delete_post',
|
37 |
}
|
38 |
|
39 |
/**
|
@@ -63,7 +63,7 @@ class WPSEO_Link_Watcher {
|
|
63 |
return;
|
64 |
}
|
65 |
|
66 |
-
$post_statuses_to_skip =
|
67 |
|
68 |
if ( in_array( $post->post_status, $post_statuses_to_skip, true ) ) {
|
69 |
return;
|
32 |
* @returns void
|
33 |
*/
|
34 |
public function register_hooks() {
|
35 |
+
add_action( 'save_post', [ $this, 'save_post' ], 10, 2 );
|
36 |
+
add_action( 'delete_post', [ $this, 'delete_post' ] );
|
37 |
}
|
38 |
|
39 |
/**
|
63 |
return;
|
64 |
}
|
65 |
|
66 |
+
$post_statuses_to_skip = [ 'auto-draft', 'trash' ];
|
67 |
|
68 |
if ( in_array( $post->post_status, $post_statuses_to_skip, true ) ) {
|
69 |
return;
|
admin/menu/class-admin-menu.php
CHANGED
@@ -17,7 +17,7 @@ class WPSEO_Admin_Menu extends WPSEO_Base_Menu {
|
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
// Needs the lower than default priority so other plugins can hook underneath it without issue.
|
20 |
-
add_action( 'admin_menu',
|
21 |
}
|
22 |
|
23 |
/**
|
@@ -77,11 +77,11 @@ class WPSEO_Admin_Menu extends WPSEO_Base_Menu {
|
|
77 |
// Account for when the available submenu pages are requested from outside the admin.
|
78 |
if ( isset( $wpseo_admin ) ) {
|
79 |
$google_search_console = new WPSEO_GSC();
|
80 |
-
$search_console_callback =
|
81 |
}
|
82 |
|
83 |
// Submenu pages.
|
84 |
-
$submenu_pages =
|
85 |
$this->get_submenu_page( __( 'General', 'wordpress-seo' ), $this->get_page_identifier() ),
|
86 |
$this->get_submenu_page( __( 'Search Appearance', 'wordpress-seo' ), 'wpseo_titles' ),
|
87 |
$this->get_submenu_page(
|
@@ -92,7 +92,7 @@ class WPSEO_Admin_Menu extends WPSEO_Base_Menu {
|
|
92 |
$this->get_submenu_page( __( 'Social', 'wordpress-seo' ), 'wpseo_social' ),
|
93 |
$this->get_submenu_page( __( 'Tools', 'wordpress-seo' ), 'wpseo_tools' ),
|
94 |
$this->get_submenu_page( $this->get_license_page_title(), 'wpseo_licenses' ),
|
95 |
-
|
96 |
|
97 |
/**
|
98 |
* Filter: 'wpseo_submenu_pages' - Collects all submenus that need to be shown.
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
// Needs the lower than default priority so other plugins can hook underneath it without issue.
|
20 |
+
add_action( 'admin_menu', [ $this, 'register_settings_page' ], 5 );
|
21 |
}
|
22 |
|
23 |
/**
|
77 |
// Account for when the available submenu pages are requested from outside the admin.
|
78 |
if ( isset( $wpseo_admin ) ) {
|
79 |
$google_search_console = new WPSEO_GSC();
|
80 |
+
$search_console_callback = [ $google_search_console, 'display' ];
|
81 |
}
|
82 |
|
83 |
// Submenu pages.
|
84 |
+
$submenu_pages = [
|
85 |
$this->get_submenu_page( __( 'General', 'wordpress-seo' ), $this->get_page_identifier() ),
|
86 |
$this->get_submenu_page( __( 'Search Appearance', 'wordpress-seo' ), 'wpseo_titles' ),
|
87 |
$this->get_submenu_page(
|
92 |
$this->get_submenu_page( __( 'Social', 'wordpress-seo' ), 'wpseo_social' ),
|
93 |
$this->get_submenu_page( __( 'Tools', 'wordpress-seo' ), 'wpseo_tools' ),
|
94 |
$this->get_submenu_page( $this->get_license_page_title(), 'wpseo_licenses' ),
|
95 |
+
];
|
96 |
|
97 |
/**
|
98 |
* Filter: 'wpseo_submenu_pages' - Collects all submenus that need to be shown.
|
admin/menu/class-base-menu.php
CHANGED
@@ -48,7 +48,7 @@ abstract class WPSEO_Base_Menu implements WPSEO_WordPress_Integration {
|
|
48 |
$callback = $this->get_admin_page_callback();
|
49 |
}
|
50 |
|
51 |
-
return
|
52 |
$this->get_page_identifier(),
|
53 |
'',
|
54 |
$page_title,
|
@@ -56,7 +56,7 @@ abstract class WPSEO_Base_Menu implements WPSEO_WordPress_Integration {
|
|
56 |
$page_slug,
|
57 |
$callback,
|
58 |
$hook,
|
59 |
-
|
60 |
}
|
61 |
|
62 |
/**
|
@@ -75,7 +75,7 @@ abstract class WPSEO_Base_Menu implements WPSEO_WordPress_Integration {
|
|
75 |
}
|
76 |
|
77 |
// Loop through submenu pages and add them.
|
78 |
-
array_walk( $submenu_pages,
|
79 |
}
|
80 |
|
81 |
/**
|
@@ -91,7 +91,7 @@ abstract class WPSEO_Base_Menu implements WPSEO_WordPress_Integration {
|
|
91 |
}
|
92 |
|
93 |
// Loop through submenu pages and add them.
|
94 |
-
array_walk( $submenu_pages,
|
95 |
|
96 |
// Set the first submenu title to the title of the first submenu page.
|
97 |
global $submenu;
|
@@ -242,7 +242,7 @@ abstract class WPSEO_Base_Menu implements WPSEO_WordPress_Integration {
|
|
242 |
* @return array Callback page handler.
|
243 |
*/
|
244 |
protected function get_admin_page_callback() {
|
245 |
-
return
|
246 |
}
|
247 |
|
248 |
/**
|
48 |
$callback = $this->get_admin_page_callback();
|
49 |
}
|
50 |
|
51 |
+
return [
|
52 |
$this->get_page_identifier(),
|
53 |
'',
|
54 |
$page_title,
|
56 |
$page_slug,
|
57 |
$callback,
|
58 |
$hook,
|
59 |
+
];
|
60 |
}
|
61 |
|
62 |
/**
|
75 |
}
|
76 |
|
77 |
// Loop through submenu pages and add them.
|
78 |
+
array_walk( $submenu_pages, [ $this, 'register_menu_page' ] );
|
79 |
}
|
80 |
|
81 |
/**
|
91 |
}
|
92 |
|
93 |
// Loop through submenu pages and add them.
|
94 |
+
array_walk( $submenu_pages, [ $this, 'register_submenu_page' ] );
|
95 |
|
96 |
// Set the first submenu title to the title of the first submenu page.
|
97 |
global $submenu;
|
242 |
* @return array Callback page handler.
|
243 |
*/
|
244 |
protected function get_admin_page_callback() {
|
245 |
+
return [ $this->menu, 'load_page' ];
|
246 |
}
|
247 |
|
248 |
/**
|
admin/menu/class-network-admin-menu.php
CHANGED
@@ -17,7 +17,7 @@ class WPSEO_Network_Admin_Menu extends WPSEO_Base_Menu {
|
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
// Needs the lower than default priority so other plugins can hook underneath it without issue.
|
20 |
-
add_action( 'network_admin_menu',
|
21 |
}
|
22 |
|
23 |
/**
|
@@ -35,7 +35,7 @@ class WPSEO_Network_Admin_Menu extends WPSEO_Base_Menu {
|
|
35 |
__( 'SEO', 'wordpress-seo' ),
|
36 |
$this->get_manage_capability(),
|
37 |
$this->get_page_identifier(),
|
38 |
-
|
39 |
WPSEO_Utils::get_icon_svg()
|
40 |
);
|
41 |
|
@@ -51,13 +51,13 @@ class WPSEO_Network_Admin_Menu extends WPSEO_Base_Menu {
|
|
51 |
public function get_submenu_pages() {
|
52 |
|
53 |
// Submenu pages.
|
54 |
-
$submenu_pages =
|
55 |
$this->get_submenu_page(
|
56 |
__( 'General', 'wordpress-seo' ),
|
57 |
$this->get_page_identifier(),
|
58 |
-
|
59 |
),
|
60 |
-
|
61 |
|
62 |
if ( WPSEO_Utils::allow_system_file_edit() === true ) {
|
63 |
$submenu_pages[] = $this->get_submenu_page( __( 'Edit Files', 'wordpress-seo' ), 'wpseo_files' );
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
// Needs the lower than default priority so other plugins can hook underneath it without issue.
|
20 |
+
add_action( 'network_admin_menu', [ $this, 'register_settings_page' ], 5 );
|
21 |
}
|
22 |
|
23 |
/**
|
35 |
__( 'SEO', 'wordpress-seo' ),
|
36 |
$this->get_manage_capability(),
|
37 |
$this->get_page_identifier(),
|
38 |
+
[ $this, 'network_config_page' ],
|
39 |
WPSEO_Utils::get_icon_svg()
|
40 |
);
|
41 |
|
51 |
public function get_submenu_pages() {
|
52 |
|
53 |
// Submenu pages.
|
54 |
+
$submenu_pages = [
|
55 |
$this->get_submenu_page(
|
56 |
__( 'General', 'wordpress-seo' ),
|
57 |
$this->get_page_identifier(),
|
58 |
+
[ $this, 'network_config_page' ]
|
59 |
),
|
60 |
+
];
|
61 |
|
62 |
if ( WPSEO_Utils::allow_system_file_edit() === true ) {
|
63 |
$submenu_pages[] = $this->get_submenu_page( __( 'Edit Files', 'wordpress-seo' ), 'wpseo_files' );
|
admin/menu/class-replacevar-editor.php
CHANGED
@@ -47,21 +47,21 @@ class WPSEO_Replacevar_Editor {
|
|
47 |
public function __construct( Yoast_Form $yform, $arguments ) {
|
48 |
$arguments = wp_parse_args(
|
49 |
$arguments,
|
50 |
-
|
51 |
'paper_style' => true,
|
52 |
-
|
53 |
);
|
54 |
|
55 |
$this->validate_arguments( $arguments );
|
56 |
|
57 |
$this->yform = $yform;
|
58 |
-
$this->arguments =
|
59 |
'title' => (string) $arguments['title'],
|
60 |
'description' => (string) $arguments['description'],
|
61 |
'page_type_recommended' => (string) $arguments['page_type_recommended'],
|
62 |
'page_type_specific' => (string) $arguments['page_type_specific'],
|
63 |
'paper_style' => (bool) $arguments['paper_style'],
|
64 |
-
|
65 |
}
|
66 |
|
67 |
/**
|
@@ -99,13 +99,13 @@ class WPSEO_Replacevar_Editor {
|
|
99 |
* @throws InvalidArgumentException Thrown when not all required arguments are present.
|
100 |
*/
|
101 |
protected function validate_arguments( array $arguments ) {
|
102 |
-
$required_arguments =
|
103 |
'title',
|
104 |
'description',
|
105 |
'page_type_recommended',
|
106 |
'page_type_specific',
|
107 |
'paper_style',
|
108 |
-
|
109 |
|
110 |
foreach ( $required_arguments as $field_name ) {
|
111 |
if ( ! array_key_exists( $field_name, $arguments ) ) {
|
47 |
public function __construct( Yoast_Form $yform, $arguments ) {
|
48 |
$arguments = wp_parse_args(
|
49 |
$arguments,
|
50 |
+
[
|
51 |
'paper_style' => true,
|
52 |
+
]
|
53 |
);
|
54 |
|
55 |
$this->validate_arguments( $arguments );
|
56 |
|
57 |
$this->yform = $yform;
|
58 |
+
$this->arguments = [
|
59 |
'title' => (string) $arguments['title'],
|
60 |
'description' => (string) $arguments['description'],
|
61 |
'page_type_recommended' => (string) $arguments['page_type_recommended'],
|
62 |
'page_type_specific' => (string) $arguments['page_type_specific'],
|
63 |
'paper_style' => (bool) $arguments['paper_style'],
|
64 |
+
];
|
65 |
}
|
66 |
|
67 |
/**
|
99 |
* @throws InvalidArgumentException Thrown when not all required arguments are present.
|
100 |
*/
|
101 |
protected function validate_arguments( array $arguments ) {
|
102 |
+
$required_arguments = [
|
103 |
'title',
|
104 |
'description',
|
105 |
'page_type_recommended',
|
106 |
'page_type_specific',
|
107 |
'paper_style',
|
108 |
+
];
|
109 |
|
110 |
foreach ( $required_arguments as $field_name ) {
|
111 |
if ( ! array_key_exists( $field_name, $arguments ) ) {
|
admin/menu/class-submenu-capability-normalize.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_Submenu_Capability_Normalize implements WPSEO_WordPress_Integration
|
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
-
add_filter( 'wpseo_submenu_pages',
|
20 |
}
|
21 |
|
22 |
/**
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
+
add_filter( 'wpseo_submenu_pages', [ $this, 'normalize_submenus_capability' ] );
|
20 |
}
|
21 |
|
22 |
/**
|
admin/metabox/class-abstract-sectioned-metabox-tab.php
CHANGED
@@ -53,12 +53,12 @@ abstract class WPSEO_Abstract_Metabox_Tab_With_Sections implements WPSEO_Metabox
|
|
53 |
* @param string $link_content The text content of the section link.
|
54 |
* @param array $options Optional link attributes.
|
55 |
*/
|
56 |
-
public function __construct( $name, $link_content, array $options =
|
57 |
-
$default_options =
|
58 |
'link_title' => '',
|
59 |
'link_class' => '',
|
60 |
'link_aria_label' => '',
|
61 |
-
|
62 |
|
63 |
$options = array_merge( $default_options, $options );
|
64 |
|
53 |
* @param string $link_content The text content of the section link.
|
54 |
* @param array $options Optional link attributes.
|
55 |
*/
|
56 |
+
public function __construct( $name, $link_content, array $options = [] ) {
|
57 |
+
$default_options = [
|
58 |
'link_title' => '',
|
59 |
'link_class' => '',
|
60 |
'link_aria_label' => '',
|
61 |
+
];
|
62 |
|
63 |
$options = array_merge( $default_options, $options );
|
64 |
|
admin/metabox/class-metabox-collapsible.php
CHANGED
@@ -62,12 +62,12 @@ class WPSEO_Metabox_Collapsible implements WPSEO_Metabox_Tab {
|
|
62 |
$collapsible_paper = new WPSEO_Paper_Presenter(
|
63 |
$this->link(),
|
64 |
null,
|
65 |
-
|
66 |
'content' => $this->content,
|
67 |
'collapsible' => true,
|
68 |
'class' => 'metabox wpseo-form wpseo-collapsible-container',
|
69 |
'paper_id' => 'collapsible-' . $this->name,
|
70 |
-
|
71 |
);
|
72 |
|
73 |
return $collapsible_paper->get_output();
|
62 |
$collapsible_paper = new WPSEO_Paper_Presenter(
|
63 |
$this->link(),
|
64 |
null,
|
65 |
+
[
|
66 |
'content' => $this->content,
|
67 |
'collapsible' => true,
|
68 |
'class' => 'metabox wpseo-form wpseo-collapsible-container',
|
69 |
'paper_id' => 'collapsible-' . $this->name,
|
70 |
+
]
|
71 |
);
|
72 |
|
73 |
return $collapsible_paper->get_output();
|
admin/metabox/class-metabox-collapsibles-section.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Metabox_Collapsibles_Sections extends WPSEO_Abstract_Metabox_Tab_Wit
|
|
15 |
*
|
16 |
* @var WPSEO_Metabox_Collapsible[]
|
17 |
*/
|
18 |
-
private $collapsibles =
|
19 |
|
20 |
/**
|
21 |
* Constructor.
|
@@ -26,7 +26,7 @@ class WPSEO_Metabox_Collapsibles_Sections extends WPSEO_Abstract_Metabox_Tab_Wit
|
|
26 |
* @param array $collapsibles The metabox collapsibles (`WPSEO_Metabox_Collapsible[]`) to be included in the section.
|
27 |
* @param array $options Optional link attributes.
|
28 |
*/
|
29 |
-
public function __construct( $name, $link_content, array $collapsibles =
|
30 |
parent::__construct( $name, $link_content, $options );
|
31 |
|
32 |
$this->collapsibles = $collapsibles;
|
@@ -40,13 +40,13 @@ class WPSEO_Metabox_Collapsibles_Sections extends WPSEO_Abstract_Metabox_Tab_Wit
|
|
40 |
printf( '<div id="%1$s" class="wpseo-meta-section">', esc_attr( 'wpseo-meta-section-' . $this->name ) );
|
41 |
echo '<div class="wpseo_content_wrapper">';
|
42 |
|
43 |
-
add_filter( 'wp_kses_allowed_html',
|
44 |
-
add_filter( 'wp_kses_allowed_html',
|
45 |
foreach ( $this->collapsibles as $collapsible ) {
|
46 |
echo wp_kses_post( $collapsible->content() );
|
47 |
}
|
48 |
-
remove_filter( 'wp_kses_allowed_html',
|
49 |
-
remove_filter( 'wp_kses_allowed_html',
|
50 |
|
51 |
echo '</div></div>';
|
52 |
}
|
15 |
*
|
16 |
* @var WPSEO_Metabox_Collapsible[]
|
17 |
*/
|
18 |
+
private $collapsibles = [];
|
19 |
|
20 |
/**
|
21 |
* Constructor.
|
26 |
* @param array $collapsibles The metabox collapsibles (`WPSEO_Metabox_Collapsible[]`) to be included in the section.
|
27 |
* @param array $options Optional link attributes.
|
28 |
*/
|
29 |
+
public function __construct( $name, $link_content, array $collapsibles = [], array $options = [] ) {
|
30 |
parent::__construct( $name, $link_content, $options );
|
31 |
|
32 |
$this->collapsibles = $collapsibles;
|
40 |
printf( '<div id="%1$s" class="wpseo-meta-section">', esc_attr( 'wpseo-meta-section-' . $this->name ) );
|
41 |
echo '<div class="wpseo_content_wrapper">';
|
42 |
|
43 |
+
add_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_forms' ] );
|
44 |
+
add_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_a11y' ] );
|
45 |
foreach ( $this->collapsibles as $collapsible ) {
|
46 |
echo wp_kses_post( $collapsible->content() );
|
47 |
}
|
48 |
+
remove_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_forms' ] );
|
49 |
+
remove_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_a11y' ] );
|
50 |
|
51 |
echo '</div></div>';
|
52 |
}
|
admin/metabox/class-metabox-editor.php
CHANGED
@@ -16,8 +16,8 @@ class WPSEO_Metabox_Editor {
|
|
16 |
* @codeCoverageIgnore
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
-
add_filter( 'mce_css',
|
20 |
-
add_filter( 'tiny_mce_before_init',
|
21 |
}
|
22 |
|
23 |
/**
|
16 |
* @codeCoverageIgnore
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
+
add_filter( 'mce_css', [ $this, 'add_css_inside_editor' ] );
|
20 |
+
add_filter( 'tiny_mce_before_init', [ $this, 'add_custom_element' ] );
|
21 |
}
|
22 |
|
23 |
/**
|
admin/metabox/class-metabox-form-tab.php
CHANGED
@@ -74,14 +74,14 @@ class WPSEO_Metabox_Form_Tab implements WPSEO_Metabox_Tab {
|
|
74 |
* @param string $link_content The text content of the tab link.
|
75 |
* @param array $options Optional link attributes.
|
76 |
*/
|
77 |
-
public function __construct( $name, $content, $link_content, array $options =
|
78 |
-
$default_options =
|
79 |
'tab_class' => '',
|
80 |
'link_class' => '',
|
81 |
'link_title' => '',
|
82 |
'link_aria_label' => '',
|
83 |
'single' => false,
|
84 |
-
|
85 |
|
86 |
$options = array_merge( $default_options, $options );
|
87 |
|
74 |
* @param string $link_content The text content of the tab link.
|
75 |
* @param array $options Optional link attributes.
|
76 |
*/
|
77 |
+
public function __construct( $name, $content, $link_content, array $options = [] ) {
|
78 |
+
$default_options = [
|
79 |
'tab_class' => '',
|
80 |
'link_class' => '',
|
81 |
'link_title' => '',
|
82 |
'link_aria_label' => '',
|
83 |
'single' => false,
|
84 |
+
];
|
85 |
|
86 |
$options = array_merge( $default_options, $options );
|
87 |
|
admin/metabox/class-metabox-section-additional.php
CHANGED
@@ -54,13 +54,13 @@ class WPSEO_Metabox_Section_Additional implements WPSEO_Metabox_Section {
|
|
54 |
* @param string $content Optional. Content to use above the React root element.
|
55 |
* @param array $options Optional link attributes.
|
56 |
*/
|
57 |
-
public function __construct( $name, $link_content, $content = '', array $options =
|
58 |
$this->name = $name;
|
59 |
$this->content = $content;
|
60 |
-
$default_options =
|
61 |
'link_class' => '',
|
62 |
'link_aria_label' => '',
|
63 |
-
|
64 |
$options = wp_parse_args( $options, $default_options );
|
65 |
$this->link_content = $link_content;
|
66 |
$this->link_class = $options['link_class'];
|
54 |
* @param string $content Optional. Content to use above the React root element.
|
55 |
* @param array $options Optional link attributes.
|
56 |
*/
|
57 |
+
public function __construct( $name, $link_content, $content = '', array $options = [] ) {
|
58 |
$this->name = $name;
|
59 |
$this->content = $content;
|
60 |
+
$default_options = [
|
61 |
'link_class' => '',
|
62 |
'link_aria_label' => '',
|
63 |
+
];
|
64 |
$options = wp_parse_args( $options, $default_options );
|
65 |
$this->link_content = $link_content;
|
66 |
$this->link_class = $options['link_class'];
|
admin/metabox/class-metabox-section-react.php
CHANGED
@@ -61,15 +61,15 @@ class WPSEO_Metabox_Section_React implements WPSEO_Metabox_Section {
|
|
61 |
* @param string $content Optional. Content to use above the React root element.
|
62 |
* @param array $options Optional link attributes.
|
63 |
*/
|
64 |
-
public function __construct( $name, $link_content, $content = '', array $options =
|
65 |
$this->name = $name;
|
66 |
$this->content = $content;
|
67 |
|
68 |
-
$default_options =
|
69 |
'link_class' => '',
|
70 |
'link_aria_label' => '',
|
71 |
'html_after' => '',
|
72 |
-
|
73 |
|
74 |
$options = wp_parse_args( $options, $default_options );
|
75 |
|
@@ -100,8 +100,8 @@ class WPSEO_Metabox_Section_React implements WPSEO_Metabox_Section {
|
|
100 |
* @return void
|
101 |
*/
|
102 |
public function display_content() {
|
103 |
-
add_filter( 'wp_kses_allowed_html',
|
104 |
-
add_filter( 'wp_kses_allowed_html',
|
105 |
|
106 |
printf(
|
107 |
'<div role="tabpanel" id="wpseo-meta-section-%1$s" aria-labelledby="wpseo-meta-tab-%1$s" tabindex="0" class="wpseo-meta-section">',
|
@@ -112,7 +112,7 @@ class WPSEO_Metabox_Section_React implements WPSEO_Metabox_Section {
|
|
112 |
echo wp_kses_post( $this->html_after );
|
113 |
echo '</div>';
|
114 |
|
115 |
-
remove_filter( 'wp_kses_allowed_html',
|
116 |
-
remove_filter( 'wp_kses_allowed_html',
|
117 |
}
|
118 |
}
|
61 |
* @param string $content Optional. Content to use above the React root element.
|
62 |
* @param array $options Optional link attributes.
|
63 |
*/
|
64 |
+
public function __construct( $name, $link_content, $content = '', array $options = [] ) {
|
65 |
$this->name = $name;
|
66 |
$this->content = $content;
|
67 |
|
68 |
+
$default_options = [
|
69 |
'link_class' => '',
|
70 |
'link_aria_label' => '',
|
71 |
'html_after' => '',
|
72 |
+
];
|
73 |
|
74 |
$options = wp_parse_args( $options, $default_options );
|
75 |
|
100 |
* @return void
|
101 |
*/
|
102 |
public function display_content() {
|
103 |
+
add_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_forms' ] );
|
104 |
+
add_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_a11y' ] );
|
105 |
|
106 |
printf(
|
107 |
'<div role="tabpanel" id="wpseo-meta-section-%1$s" aria-labelledby="wpseo-meta-tab-%1$s" tabindex="0" class="wpseo-meta-section">',
|
112 |
echo wp_kses_post( $this->html_after );
|
113 |
echo '</div>';
|
114 |
|
115 |
+
remove_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_forms' ] );
|
116 |
+
remove_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_a11y' ] );
|
117 |
}
|
118 |
}
|
admin/metabox/class-metabox.php
CHANGED
@@ -43,16 +43,16 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
43 |
*/
|
44 |
public function __construct() {
|
45 |
if ( $this->is_internet_explorer() ) {
|
46 |
-
add_action( 'add_meta_boxes',
|
47 |
return;
|
48 |
}
|
49 |
|
50 |
-
add_action( 'add_meta_boxes',
|
51 |
-
add_action( 'admin_enqueue_scripts',
|
52 |
-
add_action( 'wp_insert_post',
|
53 |
-
add_action( 'edit_attachment',
|
54 |
-
add_action( 'add_attachment',
|
55 |
-
add_action( 'admin_init',
|
56 |
|
57 |
// Check if one of the social settings is checked in the options, if so, initialize the social_admin object.
|
58 |
if ( WPSEO_Options::get( 'opengraph', false ) || WPSEO_Options::get( 'twitter', false ) ) {
|
@@ -86,25 +86,25 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
86 |
*/
|
87 |
public function internet_explorer_metabox() {
|
88 |
$post_types = WPSEO_Post_Type::get_accessible_post_types();
|
89 |
-
$post_types = array_filter( $post_types,
|
90 |
|
91 |
-
if ( ! is_array( $post_types ) || $post_types ===
|
92 |
return;
|
93 |
}
|
94 |
|
95 |
$product_title = $this->get_product_title();
|
96 |
|
97 |
foreach ( $post_types as $post_type ) {
|
98 |
-
add_filter( "postbox_classes_{$post_type}_wpseo_meta",
|
99 |
|
100 |
add_meta_box(
|
101 |
'wpseo_meta',
|
102 |
$product_title,
|
103 |
-
|
104 |
$post_type,
|
105 |
'normal',
|
106 |
apply_filters( 'wpseo_metabox_prio', 'high' ),
|
107 |
-
|
108 |
);
|
109 |
}
|
110 |
}
|
@@ -200,25 +200,25 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
200 |
*/
|
201 |
public function add_meta_box() {
|
202 |
$post_types = WPSEO_Post_Type::get_accessible_post_types();
|
203 |
-
$post_types = array_filter( $post_types,
|
204 |
|
205 |
-
if ( ! is_array( $post_types ) || $post_types ===
|
206 |
return;
|
207 |
}
|
208 |
|
209 |
$product_title = $this->get_product_title();
|
210 |
|
211 |
foreach ( $post_types as $post_type ) {
|
212 |
-
add_filter( "postbox_classes_{$post_type}_wpseo_meta",
|
213 |
|
214 |
add_meta_box(
|
215 |
'wpseo_meta',
|
216 |
$product_title,
|
217 |
-
|
218 |
$post_type,
|
219 |
'normal',
|
220 |
apply_filters( 'wpseo_metabox_prio', 'high' ),
|
221 |
-
|
222 |
);
|
223 |
}
|
224 |
}
|
@@ -251,7 +251,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
251 |
}
|
252 |
|
253 |
$post_formatter = new WPSEO_Metabox_Formatter(
|
254 |
-
new WPSEO_Post_Metabox_Formatter( $post,
|
255 |
);
|
256 |
|
257 |
$values = $post_formatter->get_values();
|
@@ -269,13 +269,13 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
269 |
* Passes some variables to js for replacing variables.
|
270 |
*/
|
271 |
public function localize_replace_vars_script() {
|
272 |
-
return
|
273 |
'no_parent_text' => __( '(no parent)', 'wordpress-seo' ),
|
274 |
'replace_vars' => $this->get_replace_vars(),
|
275 |
'recommended_replace_vars' => $this->get_recommended_replace_vars(),
|
276 |
'scope' => $this->determine_scope(),
|
277 |
'has_taxonomies' => $this->current_post_type_has_taxonomies(),
|
278 |
-
|
279 |
}
|
280 |
|
281 |
/**
|
@@ -311,10 +311,10 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
311 |
* @return array
|
312 |
*/
|
313 |
public function localize_shortcode_plugin_script() {
|
314 |
-
return
|
315 |
'wpseo_filter_shortcodes_nonce' => wp_create_nonce( 'wpseo-filter-shortcodes' ),
|
316 |
'wpseo_shortcode_tags' => $this->get_valid_shortcode_tags(),
|
317 |
-
|
318 |
}
|
319 |
|
320 |
/**
|
@@ -350,7 +350,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
350 |
* @return WPSEO_Metabox_Section[]
|
351 |
*/
|
352 |
private function get_content_sections() {
|
353 |
-
$content_sections =
|
354 |
|
355 |
$content_sections[] = $this->get_seo_meta_section();
|
356 |
|
@@ -389,12 +389,12 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
389 |
$advanced_collapsible = new WPSEO_Paper_Presenter(
|
390 |
__( 'Advanced', 'wordpress-seo' ),
|
391 |
null,
|
392 |
-
|
393 |
'collapsible' => true,
|
394 |
'class' => 'metabox wpseo-form wpseo-collapsible-container',
|
395 |
'content' => $this->get_tab_content( 'advanced' ),
|
396 |
'paper_id' => 'collapsible-advanced-settings',
|
397 |
-
|
398 |
);
|
399 |
|
400 |
$html_after = '<div class="wpseo_content_wrapper">' . $advanced_collapsible->get_output() . '</div>';
|
@@ -411,9 +411,9 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
411 |
'content',
|
412 |
$label,
|
413 |
$content,
|
414 |
-
|
415 |
'html_after' => $html_after,
|
416 |
-
|
417 |
);
|
418 |
}
|
419 |
|
@@ -432,7 +432,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
432 |
* @return WPSEO_Metabox_Section_Additional[]
|
433 |
*/
|
434 |
protected function get_additional_meta_sections() {
|
435 |
-
$sections =
|
436 |
|
437 |
/**
|
438 |
* Private filter: 'yoast_free_additional_metabox_sections'.
|
@@ -459,11 +459,11 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
459 |
* }
|
460 |
* }
|
461 |
*/
|
462 |
-
$requested_sections = apply_filters( 'yoast_free_additional_metabox_sections',
|
463 |
|
464 |
foreach ( $requested_sections as $section ) {
|
465 |
if ( is_array( $section ) && array_key_exists( 'name', $section ) && array_key_exists( 'link_content', $section ) && array_key_exists( 'content', $section ) ) {
|
466 |
-
$options = array_key_exists( 'options', $section ) ? $section['options'] :
|
467 |
$sections[] = new WPSEO_Metabox_Section_Additional(
|
468 |
$section['name'],
|
469 |
$section['link_content'],
|
@@ -548,7 +548,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
548 |
$content .= '<input type="hidden" id="' . $esc_form_key . '" name="' . $esc_form_key . '" value="' . esc_attr( $meta_value ) . '"/>' . "\n";
|
549 |
break;
|
550 |
case 'select':
|
551 |
-
if ( isset( $meta_field_def['options'] ) && is_array( $meta_field_def['options'] ) && $meta_field_def['options'] !==
|
552 |
$content .= '<select name="' . $esc_form_key . '" id="' . $esc_form_key . '" class="yoast' . $class . '">';
|
553 |
foreach ( $meta_field_def['options'] as $val => $option ) {
|
554 |
$selected = selected( $meta_value, $val, false );
|
@@ -560,7 +560,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
560 |
break;
|
561 |
|
562 |
case 'multiselect':
|
563 |
-
if ( isset( $meta_field_def['options'] ) && is_array( $meta_field_def['options'] ) && $meta_field_def['options'] !==
|
564 |
|
565 |
// Set $meta_value as $selected_arr.
|
566 |
$selected_arr = $meta_value;
|
@@ -598,7 +598,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
598 |
break;
|
599 |
|
600 |
case 'radio':
|
601 |
-
if ( isset( $meta_field_def['options'] ) && is_array( $meta_field_def['options'] ) && $meta_field_def['options'] !==
|
602 |
foreach ( $meta_field_def['options'] as $val => $option ) {
|
603 |
$checked = checked( $meta_value, $val, false );
|
604 |
$content .= '<input type="radio" ' . $checked . ' id="' . $esc_form_key . '_' . esc_attr( $val ) . '" name="' . $esc_form_key . '" value="' . esc_attr( $val ) . '"/> <label for="' . $esc_form_key . '_' . esc_attr( $val ) . '">' . esc_html( $option ) . '</label> ';
|
@@ -721,7 +721,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
721 |
|
722 |
do_action( 'wpseo_save_compare_data', $post );
|
723 |
|
724 |
-
$meta_boxes = apply_filters( 'wpseo_save_metaboxes',
|
725 |
$meta_boxes = array_merge( $meta_boxes, WPSEO_Meta::get_meta_field_defs( 'general', $post->post_type ), WPSEO_Meta::get_meta_field_defs( 'advanced' ) );
|
726 |
|
727 |
foreach ( $meta_boxes as $key => $meta_box ) {
|
@@ -744,7 +744,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
744 |
|
745 |
// For multi-select.
|
746 |
if ( is_array( $data ) ) {
|
747 |
-
$data = array_map(
|
748 |
}
|
749 |
|
750 |
if ( is_string( $data ) ) {
|
@@ -754,7 +754,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
754 |
|
755 |
// Reset options when no entry is present with multiselect - only applies to `meta-robots-adv` currently.
|
756 |
if ( ! isset( $_POST[ $field_name ] ) && ( $meta_box['type'] === 'multiselect' ) ) {
|
757 |
-
$data =
|
758 |
}
|
759 |
}
|
760 |
|
@@ -816,7 +816,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
816 |
|
817 |
if ( $post_id !== 0 ) {
|
818 |
// Enqueue files needed for upload functionality.
|
819 |
-
wp_enqueue_media(
|
820 |
}
|
821 |
|
822 |
$asset_manager->enqueue_style( 'metabox-css' );
|
@@ -841,13 +841,13 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
841 |
$analysis_worker_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ) );
|
842 |
$used_keywords_assessment_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ), 'used-keywords-assessment' );
|
843 |
|
844 |
-
$localization_data =
|
845 |
'url' => $analysis_worker_location->get_url( $analysis_worker_location->get_asset(), WPSEO_Admin_Asset::TYPE_JS ),
|
846 |
'keywords_assessment_url' => $used_keywords_assessment_location->get_url( $used_keywords_assessment_location->get_asset(), WPSEO_Admin_Asset::TYPE_JS ),
|
847 |
'log_level' => WPSEO_Utils::get_analysis_worker_log_level(),
|
848 |
// We need to make the feature flags separately available inside of the analysis web worker.
|
849 |
'enabled_features' => WPSEO_Utils::retrieve_enabled_features(),
|
850 |
-
|
851 |
wp_localize_script(
|
852 |
WPSEO_Admin_Asset_Manager::PREFIX . 'post-scraper',
|
853 |
'wpseoAnalysisWorkerL10n',
|
@@ -873,7 +873,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
873 |
|
874 |
$asset_manager->enqueue_script( 'featured-image' );
|
875 |
|
876 |
-
$featured_image_l10 =
|
877 |
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'metabox', 'wpseoFeaturedImageL10n', $featured_image_l10 );
|
878 |
}
|
879 |
}
|
@@ -884,9 +884,9 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
884 |
* @return array
|
885 |
*/
|
886 |
public function localize_media_script() {
|
887 |
-
return
|
888 |
'choose_image' => __( 'Use Image', 'wordpress-seo' ),
|
889 |
-
|
890 |
}
|
891 |
|
892 |
/**
|
@@ -907,7 +907,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
907 |
return $GLOBALS['post'];
|
908 |
}
|
909 |
|
910 |
-
return
|
911 |
}
|
912 |
|
913 |
/**
|
@@ -916,7 +916,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
916 |
* @return array
|
917 |
*/
|
918 |
private function get_valid_shortcode_tags() {
|
919 |
-
$shortcode_tags =
|
920 |
|
921 |
foreach ( $GLOBALS['shortcode_tags'] as $tag => $description ) {
|
922 |
$shortcode_tags[] = $tag;
|
@@ -933,9 +933,9 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
933 |
private function get_replace_vars() {
|
934 |
$post = $this->get_metabox_post();
|
935 |
|
936 |
-
$cached_replacement_vars =
|
937 |
|
938 |
-
$vars_to_cache =
|
939 |
'date',
|
940 |
'id',
|
941 |
'sitename',
|
@@ -943,7 +943,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
943 |
'sep',
|
944 |
'page',
|
945 |
'currentyear',
|
946 |
-
|
947 |
|
948 |
foreach ( $vars_to_cache as $var ) {
|
949 |
$cached_replacement_vars[ $var ] = wpseo_replace_vars( '%%' . $var . '%%', $post );
|
@@ -976,10 +976,10 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
976 |
* @return array Array containing all the replacement variables.
|
977 |
*/
|
978 |
private function get_custom_replace_vars( $post ) {
|
979 |
-
return
|
980 |
'custom_fields' => $this->get_custom_fields_replace_vars( $post ),
|
981 |
'custom_taxonomies' => $this->get_custom_taxonomies_replace_vars( $post ),
|
982 |
-
|
983 |
}
|
984 |
|
985 |
/**
|
@@ -991,7 +991,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
991 |
*/
|
992 |
private function get_custom_taxonomies_replace_vars( $post ) {
|
993 |
$taxonomies = get_object_taxonomies( $post, 'objects' );
|
994 |
-
$custom_replace_vars =
|
995 |
|
996 |
foreach ( $taxonomies as $taxonomy_name => $taxonomy ) {
|
997 |
|
@@ -1004,10 +1004,10 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
1004 |
continue;
|
1005 |
}
|
1006 |
|
1007 |
-
$custom_replace_vars[ $taxonomy_name ] =
|
1008 |
'name' => $taxonomy->name,
|
1009 |
'description' => $taxonomy->description,
|
1010 |
-
|
1011 |
}
|
1012 |
|
1013 |
return $custom_replace_vars;
|
@@ -1021,7 +1021,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
|
1021 |
* @return array Array containing all the replacement variables.
|
1022 |
*/
|
1023 |
private function get_custom_fields_replace_vars( $post ) {
|
1024 |
-
$custom_replace_vars =
|
1025 |
|
1026 |
// If no post object is passed, return the empty custom_replace_vars array.
|
1027 |
if ( ! is_object( $post ) ) {
|
43 |
*/
|
44 |
public function __construct() {
|
45 |
if ( $this->is_internet_explorer() ) {
|
46 |
+
add_action( 'add_meta_boxes', [ $this, 'internet_explorer_metabox' ] );
|
47 |
return;
|
48 |
}
|
49 |
|
50 |
+
add_action( 'add_meta_boxes', [ $this, 'add_meta_box' ] );
|
51 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] );
|
52 |
+
add_action( 'wp_insert_post', [ $this, 'save_postdata' ] );
|
53 |
+
add_action( 'edit_attachment', [ $this, 'save_postdata' ] );
|
54 |
+
add_action( 'add_attachment', [ $this, 'save_postdata' ] );
|
55 |
+
add_action( 'admin_init', [ $this, 'translate_meta_boxes' ] );
|
56 |
|
57 |
// Check if one of the social settings is checked in the options, if so, initialize the social_admin object.
|
58 |
if ( WPSEO_Options::get( 'opengraph', false ) || WPSEO_Options::get( 'twitter', false ) ) {
|
86 |
*/
|
87 |
public function internet_explorer_metabox() {
|
88 |
$post_types = WPSEO_Post_Type::get_accessible_post_types();
|
89 |
+
$post_types = array_filter( $post_types, [ $this, 'display_metabox' ] );
|
90 |
|
91 |
+
if ( ! is_array( $post_types ) || $post_types === [] ) {
|
92 |
return;
|
93 |
}
|
94 |
|
95 |
$product_title = $this->get_product_title();
|
96 |
|
97 |
foreach ( $post_types as $post_type ) {
|
98 |
+
add_filter( "postbox_classes_{$post_type}_wpseo_meta", [ $this, 'wpseo_metabox_class' ] );
|
99 |
|
100 |
add_meta_box(
|
101 |
'wpseo_meta',
|
102 |
$product_title,
|
103 |
+
[ $this, 'render_internet_explorer_notice' ],
|
104 |
$post_type,
|
105 |
'normal',
|
106 |
apply_filters( 'wpseo_metabox_prio', 'high' ),
|
107 |
+
[ '__block_editor_compatible_meta_box' => true ]
|
108 |
);
|
109 |
}
|
110 |
}
|
200 |
*/
|
201 |
public function add_meta_box() {
|
202 |
$post_types = WPSEO_Post_Type::get_accessible_post_types();
|
203 |
+
$post_types = array_filter( $post_types, [ $this, 'display_metabox' ] );
|
204 |
|
205 |
+
if ( ! is_array( $post_types ) || $post_types === [] ) {
|
206 |
return;
|
207 |
}
|
208 |
|
209 |
$product_title = $this->get_product_title();
|
210 |
|
211 |
foreach ( $post_types as $post_type ) {
|
212 |
+
add_filter( "postbox_classes_{$post_type}_wpseo_meta", [ $this, 'wpseo_metabox_class' ] );
|
213 |
|
214 |
add_meta_box(
|
215 |
'wpseo_meta',
|
216 |
$product_title,
|
217 |
+
[ $this, 'meta_box' ],
|
218 |
$post_type,
|
219 |
'normal',
|
220 |
apply_filters( 'wpseo_metabox_prio', 'high' ),
|
221 |
+
[ '__block_editor_compatible_meta_box' => true ]
|
222 |
);
|
223 |
}
|
224 |
}
|
251 |
}
|
252 |
|
253 |
$post_formatter = new WPSEO_Metabox_Formatter(
|
254 |
+
new WPSEO_Post_Metabox_Formatter( $post, [], $permalink )
|
255 |
);
|
256 |
|
257 |
$values = $post_formatter->get_values();
|
269 |
* Passes some variables to js for replacing variables.
|
270 |
*/
|
271 |
public function localize_replace_vars_script() {
|
272 |
+
return [
|
273 |
'no_parent_text' => __( '(no parent)', 'wordpress-seo' ),
|
274 |
'replace_vars' => $this->get_replace_vars(),
|
275 |
'recommended_replace_vars' => $this->get_recommended_replace_vars(),
|
276 |
'scope' => $this->determine_scope(),
|
277 |
'has_taxonomies' => $this->current_post_type_has_taxonomies(),
|
278 |
+
];
|
279 |
}
|
280 |
|
281 |
/**
|
311 |
* @return array
|
312 |
*/
|
313 |
public function localize_shortcode_plugin_script() {
|
314 |
+
return [
|
315 |
'wpseo_filter_shortcodes_nonce' => wp_create_nonce( 'wpseo-filter-shortcodes' ),
|
316 |
'wpseo_shortcode_tags' => $this->get_valid_shortcode_tags(),
|
317 |
+
];
|
318 |
}
|
319 |
|
320 |
/**
|
350 |
* @return WPSEO_Metabox_Section[]
|
351 |
*/
|
352 |
private function get_content_sections() {
|
353 |
+
$content_sections = [];
|
354 |
|
355 |
$content_sections[] = $this->get_seo_meta_section();
|
356 |
|
389 |
$advanced_collapsible = new WPSEO_Paper_Presenter(
|
390 |
__( 'Advanced', 'wordpress-seo' ),
|
391 |
null,
|
392 |
+
[
|
393 |
'collapsible' => true,
|
394 |
'class' => 'metabox wpseo-form wpseo-collapsible-container',
|
395 |
'content' => $this->get_tab_content( 'advanced' ),
|
396 |
'paper_id' => 'collapsible-advanced-settings',
|
397 |
+
]
|
398 |
);
|
399 |
|
400 |
$html_after = '<div class="wpseo_content_wrapper">' . $advanced_collapsible->get_output() . '</div>';
|
411 |
'content',
|
412 |
$label,
|
413 |
$content,
|
414 |
+
[
|
415 |
'html_after' => $html_after,
|
416 |
+
]
|
417 |
);
|
418 |
}
|
419 |
|
432 |
* @return WPSEO_Metabox_Section_Additional[]
|
433 |
*/
|
434 |
protected function get_additional_meta_sections() {
|
435 |
+
$sections = [];
|
436 |
|
437 |
/**
|
438 |
* Private filter: 'yoast_free_additional_metabox_sections'.
|
459 |
* }
|
460 |
* }
|
461 |
*/
|
462 |
+
$requested_sections = apply_filters( 'yoast_free_additional_metabox_sections', [] );
|
463 |
|
464 |
foreach ( $requested_sections as $section ) {
|
465 |
if ( is_array( $section ) && array_key_exists( 'name', $section ) && array_key_exists( 'link_content', $section ) && array_key_exists( 'content', $section ) ) {
|
466 |
+
$options = array_key_exists( 'options', $section ) ? $section['options'] : [];
|
467 |
$sections[] = new WPSEO_Metabox_Section_Additional(
|
468 |
$section['name'],
|
469 |
$section['link_content'],
|
548 |
$content .= '<input type="hidden" id="' . $esc_form_key . '" name="' . $esc_form_key . '" value="' . esc_attr( $meta_value ) . '"/>' . "\n";
|
549 |
break;
|
550 |
case 'select':
|
551 |
+
if ( isset( $meta_field_def['options'] ) && is_array( $meta_field_def['options'] ) && $meta_field_def['options'] !== [] ) {
|
552 |
$content .= '<select name="' . $esc_form_key . '" id="' . $esc_form_key . '" class="yoast' . $class . '">';
|
553 |
foreach ( $meta_field_def['options'] as $val => $option ) {
|
554 |
$selected = selected( $meta_value, $val, false );
|
560 |
break;
|
561 |
|
562 |
case 'multiselect':
|
563 |
+
if ( isset( $meta_field_def['options'] ) && is_array( $meta_field_def['options'] ) && $meta_field_def['options'] !== [] ) {
|
564 |
|
565 |
// Set $meta_value as $selected_arr.
|
566 |
$selected_arr = $meta_value;
|
598 |
break;
|
599 |
|
600 |
case 'radio':
|
601 |
+
if ( isset( $meta_field_def['options'] ) && is_array( $meta_field_def['options'] ) && $meta_field_def['options'] !== [] ) {
|
602 |
foreach ( $meta_field_def['options'] as $val => $option ) {
|
603 |
$checked = checked( $meta_value, $val, false );
|
604 |
$content .= '<input type="radio" ' . $checked . ' id="' . $esc_form_key . '_' . esc_attr( $val ) . '" name="' . $esc_form_key . '" value="' . esc_attr( $val ) . '"/> <label for="' . $esc_form_key . '_' . esc_attr( $val ) . '">' . esc_html( $option ) . '</label> ';
|
721 |
|
722 |
do_action( 'wpseo_save_compare_data', $post );
|
723 |
|
724 |
+
$meta_boxes = apply_filters( 'wpseo_save_metaboxes', [] );
|
725 |
$meta_boxes = array_merge( $meta_boxes, WPSEO_Meta::get_meta_field_defs( 'general', $post->post_type ), WPSEO_Meta::get_meta_field_defs( 'advanced' ) );
|
726 |
|
727 |
foreach ( $meta_boxes as $key => $meta_box ) {
|
744 |
|
745 |
// For multi-select.
|
746 |
if ( is_array( $data ) ) {
|
747 |
+
$data = array_map( [ 'WPSEO_Utils', 'sanitize_text_field' ], $data );
|
748 |
}
|
749 |
|
750 |
if ( is_string( $data ) ) {
|
754 |
|
755 |
// Reset options when no entry is present with multiselect - only applies to `meta-robots-adv` currently.
|
756 |
if ( ! isset( $_POST[ $field_name ] ) && ( $meta_box['type'] === 'multiselect' ) ) {
|
757 |
+
$data = [];
|
758 |
}
|
759 |
}
|
760 |
|
816 |
|
817 |
if ( $post_id !== 0 ) {
|
818 |
// Enqueue files needed for upload functionality.
|
819 |
+
wp_enqueue_media( [ 'post' => $post_id ] );
|
820 |
}
|
821 |
|
822 |
$asset_manager->enqueue_style( 'metabox-css' );
|
841 |
$analysis_worker_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ) );
|
842 |
$used_keywords_assessment_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ), 'used-keywords-assessment' );
|
843 |
|
844 |
+
$localization_data = [
|
845 |
'url' => $analysis_worker_location->get_url( $analysis_worker_location->get_asset(), WPSEO_Admin_Asset::TYPE_JS ),
|
846 |
'keywords_assessment_url' => $used_keywords_assessment_location->get_url( $used_keywords_assessment_location->get_asset(), WPSEO_Admin_Asset::TYPE_JS ),
|
847 |
'log_level' => WPSEO_Utils::get_analysis_worker_log_level(),
|
848 |
// We need to make the feature flags separately available inside of the analysis web worker.
|
849 |
'enabled_features' => WPSEO_Utils::retrieve_enabled_features(),
|
850 |
+
];
|
851 |
wp_localize_script(
|
852 |
WPSEO_Admin_Asset_Manager::PREFIX . 'post-scraper',
|
853 |
'wpseoAnalysisWorkerL10n',
|
873 |
|
874 |
$asset_manager->enqueue_script( 'featured-image' );
|
875 |
|
876 |
+
$featured_image_l10 = [ 'featured_image_notice' => __( 'SEO issue: The featured image should be at least 200 by 200 pixels to be picked up by Facebook and other social media sites.', 'wordpress-seo' ) ];
|
877 |
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'metabox', 'wpseoFeaturedImageL10n', $featured_image_l10 );
|
878 |
}
|
879 |
}
|
884 |
* @return array
|
885 |
*/
|
886 |
public function localize_media_script() {
|
887 |
+
return [
|
888 |
'choose_image' => __( 'Use Image', 'wordpress-seo' ),
|
889 |
+
];
|
890 |
}
|
891 |
|
892 |
/**
|
907 |
return $GLOBALS['post'];
|
908 |
}
|
909 |
|
910 |
+
return [];
|
911 |
}
|
912 |
|
913 |
/**
|
916 |
* @return array
|
917 |
*/
|
918 |
private function get_valid_shortcode_tags() {
|
919 |
+
$shortcode_tags = [];
|
920 |
|
921 |
foreach ( $GLOBALS['shortcode_tags'] as $tag => $description ) {
|
922 |
$shortcode_tags[] = $tag;
|
933 |
private function get_replace_vars() {
|
934 |
$post = $this->get_metabox_post();
|
935 |
|
936 |
+
$cached_replacement_vars = [];
|
937 |
|
938 |
+
$vars_to_cache = [
|
939 |
'date',
|
940 |
'id',
|
941 |
'sitename',
|
943 |
'sep',
|
944 |
'page',
|
945 |
'currentyear',
|
946 |
+
];
|
947 |
|
948 |
foreach ( $vars_to_cache as $var ) {
|
949 |
$cached_replacement_vars[ $var ] = wpseo_replace_vars( '%%' . $var . '%%', $post );
|
976 |
* @return array Array containing all the replacement variables.
|
977 |
*/
|
978 |
private function get_custom_replace_vars( $post ) {
|
979 |
+
return [
|
980 |
'custom_fields' => $this->get_custom_fields_replace_vars( $post ),
|
981 |
'custom_taxonomies' => $this->get_custom_taxonomies_replace_vars( $post ),
|
982 |
+
];
|
983 |
}
|
984 |
|
985 |
/**
|
991 |
*/
|
992 |
private function get_custom_taxonomies_replace_vars( $post ) {
|
993 |
$taxonomies = get_object_taxonomies( $post, 'objects' );
|
994 |
+
$custom_replace_vars = [];
|
995 |
|
996 |
foreach ( $taxonomies as $taxonomy_name => $taxonomy ) {
|
997 |
|
1004 |
continue;
|
1005 |
}
|
1006 |
|
1007 |
+
$custom_replace_vars[ $taxonomy_name ] = [
|
1008 |
'name' => $taxonomy->name,
|
1009 |
'description' => $taxonomy->description,
|
1010 |
+
];
|
1011 |
}
|
1012 |
|
1013 |
return $custom_replace_vars;
|
1021 |
* @return array Array containing all the replacement variables.
|
1022 |
*/
|
1023 |
private function get_custom_fields_replace_vars( $post ) {
|
1024 |
+
$custom_replace_vars = [];
|
1025 |
|
1026 |
// If no post object is passed, return the empty custom_replace_vars array.
|
1027 |
if ( ! is_object( $post ) ) {
|
admin/notifiers/class-post-type-archive-notification-handler.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Post_Type_Archive_Notification_Handler extends WPSEO_Dismissible_Not
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $option_defaults =
|
19 |
|
20 |
/**
|
21 |
* Sets the notification identifier.
|
@@ -42,7 +42,7 @@ class WPSEO_Post_Type_Archive_Notification_Handler extends WPSEO_Dismissible_Not
|
|
42 |
return false;
|
43 |
}
|
44 |
|
45 |
-
return $this->get_post_types() !==
|
46 |
}
|
47 |
|
48 |
/**
|
@@ -75,12 +75,12 @@ class WPSEO_Post_Type_Archive_Notification_Handler extends WPSEO_Dismissible_Not
|
|
75 |
$message .= PHP_EOL . PHP_EOL;
|
76 |
$message .= '<a class="button" href="' . admin_url( '?page=' . WPSEO_Admin::PAGE_IDENTIFIER . '&yoast_dismiss=' . $this->notification_identifier ) . '">' . __( 'Remove this message', 'wordpress-seo' ) . '</a>';
|
77 |
|
78 |
-
$notification_options =
|
79 |
'type' => Yoast_Notification::WARNING,
|
80 |
'id' => 'wpseo-' . $this->notification_identifier,
|
81 |
'priority' => 1.0,
|
82 |
'capabilities' => 'wpseo_manage_options',
|
83 |
-
|
84 |
|
85 |
return new Yoast_Notification( $message, $notification_options );
|
86 |
}
|
@@ -109,11 +109,11 @@ class WPSEO_Post_Type_Archive_Notification_Handler extends WPSEO_Dismissible_Not
|
|
109 |
if ( $post_types === null ) {
|
110 |
$this->option_defaults = WPSEO_Option_Titles::get_instance()->get_defaults();
|
111 |
|
112 |
-
$post_types = get_post_types(
|
113 |
$post_types = WPSEO_Post_Type::filter_attachment_post_type( $post_types );
|
114 |
$post_types = $this->filter_woocommerce_product_type( $post_types );
|
115 |
-
$post_types = array_filter( $post_types,
|
116 |
-
$post_types = array_filter( $post_types,
|
117 |
}
|
118 |
|
119 |
return $post_types;
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $option_defaults = [];
|
19 |
|
20 |
/**
|
21 |
* Sets the notification identifier.
|
42 |
return false;
|
43 |
}
|
44 |
|
45 |
+
return $this->get_post_types() !== [];
|
46 |
}
|
47 |
|
48 |
/**
|
75 |
$message .= PHP_EOL . PHP_EOL;
|
76 |
$message .= '<a class="button" href="' . admin_url( '?page=' . WPSEO_Admin::PAGE_IDENTIFIER . '&yoast_dismiss=' . $this->notification_identifier ) . '">' . __( 'Remove this message', 'wordpress-seo' ) . '</a>';
|
77 |
|
78 |
+
$notification_options = [
|
79 |
'type' => Yoast_Notification::WARNING,
|
80 |
'id' => 'wpseo-' . $this->notification_identifier,
|
81 |
'priority' => 1.0,
|
82 |
'capabilities' => 'wpseo_manage_options',
|
83 |
+
];
|
84 |
|
85 |
return new Yoast_Notification( $message, $notification_options );
|
86 |
}
|
109 |
if ( $post_types === null ) {
|
110 |
$this->option_defaults = WPSEO_Option_Titles::get_instance()->get_defaults();
|
111 |
|
112 |
+
$post_types = get_post_types( [ 'public' => true ] );
|
113 |
$post_types = WPSEO_Post_Type::filter_attachment_post_type( $post_types );
|
114 |
$post_types = $this->filter_woocommerce_product_type( $post_types );
|
115 |
+
$post_types = array_filter( $post_types, [ $this, 'has_custom_archive_slug' ] );
|
116 |
+
$post_types = array_filter( $post_types, [ $this, 'has_default_templates_set' ] );
|
117 |
}
|
118 |
|
119 |
return $post_types;
|
admin/onpage/class-onpage-option.php
CHANGED
@@ -142,10 +142,10 @@ class WPSEO_OnPage_Option {
|
|
142 |
* @return array
|
143 |
*/
|
144 |
private function get_option() {
|
145 |
-
$default =
|
146 |
self::STATUS => self::NOT_FETCHED,
|
147 |
self::LAST_FETCH => 0,
|
148 |
-
|
149 |
|
150 |
return get_option( self::OPTION_NAME, $default );
|
151 |
}
|
142 |
* @return array
|
143 |
*/
|
144 |
private function get_option() {
|
145 |
+
$default = [
|
146 |
self::STATUS => self::NOT_FETCHED,
|
147 |
self::LAST_FETCH => 0,
|
148 |
+
];
|
149 |
|
150 |
return get_option( self::OPTION_NAME, $default );
|
151 |
}
|
admin/onpage/class-onpage-request.php
CHANGED
@@ -28,12 +28,12 @@ class WPSEO_OnPage_Request {
|
|
28 |
* @return array
|
29 |
* @throws Exception The error message that can be used to show to the user.
|
30 |
*/
|
31 |
-
protected function get_remote( $target_url, $parameters =
|
32 |
-
$defaults =
|
33 |
'url' => $target_url,
|
34 |
'wp_version' => $GLOBALS['wp_version'],
|
35 |
'yseo_version' => WPSEO_VERSION,
|
36 |
-
|
37 |
$parameters = array_merge( $defaults, $parameters );
|
38 |
|
39 |
$url = add_query_arg( $parameters, $this->onpage_endpoint );
|
@@ -57,7 +57,7 @@ class WPSEO_OnPage_Request {
|
|
57 |
*
|
58 |
* @return array
|
59 |
*/
|
60 |
-
public function do_request( $target_url, $parameters =
|
61 |
$json_body = $this->get_remote( $target_url, $parameters );
|
62 |
|
63 |
// Ryte recognized a redirect, fetch the data of that URL by calling this method with the value from Ryte.
|
28 |
* @return array
|
29 |
* @throws Exception The error message that can be used to show to the user.
|
30 |
*/
|
31 |
+
protected function get_remote( $target_url, $parameters = [] ) {
|
32 |
+
$defaults = [
|
33 |
'url' => $target_url,
|
34 |
'wp_version' => $GLOBALS['wp_version'],
|
35 |
'yseo_version' => WPSEO_VERSION,
|
36 |
+
];
|
37 |
$parameters = array_merge( $defaults, $parameters );
|
38 |
|
39 |
$url = add_query_arg( $parameters, $this->onpage_endpoint );
|
57 |
*
|
58 |
* @return array
|
59 |
*/
|
60 |
+
public function do_request( $target_url, $parameters = [] ) {
|
61 |
$json_body = $this->get_remote( $target_url, $parameters );
|
62 |
|
63 |
// Ryte recognized a redirect, fetch the data of that URL by calling this method with the value from Ryte.
|
admin/onpage/class-onpage.php
CHANGED
@@ -38,17 +38,17 @@ class WPSEO_OnPage implements WPSEO_WordPress_Integration {
|
|
38 |
*/
|
39 |
public function register_hooks() {
|
40 |
// Adds admin notice if necessary.
|
41 |
-
add_filter( 'admin_init',
|
42 |
|
43 |
if ( ! self::is_active() ) {
|
44 |
return;
|
45 |
}
|
46 |
|
47 |
// Adds weekly schedule to the cron job schedules.
|
48 |
-
add_filter( 'cron_schedules',
|
49 |
|
50 |
// Sets the action for the Ryte fetch.
|
51 |
-
add_action( 'wpseo_onpage_fetch',
|
52 |
}
|
53 |
|
54 |
/**
|
@@ -108,13 +108,13 @@ class WPSEO_OnPage implements WPSEO_WordPress_Integration {
|
|
108 |
*/
|
109 |
public function add_weekly_schedule( $schedules ) {
|
110 |
if ( ! is_array( $schedules ) ) {
|
111 |
-
$schedules =
|
112 |
}
|
113 |
|
114 |
-
$schedules['weekly'] =
|
115 |
'interval' => WEEK_IN_SECONDS,
|
116 |
'display' => __( 'Once Weekly', 'wordpress-seo' ),
|
117 |
-
|
118 |
|
119 |
return $schedules;
|
120 |
}
|
@@ -176,11 +176,11 @@ class WPSEO_OnPage implements WPSEO_WordPress_Integration {
|
|
176 |
|
177 |
return new Yoast_Notification(
|
178 |
$notice,
|
179 |
-
|
180 |
'type' => Yoast_Notification::ERROR,
|
181 |
'id' => 'wpseo-dismiss-onpageorg',
|
182 |
'capabilities' => 'wpseo_manage_options',
|
183 |
-
|
184 |
);
|
185 |
}
|
186 |
|
@@ -190,7 +190,7 @@ class WPSEO_OnPage implements WPSEO_WordPress_Integration {
|
|
190 |
* @return int|bool The indexability value.
|
191 |
*/
|
192 |
protected function request_indexability() {
|
193 |
-
$parameters =
|
194 |
if ( $this->wordfence_protection_enabled() ) {
|
195 |
$parameters['wf_strict'] = 1;
|
196 |
}
|
@@ -275,7 +275,7 @@ class WPSEO_OnPage implements WPSEO_WordPress_Integration {
|
|
275 |
if ( filter_input( INPUT_GET, 'wpseo-redo-onpage' ) === '1' ) {
|
276 |
$this->is_manual_request = true;
|
277 |
|
278 |
-
add_action( 'admin_init',
|
279 |
}
|
280 |
}
|
281 |
|
38 |
*/
|
39 |
public function register_hooks() {
|
40 |
// Adds admin notice if necessary.
|
41 |
+
add_filter( 'admin_init', [ $this, 'show_notice' ] );
|
42 |
|
43 |
if ( ! self::is_active() ) {
|
44 |
return;
|
45 |
}
|
46 |
|
47 |
// Adds weekly schedule to the cron job schedules.
|
48 |
+
add_filter( 'cron_schedules', [ $this, 'add_weekly_schedule' ] );
|
49 |
|
50 |
// Sets the action for the Ryte fetch.
|
51 |
+
add_action( 'wpseo_onpage_fetch', [ $this, 'fetch_from_onpage' ] );
|
52 |
}
|
53 |
|
54 |
/**
|
108 |
*/
|
109 |
public function add_weekly_schedule( $schedules ) {
|
110 |
if ( ! is_array( $schedules ) ) {
|
111 |
+
$schedules = [];
|
112 |
}
|
113 |
|
114 |
+
$schedules['weekly'] = [
|
115 |
'interval' => WEEK_IN_SECONDS,
|
116 |
'display' => __( 'Once Weekly', 'wordpress-seo' ),
|
117 |
+
];
|
118 |
|
119 |
return $schedules;
|
120 |
}
|
176 |
|
177 |
return new Yoast_Notification(
|
178 |
$notice,
|
179 |
+
[
|
180 |
'type' => Yoast_Notification::ERROR,
|
181 |
'id' => 'wpseo-dismiss-onpageorg',
|
182 |
'capabilities' => 'wpseo_manage_options',
|
183 |
+
]
|
184 |
);
|
185 |
}
|
186 |
|
190 |
* @return int|bool The indexability value.
|
191 |
*/
|
192 |
protected function request_indexability() {
|
193 |
+
$parameters = [];
|
194 |
if ( $this->wordfence_protection_enabled() ) {
|
195 |
$parameters['wf_strict'] = 1;
|
196 |
}
|
275 |
if ( filter_input( INPUT_GET, 'wpseo-redo-onpage' ) === '1' ) {
|
276 |
$this->is_manual_request = true;
|
277 |
|
278 |
+
add_action( 'admin_init', [ $this, 'fetch_from_onpage' ] );
|
279 |
}
|
280 |
}
|
281 |
|
admin/onpage/class-ryte-service.php
CHANGED
@@ -41,7 +41,7 @@ class WPSEO_Ryte_Service {
|
|
41 |
$result = $this->get_score( $this->option->get_status(), $this->option->should_be_fetched() );
|
42 |
}
|
43 |
|
44 |
-
return new WP_REST_Response(
|
45 |
}
|
46 |
|
47 |
/**
|
@@ -54,11 +54,11 @@ class WPSEO_Ryte_Service {
|
|
54 |
*/
|
55 |
private function get_score( $status, $fetch = false ) {
|
56 |
if ( $status === WPSEO_OnPage_Option::IS_INDEXABLE ) {
|
57 |
-
return
|
58 |
'score' => 'good',
|
59 |
'label' => __( 'Your homepage can be indexed by search engines.', 'wordpress-seo' ),
|
60 |
'can_fetch' => $fetch,
|
61 |
-
|
62 |
}
|
63 |
|
64 |
if ( $status === WPSEO_OnPage_Option::IS_NOT_INDEXABLE ) {
|
@@ -70,11 +70,11 @@ class WPSEO_Ryte_Service {
|
|
70 |
'</a>'
|
71 |
);
|
72 |
|
73 |
-
return
|
74 |
'score' => 'bad',
|
75 |
'label' => $label,
|
76 |
'can_fetch' => $fetch,
|
77 |
-
|
78 |
}
|
79 |
|
80 |
if ( $status === WPSEO_OnPage_Option::CANNOT_FETCH ) {
|
@@ -88,11 +88,11 @@ class WPSEO_Ryte_Service {
|
|
88 |
'Ryte'
|
89 |
);
|
90 |
|
91 |
-
return
|
92 |
'score' => 'na',
|
93 |
'label' => $label,
|
94 |
'can_fetch' => $fetch,
|
95 |
-
|
96 |
}
|
97 |
|
98 |
if ( $status === WPSEO_OnPage_Option::NOT_FETCHED ) {
|
@@ -100,13 +100,13 @@ class WPSEO_Ryte_Service {
|
|
100 |
$label = __( '%1$s has not fetched your site\'s indexability status yet from %2$s', 'wordpress-seo' );
|
101 |
$label = sprintf( $label, 'Yoast SEO', 'Ryte' );
|
102 |
|
103 |
-
return
|
104 |
'score' => 'na',
|
105 |
'label' => esc_html( $label ),
|
106 |
'can_fetch' => $fetch,
|
107 |
-
|
108 |
}
|
109 |
|
110 |
-
return
|
111 |
}
|
112 |
}
|
41 |
$result = $this->get_score( $this->option->get_status(), $this->option->should_be_fetched() );
|
42 |
}
|
43 |
|
44 |
+
return new WP_REST_Response( [ 'ryte' => $result ] );
|
45 |
}
|
46 |
|
47 |
/**
|
54 |
*/
|
55 |
private function get_score( $status, $fetch = false ) {
|
56 |
if ( $status === WPSEO_OnPage_Option::IS_INDEXABLE ) {
|
57 |
+
return [
|
58 |
'score' => 'good',
|
59 |
'label' => __( 'Your homepage can be indexed by search engines.', 'wordpress-seo' ),
|
60 |
'can_fetch' => $fetch,
|
61 |
+
];
|
62 |
}
|
63 |
|
64 |
if ( $status === WPSEO_OnPage_Option::IS_NOT_INDEXABLE ) {
|
70 |
'</a>'
|
71 |
);
|
72 |
|
73 |
+
return [
|
74 |
'score' => 'bad',
|
75 |
'label' => $label,
|
76 |
'can_fetch' => $fetch,
|
77 |
+
];
|
78 |
}
|
79 |
|
80 |
if ( $status === WPSEO_OnPage_Option::CANNOT_FETCH ) {
|
88 |
'Ryte'
|
89 |
);
|
90 |
|
91 |
+
return [
|
92 |
'score' => 'na',
|
93 |
'label' => $label,
|
94 |
'can_fetch' => $fetch,
|
95 |
+
];
|
96 |
}
|
97 |
|
98 |
if ( $status === WPSEO_OnPage_Option::NOT_FETCHED ) {
|
100 |
$label = __( '%1$s has not fetched your site\'s indexability status yet from %2$s', 'wordpress-seo' );
|
101 |
$label = sprintf( $label, 'Yoast SEO', 'Ryte' );
|
102 |
|
103 |
+
return [
|
104 |
'score' => 'na',
|
105 |
'label' => esc_html( $label ),
|
106 |
'can_fetch' => $fetch,
|
107 |
+
];
|
108 |
}
|
109 |
|
110 |
+
return [];
|
111 |
}
|
112 |
}
|
admin/pages/dashboard.php
CHANGED
@@ -37,9 +37,9 @@ $tabs->add_tab(
|
|
37 |
new WPSEO_Option_Tab(
|
38 |
'dashboard',
|
39 |
__( 'Dashboard', 'wordpress-seo' ),
|
40 |
-
|
41 |
'save_button' => false,
|
42 |
-
|
43 |
)
|
44 |
);
|
45 |
$tabs->add_tab(
|
37 |
new WPSEO_Option_Tab(
|
38 |
'dashboard',
|
39 |
__( 'Dashboard', 'wordpress-seo' ),
|
40 |
+
[
|
41 |
'save_button' => false,
|
42 |
+
]
|
43 |
)
|
44 |
);
|
45 |
$tabs->add_tab(
|
admin/pages/network.php
CHANGED
@@ -17,7 +17,7 @@ $yform->admin_header( true, 'wpseo_ms' );
|
|
17 |
$tabs = new WPSEO_Option_Tabs( 'network' );
|
18 |
$tabs->add_tab( new WPSEO_Option_Tab( 'general', __( 'General', 'wordpress-seo' ) ) );
|
19 |
$tabs->add_tab( new WPSEO_Option_Tab( 'features', __( 'Features', 'wordpress-seo' ) ) );
|
20 |
-
$tabs->add_tab( new WPSEO_Option_Tab( 'restore-site', __( 'Restore Site', 'wordpress-seo' ),
|
21 |
$tabs->display( $yform );
|
22 |
|
23 |
$yform->admin_footer();
|
17 |
$tabs = new WPSEO_Option_Tabs( 'network' );
|
18 |
$tabs->add_tab( new WPSEO_Option_Tab( 'general', __( 'General', 'wordpress-seo' ) ) );
|
19 |
$tabs->add_tab( new WPSEO_Option_Tab( 'features', __( 'Features', 'wordpress-seo' ) ) );
|
20 |
+
$tabs->add_tab( new WPSEO_Option_Tab( 'restore-site', __( 'Restore Site', 'wordpress-seo' ), [ 'save_button' => false ] ) );
|
21 |
$tabs->display( $yform );
|
22 |
|
23 |
$yform->admin_footer();
|
admin/pages/tools.php
CHANGED
@@ -18,24 +18,24 @@ $yform->admin_header( false );
|
|
18 |
|
19 |
if ( '' === $tool_page ) {
|
20 |
|
21 |
-
$tools =
|
22 |
|
23 |
-
$tools['import-export'] =
|
24 |
'title' => __( 'Import and Export', 'wordpress-seo' ),
|
25 |
'desc' => __( 'Import settings from other SEO plugins and export your settings for re-use on (another) blog.', 'wordpress-seo' ),
|
26 |
-
|
27 |
|
28 |
if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) {
|
29 |
-
$tools['file-editor'] =
|
30 |
'title' => __( 'File editor', 'wordpress-seo' ),
|
31 |
'desc' => __( 'This tool allows you to quickly change important files for your SEO, like your robots.txt and, if you have one, your .htaccess file.', 'wordpress-seo' ),
|
32 |
-
|
33 |
}
|
34 |
|
35 |
-
$tools['bulk-editor'] =
|
36 |
'title' => __( 'Bulk editor', 'wordpress-seo' ),
|
37 |
'desc' => __( 'This tool allows you to quickly change titles and descriptions of your posts and pages without having to go into the editor for each page.', 'wordpress-seo' ),
|
38 |
-
|
39 |
|
40 |
echo '<p>';
|
41 |
printf(
|
@@ -50,7 +50,7 @@ if ( '' === $tool_page ) {
|
|
50 |
$admin_url = admin_url( 'admin.php?page=wpseo_tools' );
|
51 |
|
52 |
foreach ( $tools as $slug => $tool ) {
|
53 |
-
$href = ( ! empty( $tool['href'] ) ) ? $admin_url . $tool['href'] : add_query_arg(
|
54 |
$attr = ( ! empty( $tool['attr'] ) ) ? $tool['attr'] : '';
|
55 |
|
56 |
echo '<li>';
|
@@ -72,7 +72,7 @@ if ( '' === $tool_page ) {
|
|
72 |
else {
|
73 |
echo '<a href="', esc_url( admin_url( 'admin.php?page=wpseo_tools' ) ), '">', esc_html__( '« Back to Tools page', 'wordpress-seo' ), '</a>';
|
74 |
|
75 |
-
$tool_pages =
|
76 |
|
77 |
if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) {
|
78 |
$tool_pages[] = 'file-editor';
|
18 |
|
19 |
if ( '' === $tool_page ) {
|
20 |
|
21 |
+
$tools = [];
|
22 |
|
23 |
+
$tools['import-export'] = [
|
24 |
'title' => __( 'Import and Export', 'wordpress-seo' ),
|
25 |
'desc' => __( 'Import settings from other SEO plugins and export your settings for re-use on (another) blog.', 'wordpress-seo' ),
|
26 |
+
];
|
27 |
|
28 |
if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) {
|
29 |
+
$tools['file-editor'] = [
|
30 |
'title' => __( 'File editor', 'wordpress-seo' ),
|
31 |
'desc' => __( 'This tool allows you to quickly change important files for your SEO, like your robots.txt and, if you have one, your .htaccess file.', 'wordpress-seo' ),
|
32 |
+
];
|
33 |
}
|
34 |
|
35 |
+
$tools['bulk-editor'] = [
|
36 |
'title' => __( 'Bulk editor', 'wordpress-seo' ),
|
37 |
'desc' => __( 'This tool allows you to quickly change titles and descriptions of your posts and pages without having to go into the editor for each page.', 'wordpress-seo' ),
|
38 |
+
];
|
39 |
|
40 |
echo '<p>';
|
41 |
printf(
|
50 |
$admin_url = admin_url( 'admin.php?page=wpseo_tools' );
|
51 |
|
52 |
foreach ( $tools as $slug => $tool ) {
|
53 |
+
$href = ( ! empty( $tool['href'] ) ) ? $admin_url . $tool['href'] : add_query_arg( [ 'tool' => $slug ], $admin_url );
|
54 |
$attr = ( ! empty( $tool['attr'] ) ) ? $tool['attr'] : '';
|
55 |
|
56 |
echo '<li>';
|
72 |
else {
|
73 |
echo '<a href="', esc_url( admin_url( 'admin.php?page=wpseo_tools' ) ), '">', esc_html__( '« Back to Tools page', 'wordpress-seo' ), '</a>';
|
74 |
|
75 |
+
$tool_pages = [ 'bulk-editor', 'import-export' ];
|
76 |
|
77 |
if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) {
|
78 |
$tool_pages[] = 'file-editor';
|
admin/recalculate/class-recalculate-posts.php
CHANGED
@@ -40,12 +40,12 @@ class WPSEO_Recalculate_Posts extends WPSEO_Recalculate {
|
|
40 |
protected function get_items( $paged ) {
|
41 |
$items_per_page = max( 1, $this->items_per_page );
|
42 |
$post_query = new WP_Query(
|
43 |
-
|
44 |
'post_type' => 'any',
|
45 |
'meta_key' => '_yoast_wpseo_focuskw',
|
46 |
'posts_per_page' => $items_per_page,
|
47 |
'paged' => $paged,
|
48 |
-
|
49 |
);
|
50 |
|
51 |
return $post_query->get_posts();
|
@@ -77,17 +77,17 @@ class WPSEO_Recalculate_Posts extends WPSEO_Recalculate {
|
|
77 |
// Apply shortcodes.
|
78 |
$content = do_shortcode( $content );
|
79 |
|
80 |
-
return
|
81 |
'post_id' => $item->ID,
|
82 |
'text' => $content,
|
83 |
'keyword' => $focus_keyword,
|
84 |
'url' => urldecode( $item->post_name ),
|
85 |
'pageTitle' => apply_filters( 'wpseo_title', wpseo_replace_vars( $this->get_title( $item->ID, $item->post_type ), $item ) ),
|
86 |
'meta' => apply_filters( 'wpseo_metadesc', wpseo_replace_vars( $this->get_meta_description( $item->ID, $item->post_type ), $item ) ),
|
87 |
-
'keyword_usage' =>
|
88 |
$focus_keyword => WPSEO_Meta::keyword_usage( $focus_keyword, $item->ID ),
|
89 |
-
|
90 |
-
|
91 |
}
|
92 |
|
93 |
/**
|
40 |
protected function get_items( $paged ) {
|
41 |
$items_per_page = max( 1, $this->items_per_page );
|
42 |
$post_query = new WP_Query(
|
43 |
+
[
|
44 |
'post_type' => 'any',
|
45 |
'meta_key' => '_yoast_wpseo_focuskw',
|
46 |
'posts_per_page' => $items_per_page,
|
47 |
'paged' => $paged,
|
48 |
+
]
|
49 |
);
|
50 |
|
51 |
return $post_query->get_posts();
|
77 |
// Apply shortcodes.
|
78 |
$content = do_shortcode( $content );
|
79 |
|
80 |
+
return [
|
81 |
'post_id' => $item->ID,
|
82 |
'text' => $content,
|
83 |
'keyword' => $focus_keyword,
|
84 |
'url' => urldecode( $item->post_name ),
|
85 |
'pageTitle' => apply_filters( 'wpseo_title', wpseo_replace_vars( $this->get_title( $item->ID, $item->post_type ), $item ) ),
|
86 |
'meta' => apply_filters( 'wpseo_metadesc', wpseo_replace_vars( $this->get_meta_description( $item->ID, $item->post_type ), $item ) ),
|
87 |
+
'keyword_usage' => [
|
88 |
$focus_keyword => WPSEO_Meta::keyword_usage( $focus_keyword, $item->ID ),
|
89 |
+
],
|
90 |
+
];
|
91 |
}
|
92 |
|
93 |
/**
|
admin/recalculate/class-recalculate-terms.php
CHANGED
@@ -47,11 +47,11 @@ class WPSEO_Recalculate_Terms extends WPSEO_Recalculate {
|
|
47 |
|
48 |
return get_terms(
|
49 |
get_taxonomies(),
|
50 |
-
|
51 |
'hide_empty' => false,
|
52 |
'number' => $items_per_page,
|
53 |
-
'offset' => $items_per_page * abs( $paged - 1 ),
|
54 |
-
|
55 |
);
|
56 |
}
|
57 |
|
@@ -77,18 +77,18 @@ class WPSEO_Recalculate_Terms extends WPSEO_Recalculate {
|
|
77 |
*/
|
78 |
$description = apply_filters( 'wpseo_term_description_for_recalculation', $description, $item );
|
79 |
|
80 |
-
return
|
81 |
'term_id' => $item->term_id,
|
82 |
'taxonomy' => $item->taxonomy,
|
83 |
'text' => $description,
|
84 |
'keyword' => $focus_keyword,
|
85 |
'url' => urldecode( $item->slug ),
|
86 |
-
'pageTitle' => apply_filters( 'wpseo_title', wpseo_replace_vars( $title, $item,
|
87 |
'meta' => apply_filters( 'wpseo_metadesc', wpseo_replace_vars( $meta, $item ) ),
|
88 |
-
'keyword_usage' =>
|
89 |
$focus_keyword => WPSEO_Taxonomy_Meta::get_keyword_usage( $focus_keyword, $item->term_id, $item->taxonomy ),
|
90 |
-
|
91 |
-
|
92 |
}
|
93 |
|
94 |
/**
|
47 |
|
48 |
return get_terms(
|
49 |
get_taxonomies(),
|
50 |
+
[
|
51 |
'hide_empty' => false,
|
52 |
'number' => $items_per_page,
|
53 |
+
'offset' => ( $items_per_page * abs( $paged - 1 ) ),
|
54 |
+
]
|
55 |
);
|
56 |
}
|
57 |
|
77 |
*/
|
78 |
$description = apply_filters( 'wpseo_term_description_for_recalculation', $description, $item );
|
79 |
|
80 |
+
return [
|
81 |
'term_id' => $item->term_id,
|
82 |
'taxonomy' => $item->taxonomy,
|
83 |
'text' => $description,
|
84 |
'keyword' => $focus_keyword,
|
85 |
'url' => urldecode( $item->slug ),
|
86 |
+
'pageTitle' => apply_filters( 'wpseo_title', wpseo_replace_vars( $title, $item, [ 'page' ] ) ),
|
87 |
'meta' => apply_filters( 'wpseo_metadesc', wpseo_replace_vars( $meta, $item ) ),
|
88 |
+
'keyword_usage' => [
|
89 |
$focus_keyword => WPSEO_Taxonomy_Meta::get_keyword_usage( $focus_keyword, $item->term_id, $item->taxonomy ),
|
90 |
+
],
|
91 |
+
];
|
92 |
}
|
93 |
|
94 |
/**
|
admin/recalculate/class-recalculate.php
CHANGED
@@ -50,7 +50,7 @@ abstract class WPSEO_Recalculate {
|
|
50 |
* @return array Items that can be recalculated.
|
51 |
*/
|
52 |
public function get_items_to_recalculate( $paged ) {
|
53 |
-
$return =
|
54 |
|
55 |
$paged = abs( $paged );
|
56 |
|
@@ -74,7 +74,7 @@ abstract class WPSEO_Recalculate {
|
|
74 |
* @return array
|
75 |
*/
|
76 |
protected function parse_items( array $items ) {
|
77 |
-
$return =
|
78 |
foreach ( $items as $item ) {
|
79 |
$response = $this->item_to_response( $item );
|
80 |
if ( ! empty( $response ) ) {
|
50 |
* @return array Items that can be recalculated.
|
51 |
*/
|
52 |
public function get_items_to_recalculate( $paged ) {
|
53 |
+
$return = [];
|
54 |
|
55 |
$paged = abs( $paged );
|
56 |
|
74 |
* @return array
|
75 |
*/
|
76 |
protected function parse_items( array $items ) {
|
77 |
+
$return = [];
|
78 |
foreach ( $items as $item ) {
|
79 |
$response = $this->item_to_response( $item );
|
80 |
if ( ! empty( $response ) ) {
|
admin/roles/class-abstract-role-manager.php
CHANGED
@@ -15,7 +15,7 @@ abstract class WPSEO_Abstract_Role_Manager implements WPSEO_Role_Manager {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $roles =
|
19 |
|
20 |
/**
|
21 |
* Registers a role.
|
@@ -28,10 +28,10 @@ abstract class WPSEO_Abstract_Role_Manager implements WPSEO_Role_Manager {
|
|
28 |
*/
|
29 |
public function register( $role, $display_name, $template = null ) {
|
30 |
$this->roles[ $role ] =
|
31 |
-
(object)
|
32 |
'display_name' => $display_name,
|
33 |
'template' => $template,
|
34 |
-
|
35 |
}
|
36 |
|
37 |
/**
|
@@ -64,7 +64,7 @@ abstract class WPSEO_Abstract_Role_Manager implements WPSEO_Role_Manager {
|
|
64 |
*/
|
65 |
public function remove() {
|
66 |
$roles = array_keys( $this->roles );
|
67 |
-
array_map(
|
68 |
}
|
69 |
|
70 |
/**
|
@@ -76,12 +76,12 @@ abstract class WPSEO_Abstract_Role_Manager implements WPSEO_Role_Manager {
|
|
76 |
*/
|
77 |
protected function get_capabilities( $role ) {
|
78 |
if ( ! is_string( $role ) || empty( $role ) ) {
|
79 |
-
return
|
80 |
}
|
81 |
|
82 |
$wp_role = get_role( $role );
|
83 |
if ( ! $wp_role ) {
|
84 |
-
return
|
85 |
}
|
86 |
|
87 |
return $wp_role->capabilities;
|
@@ -110,7 +110,7 @@ abstract class WPSEO_Abstract_Role_Manager implements WPSEO_Role_Manager {
|
|
110 |
* @return array Capabilties that can be safely set.
|
111 |
*/
|
112 |
protected function filter_existing_capabilties( $role, array $capabilities ) {
|
113 |
-
if ( $capabilities ===
|
114 |
return $capabilities;
|
115 |
}
|
116 |
|
@@ -137,7 +137,7 @@ abstract class WPSEO_Abstract_Role_Manager implements WPSEO_Role_Manager {
|
|
137 |
*
|
138 |
* @return void
|
139 |
*/
|
140 |
-
abstract protected function add_role( $role, $display_name, array $capabilities =
|
141 |
|
142 |
/**
|
143 |
* Removes a role from the system.
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $roles = [];
|
19 |
|
20 |
/**
|
21 |
* Registers a role.
|
28 |
*/
|
29 |
public function register( $role, $display_name, $template = null ) {
|
30 |
$this->roles[ $role ] =
|
31 |
+
(object) [
|
32 |
'display_name' => $display_name,
|
33 |
'template' => $template,
|
34 |
+
];
|
35 |
}
|
36 |
|
37 |
/**
|
64 |
*/
|
65 |
public function remove() {
|
66 |
$roles = array_keys( $this->roles );
|
67 |
+
array_map( [ $this, 'remove_role' ], $roles );
|
68 |
}
|
69 |
|
70 |
/**
|
76 |
*/
|
77 |
protected function get_capabilities( $role ) {
|
78 |
if ( ! is_string( $role ) || empty( $role ) ) {
|
79 |
+
return [];
|
80 |
}
|
81 |
|
82 |
$wp_role = get_role( $role );
|
83 |
if ( ! $wp_role ) {
|
84 |
+
return [];
|
85 |
}
|
86 |
|
87 |
return $wp_role->capabilities;
|
110 |
* @return array Capabilties that can be safely set.
|
111 |
*/
|
112 |
protected function filter_existing_capabilties( $role, array $capabilities ) {
|
113 |
+
if ( $capabilities === [] ) {
|
114 |
return $capabilities;
|
115 |
}
|
116 |
|
137 |
*
|
138 |
* @return void
|
139 |
*/
|
140 |
+
abstract protected function add_role( $role, $display_name, array $capabilities = [] );
|
141 |
|
142 |
/**
|
143 |
* Removes a role from the system.
|
admin/roles/class-register-roles.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_Register_Roles implements WPSEO_WordPress_Integration {
|
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
-
add_action( 'wpseo_register_roles',
|
20 |
}
|
21 |
|
22 |
/**
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
+
add_action( 'wpseo_register_roles', [ $this, 'register' ] );
|
20 |
}
|
21 |
|
22 |
/**
|
admin/roles/class-role-manager-vip.php
CHANGED
@@ -19,9 +19,9 @@ final class WPSEO_Role_Manager_VIP extends WPSEO_Abstract_Role_Manager {
|
|
19 |
*
|
20 |
* @return void
|
21 |
*/
|
22 |
-
protected function add_role( $role, $display_name, array $capabilities =
|
23 |
-
$enabled_capabilities =
|
24 |
-
$disabled_capabilities =
|
25 |
|
26 |
// Build lists of enabled and disabled capabilities.
|
27 |
foreach ( $capabilities as $capability => $grant ) {
|
@@ -35,7 +35,7 @@ final class WPSEO_Role_Manager_VIP extends WPSEO_Abstract_Role_Manager {
|
|
35 |
}
|
36 |
|
37 |
wpcom_vip_add_role( $role, $display_name, $enabled_capabilities );
|
38 |
-
if ( $disabled_capabilities !==
|
39 |
wpcom_vip_remove_role_caps( $role, $disabled_capabilities );
|
40 |
}
|
41 |
}
|
19 |
*
|
20 |
* @return void
|
21 |
*/
|
22 |
+
protected function add_role( $role, $display_name, array $capabilities = [] ) {
|
23 |
+
$enabled_capabilities = [];
|
24 |
+
$disabled_capabilities = [];
|
25 |
|
26 |
// Build lists of enabled and disabled capabilities.
|
27 |
foreach ( $capabilities as $capability => $grant ) {
|
35 |
}
|
36 |
|
37 |
wpcom_vip_add_role( $role, $display_name, $enabled_capabilities );
|
38 |
+
if ( $disabled_capabilities !== [] ) {
|
39 |
wpcom_vip_remove_role_caps( $role, $disabled_capabilities );
|
40 |
}
|
41 |
}
|
admin/roles/class-role-manager-wp.php
CHANGED
@@ -19,7 +19,7 @@ final class WPSEO_Role_Manager_WP extends WPSEO_Abstract_Role_Manager {
|
|
19 |
*
|
20 |
* @return void
|
21 |
*/
|
22 |
-
protected function add_role( $role, $display_name, array $capabilities =
|
23 |
$wp_role = get_role( $role );
|
24 |
if ( $wp_role ) {
|
25 |
foreach ( $capabilities as $capability => $grant ) {
|
19 |
*
|
20 |
* @return void
|
21 |
*/
|
22 |
+
protected function add_role( $role, $display_name, array $capabilities = [] ) {
|
23 |
$wp_role = get_role( $role );
|
24 |
if ( $wp_role ) {
|
25 |
foreach ( $capabilities as $capability => $grant ) {
|
admin/services/class-file-size.php
CHANGED
@@ -22,19 +22,19 @@ class WPSEO_File_Size_Service {
|
|
22 |
$file_url = $this->get_file_url( $request );
|
23 |
|
24 |
return new WP_REST_Response(
|
25 |
-
|
26 |
'type' => 'success',
|
27 |
'size_in_bytes' => $this->get_file_size( $file_url ),
|
28 |
-
|
29 |
404
|
30 |
);
|
31 |
}
|
32 |
catch ( WPSEO_File_Size_Exception $exception ) {
|
33 |
return new WP_REST_Response(
|
34 |
-
|
35 |
'type' => 'failure',
|
36 |
'response' => $exception->getMessage(),
|
37 |
-
|
38 |
404
|
39 |
);
|
40 |
}
|
@@ -98,9 +98,9 @@ class WPSEO_File_Size_Service {
|
|
98 |
*/
|
99 |
protected function calculate_file_size( $file_url ) {
|
100 |
return WPSEO_Image_Utils::get_file_size(
|
101 |
-
|
102 |
'path' => $file_url,
|
103 |
-
|
104 |
);
|
105 |
}
|
106 |
}
|
22 |
$file_url = $this->get_file_url( $request );
|
23 |
|
24 |
return new WP_REST_Response(
|
25 |
+
[
|
26 |
'type' => 'success',
|
27 |
'size_in_bytes' => $this->get_file_size( $file_url ),
|
28 |
+
],
|
29 |
404
|
30 |
);
|
31 |
}
|
32 |
catch ( WPSEO_File_Size_Exception $exception ) {
|
33 |
return new WP_REST_Response(
|
34 |
+
[
|
35 |
'type' => 'failure',
|
36 |
'response' => $exception->getMessage(),
|
37 |
+
],
|
38 |
404
|
39 |
);
|
40 |
}
|
98 |
*/
|
99 |
protected function calculate_file_size( $file_url ) {
|
100 |
return WPSEO_Image_Utils::get_file_size(
|
101 |
+
[
|
102 |
'path' => $file_url,
|
103 |
+
]
|
104 |
);
|
105 |
}
|
106 |
}
|
admin/services/class-indexable-post-provider.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Indexable_Service_Post_Provider extends WPSEO_Indexable_Provider {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $renameable_fields =
|
19 |
'description' => 'metadesc',
|
20 |
'breadcrumb_title' => 'bctitle',
|
21 |
'og_title' => 'opengraph-title',
|
@@ -29,7 +29,7 @@ class WPSEO_Indexable_Service_Post_Provider extends WPSEO_Indexable_Provider {
|
|
29 |
'primary_focus_keyword' => 'focuskw',
|
30 |
'primary_focus_keyword_score' => 'linkdex',
|
31 |
'readability_score' => 'content_score',
|
32 |
-
|
33 |
|
34 |
/**
|
35 |
* Returns an array with data for the target object.
|
@@ -44,7 +44,7 @@ class WPSEO_Indexable_Service_Post_Provider extends WPSEO_Indexable_Provider {
|
|
44 |
*/
|
45 |
public function get( $object_id, $as_object = false ) {
|
46 |
if ( ! $this->is_indexable( $object_id ) ) {
|
47 |
-
return
|
48 |
}
|
49 |
|
50 |
$indexable = WPSEO_Post_Indexable::from_object( $object_id );
|
@@ -70,7 +70,7 @@ class WPSEO_Indexable_Service_Post_Provider extends WPSEO_Indexable_Provider {
|
|
70 |
public function patch( $object_id, $requestdata ) {
|
71 |
$indexable = $this->get( $object_id, true );
|
72 |
|
73 |
-
if ( $indexable ===
|
74 |
throw WPSEO_Invalid_Indexable_Exception::non_existing_indexable( $object_id );
|
75 |
}
|
76 |
|
@@ -173,7 +173,7 @@ class WPSEO_Indexable_Service_Post_Provider extends WPSEO_Indexable_Provider {
|
|
173 |
* @return string The converted advanced meta settings.
|
174 |
*/
|
175 |
protected function convert_advanced( &$indexable_data ) {
|
176 |
-
$translated_advanced_data =
|
177 |
|
178 |
if ( WPSEO_Validator::key_exists( $indexable_data, 'is_robots_nosnippet' ) && (bool) $indexable_data['is_robots_nosnippet'] === true ) {
|
179 |
$translated_advanced_data[] = 'nosnippet';
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $renameable_fields = [
|
19 |
'description' => 'metadesc',
|
20 |
'breadcrumb_title' => 'bctitle',
|
21 |
'og_title' => 'opengraph-title',
|
29 |
'primary_focus_keyword' => 'focuskw',
|
30 |
'primary_focus_keyword_score' => 'linkdex',
|
31 |
'readability_score' => 'content_score',
|
32 |
+
];
|
33 |
|
34 |
/**
|
35 |
* Returns an array with data for the target object.
|
44 |
*/
|
45 |
public function get( $object_id, $as_object = false ) {
|
46 |
if ( ! $this->is_indexable( $object_id ) ) {
|
47 |
+
return [];
|
48 |
}
|
49 |
|
50 |
$indexable = WPSEO_Post_Indexable::from_object( $object_id );
|
70 |
public function patch( $object_id, $requestdata ) {
|
71 |
$indexable = $this->get( $object_id, true );
|
72 |
|
73 |
+
if ( $indexable === [] ) {
|
74 |
throw WPSEO_Invalid_Indexable_Exception::non_existing_indexable( $object_id );
|
75 |
}
|
76 |
|
173 |
* @return string The converted advanced meta settings.
|
174 |
*/
|
175 |
protected function convert_advanced( &$indexable_data ) {
|
176 |
+
$translated_advanced_data = [];
|
177 |
|
178 |
if ( WPSEO_Validator::key_exists( $indexable_data, 'is_robots_nosnippet' ) && (bool) $indexable_data['is_robots_nosnippet'] === true ) {
|
179 |
$translated_advanced_data[] = 'nosnippet';
|
admin/services/class-indexable-provider.php
CHANGED
@@ -15,7 +15,7 @@ abstract class WPSEO_Indexable_Provider implements WPSEO_Indexable_Service_Provi
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $renameable_fields =
|
19 |
|
20 |
/**
|
21 |
* Renames and converts some of the indexable data to its database variant.
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $renameable_fields = [];
|
19 |
|
20 |
/**
|
21 |
* Renames and converts some of the indexable data to its database variant.
|
admin/services/class-indexable-term-provider.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Indexable_Service_Term_Provider extends WPSEO_Indexable_Provider {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $renameable_fields =
|
19 |
'description' => 'desc',
|
20 |
'breadcrumb_title' => 'bctitle',
|
21 |
'og_title' => 'opengraph-title',
|
@@ -28,7 +28,7 @@ class WPSEO_Indexable_Service_Term_Provider extends WPSEO_Indexable_Provider {
|
|
28 |
'primary_focus_keyword' => 'focuskw',
|
29 |
'primary_focus_keyword_score' => 'linkdex',
|
30 |
'readability_score' => 'content_score',
|
31 |
-
|
32 |
|
33 |
/**
|
34 |
* Returns an array with data for the target object.
|
@@ -41,7 +41,7 @@ class WPSEO_Indexable_Service_Term_Provider extends WPSEO_Indexable_Provider {
|
|
41 |
*/
|
42 |
public function get( $object_id, $as_object = false ) {
|
43 |
if ( ! $this->is_indexable( $object_id ) ) {
|
44 |
-
return
|
45 |
}
|
46 |
|
47 |
$indexable = WPSEO_Term_Indexable::from_object( $object_id );
|
@@ -67,7 +67,7 @@ class WPSEO_Indexable_Service_Term_Provider extends WPSEO_Indexable_Provider {
|
|
67 |
public function patch( $object_id, $requestdata ) {
|
68 |
$indexable = $this->get( $object_id, true );
|
69 |
|
70 |
-
if ( $indexable ===
|
71 |
throw WPSEO_Invalid_Indexable_Exception::non_existing_indexable( $object_id );
|
72 |
}
|
73 |
|
@@ -106,7 +106,7 @@ class WPSEO_Indexable_Service_Term_Provider extends WPSEO_Indexable_Provider {
|
|
106 |
* @return array The compatible indexable data.
|
107 |
*/
|
108 |
protected function prefix_indexable_data( $indexable_data ) {
|
109 |
-
$converted_data =
|
110 |
|
111 |
foreach ( $indexable_data as $key => $item ) {
|
112 |
if ( substr( strtolower( $key ), 0, 6 ) !== 'wpseo_' ) {
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $renameable_fields = [
|
19 |
'description' => 'desc',
|
20 |
'breadcrumb_title' => 'bctitle',
|
21 |
'og_title' => 'opengraph-title',
|
28 |
'primary_focus_keyword' => 'focuskw',
|
29 |
'primary_focus_keyword_score' => 'linkdex',
|
30 |
'readability_score' => 'content_score',
|
31 |
+
];
|
32 |
|
33 |
/**
|
34 |
* Returns an array with data for the target object.
|
41 |
*/
|
42 |
public function get( $object_id, $as_object = false ) {
|
43 |
if ( ! $this->is_indexable( $object_id ) ) {
|
44 |
+
return [];
|
45 |
}
|
46 |
|
47 |
$indexable = WPSEO_Term_Indexable::from_object( $object_id );
|
67 |
public function patch( $object_id, $requestdata ) {
|
68 |
$indexable = $this->get( $object_id, true );
|
69 |
|
70 |
+
if ( $indexable === [] ) {
|
71 |
throw WPSEO_Invalid_Indexable_Exception::non_existing_indexable( $object_id );
|
72 |
}
|
73 |
|
106 |
* @return array The compatible indexable data.
|
107 |
*/
|
108 |
protected function prefix_indexable_data( $indexable_data ) {
|
109 |
+
$converted_data = [];
|
110 |
|
111 |
foreach ( $indexable_data as $key => $item ) {
|
112 |
if ( substr( strtolower( $key ), 0, 6 ) !== 'wpseo_' ) {
|
admin/statistics/class-statistics-integration.php
CHANGED
@@ -16,8 +16,8 @@ class WPSEO_Statistic_Integration implements WPSEO_WordPress_Integration {
|
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
-
add_action( 'wp_insert_post',
|
20 |
-
add_action( 'delete_post',
|
21 |
}
|
22 |
|
23 |
/**
|
16 |
* @return void
|
17 |
*/
|
18 |
public function register_hooks() {
|
19 |
+
add_action( 'wp_insert_post', [ $this, 'clear_cache' ] );
|
20 |
+
add_action( 'delete_post', [ $this, 'clear_cache' ] );
|
21 |
}
|
22 |
|
23 |
/**
|
admin/statistics/class-statistics-service.php
CHANGED
@@ -52,10 +52,10 @@ class WPSEO_Statistics_Service {
|
|
52 |
$this->labels = $this->labels();
|
53 |
$statistics = $this->statistic_items();
|
54 |
|
55 |
-
$data =
|
56 |
'header' => $this->get_header_from_statistics( $statistics ),
|
57 |
'seo_scores' => $statistics['scores'],
|
58 |
-
|
59 |
|
60 |
return new WP_REST_Response( $data );
|
61 |
}
|
@@ -105,7 +105,7 @@ class WPSEO_Statistics_Service {
|
|
105 |
$transient = get_transient( self::CACHE_TRANSIENT_KEY );
|
106 |
|
107 |
if ( $transient === false ) {
|
108 |
-
return
|
109 |
}
|
110 |
|
111 |
return $transient;
|
@@ -123,11 +123,11 @@ class WPSEO_Statistics_Service {
|
|
123 |
$scores = $this->get_seo_scores_with_post_count();
|
124 |
$division = $this->get_seo_score_division( $scores );
|
125 |
|
126 |
-
$transient[ $user ] =
|
127 |
// Use array_values because array_filter may return non-zero indexed arrays.
|
128 |
-
'scores' => array_values( array_filter( $scores,
|
129 |
'division' => $division,
|
130 |
-
|
131 |
|
132 |
set_transient( self::CACHE_TRANSIENT_KEY, $transient, DAY_IN_SECONDS );
|
133 |
|
@@ -143,7 +143,7 @@ class WPSEO_Statistics_Service {
|
|
143 |
*/
|
144 |
private function get_seo_score_division( array $scores ) {
|
145 |
$total = 0;
|
146 |
-
$division =
|
147 |
|
148 |
foreach ( $scores as $score ) {
|
149 |
$total += $score['count'];
|
@@ -168,7 +168,7 @@ class WPSEO_Statistics_Service {
|
|
168 |
private function get_seo_scores_with_post_count() {
|
169 |
$ranks = WPSEO_Rank::get_all_ranks();
|
170 |
|
171 |
-
return array_map(
|
172 |
}
|
173 |
|
174 |
/**
|
@@ -179,12 +179,12 @@ class WPSEO_Statistics_Service {
|
|
179 |
* @return array The mapped rank.
|
180 |
*/
|
181 |
private function map_rank_to_widget( WPSEO_Rank $rank ) {
|
182 |
-
return
|
183 |
'seo_rank' => $rank->get_rank(),
|
184 |
'label' => $this->get_label_for_rank( $rank ),
|
185 |
'count' => $this->statistics->get_post_count( $rank ),
|
186 |
'link' => $this->get_link_for_rank( $rank ),
|
187 |
-
|
188 |
}
|
189 |
|
190 |
/**
|
@@ -204,7 +204,7 @@ class WPSEO_Statistics_Service {
|
|
204 |
* @return array Array containing the translatable labels.
|
205 |
*/
|
206 |
private function labels() {
|
207 |
-
return
|
208 |
WPSEO_Rank::NO_FOCUS => sprintf(
|
209 |
/* translators: %1$s expands to an opening strong tag, %2$s expands to a closing strong tag */
|
210 |
__( 'Posts %1$swithout%2$s a focus keyphrase', 'wordpress-seo' ),
|
@@ -227,7 +227,7 @@ class WPSEO_Statistics_Service {
|
|
227 |
'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
|
228 |
),
|
229 |
WPSEO_Rank::NO_INDEX => __( 'Posts that should not show up in search results', 'wordpress-seo' ),
|
230 |
-
|
231 |
}
|
232 |
|
233 |
/**
|
52 |
$this->labels = $this->labels();
|
53 |
$statistics = $this->statistic_items();
|
54 |
|
55 |
+
$data = [
|
56 |
'header' => $this->get_header_from_statistics( $statistics ),
|
57 |
'seo_scores' => $statistics['scores'],
|
58 |
+
];
|
59 |
|
60 |
return new WP_REST_Response( $data );
|
61 |
}
|
105 |
$transient = get_transient( self::CACHE_TRANSIENT_KEY );
|
106 |
|
107 |
if ( $transient === false ) {
|
108 |
+
return [];
|
109 |
}
|
110 |
|
111 |
return $transient;
|
123 |
$scores = $this->get_seo_scores_with_post_count();
|
124 |
$division = $this->get_seo_score_division( $scores );
|
125 |
|
126 |
+
$transient[ $user ] = [
|
127 |
// Use array_values because array_filter may return non-zero indexed arrays.
|
128 |
+
'scores' => array_values( array_filter( $scores, [ $this, 'filter_items' ] ) ),
|
129 |
'division' => $division,
|
130 |
+
];
|
131 |
|
132 |
set_transient( self::CACHE_TRANSIENT_KEY, $transient, DAY_IN_SECONDS );
|
133 |
|
143 |
*/
|
144 |
private function get_seo_score_division( array $scores ) {
|
145 |
$total = 0;
|
146 |
+
$division = [];
|
147 |
|
148 |
foreach ( $scores as $score ) {
|
149 |
$total += $score['count'];
|
168 |
private function get_seo_scores_with_post_count() {
|
169 |
$ranks = WPSEO_Rank::get_all_ranks();
|
170 |
|
171 |
+
return array_map( [ $this, 'map_rank_to_widget' ], $ranks );
|
172 |
}
|
173 |
|
174 |
/**
|
179 |
* @return array The mapped rank.
|
180 |
*/
|
181 |
private function map_rank_to_widget( WPSEO_Rank $rank ) {
|
182 |
+
return [
|
183 |
'seo_rank' => $rank->get_rank(),
|
184 |
'label' => $this->get_label_for_rank( $rank ),
|
185 |
'count' => $this->statistics->get_post_count( $rank ),
|
186 |
'link' => $this->get_link_for_rank( $rank ),
|
187 |
+
];
|
188 |
}
|
189 |
|
190 |
/**
|
204 |
* @return array Array containing the translatable labels.
|
205 |
*/
|
206 |
private function labels() {
|
207 |
+
return [
|
208 |
WPSEO_Rank::NO_FOCUS => sprintf(
|
209 |
/* translators: %1$s expands to an opening strong tag, %2$s expands to a closing strong tag */
|
210 |
__( 'Posts %1$swithout%2$s a focus keyphrase', 'wordpress-seo' ),
|
227 |
'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
|
228 |
),
|
229 |
WPSEO_Rank::NO_INDEX => __( 'Posts that should not show up in search results', 'wordpress-seo' ),
|
230 |
+
];
|
231 |
}
|
232 |
|
233 |
/**
|
admin/taxonomy/class-taxonomy-columns.php
CHANGED
@@ -39,8 +39,8 @@ class WPSEO_Taxonomy_Columns {
|
|
39 |
$this->taxonomy = $this->get_taxonomy();
|
40 |
|
41 |
if ( ! empty( $this->taxonomy ) ) {
|
42 |
-
add_filter( 'manage_edit-' . $this->taxonomy . '_columns',
|
43 |
-
add_filter( 'manage_' . $this->taxonomy . '_custom_column',
|
44 |
}
|
45 |
|
46 |
$this->analysis_seo = new WPSEO_Metabox_Analysis_SEO();
|
@@ -59,7 +59,7 @@ class WPSEO_Taxonomy_Columns {
|
|
59 |
return $columns;
|
60 |
}
|
61 |
|
62 |
-
$new_columns =
|
63 |
|
64 |
foreach ( $columns as $column_name => $column_value ) {
|
65 |
$new_columns[ $column_name ] = $column_value;
|
39 |
$this->taxonomy = $this->get_taxonomy();
|
40 |
|
41 |
if ( ! empty( $this->taxonomy ) ) {
|
42 |
+
add_filter( 'manage_edit-' . $this->taxonomy . '_columns', [ $this, 'add_columns' ] );
|
43 |
+
add_filter( 'manage_' . $this->taxonomy . '_custom_column', [ $this, 'parse_column' ], 10, 3 );
|
44 |
}
|
45 |
|
46 |
$this->analysis_seo = new WPSEO_Metabox_Analysis_SEO();
|
59 |
return $columns;
|
60 |
}
|
61 |
|
62 |
+
$new_columns = [];
|
63 |
|
64 |
foreach ( $columns as $column_name => $column_value ) {
|
65 |
$new_columns[ $column_name ] = $column_value;
|
admin/taxonomy/class-taxonomy-content-fields.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_Taxonomy_Content_Fields extends WPSEO_Taxonomy_Fields {
|
|
16 |
* @return array
|
17 |
*/
|
18 |
public function get() {
|
19 |
-
$fields =
|
20 |
'title' => $this->get_field_config(
|
21 |
'',
|
22 |
'',
|
@@ -47,13 +47,13 @@ class WPSEO_Taxonomy_Content_Fields extends WPSEO_Taxonomy_Fields {
|
|
47 |
'hidden',
|
48 |
''
|
49 |
),
|
50 |
-
|
51 |
/**
|
52 |
* Filter: 'wpseo_taxonomy_content_fields' - Adds the possibility to register additional content fields.
|
53 |
*
|
54 |
* @api array - The additional fields.
|
55 |
*/
|
56 |
-
$additional_fields = apply_filters( 'wpseo_taxonomy_content_fields',
|
57 |
|
58 |
return $this->filter_hidden_fields( array_merge( $fields, $additional_fields ) );
|
59 |
}
|
16 |
* @return array
|
17 |
*/
|
18 |
public function get() {
|
19 |
+
$fields = [
|
20 |
'title' => $this->get_field_config(
|
21 |
'',
|
22 |
'',
|
47 |
'hidden',
|
48 |
''
|
49 |
),
|
50 |
+
];
|
51 |
/**
|
52 |
* Filter: 'wpseo_taxonomy_content_fields' - Adds the possibility to register additional content fields.
|
53 |
*
|
54 |
* @api array - The additional fields.
|
55 |
*/
|
56 |
+
$additional_fields = apply_filters( 'wpseo_taxonomy_content_fields', [] );
|
57 |
|
58 |
return $this->filter_hidden_fields( array_merge( $fields, $additional_fields ) );
|
59 |
}
|
admin/taxonomy/class-taxonomy-fields-presenter.php
CHANGED
@@ -128,7 +128,7 @@ class WPSEO_Taxonomy_Fields_Presenter {
|
|
128 |
' />';
|
129 |
break;
|
130 |
case 'select':
|
131 |
-
if ( is_array( $options ) && $options !==
|
132 |
$field .= '<select name="' . $field_name . '" id="' . $field_name . '"' . $aria_describedby . '>';
|
133 |
|
134 |
$select_options = ( array_key_exists( 'options', $options ) ) ? $options['options'] : $options;
|
128 |
' />';
|
129 |
break;
|
130 |
case 'select':
|
131 |
+
if ( is_array( $options ) && $options !== [] ) {
|
132 |
$field .= '<select name="' . $field_name . '" id="' . $field_name . '"' . $aria_describedby . '>';
|
133 |
|
134 |
$select_options = ( array_key_exists( 'options', $options ) ) ? $options['options'] : $options;
|
admin/taxonomy/class-taxonomy-fields.php
CHANGED
@@ -47,13 +47,13 @@ abstract class WPSEO_Taxonomy_Fields {
|
|
47 |
* @return array
|
48 |
*/
|
49 |
protected function get_field_config( $label, $description, $type = 'text', $options = '', $hide = false ) {
|
50 |
-
return
|
51 |
'label' => $label,
|
52 |
'description' => $description,
|
53 |
'type' => $type,
|
54 |
'options' => $options,
|
55 |
'hide' => $hide,
|
56 |
-
|
57 |
}
|
58 |
|
59 |
/**
|
47 |
* @return array
|
48 |
*/
|
49 |
protected function get_field_config( $label, $description, $type = 'text', $options = '', $hide = false ) {
|
50 |
+
return [
|
51 |
'label' => $label,
|
52 |
'description' => $description,
|
53 |
'type' => $type,
|
54 |
'options' => $options,
|
55 |
'hide' => $hide,
|
56 |
+
];
|
57 |
}
|
58 |
|
59 |
/**
|
admin/taxonomy/class-taxonomy-metabox.php
CHANGED
@@ -100,7 +100,7 @@ class WPSEO_Taxonomy_Metabox {
|
|
100 |
* @return WPSEO_Metabox_Section[]
|
101 |
*/
|
102 |
private function get_content_sections() {
|
103 |
-
$content_sections =
|
104 |
|
105 |
$content_sections[] = $this->get_seo_meta_section();
|
106 |
|
@@ -138,12 +138,12 @@ class WPSEO_Taxonomy_Metabox {
|
|
138 |
$advanced_collapsible = new WPSEO_Paper_Presenter(
|
139 |
__( 'Advanced', 'wordpress-seo' ),
|
140 |
null,
|
141 |
-
|
142 |
'collapsible' => true,
|
143 |
'class' => 'metabox wpseo-form wpseo-collapsible-container',
|
144 |
'content' => $this->taxonomy_tab_content->html( $taxonomy_settings_fields->get() ),
|
145 |
'paper_id' => 'collapsible-advanced-settings',
|
146 |
-
|
147 |
);
|
148 |
|
149 |
$html_after = '<div class="wpseo_content_wrapper">' . $advanced_collapsible->get_output() . '</div>';
|
@@ -153,9 +153,9 @@ class WPSEO_Taxonomy_Metabox {
|
|
153 |
'content',
|
154 |
$label,
|
155 |
$content,
|
156 |
-
|
157 |
'html_after' => $html_after,
|
158 |
-
|
159 |
);
|
160 |
}
|
161 |
|
@@ -177,7 +177,7 @@ class WPSEO_Taxonomy_Metabox {
|
|
177 |
$this->taxonomy_social_fields = new WPSEO_Taxonomy_Social_Fields( $this->term );
|
178 |
$this->social_admin = new WPSEO_Social_Admin();
|
179 |
|
180 |
-
$collapsibles =
|
181 |
$collapsibles[] = $this->create_collapsible( 'facebook', 'opengraph', 'facebook-alt', __( 'Facebook', 'wordpress-seo' ) );
|
182 |
$collapsibles[] = $this->create_collapsible( 'twitter', 'twitter', 'twitter', __( 'Twitter', 'wordpress-seo' ) );
|
183 |
|
100 |
* @return WPSEO_Metabox_Section[]
|
101 |
*/
|
102 |
private function get_content_sections() {
|
103 |
+
$content_sections = [];
|
104 |
|
105 |
$content_sections[] = $this->get_seo_meta_section();
|
106 |
|
138 |
$advanced_collapsible = new WPSEO_Paper_Presenter(
|
139 |
__( 'Advanced', 'wordpress-seo' ),
|
140 |
null,
|
141 |
+
[
|
142 |
'collapsible' => true,
|
143 |
'class' => 'metabox wpseo-form wpseo-collapsible-container',
|
144 |
'content' => $this->taxonomy_tab_content->html( $taxonomy_settings_fields->get() ),
|
145 |
'paper_id' => 'collapsible-advanced-settings',
|
146 |
+
]
|
147 |
);
|
148 |
|
149 |
$html_after = '<div class="wpseo_content_wrapper">' . $advanced_collapsible->get_output() . '</div>';
|
153 |
'content',
|
154 |
$label,
|
155 |
$content,
|
156 |
+
[
|
157 |
'html_after' => $html_after,
|
158 |
+
]
|
159 |
);
|
160 |
}
|
161 |
|
177 |
$this->taxonomy_social_fields = new WPSEO_Taxonomy_Social_Fields( $this->term );
|
178 |
$this->social_admin = new WPSEO_Social_Admin();
|
179 |
|
180 |
+
$collapsibles = [];
|
181 |
$collapsibles[] = $this->create_collapsible( 'facebook', 'opengraph', 'facebook-alt', __( 'Facebook', 'wordpress-seo' ) );
|
182 |
$collapsibles[] = $this->create_collapsible( 'twitter', 'twitter', 'twitter', __( 'Twitter', 'wordpress-seo' ) );
|
183 |
|
admin/taxonomy/class-taxonomy-settings-fields.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Taxonomy_Settings_Fields extends WPSEO_Taxonomy_Fields {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
private $no_index_options =
|
19 |
|
20 |
/**
|
21 |
* The WPSEO_Taxonomy_Settings_Fields class constructor.
|
@@ -34,7 +34,7 @@ class WPSEO_Taxonomy_Settings_Fields extends WPSEO_Taxonomy_Fields {
|
|
34 |
*/
|
35 |
public function get() {
|
36 |
$labels = $this->get_taxonomy_labels();
|
37 |
-
$fields =
|
38 |
'noindex' => $this->get_field_config(
|
39 |
/* translators: %s = taxonomy name. */
|
40 |
esc_html( sprintf( __( 'Allow search engines to show this %s in search results?', 'wordpress-seo' ), $labels->singular_name ) ),
|
@@ -53,7 +53,7 @@ class WPSEO_Taxonomy_Settings_Fields extends WPSEO_Taxonomy_Fields {
|
|
53 |
__( 'Canonical URL', 'wordpress-seo' ),
|
54 |
esc_html__( 'The canonical link is shown on the archive page for this term.', 'wordpress-seo' )
|
55 |
),
|
56 |
-
|
57 |
|
58 |
return $this->filter_hidden_fields( $fields );
|
59 |
}
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
private $no_index_options = [];
|
19 |
|
20 |
/**
|
21 |
* The WPSEO_Taxonomy_Settings_Fields class constructor.
|
34 |
*/
|
35 |
public function get() {
|
36 |
$labels = $this->get_taxonomy_labels();
|
37 |
+
$fields = [
|
38 |
'noindex' => $this->get_field_config(
|
39 |
/* translators: %s = taxonomy name. */
|
40 |
esc_html( sprintf( __( 'Allow search engines to show this %s in search results?', 'wordpress-seo' ), $labels->singular_name ) ),
|
53 |
__( 'Canonical URL', 'wordpress-seo' ),
|
54 |
esc_html__( 'The canonical link is shown on the archive page for this term.', 'wordpress-seo' )
|
55 |
),
|
56 |
+
];
|
57 |
|
58 |
return $this->filter_hidden_fields( $fields );
|
59 |
}
|
admin/taxonomy/class-taxonomy-social-fields.php
CHANGED
@@ -47,14 +47,14 @@ class WPSEO_Taxonomy_Social_Fields extends WPSEO_Taxonomy_Fields {
|
|
47 |
public function get_by_network( $network ) {
|
48 |
$settings = $this->networks[ $network ];
|
49 |
|
50 |
-
return
|
51 |
$settings['network'] . '-title' => $this->get_field_config(
|
52 |
/* translators: %s expands to the social network name */
|
53 |
sprintf( __( '%s Title', 'wordpress-seo' ), $settings['label'] ),
|
54 |
/* translators: %1$s expands to the social network name */
|
55 |
sprintf( esc_html__( 'If you don\'t want to use the title for sharing on %1$s but instead want another title there, write it here.', 'wordpress-seo' ), $settings['label'] ),
|
56 |
'text',
|
57 |
-
|
58 |
),
|
59 |
$settings['network'] . '-description' => $this->get_field_config(
|
60 |
/* translators: %s expands to the social network name */
|
@@ -77,7 +77,7 @@ class WPSEO_Taxonomy_Social_Fields extends WPSEO_Taxonomy_Fields {
|
|
77 |
'',
|
78 |
'hidden'
|
79 |
),
|
80 |
-
|
81 |
}
|
82 |
|
83 |
/**
|
@@ -86,7 +86,7 @@ class WPSEO_Taxonomy_Social_Fields extends WPSEO_Taxonomy_Fields {
|
|
86 |
* @return array
|
87 |
*/
|
88 |
public function get() {
|
89 |
-
$fields =
|
90 |
foreach ( $this->networks as $option => $settings ) {
|
91 |
$fields_to_push = $this->get_by_network( $option );
|
92 |
|
@@ -117,10 +117,10 @@ class WPSEO_Taxonomy_Social_Fields extends WPSEO_Taxonomy_Fields {
|
|
117 |
'512'
|
118 |
);
|
119 |
|
120 |
-
$social_networks =
|
121 |
'opengraph' => $this->social_network( 'opengraph', __( 'Facebook', 'wordpress-seo' ), $fb_image_size ),
|
122 |
'twitter' => $this->social_network( 'twitter', __( 'Twitter', 'wordpress-seo' ), $twitter_image_size ),
|
123 |
-
|
124 |
|
125 |
return $this->filter_social_networks( $social_networks );
|
126 |
}
|
@@ -135,11 +135,11 @@ class WPSEO_Taxonomy_Social_Fields extends WPSEO_Taxonomy_Fields {
|
|
135 |
* @return array
|
136 |
*/
|
137 |
private function social_network( $network, $label, $image_size ) {
|
138 |
-
return
|
139 |
'network' => $network,
|
140 |
'label' => $label,
|
141 |
'size' => $image_size,
|
142 |
-
|
143 |
}
|
144 |
|
145 |
/**
|
47 |
public function get_by_network( $network ) {
|
48 |
$settings = $this->networks[ $network ];
|
49 |
|
50 |
+
return [
|
51 |
$settings['network'] . '-title' => $this->get_field_config(
|
52 |
/* translators: %s expands to the social network name */
|
53 |
sprintf( __( '%s Title', 'wordpress-seo' ), $settings['label'] ),
|
54 |
/* translators: %1$s expands to the social network name */
|
55 |
sprintf( esc_html__( 'If you don\'t want to use the title for sharing on %1$s but instead want another title there, write it here.', 'wordpress-seo' ), $settings['label'] ),
|
56 |
'text',
|
57 |
+
[ 'class' => 'large-text' ]
|
58 |
),
|
59 |
$settings['network'] . '-description' => $this->get_field_config(
|
60 |
/* translators: %s expands to the social network name */
|
77 |
'',
|
78 |
'hidden'
|
79 |
),
|
80 |
+
];
|
81 |
}
|
82 |
|
83 |
/**
|
86 |
* @return array
|
87 |
*/
|
88 |
public function get() {
|
89 |
+
$fields = [];
|
90 |
foreach ( $this->networks as $option => $settings ) {
|
91 |
$fields_to_push = $this->get_by_network( $option );
|
92 |
|
117 |
'512'
|
118 |
);
|
119 |
|
120 |
+
$social_networks = [
|
121 |
'opengraph' => $this->social_network( 'opengraph', __( 'Facebook', 'wordpress-seo' ), $fb_image_size ),
|
122 |
'twitter' => $this->social_network( 'twitter', __( 'Twitter', 'wordpress-seo' ), $twitter_image_size ),
|
123 |
+
];
|
124 |
|
125 |
return $this->filter_social_networks( $social_networks );
|
126 |
}
|
135 |
* @return array
|
136 |
*/
|
137 |
private function social_network( $network, $label, $image_size ) {
|
138 |
+
return [
|
139 |
'network' => $network,
|
140 |
'label' => $label,
|
141 |
'size' => $image_size,
|
142 |
+
];
|
143 |
}
|
144 |
|
145 |
/**
|
admin/taxonomy/class-taxonomy.php
CHANGED
@@ -37,9 +37,9 @@ class WPSEO_Taxonomy {
|
|
37 |
public function __construct() {
|
38 |
$this->taxonomy = $this->get_taxonomy();
|
39 |
|
40 |
-
add_action( 'edit_term',
|
41 |
-
add_action( 'init',
|
42 |
-
add_action( 'admin_init',
|
43 |
|
44 |
if ( self::is_term_overview( $GLOBALS['pagenow'] ) ) {
|
45 |
new WPSEO_Taxonomy_Columns();
|
@@ -61,8 +61,8 @@ class WPSEO_Taxonomy {
|
|
61 |
|
62 |
$this->insert_description_field_editor();
|
63 |
|
64 |
-
add_action( sanitize_text_field( $this->taxonomy ) . '_edit_form',
|
65 |
-
add_action( 'admin_enqueue_scripts',
|
66 |
}
|
67 |
|
68 |
/**
|
@@ -145,7 +145,7 @@ class WPSEO_Taxonomy {
|
|
145 |
$analysis_worker_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ) );
|
146 |
$used_keywords_assessment_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ), 'used-keywords-assessment' );
|
147 |
|
148 |
-
$localization_data =
|
149 |
'url' => $analysis_worker_location->get_url(
|
150 |
$analysis_worker_location->get_asset(),
|
151 |
WPSEO_Admin_Asset::TYPE_JS
|
@@ -155,7 +155,7 @@ class WPSEO_Taxonomy {
|
|
155 |
WPSEO_Admin_Asset::TYPE_JS
|
156 |
),
|
157 |
'log_level' => WPSEO_Utils::get_analysis_worker_log_level(),
|
158 |
-
|
159 |
wp_localize_script(
|
160 |
WPSEO_Admin_Asset_Manager::PREFIX . 'term-scraper',
|
161 |
'wpseoAnalysisWorkerL10n',
|
@@ -178,7 +178,7 @@ class WPSEO_Taxonomy {
|
|
178 |
wp_localize_script(
|
179 |
WPSEO_Admin_Asset_Manager::PREFIX . 'admin-media',
|
180 |
'wpseoMediaL10n',
|
181 |
-
|
182 |
);
|
183 |
}
|
184 |
|
@@ -200,7 +200,7 @@ class WPSEO_Taxonomy {
|
|
200 |
}
|
201 |
|
202 |
/* Create post array with only our values. */
|
203 |
-
$new_meta_data =
|
204 |
foreach ( WPSEO_Taxonomy_Meta::$defaults_per_term as $key => $default ) {
|
205 |
$posted_value = filter_input( INPUT_POST, $key );
|
206 |
if ( isset( $posted_value ) && $posted_value !== false ) {
|
@@ -240,12 +240,12 @@ class WPSEO_Taxonomy {
|
|
240 |
* Allows HTML in descriptions.
|
241 |
*/
|
242 |
public function custom_category_descriptions_allow_html() {
|
243 |
-
$filters =
|
244 |
'pre_term_description',
|
245 |
'pre_link_description',
|
246 |
'pre_link_notes',
|
247 |
'pre_user_description',
|
248 |
-
|
249 |
|
250 |
foreach ( $filters as $filter ) {
|
251 |
remove_filter( $filter, 'wp_filter_kses' );
|
@@ -284,12 +284,12 @@ class WPSEO_Taxonomy {
|
|
284 |
* Pass some variables to js for replacing variables.
|
285 |
*/
|
286 |
public function localize_replace_vars_script() {
|
287 |
-
return
|
288 |
'no_parent_text' => __( '(no parent)', 'wordpress-seo' ),
|
289 |
'replace_vars' => $this->get_replace_vars(),
|
290 |
'recommended_replace_vars' => $this->get_recommended_replace_vars(),
|
291 |
'scope' => $this->determine_scope(),
|
292 |
-
|
293 |
}
|
294 |
|
295 |
/**
|
@@ -352,7 +352,7 @@ class WPSEO_Taxonomy {
|
|
352 |
* @return string
|
353 |
*/
|
354 |
private function get_taxonomy() {
|
355 |
-
return filter_input( INPUT_GET, 'taxonomy', FILTER_DEFAULT,
|
356 |
}
|
357 |
|
358 |
/**
|
@@ -364,9 +364,9 @@ class WPSEO_Taxonomy {
|
|
364 |
$term_id = filter_input( INPUT_GET, 'tag_ID' );
|
365 |
$term = get_term_by( 'id', $term_id, $this->get_taxonomy() );
|
366 |
|
367 |
-
$cached_replacement_vars =
|
368 |
|
369 |
-
$vars_to_cache =
|
370 |
'date',
|
371 |
'id',
|
372 |
'sitename',
|
@@ -379,7 +379,7 @@ class WPSEO_Taxonomy {
|
|
379 |
'tag_description',
|
380 |
'searchphrase',
|
381 |
'currentyear',
|
382 |
-
|
383 |
|
384 |
foreach ( $vars_to_cache as $var ) {
|
385 |
$cached_replacement_vars[ $var ] = wpseo_replace_vars( '%%' . $var . '%%', $term );
|
@@ -412,11 +412,11 @@ class WPSEO_Taxonomy {
|
|
412 |
*/
|
413 |
private function insert_description_field_editor() {
|
414 |
if ( version_compare( $GLOBALS['wp_version'], '4.5', '<' ) ) {
|
415 |
-
add_action( "{$this->taxonomy}_edit_form",
|
416 |
return;
|
417 |
}
|
418 |
|
419 |
-
add_action( "{$this->taxonomy}_term_edit_form_top",
|
420 |
}
|
421 |
|
422 |
/* ********************* DEPRECATED METHODS ********************* */
|
37 |
public function __construct() {
|
38 |
$this->taxonomy = $this->get_taxonomy();
|
39 |
|
40 |
+
add_action( 'edit_term', [ $this, 'update_term' ], 99, 3 );
|
41 |
+
add_action( 'init', [ $this, 'custom_category_descriptions_allow_html' ] );
|
42 |
+
add_action( 'admin_init', [ $this, 'admin_init' ] );
|
43 |
|
44 |
if ( self::is_term_overview( $GLOBALS['pagenow'] ) ) {
|
45 |
new WPSEO_Taxonomy_Columns();
|
61 |
|
62 |
$this->insert_description_field_editor();
|
63 |
|
64 |
+
add_action( sanitize_text_field( $this->taxonomy ) . '_edit_form', [ $this, 'term_metabox' ], 90, 1 );
|
65 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
|
66 |
}
|
67 |
|
68 |
/**
|
145 |
$analysis_worker_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ) );
|
146 |
$used_keywords_assessment_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ), 'used-keywords-assessment' );
|
147 |
|
148 |
+
$localization_data = [
|
149 |
'url' => $analysis_worker_location->get_url(
|
150 |
$analysis_worker_location->get_asset(),
|
151 |
WPSEO_Admin_Asset::TYPE_JS
|
155 |
WPSEO_Admin_Asset::TYPE_JS
|
156 |
),
|
157 |
'log_level' => WPSEO_Utils::get_analysis_worker_log_level(),
|
158 |
+
];
|
159 |
wp_localize_script(
|
160 |
WPSEO_Admin_Asset_Manager::PREFIX . 'term-scraper',
|
161 |
'wpseoAnalysisWorkerL10n',
|
178 |
wp_localize_script(
|
179 |
WPSEO_Admin_Asset_Manager::PREFIX . 'admin-media',
|
180 |
'wpseoMediaL10n',
|
181 |
+
[ 'choose_image' => __( 'Use Image', 'wordpress-seo' ) ]
|
182 |
);
|
183 |
}
|
184 |
|
200 |
}
|
201 |
|
202 |
/* Create post array with only our values. */
|
203 |
+
$new_meta_data = [];
|
204 |
foreach ( WPSEO_Taxonomy_Meta::$defaults_per_term as $key => $default ) {
|
205 |
$posted_value = filter_input( INPUT_POST, $key );
|
206 |
if ( isset( $posted_value ) && $posted_value !== false ) {
|
240 |
* Allows HTML in descriptions.
|
241 |
*/
|
242 |
public function custom_category_descriptions_allow_html() {
|
243 |
+
$filters = [
|
244 |
'pre_term_description',
|
245 |
'pre_link_description',
|
246 |
'pre_link_notes',
|
247 |
'pre_user_description',
|
248 |
+
];
|
249 |
|
250 |
foreach ( $filters as $filter ) {
|
251 |
remove_filter( $filter, 'wp_filter_kses' );
|
284 |
* Pass some variables to js for replacing variables.
|
285 |
*/
|
286 |
public function localize_replace_vars_script() {
|
287 |
+
return [
|
288 |
'no_parent_text' => __( '(no parent)', 'wordpress-seo' ),
|
289 |
'replace_vars' => $this->get_replace_vars(),
|
290 |
'recommended_replace_vars' => $this->get_recommended_replace_vars(),
|
291 |
'scope' => $this->determine_scope(),
|
292 |
+
];
|
293 |
}
|
294 |
|
295 |
/**
|
352 |
* @return string
|
353 |
*/
|
354 |
private function get_taxonomy() {
|
355 |
+
return filter_input( INPUT_GET, 'taxonomy', FILTER_DEFAULT, [ 'options' => [ 'default' => '' ] ] );
|
356 |
}
|
357 |
|
358 |
/**
|
364 |
$term_id = filter_input( INPUT_GET, 'tag_ID' );
|
365 |
$term = get_term_by( 'id', $term_id, $this->get_taxonomy() );
|
366 |
|
367 |
+
$cached_replacement_vars = [];
|
368 |
|
369 |
+
$vars_to_cache = [
|
370 |
'date',
|
371 |
'id',
|
372 |
'sitename',
|
379 |
'tag_description',
|
380 |
'searchphrase',
|
381 |
'currentyear',
|
382 |
+
];
|
383 |
|
384 |
foreach ( $vars_to_cache as $var ) {
|
385 |
$cached_replacement_vars[ $var ] = wpseo_replace_vars( '%%' . $var . '%%', $term );
|
412 |
*/
|
413 |
private function insert_description_field_editor() {
|
414 |
if ( version_compare( $GLOBALS['wp_version'], '4.5', '<' ) ) {
|
415 |
+
add_action( "{$this->taxonomy}_edit_form", [ $this, 'custom_category_description_editor' ] );
|
416 |
return;
|
417 |
}
|
418 |
|
419 |
+
add_action( "{$this->taxonomy}_term_edit_form_top", [ $this, 'custom_category_description_editor' ] );
|
420 |
}
|
421 |
|
422 |
/* ********************* DEPRECATED METHODS ********************* */
|
admin/tracking/class-tracking-default-data.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_Tracking_Default_Data implements WPSEO_Collection {
|
|
16 |
* @return array The collection data.
|
17 |
*/
|
18 |
public function get() {
|
19 |
-
return
|
20 |
'siteTitle' => get_option( 'blogname' ),
|
21 |
'@timestamp' => (int) date( 'Uv' ),
|
22 |
'wpVersion' => $this->get_wordpress_version(),
|
@@ -24,7 +24,7 @@ class WPSEO_Tracking_Default_Data implements WPSEO_Collection {
|
|
24 |
'adminURL' => admin_url(),
|
25 |
'isMultisite' => is_multisite(),
|
26 |
'siteLanguage' => get_bloginfo( 'language' ),
|
27 |
-
|
28 |
}
|
29 |
|
30 |
/**
|
16 |
* @return array The collection data.
|
17 |
*/
|
18 |
public function get() {
|
19 |
+
return [
|
20 |
'siteTitle' => get_option( 'blogname' ),
|
21 |
'@timestamp' => (int) date( 'Uv' ),
|
22 |
'wpVersion' => $this->get_wordpress_version(),
|
24 |
'adminURL' => admin_url(),
|
25 |
'isMultisite' => is_multisite(),
|
26 |
'siteLanguage' => get_bloginfo( 'language' ),
|
27 |
+
];
|
28 |
}
|
29 |
|
30 |
/**
|
admin/tracking/class-tracking-plugin-data.php
CHANGED
@@ -16,9 +16,9 @@ class WPSEO_Tracking_Plugin_Data implements WPSEO_Collection {
|
|
16 |
* @return array The collection data.
|
17 |
*/
|
18 |
public function get() {
|
19 |
-
return
|
20 |
'plugins' => $this->get_plugin_data(),
|
21 |
-
|
22 |
}
|
23 |
|
24 |
/**
|
@@ -34,9 +34,9 @@ class WPSEO_Tracking_Plugin_Data implements WPSEO_Collection {
|
|
34 |
|
35 |
$plugins = wp_get_active_and_valid_plugins();
|
36 |
$plugins = array_map( 'get_plugin_data', $plugins );
|
37 |
-
$plugins = array_map(
|
38 |
|
39 |
-
$plugin_data =
|
40 |
foreach ( $plugins as $plugin ) {
|
41 |
$plugin_key = sanitize_title( $plugin['name'] );
|
42 |
$plugin_data[ $plugin_key ] = $plugin;
|
@@ -53,9 +53,9 @@ class WPSEO_Tracking_Plugin_Data implements WPSEO_Collection {
|
|
53 |
* @return array The formatted array.
|
54 |
*/
|
55 |
protected function format_plugin( array $plugin ) {
|
56 |
-
return
|
57 |
'name' => $plugin['Name'],
|
58 |
'version' => $plugin['Version'],
|
59 |
-
|
60 |
}
|
61 |
}
|
16 |
* @return array The collection data.
|
17 |
*/
|
18 |
public function get() {
|
19 |
+
return [
|
20 |
'plugins' => $this->get_plugin_data(),
|
21 |
+
];
|
22 |
}
|
23 |
|
24 |
/**
|
34 |
|
35 |
$plugins = wp_get_active_and_valid_plugins();
|
36 |
$plugins = array_map( 'get_plugin_data', $plugins );
|
37 |
+
$plugins = array_map( [ $this, 'format_plugin' ], $plugins );
|
38 |
|
39 |
+
$plugin_data = [];
|
40 |
foreach ( $plugins as $plugin ) {
|
41 |
$plugin_key = sanitize_title( $plugin['name'] );
|
42 |
$plugin_data[ $plugin_key ] = $plugin;
|
53 |
* @return array The formatted array.
|
54 |
*/
|
55 |
protected function format_plugin( array $plugin ) {
|
56 |
+
return [
|
57 |
'name' => $plugin['Name'],
|
58 |
'version' => $plugin['Version'],
|
59 |
+
];
|
60 |
}
|
61 |
}
|
admin/tracking/class-tracking-server-data.php
CHANGED
@@ -16,9 +16,9 @@ class WPSEO_Tracking_Server_Data implements WPSEO_Collection {
|
|
16 |
* @return array The collection data.
|
17 |
*/
|
18 |
public function get() {
|
19 |
-
return
|
20 |
'server' => $this->get_server_data(),
|
21 |
-
|
22 |
}
|
23 |
|
24 |
/**
|
@@ -27,7 +27,7 @@ class WPSEO_Tracking_Server_Data implements WPSEO_Collection {
|
|
27 |
* @return array Array with the value.
|
28 |
*/
|
29 |
protected function get_server_data() {
|
30 |
-
$server_data =
|
31 |
|
32 |
// Validate if the server address is a valid IP-address.
|
33 |
$ipaddress = filter_input( INPUT_SERVER, 'SERVER_ADDR', FILTER_VALIDATE_IP );
|
@@ -61,10 +61,10 @@ class WPSEO_Tracking_Server_Data implements WPSEO_Collection {
|
|
61 |
$ssl_support = false;
|
62 |
}
|
63 |
|
64 |
-
return
|
65 |
'version' => $curl['version'],
|
66 |
'sslSupport' => $ssl_support,
|
67 |
-
|
68 |
}
|
69 |
|
70 |
/**
|
@@ -73,13 +73,13 @@ class WPSEO_Tracking_Server_Data implements WPSEO_Collection {
|
|
73 |
* @return array Returns the state of the php extensions.
|
74 |
*/
|
75 |
protected function get_php_extensions() {
|
76 |
-
return
|
77 |
'imagick' => extension_loaded( 'imagick' ),
|
78 |
'filter' => extension_loaded( 'filter' ),
|
79 |
'bcmath' => extension_loaded( 'bcmath' ),
|
80 |
'modXml' => extension_loaded( 'modXml' ),
|
81 |
'pcre' => extension_loaded( 'pcre' ),
|
82 |
'xml' => extension_loaded( 'xml' ),
|
83 |
-
|
84 |
}
|
85 |
}
|
16 |
* @return array The collection data.
|
17 |
*/
|
18 |
public function get() {
|
19 |
+
return [
|
20 |
'server' => $this->get_server_data(),
|
21 |
+
];
|
22 |
}
|
23 |
|
24 |
/**
|
27 |
* @return array Array with the value.
|
28 |
*/
|
29 |
protected function get_server_data() {
|
30 |
+
$server_data = [];
|
31 |
|
32 |
// Validate if the server address is a valid IP-address.
|
33 |
$ipaddress = filter_input( INPUT_SERVER, 'SERVER_ADDR', FILTER_VALIDATE_IP );
|
61 |
$ssl_support = false;
|
62 |
}
|
63 |
|
64 |
+
return [
|
65 |
'version' => $curl['version'],
|
66 |
'sslSupport' => $ssl_support,
|
67 |
+
];
|
68 |
}
|
69 |
|
70 |
/**
|
73 |
* @return array Returns the state of the php extensions.
|
74 |
*/
|
75 |
protected function get_php_extensions() {
|
76 |
+
return [
|
77 |
'imagick' => extension_loaded( 'imagick' ),
|
78 |
'filter' => extension_loaded( 'filter' ),
|
79 |
'bcmath' => extension_loaded( 'bcmath' ),
|
80 |
'modXml' => extension_loaded( 'modXml' ),
|
81 |
'pcre' => extension_loaded( 'pcre' ),
|
82 |
'xml' => extension_loaded( 'xml' ),
|
83 |
+
];
|
84 |
}
|
85 |
}
|
admin/tracking/class-tracking-settings-data.php
CHANGED
@@ -14,7 +14,7 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
|
|
14 |
* @var array $anonymous_settings contains all of the option_names which need to be
|
15 |
* anonimized before they can be sent elsewhere.
|
16 |
*/
|
17 |
-
private $anonymous_settings =
|
18 |
'baiduverify',
|
19 |
'googleverify',
|
20 |
'msverify',
|
@@ -44,12 +44,12 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
|
|
44 |
'youtube_url',
|
45 |
'wikipedia_url',
|
46 |
'fbadminapp',
|
47 |
-
|
48 |
|
49 |
/**
|
50 |
* @var array $include_list contains the option_names for the options we want to track.
|
51 |
*/
|
52 |
-
private $include_list =
|
53 |
'ms_defaults_set',
|
54 |
'version',
|
55 |
'disableadvanced_meta',
|
@@ -155,7 +155,7 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
|
|
155 |
'youtube_url',
|
156 |
'wikipedia_url',
|
157 |
'fbadminapp',
|
158 |
-
|
159 |
|
160 |
/**
|
161 |
* Returns the collection data.
|
@@ -174,9 +174,9 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
|
|
174 |
// Returns the settings of which the keys intersect with the values of the include list.
|
175 |
$options = array_intersect_key( $options, array_flip( $this->include_list ) );
|
176 |
|
177 |
-
return
|
178 |
'settings' => $this->anonymize_settings( $options ),
|
179 |
-
|
180 |
}
|
181 |
|
182 |
/**
|
14 |
* @var array $anonymous_settings contains all of the option_names which need to be
|
15 |
* anonimized before they can be sent elsewhere.
|
16 |
*/
|
17 |
+
private $anonymous_settings = [
|
18 |
'baiduverify',
|
19 |
'googleverify',
|
20 |
'msverify',
|
44 |
'youtube_url',
|
45 |
'wikipedia_url',
|
46 |
'fbadminapp',
|
47 |
+
];
|
48 |
|
49 |
/**
|
50 |
* @var array $include_list contains the option_names for the options we want to track.
|
51 |
*/
|
52 |
+
private $include_list = [
|
53 |
'ms_defaults_set',
|
54 |
'version',
|
55 |
'disableadvanced_meta',
|
155 |
'youtube_url',
|
156 |
'wikipedia_url',
|
157 |
'fbadminapp',
|
158 |
+
];
|
159 |
|
160 |
/**
|
161 |
* Returns the collection data.
|
174 |
// Returns the settings of which the keys intersect with the values of the include list.
|
175 |
$options = array_intersect_key( $options, array_flip( $this->include_list ) );
|
176 |
|
177 |
+
return [
|
178 |
'settings' => $this->anonymize_settings( $options ),
|
179 |
+
];
|
180 |
}
|
181 |
|
182 |
/**
|
admin/tracking/class-tracking-theme-data.php
CHANGED
@@ -18,18 +18,18 @@ class WPSEO_Tracking_Theme_Data implements WPSEO_Collection {
|
|
18 |
public function get() {
|
19 |
$theme = wp_get_theme();
|
20 |
|
21 |
-
return
|
22 |
-
'theme' =>
|
23 |
'name' => $theme->get( 'Name' ),
|
24 |
'url' => $theme->get( 'ThemeURI' ),
|
25 |
'version' => $theme->get( 'Version' ),
|
26 |
-
'author' =>
|
27 |
'name' => $theme->get( 'Author' ),
|
28 |
'url' => $theme->get( 'AuthorURI' ),
|
29 |
-
|
30 |
'parentTheme' => $this->get_parent_theme( $theme ),
|
31 |
-
|
32 |
-
|
33 |
}
|
34 |
|
35 |
/**
|
18 |
public function get() {
|
19 |
$theme = wp_get_theme();
|
20 |
|
21 |
+
return [
|
22 |
+
'theme' => [
|
23 |
'name' => $theme->get( 'Name' ),
|
24 |
'url' => $theme->get( 'ThemeURI' ),
|
25 |
'version' => $theme->get( 'Version' ),
|
26 |
+
'author' => [
|
27 |
'name' => $theme->get( 'Author' ),
|
28 |
'url' => $theme->get( 'AuthorURI' ),
|
29 |
+
],
|
30 |
'parentTheme' => $this->get_parent_theme( $theme ),
|
31 |
+
],
|
32 |
+
];
|
33 |
}
|
34 |
|
35 |
/**
|
admin/tracking/class-tracking.php
CHANGED
@@ -18,7 +18,7 @@ class WPSEO_Tracking implements WPSEO_WordPress_Integration {
|
|
18 |
protected $option_name = 'wpseo_tracking_last_request';
|
19 |
|
20 |
/**
|
21 |
-
* The limit
|
22 |
*
|
23 |
* @var int
|
24 |
*/
|
@@ -39,7 +39,7 @@ class WPSEO_Tracking implements WPSEO_WordPress_Integration {
|
|
39 |
private $current_time;
|
40 |
|
41 |
/**
|
42 |
-
*
|
43 |
*
|
44 |
* @param string $endpoint The endpoint to send the data to.
|
45 |
* @param int $threshold The limit for the option.
|
@@ -54,14 +54,54 @@ class WPSEO_Tracking implements WPSEO_WordPress_Integration {
|
|
54 |
* Registers all hooks to WordPress.
|
55 |
*/
|
56 |
public function register_hooks() {
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
|
60 |
/**
|
61 |
* Sends the tracking data.
|
|
|
|
|
|
|
62 |
*/
|
63 |
-
public function send() {
|
64 |
-
if ( ! $this->should_send_tracking() ) {
|
65 |
return;
|
66 |
}
|
67 |
|
@@ -75,31 +115,44 @@ class WPSEO_Tracking implements WPSEO_WordPress_Integration {
|
|
75 |
}
|
76 |
|
77 |
/**
|
78 |
-
*
|
|
|
|
|
|
|
|
|
|
|
79 |
*
|
80 |
-
* @
|
|
|
|
|
|
|
81 |
*/
|
82 |
-
protected function should_send_tracking() {
|
83 |
global $pagenow;
|
84 |
|
85 |
/**
|
86 |
-
* Filter: '
|
87 |
*
|
88 |
-
* @api string $
|
89 |
*/
|
90 |
if ( apply_filters( 'wpseo_enable_tracking', false ) === false ) {
|
91 |
return false;
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
94 |
// Because we don't want to possibly block plugin actions with our routines.
|
95 |
-
if ( in_array( $pagenow,
|
96 |
return false;
|
97 |
}
|
98 |
|
99 |
$last_time = get_option( $this->option_name );
|
100 |
|
101 |
-
// When
|
102 |
-
if ( ! $last_time ) {
|
103 |
return true;
|
104 |
}
|
105 |
|
18 |
protected $option_name = 'wpseo_tracking_last_request';
|
19 |
|
20 |
/**
|
21 |
+
* The limit for the option.
|
22 |
*
|
23 |
* @var int
|
24 |
*/
|
39 |
private $current_time;
|
40 |
|
41 |
/**
|
42 |
+
* WPSEO_Tracking constructor.
|
43 |
*
|
44 |
* @param string $endpoint The endpoint to send the data to.
|
45 |
* @param int $threshold The limit for the option.
|
54 |
* Registers all hooks to WordPress.
|
55 |
*/
|
56 |
public function register_hooks() {
|
57 |
+
// Send tracking data on `admin_init`.
|
58 |
+
add_action( 'admin_init', [ $this, 'send' ], 1 );
|
59 |
+
|
60 |
+
// Add an action hook that will be triggered at the specified time by `wp_schedule_single_event()`.
|
61 |
+
add_action( 'wpseo_send_tracking_data_after_core_update', [ $this, 'send' ] );
|
62 |
+
// Call `wp_schedule_single_event()` after a WordPress core update.
|
63 |
+
add_action( 'upgrader_process_complete', [ $this, 'schedule_tracking_data_sending' ], 10, 2 );
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Schedules a new sending of the tracking data after a WordPress core update.
|
68 |
+
*
|
69 |
+
* @param bool|WP_Upgrader $upgrader Optional. WP_Upgrader instance or false.
|
70 |
+
* Depending on context, it might be a Theme_Upgrader,
|
71 |
+
* Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader.
|
72 |
+
* instance. Default false.
|
73 |
+
* @param array $data Array of update data.
|
74 |
+
*
|
75 |
+
* @return void
|
76 |
+
*/
|
77 |
+
public function schedule_tracking_data_sending( $upgrader = false, $data = [] ) {
|
78 |
+
// Return if it's not a WordPress core update.
|
79 |
+
if ( ! $upgrader || ! isset( $data['type'] ) || $data['type'] !== 'core' ) {
|
80 |
+
return;
|
81 |
+
}
|
82 |
+
|
83 |
+
/*
|
84 |
+
* To uniquely identify the scheduled cron event, `wp_next_scheduled()`
|
85 |
+
* needs to receive the same arguments as those used when originally
|
86 |
+
* scheduling the event otherwise it will always return false.
|
87 |
+
*/
|
88 |
+
if ( ! wp_next_scheduled( 'wpseo_send_tracking_data_after_core_update', true ) ) {
|
89 |
+
/*
|
90 |
+
* Schedule sending of data tracking 6 hours after a WordPress core
|
91 |
+
* update. Pass a `true` parameter for the callback `$force` argument.
|
92 |
+
*/
|
93 |
+
wp_schedule_single_event( ( time() + ( HOUR_IN_SECONDS * 6 ) ), 'wpseo_send_tracking_data_after_core_update', true );
|
94 |
+
}
|
95 |
}
|
96 |
|
97 |
/**
|
98 |
* Sends the tracking data.
|
99 |
+
*
|
100 |
+
* @param bool $force Whether to send the tracking data ignoring the two
|
101 |
+
* weeks time treshhold. Default false.
|
102 |
*/
|
103 |
+
public function send( $force = false ) {
|
104 |
+
if ( ! $this->should_send_tracking( $force ) ) {
|
105 |
return;
|
106 |
}
|
107 |
|
115 |
}
|
116 |
|
117 |
/**
|
118 |
+
* Determines whether to send the tracking data.
|
119 |
+
*
|
120 |
+
* Returns false if tracking is disabled or the current page is one of the
|
121 |
+
* admin plugins pages. Returns true when there's no tracking data stored or
|
122 |
+
* the data was sent more than two weeks ago. The two weeks interval is set
|
123 |
+
* when instantiating the class.
|
124 |
*
|
125 |
+
* @param bool $ignore_time_treshhold Whether to send the tracking data ignoring
|
126 |
+
* the two weeks time treshhold. Default false.
|
127 |
+
*
|
128 |
+
* @return bool True when tracking data should be sent.
|
129 |
*/
|
130 |
+
protected function should_send_tracking( $ignore_time_treshhold = false ) {
|
131 |
global $pagenow;
|
132 |
|
133 |
/**
|
134 |
+
* Filter: 'wpseo_enable_tracking' - Enables the data tracking of Yoast SEO Premium.
|
135 |
*
|
136 |
+
* @api string $is_enabled The enabled state. Default is false.
|
137 |
*/
|
138 |
if ( apply_filters( 'wpseo_enable_tracking', false ) === false ) {
|
139 |
return false;
|
140 |
}
|
141 |
|
142 |
+
// Only send tracking on the main site of a multi-site instance. This returns true on non-multisite installs.
|
143 |
+
if ( ! is_main_site() ) {
|
144 |
+
return false;
|
145 |
+
}
|
146 |
+
|
147 |
// Because we don't want to possibly block plugin actions with our routines.
|
148 |
+
if ( in_array( $pagenow, [ 'plugins.php', 'plugin-install.php', 'plugin-editor.php' ], true ) ) {
|
149 |
return false;
|
150 |
}
|
151 |
|
152 |
$last_time = get_option( $this->option_name );
|
153 |
|
154 |
+
// When tracking data haven't been sent yet or when sending data is forced.
|
155 |
+
if ( ! $last_time || $ignore_time_treshhold ) {
|
156 |
return true;
|
157 |
}
|
158 |
|
admin/views/class-view-utils.php
CHANGED
@@ -102,13 +102,13 @@ class Yoast_View_Utils {
|
|
102 |
|
103 |
$editor = new WPSEO_Replacevar_Editor(
|
104 |
$this->form,
|
105 |
-
|
106 |
'title' => 'title-' . $post_type->name,
|
107 |
'description' => 'metadesc-' . $post_type->name,
|
108 |
'page_type_recommended' => $recommended_replace_vars->determine_for_post_type( $post_type->name ),
|
109 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_post_type( $post_type->name ),
|
110 |
'paper_style' => $paper_style,
|
111 |
-
|
112 |
);
|
113 |
$editor->render();
|
114 |
}
|
102 |
|
103 |
$editor = new WPSEO_Replacevar_Editor(
|
104 |
$this->form,
|
105 |
+
[
|
106 |
'title' => 'title-' . $post_type->name,
|
107 |
'description' => 'metadesc-' . $post_type->name,
|
108 |
'page_type_recommended' => $recommended_replace_vars->determine_for_post_type( $post_type->name ),
|
109 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_post_type( $post_type->name ),
|
110 |
'paper_style' => $paper_style,
|
111 |
+
]
|
112 |
);
|
113 |
$editor->render();
|
114 |
}
|
admin/views/class-yoast-feature-toggle.php
CHANGED
@@ -80,7 +80,7 @@ class Yoast_Feature_Toggle {
|
|
80 |
* @throws InvalidArgumentException Thrown when a required argument is missing.
|
81 |
*/
|
82 |
public function __construct( array $args ) {
|
83 |
-
$required_keys =
|
84 |
|
85 |
foreach ( $required_keys as $key ) {
|
86 |
if ( empty( $args[ $key ] ) ) {
|
80 |
* @throws InvalidArgumentException Thrown when a required argument is missing.
|
81 |
*/
|
82 |
public function __construct( array $args ) {
|
83 |
+
$required_keys = [ 'name', 'setting', 'label' ];
|
84 |
|
85 |
foreach ( $required_keys as $key ) {
|
86 |
if ( empty( $args[ $key ] ) ) {
|
admin/views/class-yoast-feature-toggles.php
CHANGED
@@ -67,40 +67,40 @@ class Yoast_Feature_Toggles {
|
|
67 |
. '" target="_blank">' . esc_html__( 'See the XML sitemap.', 'wordpress-seo' ) . '</a>';
|
68 |
}
|
69 |
|
70 |
-
$feature_toggles =
|
71 |
-
(object)
|
72 |
'name' => __( 'SEO analysis', 'wordpress-seo' ),
|
73 |
'setting' => 'keyword_analysis_active',
|
74 |
'label' => __( 'The SEO analysis offers suggestions to improve the SEO of your text.', 'wordpress-seo' ),
|
75 |
'read_more_label' => __( 'Learn how the SEO analysis can help you rank.', 'wordpress-seo' ),
|
76 |
'read_more_url' => 'https://yoa.st/2ak',
|
77 |
'order' => 10,
|
78 |
-
|
79 |
-
(object)
|
80 |
'name' => __( 'Readability analysis', 'wordpress-seo' ),
|
81 |
'setting' => 'content_analysis_active',
|
82 |
'label' => __( 'The readability analysis offers suggestions to improve the structure and style of your text.', 'wordpress-seo' ),
|
83 |
'read_more_label' => __( 'Discover why readability is important for SEO.', 'wordpress-seo' ),
|
84 |
'read_more_url' => 'https://yoa.st/2ao',
|
85 |
'order' => 20,
|
86 |
-
|
87 |
-
(object)
|
88 |
'name' => __( 'Cornerstone content', 'wordpress-seo' ),
|
89 |
'setting' => 'enable_cornerstone_content',
|
90 |
'label' => __( 'The cornerstone content feature lets you to mark and filter cornerstone content on your website.', 'wordpress-seo' ),
|
91 |
'read_more_label' => __( 'Find out how cornerstone content can help you improve your site structure.', 'wordpress-seo' ),
|
92 |
'read_more_url' => 'https://yoa.st/dashboard-help-cornerstone',
|
93 |
'order' => 30,
|
94 |
-
|
95 |
-
(object)
|
96 |
'name' => __( 'Text link counter', 'wordpress-seo' ),
|
97 |
'setting' => 'enable_text_link_counter',
|
98 |
'label' => __( 'The text link counter helps you improve your site structure.', 'wordpress-seo' ),
|
99 |
'read_more_label' => __( 'Find out how the text link counter can enhance your SEO.', 'wordpress-seo' ),
|
100 |
'read_more_url' => 'https://yoa.st/2aj',
|
101 |
'order' => 40,
|
102 |
-
|
103 |
-
(object)
|
104 |
'name' => __( 'XML sitemaps', 'wordpress-seo' ),
|
105 |
'setting' => 'enable_xml_sitemap',
|
106 |
/* translators: %s: Yoast SEO */
|
@@ -109,8 +109,8 @@ class Yoast_Feature_Toggles {
|
|
109 |
'read_more_url' => 'https://yoa.st/2a-',
|
110 |
'extra' => $xml_sitemap_extra,
|
111 |
'order' => 60,
|
112 |
-
|
113 |
-
(object)
|
114 |
/* translators: %s: Ryte */
|
115 |
'name' => sprintf( __( '%s integration', 'wordpress-seo' ), 'Ryte' ),
|
116 |
'setting' => 'onpage_indexability',
|
@@ -124,15 +124,15 @@ class Yoast_Feature_Toggles {
|
|
124 |
'read_more_label' => sprintf( __( 'Read more about how %s works.', 'wordpress-seo' ), 'Ryte ' ),
|
125 |
'read_more_url' => 'https://yoa.st/2an',
|
126 |
'order' => 70,
|
127 |
-
|
128 |
-
(object)
|
129 |
'name' => __( 'Admin bar menu', 'wordpress-seo' ),
|
130 |
'setting' => 'enable_admin_bar_menu',
|
131 |
/* translators: 1: Yoast SEO */
|
132 |
'label' => sprintf( __( 'The %1$s admin bar menu contains useful links to third-party tools for analyzing pages and makes it easy to see if you have new notifications.', 'wordpress-seo' ), 'Yoast SEO' ),
|
133 |
'order' => 80,
|
134 |
-
|
135 |
-
(object)
|
136 |
'name' => __( 'Security: no advanced settings for authors', 'wordpress-seo' ),
|
137 |
'setting' => 'disableadvanced_meta',
|
138 |
'label' => sprintf(
|
@@ -142,8 +142,8 @@ class Yoast_Feature_Toggles {
|
|
142 |
__( 'Off', 'wordpress-seo' )
|
143 |
),
|
144 |
'order' => 90,
|
145 |
-
|
146 |
-
|
147 |
|
148 |
/**
|
149 |
* Filter to add feature toggles from add-ons.
|
@@ -153,8 +153,8 @@ class Yoast_Feature_Toggles {
|
|
153 |
*/
|
154 |
$feature_toggles = apply_filters( 'wpseo_feature_toggles', $feature_toggles );
|
155 |
|
156 |
-
$feature_toggles = array_map(
|
157 |
-
usort( $feature_toggles,
|
158 |
|
159 |
return $feature_toggles;
|
160 |
}
|
67 |
. '" target="_blank">' . esc_html__( 'See the XML sitemap.', 'wordpress-seo' ) . '</a>';
|
68 |
}
|
69 |
|
70 |
+
$feature_toggles = [
|
71 |
+
(object) [
|
72 |
'name' => __( 'SEO analysis', 'wordpress-seo' ),
|
73 |
'setting' => 'keyword_analysis_active',
|
74 |
'label' => __( 'The SEO analysis offers suggestions to improve the SEO of your text.', 'wordpress-seo' ),
|
75 |
'read_more_label' => __( 'Learn how the SEO analysis can help you rank.', 'wordpress-seo' ),
|
76 |
'read_more_url' => 'https://yoa.st/2ak',
|
77 |
'order' => 10,
|
78 |
+
],
|
79 |
+
(object) [
|
80 |
'name' => __( 'Readability analysis', 'wordpress-seo' ),
|
81 |
'setting' => 'content_analysis_active',
|
82 |
'label' => __( 'The readability analysis offers suggestions to improve the structure and style of your text.', 'wordpress-seo' ),
|
83 |
'read_more_label' => __( 'Discover why readability is important for SEO.', 'wordpress-seo' ),
|
84 |
'read_more_url' => 'https://yoa.st/2ao',
|
85 |
'order' => 20,
|
86 |
+
],
|
87 |
+
(object) [
|
88 |
'name' => __( 'Cornerstone content', 'wordpress-seo' ),
|
89 |
'setting' => 'enable_cornerstone_content',
|
90 |
'label' => __( 'The cornerstone content feature lets you to mark and filter cornerstone content on your website.', 'wordpress-seo' ),
|
91 |
'read_more_label' => __( 'Find out how cornerstone content can help you improve your site structure.', 'wordpress-seo' ),
|
92 |
'read_more_url' => 'https://yoa.st/dashboard-help-cornerstone',
|
93 |
'order' => 30,
|
94 |
+
],
|
95 |
+
(object) [
|
96 |
'name' => __( 'Text link counter', 'wordpress-seo' ),
|
97 |
'setting' => 'enable_text_link_counter',
|
98 |
'label' => __( 'The text link counter helps you improve your site structure.', 'wordpress-seo' ),
|
99 |
'read_more_label' => __( 'Find out how the text link counter can enhance your SEO.', 'wordpress-seo' ),
|
100 |
'read_more_url' => 'https://yoa.st/2aj',
|
101 |
'order' => 40,
|
102 |
+
],
|
103 |
+
(object) [
|
104 |
'name' => __( 'XML sitemaps', 'wordpress-seo' ),
|
105 |
'setting' => 'enable_xml_sitemap',
|
106 |
/* translators: %s: Yoast SEO */
|
109 |
'read_more_url' => 'https://yoa.st/2a-',
|
110 |
'extra' => $xml_sitemap_extra,
|
111 |
'order' => 60,
|
112 |
+
],
|
113 |
+
(object) [
|
114 |
/* translators: %s: Ryte */
|
115 |
'name' => sprintf( __( '%s integration', 'wordpress-seo' ), 'Ryte' ),
|
116 |
'setting' => 'onpage_indexability',
|
124 |
'read_more_label' => sprintf( __( 'Read more about how %s works.', 'wordpress-seo' ), 'Ryte ' ),
|
125 |
'read_more_url' => 'https://yoa.st/2an',
|
126 |
'order' => 70,
|
127 |
+
],
|
128 |
+
(object) [
|
129 |
'name' => __( 'Admin bar menu', 'wordpress-seo' ),
|
130 |
'setting' => 'enable_admin_bar_menu',
|
131 |
/* translators: 1: Yoast SEO */
|
132 |
'label' => sprintf( __( 'The %1$s admin bar menu contains useful links to third-party tools for analyzing pages and makes it easy to see if you have new notifications.', 'wordpress-seo' ), 'Yoast SEO' ),
|
133 |
'order' => 80,
|
134 |
+
],
|
135 |
+
(object) [
|
136 |
'name' => __( 'Security: no advanced settings for authors', 'wordpress-seo' ),
|
137 |
'setting' => 'disableadvanced_meta',
|
138 |
'label' => sprintf(
|
142 |
__( 'Off', 'wordpress-seo' )
|
143 |
),
|
144 |
'order' => 90,
|
145 |
+
],
|
146 |
+
];
|
147 |
|
148 |
/**
|
149 |
* Filter to add feature toggles from add-ons.
|
153 |
*/
|
154 |
$feature_toggles = apply_filters( 'wpseo_feature_toggles', $feature_toggles );
|
155 |
|
156 |
+
$feature_toggles = array_map( [ $this, 'ensure_toggle' ], $feature_toggles );
|
157 |
+
usort( $feature_toggles, [ $this, 'sort_toggles_callback' ] );
|
158 |
|
159 |
return $feature_toggles;
|
160 |
}
|
admin/views/class-yoast-input-select.php
CHANGED
@@ -29,7 +29,7 @@ class Yoast_Input_Select {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
private $select_attributes =
|
33 |
|
34 |
/**
|
35 |
* Array with the options to parse.
|
@@ -102,13 +102,13 @@ class Yoast_Input_Select {
|
|
102 |
* @return array
|
103 |
*/
|
104 |
private function get_select_values() {
|
105 |
-
return
|
106 |
'id' => $this->select_id,
|
107 |
'name' => $this->select_name,
|
108 |
'attributes' => $this->get_attributes(),
|
109 |
'options' => $this->select_options,
|
110 |
'selected' => $this->selected_option,
|
111 |
-
|
112 |
}
|
113 |
|
114 |
/**
|
@@ -120,7 +120,7 @@ class Yoast_Input_Select {
|
|
120 |
$attributes = $this->select_attributes;
|
121 |
|
122 |
if ( ! empty( $attributes ) ) {
|
123 |
-
array_walk( $attributes,
|
124 |
|
125 |
return implode( ' ', $attributes ) . ' ';
|
126 |
}
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
private $select_attributes = [];
|
33 |
|
34 |
/**
|
35 |
* Array with the options to parse.
|
102 |
* @return array
|
103 |
*/
|
104 |
private function get_select_values() {
|
105 |
+
return [
|
106 |
'id' => $this->select_id,
|
107 |
'name' => $this->select_name,
|
108 |
'attributes' => $this->get_attributes(),
|
109 |
'options' => $this->select_options,
|
110 |
'selected' => $this->selected_option,
|
111 |
+
];
|
112 |
}
|
113 |
|
114 |
/**
|
120 |
$attributes = $this->select_attributes;
|
121 |
|
122 |
if ( ! empty( $attributes ) ) {
|
123 |
+
array_walk( $attributes, [ $this, 'parse_attribute' ] );
|
124 |
|
125 |
return implode( ' ', $attributes ) . ' ';
|
126 |
}
|
admin/views/licenses.php
CHANGED
@@ -16,72 +16,72 @@ $extension_list = new WPSEO_Extensions();
|
|
16 |
$extensions = $extension_list->get();
|
17 |
|
18 |
// First invalidate all licenses.
|
19 |
-
array_map(
|
20 |
|
21 |
$premium_extension = new WPSEO_Extension(
|
22 |
-
|
23 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zz' ),
|
24 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zy' ),
|
25 |
'title' => 'Yoast SEO Premium',
|
26 |
/* translators: %1$s expands to Yoast SEO */
|
27 |
'desc' => sprintf( __( 'The premium version of %1$s with more features & support.', 'wordpress-seo' ), 'Yoast SEO' ),
|
28 |
-
'benefits' =>
|
29 |
-
|
30 |
);
|
31 |
|
32 |
-
$extensions =
|
33 |
WPSEO_Addon_Manager::LOCAL_SLUG => new WPSEO_Extension(
|
34 |
-
|
35 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zt' ),
|
36 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zs' ),
|
37 |
'title' => 'Local SEO',
|
38 |
'display_title' => 'Stop losing customers to other local businesses',
|
39 |
'desc' => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ),
|
40 |
'image' => plugins_url( 'images/local_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
|
41 |
-
'benefits' =>
|
42 |
__( 'Get better search results in local search', 'wordpress-seo' ),
|
43 |
__( 'Easily insert Google Maps, a store locator, opening hours and more', 'wordpress-seo' ),
|
44 |
/* translators: %1$s expands to WooCommerce */
|
45 |
sprintf( __( 'Allow customers to pick up their %s order locally', 'wordpress-seo' ), 'WooCommerce' ),
|
46 |
-
|
47 |
-
|
48 |
),
|
49 |
WPSEO_Addon_Manager::VIDEO_SLUG => new WPSEO_Extension(
|
50 |
-
|
51 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zx/' ),
|
52 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zw/' ),
|
53 |
'title' => 'Video SEO',
|
54 |
'display_title' => 'Start ranking better for your videos',
|
55 |
'desc' => __( 'Optimize your videos to show them off in search results and get more clicks!', 'wordpress-seo' ),
|
56 |
'image' => plugins_url( 'images/video_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
|
57 |
-
'benefits' =>
|
58 |
__( 'Show your videos in Google Videos', 'wordpress-seo' ),
|
59 |
__( 'Enhance the experience of sharing posts with videos', 'wordpress-seo' ),
|
60 |
__( 'Make videos responsive through enabling fitvids.js', 'wordpress-seo' ),
|
61 |
-
|
62 |
-
|
63 |
),
|
64 |
WPSEO_Addon_Manager::NEWS_SLUG => new WPSEO_Extension(
|
65 |
-
|
66 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zv/' ),
|
67 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zu/' ),
|
68 |
'title' => 'News SEO',
|
69 |
'display_title' => 'Everything you need for Google News',
|
70 |
'desc' => __( 'Are you in Google News? Increase your traffic from Google News by optimizing for it!', 'wordpress-seo' ),
|
71 |
'image' => plugins_url( 'images/news_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
|
72 |
-
'benefits' =>
|
73 |
__( 'Optimize your site for Google News', 'wordpress-seo' ),
|
74 |
__( 'Immediately pings Google on the publication of a new post', 'wordpress-seo' ),
|
75 |
__( 'Creates XML News Sitemaps', 'wordpress-seo' ),
|
76 |
-
|
77 |
-
|
78 |
),
|
79 |
-
|
80 |
|
81 |
// Add Yoast WooCommerce SEO when WooCommerce is active.
|
82 |
if ( WPSEO_Utils::is_woocommerce_active() ) {
|
83 |
$extensions[ WPSEO_Addon_Manager::WOOCOMMERCE_SLUG ] = new WPSEO_Extension(
|
84 |
-
|
85 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zr' ),
|
86 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zq' ),
|
87 |
'title' => 'Yoast WooCommerce SEO',
|
@@ -89,15 +89,15 @@ if ( WPSEO_Utils::is_woocommerce_active() ) {
|
|
89 |
/* translators: %1$s expands to Yoast SEO */
|
90 |
'desc' => sprintf( __( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ), 'Yoast SEO' ),
|
91 |
'image' => plugins_url( 'images/woo_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
|
92 |
-
'benefits' =>
|
93 |
sprintf( __( 'Improve sharing on Facebook and Pinterest', 'wordpress-seo' ) ),
|
94 |
/* translators: %1$s expands to Yoast, %2$s expands to WooCommerce */
|
95 |
sprintf( __( 'Use %1$s breadcrumbs instead of %2$s ones', 'wordpress-seo' ), 'Yoast', 'WooCommerce' ),
|
96 |
/* translators: %1$s expands to Yoast SEO, %2$s expands to WooCommerce */
|
97 |
sprintf( __( 'A seamless integration between %1$s and %2$s', 'wordpress-seo' ), 'Yoast SEO', 'WooCommerce' ),
|
98 |
-
|
99 |
'buy_button' => 'WooCommerce SEO',
|
100 |
-
|
101 |
);
|
102 |
}
|
103 |
|
16 |
$extensions = $extension_list->get();
|
17 |
|
18 |
// First invalidate all licenses.
|
19 |
+
array_map( [ $extension_list, 'invalidate' ], $extensions );
|
20 |
|
21 |
$premium_extension = new WPSEO_Extension(
|
22 |
+
[
|
23 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zz' ),
|
24 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zy' ),
|
25 |
'title' => 'Yoast SEO Premium',
|
26 |
/* translators: %1$s expands to Yoast SEO */
|
27 |
'desc' => sprintf( __( 'The premium version of %1$s with more features & support.', 'wordpress-seo' ), 'Yoast SEO' ),
|
28 |
+
'benefits' => [],
|
29 |
+
]
|
30 |
);
|
31 |
|
32 |
+
$extensions = [
|
33 |
WPSEO_Addon_Manager::LOCAL_SLUG => new WPSEO_Extension(
|
34 |
+
[
|
35 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zt' ),
|
36 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zs' ),
|
37 |
'title' => 'Local SEO',
|
38 |
'display_title' => 'Stop losing customers to other local businesses',
|
39 |
'desc' => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ),
|
40 |
'image' => plugins_url( 'images/local_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
|
41 |
+
'benefits' => [
|
42 |
__( 'Get better search results in local search', 'wordpress-seo' ),
|
43 |
__( 'Easily insert Google Maps, a store locator, opening hours and more', 'wordpress-seo' ),
|
44 |
/* translators: %1$s expands to WooCommerce */
|
45 |
sprintf( __( 'Allow customers to pick up their %s order locally', 'wordpress-seo' ), 'WooCommerce' ),
|
46 |
+
],
|
47 |
+
]
|
48 |
),
|
49 |
WPSEO_Addon_Manager::VIDEO_SLUG => new WPSEO_Extension(
|
50 |
+
[
|
51 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zx/' ),
|
52 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zw/' ),
|
53 |
'title' => 'Video SEO',
|
54 |
'display_title' => 'Start ranking better for your videos',
|
55 |
'desc' => __( 'Optimize your videos to show them off in search results and get more clicks!', 'wordpress-seo' ),
|
56 |
'image' => plugins_url( 'images/video_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
|
57 |
+
'benefits' => [
|
58 |
__( 'Show your videos in Google Videos', 'wordpress-seo' ),
|
59 |
__( 'Enhance the experience of sharing posts with videos', 'wordpress-seo' ),
|
60 |
__( 'Make videos responsive through enabling fitvids.js', 'wordpress-seo' ),
|
61 |
+
],
|
62 |
+
]
|
63 |
),
|
64 |
WPSEO_Addon_Manager::NEWS_SLUG => new WPSEO_Extension(
|
65 |
+
[
|
66 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zv/' ),
|
67 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zu/' ),
|
68 |
'title' => 'News SEO',
|
69 |
'display_title' => 'Everything you need for Google News',
|
70 |
'desc' => __( 'Are you in Google News? Increase your traffic from Google News by optimizing for it!', 'wordpress-seo' ),
|
71 |
'image' => plugins_url( 'images/news_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
|
72 |
+
'benefits' => [
|
73 |
__( 'Optimize your site for Google News', 'wordpress-seo' ),
|
74 |
__( 'Immediately pings Google on the publication of a new post', 'wordpress-seo' ),
|
75 |
__( 'Creates XML News Sitemaps', 'wordpress-seo' ),
|
76 |
+
],
|
77 |
+
]
|
78 |
),
|
79 |
+
];
|
80 |
|
81 |
// Add Yoast WooCommerce SEO when WooCommerce is active.
|
82 |
if ( WPSEO_Utils::is_woocommerce_active() ) {
|
83 |
$extensions[ WPSEO_Addon_Manager::WOOCOMMERCE_SLUG ] = new WPSEO_Extension(
|
84 |
+
[
|
85 |
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zr' ),
|
86 |
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zq' ),
|
87 |
'title' => 'Yoast WooCommerce SEO',
|
89 |
/* translators: %1$s expands to Yoast SEO */
|
90 |
'desc' => sprintf( __( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ), 'Yoast SEO' ),
|
91 |
'image' => plugins_url( 'images/woo_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
|
92 |
+
'benefits' => [
|
93 |
sprintf( __( 'Improve sharing on Facebook and Pinterest', 'wordpress-seo' ) ),
|
94 |
/* translators: %1$s expands to Yoast, %2$s expands to WooCommerce */
|
95 |
sprintf( __( 'Use %1$s breadcrumbs instead of %2$s ones', 'wordpress-seo' ), 'Yoast', 'WooCommerce' ),
|
96 |
/* translators: %1$s expands to Yoast SEO, %2$s expands to WooCommerce */
|
97 |
sprintf( __( 'A seamless integration between %1$s and %2$s', 'wordpress-seo' ), 'Yoast SEO', 'WooCommerce' ),
|
98 |
+
],
|
99 |
'buy_button' => 'WooCommerce SEO',
|
100 |
+
]
|
101 |
);
|
102 |
}
|
103 |
|
admin/views/partial-alerts-template.php
CHANGED
@@ -92,14 +92,14 @@ if ( ! $active ) {
|
|
92 |
$dismissed_paper = new WPSEO_Paper_Presenter(
|
93 |
esc_html( $i18n_muted_issues_title ),
|
94 |
null,
|
95 |
-
|
96 |
'paper_id' => esc_attr( $type . '-dismissed' ),
|
97 |
'paper_id_prefix' => 'yoast-',
|
98 |
'class' => 'yoast-alerts-dismissed',
|
99 |
'content' => _yoast_display_alerts( $dismissed, 'dismissed' ),
|
100 |
'collapsible' => true,
|
101 |
'collapsible_header_class' => 'yoast-alert',
|
102 |
-
|
103 |
);
|
104 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: current usage is considered safe.
|
105 |
echo $dismissed_paper->get_output();
|
92 |
$dismissed_paper = new WPSEO_Paper_Presenter(
|
93 |
esc_html( $i18n_muted_issues_title ),
|
94 |
null,
|
95 |
+
[
|
96 |
'paper_id' => esc_attr( $type . '-dismissed' ),
|
97 |
'paper_id_prefix' => 'yoast-',
|
98 |
'class' => 'yoast-alerts-dismissed',
|
99 |
'content' => _yoast_display_alerts( $dismissed, 'dismissed' ),
|
100 |
'collapsible' => true,
|
101 |
'collapsible_header_class' => 'yoast-alert',
|
102 |
+
]
|
103 |
);
|
104 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: current usage is considered safe.
|
105 |
echo $dismissed_paper->get_output();
|
admin/views/tabs/dashboard/dashboard.php
CHANGED
@@ -56,4 +56,4 @@ $wpseo_contributors_phrase = sprintf(
|
|
56 |
*
|
57 |
* @deprecated 7.0
|
58 |
*/
|
59 |
-
do_action_deprecated( 'wpseo_internal_linking',
|
56 |
*
|
57 |
* @deprecated 7.0
|
58 |
*/
|
59 |
+
do_action_deprecated( 'wpseo_internal_linking', [], 'WPSEO 7.0' );
|
admin/views/tabs/dashboard/features.php
CHANGED
@@ -48,10 +48,10 @@ $feature_toggles = Yoast_Feature_Toggles::instance()->get_all();
|
|
48 |
|
49 |
$yform->toggle_switch(
|
50 |
$feature->setting,
|
51 |
-
|
52 |
'on' => __( 'On', 'wordpress-seo' ),
|
53 |
'off' => __( 'Off', 'wordpress-seo' ),
|
54 |
-
|
55 |
'<strong>' . $feature->name . '</strong>',
|
56 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
57 |
);
|
48 |
|
49 |
$yform->toggle_switch(
|
50 |
$feature->setting,
|
51 |
+
[
|
52 |
'on' => __( 'On', 'wordpress-seo' ),
|
53 |
'off' => __( 'Off', 'wordpress-seo' ),
|
54 |
+
],
|
55 |
'<strong>' . $feature->name . '</strong>',
|
56 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
57 |
);
|
admin/views/tabs/dashboard/webmaster-tools.php
CHANGED
@@ -27,11 +27,11 @@ $msverify_link = 'https://www.bing.com/toolbox/webmaster/#/Dashboard/?url=' .
|
|
27 |
rawurlencode( str_replace( 'http://', '', get_bloginfo( 'url' ) ) );
|
28 |
|
29 |
$googleverify_link = add_query_arg(
|
30 |
-
|
31 |
'hl' => 'en',
|
32 |
'tid' => 'alternate',
|
33 |
'siteUrl' => rawurlencode( get_bloginfo( 'url' ) ) . '/',
|
34 |
-
|
35 |
'https://www.google.com/webmasters/verification/verification'
|
36 |
);
|
37 |
|
27 |
rawurlencode( str_replace( 'http://', '', get_bloginfo( 'url' ) ) );
|
28 |
|
29 |
$googleverify_link = add_query_arg(
|
30 |
+
[
|
31 |
'hl' => 'en',
|
32 |
'tid' => 'alternate',
|
33 |
'siteUrl' => rawurlencode( get_bloginfo( 'url' ) ) . '/',
|
34 |
+
],
|
35 |
'https://www.google.com/webmasters/verification/verification'
|
36 |
);
|
37 |
|
admin/views/tabs/metas/archives.php
CHANGED
@@ -14,23 +14,23 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
|
|
14 |
// To improve readability, this tab has been divided into separate blocks, included below.
|
15 |
require dirname( __FILE__ ) . '/archives/help.php';
|
16 |
|
17 |
-
$wpseo_archives =
|
18 |
-
|
19 |
'title' => esc_html__( 'Author archives settings', 'wordpress-seo' ),
|
20 |
'view_file' => 'paper-content/author-archive-settings.php',
|
21 |
'paper_id' => 'settings-author-archives',
|
22 |
-
|
23 |
-
|
24 |
'title' => esc_html__( 'Date archives settings', 'wordpress-seo' ),
|
25 |
'view_file' => 'paper-content/date-archives-settings.php',
|
26 |
'paper_id' => 'settings-date-archives',
|
27 |
-
|
28 |
-
|
29 |
'title' => esc_html__( 'Special Pages', 'wordpress-seo' ),
|
30 |
'view_file' => 'paper-content/special-pages.php',
|
31 |
'paper_id' => 'settings-special-pages',
|
32 |
-
|
33 |
-
|
34 |
|
35 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
36 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
@@ -39,14 +39,14 @@ foreach ( $wpseo_archives as $wpseo_archive_index => $wpseo_archive ) {
|
|
39 |
$wpseo_archive_presenter = new WPSEO_Paper_Presenter(
|
40 |
$wpseo_archive['title'],
|
41 |
dirname( __FILE__ ) . '/' . $wpseo_archive['view_file'],
|
42 |
-
|
43 |
'collapsible' => true,
|
44 |
'expanded' => ( $wpseo_archive_index === 0 ),
|
45 |
'paper_id' => $wpseo_archive['paper_id'],
|
46 |
'recommended_replace_vars' => $recommended_replace_vars,
|
47 |
'editor_specific_replace_vars' => $editor_specific_replace_vars,
|
48 |
'class' => 'search-appearance',
|
49 |
-
|
50 |
);
|
51 |
|
52 |
echo $wpseo_archive_presenter->get_output();
|
14 |
// To improve readability, this tab has been divided into separate blocks, included below.
|
15 |
require dirname( __FILE__ ) . '/archives/help.php';
|
16 |
|
17 |
+
$wpseo_archives = [
|
18 |
+
[
|
19 |
'title' => esc_html__( 'Author archives settings', 'wordpress-seo' ),
|
20 |
'view_file' => 'paper-content/author-archive-settings.php',
|
21 |
'paper_id' => 'settings-author-archives',
|
22 |
+
],
|
23 |
+
[
|
24 |
'title' => esc_html__( 'Date archives settings', 'wordpress-seo' ),
|
25 |
'view_file' => 'paper-content/date-archives-settings.php',
|
26 |
'paper_id' => 'settings-date-archives',
|
27 |
+
],
|
28 |
+
[
|
29 |
'title' => esc_html__( 'Special Pages', 'wordpress-seo' ),
|
30 |
'view_file' => 'paper-content/special-pages.php',
|
31 |
'paper_id' => 'settings-special-pages',
|
32 |
+
],
|
33 |
+
];
|
34 |
|
35 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
36 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
39 |
$wpseo_archive_presenter = new WPSEO_Paper_Presenter(
|
40 |
$wpseo_archive['title'],
|
41 |
dirname( __FILE__ ) . '/' . $wpseo_archive['view_file'],
|
42 |
+
[
|
43 |
'collapsible' => true,
|
44 |
'expanded' => ( $wpseo_archive_index === 0 ),
|
45 |
'paper_id' => $wpseo_archive['paper_id'],
|
46 |
'recommended_replace_vars' => $recommended_replace_vars,
|
47 |
'editor_specific_replace_vars' => $editor_specific_replace_vars,
|
48 |
'class' => 'search-appearance',
|
49 |
+
]
|
50 |
);
|
51 |
|
52 |
echo $wpseo_archive_presenter->get_output();
|
admin/views/tabs/metas/archives/help.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package WPSEO\Admin\Views\Archive
|
6 |
*/
|
7 |
|
8 |
-
$archives_help_content =
|
9 |
sprintf(
|
10 |
/* translators: %1$s / %2$s: links to an article about duplicate content on yoast.com */
|
11 |
esc_html__( 'If you\'re running a one author blog, the author archive will be exactly the same as your homepage. This is what\'s called a %1$sduplicate content problem%2$s.', 'wordpress-seo' ),
|
@@ -19,7 +19,7 @@ $archives_help_content = array(
|
|
19 |
),
|
20 |
esc_html__( 'Note that links to archives might be still output by your theme and you would need to remove them separately.', 'wordpress-seo' ),
|
21 |
esc_html__( 'Date-based archives could in some cases also be seen as duplicate content.', 'wordpress-seo' ),
|
22 |
-
|
23 |
|
24 |
$archives_help = new WPSEO_Admin_Help_Panel(
|
25 |
'search-appearance-archives',
|
5 |
* @package WPSEO\Admin\Views\Archive
|
6 |
*/
|
7 |
|
8 |
+
$archives_help_content = [
|
9 |
sprintf(
|
10 |
/* translators: %1$s / %2$s: links to an article about duplicate content on yoast.com */
|
11 |
esc_html__( 'If you\'re running a one author blog, the author archive will be exactly the same as your homepage. This is what\'s called a %1$sduplicate content problem%2$s.', 'wordpress-seo' ),
|
19 |
),
|
20 |
esc_html__( 'Note that links to archives might be still output by your theme and you would need to remove them separately.', 'wordpress-seo' ),
|
21 |
esc_html__( 'Date-based archives could in some cases also be seen as duplicate content.', 'wordpress-seo' ),
|
22 |
+
];
|
23 |
|
24 |
$archives_help = new WPSEO_Admin_Help_Panel(
|
25 |
'search-appearance-archives',
|
admin/views/tabs/metas/breadcrumbs.php
CHANGED
@@ -14,9 +14,9 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
|
|
14 |
$wpseo_breadcrumbs_presenter = new WPSEO_Paper_Presenter(
|
15 |
esc_html__( 'Breadcrumbs settings', 'wordpress-seo' ),
|
16 |
dirname( __FILE__ ) . '/paper-content/breadcrumbs-content.php',
|
17 |
-
|
18 |
'paper_id' => 'settings-breadcrumbs',
|
19 |
'class' => 'search-appearance',
|
20 |
-
|
21 |
);
|
22 |
echo $wpseo_breadcrumbs_presenter->get_output();
|
14 |
$wpseo_breadcrumbs_presenter = new WPSEO_Paper_Presenter(
|
15 |
esc_html__( 'Breadcrumbs settings', 'wordpress-seo' ),
|
16 |
dirname( __FILE__ ) . '/paper-content/breadcrumbs-content.php',
|
17 |
+
[
|
18 |
'paper_id' => 'settings-breadcrumbs',
|
19 |
'class' => 'search-appearance',
|
20 |
+
]
|
21 |
);
|
22 |
echo $wpseo_breadcrumbs_presenter->get_output();
|
admin/views/tabs/metas/general.php
CHANGED
@@ -14,10 +14,10 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
|
|
14 |
$wpseo_general_presenter = new WPSEO_Paper_Presenter(
|
15 |
'',
|
16 |
dirname( __FILE__ ) . '/paper-content/general-content.php',
|
17 |
-
|
18 |
'paper_id' => 'settings-general',
|
19 |
'class' => 'search-appearance',
|
20 |
-
|
21 |
);
|
22 |
|
23 |
echo $wpseo_general_presenter->get_output();
|
14 |
$wpseo_general_presenter = new WPSEO_Paper_Presenter(
|
15 |
'',
|
16 |
dirname( __FILE__ ) . '/paper-content/general-content.php',
|
17 |
+
[
|
18 |
'paper_id' => 'settings-general',
|
19 |
'class' => 'search-appearance',
|
20 |
+
]
|
21 |
);
|
22 |
|
23 |
echo $wpseo_general_presenter->get_output();
|
admin/views/tabs/metas/media.php
CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
|
|
14 |
$wpseo_media_presenter = new WPSEO_Paper_Presenter(
|
15 |
esc_html__( 'Media & attachment URLs', 'wordpress-seo' ),
|
16 |
dirname( __FILE__ ) . '/paper-content/media-content.php',
|
17 |
-
|
18 |
'help_text' => new WPSEO_Admin_Help_Panel(
|
19 |
'search-appearance-media',
|
20 |
__( 'Learn more about the Media and attachment URLs setting', 'wordpress-seo' ),
|
@@ -23,7 +23,7 @@ $wpseo_media_presenter = new WPSEO_Paper_Presenter(
|
|
23 |
),
|
24 |
'paper_id' => 'settings-media-attachment-url',
|
25 |
'class' => 'search-appearance',
|
26 |
-
|
27 |
);
|
28 |
|
29 |
echo $wpseo_media_presenter->get_output();
|
14 |
$wpseo_media_presenter = new WPSEO_Paper_Presenter(
|
15 |
esc_html__( 'Media & attachment URLs', 'wordpress-seo' ),
|
16 |
dirname( __FILE__ ) . '/paper-content/media-content.php',
|
17 |
+
[
|
18 |
'help_text' => new WPSEO_Admin_Help_Panel(
|
19 |
'search-appearance-media',
|
20 |
__( 'Learn more about the Media and attachment URLs setting', 'wordpress-seo' ),
|
23 |
),
|
24 |
'paper_id' => 'settings-media-attachment-url',
|
25 |
'class' => 'search-appearance',
|
26 |
+
]
|
27 |
);
|
28 |
|
29 |
echo $wpseo_media_presenter->get_output();
|
admin/views/tabs/metas/paper-content/author-archive-settings.php
CHANGED
@@ -9,10 +9,10 @@
|
|
9 |
|
10 |
$yform->toggle_switch(
|
11 |
'disable-author',
|
12 |
-
|
13 |
'off' => __( 'Enabled', 'wordpress-seo' ),
|
14 |
'on' => __( 'Disabled', 'wordpress-seo' ),
|
15 |
-
|
16 |
__( 'Author archives', 'wordpress-seo' )
|
17 |
);
|
18 |
|
@@ -71,13 +71,13 @@ $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
|
71 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
72 |
$editor = new WPSEO_Replacevar_Editor(
|
73 |
$yform,
|
74 |
-
|
75 |
'title' => 'title-author-wpseo',
|
76 |
'description' => 'metadesc-author-wpseo',
|
77 |
'page_type_recommended' => $recommended_replace_vars->determine_for_archive( 'author' ),
|
78 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( 'author' ),
|
79 |
'paper_style' => false,
|
80 |
-
|
81 |
);
|
82 |
|
83 |
$editor->render();
|
9 |
|
10 |
$yform->toggle_switch(
|
11 |
'disable-author',
|
12 |
+
[
|
13 |
'off' => __( 'Enabled', 'wordpress-seo' ),
|
14 |
'on' => __( 'Disabled', 'wordpress-seo' ),
|
15 |
+
],
|
16 |
__( 'Author archives', 'wordpress-seo' )
|
17 |
);
|
18 |
|
71 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
72 |
$editor = new WPSEO_Replacevar_Editor(
|
73 |
$yform,
|
74 |
+
[
|
75 |
'title' => 'title-author-wpseo',
|
76 |
'description' => 'metadesc-author-wpseo',
|
77 |
'page_type_recommended' => $recommended_replace_vars->determine_for_archive( 'author' ),
|
78 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( 'author' ),
|
79 |
'paper_style' => false,
|
80 |
+
]
|
81 |
);
|
82 |
|
83 |
$editor->render();
|
admin/views/tabs/metas/paper-content/breadcrumbs-content.php
CHANGED
@@ -26,10 +26,10 @@ if ( get_option( 'show_on_front' ) === 'page' && get_option( 'page_for_posts' )
|
|
26 |
$yform->show_hide_switch( 'breadcrumbs-display-blog-page', __( 'Show Blog page', 'wordpress-seo' ) );
|
27 |
}
|
28 |
|
29 |
-
$yoast_free_breadcrumb_bold_texts =
|
30 |
'on' => __( 'Bold', 'wordpress-seo' ),
|
31 |
'off' => __( 'Regular', 'wordpress-seo' ),
|
32 |
-
|
33 |
$yform->toggle_switch(
|
34 |
'breadcrumbs-boldlast',
|
35 |
$yoast_free_breadcrumb_bold_texts,
|
@@ -42,13 +42,13 @@ echo '<br/><br/>';
|
|
42 |
* WPSEO_Post_Type::get_accessible_post_types() should *not* be used here.
|
43 |
* Even posts that are not indexed, should be able to get breadcrumbs for accessibility/usability.
|
44 |
*/
|
45 |
-
$post_types = get_post_types(
|
46 |
-
if ( is_array( $post_types ) && $post_types !==
|
47 |
echo '<h2>' . esc_html__( 'Taxonomy to show in breadcrumbs for content types', 'wordpress-seo' ) . '</h2>';
|
48 |
foreach ( $post_types as $pt ) {
|
49 |
$taxonomies = get_object_taxonomies( $pt->name, 'objects' );
|
50 |
-
if ( is_array( $taxonomies ) && $taxonomies !==
|
51 |
-
$values =
|
52 |
foreach ( $taxonomies as $tax ) {
|
53 |
if ( ! $tax->public ) {
|
54 |
continue;
|
@@ -67,21 +67,21 @@ if ( is_array( $post_types ) && $post_types !== array() ) {
|
|
67 |
echo '<br/>';
|
68 |
|
69 |
$taxonomies = get_taxonomies(
|
70 |
-
|
71 |
'public' => true,
|
72 |
-
|
73 |
'objects'
|
74 |
);
|
75 |
|
76 |
-
if ( is_array( $taxonomies ) && $taxonomies !==
|
77 |
echo '<h2>' . esc_html__( 'Content type archive to show in breadcrumbs for taxonomies', 'wordpress-seo' ) . '</h2>';
|
78 |
foreach ( $taxonomies as $tax ) {
|
79 |
-
$values =
|
80 |
if ( get_option( 'show_on_front' ) === 'page' && get_option( 'page_for_posts' ) > 0 ) {
|
81 |
$values['post'] = __( 'Blog', 'wordpress-seo' );
|
82 |
}
|
83 |
|
84 |
-
if ( is_array( $post_types ) && $post_types !==
|
85 |
foreach ( $post_types as $pt ) {
|
86 |
if ( WPSEO_Post_Type::has_archive( $pt ) ) {
|
87 |
$values[ $pt->name ] = $pt->labels->name;
|
26 |
$yform->show_hide_switch( 'breadcrumbs-display-blog-page', __( 'Show Blog page', 'wordpress-seo' ) );
|
27 |
}
|
28 |
|
29 |
+
$yoast_free_breadcrumb_bold_texts = [
|
30 |
'on' => __( 'Bold', 'wordpress-seo' ),
|
31 |
'off' => __( 'Regular', 'wordpress-seo' ),
|
32 |
+
];
|
33 |
$yform->toggle_switch(
|
34 |
'breadcrumbs-boldlast',
|
35 |
$yoast_free_breadcrumb_bold_texts,
|
42 |
* WPSEO_Post_Type::get_accessible_post_types() should *not* be used here.
|
43 |
* Even posts that are not indexed, should be able to get breadcrumbs for accessibility/usability.
|
44 |
*/
|
45 |
+
$post_types = get_post_types( [ 'public' => true ], 'objects' );
|
46 |
+
if ( is_array( $post_types ) && $post_types !== [] ) {
|
47 |
echo '<h2>' . esc_html__( 'Taxonomy to show in breadcrumbs for content types', 'wordpress-seo' ) . '</h2>';
|
48 |
foreach ( $post_types as $pt ) {
|
49 |
$taxonomies = get_object_taxonomies( $pt->name, 'objects' );
|
50 |
+
if ( is_array( $taxonomies ) && $taxonomies !== [] ) {
|
51 |
+
$values = [ 0 => __( 'None', 'wordpress-seo' ) ];
|
52 |
foreach ( $taxonomies as $tax ) {
|
53 |
if ( ! $tax->public ) {
|
54 |
continue;
|
67 |
echo '<br/>';
|
68 |
|
69 |
$taxonomies = get_taxonomies(
|
70 |
+
[
|
71 |
'public' => true,
|
72 |
+
],
|
73 |
'objects'
|
74 |
);
|
75 |
|
76 |
+
if ( is_array( $taxonomies ) && $taxonomies !== [] ) {
|
77 |
echo '<h2>' . esc_html__( 'Content type archive to show in breadcrumbs for taxonomies', 'wordpress-seo' ) . '</h2>';
|
78 |
foreach ( $taxonomies as $tax ) {
|
79 |
+
$values = [ 0 => __( 'None', 'wordpress-seo' ) ];
|
80 |
if ( get_option( 'show_on_front' ) === 'page' && get_option( 'page_for_posts' ) > 0 ) {
|
81 |
$values['post'] = __( 'Blog', 'wordpress-seo' );
|
82 |
}
|
83 |
|
84 |
+
if ( is_array( $post_types ) && $post_types !== [] ) {
|
85 |
foreach ( $post_types as $pt ) {
|
86 |
if ( WPSEO_Post_Type::has_archive( $pt ) ) {
|
87 |
$values[ $pt->name ] = $pt->labels->name;
|
admin/views/tabs/metas/paper-content/date-archives-settings.php
CHANGED
@@ -9,10 +9,10 @@
|
|
9 |
|
10 |
$yform->toggle_switch(
|
11 |
'disable-date',
|
12 |
-
|
13 |
'off' => __( 'Enabled', 'wordpress-seo' ),
|
14 |
'on' => __( 'Disabled', 'wordpress-seo' ),
|
15 |
-
|
16 |
__( 'Date archives', 'wordpress-seo' )
|
17 |
);
|
18 |
|
@@ -42,13 +42,13 @@ $yform->toggle_switch(
|
|
42 |
|
43 |
$editor = new WPSEO_Replacevar_Editor(
|
44 |
$yform,
|
45 |
-
|
46 |
'title' => 'title-archive-wpseo',
|
47 |
'description' => 'metadesc-archive-wpseo',
|
48 |
'page_type_recommended' => $recommended_replace_vars->determine_for_archive( 'date' ),
|
49 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( 'date' ),
|
50 |
'paper_style' => false,
|
51 |
-
|
52 |
);
|
53 |
$editor->render();
|
54 |
?>
|
9 |
|
10 |
$yform->toggle_switch(
|
11 |
'disable-date',
|
12 |
+
[
|
13 |
'off' => __( 'Enabled', 'wordpress-seo' ),
|
14 |
'on' => __( 'Disabled', 'wordpress-seo' ),
|
15 |
+
],
|
16 |
__( 'Date archives', 'wordpress-seo' )
|
17 |
);
|
18 |
|
42 |
|
43 |
$editor = new WPSEO_Replacevar_Editor(
|
44 |
$yform,
|
45 |
+
[
|
46 |
'title' => 'title-archive-wpseo',
|
47 |
'description' => 'metadesc-archive-wpseo',
|
48 |
'page_type_recommended' => $recommended_replace_vars->determine_for_archive( 'date' ),
|
49 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( 'date' ),
|
50 |
'paper_style' => false,
|
51 |
+
]
|
52 |
);
|
53 |
$editor->render();
|
54 |
?>
|
admin/views/tabs/metas/paper-content/general/homepage.php
CHANGED
@@ -23,13 +23,13 @@
|
|
23 |
|
24 |
$editor = new WPSEO_Replacevar_Editor(
|
25 |
$yform,
|
26 |
-
|
27 |
'title' => 'title-home-wpseo',
|
28 |
'description' => 'metadesc-home-wpseo',
|
29 |
'page_type_recommended' => 'homepage',
|
30 |
'page_type_specific' => 'page',
|
31 |
'paper_style' => false,
|
32 |
-
|
33 |
);
|
34 |
$editor->render();
|
35 |
}
|
23 |
|
24 |
$editor = new WPSEO_Replacevar_Editor(
|
25 |
$yform,
|
26 |
+
[
|
27 |
'title' => 'title-home-wpseo',
|
28 |
'description' => 'metadesc-home-wpseo',
|
29 |
'page_type_recommended' => 'homepage',
|
30 |
'page_type_specific' => 'page',
|
31 |
'paper_style' => false,
|
32 |
+
]
|
33 |
);
|
34 |
$editor->render();
|
35 |
}
|
admin/views/tabs/metas/paper-content/general/knowledge-graph.php
CHANGED
@@ -37,10 +37,10 @@ $knowledge_graph_help = new WPSEO_Admin_Help_Panel(
|
|
37 |
<?php esc_html_e( 'Choose whether the site represents an organization or a person.', 'wordpress-seo' ); ?>
|
38 |
</p>
|
39 |
<?php
|
40 |
-
$yoast_free_kg_select_options =
|
41 |
'company' => __( 'Organization', 'wordpress-seo' ),
|
42 |
'person' => __( 'Person', 'wordpress-seo' ),
|
43 |
-
|
44 |
$yform->select( 'company_or_person', __( 'Organization or person', 'wordpress-seo' ), $yoast_free_kg_select_options, 'styled', false );
|
45 |
?>
|
46 |
<div id="knowledge-graph-company">
|
@@ -58,7 +58,7 @@ $knowledge_graph_help = new WPSEO_Admin_Help_Panel(
|
|
58 |
|
59 |
<h3><?php esc_html_e( 'Organization', 'wordpress-seo' ); ?></h3>
|
60 |
<?php
|
61 |
-
$yform->textinput( 'company_name', __( 'Organization name', 'wordpress-seo' ),
|
62 |
$yform->media_input( 'company_logo', __( 'Organization logo', 'wordpress-seo' ) );
|
63 |
?>
|
64 |
<div id="wpseo-local-seo-upsell"></div>
|
37 |
<?php esc_html_e( 'Choose whether the site represents an organization or a person.', 'wordpress-seo' ); ?>
|
38 |
</p>
|
39 |
<?php
|
40 |
+
$yoast_free_kg_select_options = [
|
41 |
'company' => __( 'Organization', 'wordpress-seo' ),
|
42 |
'person' => __( 'Person', 'wordpress-seo' ),
|
43 |
+
];
|
44 |
$yform->select( 'company_or_person', __( 'Organization or person', 'wordpress-seo' ), $yoast_free_kg_select_options, 'styled', false );
|
45 |
?>
|
46 |
<div id="knowledge-graph-company">
|
58 |
|
59 |
<h3><?php esc_html_e( 'Organization', 'wordpress-seo' ); ?></h3>
|
60 |
<?php
|
61 |
+
$yform->textinput( 'company_name', __( 'Organization name', 'wordpress-seo' ), [ 'autocomplete' => 'organization' ] );
|
62 |
$yform->media_input( 'company_logo', __( 'Organization logo', 'wordpress-seo' ) );
|
63 |
?>
|
64 |
<div id="wpseo-local-seo-upsell"></div>
|
admin/views/tabs/metas/paper-content/general/title-separator.php
CHANGED
@@ -19,7 +19,7 @@ $title_separator_help = new WPSEO_Admin_Help_Panel(
|
|
19 |
<?php
|
20 |
echo $title_separator_help->get_panel_html();
|
21 |
$legend = __( 'Title separator symbol', 'wordpress-seo' );
|
22 |
-
$legend_attr =
|
23 |
$yform->radio( 'separator', WPSEO_Option_Titles::get_instance()->get_separator_options_for_display(), $legend, $legend_attr );
|
24 |
?>
|
25 |
</div>
|
19 |
<?php
|
20 |
echo $title_separator_help->get_panel_html();
|
21 |
$legend = __( 'Title separator symbol', 'wordpress-seo' );
|
22 |
+
$legend_attr = [ 'class' => 'radiogroup screen-reader-text' ];
|
23 |
$yform->radio( 'separator', WPSEO_Option_Titles::get_instance()->get_separator_options_for_display(), $legend, $legend_attr );
|
24 |
?>
|
25 |
</div>
|
admin/views/tabs/metas/paper-content/media-content.php
CHANGED
@@ -15,10 +15,10 @@ $view_utils = new Yoast_View_Utils();
|
|
15 |
<p><strong><?php esc_html_e( 'We recommend you set this to Yes.', 'wordpress-seo' ); ?></strong></p>
|
16 |
<?php
|
17 |
|
18 |
-
$yoast_free_disable_attachments_texts =
|
19 |
'on' => __( 'Yes', 'wordpress-seo' ),
|
20 |
'off' => __( 'No', 'wordpress-seo' ),
|
21 |
-
|
22 |
$yform->toggle_switch(
|
23 |
'disable-attachment',
|
24 |
$yoast_free_disable_attachments_texts,
|
15 |
<p><strong><?php esc_html_e( 'We recommend you set this to Yes.', 'wordpress-seo' ); ?></strong></p>
|
16 |
<?php
|
17 |
|
18 |
+
$yoast_free_disable_attachments_texts = [
|
19 |
'on' => __( 'Yes', 'wordpress-seo' ),
|
20 |
'off' => __( 'No', 'wordpress-seo' ),
|
21 |
+
];
|
22 |
$yform->toggle_switch(
|
23 |
'disable-attachment',
|
24 |
$yoast_free_disable_attachments_texts,
|
admin/views/tabs/metas/paper-content/post-type-content.php
CHANGED
@@ -47,13 +47,13 @@ if ( WPSEO_Post_Type::has_archive( $wpseo_post_type ) ) {
|
|
47 |
|
48 |
$editor = new WPSEO_Replacevar_Editor(
|
49 |
$yform,
|
50 |
-
|
51 |
'title' => 'title-ptarchive-' . $wpseo_post_type->name,
|
52 |
'description' => 'metadesc-ptarchive-' . $wpseo_post_type->name,
|
53 |
'page_type_recommended' => $recommended_replace_vars->determine_for_archive( $wpseo_post_type->name ),
|
54 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( $wpseo_post_type->name ),
|
55 |
'paper_style' => false,
|
56 |
-
|
57 |
);
|
58 |
$editor->render();
|
59 |
|
47 |
|
48 |
$editor = new WPSEO_Replacevar_Editor(
|
49 |
$yform,
|
50 |
+
[
|
51 |
'title' => 'title-ptarchive-' . $wpseo_post_type->name,
|
52 |
'description' => 'metadesc-ptarchive-' . $wpseo_post_type->name,
|
53 |
'page_type_recommended' => $recommended_replace_vars->determine_for_archive( $wpseo_post_type->name ),
|
54 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( $wpseo_post_type->name ),
|
55 |
'paper_style' => false,
|
56 |
+
]
|
57 |
);
|
58 |
$editor->render();
|
59 |
|
admin/views/tabs/metas/paper-content/post_type/post-type.php
CHANGED
@@ -34,12 +34,12 @@ $yform->show_hide_switch(
|
|
34 |
|
35 |
$editor = new WPSEO_Replacevar_Editor(
|
36 |
$yform,
|
37 |
-
|
38 |
'title' => 'title-' . $wpseo_post_type->name,
|
39 |
'description' => 'metadesc-' . $wpseo_post_type->name,
|
40 |
'page_type_recommended' => $recommended_replace_vars->determine_for_post_type( $wpseo_post_type->name ),
|
41 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_post_type( $wpseo_post_type->name ),
|
42 |
'paper_style' => false,
|
43 |
-
|
44 |
);
|
45 |
$editor->render();
|
34 |
|
35 |
$editor = new WPSEO_Replacevar_Editor(
|
36 |
$yform,
|
37 |
+
[
|
38 |
'title' => 'title-' . $wpseo_post_type->name,
|
39 |
'description' => 'metadesc-' . $wpseo_post_type->name,
|
40 |
'page_type_recommended' => $recommended_replace_vars->determine_for_post_type( $wpseo_post_type->name ),
|
41 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_post_type( $wpseo_post_type->name ),
|
42 |
'paper_style' => false,
|
43 |
+
]
|
44 |
);
|
45 |
$editor->render();
|
admin/views/tabs/metas/paper-content/rss-content.php
CHANGED
@@ -7,10 +7,10 @@
|
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
-
$textarea_atts =
|
11 |
'cols' => '50',
|
12 |
'rows' => '5',
|
13 |
-
|
14 |
$yform->textarea( 'rssbefore', __( 'Content to put before each post in the feed', 'wordpress-seo' ), $textarea_atts );
|
15 |
$yform->textarea( 'rssafter', __( 'Content to put after each post in the feed', 'wordpress-seo' ), $textarea_atts );
|
16 |
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
+
$textarea_atts = [
|
11 |
'cols' => '50',
|
12 |
'rows' => '5',
|
13 |
+
];
|
14 |
$yform->textarea( 'rssbefore', __( 'Content to put before each post in the feed', 'wordpress-seo' ), $textarea_atts );
|
15 |
$yform->textarea( 'rssafter', __( 'Content to put after each post in the feed', 'wordpress-seo' ), $textarea_atts );
|
16 |
|
admin/views/tabs/metas/paper-content/taxonomy-content.php
CHANGED
@@ -16,7 +16,7 @@ if ( $wpseo_taxonomy->name === 'post_format' ) {
|
|
16 |
$yform->light_switch(
|
17 |
'disable-post_format',
|
18 |
__( 'Format-based archives', 'wordpress-seo' ),
|
19 |
-
|
20 |
false
|
21 |
);
|
22 |
}
|
@@ -37,13 +37,13 @@ $page_type = $recommended_replace_vars->determine_for_term( $wpseo_taxonomy->nam
|
|
37 |
|
38 |
$editor = new WPSEO_Replacevar_Editor(
|
39 |
$yform,
|
40 |
-
|
41 |
'title' => 'title-tax-' . $wpseo_taxonomy->name,
|
42 |
'description' => 'metadesc-tax-' . $wpseo_taxonomy->name,
|
43 |
'page_type_recommended' => $recommended_replace_vars->determine_for_term( $wpseo_taxonomy->name ),
|
44 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_term( $wpseo_taxonomy->name ),
|
45 |
'paper_style' => false,
|
46 |
-
|
47 |
);
|
48 |
$editor->render();
|
49 |
|
16 |
$yform->light_switch(
|
17 |
'disable-post_format',
|
18 |
__( 'Format-based archives', 'wordpress-seo' ),
|
19 |
+
[ __( 'Enabled', 'wordpress-seo' ), __( 'Disabled', 'wordpress-seo' ) ],
|
20 |
false
|
21 |
);
|
22 |
}
|
37 |
|
38 |
$editor = new WPSEO_Replacevar_Editor(
|
39 |
$yform,
|
40 |
+
[
|
41 |
'title' => 'title-tax-' . $wpseo_taxonomy->name,
|
42 |
'description' => 'metadesc-tax-' . $wpseo_taxonomy->name,
|
43 |
'page_type_recommended' => $recommended_replace_vars->determine_for_term( $wpseo_taxonomy->name ),
|
44 |
'page_type_specific' => $editor_specific_replace_vars->determine_for_term( $wpseo_taxonomy->name ),
|
45 |
'paper_style' => false,
|
46 |
+
]
|
47 |
);
|
48 |
$editor->render();
|
49 |
|
admin/views/tabs/metas/post-types.php
CHANGED
@@ -16,7 +16,7 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
|
|
16 |
* Otherwise setting a post-type to `noindex` will remove it from the list,
|
17 |
* making it very hard to restore the setting again.
|
18 |
*/
|
19 |
-
$wpseo_post_types = get_post_types(
|
20 |
|
21 |
// We'll show attachments on the Media tab.
|
22 |
$wpseo_post_types = WPSEO_Post_Type::filter_attachment_post_type( $wpseo_post_types );
|
@@ -25,7 +25,7 @@ echo '<p>';
|
|
25 |
esc_html_e( 'The settings on this page allow you to specify what the default search appearance should be for any type of content you have. You can choose which content types appear in search results and what their default description should be.', 'wordpress-seo' );
|
26 |
echo '</p>';
|
27 |
|
28 |
-
if ( is_array( $wpseo_post_types ) && $wpseo_post_types !==
|
29 |
$view_utils = new Yoast_View_Utils();
|
30 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
31 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
@@ -34,20 +34,20 @@ if ( is_array( $wpseo_post_types ) && $wpseo_post_types !== array() ) {
|
|
34 |
$wpseo_post_type_presenter = new WPSEO_Paper_Presenter(
|
35 |
$post_type->labels->name,
|
36 |
dirname( __FILE__ ) . '/paper-content/post-type-content.php',
|
37 |
-
|
38 |
'collapsible' => true,
|
39 |
'expanded' => ( $wpseo_post_type_index === 0 ),
|
40 |
'paper_id' => 'settings-' . $post_type->name,
|
41 |
-
'view_data' =>
|
42 |
'wpseo_post_type' => $post_type,
|
43 |
'view_utils' => $view_utils,
|
44 |
'recommended_replace_vars' => $recommended_replace_vars,
|
45 |
'editor_specific_replace_vars' => $editor_specific_replace_vars,
|
46 |
-
|
47 |
'title' => $post_type->labels->name,
|
48 |
'title_after' => ' (<code>' . esc_html( $post_type->name ) . '</code>)',
|
49 |
'class' => 'search-appearance',
|
50 |
-
|
51 |
);
|
52 |
|
53 |
echo $wpseo_post_type_presenter->get_output();
|
16 |
* Otherwise setting a post-type to `noindex` will remove it from the list,
|
17 |
* making it very hard to restore the setting again.
|
18 |
*/
|
19 |
+
$wpseo_post_types = get_post_types( [ 'public' => true ], 'objects' );
|
20 |
|
21 |
// We'll show attachments on the Media tab.
|
22 |
$wpseo_post_types = WPSEO_Post_Type::filter_attachment_post_type( $wpseo_post_types );
|
25 |
esc_html_e( 'The settings on this page allow you to specify what the default search appearance should be for any type of content you have. You can choose which content types appear in search results and what their default description should be.', 'wordpress-seo' );
|
26 |
echo '</p>';
|
27 |
|
28 |
+
if ( is_array( $wpseo_post_types ) && $wpseo_post_types !== [] ) {
|
29 |
$view_utils = new Yoast_View_Utils();
|
30 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
31 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
34 |
$wpseo_post_type_presenter = new WPSEO_Paper_Presenter(
|
35 |
$post_type->labels->name,
|
36 |
dirname( __FILE__ ) . '/paper-content/post-type-content.php',
|
37 |
+
[
|
38 |
'collapsible' => true,
|
39 |
'expanded' => ( $wpseo_post_type_index === 0 ),
|
40 |
'paper_id' => 'settings-' . $post_type->name,
|
41 |
+
'view_data' => [
|
42 |
'wpseo_post_type' => $post_type,
|
43 |
'view_utils' => $view_utils,
|
44 |
'recommended_replace_vars' => $recommended_replace_vars,
|
45 |
'editor_specific_replace_vars' => $editor_specific_replace_vars,
|
46 |
+
],
|
47 |
'title' => $post_type->labels->name,
|
48 |
'title_after' => ' (<code>' . esc_html( $post_type->name ) . '</code>)',
|
49 |
'class' => 'search-appearance',
|
50 |
+
]
|
51 |
);
|
52 |
|
53 |
echo $wpseo_post_type_presenter->get_output();
|
admin/views/tabs/metas/rss.php
CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
|
|
14 |
$wpseo_rss_presenter = new WPSEO_Paper_Presenter(
|
15 |
esc_html__( 'RSS feed settings', 'wordpress-seo' ),
|
16 |
dirname( __FILE__ ) . '/paper-content/rss-content.php',
|
17 |
-
|
18 |
'help_text' => new WPSEO_Admin_Help_Panel(
|
19 |
'search-appearance-rss',
|
20 |
__( 'Learn more about the RSS feed setting', 'wordpress-seo' ),
|
@@ -23,7 +23,7 @@ $wpseo_rss_presenter = new WPSEO_Paper_Presenter(
|
|
23 |
),
|
24 |
'paper_id' => 'settings-rss-feed',
|
25 |
'class' => 'search-appearance',
|
26 |
-
|
27 |
);
|
28 |
|
29 |
echo $wpseo_rss_presenter->get_output();
|
14 |
$wpseo_rss_presenter = new WPSEO_Paper_Presenter(
|
15 |
esc_html__( 'RSS feed settings', 'wordpress-seo' ),
|
16 |
dirname( __FILE__ ) . '/paper-content/rss-content.php',
|
17 |
+
[
|
18 |
'help_text' => new WPSEO_Admin_Help_Panel(
|
19 |
'search-appearance-rss',
|
20 |
__( 'Learn more about the RSS feed setting', 'wordpress-seo' ),
|
23 |
),
|
24 |
'paper_id' => 'settings-rss-feed',
|
25 |
'class' => 'search-appearance',
|
26 |
+
]
|
27 |
);
|
28 |
|
29 |
echo $wpseo_rss_presenter->get_output();
|
admin/views/tabs/metas/taxonomies.php
CHANGED
@@ -11,32 +11,32 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
|
|
11 |
exit();
|
12 |
}
|
13 |
|
14 |
-
$wpseo_taxonomies = get_taxonomies(
|
15 |
-
if ( is_array( $wpseo_taxonomies ) && $wpseo_taxonomies !==
|
16 |
$view_utils = new Yoast_View_Utils();
|
17 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
18 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
19 |
|
20 |
// Explicitly hide all the core taxonomies we never want to do stuff for.
|
21 |
-
$wpseo_taxonomies = array_diff_key( $wpseo_taxonomies, array_flip(
|
22 |
|
23 |
foreach ( array_values( $wpseo_taxonomies ) as $wpseo_taxonomy_index => $wpseo_taxonomy ) {
|
24 |
$wpseo_taxonomy_presenter = new WPSEO_Paper_Presenter(
|
25 |
$wpseo_taxonomy->labels->name,
|
26 |
dirname( __FILE__ ) . '/paper-content/taxonomy-content.php',
|
27 |
-
|
28 |
'collapsible' => true,
|
29 |
'expanded' => ( $wpseo_taxonomy_index === 0 ),
|
30 |
'paper_id' => 'settings-' . $wpseo_taxonomy->name,
|
31 |
-
'view_data' =>
|
32 |
'wpseo_taxonomy' => $wpseo_taxonomy,
|
33 |
'view_utils' => $view_utils,
|
34 |
'recommended_replace_vars' => $recommended_replace_vars,
|
35 |
'editor_specific_replace_vars' => $editor_specific_replace_vars,
|
36 |
-
|
37 |
'title_after' => ' (<code>' . esc_html( $wpseo_taxonomy->name ) . '</code>)',
|
38 |
'class' => 'search-appearance',
|
39 |
-
|
40 |
);
|
41 |
echo $wpseo_taxonomy_presenter->get_output();
|
42 |
}
|
11 |
exit();
|
12 |
}
|
13 |
|
14 |
+
$wpseo_taxonomies = get_taxonomies( [ 'public' => true ], 'objects' );
|
15 |
+
if ( is_array( $wpseo_taxonomies ) && $wpseo_taxonomies !== [] ) {
|
16 |
$view_utils = new Yoast_View_Utils();
|
17 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
18 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
19 |
|
20 |
// Explicitly hide all the core taxonomies we never want to do stuff for.
|
21 |
+
$wpseo_taxonomies = array_diff_key( $wpseo_taxonomies, array_flip( [ 'link_category', 'nav_menu' ] ) );
|
22 |
|
23 |
foreach ( array_values( $wpseo_taxonomies ) as $wpseo_taxonomy_index => $wpseo_taxonomy ) {
|
24 |
$wpseo_taxonomy_presenter = new WPSEO_Paper_Presenter(
|
25 |
$wpseo_taxonomy->labels->name,
|
26 |
dirname( __FILE__ ) . '/paper-content/taxonomy-content.php',
|
27 |
+
[
|
28 |
'collapsible' => true,
|
29 |
'expanded' => ( $wpseo_taxonomy_index === 0 ),
|
30 |
'paper_id' => 'settings-' . $wpseo_taxonomy->name,
|
31 |
+
'view_data' => [
|
32 |
'wpseo_taxonomy' => $wpseo_taxonomy,
|
33 |
'view_utils' => $view_utils,
|
34 |
'recommended_replace_vars' => $recommended_replace_vars,
|
35 |
'editor_specific_replace_vars' => $editor_specific_replace_vars,
|
36 |
+
],
|
37 |
'title_after' => ' (<code>' . esc_html( $wpseo_taxonomy->name ) . '</code>)',
|
38 |
'class' => 'search-appearance',
|
39 |
+
]
|
40 |
);
|
41 |
echo $wpseo_taxonomy_presenter->get_output();
|
42 |
}
|
admin/views/tabs/metas/taxonomies/category-url.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
-
$remove_buttons =
|
11 |
|
12 |
$stripcategorybase_help = new WPSEO_Admin_Help_Panel(
|
13 |
'opengraph',
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
+
$remove_buttons = [ __( 'Keep', 'wordpress-seo' ), __( 'Remove', 'wordpress-seo' ) ];
|
11 |
|
12 |
$stripcategorybase_help = new WPSEO_Admin_Help_Panel(
|
13 |
'opengraph',
|
admin/views/tabs/network/features.php
CHANGED
@@ -48,10 +48,10 @@ $feature_toggles = Yoast_Feature_Toggles::instance()->get_all();
|
|
48 |
|
49 |
$yform->toggle_switch(
|
50 |
WPSEO_Option::ALLOW_KEY_PREFIX . $feature->setting,
|
51 |
-
|
52 |
'on' => __( 'Allow Control', 'wordpress-seo' ),
|
53 |
'off' => __( 'Disable', 'wordpress-seo' ),
|
54 |
-
|
55 |
'<strong>' . $feature->name . '</strong>',
|
56 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
57 |
);
|
48 |
|
49 |
$yform->toggle_switch(
|
50 |
WPSEO_Option::ALLOW_KEY_PREFIX . $feature->setting,
|
51 |
+
[
|
52 |
'on' => __( 'Allow Control', 'wordpress-seo' ),
|
53 |
'off' => __( 'Disable', 'wordpress-seo' ),
|
54 |
+
],
|
55 |
'<strong>' . $feature->name . '</strong>',
|
56 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
57 |
);
|
admin/views/tabs/network/general.php
CHANGED
@@ -21,10 +21,10 @@ $yform->select(
|
|
21 |
'access',
|
22 |
/* translators: %1$s expands to Yoast SEO */
|
23 |
sprintf( __( 'Who should have access to the %1$s settings', 'wordpress-seo' ), 'Yoast SEO' ),
|
24 |
-
|
25 |
'admin' => __( 'Site Admins (default)', 'wordpress-seo' ),
|
26 |
'superadmin' => __( 'Super Admins only', 'wordpress-seo' ),
|
27 |
-
|
28 |
);
|
29 |
|
30 |
if ( get_blog_count() <= 100 ) {
|
21 |
'access',
|
22 |
/* translators: %1$s expands to Yoast SEO */
|
23 |
sprintf( __( 'Who should have access to the %1$s settings', 'wordpress-seo' ), 'Yoast SEO' ),
|
24 |
+
[
|
25 |
'admin' => __( 'Site Admins (default)', 'wordpress-seo' ),
|
26 |
'superadmin' => __( 'Super Admins only', 'wordpress-seo' ),
|
27 |
+
]
|
28 |
);
|
29 |
|
30 |
if ( get_blog_count() <= 100 ) {
|
admin/views/tabs/social/accounts.php
CHANGED
@@ -23,40 +23,40 @@ $social_profiles_help = new WPSEO_Admin_Help_Panel(
|
|
23 |
|
24 |
$company_or_person = WPSEO_Options::get( 'company_or_person', '' );
|
25 |
|
26 |
-
$organization_social_fields =
|
27 |
-
|
28 |
'id' => 'facebook_site',
|
29 |
'label' => __( 'Facebook Page URL', 'wordpress-seo' ),
|
30 |
-
|
31 |
-
|
32 |
'id' => 'twitter_site',
|
33 |
'label' => __( 'Twitter Username', 'wordpress-seo' ),
|
34 |
-
|
35 |
-
|
36 |
'id' => 'instagram_url',
|
37 |
'label' => __( 'Instagram URL', 'wordpress-seo' ),
|
38 |
-
|
39 |
-
|
40 |
'id' => 'linkedin_url',
|
41 |
'label' => __( 'LinkedIn URL', 'wordpress-seo' ),
|
42 |
-
|
43 |
-
|
44 |
'id' => 'myspace_url',
|
45 |
'label' => __( 'MySpace URL', 'wordpress-seo' ),
|
46 |
-
|
47 |
-
|
48 |
'id' => 'pinterest_url',
|
49 |
'label' => __( 'Pinterest URL', 'wordpress-seo' ),
|
50 |
-
|
51 |
-
|
52 |
'id' => 'youtube_url',
|
53 |
'label' => __( 'YouTube URL', 'wordpress-seo' ),
|
54 |
-
|
55 |
-
|
56 |
'id' => 'wikipedia_url',
|
57 |
'label' => __( 'Wikipedia URL', 'wordpress-seo' ),
|
58 |
-
|
59 |
-
|
60 |
|
61 |
$yform = Yoast_Form::get_instance();
|
62 |
|
23 |
|
24 |
$company_or_person = WPSEO_Options::get( 'company_or_person', '' );
|
25 |
|
26 |
+
$organization_social_fields = [
|
27 |
+
[
|
28 |
'id' => 'facebook_site',
|
29 |
'label' => __( 'Facebook Page URL', 'wordpress-seo' ),
|
30 |
+
],
|
31 |
+
[
|
32 |
'id' => 'twitter_site',
|
33 |
'label' => __( 'Twitter Username', 'wordpress-seo' ),
|
34 |
+
],
|
35 |
+
[
|
36 |
'id' => 'instagram_url',
|
37 |
'label' => __( 'Instagram URL', 'wordpress-seo' ),
|
38 |
+
],
|
39 |
+
[
|
40 |
'id' => 'linkedin_url',
|
41 |
'label' => __( 'LinkedIn URL', 'wordpress-seo' ),
|
42 |
+
],
|
43 |
+
[
|
44 |
'id' => 'myspace_url',
|
45 |
'label' => __( 'MySpace URL', 'wordpress-seo' ),
|
46 |
+
],
|
47 |
+
[
|
48 |
'id' => 'pinterest_url',
|
49 |
'label' => __( 'Pinterest URL', 'wordpress-seo' ),
|
50 |
+
],
|
51 |
+
[
|
52 |
'id' => 'youtube_url',
|
53 |
'label' => __( 'YouTube URL', 'wordpress-seo' ),
|
54 |
+
],
|
55 |
+
[
|
56 |
'id' => 'wikipedia_url',
|
57 |
'label' => __( 'Wikipedia URL', 'wordpress-seo' ),
|
58 |
+
],
|
59 |
+
];
|
60 |
|
61 |
$yform = Yoast_Form::get_instance();
|
62 |
|
admin/views/tabs/social/twitterbox.php
CHANGED
@@ -21,7 +21,7 @@ printf(
|
|
21 |
esc_html__( 'Twitter uses Open Graph metadata just like Facebook, so be sure to keep the Open Graph checkbox on the Facebook tab checked if you want to optimize your site for Twitter.', 'wordpress-seo' )
|
22 |
);
|
23 |
|
24 |
-
$yform->light_switch( 'twitter', __( 'Add Twitter card meta data', 'wordpress-seo' ),
|
25 |
|
26 |
echo '<p>';
|
27 |
esc_html_e( 'Enable this feature if you want Twitter to display a preview with images and a text excerpt when a link to your site is shared.', 'wordpress-seo' );
|
21 |
esc_html__( 'Twitter uses Open Graph metadata just like Facebook, so be sure to keep the Open Graph checkbox on the Facebook tab checked if you want to optimize your site for Twitter.', 'wordpress-seo' )
|
22 |
);
|
23 |
|
24 |
+
$yform->light_switch( 'twitter', __( 'Add Twitter card meta data', 'wordpress-seo' ), [], true, '', true );
|
25 |
|
26 |
echo '<p>';
|
27 |
esc_html_e( 'Enable this feature if you want Twitter to display a preview with images and a text excerpt when a link to your site is shared.', 'wordpress-seo' );
|
admin/views/tool-bulk-editor.php
CHANGED
@@ -18,16 +18,16 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
|
|
18 |
* @return array The sanitized fields.
|
19 |
*/
|
20 |
function yoast_free_bulk_sanitize_input_fields() {
|
21 |
-
$possible_params =
|
22 |
'type',
|
23 |
'paged',
|
24 |
'post_type_filter',
|
25 |
'post_status',
|
26 |
'order',
|
27 |
'orderby',
|
28 |
-
|
29 |
|
30 |
-
$input_get =
|
31 |
foreach ( $possible_params as $param_name ) {
|
32 |
if ( isset( $_GET[ $param_name ] ) ) {
|
33 |
$input_get[ $param_name ] = sanitize_text_field( wp_unslash( $_GET[ $param_name ] ) );
|
@@ -49,19 +49,19 @@ if ( ! isset( $yoast_free_input_fields['type'] ) ) {
|
|
49 |
$yoast_free_input_fields['type'] = 'title';
|
50 |
}
|
51 |
|
52 |
-
$yoast_bulk_editor_arguments =
|
53 |
'input_fields' => $yoast_free_input_fields,
|
54 |
'nonce' => wp_create_nonce( 'bulk-editor-table' ),
|
55 |
-
|
56 |
|
57 |
$wpseo_bulk_titles_table = new WPSEO_Bulk_Title_Editor_List_Table( $yoast_bulk_editor_arguments );
|
58 |
$wpseo_bulk_description_table = new WPSEO_Bulk_Description_List_Table( $yoast_bulk_editor_arguments );
|
59 |
|
60 |
-
$yoast_free_screen_reader_content =
|
61 |
'heading_views' => __( 'Filter posts list', 'wordpress-seo' ),
|
62 |
'heading_pagination' => __( 'Posts list navigation', 'wordpress-seo' ),
|
63 |
'heading_list' => __( 'Posts list', 'wordpress-seo' ),
|
64 |
-
|
65 |
get_current_screen()->set_screen_reader_content( $yoast_free_screen_reader_content );
|
66 |
|
67 |
if ( ! empty( $_REQUEST['_wp_http_referer'] ) && isset( $_SERVER['REQUEST_URI'] ) ) {
|
@@ -69,7 +69,7 @@ if ( ! empty( $_REQUEST['_wp_http_referer'] ) && isset( $_SERVER['REQUEST_URI']
|
|
69 |
|
70 |
wp_redirect(
|
71 |
remove_query_arg(
|
72 |
-
|
73 |
$request_uri
|
74 |
)
|
75 |
);
|
18 |
* @return array The sanitized fields.
|
19 |
*/
|
20 |
function yoast_free_bulk_sanitize_input_fields() {
|
21 |
+
$possible_params = [
|
22 |
'type',
|
23 |
'paged',
|
24 |
'post_type_filter',
|
25 |
'post_status',
|
26 |
'order',
|
27 |
'orderby',
|
28 |
+
];
|
29 |
|
30 |
+
$input_get = [];
|
31 |
foreach ( $possible_params as $param_name ) {
|
32 |
if ( isset( $_GET[ $param_name ] ) ) {
|
33 |
$input_get[ $param_name ] = sanitize_text_field( wp_unslash( $_GET[ $param_name ] ) );
|
49 |
$yoast_free_input_fields['type'] = 'title';
|
50 |
}
|
51 |
|
52 |
+
$yoast_bulk_editor_arguments = [
|
53 |
'input_fields' => $yoast_free_input_fields,
|
54 |
'nonce' => wp_create_nonce( 'bulk-editor-table' ),
|
55 |
+
];
|
56 |
|
57 |
$wpseo_bulk_titles_table = new WPSEO_Bulk_Title_Editor_List_Table( $yoast_bulk_editor_arguments );
|
58 |
$wpseo_bulk_description_table = new WPSEO_Bulk_Description_List_Table( $yoast_bulk_editor_arguments );
|
59 |
|
60 |
+
$yoast_free_screen_reader_content = [
|
61 |
'heading_views' => __( 'Filter posts list', 'wordpress-seo' ),
|
62 |
'heading_pagination' => __( 'Posts list navigation', 'wordpress-seo' ),
|
63 |
'heading_list' => __( 'Posts list', 'wordpress-seo' ),
|
64 |
+
];
|
65 |
get_current_screen()->set_screen_reader_content( $yoast_free_screen_reader_content );
|
66 |
|
67 |
if ( ! empty( $_REQUEST['_wp_http_referer'] ) && isset( $_SERVER['REQUEST_URI'] ) ) {
|
69 |
|
70 |
wp_redirect(
|
71 |
remove_query_arg(
|
72 |
+
[ '_wp_http_referer', '_wpnonce' ],
|
73 |
$request_uri
|
74 |
)
|
75 |
);
|
admin/views/tool-import-export.php
CHANGED
@@ -80,17 +80,17 @@ if ( $import ) {
|
|
80 |
}
|
81 |
}
|
82 |
|
83 |
-
$tabs =
|
84 |
-
'wpseo-import' =>
|
85 |
'label' => __( 'Import settings', 'wordpress-seo' ),
|
86 |
-
|
87 |
-
'wpseo-export' =>
|
88 |
'label' => __( 'Export settings', 'wordpress-seo' ),
|
89 |
-
|
90 |
-
'import-seo' =>
|
91 |
'label' => __( 'Import from other SEO plugins', 'wordpress-seo' ),
|
92 |
-
|
93 |
-
|
94 |
|
95 |
?>
|
96 |
<br/><br/>
|
80 |
}
|
81 |
}
|
82 |
|
83 |
+
$tabs = [
|
84 |
+
'wpseo-import' => [
|
85 |
'label' => __( 'Import settings', 'wordpress-seo' ),
|
86 |
+
],
|
87 |
+
'wpseo-export' => [
|
88 |
'label' => __( 'Export settings', 'wordpress-seo' ),
|
89 |
+
],
|
90 |
+
'import-seo' => [
|
91 |
'label' => __( 'Import from other SEO plugins', 'wordpress-seo' ),
|
92 |
+
],
|
93 |
+
];
|
94 |
|
95 |
?>
|
96 |
<br/><br/>
|
admin/watchers/class-slug-change-watcher.php
CHANGED
@@ -21,16 +21,16 @@ class WPSEO_Slug_Change_Watcher implements WPSEO_WordPress_Integration {
|
|
21 |
return;
|
22 |
}
|
23 |
|
24 |
-
add_action( 'admin_enqueue_scripts',
|
25 |
|
26 |
// Detect a post trash.
|
27 |
-
add_action( 'wp_trash_post',
|
28 |
|
29 |
// Detect a post delete.
|
30 |
-
add_action( 'before_delete_post',
|
31 |
|
32 |
// Detects deletion of a term.
|
33 |
-
add_action( 'delete_term_taxonomy',
|
34 |
}
|
35 |
|
36 |
/**
|
@@ -41,7 +41,7 @@ class WPSEO_Slug_Change_Watcher implements WPSEO_WordPress_Integration {
|
|
41 |
public function enqueue_assets() {
|
42 |
global $pagenow;
|
43 |
|
44 |
-
if ( ! in_array( $pagenow,
|
45 |
return;
|
46 |
}
|
47 |
|
@@ -193,11 +193,11 @@ class WPSEO_Slug_Change_Watcher implements WPSEO_WordPress_Integration {
|
|
193 |
* @return bool Whether or not the post is visible.
|
194 |
*/
|
195 |
protected function check_visible_post_status( $post_status ) {
|
196 |
-
$visible_post_statuses =
|
197 |
'publish',
|
198 |
'static',
|
199 |
'private',
|
200 |
-
|
201 |
|
202 |
return in_array( $post_status, $visible_post_statuses, true );
|
203 |
}
|
@@ -236,10 +236,10 @@ class WPSEO_Slug_Change_Watcher implements WPSEO_WordPress_Integration {
|
|
236 |
protected function add_notification( $message ) {
|
237 |
$notification = new Yoast_Notification(
|
238 |
$message,
|
239 |
-
|
240 |
'type' => 'notice-warning is-dismissible',
|
241 |
'yoast_branding' => true,
|
242 |
-
|
243 |
);
|
244 |
|
245 |
$notification_center = Yoast_Notification_Center::get();
|
21 |
return;
|
22 |
}
|
23 |
|
24 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
25 |
|
26 |
// Detect a post trash.
|
27 |
+
add_action( 'wp_trash_post', [ $this, 'detect_post_trash' ] );
|
28 |
|
29 |
// Detect a post delete.
|
30 |
+
add_action( 'before_delete_post', [ $this, 'detect_post_delete' ] );
|
31 |
|
32 |
// Detects deletion of a term.
|
33 |
+
add_action( 'delete_term_taxonomy', [ $this, 'detect_term_delete' ] );
|
34 |
}
|
35 |
|
36 |
/**
|
41 |
public function enqueue_assets() {
|
42 |
global $pagenow;
|
43 |
|
44 |
+
if ( ! in_array( $pagenow, [ 'edit.php', 'edit-tags.php' ], true ) ) {
|
45 |
return;
|
46 |
}
|
47 |
|
193 |
* @return bool Whether or not the post is visible.
|
194 |
*/
|
195 |
protected function check_visible_post_status( $post_status ) {
|
196 |
+
$visible_post_statuses = [
|
197 |
'publish',
|
198 |
'static',
|
199 |
'private',
|
200 |
+
];
|
201 |
|
202 |
return in_array( $post_status, $visible_post_statuses, true );
|
203 |
}
|
236 |
protected function add_notification( $message ) {
|
237 |
$notification = new Yoast_Notification(
|
238 |
$message,
|
239 |
+
[
|
240 |
'type' => 'notice-warning is-dismissible',
|
241 |
'yoast_branding' => true,
|
242 |
+
]
|
243 |
);
|
244 |
|
245 |
$notification_center = Yoast_Notification_Center::get();
|
css/dist/{admin-global-1262-rtl.min.css → admin-global-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{admin-global-1262.min.css → admin-global-1270.min.css}
RENAMED
File without changes
|
css/dist/{adminbar-1262-rtl.min.css → adminbar-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{adminbar-1262.min.css → adminbar-1270.min.css}
RENAMED
File without changes
|
css/dist/alerts-1262-rtl.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;border:0;padding:0;overflow:hidden;word-wrap:normal!important}.yoast-alert{padding:0 12px;border-right:4px solid #fff;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2)}.yoast-container{position:relative;max-width:1280px;margin:20px 0 1px;padding:20px 20px 0;border:1px solid #e5e5e5;background-color:#fdfdfd;box-shadow:0 1px 1px rgba(0,0,0,.04)}.yoast-alerts>h2:first-child{margin:0;padding:9px 0 4px;font-size:23px;font-weight:400;line-height:29px}.yoast-alerts .yoast-container h3{margin:-20px -20px 0;padding:1em;border-bottom:1px solid #ccc;background-color:#fdfdfd;font-size:1.4em}.yoast-container .container{max-width:980px}.yoast-container .yoast-alert-holder{display:-ms-flexbox;display:flex;position:relative}.dismiss .dashicons,.restore .dashicons{font-size:20px;width:20px;height:20px}.yoast-bottom-spacing{margin-bottom:20px}.yoast-alerts .button.dismiss,.yoast-alerts .button.restore{position:absolute;left:0;width:52px;height:100%;line-height:inherit;padding:0;outline:none;cursor:pointer;background:transparent;border:none;box-shadow:none;border-radius:0}.yoast-alerts .button.dismiss:focus,.yoast-alerts .button.dismiss:hover,.yoast-alerts .button.restore:focus,.yoast-alerts .button.restore:hover{background:transparent}.yoast-container .separator{margin-top:1em;margin-bottom:1em;border-top:1px solid #ddd}.yoast-container .dashicons-yes{color:#77b227}.yoast-container-disabled{display:table-cell;position:absolute;top:0;left:0;bottom:0;right:0;border-radius:4px;background-color:hsla(0,0%,91%,.7)}.yoast-no-issues{padding:1em 16px 1em 1em;color:#666}.yoast-muted-title{overflow:hidden;font-weight:600;font-style:italic}.yoast-muted-title:after{content:"";display:inline-block;height:.5em;vertical-align:bottom;width:100%;margin-left:-100%;margin-right:10px;border-top:1px solid #ddd}.yoast-alerts-active .yoast-alert,.yoast-alerts-dismissed .yoast-alert{padding-left:52px;-ms-flex:1;flex:1}.yoast-alerts-active .yoast-alert-holder{margin-bottom:20px}.yoast-alerts-dismissed.paper.tab-block{margin:20px 0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container{padding:0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd){background-color:#f7f7f7}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd) .yoast-alert{background-color:transparent}.yoast-alerts-dismissed .yoast-svg-icon-eye{background:transparent url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%20role%3D%22img%22%20aria%2Dhidden%3D%22true%22%20focusable%3D%22false%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M1664%20960q%2D152%2D236%2D381%2D353%2061%20104%2061%20225%200%20185%2D131%2E5%20316%2E5t%2D316%2E5%20131%2E5%2D316%2E5%2D131%2E5%2D131%2E5%2D316%2E5q0%2D121%2061%2D225%2D229%20117%2D381%20353%20133%20205%20333%2E5%20326%2E5t434%2E5%20121%2E5%20434%2E5%2D121%2E5%20333%2E5%2D326%2E5zm%2D720%2D384q0%2D20%2D14%2D34t%2D34%2D14q%2D125%200%2D214%2E5%2089%2E5t%2D89%2E5%20214%2E5q0%2020%2014%2034t34%2014%2034%2D14%2014%2D34q0%2D86%2061%2D147t147%2D61q20%200%2034%2D14t14%2D34zm848%20384q0%2034%2D20%2069%2D140%20230%2D376%2E5%20368%2E5t%2D499%2E5%20138%2E5%2D499%2E5%2D139%2D376%2E5%2D368q%2D20%2D35%2D20%2D69t20%2D69q140%2D229%20376%2E5%2D368t499%2E5%2D139%20499%2E5%20139%20376%2E5%20368q20%2035%2020%2069z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat 100% 0;background-size:20px}#yoast-errors-header .dashicons{color:#dc3232}#yoast-errors-active .yoast-alert{border-right-color:#dc3232}#yoast-errors-dismissed .yoast-alert{border-right-color:#d93f69}#yoast-warnings-header .dashicons{color:#5d237a}#yoast-warnings-active .yoast-alert{border-right-color:#5d237a}#yoast-warnings-dismissed .yoast-alert{border-right-color:#0075b3}.yoast-alerts .yoast-container__configuration-wizard{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;box-shadow:0 1px 2px rgba(0,0,0,.2);background-color:#fff;min-height:0;padding-bottom:20px;margin-bottom:15px}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard img{display:none}}.yoast-alerts .yoast-container__configuration-wizard--content{-ms-flex:1 1 auto;flex:1 1 auto;margin:12px;padding:0}.yoast-alerts .yoast-container__configuration-wizard--content h3{border-bottom:0;font-size:1.4em;line-height:1;margin:0 0 4px;padding:0;background:transparent}.yoast-alerts .yoast-container__configuration-wizard--content p{margin:1em 0 0}.yoast-alerts .yoast-container__configuration-wizard--content p:last-child{margin:0}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--content{display:block;position:relative;padding:16px}}.yoast-alerts .yoast-container__configuration-wizard--dismiss{text-align:center}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--dismiss{width:40px;position:absolute;top:5px;left:5px;margin:0}}.yoast-alerts .yoast-container__configuration-wizard--dismiss .dashicons{text-decoration:none;margin-top:11px}
|
|
css/dist/alerts-1262.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;border:0;padding:0;overflow:hidden;word-wrap:normal!important}.yoast-alert{padding:0 12px;border-left:4px solid #fff;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2)}.yoast-container{position:relative;max-width:1280px;margin:20px 0 1px;padding:20px 20px 0;border:1px solid #e5e5e5;background-color:#fdfdfd;box-shadow:0 1px 1px rgba(0,0,0,.04)}.yoast-alerts>h2:first-child{margin:0;padding:9px 0 4px;font-size:23px;font-weight:400;line-height:29px}.yoast-alerts .yoast-container h3{margin:-20px -20px 0;padding:1em;border-bottom:1px solid #ccc;background-color:#fdfdfd;font-size:1.4em}.yoast-container .container{max-width:980px}.yoast-container .yoast-alert-holder{display:-ms-flexbox;display:flex;position:relative}.dismiss .dashicons,.restore .dashicons{font-size:20px;width:20px;height:20px}.yoast-bottom-spacing{margin-bottom:20px}.yoast-alerts .button.dismiss,.yoast-alerts .button.restore{position:absolute;right:0;width:52px;height:100%;line-height:inherit;padding:0;outline:none;cursor:pointer;background:transparent;border:none;box-shadow:none;border-radius:0}.yoast-alerts .button.dismiss:focus,.yoast-alerts .button.dismiss:hover,.yoast-alerts .button.restore:focus,.yoast-alerts .button.restore:hover{background:transparent}.yoast-container .separator{margin-top:1em;margin-bottom:1em;border-top:1px solid #ddd}.yoast-container .dashicons-yes{color:#77b227}.yoast-container-disabled{display:table-cell;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:4px;background-color:hsla(0,0%,91%,.7)}.yoast-no-issues{padding:1em 1em 1em 16px;color:#666}.yoast-muted-title{overflow:hidden;font-weight:600;font-style:italic}.yoast-muted-title:after{content:"";display:inline-block;height:.5em;vertical-align:bottom;width:100%;margin-right:-100%;margin-left:10px;border-top:1px solid #ddd}.yoast-alerts-active .yoast-alert,.yoast-alerts-dismissed .yoast-alert{padding-right:52px;-ms-flex:1;flex:1}.yoast-alerts-active .yoast-alert-holder{margin-bottom:20px}.yoast-alerts-dismissed.paper.tab-block{margin:20px 0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container{padding:0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd){background-color:#f7f7f7}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd) .yoast-alert{background-color:transparent}.yoast-alerts-dismissed .yoast-svg-icon-eye{background:transparent url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%20role%3D%22img%22%20aria%2Dhidden%3D%22true%22%20focusable%3D%22false%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M1664%20960q%2D152%2D236%2D381%2D353%2061%20104%2061%20225%200%20185%2D131%2E5%20316%2E5t%2D316%2E5%20131%2E5%2D316%2E5%2D131%2E5%2D131%2E5%2D316%2E5q0%2D121%2061%2D225%2D229%20117%2D381%20353%20133%20205%20333%2E5%20326%2E5t434%2E5%20121%2E5%20434%2E5%2D121%2E5%20333%2E5%2D326%2E5zm%2D720%2D384q0%2D20%2D14%2D34t%2D34%2D14q%2D125%200%2D214%2E5%2089%2E5t%2D89%2E5%20214%2E5q0%2020%2014%2034t34%2014%2034%2D14%2014%2D34q0%2D86%2061%2D147t147%2D61q20%200%2034%2D14t14%2D34zm848%20384q0%2034%2D20%2069%2D140%20230%2D376%2E5%20368%2E5t%2D499%2E5%20138%2E5%2D499%2E5%2D139%2D376%2E5%2D368q%2D20%2D35%2D20%2D69t20%2D69q140%2D229%20376%2E5%2D368t499%2E5%2D139%20499%2E5%20139%20376%2E5%20368q20%2035%2020%2069z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat 0 0;background-size:20px}#yoast-errors-header .dashicons{color:#dc3232}#yoast-errors-active .yoast-alert{border-left-color:#dc3232}#yoast-errors-dismissed .yoast-alert{border-left-color:#d93f69}#yoast-warnings-header .dashicons{color:#5d237a}#yoast-warnings-active .yoast-alert{border-left-color:#5d237a}#yoast-warnings-dismissed .yoast-alert{border-left-color:#0075b3}.yoast-alerts .yoast-container__configuration-wizard{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;box-shadow:0 1px 2px rgba(0,0,0,.2);background-color:#fff;min-height:0;padding-bottom:20px;margin-bottom:15px}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard img{display:none}}.yoast-alerts .yoast-container__configuration-wizard--content{-ms-flex:1 1 auto;flex:1 1 auto;margin:12px;padding:0}.yoast-alerts .yoast-container__configuration-wizard--content h3{border-bottom:0;font-size:1.4em;line-height:1;margin:0 0 4px;padding:0;background:transparent}.yoast-alerts .yoast-container__configuration-wizard--content p{margin:1em 0 0}.yoast-alerts .yoast-container__configuration-wizard--content p:last-child{margin:0}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--content{display:block;position:relative;padding:16px}}.yoast-alerts .yoast-container__configuration-wizard--dismiss{text-align:center}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--dismiss{width:40px;position:absolute;top:5px;right:5px;margin:0}}.yoast-alerts .yoast-container__configuration-wizard--dismiss .dashicons{text-decoration:none;margin-top:11px}
|
|
css/dist/alerts-1270-rtl.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;border:0;padding:0;overflow:hidden;word-wrap:normal!important}.yoast-alert{padding:0 12px;border-right:4px solid #fff;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2)}.yoast-container{position:relative;max-width:1280px;margin:20px 0 1px;padding:20px 20px 0;border:1px solid #e5e5e5;background-color:#fdfdfd;box-shadow:0 1px 1px rgba(0,0,0,.04)}.yoast-alerts>h2:first-child{margin:0;padding:9px 0 4px;font-size:23px;font-weight:400;line-height:29px}.yoast-alerts .yoast-container h3{margin:-20px -20px 0;padding:1em;border-bottom:1px solid #ccc;background-color:#fdfdfd;font-size:1.4em}.yoast-container .container{max-width:980px}.yoast-container .yoast-alert-holder{display:-ms-flexbox;display:flex;position:relative}.dismiss .dashicons,.restore .dashicons{font-size:20px;width:20px;height:20px}.yoast-bottom-spacing{margin-bottom:20px}.yoast-alerts .button.dismiss,.yoast-alerts .button.restore{position:absolute;left:0;width:52px;height:100%;line-height:inherit;padding:0;outline:none;cursor:pointer;background:transparent;border:none;box-shadow:none;border-radius:0}.yoast-alerts .button.dismiss:focus,.yoast-alerts .button.dismiss:hover,.yoast-alerts .button.restore:focus,.yoast-alerts .button.restore:hover{background:transparent}.yoast-alerts .button.dismiss:focus:before,.yoast-alerts .button.restore:focus:before{content:"";display:block;width:32px;height:32px;border-radius:50%;position:absolute;top:50%;right:50%;-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);box-shadow:0 0 0 1px #007cba;outline:2px solid transparent}.yoast-container .separator{margin-top:1em;margin-bottom:1em;border-top:1px solid #ddd}.yoast-container .dashicons-yes{color:#77b227}.yoast-container-disabled{display:table-cell;position:absolute;top:0;left:0;bottom:0;right:0;border-radius:4px;background-color:hsla(0,0%,91%,.7)}.yoast-no-issues{padding:1em 16px 1em 1em;color:#666}.yoast-muted-title{overflow:hidden;font-weight:600;font-style:italic}.yoast-muted-title:after{content:"";display:inline-block;height:.5em;vertical-align:bottom;width:100%;margin-left:-100%;margin-right:10px;border-top:1px solid #ddd}.yoast-alerts-active .yoast-alert,.yoast-alerts-dismissed .yoast-alert{padding-left:52px;-ms-flex:1;flex:1}.yoast-alerts-active .yoast-alert-holder{margin-bottom:20px}.yoast-alerts-dismissed.paper.tab-block{margin:20px 0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container{padding:0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd){background-color:#f7f7f7}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd) .yoast-alert{background-color:transparent}.yoast-alerts-dismissed .yoast-svg-icon-eye{background:transparent url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%20role%3D%22img%22%20aria%2Dhidden%3D%22true%22%20focusable%3D%22false%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M1664%20960q%2D152%2D236%2D381%2D353%2061%20104%2061%20225%200%20185%2D131%2E5%20316%2E5t%2D316%2E5%20131%2E5%2D316%2E5%2D131%2E5%2D131%2E5%2D316%2E5q0%2D121%2061%2D225%2D229%20117%2D381%20353%20133%20205%20333%2E5%20326%2E5t434%2E5%20121%2E5%20434%2E5%2D121%2E5%20333%2E5%2D326%2E5zm%2D720%2D384q0%2D20%2D14%2D34t%2D34%2D14q%2D125%200%2D214%2E5%2089%2E5t%2D89%2E5%20214%2E5q0%2020%2014%2034t34%2014%2034%2D14%2014%2D34q0%2D86%2061%2D147t147%2D61q20%200%2034%2D14t14%2D34zm848%20384q0%2034%2D20%2069%2D140%20230%2D376%2E5%20368%2E5t%2D499%2E5%20138%2E5%2D499%2E5%2D139%2D376%2E5%2D368q%2D20%2D35%2D20%2D69t20%2D69q140%2D229%20376%2E5%2D368t499%2E5%2D139%20499%2E5%20139%20376%2E5%20368q20%2035%2020%2069z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat 100% 0;background-size:20px}#yoast-errors-header .dashicons{color:#dc3232}#yoast-errors-active .yoast-alert{border-right-color:#dc3232}#yoast-errors-dismissed .yoast-alert{border-right-color:#d93f69}#yoast-warnings-header .dashicons{color:#5d237a}#yoast-warnings-active .yoast-alert{border-right-color:#5d237a}#yoast-warnings-dismissed .yoast-alert{border-right-color:#0075b3}.yoast-alerts .yoast-container__configuration-wizard{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;box-shadow:0 1px 2px rgba(0,0,0,.2);background-color:#fff;min-height:0;padding-bottom:20px;margin-bottom:15px}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard img{display:none}}.yoast-alerts .yoast-container__configuration-wizard--content{-ms-flex:1 1 auto;flex:1 1 auto;margin:12px;padding:0}.yoast-alerts .yoast-container__configuration-wizard--content h3{border-bottom:0;font-size:1.4em;line-height:1;margin:0 0 4px;padding:0;background:transparent}.yoast-alerts .yoast-container__configuration-wizard--content p{margin:1em 0 0}.yoast-alerts .yoast-container__configuration-wizard--content p:last-child{margin:0}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--content{display:block;position:relative;padding:16px}}.yoast-alerts .yoast-container__configuration-wizard--dismiss{text-align:center}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--dismiss{width:40px;position:absolute;top:5px;left:5px;margin:0}}.yoast-alerts .yoast-container__configuration-wizard--dismiss .dashicons{text-decoration:none;margin-top:11px}
|
css/dist/alerts-1270.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;border:0;padding:0;overflow:hidden;word-wrap:normal!important}.yoast-alert{padding:0 12px;border-left:4px solid #fff;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2)}.yoast-container{position:relative;max-width:1280px;margin:20px 0 1px;padding:20px 20px 0;border:1px solid #e5e5e5;background-color:#fdfdfd;box-shadow:0 1px 1px rgba(0,0,0,.04)}.yoast-alerts>h2:first-child{margin:0;padding:9px 0 4px;font-size:23px;font-weight:400;line-height:29px}.yoast-alerts .yoast-container h3{margin:-20px -20px 0;padding:1em;border-bottom:1px solid #ccc;background-color:#fdfdfd;font-size:1.4em}.yoast-container .container{max-width:980px}.yoast-container .yoast-alert-holder{display:-ms-flexbox;display:flex;position:relative}.dismiss .dashicons,.restore .dashicons{font-size:20px;width:20px;height:20px}.yoast-bottom-spacing{margin-bottom:20px}.yoast-alerts .button.dismiss,.yoast-alerts .button.restore{position:absolute;right:0;width:52px;height:100%;line-height:inherit;padding:0;outline:none;cursor:pointer;background:transparent;border:none;box-shadow:none;border-radius:0}.yoast-alerts .button.dismiss:focus,.yoast-alerts .button.dismiss:hover,.yoast-alerts .button.restore:focus,.yoast-alerts .button.restore:hover{background:transparent}.yoast-alerts .button.dismiss:focus:before,.yoast-alerts .button.restore:focus:before{content:"";display:block;width:32px;height:32px;border-radius:50%;position:absolute;top:50%;left:50%;-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);box-shadow:0 0 0 1px #007cba;outline:2px solid transparent}.yoast-container .separator{margin-top:1em;margin-bottom:1em;border-top:1px solid #ddd}.yoast-container .dashicons-yes{color:#77b227}.yoast-container-disabled{display:table-cell;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:4px;background-color:hsla(0,0%,91%,.7)}.yoast-no-issues{padding:1em 1em 1em 16px;color:#666}.yoast-muted-title{overflow:hidden;font-weight:600;font-style:italic}.yoast-muted-title:after{content:"";display:inline-block;height:.5em;vertical-align:bottom;width:100%;margin-right:-100%;margin-left:10px;border-top:1px solid #ddd}.yoast-alerts-active .yoast-alert,.yoast-alerts-dismissed .yoast-alert{padding-right:52px;-ms-flex:1;flex:1}.yoast-alerts-active .yoast-alert-holder{margin-bottom:20px}.yoast-alerts-dismissed.paper.tab-block{margin:20px 0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container{padding:0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd){background-color:#f7f7f7}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd) .yoast-alert{background-color:transparent}.yoast-alerts-dismissed .yoast-svg-icon-eye{background:transparent url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%20role%3D%22img%22%20aria%2Dhidden%3D%22true%22%20focusable%3D%22false%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M1664%20960q%2D152%2D236%2D381%2D353%2061%20104%2061%20225%200%20185%2D131%2E5%20316%2E5t%2D316%2E5%20131%2E5%2D316%2E5%2D131%2E5%2D131%2E5%2D316%2E5q0%2D121%2061%2D225%2D229%20117%2D381%20353%20133%20205%20333%2E5%20326%2E5t434%2E5%20121%2E5%20434%2E5%2D121%2E5%20333%2E5%2D326%2E5zm%2D720%2D384q0%2D20%2D14%2D34t%2D34%2D14q%2D125%200%2D214%2E5%2089%2E5t%2D89%2E5%20214%2E5q0%2020%2014%2034t34%2014%2034%2D14%2014%2D34q0%2D86%2061%2D147t147%2D61q20%200%2034%2D14t14%2D34zm848%20384q0%2034%2D20%2069%2D140%20230%2D376%2E5%20368%2E5t%2D499%2E5%20138%2E5%2D499%2E5%2D139%2D376%2E5%2D368q%2D20%2D35%2D20%2D69t20%2D69q140%2D229%20376%2E5%2D368t499%2E5%2D139%20499%2E5%20139%20376%2E5%20368q20%2035%2020%2069z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat 0 0;background-size:20px}#yoast-errors-header .dashicons{color:#dc3232}#yoast-errors-active .yoast-alert{border-left-color:#dc3232}#yoast-errors-dismissed .yoast-alert{border-left-color:#d93f69}#yoast-warnings-header .dashicons{color:#5d237a}#yoast-warnings-active .yoast-alert{border-left-color:#5d237a}#yoast-warnings-dismissed .yoast-alert{border-left-color:#0075b3}.yoast-alerts .yoast-container__configuration-wizard{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;box-shadow:0 1px 2px rgba(0,0,0,.2);background-color:#fff;min-height:0;padding-bottom:20px;margin-bottom:15px}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard img{display:none}}.yoast-alerts .yoast-container__configuration-wizard--content{-ms-flex:1 1 auto;flex:1 1 auto;margin:12px;padding:0}.yoast-alerts .yoast-container__configuration-wizard--content h3{border-bottom:0;font-size:1.4em;line-height:1;margin:0 0 4px;padding:0;background:transparent}.yoast-alerts .yoast-container__configuration-wizard--content p{margin:1em 0 0}.yoast-alerts .yoast-container__configuration-wizard--content p:last-child{margin:0}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--content{display:block;position:relative;padding:16px}}.yoast-alerts .yoast-container__configuration-wizard--dismiss{text-align:center}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--dismiss{width:40px;position:absolute;top:5px;right:5px;margin:0}}.yoast-alerts .yoast-container__configuration-wizard--dismiss .dashicons{text-decoration:none;margin-top:11px}
|
css/dist/{dashboard-1262-rtl.min.css → dashboard-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{dashboard-1262.min.css → dashboard-1270.min.css}
RENAMED
File without changes
|
css/dist/{edit-page-1262-rtl.min.css → edit-page-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{edit-page-1262.min.css → edit-page-1270.min.css}
RENAMED
File without changes
|
css/dist/{featured-image-1262-rtl.min.css → featured-image-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{featured-image-1262.min.css → featured-image-1270.min.css}
RENAMED
File without changes
|
css/dist/{filter-explanation-1262-rtl.min.css → filter-explanation-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{filter-explanation-1262.min.css → filter-explanation-1270.min.css}
RENAMED
File without changes
|
css/dist/{inside-editor-1262-rtl.min.css → inside-editor-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{inside-editor-1262.min.css → inside-editor-1270.min.css}
RENAMED
File without changes
|
css/dist/{metabox-1262-rtl.min.css → metabox-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{metabox-1262.min.css → metabox-1270.min.css}
RENAMED
File without changes
|
css/dist/{metabox-primary-category-1262-rtl.min.css → metabox-primary-category-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{metabox-primary-category-1262.min.css → metabox-primary-category-1270.min.css}
RENAMED
File without changes
|
css/dist/{search-appearance-1262-rtl.min.css → search-appearance-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{search-appearance-1262.min.css → search-appearance-1270.min.css}
RENAMED
File without changes
|
css/dist/{structured-data-blocks-1262-rtl.min.css → structured-data-blocks-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{structured-data-blocks-1262.min.css → structured-data-blocks-1270.min.css}
RENAMED
File without changes
|
css/dist/{toggle-switch-1262-rtl.min.css → toggle-switch-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{toggle-switch-1262.min.css → toggle-switch-1270.min.css}
RENAMED
File without changes
|
css/dist/{wpseo-dismissible-1262-rtl.min.css → wpseo-dismissible-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{wpseo-dismissible-1262.min.css → wpseo-dismissible-1270.min.css}
RENAMED
File without changes
|
css/dist/{yoast-components-1262-rtl.min.css → yoast-components-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{yoast-components-1262.min.css → yoast-components-1270.min.css}
RENAMED
File without changes
|
css/dist/{yoast-extensions-1262-rtl.min.css → yoast-extensions-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{yoast-extensions-1262.min.css → yoast-extensions-1270.min.css}
RENAMED
File without changes
|
css/dist/{yst_plugin_tools-1262-rtl.min.css → yst_plugin_tools-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{yst_plugin_tools-1262.min.css → yst_plugin_tools-1270.min.css}
RENAMED
File without changes
|
css/dist/{yst_seo_score-1262-rtl.min.css → yst_seo_score-1270-rtl.min.css}
RENAMED
File without changes
|
css/dist/{yst_seo_score-1262.min.css → yst_seo_score-1270.min.css}
RENAMED
File without changes
|
frontend/class-breadcrumbs.php
CHANGED
@@ -91,7 +91,7 @@ class WPSEO_Breadcrumbs {
|
|
91 |
*
|
92 |
* @var array
|
93 |
*/
|
94 |
-
private $crumbs =
|
95 |
|
96 |
/**
|
97 |
* Count of the elements in the $crumbs property.
|
@@ -105,7 +105,7 @@ class WPSEO_Breadcrumbs {
|
|
105 |
*
|
106 |
* @var array
|
107 |
*/
|
108 |
-
private $links =
|
109 |
|
110 |
/**
|
111 |
* Breadcrumb html string.
|
@@ -265,7 +265,7 @@ class WPSEO_Breadcrumbs {
|
|
265 |
*/
|
266 |
private function get_term_parents( $term ) {
|
267 |
$tax = $term->taxonomy;
|
268 |
-
$parents =
|
269 |
while ( $term->parent !== 0 ) {
|
270 |
$term = get_term( $term->parent, $tax );
|
271 |
$parents[] = $term;
|
@@ -286,7 +286,7 @@ class WPSEO_Breadcrumbs {
|
|
286 |
* Let's find the deepest term in this array, by looping through and then
|
287 |
* unsetting every term that is used as a parent by another one in the array.
|
288 |
*/
|
289 |
-
$terms_by_id =
|
290 |
foreach ( $terms as $term ) {
|
291 |
$terms_by_id[ $term->term_id ] = $term;
|
292 |
}
|
@@ -335,18 +335,18 @@ class WPSEO_Breadcrumbs {
|
|
335 |
* @return array
|
336 |
*/
|
337 |
private function get_post_ancestors() {
|
338 |
-
$ancestors =
|
339 |
|
340 |
if ( isset( $this->post->ancestors ) ) {
|
341 |
if ( is_array( $this->post->ancestors ) ) {
|
342 |
$ancestors = array_values( $this->post->ancestors );
|
343 |
}
|
344 |
else {
|
345 |
-
$ancestors =
|
346 |
}
|
347 |
}
|
348 |
elseif ( isset( $this->post->post_parent ) ) {
|
349 |
-
$ancestors =
|
350 |
}
|
351 |
|
352 |
/**
|
@@ -488,9 +488,9 @@ class WPSEO_Breadcrumbs {
|
|
488 |
* @param int $id Post ID.
|
489 |
*/
|
490 |
private function add_single_post_crumb( $id ) {
|
491 |
-
$this->crumbs[] =
|
492 |
'id' => $id,
|
493 |
-
|
494 |
}
|
495 |
|
496 |
/**
|
@@ -499,9 +499,9 @@ class WPSEO_Breadcrumbs {
|
|
499 |
* @param object $term Term data object.
|
500 |
*/
|
501 |
private function add_term_crumb( $term ) {
|
502 |
-
$this->crumbs[] =
|
503 |
'term' => $term,
|
504 |
-
|
505 |
}
|
506 |
|
507 |
/**
|
@@ -510,9 +510,9 @@ class WPSEO_Breadcrumbs {
|
|
510 |
* @param string $pt Post type.
|
511 |
*/
|
512 |
private function add_ptarchive_crumb( $pt ) {
|
513 |
-
$this->crumbs[] =
|
514 |
'ptarchive' => $pt,
|
515 |
-
|
516 |
}
|
517 |
|
518 |
/**
|
@@ -523,11 +523,11 @@ class WPSEO_Breadcrumbs {
|
|
523 |
* @param bool $allow_html Flag to allow HTML.
|
524 |
*/
|
525 |
private function add_predefined_crumb( $text, $url = '', $allow_html = false ) {
|
526 |
-
$this->crumbs[] =
|
527 |
'text' => $text,
|
528 |
'url' => $url,
|
529 |
'allow_html' => $allow_html,
|
530 |
-
|
531 |
}
|
532 |
|
533 |
/**
|
@@ -597,7 +597,7 @@ class WPSEO_Breadcrumbs {
|
|
597 |
if ( isset( $this->post->ID ) ) {
|
598 |
$terms = get_the_terms( $this->post, $main_tax );
|
599 |
|
600 |
-
if ( is_array( $terms ) && $terms !==
|
601 |
|
602 |
$primary_term = new WPSEO_Primary_Term( $main_tax, $this->post->ID );
|
603 |
if ( $primary_term->get_primary_term() ) {
|
@@ -625,7 +625,7 @@ class WPSEO_Breadcrumbs {
|
|
625 |
*/
|
626 |
private function add_post_ancestor_crumbs() {
|
627 |
$ancestors = $this->get_post_ancestors();
|
628 |
-
if ( is_array( $ancestors ) && $ancestors !==
|
629 |
foreach ( $ancestors as $ancestor ) {
|
630 |
$this->add_single_post_crumb( $ancestor );
|
631 |
}
|
@@ -661,7 +661,7 @@ class WPSEO_Breadcrumbs {
|
|
661 |
return;
|
662 |
}
|
663 |
|
664 |
-
$this->crumbs[] =
|
665 |
'text' => sprintf(
|
666 |
/* translators: %s expands to the current page number */
|
667 |
__( 'Page %s', 'wordpress-seo' ),
|
@@ -669,7 +669,7 @@ class WPSEO_Breadcrumbs {
|
|
669 |
),
|
670 |
'url' => '',
|
671 |
'hide_in_schema' => true,
|
672 |
-
|
673 |
}
|
674 |
|
675 |
/**
|
@@ -753,7 +753,7 @@ class WPSEO_Breadcrumbs {
|
|
753 |
* @link http://support.google.com/webmasters/bin/answer.py?hl=en&answer=185417 Google documentation on RDFA
|
754 |
*/
|
755 |
private function prepare_links() {
|
756 |
-
if ( ! is_array( $this->crumbs ) || $this->crumbs ===
|
757 |
return;
|
758 |
}
|
759 |
|
@@ -792,7 +792,7 @@ class WPSEO_Breadcrumbs {
|
|
792 |
* @return array Array of link text and url.
|
793 |
*/
|
794 |
private function get_link_info_for_id( $id ) {
|
795 |
-
$link =
|
796 |
$link['url'] = $this->get_link_url_for_id( $id );
|
797 |
$link['text'] = WPSEO_Meta::get_value( 'bctitle', $id );
|
798 |
|
@@ -811,7 +811,7 @@ class WPSEO_Breadcrumbs {
|
|
811 |
* @return array Array of link text and url.
|
812 |
*/
|
813 |
private function get_link_info_for_term( $term ) {
|
814 |
-
$link =
|
815 |
|
816 |
$bctitle = WPSEO_Taxonomy_Meta::get_term_meta( $term, $term->taxonomy, 'bctitle' );
|
817 |
if ( ! is_string( $bctitle ) || $bctitle === '' ) {
|
@@ -832,7 +832,7 @@ class WPSEO_Breadcrumbs {
|
|
832 |
* @return array Array of link text and url.
|
833 |
*/
|
834 |
private function get_link_info_for_ptarchive( $pt ) {
|
835 |
-
$link =
|
836 |
$archive_title = $this->get_archive_title( $pt );
|
837 |
|
838 |
$link['url'] = get_post_type_archive_link( $pt );
|
@@ -973,7 +973,7 @@ class WPSEO_Breadcrumbs {
|
|
973 |
* Create a complete breadcrumb string from an array of breadcrumb element strings.
|
974 |
*/
|
975 |
private function links_to_string() {
|
976 |
-
if ( is_array( $this->links ) && $this->links !==
|
977 |
// Converts info to an effective link.
|
978 |
$links = $this->links;
|
979 |
foreach ( $links as $key => $link ) {
|
91 |
*
|
92 |
* @var array
|
93 |
*/
|
94 |
+
private $crumbs = [];
|
95 |
|
96 |
/**
|
97 |
* Count of the elements in the $crumbs property.
|
105 |
*
|
106 |
* @var array
|
107 |
*/
|
108 |
+
private $links = [];
|
109 |
|
110 |
/**
|
111 |
* Breadcrumb html string.
|
265 |
*/
|
266 |
private function get_term_parents( $term ) {
|
267 |
$tax = $term->taxonomy;
|
268 |
+
$parents = [];
|
269 |
while ( $term->parent !== 0 ) {
|
270 |
$term = get_term( $term->parent, $tax );
|
271 |
$parents[] = $term;
|
286 |
* Let's find the deepest term in this array, by looping through and then
|
287 |
* unsetting every term that is used as a parent by another one in the array.
|
288 |
*/
|
289 |
+
$terms_by_id = [];
|
290 |
foreach ( $terms as $term ) {
|
291 |
$terms_by_id[ $term->term_id ] = $term;
|
292 |
}
|
335 |
* @return array
|
336 |
*/
|
337 |
private function get_post_ancestors() {
|
338 |
+
$ancestors = [];
|
339 |
|
340 |
if ( isset( $this->post->ancestors ) ) {
|
341 |
if ( is_array( $this->post->ancestors ) ) {
|
342 |
$ancestors = array_values( $this->post->ancestors );
|
343 |
}
|
344 |
else {
|
345 |
+
$ancestors = [ $this->post->ancestors ];
|
346 |
}
|
347 |
}
|
348 |
elseif ( isset( $this->post->post_parent ) ) {
|
349 |
+
$ancestors = [ $this->post->post_parent ];
|
350 |
}
|
351 |
|
352 |
/**
|
488 |
* @param int $id Post ID.
|
489 |
*/
|
490 |
private function add_single_post_crumb( $id ) {
|
491 |
+
$this->crumbs[] = [
|
492 |
'id' => $id,
|
493 |
+
];
|
494 |
}
|
495 |
|
496 |
/**
|
499 |
* @param object $term Term data object.
|
500 |
*/
|
501 |
private function add_term_crumb( $term ) {
|
502 |
+
$this->crumbs[] = [
|
503 |
'term' => $term,
|
504 |
+
];
|
505 |
}
|
506 |
|
507 |
/**
|
510 |
* @param string $pt Post type.
|
511 |
*/
|
512 |
private function add_ptarchive_crumb( $pt ) {
|
513 |
+
$this->crumbs[] = [
|
514 |
'ptarchive' => $pt,
|
515 |
+
];
|
516 |
}
|
517 |
|
518 |
/**
|
523 |
* @param bool $allow_html Flag to allow HTML.
|
524 |
*/
|
525 |
private function add_predefined_crumb( $text, $url = '', $allow_html = false ) {
|
526 |
+
$this->crumbs[] = [
|
527 |
'text' => $text,
|
528 |
'url' => $url,
|
529 |
'allow_html' => $allow_html,
|
530 |
+
];
|
531 |
}
|
532 |
|
533 |
/**
|
597 |
if ( isset( $this->post->ID ) ) {
|
598 |
$terms = get_the_terms( $this->post, $main_tax );
|
599 |
|
600 |
+
if ( is_array( $terms ) && $terms !== [] ) {
|
601 |
|
602 |
$primary_term = new WPSEO_Primary_Term( $main_tax, $this->post->ID );
|
603 |
if ( $primary_term->get_primary_term() ) {
|
625 |
*/
|
626 |
private function add_post_ancestor_crumbs() {
|
627 |
$ancestors = $this->get_post_ancestors();
|
628 |
+
if ( is_array( $ancestors ) && $ancestors !== [] ) {
|
629 |
foreach ( $ancestors as $ancestor ) {
|
630 |
$this->add_single_post_crumb( $ancestor );
|
631 |
}
|
661 |
return;
|
662 |
}
|
663 |
|
664 |
+
$this->crumbs[] = [
|
665 |
'text' => sprintf(
|
666 |
/* translators: %s expands to the current page number */
|
667 |
__( 'Page %s', 'wordpress-seo' ),
|
669 |
),
|
670 |
'url' => '',
|
671 |
'hide_in_schema' => true,
|
672 |
+
];
|
673 |
}
|
674 |
|
675 |
/**
|
753 |
* @link http://support.google.com/webmasters/bin/answer.py?hl=en&answer=185417 Google documentation on RDFA
|
754 |
*/
|
755 |
private function prepare_links() {
|
756 |
+
if ( ! is_array( $this->crumbs ) || $this->crumbs === [] ) {
|
757 |
return;
|
758 |
}
|
759 |
|
792 |
* @return array Array of link text and url.
|
793 |
*/
|
794 |
private function get_link_info_for_id( $id ) {
|
795 |
+
$link = [];
|
796 |
$link['url'] = $this->get_link_url_for_id( $id );
|
797 |
$link['text'] = WPSEO_Meta::get_value( 'bctitle', $id );
|
798 |
|
811 |
* @return array Array of link text and url.
|
812 |
*/
|
813 |
private function get_link_info_for_term( $term ) {
|
814 |
+
$link = [];
|
815 |
|
816 |
$bctitle = WPSEO_Taxonomy_Meta::get_term_meta( $term, $term->taxonomy, 'bctitle' );
|
817 |
if ( ! is_string( $bctitle ) || $bctitle === '' ) {
|
832 |
* @return array Array of link text and url.
|
833 |
*/
|
834 |
private function get_link_info_for_ptarchive( $pt ) {
|
835 |
+
$link = [];
|
836 |
$archive_title = $this->get_archive_title( $pt );
|
837 |
|
838 |
$link['url'] = get_post_type_archive_link( $pt );
|
973 |
* Create a complete breadcrumb string from an array of breadcrumb element strings.
|
974 |
*/
|
975 |
private function links_to_string() {
|
976 |
+
if ( is_array( $this->links ) && $this->links !== [] ) {
|
977 |
// Converts info to an effective link.
|
978 |
$links = $this->links;
|
979 |
foreach ( $links as $key => $link ) {
|
frontend/class-frontend.php
CHANGED
@@ -88,15 +88,15 @@ class WPSEO_Frontend {
|
|
88 |
*/
|
89 |
protected function __construct() {
|
90 |
|
91 |
-
add_action( 'wp_head',
|
92 |
-
add_action( 'wp_head',
|
93 |
|
94 |
// The head function here calls action wpseo_head, to which we hook all our functionality.
|
95 |
-
add_action( 'wpseo_head',
|
96 |
-
add_action( 'wpseo_head',
|
97 |
-
add_action( 'wpseo_head',
|
98 |
-
add_action( 'wpseo_head',
|
99 |
-
add_action( 'wpseo_head',
|
100 |
|
101 |
// Remove actions that we will handle through our wpseo_head call, and probably change the output of.
|
102 |
remove_action( 'wp_head', 'rel_canonical' );
|
@@ -106,55 +106,55 @@ class WPSEO_Frontend {
|
|
106 |
remove_action( 'wp_head', 'noindex', 1 );
|
107 |
|
108 |
// When using WP 4.4, just use the new hook.
|
109 |
-
add_filter( 'pre_get_document_title',
|
110 |
-
add_filter( 'wp_title',
|
111 |
|
112 |
-
add_filter( 'thematic_doctitle',
|
113 |
|
114 |
-
add_action( 'wp',
|
115 |
|
116 |
-
add_action( 'template_redirect',
|
117 |
|
118 |
-
add_filter( 'loginout',
|
119 |
-
add_filter( 'register',
|
120 |
|
121 |
// Add support for shortcodes to category descriptions.
|
122 |
-
add_filter( 'category_description',
|
123 |
|
124 |
// Fix the WooThemes woo_title() output.
|
125 |
-
add_filter( 'woo_title',
|
126 |
|
127 |
if ( WPSEO_Options::get( 'disable-date', false )
|
128 |
|| WPSEO_Options::get( 'disable-author', false )
|
129 |
|| WPSEO_Options::get( 'disable-post_format', false )
|
130 |
) {
|
131 |
-
add_action( 'wp',
|
132 |
}
|
133 |
-
add_action( 'template_redirect',
|
134 |
|
135 |
-
add_filter( 'the_content_feed',
|
136 |
-
add_filter( 'the_excerpt_rss',
|
137 |
|
138 |
// For WordPress functions below 4.4.
|
139 |
if ( WPSEO_Options::get( 'forcerewritetitle', false ) && ! current_theme_supports( 'title-tag' ) ) {
|
140 |
-
add_action( 'template_redirect',
|
141 |
-
add_action( 'wp_footer',
|
142 |
}
|
143 |
|
144 |
if ( WPSEO_Options::get( 'title_test', 0 ) > 0 ) {
|
145 |
-
add_filter( 'wpseo_title',
|
146 |
}
|
147 |
|
148 |
$this->woocommerce_shop_page = new WPSEO_WooCommerce_Shop_Page();
|
149 |
|
150 |
-
$integrations =
|
151 |
new WPSEO_Frontend_Primary_Category(),
|
152 |
new WPSEO_Schema(),
|
153 |
new WPSEO_Handle_404(),
|
154 |
new WPSEO_Remove_Reply_To_Com(),
|
155 |
new WPSEO_OpenGraph_OEmbed(),
|
156 |
$this->woocommerce_shop_page,
|
157 |
-
|
158 |
|
159 |
foreach ( $integrations as $integration ) {
|
160 |
$integration->register_hooks();
|
@@ -169,7 +169,7 @@ class WPSEO_Frontend {
|
|
169 |
return;
|
170 |
}
|
171 |
|
172 |
-
add_action( 'wpseo_head',
|
173 |
}
|
174 |
|
175 |
/**
|
@@ -296,7 +296,7 @@ class WPSEO_Frontend {
|
|
296 |
$title = trim( get_the_author_meta( 'wpseo_title', $author_id ) );
|
297 |
|
298 |
if ( $title !== '' ) {
|
299 |
-
return $this->replace_vars( $title,
|
300 |
}
|
301 |
|
302 |
return $this->get_title_from_options( 'title-author-wpseo' );
|
@@ -312,7 +312,7 @@ class WPSEO_Frontend {
|
|
312 |
*
|
313 |
* @return string
|
314 |
*/
|
315 |
-
public function get_title_from_options( $index, $var_source =
|
316 |
$template = WPSEO_Options::get( $index, '' );
|
317 |
if ( $template === '' ) {
|
318 |
if ( is_singular() ) {
|
@@ -430,7 +430,7 @@ class WPSEO_Frontend {
|
|
430 |
return $title;
|
431 |
}
|
432 |
|
433 |
-
$separator = $this->replace_vars( '%%sep%%',
|
434 |
$separator = ' ' . trim( $separator ) . ' ';
|
435 |
|
436 |
if ( '' === trim( $separator_location ) ) {
|
@@ -694,10 +694,10 @@ class WPSEO_Frontend {
|
|
694 |
public function get_robots() {
|
695 |
global $wp_query, $post;
|
696 |
|
697 |
-
$robots =
|
698 |
$robots['index'] = 'index';
|
699 |
$robots['follow'] = 'follow';
|
700 |
-
$robots['other'] =
|
701 |
|
702 |
if ( is_object( $post ) && WPSEO_Frontend_Page_Type::is_simple_page() ) {
|
703 |
$private = 'private' === $post->post_status;
|
@@ -769,13 +769,13 @@ class WPSEO_Frontend {
|
|
769 |
|
770 |
$robotsstr = $robots['index'] . ',' . $robots['follow'];
|
771 |
|
772 |
-
if ( $robots['other'] !==
|
773 |
$robots['other'] = array_unique( $robots['other'] ); // @todo Most likely no longer needed, needs testing.
|
774 |
$robotsstr .= ',' . implode( ',', $robots['other'] );
|
775 |
}
|
776 |
|
777 |
$robotsstr = preg_replace( '`^index,follow,?`', '', $robotsstr );
|
778 |
-
$robotsstr = str_replace(
|
779 |
|
780 |
if ( strpos( $robotsstr, 'noindex' ) === false && strpos( $robotsstr, 'nosnippet' ) === false ) {
|
781 |
if ( $robotsstr !== '' ) {
|
@@ -808,7 +808,7 @@ class WPSEO_Frontend {
|
|
808 |
|
809 |
// If a page has a noindex, it should _not_ have a canonical, as these are opposing indexing directives.
|
810 |
if ( strpos( $robotsstr, 'noindex' ) !== false ) {
|
811 |
-
remove_action( 'wpseo_head',
|
812 |
}
|
813 |
|
814 |
return $robotsstr;
|
@@ -1252,7 +1252,7 @@ class WPSEO_Frontend {
|
|
1252 |
}
|
1253 |
elseif ( WPSEO_Frontend_Page_Type::is_home_posts_page() ) {
|
1254 |
$template = WPSEO_Options::get( 'metadesc-home-wpseo' );
|
1255 |
-
$term =
|
1256 |
|
1257 |
if ( empty( $template ) ) {
|
1258 |
$template = get_bloginfo( 'description' );
|
@@ -1350,7 +1350,7 @@ class WPSEO_Frontend {
|
|
1350 |
* Outputs noindex values for the current page.
|
1351 |
*/
|
1352 |
public function noindex_page() {
|
1353 |
-
remove_action( 'wpseo_head',
|
1354 |
echo '<meta name="robots" content="noindex" />', "\n";
|
1355 |
}
|
1356 |
|
@@ -1667,7 +1667,7 @@ class WPSEO_Frontend {
|
|
1667 |
* @return bool True when the action exists.
|
1668 |
*/
|
1669 |
protected function show_debug_marker() {
|
1670 |
-
return has_action( 'wpseo_head',
|
1671 |
}
|
1672 |
|
1673 |
/**
|
@@ -1785,7 +1785,7 @@ class WPSEO_Frontend {
|
|
1785 |
*
|
1786 |
* @return string The replaced string.
|
1787 |
*/
|
1788 |
-
protected function replace_vars( $string, $args, $omit =
|
1789 |
$replacer = new WPSEO_Replace_Vars();
|
1790 |
|
1791 |
return $replacer->replace( $string, $args, $omit );
|
88 |
*/
|
89 |
protected function __construct() {
|
90 |
|
91 |
+
add_action( 'wp_head', [ $this, 'front_page_specific_init' ], 0 );
|
92 |
+
add_action( 'wp_head', [ $this, 'head' ], 1 );
|
93 |
|
94 |
// The head function here calls action wpseo_head, to which we hook all our functionality.
|
95 |
+
add_action( 'wpseo_head', [ $this, 'debug_mark' ], 2 );
|
96 |
+
add_action( 'wpseo_head', [ $this, 'metadesc' ], 6 );
|
97 |
+
add_action( 'wpseo_head', [ $this, 'robots' ], 10 );
|
98 |
+
add_action( 'wpseo_head', [ $this, 'canonical' ], 20 );
|
99 |
+
add_action( 'wpseo_head', [ $this, 'adjacent_rel_links' ], 21 );
|
100 |
|
101 |
// Remove actions that we will handle through our wpseo_head call, and probably change the output of.
|
102 |
remove_action( 'wp_head', 'rel_canonical' );
|
106 |
remove_action( 'wp_head', 'noindex', 1 );
|
107 |
|
108 |
// When using WP 4.4, just use the new hook.
|
109 |
+
add_filter( 'pre_get_document_title', [ $this, 'title' ], 15 );
|
110 |
+
add_filter( 'wp_title', [ $this, 'title' ], 15, 3 );
|
111 |
|
112 |
+
add_filter( 'thematic_doctitle', [ $this, 'title' ], 15 );
|
113 |
|
114 |
+
add_action( 'wp', [ $this, 'page_redirect' ], 99 );
|
115 |
|
116 |
+
add_action( 'template_redirect', [ $this, 'noindex_robots' ] );
|
117 |
|
118 |
+
add_filter( 'loginout', [ $this, 'nofollow_link' ] );
|
119 |
+
add_filter( 'register', [ $this, 'nofollow_link' ] );
|
120 |
|
121 |
// Add support for shortcodes to category descriptions.
|
122 |
+
add_filter( 'category_description', [ $this, 'custom_category_descriptions_add_shortcode_support' ] );
|
123 |
|
124 |
// Fix the WooThemes woo_title() output.
|
125 |
+
add_filter( 'woo_title', [ $this, 'fix_woo_title' ], 99 );
|
126 |
|
127 |
if ( WPSEO_Options::get( 'disable-date', false )
|
128 |
|| WPSEO_Options::get( 'disable-author', false )
|
129 |
|| WPSEO_Options::get( 'disable-post_format', false )
|
130 |
) {
|
131 |
+
add_action( 'wp', [ $this, 'archive_redirect' ] );
|
132 |
}
|
133 |
+
add_action( 'template_redirect', [ $this, 'attachment_redirect' ], 1 );
|
134 |
|
135 |
+
add_filter( 'the_content_feed', [ $this, 'embed_rssfooter' ] );
|
136 |
+
add_filter( 'the_excerpt_rss', [ $this, 'embed_rssfooter_excerpt' ] );
|
137 |
|
138 |
// For WordPress functions below 4.4.
|
139 |
if ( WPSEO_Options::get( 'forcerewritetitle', false ) && ! current_theme_supports( 'title-tag' ) ) {
|
140 |
+
add_action( 'template_redirect', [ $this, 'force_rewrite_output_buffer' ], 99999 );
|
141 |
+
add_action( 'wp_footer', [ $this, 'flush_cache' ], - 1 );
|
142 |
}
|
143 |
|
144 |
if ( WPSEO_Options::get( 'title_test', 0 ) > 0 ) {
|
145 |
+
add_filter( 'wpseo_title', [ $this, 'title_test_helper' ] );
|
146 |
}
|
147 |
|
148 |
$this->woocommerce_shop_page = new WPSEO_WooCommerce_Shop_Page();
|
149 |
|
150 |
+
$integrations = [
|
151 |
new WPSEO_Frontend_Primary_Category(),
|
152 |
new WPSEO_Schema(),
|
153 |
new WPSEO_Handle_404(),
|
154 |
new WPSEO_Remove_Reply_To_Com(),
|
155 |
new WPSEO_OpenGraph_OEmbed(),
|
156 |
$this->woocommerce_shop_page,
|
157 |
+
];
|
158 |
|
159 |
foreach ( $integrations as $integration ) {
|
160 |
$integration->register_hooks();
|
169 |
return;
|
170 |
}
|
171 |
|
172 |
+
add_action( 'wpseo_head', [ $this, 'webmaster_tools_authentication' ], 90 );
|
173 |
}
|
174 |
|
175 |
/**
|
296 |
$title = trim( get_the_author_meta( 'wpseo_title', $author_id ) );
|
297 |
|
298 |
if ( $title !== '' ) {
|
299 |
+
return $this->replace_vars( $title, [] );
|
300 |
}
|
301 |
|
302 |
return $this->get_title_from_options( 'title-author-wpseo' );
|
312 |
*
|
313 |
* @return string
|
314 |
*/
|
315 |
+
public function get_title_from_options( $index, $var_source = [] ) {
|
316 |
$template = WPSEO_Options::get( $index, '' );
|
317 |
if ( $template === '' ) {
|
318 |
if ( is_singular() ) {
|
430 |
return $title;
|
431 |
}
|
432 |
|
433 |
+
$separator = $this->replace_vars( '%%sep%%', [] );
|
434 |
$separator = ' ' . trim( $separator ) . ' ';
|
435 |
|
436 |
if ( '' === trim( $separator_location ) ) {
|
694 |
public function get_robots() {
|
695 |
global $wp_query, $post;
|
696 |
|
697 |
+
$robots = [];
|
698 |
$robots['index'] = 'index';
|
699 |
$robots['follow'] = 'follow';
|
700 |
+
$robots['other'] = [];
|
701 |
|
702 |
if ( is_object( $post ) && WPSEO_Frontend_Page_Type::is_simple_page() ) {
|
703 |
$private = 'private' === $post->post_status;
|
769 |
|
770 |
$robotsstr = $robots['index'] . ',' . $robots['follow'];
|
771 |
|
772 |
+
if ( $robots['other'] !== [] ) {
|
773 |
$robots['other'] = array_unique( $robots['other'] ); // @todo Most likely no longer needed, needs testing.
|
774 |
$robotsstr .= ',' . implode( ',', $robots['other'] );
|
775 |
}
|
776 |
|
777 |
$robotsstr = preg_replace( '`^index,follow,?`', '', $robotsstr );
|
778 |
+
$robotsstr = str_replace( [ 'noodp,', 'noodp' ], '', $robotsstr );
|
779 |
|
780 |
if ( strpos( $robotsstr, 'noindex' ) === false && strpos( $robotsstr, 'nosnippet' ) === false ) {
|
781 |
if ( $robotsstr !== '' ) {
|
808 |
|
809 |
// If a page has a noindex, it should _not_ have a canonical, as these are opposing indexing directives.
|
810 |
if ( strpos( $robotsstr, 'noindex' ) !== false ) {
|
811 |
+
remove_action( 'wpseo_head', [ $this, 'canonical' ], 20 );
|
812 |
}
|
813 |
|
814 |
return $robotsstr;
|
1252 |
}
|
1253 |
elseif ( WPSEO_Frontend_Page_Type::is_home_posts_page() ) {
|
1254 |
$template = WPSEO_Options::get( 'metadesc-home-wpseo' );
|
1255 |
+
$term = [];
|
1256 |
|
1257 |
if ( empty( $template ) ) {
|
1258 |
$template = get_bloginfo( 'description' );
|
1350 |
* Outputs noindex values for the current page.
|
1351 |
*/
|
1352 |
public function noindex_page() {
|
1353 |
+
remove_action( 'wpseo_head', [ $this, 'canonical' ], 20 );
|
1354 |
echo '<meta name="robots" content="noindex" />', "\n";
|
1355 |
}
|
1356 |
|
1667 |
* @return bool True when the action exists.
|
1668 |
*/
|
1669 |
protected function show_debug_marker() {
|
1670 |
+
return has_action( 'wpseo_head', [ $this, 'debug_mark' ] ) !== false;
|
1671 |
}
|
1672 |
|
1673 |
/**
|
1785 |
*
|
1786 |
* @return string The replaced string.
|
1787 |
*/
|
1788 |
+
protected function replace_vars( $string, $args, $omit = [] ) {
|
1789 |
$replacer = new WPSEO_Replace_Vars();
|
1790 |
|
1791 |
return $replacer->replace( $string, $args, $omit );
|
frontend/class-handle-404.php
CHANGED
@@ -20,7 +20,7 @@ class WPSEO_Handle_404 implements WPSEO_WordPress_Integration {
|
|
20 |
* @return void
|
21 |
*/
|
22 |
public function register_hooks() {
|
23 |
-
add_filter( 'pre_handle_404',
|
24 |
}
|
25 |
|
26 |
/**
|
20 |
* @return void
|
21 |
*/
|
22 |
public function register_hooks() {
|
23 |
+
add_filter( 'pre_handle_404', [ $this, 'handle_404' ] );
|
24 |
}
|
25 |
|
26 |
/**
|
frontend/class-opengraph-image.php
CHANGED
@@ -22,7 +22,7 @@ class WPSEO_OpenGraph_Image {
|
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
-
protected $images =
|
26 |
|
27 |
/**
|
28 |
* Holds the WPSEO_OpenGraph instance, so we can call og_tag.
|
@@ -36,37 +36,37 @@ class WPSEO_OpenGraph_Image {
|
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
-
private $image_tags =
|
40 |
'width' => 'width',
|
41 |
'height' => 'height',
|
42 |
'mime-type' => 'type',
|
43 |
-
|
44 |
|
45 |
/**
|
46 |
* The parameters we have for Facebook images.
|
47 |
*
|
48 |
* @var array
|
49 |
*/
|
50 |
-
private $image_params =
|
51 |
'min_width' => 200,
|
52 |
'max_width' => 2000,
|
53 |
'min_height' => 200,
|
54 |
'max_height' => 2000,
|
55 |
-
|
56 |
|
57 |
/**
|
58 |
* Image types that are supported by OpenGraph.
|
59 |
*
|
60 |
* @var array
|
61 |
*/
|
62 |
-
private $valid_image_types =
|
63 |
|
64 |
/**
|
65 |
* Image extensions that are supported by OpenGraph.
|
66 |
*
|
67 |
* @var array
|
68 |
*/
|
69 |
-
private $valid_image_extensions =
|
70 |
|
71 |
/**
|
72 |
* Constructor.
|
@@ -168,7 +168,7 @@ class WPSEO_OpenGraph_Image {
|
|
168 |
public function add_image( $attachment ) {
|
169 |
// In the past `add_image` accepted an image url, so leave this for backwards compatibility.
|
170 |
if ( is_string( $attachment ) ) {
|
171 |
-
$attachment =
|
172 |
}
|
173 |
|
174 |
if ( ! is_array( $attachment ) || empty( $attachment['url'] ) ) {
|
@@ -214,7 +214,7 @@ class WPSEO_OpenGraph_Image {
|
|
214 |
switch ( $image_id ) {
|
215 |
case self::EXTERNAL_IMAGE_ID:
|
216 |
// Add image by URL, but skip attachment_to_id call. We already know this is an external image.
|
217 |
-
$this->add_image(
|
218 |
break;
|
219 |
|
220 |
case '':
|
@@ -261,7 +261,7 @@ class WPSEO_OpenGraph_Image {
|
|
261 |
$frontpage_image_url = WPSEO_Options::get( 'og_frontpage_image' );
|
262 |
$frontpage_image_id = WPSEO_Options::get( 'og_frontpage_image_id' );
|
263 |
|
264 |
-
$this->add_image_by_id_or_url( $frontpage_image_id, $frontpage_image_url,
|
265 |
}
|
266 |
|
267 |
/**
|
@@ -351,7 +351,7 @@ class WPSEO_OpenGraph_Image {
|
|
351 |
return;
|
352 |
}
|
353 |
|
354 |
-
$this->add_image_by_id_or_url( $default_image_id, $default_image_url,
|
355 |
}
|
356 |
|
357 |
/**
|
@@ -378,7 +378,7 @@ class WPSEO_OpenGraph_Image {
|
|
378 |
$image_id = WPSEO_Meta::get_value( 'opengraph-image-id', $post_id );
|
379 |
$image_url = WPSEO_Meta::get_value( 'opengraph-image', $post_id );
|
380 |
|
381 |
-
$this->add_image_by_id_or_url( $image_id, $image_url,
|
382 |
}
|
383 |
|
384 |
/**
|
@@ -437,7 +437,7 @@ class WPSEO_OpenGraph_Image {
|
|
437 |
return $attachment_id;
|
438 |
}
|
439 |
|
440 |
-
$this->add_image(
|
441 |
|
442 |
return -1;
|
443 |
}
|
@@ -669,6 +669,6 @@ class WPSEO_OpenGraph_Image {
|
|
669 |
return;
|
670 |
}
|
671 |
|
672 |
-
$this->add_image(
|
673 |
}
|
674 |
}
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
+
protected $images = [];
|
26 |
|
27 |
/**
|
28 |
* Holds the WPSEO_OpenGraph instance, so we can call og_tag.
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
+
private $image_tags = [
|
40 |
'width' => 'width',
|
41 |
'height' => 'height',
|
42 |
'mime-type' => 'type',
|
43 |
+
];
|
44 |
|
45 |
/**
|
46 |
* The parameters we have for Facebook images.
|
47 |
*
|
48 |
* @var array
|
49 |
*/
|
50 |
+
private $image_params = [
|
51 |
'min_width' => 200,
|
52 |
'max_width' => 2000,
|
53 |
'min_height' => 200,
|
54 |
'max_height' => 2000,
|
55 |
+
];
|
56 |
|
57 |
/**
|
58 |
* Image types that are supported by OpenGraph.
|
59 |
*
|
60 |
* @var array
|
61 |
*/
|
62 |
+
private $valid_image_types = [ 'image/jpeg', 'image/gif', 'image/png' ];
|
63 |
|
64 |
/**
|
65 |
* Image extensions that are supported by OpenGraph.
|
66 |
*
|
67 |
* @var array
|
68 |
*/
|
69 |
+
private $valid_image_extensions = [ 'jpeg', 'jpg', 'gif', 'png' ];
|
70 |
|
71 |
/**
|
72 |
* Constructor.
|
168 |
public function add_image( $attachment ) {
|
169 |
// In the past `add_image` accepted an image url, so leave this for backwards compatibility.
|
170 |
if ( is_string( $attachment ) ) {
|
171 |
+
$attachment = [ 'url' => $attachment ];
|
172 |
}
|
173 |
|
174 |
if ( ! is_array( $attachment ) || empty( $attachment['url'] ) ) {
|
214 |
switch ( $image_id ) {
|
215 |
case self::EXTERNAL_IMAGE_ID:
|
216 |
// Add image by URL, but skip attachment_to_id call. We already know this is an external image.
|
217 |
+
$this->add_image( [ 'url' => $image_url ] );
|
218 |
break;
|
219 |
|
220 |
case '':
|
261 |
$frontpage_image_url = WPSEO_Options::get( 'og_frontpage_image' );
|
262 |
$frontpage_image_id = WPSEO_Options::get( 'og_frontpage_image_id' );
|
263 |
|
264 |
+
$this->add_image_by_id_or_url( $frontpage_image_id, $frontpage_image_url, [ $this, 'save_frontpage_image_id' ] );
|
265 |
}
|
266 |
|
267 |
/**
|
351 |
return;
|
352 |
}
|
353 |
|
354 |
+
$this->add_image_by_id_or_url( $default_image_id, $default_image_url, [ $this, 'save_default_image_id' ] );
|
355 |
}
|
356 |
|
357 |
/**
|
378 |
$image_id = WPSEO_Meta::get_value( 'opengraph-image-id', $post_id );
|
379 |
$image_url = WPSEO_Meta::get_value( 'opengraph-image', $post_id );
|
380 |
|
381 |
+
$this->add_image_by_id_or_url( $image_id, $image_url, [ $this, 'save_opengraph_image_id_meta' ] );
|
382 |
}
|
383 |
|
384 |
/**
|
437 |
return $attachment_id;
|
438 |
}
|
439 |
|
440 |
+
$this->add_image( [ 'url' => $url ] );
|
441 |
|
442 |
return -1;
|
443 |
}
|
669 |
return;
|
670 |
}
|
671 |
|
672 |
+
$this->add_image( [ 'url' => $image_url ] );
|
673 |
}
|
674 |
}
|
frontend/class-opengraph-oembed.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_OpenGraph_OEmbed implements WPSEO_WordPress_Integration {
|
|
16 |
public function register_hooks() {
|
17 |
// Check to make sure opengraph is enabled before adding filter.
|
18 |
if ( WPSEO_Options::get( 'opengraph' ) ) {
|
19 |
-
add_filter( 'oembed_response_data',
|
20 |
}
|
21 |
}
|
22 |
|
16 |
public function register_hooks() {
|
17 |
// Check to make sure opengraph is enabled before adding filter.
|
18 |
if ( WPSEO_Options::get( 'opengraph' ) ) {
|
19 |
+
add_filter( 'oembed_response_data', [ $this, 'set_oembed_data' ], 10, 2 );
|
20 |
}
|
21 |
}
|
22 |
|
frontend/class-opengraph.php
CHANGED
@@ -24,28 +24,28 @@ class WPSEO_OpenGraph {
|
|
24 |
$this->date = new WPSEO_Date_Helper();
|
25 |
|
26 |
if ( isset( $GLOBALS['fb_ver'] ) || class_exists( 'Facebook_Loader', false ) ) {
|
27 |
-
add_filter( 'fb_meta_tags',
|
28 |
}
|
29 |
else {
|
30 |
-
add_action( 'wpseo_opengraph',
|
31 |
-
add_action( 'wpseo_opengraph',
|
32 |
-
add_action( 'wpseo_opengraph',
|
33 |
-
add_action( 'wpseo_opengraph',
|
34 |
-
add_action( 'wpseo_opengraph',
|
35 |
-
add_action( 'wpseo_opengraph',
|
36 |
-
add_action( 'wpseo_opengraph',
|
37 |
-
add_action( 'wpseo_opengraph',
|
38 |
if ( is_singular() && ! is_front_page() ) {
|
39 |
-
add_action( 'wpseo_opengraph',
|
40 |
-
add_action( 'wpseo_opengraph',
|
41 |
-
add_action( 'wpseo_opengraph',
|
42 |
-
add_action( 'wpseo_opengraph',
|
43 |
}
|
44 |
|
45 |
-
add_action( 'wpseo_opengraph',
|
46 |
}
|
47 |
add_filter( 'jetpack_enable_open_graph', '__return_false' );
|
48 |
-
add_action( 'wpseo_head',
|
49 |
}
|
50 |
|
51 |
/**
|
@@ -275,7 +275,7 @@ class WPSEO_OpenGraph {
|
|
275 |
$locale = apply_filters( 'wpseo_locale', get_locale() );
|
276 |
|
277 |
// Catch some weird locales served out by WP that are not easily doubled up.
|
278 |
-
$fix_locales =
|
279 |
'ca' => 'ca_ES',
|
280 |
'en' => 'en_US',
|
281 |
'el' => 'el_GR',
|
@@ -285,7 +285,7 @@ class WPSEO_OpenGraph {
|
|
285 |
'uk' => 'uk_UA',
|
286 |
'vi' => 'vi_VN',
|
287 |
'zh' => 'zh_CN',
|
288 |
-
|
289 |
|
290 |
if ( isset( $fix_locales[ $locale ] ) ) {
|
291 |
$locale = $fix_locales[ $locale ];
|
@@ -297,7 +297,7 @@ class WPSEO_OpenGraph {
|
|
297 |
}
|
298 |
|
299 |
// These are the locales FB supports.
|
300 |
-
$fb_valid_fb_locales =
|
301 |
'af_ZA', // Afrikaans.
|
302 |
'ak_GH', // Akan.
|
303 |
'am_ET', // Amharic.
|
@@ -452,7 +452,7 @@ class WPSEO_OpenGraph {
|
|
452 |
'zh_TW', // Traditional Chinese (Taiwan).
|
453 |
'zu_ZA', // Zulu.
|
454 |
'zz_TR', // Zazaki.
|
455 |
-
|
456 |
|
457 |
// Check to see if the locale is a valid FB one, if not, use en_US as a fallback.
|
458 |
if ( ! in_array( $locale, $fb_valid_fb_locales, true ) ) {
|
@@ -634,7 +634,7 @@ class WPSEO_OpenGraph {
|
|
634 |
}
|
635 |
|
636 |
$tags = get_the_tags();
|
637 |
-
if ( ! is_wp_error( $tags ) && ( is_array( $tags ) && $tags !==
|
638 |
|
639 |
foreach ( $tags as $tag ) {
|
640 |
$this->og_tag( 'article:tag', $tag->name );
|
24 |
$this->date = new WPSEO_Date_Helper();
|
25 |
|
26 |
if ( isset( $GLOBALS['fb_ver'] ) || class_exists( 'Facebook_Loader', false ) ) {
|
27 |
+
add_filter( 'fb_meta_tags', [ $this, 'facebook_filter' ], 10, 1 );
|
28 |
}
|
29 |
else {
|
30 |
+
add_action( 'wpseo_opengraph', [ $this, 'locale' ], 1 );
|
31 |
+
add_action( 'wpseo_opengraph', [ $this, 'type' ], 5 );
|
32 |
+
add_action( 'wpseo_opengraph', [ $this, 'og_title' ], 10 );
|
33 |
+
add_action( 'wpseo_opengraph', [ $this, 'app_id' ], 20 );
|
34 |
+
add_action( 'wpseo_opengraph', [ $this, 'description' ], 11 );
|
35 |
+
add_action( 'wpseo_opengraph', [ $this, 'url' ], 12 );
|
36 |
+
add_action( 'wpseo_opengraph', [ $this, 'site_name' ], 13 );
|
37 |
+
add_action( 'wpseo_opengraph', [ $this, 'website_facebook' ], 14 );
|
38 |
if ( is_singular() && ! is_front_page() ) {
|
39 |
+
add_action( 'wpseo_opengraph', [ $this, 'article_author_facebook' ], 15 );
|
40 |
+
add_action( 'wpseo_opengraph', [ $this, 'tags' ], 16 );
|
41 |
+
add_action( 'wpseo_opengraph', [ $this, 'category' ], 17 );
|
42 |
+
add_action( 'wpseo_opengraph', [ $this, 'publish_date' ], 19 );
|
43 |
}
|
44 |
|
45 |
+
add_action( 'wpseo_opengraph', [ $this, 'image' ], 30 );
|
46 |
}
|
47 |
add_filter( 'jetpack_enable_open_graph', '__return_false' );
|
48 |
+
add_action( 'wpseo_head', [ $this, 'opengraph' ], 30 );
|
49 |
}
|
50 |
|
51 |
/**
|
275 |
$locale = apply_filters( 'wpseo_locale', get_locale() );
|
276 |
|
277 |
// Catch some weird locales served out by WP that are not easily doubled up.
|
278 |
+
$fix_locales = [
|
279 |
'ca' => 'ca_ES',
|
280 |
'en' => 'en_US',
|
281 |
'el' => 'el_GR',
|
285 |
'uk' => 'uk_UA',
|
286 |
'vi' => 'vi_VN',
|
287 |
'zh' => 'zh_CN',
|
288 |
+
];
|
289 |
|
290 |
if ( isset( $fix_locales[ $locale ] ) ) {
|
291 |
$locale = $fix_locales[ $locale ];
|
297 |
}
|
298 |
|
299 |
// These are the locales FB supports.
|
300 |
+
$fb_valid_fb_locales = [
|
301 |
'af_ZA', // Afrikaans.
|
302 |
'ak_GH', // Akan.
|
303 |
'am_ET', // Amharic.
|
452 |
'zh_TW', // Traditional Chinese (Taiwan).
|
453 |
'zu_ZA', // Zulu.
|
454 |
'zz_TR', // Zazaki.
|
455 |
+
];
|
456 |
|
457 |
// Check to see if the locale is a valid FB one, if not, use en_US as a fallback.
|
458 |
if ( ! in_array( $locale, $fb_valid_fb_locales, true ) ) {
|
634 |
}
|
635 |
|
636 |
$tags = get_the_tags();
|
637 |
+
if ( ! is_wp_error( $tags ) && ( is_array( $tags ) && $tags !== [] ) ) {
|
638 |
|
639 |
foreach ( $tags as $tag ) {
|
640 |
$this->og_tag( 'article:tag', $tag->name );
|
frontend/class-primary-category.php
CHANGED
@@ -14,7 +14,7 @@ class WPSEO_Frontend_Primary_Category implements WPSEO_WordPress_Integration {
|
|
14 |
* Registers the hooks necessary for correct primary category behaviour.
|
15 |
*/
|
16 |
public function register_hooks() {
|
17 |
-
add_filter( 'post_link_category',
|
18 |
}
|
19 |
|
20 |
/**
|
14 |
* Registers the hooks necessary for correct primary category behaviour.
|
15 |
*/
|
16 |
public function register_hooks() {
|
17 |
+
add_filter( 'post_link_category', [ $this, 'post_link_category' ], 10, 3 );
|
18 |
}
|
19 |
|
20 |
/**
|
frontend/class-remove-reply-to-com.php
CHANGED
@@ -21,8 +21,8 @@ class WPSEO_Remove_Reply_To_Com implements WPSEO_WordPress_Integration {
|
|
21 |
*/
|
22 |
public function register_hooks() {
|
23 |
if ( $this->clean_reply_to_com() ) {
|
24 |
-
add_filter( 'comment_reply_link',
|
25 |
-
add_action( 'template_redirect',
|
26 |
}
|
27 |
}
|
28 |
|
21 |
*/
|
22 |
public function register_hooks() {
|
23 |
if ( $this->clean_reply_to_com() ) {
|
24 |
+
add_filter( 'comment_reply_link', [ $this, 'remove_reply_to_com' ] );
|
25 |
+
add_action( 'template_redirect', [ $this, 'replytocom_redirect' ], 1 );
|
26 |
}
|
27 |
}
|
28 |
|
frontend/class-twitter.php
CHANGED
@@ -24,14 +24,14 @@ class WPSEO_Twitter {
|
|
24 |
*
|
25 |
* @var array
|
26 |
*/
|
27 |
-
private $images =
|
28 |
|
29 |
/**
|
30 |
* Images.
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
-
public $shown_images =
|
35 |
|
36 |
/**
|
37 |
* Will hold the Twitter card type being created.
|
@@ -47,12 +47,12 @@ class WPSEO_Twitter {
|
|
47 |
*
|
48 |
* @var array
|
49 |
*/
|
50 |
-
private $valid_types =
|
51 |
'summary',
|
52 |
'summary_large_image',
|
53 |
'app',
|
54 |
'player',
|
55 |
-
|
56 |
|
57 |
/**
|
58 |
* Class constructor.
|
@@ -400,7 +400,7 @@ class WPSEO_Twitter {
|
|
400 |
* @return bool
|
401 |
*/
|
402 |
private function taxonomy_image_output() {
|
403 |
-
foreach (
|
404 |
$img = WPSEO_Taxonomy_Meta::get_meta_without_term( $tag );
|
405 |
if ( is_string( $img ) && $img !== '' ) {
|
406 |
$this->image_output( $img );
|
@@ -551,7 +551,7 @@ class WPSEO_Twitter {
|
|
551 |
* @return bool
|
552 |
*/
|
553 |
private function image_from_meta_values_output( $post_id = 0 ) {
|
554 |
-
foreach (
|
555 |
$img = WPSEO_Meta::get_value( $tag, $post_id );
|
556 |
if ( $img !== '' ) {
|
557 |
$this->image_output( $img );
|
24 |
*
|
25 |
* @var array
|
26 |
*/
|
27 |
+
private $images = [];
|
28 |
|
29 |
/**
|
30 |
* Images.
|
31 |
*
|
32 |
* @var array
|
33 |
*/
|
34 |
+
public $shown_images = [];
|
35 |
|
36 |
/**
|
37 |
* Will hold the Twitter card type being created.
|
47 |
*
|
48 |
* @var array
|
49 |
*/
|
50 |
+
private $valid_types = [
|
51 |
'summary',
|
52 |
'summary_large_image',
|
53 |
'app',
|
54 |
'player',
|
55 |
+
];
|
56 |
|
57 |
/**
|
58 |
* Class constructor.
|
400 |
* @return bool
|
401 |
*/
|
402 |
private function taxonomy_image_output() {
|
403 |
+
foreach ( [ 'twitter-image', 'opengraph-image' ] as $tag ) {
|
404 |
$img = WPSEO_Taxonomy_Meta::get_meta_without_term( $tag );
|
405 |
if ( is_string( $img ) && $img !== '' ) {
|
406 |
$this->image_output( $img );
|
551 |
* @return bool
|
552 |
*/
|
553 |
private function image_from_meta_values_output( $post_id = 0 ) {
|
554 |
+
foreach ( [ 'twitter-image', 'opengraph-image' ] as $tag ) {
|
555 |
$img = WPSEO_Meta::get_value( $tag, $post_id );
|
556 |
if ( $img !== '' ) {
|
557 |
$this->image_output( $img );
|
frontend/class-woocommerce-shop-page.php
CHANGED
@@ -34,7 +34,7 @@ class WPSEO_WooCommerce_Shop_Page implements WPSEO_WordPress_Integration {
|
|
34 |
return;
|
35 |
}
|
36 |
|
37 |
-
add_filter( 'wpseo_frontend_page_type_simple_page_id',
|
38 |
}
|
39 |
|
40 |
/**
|
34 |
return;
|
35 |
}
|
36 |
|
37 |
+
add_filter( 'wpseo_frontend_page_type_simple_page_id', [ $this, 'get_page_id' ] );
|
38 |
}
|
39 |
|
40 |
/**
|
frontend/schema/class-schema-article.php
CHANGED
@@ -61,17 +61,17 @@ class WPSEO_Schema_Article implements WPSEO_Graph_Piece {
|
|
61 |
public function generate() {
|
62 |
$post = get_post( $this->context->id );
|
63 |
$comment_count = get_comment_count( $this->context->id );
|
64 |
-
$data =
|
65 |
'@type' => 'Article',
|
66 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::ARTICLE_HASH,
|
67 |
-
'isPartOf' =>
|
68 |
-
'author' =>
|
69 |
'headline' => get_the_title(),
|
70 |
'datePublished' => $this->date->format( $post->post_date_gmt ),
|
71 |
'dateModified' => $this->date->format( $post->post_modified_gmt ),
|
72 |
'commentCount' => $comment_count['approved'],
|
73 |
-
'mainEntityOfPage' =>
|
74 |
-
|
75 |
|
76 |
if ( $this->context->site_represents_reference ) {
|
77 |
$data['publisher'] = $this->context->site_represents_reference;
|
@@ -101,7 +101,7 @@ class WPSEO_Schema_Article implements WPSEO_Graph_Piece {
|
|
101 |
*
|
102 |
* @api string[] $post_types The post types for which we output Article.
|
103 |
*/
|
104 |
-
$post_types = apply_filters( 'wpseo_schema_article_post_types',
|
105 |
|
106 |
return in_array( $post_type, $post_types );
|
107 |
}
|
@@ -154,7 +154,7 @@ class WPSEO_Schema_Article implements WPSEO_Graph_Piece {
|
|
154 |
private function add_terms( $data, $key, $taxonomy ) {
|
155 |
$terms = get_the_terms( $this->context->id, $taxonomy );
|
156 |
if ( is_array( $terms ) ) {
|
157 |
-
$keywords =
|
158 |
foreach ( $terms as $term ) {
|
159 |
// We are checking against the WordPress internal translation.
|
160 |
// @codingStandardsIgnoreLine
|
@@ -177,9 +177,9 @@ class WPSEO_Schema_Article implements WPSEO_Graph_Piece {
|
|
177 |
*/
|
178 |
private function add_image( $data ) {
|
179 |
if ( $this->context->has_image ) {
|
180 |
-
$data['image'] =
|
181 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::PRIMARY_IMAGE_HASH,
|
182 |
-
|
183 |
}
|
184 |
|
185 |
return $data;
|
61 |
public function generate() {
|
62 |
$post = get_post( $this->context->id );
|
63 |
$comment_count = get_comment_count( $this->context->id );
|
64 |
+
$data = [
|
65 |
'@type' => 'Article',
|
66 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::ARTICLE_HASH,
|
67 |
+
'isPartOf' => [ '@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH ],
|
68 |
+
'author' => [ '@id' => WPSEO_Schema_Utils::get_user_schema_id( $post->post_author, $this->context ) ],
|
69 |
'headline' => get_the_title(),
|
70 |
'datePublished' => $this->date->format( $post->post_date_gmt ),
|
71 |
'dateModified' => $this->date->format( $post->post_modified_gmt ),
|
72 |
'commentCount' => $comment_count['approved'],
|
73 |
+
'mainEntityOfPage' => [ '@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH ],
|
74 |
+
];
|
75 |
|
76 |
if ( $this->context->site_represents_reference ) {
|
77 |
$data['publisher'] = $this->context->site_represents_reference;
|
101 |
*
|
102 |
* @api string[] $post_types The post types for which we output Article.
|
103 |
*/
|
104 |
+
$post_types = apply_filters( 'wpseo_schema_article_post_types', [ 'post' ] );
|
105 |
|
106 |
return in_array( $post_type, $post_types );
|
107 |
}
|
154 |
private function add_terms( $data, $key, $taxonomy ) {
|
155 |
$terms = get_the_terms( $this->context->id, $taxonomy );
|
156 |
if ( is_array( $terms ) ) {
|
157 |
+
$keywords = [];
|
158 |
foreach ( $terms as $term ) {
|
159 |
// We are checking against the WordPress internal translation.
|
160 |
// @codingStandardsIgnoreLine
|
177 |
*/
|
178 |
private function add_image( $data ) {
|
179 |
if ( $this->context->has_image ) {
|
180 |
+
$data['image'] = [
|
181 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::PRIMARY_IMAGE_HASH,
|
182 |
+
];
|
183 |
}
|
184 |
|
185 |
return $data;
|
frontend/schema/class-schema-author.php
CHANGED
@@ -26,7 +26,7 @@ class WPSEO_Schema_Author extends WPSEO_Schema_Person implements WPSEO_Graph_Pie
|
|
26 |
*
|
27 |
* @var string[]
|
28 |
*/
|
29 |
-
protected $type =
|
30 |
|
31 |
/**
|
32 |
* WPSEO_Schema_Author constructor.
|
@@ -77,9 +77,9 @@ class WPSEO_Schema_Author extends WPSEO_Schema_Person implements WPSEO_Graph_Pie
|
|
77 |
|
78 |
// If this is an author page, the Person object is the main object, so we set it as such here.
|
79 |
if ( is_author() ) {
|
80 |
-
$data['mainEntityOfPage'] =
|
81 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH,
|
82 |
-
|
83 |
}
|
84 |
|
85 |
return $data;
|
26 |
*
|
27 |
* @var string[]
|
28 |
*/
|
29 |
+
protected $type = [ 'Person' ];
|
30 |
|
31 |
/**
|
32 |
* WPSEO_Schema_Author constructor.
|
77 |
|
78 |
// If this is an author page, the Person object is the main object, so we set it as such here.
|
79 |
if ( is_author() ) {
|
80 |
+
$data['mainEntityOfPage'] = [
|
81 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH,
|
82 |
+
];
|
83 |
}
|
84 |
|
85 |
return $data;
|
frontend/schema/class-schema-breadcrumb.php
CHANGED
@@ -67,7 +67,7 @@ class WPSEO_Schema_Breadcrumb implements WPSEO_Graph_Piece {
|
|
67 |
$breadcrumbs_instance = WPSEO_Breadcrumbs::get_instance();
|
68 |
$breadcrumbs = $breadcrumbs_instance->get_links();
|
69 |
$broken = false;
|
70 |
-
$list_elements =
|
71 |
|
72 |
foreach ( $breadcrumbs as $index => $breadcrumb ) {
|
73 |
if ( ! empty( $breadcrumb['hide_in_schema'] ) ) {
|
@@ -86,11 +86,11 @@ class WPSEO_Schema_Breadcrumb implements WPSEO_Graph_Piece {
|
|
86 |
$list_elements[] = $this->add_paginated_state();
|
87 |
}
|
88 |
|
89 |
-
$data =
|
90 |
'@type' => 'BreadcrumbList',
|
91 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::BREADCRUMB_HASH,
|
92 |
'itemListElement' => $list_elements,
|
93 |
-
|
94 |
|
95 |
// Only output if JSON is correctly formatted.
|
96 |
if ( ! $broken ) {
|
@@ -123,16 +123,16 @@ class WPSEO_Schema_Breadcrumb implements WPSEO_Graph_Piece {
|
|
123 |
$breadcrumb['url'] = $this->context->title;
|
124 |
}
|
125 |
|
126 |
-
return
|
127 |
'@type' => 'ListItem',
|
128 |
'position' => ( $index + 1 ),
|
129 |
-
'item' =>
|
130 |
'@type' => 'WebPage',
|
131 |
'@id' => $breadcrumb['url'],
|
132 |
'url' => $breadcrumb['url'], // For future proofing, we're trying to change the standard for this.
|
133 |
'name' => $breadcrumb['text'],
|
134 |
-
|
135 |
-
|
136 |
}
|
137 |
|
138 |
/**
|
@@ -144,10 +144,10 @@ class WPSEO_Schema_Breadcrumb implements WPSEO_Graph_Piece {
|
|
144 |
$this->index++;
|
145 |
return $this->add_breadcrumb(
|
146 |
$this->index,
|
147 |
-
|
148 |
'url' => $this->context->canonical,
|
149 |
'text' => $this->context->title,
|
150 |
-
|
151 |
);
|
152 |
}
|
153 |
}
|
67 |
$breadcrumbs_instance = WPSEO_Breadcrumbs::get_instance();
|
68 |
$breadcrumbs = $breadcrumbs_instance->get_links();
|
69 |
$broken = false;
|
70 |
+
$list_elements = [];
|
71 |
|
72 |
foreach ( $breadcrumbs as $index => $breadcrumb ) {
|
73 |
if ( ! empty( $breadcrumb['hide_in_schema'] ) ) {
|
86 |
$list_elements[] = $this->add_paginated_state();
|
87 |
}
|
88 |
|
89 |
+
$data = [
|
90 |
'@type' => 'BreadcrumbList',
|
91 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::BREADCRUMB_HASH,
|
92 |
'itemListElement' => $list_elements,
|
93 |
+
];
|
94 |
|
95 |
// Only output if JSON is correctly formatted.
|
96 |
if ( ! $broken ) {
|
123 |
$breadcrumb['url'] = $this->context->title;
|
124 |
}
|
125 |
|
126 |
+
return [
|
127 |
'@type' => 'ListItem',
|
128 |
'position' => ( $index + 1 ),
|
129 |
+
'item' => [
|
130 |
'@type' => 'WebPage',
|
131 |
'@id' => $breadcrumb['url'],
|
132 |
'url' => $breadcrumb['url'], // For future proofing, we're trying to change the standard for this.
|
133 |
'name' => $breadcrumb['text'],
|
134 |
+
],
|
135 |
+
];
|
136 |
}
|
137 |
|
138 |
/**
|
144 |
$this->index++;
|
145 |
return $this->add_breadcrumb(
|
146 |
$this->index,
|
147 |
+
[
|
148 |
'url' => $this->context->canonical,
|
149 |
'text' => $this->context->title,
|
150 |
+
]
|
151 |
);
|
152 |
}
|
153 |
}
|
frontend/schema/class-schema-context.php
CHANGED
@@ -173,11 +173,11 @@ class WPSEO_Schema_Context {
|
|
173 |
$this->site_represents_reference = false;
|
174 |
|
175 |
if ( $this->site_represents === 'person' ) {
|
176 |
-
$this->site_represents_reference =
|
177 |
}
|
178 |
|
179 |
if ( $this->site_represents === 'company' ) {
|
180 |
-
$this->site_represents_reference =
|
181 |
}
|
182 |
}
|
183 |
|
173 |
$this->site_represents_reference = false;
|
174 |
|
175 |
if ( $this->site_represents === 'person' ) {
|
176 |
+
$this->site_represents_reference = [ '@id' => WPSEO_Schema_Utils::get_user_schema_id( $this->site_user_id, $this ) ];
|
177 |
}
|
178 |
|
179 |
if ( $this->site_represents === 'company' ) {
|
180 |
+
$this->site_represents_reference = [ '@id' => $this->site_url . WPSEO_Schema_IDs::ORGANIZATION_HASH ];
|
181 |
}
|
182 |
}
|
183 |
|
frontend/schema/class-schema-faq-question-list.php
CHANGED
@@ -23,7 +23,7 @@ class WPSEO_Schema_FAQ_Question_List {
|
|
23 |
*
|
24 |
* @var array
|
25 |
*/
|
26 |
-
private $data =
|
27 |
|
28 |
/**
|
29 |
* All the blocks of this block-type.
|
@@ -66,12 +66,12 @@ class WPSEO_Schema_FAQ_Question_List {
|
|
66 |
public function generate() {
|
67 |
$this->prepare_blocks();
|
68 |
|
69 |
-
$this->data[] =
|
70 |
'@type' => 'ItemList',
|
71 |
-
'mainEntityOfPage' =>
|
72 |
'numberOfItems' => $this->count,
|
73 |
'itemListElement' => $this->ids,
|
74 |
-
|
75 |
|
76 |
return $this->data;
|
77 |
}
|
@@ -109,7 +109,7 @@ class WPSEO_Schema_FAQ_Question_List {
|
|
109 |
continue;
|
110 |
}
|
111 |
$this->count ++;
|
112 |
-
$this->ids[] =
|
113 |
}
|
114 |
}
|
115 |
}
|
23 |
*
|
24 |
* @var array
|
25 |
*/
|
26 |
+
private $data = [];
|
27 |
|
28 |
/**
|
29 |
* All the blocks of this block-type.
|
66 |
public function generate() {
|
67 |
$this->prepare_blocks();
|
68 |
|
69 |
+
$this->data[] = [
|
70 |
'@type' => 'ItemList',
|
71 |
+
'mainEntityOfPage' => [ '@id' => $this->get_schema_id() ],
|
72 |
'numberOfItems' => $this->count,
|
73 |
'itemListElement' => $this->ids,
|
74 |
+
];
|
75 |
|
76 |
return $this->data;
|
77 |
}
|
109 |
continue;
|
110 |
}
|
111 |
$this->count ++;
|
112 |
+
$this->ids[] = [ '@id' => $this->context->canonical . '#' . esc_attr( $question['id'] ) ];
|
113 |
}
|
114 |
}
|
115 |
}
|
frontend/schema/class-schema-faq-questions.php
CHANGED
@@ -75,17 +75,19 @@ class WPSEO_Schema_FAQ_Questions {
|
|
75 |
* @return array Schema.org Question piece.
|
76 |
*/
|
77 |
protected function generate_question_block( $question ) {
|
78 |
-
|
|
|
|
|
79 |
'@type' => 'Question',
|
80 |
-
'@id' => $
|
81 |
'position' => $this->position ++,
|
82 |
-
'url' => $
|
83 |
'name' => wp_strip_all_tags( $question['jsonQuestion'] ),
|
84 |
'answerCount' => 1,
|
85 |
-
'acceptedAnswer' =>
|
86 |
'@type' => 'Answer',
|
87 |
'text' => strip_tags( $question['jsonAnswer'], '<h1><h2><h3><h4><h5><h6><br><ol><ul><li><a><p><b><strong><i><em>' ),
|
88 |
-
|
89 |
-
|
90 |
}
|
91 |
}
|
75 |
* @return array Schema.org Question piece.
|
76 |
*/
|
77 |
protected function generate_question_block( $question ) {
|
78 |
+
$url = $this->context->canonical . '#' . esc_attr( $question['id'] );
|
79 |
+
|
80 |
+
return [
|
81 |
'@type' => 'Question',
|
82 |
+
'@id' => $url,
|
83 |
'position' => $this->position ++,
|
84 |
+
'url' => $url,
|
85 |
'name' => wp_strip_all_tags( $question['jsonQuestion'] ),
|
86 |
'answerCount' => 1,
|
87 |
+
'acceptedAnswer' => [
|
88 |
'@type' => 'Answer',
|
89 |
'text' => strip_tags( $question['jsonAnswer'], '<h1><h2><h3><h4><h5><h6><br><ol><ul><li><a><p><b><strong><i><em>' ),
|
90 |
+
],
|
91 |
+
];
|
92 |
}
|
93 |
}
|
frontend/schema/class-schema-faq.php
CHANGED
@@ -41,8 +41,8 @@ class WPSEO_Schema_FAQ implements WPSEO_Graph_Piece {
|
|
41 |
public function __construct( WPSEO_Schema_Context $context ) {
|
42 |
$this->context = $context;
|
43 |
|
44 |
-
add_action( 'wpseo_pre_schema_block_type_yoast/faq-block',
|
45 |
-
add_filter( 'wpseo_schema_block_yoast/faq-block',
|
46 |
}
|
47 |
|
48 |
/**
|
@@ -53,7 +53,7 @@ class WPSEO_Schema_FAQ implements WPSEO_Graph_Piece {
|
|
53 |
public function prepare_schema( $blocks ) {
|
54 |
$this->blocks = $blocks;
|
55 |
$this->is_needed = true;
|
56 |
-
add_filter( 'wpseo_schema_webpage_type',
|
57 |
}
|
58 |
|
59 |
/**
|
@@ -65,7 +65,7 @@ class WPSEO_Schema_FAQ implements WPSEO_Graph_Piece {
|
|
65 |
*/
|
66 |
public function change_schema_page_type( $page_type ) {
|
67 |
if ( ! is_array( $page_type ) ) {
|
68 |
-
$page_type =
|
69 |
}
|
70 |
$page_type[] = 'FAQPage';
|
71 |
|
41 |
public function __construct( WPSEO_Schema_Context $context ) {
|
42 |
$this->context = $context;
|
43 |
|
44 |
+
add_action( 'wpseo_pre_schema_block_type_yoast/faq-block', [ $this, 'prepare_schema' ], 10, 1 );
|
45 |
+
add_filter( 'wpseo_schema_block_yoast/faq-block', [ $this, 'render_schema_questions' ], 10, 3 );
|
46 |
}
|
47 |
|
48 |
/**
|
53 |
public function prepare_schema( $blocks ) {
|
54 |
$this->blocks = $blocks;
|
55 |
$this->is_needed = true;
|
56 |
+
add_filter( 'wpseo_schema_webpage_type', [ $this, 'change_schema_page_type' ] );
|
57 |
}
|
58 |
|
59 |
/**
|
65 |
*/
|
66 |
public function change_schema_page_type( $page_type ) {
|
67 |
if ( ! is_array( $page_type ) ) {
|
68 |
+
$page_type = [ $page_type ];
|
69 |
}
|
70 |
$page_type[] = 'FAQPage';
|
71 |
|
frontend/schema/class-schema-howto.php
CHANGED
@@ -53,7 +53,7 @@ class WPSEO_Schema_HowTo implements WPSEO_Graph_Piece {
|
|
53 |
$this->counter = 0;
|
54 |
$this->context = $context;
|
55 |
|
56 |
-
add_filter( 'wpseo_schema_block_yoast/how-to-block',
|
57 |
}
|
58 |
|
59 |
/**
|
@@ -62,7 +62,7 @@ class WPSEO_Schema_HowTo implements WPSEO_Graph_Piece {
|
|
62 |
* @return array $data Our Schema graph.
|
63 |
*/
|
64 |
public function generate() {
|
65 |
-
return
|
66 |
}
|
67 |
|
68 |
/**
|
@@ -75,13 +75,13 @@ class WPSEO_Schema_HowTo implements WPSEO_Graph_Piece {
|
|
75 |
*/
|
76 |
public function render( $graph, $block ) {
|
77 |
$this->counter++;
|
78 |
-
$data =
|
79 |
'@type' => 'HowTo',
|
80 |
'@id' => $this->context->canonical . '#howto-' . $this->counter,
|
81 |
'name' => $this->context->title,
|
82 |
-
'mainEntityOfPage' =>
|
83 |
'description' => '',
|
84 |
-
|
85 |
|
86 |
$json_description = strip_tags( $block['attrs']['jsonDescription'], '<h1><h2><h3><h4><h5><h6><br><ol><ul><li><a><p><b><strong><i><em>' );
|
87 |
|
@@ -112,7 +112,7 @@ class WPSEO_Schema_HowTo implements WPSEO_Graph_Piece {
|
|
112 |
$minutes = empty( $attributes['minutes'] ) ? 0 : $attributes['minutes'];
|
113 |
|
114 |
if ( ( $days + $hours + $minutes ) > 0 ) {
|
115 |
-
$data['totalTime'] = 'P' . $days . 'DT' . $hours . 'H' . $minutes . 'M';
|
116 |
}
|
117 |
}
|
118 |
|
@@ -149,11 +149,11 @@ class WPSEO_Schema_HowTo implements WPSEO_Graph_Piece {
|
|
149 |
*/
|
150 |
private function add_steps( &$data, $steps ) {
|
151 |
foreach ( $steps as $step ) {
|
152 |
-
$schema_id = $this->context->canonical . '#' . $step['id'];
|
153 |
-
$schema_step =
|
154 |
'@type' => 'HowToStep',
|
155 |
'url' => $schema_id,
|
156 |
-
|
157 |
|
158 |
$json_text = strip_tags( $step['jsonText'], $this->allowed_json_text_tags );
|
159 |
$json_name = wp_strip_all_tags( $step['jsonName'] );
|
@@ -204,12 +204,12 @@ class WPSEO_Schema_HowTo implements WPSEO_Graph_Piece {
|
|
204 |
return;
|
205 |
}
|
206 |
|
207 |
-
$schema_step['itemListElement'] =
|
208 |
|
209 |
-
$schema_step['itemListElement'][] =
|
210 |
'@type' => 'HowToDirection',
|
211 |
'text' => $json_text,
|
212 |
-
|
213 |
}
|
214 |
|
215 |
/**
|
@@ -221,7 +221,7 @@ class WPSEO_Schema_HowTo implements WPSEO_Graph_Piece {
|
|
221 |
private function add_step_image( &$schema_step, $step ) {
|
222 |
foreach ( $step['text'] as $line ) {
|
223 |
if ( is_array( $line ) && isset( $line['type'] ) && $line['type'] === 'img' ) {
|
224 |
-
$schema_step['image'] = $this->get_image_schema( $line['props']['src'] );
|
225 |
}
|
226 |
}
|
227 |
}
|
53 |
$this->counter = 0;
|
54 |
$this->context = $context;
|
55 |
|
56 |
+
add_filter( 'wpseo_schema_block_yoast/how-to-block', [ $this, 'render' ], 10, 2 );
|
57 |
}
|
58 |
|
59 |
/**
|
62 |
* @return array $data Our Schema graph.
|
63 |
*/
|
64 |
public function generate() {
|
65 |
+
return [];
|
66 |
}
|
67 |
|
68 |
/**
|
75 |
*/
|
76 |
public function render( $graph, $block ) {
|
77 |
$this->counter++;
|
78 |
+
$data = [
|
79 |
'@type' => 'HowTo',
|
80 |
'@id' => $this->context->canonical . '#howto-' . $this->counter,
|
81 |
'name' => $this->context->title,
|
82 |
+
'mainEntityOfPage' => [ '@id' => $this->get_main_schema_id() ],
|
83 |
'description' => '',
|
84 |
+
];
|
85 |
|
86 |
$json_description = strip_tags( $block['attrs']['jsonDescription'], '<h1><h2><h3><h4><h5><h6><br><ol><ul><li><a><p><b><strong><i><em>' );
|
87 |
|
112 |
$minutes = empty( $attributes['minutes'] ) ? 0 : $attributes['minutes'];
|
113 |
|
114 |
if ( ( $days + $hours + $minutes ) > 0 ) {
|
115 |
+
$data['totalTime'] = esc_attr( 'P' . $days . 'DT' . $hours . 'H' . $minutes . 'M' );
|
116 |
}
|
117 |
}
|
118 |
|
149 |
*/
|
150 |
private function add_steps( &$data, $steps ) {
|
151 |
foreach ( $steps as $step ) {
|
152 |
+
$schema_id = $this->context->canonical . '#' . esc_attr( $step['id'] );
|
153 |
+
$schema_step = [
|
154 |
'@type' => 'HowToStep',
|
155 |
'url' => $schema_id,
|
156 |
+
];
|
157 |
|
158 |
$json_text = strip_tags( $step['jsonText'], $this->allowed_json_text_tags );
|
159 |
$json_name = wp_strip_all_tags( $step['jsonName'] );
|
204 |
return;
|
205 |
}
|
206 |
|
207 |
+
$schema_step['itemListElement'] = [];
|
208 |
|
209 |
+
$schema_step['itemListElement'][] = [
|
210 |
'@type' => 'HowToDirection',
|
211 |
'text' => $json_text,
|
212 |
+
];
|
213 |
}
|
214 |
|
215 |
/**
|
221 |
private function add_step_image( &$schema_step, $step ) {
|
222 |
foreach ( $step['text'] as $line ) {
|
223 |
if ( is_array( $line ) && isset( $line['type'] ) && $line['type'] === 'img' ) {
|
224 |
+
$schema_step['image'] = $this->get_image_schema( esc_url( $line['props']['src'] ) );
|
225 |
}
|
226 |
}
|
227 |
}
|
frontend/schema/class-schema-image.php
CHANGED
@@ -132,10 +132,10 @@ class WPSEO_Schema_Image {
|
|
132 |
* @return void
|
133 |
*/
|
134 |
private function generate_object() {
|
135 |
-
$this->data =
|
136 |
'@type' => 'ImageObject',
|
137 |
'@id' => $this->schema_id,
|
138 |
-
|
139 |
}
|
140 |
|
141 |
/**
|
132 |
* @return void
|
133 |
*/
|
134 |
private function generate_object() {
|
135 |
+
$this->data = [
|
136 |
'@type' => 'ImageObject',
|
137 |
'@id' => $this->schema_id,
|
138 |
+
];
|
139 |
}
|
140 |
|
141 |
/**
|
frontend/schema/class-schema-organization.php
CHANGED
@@ -43,13 +43,13 @@ class WPSEO_Schema_Organization implements WPSEO_Graph_Piece {
|
|
43 |
* @return array $data The Organization schema.
|
44 |
*/
|
45 |
public function generate() {
|
46 |
-
$data =
|
47 |
'@type' => 'Organization',
|
48 |
'@id' => $this->context->site_url . WPSEO_Schema_IDs::ORGANIZATION_HASH,
|
49 |
'name' => $this->context->company_name,
|
50 |
'url' => $this->context->site_url,
|
51 |
'sameAs' => $this->fetch_social_profiles(),
|
52 |
-
|
53 |
$data = $this->add_logo( $data );
|
54 |
|
55 |
return $data;
|
@@ -66,7 +66,7 @@ class WPSEO_Schema_Organization implements WPSEO_Graph_Piece {
|
|
66 |
$schema_id = $this->context->site_url . WPSEO_Schema_IDs::ORGANIZATION_LOGO_HASH;
|
67 |
$schema_image = new WPSEO_Schema_Image( $schema_id );
|
68 |
$data['logo'] = $schema_image->generate_from_attachment_id( $this->context->company_logo_id, $this->context->company_name );
|
69 |
-
$data['image'] =
|
70 |
|
71 |
return $data;
|
72 |
}
|
@@ -81,8 +81,8 @@ class WPSEO_Schema_Organization implements WPSEO_Graph_Piece {
|
|
81 |
* @return array $profiles An array of social profiles.
|
82 |
*/
|
83 |
private function fetch_social_profiles() {
|
84 |
-
$profiles =
|
85 |
-
$social_profiles =
|
86 |
'facebook_site',
|
87 |
'instagram_url',
|
88 |
'linkedin_url',
|
@@ -90,7 +90,7 @@ class WPSEO_Schema_Organization implements WPSEO_Graph_Piece {
|
|
90 |
'youtube_url',
|
91 |
'pinterest_url',
|
92 |
'wikipedia_url',
|
93 |
-
|
94 |
foreach ( $social_profiles as $profile ) {
|
95 |
if ( WPSEO_Options::get( $profile, '' ) !== '' ) {
|
96 |
$profiles[] = WPSEO_Options::get( $profile );
|
43 |
* @return array $data The Organization schema.
|
44 |
*/
|
45 |
public function generate() {
|
46 |
+
$data = [
|
47 |
'@type' => 'Organization',
|
48 |
'@id' => $this->context->site_url . WPSEO_Schema_IDs::ORGANIZATION_HASH,
|
49 |
'name' => $this->context->company_name,
|
50 |
'url' => $this->context->site_url,
|
51 |
'sameAs' => $this->fetch_social_profiles(),
|
52 |
+
];
|
53 |
$data = $this->add_logo( $data );
|
54 |
|
55 |
return $data;
|
66 |
$schema_id = $this->context->site_url . WPSEO_Schema_IDs::ORGANIZATION_LOGO_HASH;
|
67 |
$schema_image = new WPSEO_Schema_Image( $schema_id );
|
68 |
$data['logo'] = $schema_image->generate_from_attachment_id( $this->context->company_logo_id, $this->context->company_name );
|
69 |
+
$data['image'] = [ '@id' => $schema_id ];
|
70 |
|
71 |
return $data;
|
72 |
}
|
81 |
* @return array $profiles An array of social profiles.
|
82 |
*/
|
83 |
private function fetch_social_profiles() {
|
84 |
+
$profiles = [];
|
85 |
+
$social_profiles = [
|
86 |
'facebook_site',
|
87 |
'instagram_url',
|
88 |
'linkedin_url',
|
90 |
'youtube_url',
|
91 |
'pinterest_url',
|
92 |
'wikipedia_url',
|
93 |
+
];
|
94 |
foreach ( $social_profiles as $profile ) {
|
95 |
if ( WPSEO_Options::get( $profile, '' ) !== '' ) {
|
96 |
$profiles[] = WPSEO_Options::get( $profile );
|
frontend/schema/class-schema-person.php
CHANGED
@@ -24,7 +24,7 @@ class WPSEO_Schema_Person implements WPSEO_Graph_Piece {
|
|
24 |
*
|
25 |
* @var string[]
|
26 |
*/
|
27 |
-
private $social_profiles =
|
28 |
'facebook',
|
29 |
'instagram',
|
30 |
'linkedin',
|
@@ -35,17 +35,17 @@ class WPSEO_Schema_Person implements WPSEO_Graph_Piece {
|
|
35 |
'soundcloud',
|
36 |
'tumblr',
|
37 |
'wikipedia',
|
38 |
-
|
39 |
|
40 |
/**
|
41 |
* The Schema type we use for this class.
|
42 |
*
|
43 |
* @var string[]
|
44 |
*/
|
45 |
-
protected $type =
|
46 |
'Person',
|
47 |
'Organization',
|
48 |
-
|
49 |
|
50 |
/**
|
51 |
* The hash used for images.
|
@@ -126,7 +126,7 @@ class WPSEO_Schema_Person implements WPSEO_Graph_Piece {
|
|
126 |
* key. As they are retrieved using the WordPress function `get_the_author_meta`.
|
127 |
*/
|
128 |
$social_profiles = apply_filters( 'wpseo_schema_person_social_profiles', $this->social_profiles, $user_id );
|
129 |
-
$output =
|
130 |
foreach ( $social_profiles as $profile ) {
|
131 |
$social_url = $this->url_social_site( $profile, $user_id );
|
132 |
if ( $social_url ) {
|
@@ -146,11 +146,11 @@ class WPSEO_Schema_Person implements WPSEO_Graph_Piece {
|
|
146 |
*/
|
147 |
protected function build_person_data( $user_id ) {
|
148 |
$user_data = get_userdata( $user_id );
|
149 |
-
$data =
|
150 |
'@type' => $this->type,
|
151 |
'@id' => WPSEO_Schema_Utils::get_user_schema_id( $user_id, $this->context ),
|
152 |
'name' => $user_data->display_name,
|
153 |
-
|
154 |
|
155 |
$data = $this->add_image( $data, $user_data );
|
156 |
|
@@ -183,7 +183,7 @@ class WPSEO_Schema_Person implements WPSEO_Graph_Piece {
|
|
183 |
}
|
184 |
|
185 |
if ( is_array( $this->type ) && in_array( 'Organization', $this->type ) ) {
|
186 |
-
$data['logo'] =
|
187 |
}
|
188 |
|
189 |
return $data;
|
24 |
*
|
25 |
* @var string[]
|
26 |
*/
|
27 |
+
private $social_profiles = [
|
28 |
'facebook',
|
29 |
'instagram',
|
30 |
'linkedin',
|
35 |
'soundcloud',
|
36 |
'tumblr',
|
37 |
'wikipedia',
|
38 |
+
];
|
39 |
|
40 |
/**
|
41 |
* The Schema type we use for this class.
|
42 |
*
|
43 |
* @var string[]
|
44 |
*/
|
45 |
+
protected $type = [
|
46 |
'Person',
|
47 |
'Organization',
|
48 |
+
];
|
49 |
|
50 |
/**
|
51 |
* The hash used for images.
|
126 |
* key. As they are retrieved using the WordPress function `get_the_author_meta`.
|
127 |
*/
|
128 |
$social_profiles = apply_filters( 'wpseo_schema_person_social_profiles', $this->social_profiles, $user_id );
|
129 |
+
$output = [];
|
130 |
foreach ( $social_profiles as $profile ) {
|
131 |
$social_url = $this->url_social_site( $profile, $user_id );
|
132 |
if ( $social_url ) {
|
146 |
*/
|
147 |
protected function build_person_data( $user_id ) {
|
148 |
$user_data = get_userdata( $user_id );
|
149 |
+
$data = [
|
150 |
'@type' => $this->type,
|
151 |
'@id' => WPSEO_Schema_Utils::get_user_schema_id( $user_id, $this->context ),
|
152 |
'name' => $user_data->display_name,
|
153 |
+
];
|
154 |
|
155 |
$data = $this->add_image( $data, $user_data );
|
156 |
|
183 |
}
|
184 |
|
185 |
if ( is_array( $this->type ) && in_array( 'Organization', $this->type ) ) {
|
186 |
+
$data['logo'] = [ '@id' => $schema_id ];
|
187 |
}
|
188 |
|
189 |
return $data;
|
frontend/schema/class-schema-webpage.php
CHANGED
@@ -55,16 +55,16 @@ class WPSEO_Schema_WebPage implements WPSEO_Graph_Piece {
|
|
55 |
* @return array WebPage schema data.
|
56 |
*/
|
57 |
public function generate() {
|
58 |
-
$data =
|
59 |
'@type' => $this->determine_page_type(),
|
60 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH,
|
61 |
'url' => $this->context->canonical,
|
62 |
'inLanguage' => get_bloginfo( 'language' ),
|
63 |
'name' => $this->context->title,
|
64 |
-
'isPartOf' =>
|
65 |
'@id' => $this->context->site_url . WPSEO_Schema_IDs::WEBSITE_HASH,
|
66 |
-
|
67 |
-
|
68 |
|
69 |
if ( is_front_page() ) {
|
70 |
if ( $this->context->site_represents_reference ) {
|
@@ -89,9 +89,9 @@ class WPSEO_Schema_WebPage implements WPSEO_Graph_Piece {
|
|
89 |
}
|
90 |
|
91 |
if ( $this->add_breadcrumbs() ) {
|
92 |
-
$data['breadcrumb'] =
|
93 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::BREADCRUMB_HASH,
|
94 |
-
|
95 |
}
|
96 |
|
97 |
return $data;
|
@@ -107,7 +107,7 @@ class WPSEO_Schema_WebPage implements WPSEO_Graph_Piece {
|
|
107 |
*/
|
108 |
public function add_author( $data, $post ) {
|
109 |
if ( $this->context->site_represents === false ) {
|
110 |
-
$data['author'] =
|
111 |
}
|
112 |
return $data;
|
113 |
}
|
@@ -119,7 +119,7 @@ class WPSEO_Schema_WebPage implements WPSEO_Graph_Piece {
|
|
119 |
*/
|
120 |
public function add_image( &$data ) {
|
121 |
if ( $this->context->has_image ) {
|
122 |
-
$data['primaryImageOfPage'] =
|
123 |
}
|
124 |
}
|
125 |
|
55 |
* @return array WebPage schema data.
|
56 |
*/
|
57 |
public function generate() {
|
58 |
+
$data = [
|
59 |
'@type' => $this->determine_page_type(),
|
60 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH,
|
61 |
'url' => $this->context->canonical,
|
62 |
'inLanguage' => get_bloginfo( 'language' ),
|
63 |
'name' => $this->context->title,
|
64 |
+
'isPartOf' => [
|
65 |
'@id' => $this->context->site_url . WPSEO_Schema_IDs::WEBSITE_HASH,
|
66 |
+
],
|
67 |
+
];
|
68 |
|
69 |
if ( is_front_page() ) {
|
70 |
if ( $this->context->site_represents_reference ) {
|
89 |
}
|
90 |
|
91 |
if ( $this->add_breadcrumbs() ) {
|
92 |
+
$data['breadcrumb'] = [
|
93 |
'@id' => $this->context->canonical . WPSEO_Schema_IDs::BREADCRUMB_HASH,
|
94 |
+
];
|
95 |
}
|
96 |
|
97 |
return $data;
|
107 |
*/
|
108 |
public function add_author( $data, $post ) {
|
109 |
if ( $this->context->site_represents === false ) {
|
110 |
+
$data['author'] = [ '@id' => WPSEO_Schema_Utils::get_user_schema_id( $post->post_author, $this->context ) ];
|
111 |
}
|
112 |
return $data;
|
113 |
}
|
119 |
*/
|
120 |
public function add_image( &$data ) {
|
121 |
if ( $this->context->has_image ) {
|
122 |
+
$data['primaryImageOfPage'] = [ '@id' => $this->context->canonical . WPSEO_Schema_IDs::PRIMARY_IMAGE_HASH ];
|
123 |
}
|
124 |
}
|
125 |
|
frontend/schema/class-schema-website.php
CHANGED
@@ -47,14 +47,14 @@ class WPSEO_Schema_Website implements WPSEO_Graph_Piece {
|
|
47 |
* @return array Website data blob.
|
48 |
*/
|
49 |
public function generate() {
|
50 |
-
$data =
|
51 |
'@type' => 'WebSite',
|
52 |
'@id' => $this->context->site_url . WPSEO_Schema_IDs::WEBSITE_HASH,
|
53 |
'url' => $this->context->site_url,
|
54 |
'name' => $this->context->site_name,
|
55 |
-
|
56 |
|
57 |
-
if (
|
58 |
$data['description'] = $this->context->site_description;
|
59 |
}
|
60 |
|
@@ -106,11 +106,11 @@ class WPSEO_Schema_Website implements WPSEO_Graph_Piece {
|
|
106 |
*/
|
107 |
$search_url = apply_filters( 'wpseo_json_ld_search_url', $this->context->site_url . '?s={search_term_string}' );
|
108 |
|
109 |
-
$data['potentialAction'] =
|
110 |
'@type' => 'SearchAction',
|
111 |
'target' => $search_url,
|
112 |
'query-input' => 'required name=search_term_string',
|
113 |
-
|
114 |
}
|
115 |
|
116 |
return $data;
|
47 |
* @return array Website data blob.
|
48 |
*/
|
49 |
public function generate() {
|
50 |
+
$data = [
|
51 |
'@type' => 'WebSite',
|
52 |
'@id' => $this->context->site_url . WPSEO_Schema_IDs::WEBSITE_HASH,
|
53 |
'url' => $this->context->site_url,
|
54 |
'name' => $this->context->site_name,
|
55 |
+
];
|
56 |
|
57 |
+
if ( $this->context->site_description ) {
|
58 |
$data['description'] = $this->context->site_description;
|
59 |
}
|
60 |
|
106 |
*/
|
107 |
$search_url = apply_filters( 'wpseo_json_ld_search_url', $this->context->site_url . '?s={search_term_string}' );
|
108 |
|
109 |
+
$data['potentialAction'] = [
|
110 |
'@type' => 'SearchAction',
|
111 |
'target' => $search_url,
|
112 |
'query-input' => 'required name=search_term_string',
|
113 |
+
];
|
114 |
}
|
115 |
|
116 |
return $data;
|
frontend/schema/class-schema.php
CHANGED
@@ -19,7 +19,7 @@ class WPSEO_Schema implements WPSEO_WordPress_Integration {
|
|
19 |
*
|
20 |
* @var array
|
21 |
*/
|
22 |
-
private $parsed_blocks =
|
23 |
|
24 |
/**
|
25 |
* Holds context variables about the current page and site.
|
@@ -32,11 +32,11 @@ class WPSEO_Schema implements WPSEO_WordPress_Integration {
|
|
32 |
* Registers the hooks.
|
33 |
*/
|
34 |
public function register_hooks() {
|
35 |
-
add_action( 'wpseo_head',
|
36 |
-
add_action( 'wpseo_json_ld',
|
37 |
|
38 |
// This AMP hook is only used in Reader (formerly Classic) mode.
|
39 |
-
add_action( 'amp_post_template_head',
|
40 |
}
|
41 |
|
42 |
/**
|
@@ -45,9 +45,9 @@ class WPSEO_Schema implements WPSEO_WordPress_Integration {
|
|
45 |
* @since 1.8
|
46 |
*/
|
47 |
public function json_ld() {
|
48 |
-
$deprecated_data =
|
49 |
'_deprecated' => 'Please use the "wpseo_schema_*" filters to extend the Yoast SEO schema data - see the WPSEO_Schema class.',
|
50 |
-
|
51 |
|
52 |
/**
|
53 |
* Filter: 'wpseo_json_ld_output' - Allows disabling Yoast's schema output entirely.
|
@@ -55,7 +55,7 @@ class WPSEO_Schema implements WPSEO_WordPress_Integration {
|
|
55 |
* @api mixed If false or an empty array is returned, disable our output.
|
56 |
*/
|
57 |
$return = apply_filters( 'wpseo_json_ld_output', $deprecated_data, '' );
|
58 |
-
if ( $return ===
|
59 |
return;
|
60 |
}
|
61 |
|
@@ -72,7 +72,7 @@ class WPSEO_Schema implements WPSEO_WordPress_Integration {
|
|
72 |
* @return void
|
73 |
*/
|
74 |
public function generate() {
|
75 |
-
$graph =
|
76 |
|
77 |
$this->context = new WPSEO_Schema_Context();
|
78 |
$pieces = $this->get_graph_pieces();
|
@@ -130,7 +130,7 @@ class WPSEO_Schema implements WPSEO_WordPress_Integration {
|
|
130 |
* @return array A filtered array of graph pieces.
|
131 |
*/
|
132 |
private function get_graph_pieces() {
|
133 |
-
$pieces =
|
134 |
new WPSEO_Schema_Organization( $this->context ),
|
135 |
new WPSEO_Schema_Person( $this->context ),
|
136 |
new WPSEO_Schema_Website( $this->context ),
|
@@ -141,7 +141,7 @@ class WPSEO_Schema implements WPSEO_WordPress_Integration {
|
|
141 |
new WPSEO_Schema_Author( $this->context ),
|
142 |
new WPSEO_Schema_FAQ( $this->context ),
|
143 |
new WPSEO_Schema_HowTo( $this->context ),
|
144 |
-
|
145 |
|
146 |
/**
|
147 |
* Filter: 'wpseo_schema_graph_pieces' - Allows adding pieces to the graph.
|
@@ -187,7 +187,7 @@ class WPSEO_Schema implements WPSEO_WordPress_Integration {
|
|
187 |
|
188 |
foreach ( $parsed_blocks as $block ) {
|
189 |
if ( ! isset( $this->parsed_blocks[ $block['blockName'] ] ) || ! is_array( $this->parsed_blocks[ $block['blockName'] ] ) ) {
|
190 |
-
$this->parsed_blocks[ $block['blockName'] ] =
|
191 |
}
|
192 |
$this->parsed_blocks[ $block['blockName'] ][] = $block;
|
193 |
}
|
19 |
*
|
20 |
* @var array
|
21 |
*/
|
22 |
+
private $parsed_blocks = [];
|
23 |
|
24 |
/**
|
25 |
* Holds context variables about the current page and site.
|
32 |
* Registers the hooks.
|
33 |
*/
|
34 |
public function register_hooks() {
|
35 |
+
add_action( 'wpseo_head', [ $this, 'json_ld' ], 91 );
|
36 |
+
add_action( 'wpseo_json_ld', [ $this, 'generate' ], 1 );
|
37 |
|
38 |
// This AMP hook is only used in Reader (formerly Classic) mode.
|
39 |
+
add_action( 'amp_post_template_head', [ $this, 'json_ld' ], 9 );
|
40 |
}
|
41 |
|
42 |
/**
|
45 |
* @since 1.8
|
46 |
*/
|
47 |
public function json_ld() {
|
48 |
+
$deprecated_data = [
|
49 |
'_deprecated' => 'Please use the "wpseo_schema_*" filters to extend the Yoast SEO schema data - see the WPSEO_Schema class.',
|
50 |
+
];
|
51 |
|
52 |
/**
|
53 |
* Filter: 'wpseo_json_ld_output' - Allows disabling Yoast's schema output entirely.
|
55 |
* @api mixed If false or an empty array is returned, disable our output.
|
56 |
*/
|
57 |
$return = apply_filters( 'wpseo_json_ld_output', $deprecated_data, '' );
|
58 |
+
if ( $return === [] || $return === false ) {
|
59 |
return;
|
60 |
}
|
61 |
|
72 |
* @return void
|
73 |
*/
|
74 |
public function generate() {
|
75 |
+
$graph = [];
|
76 |
|
77 |
$this->context = new WPSEO_Schema_Context();
|
78 |
$pieces = $this->get_graph_pieces();
|
130 |
* @return array A filtered array of graph pieces.
|
131 |
*/
|
132 |
private function get_graph_pieces() {
|
133 |
+
$pieces = [
|
134 |
new WPSEO_Schema_Organization( $this->context ),
|
135 |
new WPSEO_Schema_Person( $this->context ),
|
136 |
new WPSEO_Schema_Website( $this->context ),
|
141 |
new WPSEO_Schema_Author( $this->context ),
|
142 |
new WPSEO_Schema_FAQ( $this->context ),
|
143 |
new WPSEO_Schema_HowTo( $this->context ),
|
144 |
+
];
|
145 |
|
146 |
/**
|
147 |
* Filter: 'wpseo_schema_graph_pieces' - Allows adding pieces to the graph.
|
187 |
|
188 |
foreach ( $parsed_blocks as $block ) {
|
189 |
if ( ! isset( $this->parsed_blocks[ $block['blockName'] ] ) || ! is_array( $this->parsed_blocks[ $block['blockName'] ] ) ) {
|
190 |
+
$this->parsed_blocks[ $block['blockName'] ] = [];
|
191 |
}
|
192 |
$this->parsed_blocks[ $block['blockName'] ][] = $block;
|
193 |
}
|
inc/class-addon-manager.php
CHANGED
@@ -64,13 +64,13 @@ class WPSEO_Addon_Manager {
|
|
64 |
*
|
65 |
* @var array
|
66 |
*/
|
67 |
-
protected static $addons =
|
68 |
'wp-seo-premium.php' => self::PREMIUM_SLUG,
|
69 |
'wpseo-news.php' => self::NEWS_SLUG,
|
70 |
'video-seo.php' => self::VIDEO_SLUG,
|
71 |
'wpseo-woocommerce.php' => self::WOOCOMMERCE_SLUG,
|
72 |
'local-seo.php' => self::LOCAL_SLUG,
|
73 |
-
|
74 |
|
75 |
/**
|
76 |
* Holds the site information data.
|
@@ -87,8 +87,8 @@ class WPSEO_Addon_Manager {
|
|
87 |
* @return void
|
88 |
*/
|
89 |
public function register_hooks() {
|
90 |
-
add_filter( 'pre_set_site_transient_update_plugins',
|
91 |
-
add_filter( 'plugins_api',
|
92 |
}
|
93 |
|
94 |
/**
|
@@ -124,8 +124,8 @@ class WPSEO_Addon_Manager {
|
|
124 |
*/
|
125 |
public function get_subscriptions_for_active_addons() {
|
126 |
$active_addons = array_keys( $this->get_active_addons() );
|
127 |
-
$subscription_slugs = array_map(
|
128 |
-
$subscriptions =
|
129 |
foreach ( $subscription_slugs as $subscription_slug ) {
|
130 |
$subscriptions[ $subscription_slug ] = $this->get_subscription( $subscription_slug );
|
131 |
}
|
@@ -139,7 +139,7 @@ class WPSEO_Addon_Manager {
|
|
139 |
* @return array The addon versions.
|
140 |
*/
|
141 |
public function get_installed_addons_versions() {
|
142 |
-
$addon_versions =
|
143 |
foreach ( $this->get_installed_addons() as $plugin_file => $installed_addon ) {
|
144 |
$addon_versions[ $this->get_slug_by_plugin_file( $plugin_file ) ] = $installed_addon['Version'];
|
145 |
}
|
@@ -238,7 +238,7 @@ class WPSEO_Addon_Manager {
|
|
238 |
* @return stdClass The converted subscription.
|
239 |
*/
|
240 |
protected function convert_subscription_to_plugin( $subscription ) {
|
241 |
-
return (object)
|
242 |
'new_version' => $subscription->product->version,
|
243 |
'name' => $subscription->product->name,
|
244 |
'slug' => $subscription->product->slug,
|
@@ -248,10 +248,10 @@ class WPSEO_Addon_Manager {
|
|
248 |
'download_link' => $subscription->product->download,
|
249 |
'package' => $subscription->product->download,
|
250 |
'sections' =>
|
251 |
-
|
252 |
'changelog' => $subscription->product->changelog,
|
253 |
-
|
254 |
-
|
255 |
}
|
256 |
|
257 |
/**
|
@@ -295,7 +295,7 @@ class WPSEO_Addon_Manager {
|
|
295 |
* @return array The installed plugins.
|
296 |
*/
|
297 |
protected function get_installed_addons() {
|
298 |
-
return $this->filter_by_key( $this->get_plugins(),
|
299 |
}
|
300 |
|
301 |
/**
|
@@ -304,7 +304,7 @@ class WPSEO_Addon_Manager {
|
|
304 |
* @return array The active addons.
|
305 |
*/
|
306 |
protected function get_active_addons() {
|
307 |
-
return $this->filter_by_key( $this->get_installed_addons(),
|
308 |
}
|
309 |
|
310 |
/**
|
@@ -405,10 +405,10 @@ class WPSEO_Addon_Manager {
|
|
405 |
* @return stdClass Site information.
|
406 |
*/
|
407 |
protected function get_site_information_default() {
|
408 |
-
return (object)
|
409 |
'url' => WPSEO_Utils::get_home_url(),
|
410 |
-
'subscriptions' =>
|
411 |
-
|
412 |
}
|
413 |
|
414 |
/**
|
@@ -438,7 +438,7 @@ class WPSEO_Addon_Manager {
|
|
438 |
*/
|
439 |
private function filter_by_key( $array_to_filter, $callback ) {
|
440 |
$keys_to_filter = array_filter( array_keys( $array_to_filter ), $callback );
|
441 |
-
$filtered_array =
|
442 |
foreach ( $keys_to_filter as $filtered_key ) {
|
443 |
$filtered_array[ $filtered_key ] = $array_to_filter[ $filtered_key ];
|
444 |
}
|
@@ -454,10 +454,10 @@ class WPSEO_Addon_Manager {
|
|
454 |
* @return object Mapped site information.
|
455 |
*/
|
456 |
protected function map_site_information( $site_information ) {
|
457 |
-
return (object)
|
458 |
'url' => $site_information->url,
|
459 |
-
'subscriptions' => array_map(
|
460 |
-
|
461 |
}
|
462 |
|
463 |
/**
|
64 |
*
|
65 |
* @var array
|
66 |
*/
|
67 |
+
protected static $addons = [
|
68 |
'wp-seo-premium.php' => self::PREMIUM_SLUG,
|
69 |
'wpseo-news.php' => self::NEWS_SLUG,
|
70 |
'video-seo.php' => self::VIDEO_SLUG,
|
71 |
'wpseo-woocommerce.php' => self::WOOCOMMERCE_SLUG,
|
72 |
'local-seo.php' => self::LOCAL_SLUG,
|
73 |
+
];
|
74 |
|
75 |
/**
|
76 |
* Holds the site information data.
|
87 |
* @return void
|
88 |
*/
|
89 |
public function register_hooks() {
|
90 |
+
add_filter( 'pre_set_site_transient_update_plugins', [ $this, 'check_for_updates' ] );
|
91 |
+
add_filter( 'plugins_api', [ $this, 'get_plugin_information' ], 10, 3 );
|
92 |
}
|
93 |
|
94 |
/**
|
124 |
*/
|
125 |
public function get_subscriptions_for_active_addons() {
|
126 |
$active_addons = array_keys( $this->get_active_addons() );
|
127 |
+
$subscription_slugs = array_map( [ $this, 'get_slug_by_plugin_file' ], $active_addons );
|
128 |
+
$subscriptions = [];
|
129 |
foreach ( $subscription_slugs as $subscription_slug ) {
|
130 |
$subscriptions[ $subscription_slug ] = $this->get_subscription( $subscription_slug );
|
131 |
}
|
139 |
* @return array The addon versions.
|
140 |
*/
|
141 |
public function get_installed_addons_versions() {
|
142 |
+
$addon_versions = [];
|
143 |
foreach ( $this->get_installed_addons() as $plugin_file => $installed_addon ) {
|
144 |
$addon_versions[ $this->get_slug_by_plugin_file( $plugin_file ) ] = $installed_addon['Version'];
|
145 |
}
|
238 |
* @return stdClass The converted subscription.
|
239 |
*/
|
240 |
protected function convert_subscription_to_plugin( $subscription ) {
|
241 |
+
return (object) [
|
242 |
'new_version' => $subscription->product->version,
|
243 |
'name' => $subscription->product->name,
|
244 |
'slug' => $subscription->product->slug,
|
248 |
'download_link' => $subscription->product->download,
|
249 |
'package' => $subscription->product->download,
|
250 |
'sections' =>
|
251 |
+
[
|
252 |
'changelog' => $subscription->product->changelog,
|
253 |
+
],
|
254 |
+
];
|
255 |
}
|
256 |
|
257 |
/**
|
295 |
* @return array The installed plugins.
|
296 |
*/
|
297 |
protected function get_installed_addons() {
|
298 |
+
return $this->filter_by_key( $this->get_plugins(), [ $this, 'is_yoast_addon' ] );
|
299 |
}
|
300 |
|
301 |
/**
|
304 |
* @return array The active addons.
|
305 |
*/
|
306 |
protected function get_active_addons() {
|
307 |
+
return $this->filter_by_key( $this->get_installed_addons(), [ $this, 'is_plugin_active' ] );
|
308 |
}
|
309 |
|
310 |
/**
|
405 |
* @return stdClass Site information.
|
406 |
*/
|
407 |
protected function get_site_information_default() {
|
408 |
+
return (object) [
|
409 |
'url' => WPSEO_Utils::get_home_url(),
|
410 |
+
'subscriptions' => [],
|
411 |
+
];
|
412 |
}
|
413 |
|
414 |
/**
|
438 |
*/
|
439 |
private function filter_by_key( $array_to_filter, $callback ) {
|
440 |
$keys_to_filter = array_filter( array_keys( $array_to_filter ), $callback );
|
441 |
+
$filtered_array = [];
|
442 |
foreach ( $keys_to_filter as $filtered_key ) {
|
443 |
$filtered_array[ $filtered_key ] = $array_to_filter[ $filtered_key ];
|
444 |
}
|
454 |
* @return object Mapped site information.
|
455 |
*/
|
456 |
protected function map_site_information( $site_information ) {
|
457 |
+
return (object) [
|
458 |
'url' => $site_information->url,
|
459 |
+
'subscriptions' => array_map( [ $this, 'map_subscription' ], $site_information->subscriptions ),
|
460 |
+
];
|
461 |
}
|
462 |
|
463 |
/**
|
inc/class-my-yoast-api-request.php
CHANGED
@@ -22,13 +22,13 @@ class WPSEO_MyYoast_Api_Request {
|
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
-
protected $args =
|
26 |
'method' => 'GET',
|
27 |
'timeout' => 5,
|
28 |
-
'headers' =>
|
29 |
'Accept-Encoding' => '*',
|
30 |
-
|
31 |
-
|
32 |
|
33 |
/**
|
34 |
* Contains the fetched response.
|
@@ -59,7 +59,7 @@ class WPSEO_MyYoast_Api_Request {
|
|
59 |
* @param string $url The request url.
|
60 |
* @param array $args The request arguments.
|
61 |
*/
|
62 |
-
public function __construct( $url, array $args =
|
63 |
$this->url = 'https://my.yoast.com/api/' . $url;
|
64 |
$this->args = wp_parse_args( $args, $this->args );
|
65 |
}
|
@@ -200,7 +200,7 @@ class WPSEO_MyYoast_Api_Request {
|
|
200 |
* @return array The enriched arguments.
|
201 |
*/
|
202 |
protected function enrich_request_arguments( array $request_arguments ) {
|
203 |
-
$request_arguments = wp_parse_args( $request_arguments,
|
204 |
$addon_version_headers = $this->get_installed_addon_versions();
|
205 |
|
206 |
foreach ( $addon_version_headers as $addon => $version ) {
|
@@ -208,7 +208,7 @@ class WPSEO_MyYoast_Api_Request {
|
|
208 |
}
|
209 |
|
210 |
$request_body = $this->get_request_body();
|
211 |
-
if ( $request_body !==
|
212 |
$request_arguments['body'] = $request_body;
|
213 |
}
|
214 |
|
@@ -224,13 +224,13 @@ class WPSEO_MyYoast_Api_Request {
|
|
224 |
*/
|
225 |
public function get_request_body() {
|
226 |
if ( ! $this->has_oauth_support() ) {
|
227 |
-
return
|
228 |
}
|
229 |
|
230 |
try {
|
231 |
$access_token = $this->get_access_token();
|
232 |
if ( $access_token ) {
|
233 |
-
return
|
234 |
}
|
235 |
}
|
236 |
// @codingStandardsIgnoreLine Generic.CodeAnalysis.EmptyStatement.DetectedCATCH -- There is nothing to do.
|
@@ -238,7 +238,7 @@ class WPSEO_MyYoast_Api_Request {
|
|
238 |
// Do nothing.
|
239 |
}
|
240 |
|
241 |
-
return
|
242 |
}
|
243 |
|
244 |
/**
|
@@ -271,9 +271,9 @@ class WPSEO_MyYoast_Api_Request {
|
|
271 |
->get_provider()
|
272 |
->getAccessToken(
|
273 |
'refresh_token',
|
274 |
-
|
275 |
'refresh_token' => $access_token->getRefreshToken(),
|
276 |
-
|
277 |
);
|
278 |
|
279 |
$client->save_access_token( $this->get_current_user_id(), $access_token );
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
+
protected $args = [
|
26 |
'method' => 'GET',
|
27 |
'timeout' => 5,
|
28 |
+
'headers' => [
|
29 |
'Accept-Encoding' => '*',
|
30 |
+
],
|
31 |
+
];
|
32 |
|
33 |
/**
|
34 |
* Contains the fetched response.
|
59 |
* @param string $url The request url.
|
60 |
* @param array $args The request arguments.
|
61 |
*/
|
62 |
+
public function __construct( $url, array $args = [] ) {
|
63 |
$this->url = 'https://my.yoast.com/api/' . $url;
|
64 |
$this->args = wp_parse_args( $args, $this->args );
|
65 |
}
|
200 |
* @return array The enriched arguments.
|
201 |
*/
|
202 |
protected function enrich_request_arguments( array $request_arguments ) {
|
203 |
+
$request_arguments = wp_parse_args( $request_arguments, [ 'headers' => [] ] );
|
204 |
$addon_version_headers = $this->get_installed_addon_versions();
|
205 |
|
206 |
foreach ( $addon_version_headers as $addon => $version ) {
|
208 |
}
|
209 |
|
210 |
$request_body = $this->get_request_body();
|
211 |
+
if ( $request_body !== [] ) {
|
212 |
$request_arguments['body'] = $request_body;
|
213 |
}
|
214 |
|
224 |
*/
|
225 |
public function get_request_body() {
|
226 |
if ( ! $this->has_oauth_support() ) {
|
227 |
+
return [ 'url' => WPSEO_Utils::get_home_url() ];
|
228 |
}
|
229 |
|
230 |
try {
|
231 |
$access_token = $this->get_access_token();
|
232 |
if ( $access_token ) {
|
233 |
+
return [ 'token' => $access_token->getToken() ];
|
234 |
}
|
235 |
}
|
236 |
// @codingStandardsIgnoreLine Generic.CodeAnalysis.EmptyStatement.DetectedCATCH -- There is nothing to do.
|
238 |
// Do nothing.
|
239 |
}
|
240 |
|
241 |
+
return [];
|
242 |
}
|
243 |
|
244 |
/**
|
271 |
->get_provider()
|
272 |
->getAccessToken(
|
273 |
'refresh_token',
|
274 |
+
[
|
275 |
'refresh_token' => $access_token->getRefreshToken(),
|
276 |
+
]
|
277 |
);
|
278 |
|
279 |
$client->save_access_token( $this->get_current_user_id(), $access_token );
|
inc/class-post-type.php
CHANGED
@@ -18,7 +18,7 @@ class WPSEO_Post_Type {
|
|
18 |
* @return array Array with all the accessible post_types.
|
19 |
*/
|
20 |
public static function get_accessible_post_types() {
|
21 |
-
$post_types = get_post_types(
|
22 |
$post_types = array_filter( $post_types, 'is_post_type_viewable' );
|
23 |
|
24 |
/**
|
@@ -30,7 +30,7 @@ class WPSEO_Post_Type {
|
|
30 |
|
31 |
// When the array gets messed up somewhere.
|
32 |
if ( ! is_array( $post_types ) ) {
|
33 |
-
return
|
34 |
}
|
35 |
|
36 |
return $post_types;
|
18 |
* @return array Array with all the accessible post_types.
|
19 |
*/
|
20 |
public static function get_accessible_post_types() {
|
21 |
+
$post_types = get_post_types( [ 'public' => true ] );
|
22 |
$post_types = array_filter( $post_types, 'is_post_type_viewable' );
|
23 |
|
24 |
/**
|
30 |
|
31 |
// When the array gets messed up somewhere.
|
32 |
if ( ! is_array( $post_types ) ) {
|
33 |
+
return [];
|
34 |
}
|
35 |
|
36 |
return $post_types;
|
inc/class-rewrite.php
CHANGED
@@ -14,16 +14,16 @@ class WPSEO_Rewrite {
|
|
14 |
* Class constructor.
|
15 |
*/
|
16 |
public function __construct() {
|
17 |
-
add_filter( 'query_vars',
|
18 |
-
add_filter( 'category_link',
|
19 |
-
add_filter( 'request',
|
20 |
-
add_filter( 'category_rewrite_rules',
|
21 |
|
22 |
-
add_action( 'created_category',
|
23 |
-
add_action( 'edited_category',
|
24 |
-
add_action( 'delete_category',
|
25 |
|
26 |
-
add_action( 'init',
|
27 |
}
|
28 |
|
29 |
/**
|
@@ -119,7 +119,7 @@ class WPSEO_Rewrite {
|
|
119 |
public function category_rewrite_rules() {
|
120 |
global $wp_rewrite;
|
121 |
|
122 |
-
$category_rewrite =
|
123 |
|
124 |
$taxonomy = get_taxonomy( 'category' );
|
125 |
$permalink_structure = get_option( 'permalink_structure' );
|
@@ -129,8 +129,8 @@ class WPSEO_Rewrite {
|
|
129 |
$blog_prefix = 'blog/';
|
130 |
}
|
131 |
|
132 |
-
$categories = get_categories(
|
133 |
-
if ( is_array( $categories ) && $categories !==
|
134 |
foreach ( $categories as $category ) {
|
135 |
$category_nicename = $category->slug;
|
136 |
if ( $category->parent == $category->cat_ID ) {
|
@@ -201,7 +201,7 @@ class WPSEO_Rewrite {
|
|
201 |
}
|
202 |
|
203 |
$names = explode( '/', $name );
|
204 |
-
$names = array_map(
|
205 |
|
206 |
return implode( '/', $names );
|
207 |
}
|
14 |
* Class constructor.
|
15 |
*/
|
16 |
public function __construct() {
|
17 |
+
add_filter( 'query_vars', [ $this, 'query_vars' ] );
|
18 |
+
add_filter( 'category_link', [ $this, 'no_category_base' ] );
|
19 |
+
add_filter( 'request', [ $this, 'request' ] );
|
20 |
+
add_filter( 'category_rewrite_rules', [ $this, 'category_rewrite_rules' ] );
|
21 |
|
22 |
+
add_action( 'created_category', [ $this, 'schedule_flush' ] );
|
23 |
+
add_action( 'edited_category', [ $this, 'schedule_flush' ] );
|
24 |
+
add_action( 'delete_category', [ $this, 'schedule_flush' ] );
|
25 |
|
26 |
+
add_action( 'init', [ $this, 'flush' ], 999 );
|
27 |
}
|
28 |
|
29 |
/**
|
119 |
public function category_rewrite_rules() {
|
120 |
global $wp_rewrite;
|
121 |
|
122 |
+
$category_rewrite = [];
|
123 |
|
124 |
$taxonomy = get_taxonomy( 'category' );
|
125 |
$permalink_structure = get_option( 'permalink_structure' );
|
129 |
$blog_prefix = 'blog/';
|
130 |
}
|
131 |
|
132 |
+
$categories = get_categories( [ 'hide_empty' => false ] );
|
133 |
+
if ( is_array( $categories ) && $categories !== [] ) {
|
134 |
foreach ( $categories as $category ) {
|
135 |
$category_nicename = $category->slug;
|
136 |
if ( $category->parent == $category->cat_ID ) {
|
201 |
}
|
202 |
|
203 |
$names = explode( '/', $name );
|
204 |
+
$names = array_map( [ $this, 'encode_to_upper' ], $names );
|
205 |
|
206 |
return implode( '/', $names );
|
207 |
}
|
inc/class-structured-data-blocks.php
CHANGED
@@ -21,8 +21,8 @@ class WPSEO_Structured_Data_Blocks implements WPSEO_WordPress_Integration {
|
|
21 |
* Registers hooks for Structured Data Blocks with WordPress.
|
22 |
*/
|
23 |
public function register_hooks() {
|
24 |
-
add_action( 'enqueue_block_editor_assets',
|
25 |
-
add_filter( 'block_categories',
|
26 |
}
|
27 |
|
28 |
/**
|
@@ -66,14 +66,14 @@ class WPSEO_Structured_Data_Blocks implements WPSEO_WordPress_Integration {
|
|
66 |
*/
|
67 |
public function add_block_category( $categories ) {
|
68 |
if ( $this->check_enabled() ) {
|
69 |
-
$categories[] =
|
70 |
'slug' => 'yoast-structured-data-blocks',
|
71 |
'title' => sprintf(
|
72 |
/* translators: %1$s expands to Yoast. */
|
73 |
__( '%1$s Structured Data Blocks', 'wordpress-seo' ),
|
74 |
'Yoast'
|
75 |
),
|
76 |
-
|
77 |
}
|
78 |
|
79 |
return $categories;
|
21 |
* Registers hooks for Structured Data Blocks with WordPress.
|
22 |
*/
|
23 |
public function register_hooks() {
|
24 |
+
add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_block_editor_assets' ] );
|
25 |
+
add_filter( 'block_categories', [ $this, 'add_block_category' ] );
|
26 |
}
|
27 |
|
28 |
/**
|
66 |
*/
|
67 |
public function add_block_category( $categories ) {
|
68 |
if ( $this->check_enabled() ) {
|
69 |
+
$categories[] = [
|
70 |
'slug' => 'yoast-structured-data-blocks',
|
71 |
'title' => sprintf(
|
72 |
/* translators: %1$s expands to Yoast. */
|
73 |
__( '%1$s Structured Data Blocks', 'wordpress-seo' ),
|
74 |
'Yoast'
|
75 |
),
|
76 |
+
];
|
77 |
}
|
78 |
|
79 |
return $categories;
|
inc/class-upgrade-history.php
CHANGED
@@ -36,9 +36,9 @@ class WPSEO_Upgrade_History {
|
|
36 |
* @return array The contents of the history option.
|
37 |
*/
|
38 |
public function get() {
|
39 |
-
$data = get_option( $this->get_option_name(),
|
40 |
if ( ! is_array( $data ) ) {
|
41 |
-
return
|
42 |
}
|
43 |
|
44 |
return $data;
|
@@ -52,8 +52,8 @@ class WPSEO_Upgrade_History {
|
|
52 |
* @param array $option_names The options that need to be stored.
|
53 |
*/
|
54 |
public function add( $old_version, $new_version, array $option_names ) {
|
55 |
-
$option_data =
|
56 |
-
if (
|
57 |
$option_data = $this->get_options_data( $option_names );
|
58 |
}
|
59 |
|
@@ -61,11 +61,11 @@ class WPSEO_Upgrade_History {
|
|
61 |
$data = $this->get();
|
62 |
|
63 |
// Add new entry.
|
64 |
-
$data[ time() ] =
|
65 |
'options' => $option_data,
|
66 |
'old_version' => $old_version,
|
67 |
'new_version' => $new_version,
|
68 |
-
|
69 |
|
70 |
// Store the data.
|
71 |
$this->set( $data );
|
@@ -91,7 +91,7 @@ class WPSEO_Upgrade_History {
|
|
91 |
|
92 |
$results = $wpdb->get_results( $sql, ARRAY_A );
|
93 |
|
94 |
-
$data =
|
95 |
foreach ( $results as $result ) {
|
96 |
$data[ $result['option_name'] ] = maybe_unserialize( $result['option_value'] );
|
97 |
}
|
36 |
* @return array The contents of the history option.
|
37 |
*/
|
38 |
public function get() {
|
39 |
+
$data = get_option( $this->get_option_name(), [] );
|
40 |
if ( ! is_array( $data ) ) {
|
41 |
+
return [];
|
42 |
}
|
43 |
|
44 |
return $data;
|
52 |
* @param array $option_names The options that need to be stored.
|
53 |
*/
|
54 |
public function add( $old_version, $new_version, array $option_names ) {
|
55 |
+
$option_data = [];
|
56 |
+
if ( [] !== $option_names ) {
|
57 |
$option_data = $this->get_options_data( $option_names );
|
58 |
}
|
59 |
|
61 |
$data = $this->get();
|
62 |
|
63 |
// Add new entry.
|
64 |
+
$data[ time() ] = [
|
65 |
'options' => $option_data,
|
66 |
'old_version' => $old_version,
|
67 |
'new_version' => $new_version,
|
68 |
+
];
|
69 |
|
70 |
// Store the data.
|
71 |
$this->set( $data );
|
91 |
|
92 |
$results = $wpdb->get_results( $sql, ARRAY_A );
|
93 |
|
94 |
+
$data = [];
|
95 |
foreach ( $results as $result ) {
|
96 |
$data[ $result['option_name'] ] = maybe_unserialize( $result['option_value'] );
|
97 |
}
|
inc/class-upgrade.php
CHANGED
@@ -18,132 +18,42 @@ class WPSEO_Upgrade {
|
|
18 |
|
19 |
WPSEO_Options::maybe_set_multisite_defaults( false );
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
$this->upgrade_36();
|
51 |
-
}
|
52 |
-
|
53 |
-
if ( version_compare( $version, '4.0', '<' ) ) {
|
54 |
-
$this->upgrade_40();
|
55 |
-
}
|
56 |
-
|
57 |
-
if ( version_compare( $version, '4.4', '<' ) ) {
|
58 |
-
$this->upgrade_44();
|
59 |
-
}
|
60 |
-
|
61 |
-
if ( version_compare( $version, '4.7', '<' ) ) {
|
62 |
-
$this->upgrade_47();
|
63 |
-
}
|
64 |
-
|
65 |
-
if ( version_compare( $version, '4.9', '<' ) ) {
|
66 |
-
$this->upgrade_49();
|
67 |
-
}
|
68 |
-
|
69 |
-
if ( version_compare( $version, '5.0', '<' ) ) {
|
70 |
-
$this->upgrade_50();
|
71 |
-
}
|
72 |
-
|
73 |
-
if ( version_compare( $version, '5.0', '>=' )
|
74 |
-
&& version_compare( $version, '5.1', '<' )
|
75 |
-
) {
|
76 |
-
$this->upgrade_50_51();
|
77 |
-
}
|
78 |
-
|
79 |
-
if ( version_compare( $version, '5.5', '<' ) ) {
|
80 |
-
$this->upgrade_55();
|
81 |
-
}
|
82 |
-
|
83 |
-
if ( version_compare( $version, '5.6', '<' ) ) {
|
84 |
-
$this->upgrade_56();
|
85 |
-
}
|
86 |
-
|
87 |
-
if ( version_compare( $version, '6.1', '<' ) ) {
|
88 |
-
$this->upgrade_61();
|
89 |
-
}
|
90 |
-
|
91 |
-
if ( version_compare( $version, '6.3', '<' ) ) {
|
92 |
-
$this->upgrade_63();
|
93 |
-
}
|
94 |
-
|
95 |
-
if ( version_compare( $version, '7.0-RC0', '<' ) ) {
|
96 |
-
$this->upgrade_70();
|
97 |
-
}
|
98 |
-
|
99 |
-
if ( version_compare( $version, '7.1-RC0', '<' ) ) {
|
100 |
-
$this->upgrade_71();
|
101 |
-
}
|
102 |
-
|
103 |
-
if ( version_compare( $version, '7.3-RC0', '<' ) ) {
|
104 |
-
$this->upgrade_73();
|
105 |
-
}
|
106 |
-
|
107 |
-
if ( version_compare( $version, '7.4-RC0', '<' ) ) {
|
108 |
-
$this->upgrade_74();
|
109 |
-
}
|
110 |
-
|
111 |
-
if ( version_compare( $version, '7.5.3', '<' ) ) {
|
112 |
-
$this->upgrade_753();
|
113 |
-
}
|
114 |
-
|
115 |
-
if ( version_compare( $version, '7.7-RC0', '<' ) ) {
|
116 |
-
$this->upgrade_77();
|
117 |
-
}
|
118 |
-
|
119 |
-
if ( version_compare( $version, '7.7.2-RC0', '<' ) ) {
|
120 |
-
$this->upgrade_772();
|
121 |
-
}
|
122 |
-
|
123 |
-
if ( version_compare( $version, '9.0-RC0', '<' ) ) {
|
124 |
-
$this->upgrade90();
|
125 |
-
}
|
126 |
-
|
127 |
-
if ( version_compare( $version, '10.0-RC0', '<' ) ) {
|
128 |
-
$this->upgrade_100();
|
129 |
-
}
|
130 |
-
|
131 |
-
if ( version_compare( $version, '11.1-RC0', '<' ) ) {
|
132 |
-
$this->upgrade_111();
|
133 |
-
}
|
134 |
-
|
135 |
-
if ( version_compare( $version, '12.1-RC0', '<' ) ) {
|
136 |
/** Reset notifications because we removed the AMP Glue plugin notification */
|
137 |
-
|
138 |
-
|
|
|
|
|
139 |
|
140 |
-
|
141 |
-
$this->upgrade_123();
|
142 |
-
}
|
143 |
-
|
144 |
-
if ( version_compare( $version, '12.4-RC0', '<' ) ) {
|
145 |
-
$this->upgrade_124();
|
146 |
-
}
|
147 |
|
148 |
if ( version_compare( $version, '12.5-RC0', '<' ) ) {
|
149 |
/*
|
@@ -151,7 +61,7 @@ class WPSEO_Upgrade {
|
|
151 |
* - the theme support check isn't available.
|
152 |
* - the notification center notifications are not filled yet.
|
153 |
*/
|
154 |
-
add_action( 'init',
|
155 |
}
|
156 |
|
157 |
// Since 3.7.
|
@@ -161,13 +71,28 @@ class WPSEO_Upgrade {
|
|
161 |
/**
|
162 |
* Filter: 'wpseo_run_upgrade' - Runs the upgrade hook which are dependent on Yoast SEO.
|
163 |
*
|
164 |
-
* @api
|
165 |
*/
|
166 |
do_action( 'wpseo_run_upgrade', $version );
|
167 |
|
168 |
$this->finish_up();
|
169 |
}
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
/**
|
172 |
* Adds a new upgrade history entry.
|
173 |
*
|
@@ -227,7 +152,7 @@ class WPSEO_Upgrade {
|
|
227 |
* Detects if taxonomy terms were split and updates the corresponding taxonomy meta's accordingly.
|
228 |
*/
|
229 |
private function upgrade_21() {
|
230 |
-
$taxonomies = get_option( 'wpseo_taxonomy_meta',
|
231 |
|
232 |
if ( ! empty( $taxonomies ) ) {
|
233 |
foreach ( $taxonomies as $taxonomy => $tax_metas ) {
|
@@ -260,8 +185,8 @@ class WPSEO_Upgrade {
|
|
260 |
* Schedules upgrade function to Yoast SEO 2.3.
|
261 |
*/
|
262 |
private function upgrade_23() {
|
263 |
-
add_action( 'wp',
|
264 |
-
add_action( 'admin_head',
|
265 |
}
|
266 |
|
267 |
/**
|
@@ -273,7 +198,7 @@ class WPSEO_Upgrade {
|
|
273 |
if ( ! empty( $wp_query->posts ) ) {
|
274 |
$options = get_option( 'wpseo_xml' );
|
275 |
|
276 |
-
$excluded_posts =
|
277 |
if ( $options['excluded-posts'] !== '' ) {
|
278 |
$excluded_posts = explode( ',', $options['excluded-posts'] );
|
279 |
}
|
@@ -369,7 +294,7 @@ class WPSEO_Upgrade {
|
|
369 |
* notifications on shutdown. This causes the returning notification. By adding this filter the shutdown
|
370 |
* routine on the notification center will remove the notification.
|
371 |
*/
|
372 |
-
add_filter( 'yoast_notifications_before_storage',
|
373 |
|
374 |
$meta_key = $wpdb->get_blog_prefix() . Yoast_Notification_Center::STORAGE_KEY;
|
375 |
|
@@ -439,12 +364,16 @@ class WPSEO_Upgrade {
|
|
439 |
|
440 |
/**
|
441 |
* Updates the internal_link_count column to support improved functionality.
|
|
|
|
|
442 |
*/
|
443 |
-
private function upgrade_50_51() {
|
444 |
global $wpdb;
|
445 |
|
446 |
-
$
|
447 |
-
|
|
|
|
|
448 |
}
|
449 |
|
450 |
/**
|
@@ -663,7 +592,7 @@ class WPSEO_Upgrade {
|
|
663 |
*
|
664 |
* @return void
|
665 |
*/
|
666 |
-
private function
|
667 |
global $wpdb;
|
668 |
|
669 |
// Invalidate all sitemap cache transients.
|
@@ -698,7 +627,7 @@ class WPSEO_Upgrade {
|
|
698 |
// Set company_or_person to company when it's an invalid value.
|
699 |
$company_or_person = WPSEO_Options::get( 'company_or_person', '' );
|
700 |
|
701 |
-
if ( ! in_array( $company_or_person,
|
702 |
WPSEO_Options::set( 'company_or_person', 'company' );
|
703 |
}
|
704 |
}
|
@@ -709,14 +638,14 @@ class WPSEO_Upgrade {
|
|
709 |
* Removes the about notice when its still in the database.
|
710 |
*/
|
711 |
private function upgrade_123() {
|
712 |
-
$plugins =
|
713 |
'yoast-seo-premium',
|
714 |
'video-seo-for-wordpress-seo-by-yoast',
|
715 |
'yoast-news-seo',
|
716 |
'local-seo-for-yoast-seo',
|
717 |
'yoast-woocommerce-seo',
|
718 |
'yoast-acf-analysis',
|
719 |
-
|
720 |
|
721 |
$center = Yoast_Notification_Center::get();
|
722 |
foreach ( $plugins as $plugin ) {
|
@@ -769,7 +698,7 @@ class WPSEO_Upgrade {
|
|
769 |
*/
|
770 |
private function delete_post_meta( $meta_key ) {
|
771 |
global $wpdb;
|
772 |
-
$deleted = $wpdb->delete( $wpdb->postmeta,
|
773 |
|
774 |
if ( $deleted ) {
|
775 |
wp_cache_set( 'last_changed', microtime(), 'posts' );
|
@@ -807,7 +736,7 @@ class WPSEO_Upgrade {
|
|
807 |
return maybe_unserialize( $results[0]['option_value'] );
|
808 |
}
|
809 |
|
810 |
-
return
|
811 |
}
|
812 |
|
813 |
/**
|
@@ -818,8 +747,8 @@ class WPSEO_Upgrade {
|
|
818 |
* @return void
|
819 |
*/
|
820 |
protected function cleanup_option_data( $option_name ) {
|
821 |
-
$data = get_option( $option_name,
|
822 |
-
if ( ! is_array( $data ) || $data ===
|
823 |
return;
|
824 |
}
|
825 |
|
18 |
|
19 |
WPSEO_Options::maybe_set_multisite_defaults( false );
|
20 |
|
21 |
+
$routines = [
|
22 |
+
'1.5.0' => 'upgrade_15',
|
23 |
+
'2.0' => 'upgrade_20',
|
24 |
+
'2.1' => 'upgrade_21',
|
25 |
+
'2.2' => 'upgrade_22',
|
26 |
+
'2.3' => 'upgrade_23',
|
27 |
+
'3.0' => 'upgrade_30',
|
28 |
+
'3.3' => 'upgrade_33',
|
29 |
+
'3.6' => 'upgrade_36',
|
30 |
+
'4.0' => 'upgrade_40',
|
31 |
+
'4.4' => 'upgrade_44',
|
32 |
+
'4.7' => 'upgrade_47',
|
33 |
+
'4.9' => 'upgrade_49',
|
34 |
+
'5.0' => 'upgrade_50',
|
35 |
+
'5.1' => 'upgrade_50_51',
|
36 |
+
'5.5' => 'upgrade_55',
|
37 |
+
'5.6' => 'upgrade_56',
|
38 |
+
'6.1' => 'upgrade_61',
|
39 |
+
'6.3' => 'upgrade_63',
|
40 |
+
'7.0-RC0' => 'upgrade_70',
|
41 |
+
'7.1-RC0' => 'upgrade_71',
|
42 |
+
'7.3-RC0' => 'upgrade_73',
|
43 |
+
'7.4-RC0' => 'upgrade_74',
|
44 |
+
'7.5.3' => 'upgrade_753',
|
45 |
+
'7.7-RC0' => 'upgrade_77',
|
46 |
+
'7.7.2-RC0' => 'upgrade_772',
|
47 |
+
'9.0-RC0' => 'upgrade_90',
|
48 |
+
'10.0-RC0' => 'upgrade_100',
|
49 |
+
'11.1-RC0' => 'upgrade_111',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
/** Reset notifications because we removed the AMP Glue plugin notification */
|
51 |
+
'12.1-RC0' => 'clean_all_notifications',
|
52 |
+
'12.3-RC0' => 'upgrade_123',
|
53 |
+
'12.4-RC0' => 'upgrade_124',
|
54 |
+
];
|
55 |
|
56 |
+
array_walk( $routines, [ $this, 'run_upgrade_routine' ], $version );
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
if ( version_compare( $version, '12.5-RC0', '<' ) ) {
|
59 |
/*
|
61 |
* - the theme support check isn't available.
|
62 |
* - the notification center notifications are not filled yet.
|
63 |
*/
|
64 |
+
add_action( 'init', [ $this, 'upgrade_125' ] );
|
65 |
}
|
66 |
|
67 |
// Since 3.7.
|
71 |
/**
|
72 |
* Filter: 'wpseo_run_upgrade' - Runs the upgrade hook which are dependent on Yoast SEO.
|
73 |
*
|
74 |
+
* @api string - The current version of Yoast SEO
|
75 |
*/
|
76 |
do_action( 'wpseo_run_upgrade', $version );
|
77 |
|
78 |
$this->finish_up();
|
79 |
}
|
80 |
|
81 |
+
/**
|
82 |
+
* Runs the upgrade routine.
|
83 |
+
*
|
84 |
+
* @param string $routine The method to call.
|
85 |
+
* @param string $version The new version.
|
86 |
+
* @param string $current_version The current set version.
|
87 |
+
*
|
88 |
+
* @return void
|
89 |
+
*/
|
90 |
+
protected function run_upgrade_routine( $routine, $version, $current_version ) {
|
91 |
+
if ( version_compare( $current_version, $version, '<' ) ) {
|
92 |
+
$this->$routine( $current_version );
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
/**
|
97 |
* Adds a new upgrade history entry.
|
98 |
*
|
152 |
* Detects if taxonomy terms were split and updates the corresponding taxonomy meta's accordingly.
|
153 |
*/
|
154 |
private function upgrade_21() {
|
155 |
+
$taxonomies = get_option( 'wpseo_taxonomy_meta', [] );
|
156 |
|
157 |
if ( ! empty( $taxonomies ) ) {
|
158 |
foreach ( $taxonomies as $taxonomy => $tax_metas ) {
|
185 |
* Schedules upgrade function to Yoast SEO 2.3.
|
186 |
*/
|
187 |
private function upgrade_23() {
|
188 |
+
add_action( 'wp', [ $this, 'upgrade_23_query' ], 90 );
|
189 |
+
add_action( 'admin_head', [ $this, 'upgrade_23_query' ], 90 );
|
190 |
}
|
191 |
|
192 |
/**
|
198 |
if ( ! empty( $wp_query->posts ) ) {
|
199 |
$options = get_option( 'wpseo_xml' );
|
200 |
|
201 |
+
$excluded_posts = [];
|
202 |
if ( $options['excluded-posts'] !== '' ) {
|
203 |
$excluded_posts = explode( ',', $options['excluded-posts'] );
|
204 |
}
|
294 |
* notifications on shutdown. This causes the returning notification. By adding this filter the shutdown
|
295 |
* routine on the notification center will remove the notification.
|
296 |
*/
|
297 |
+
add_filter( 'yoast_notifications_before_storage', [ $this, 'remove_about_notice' ] );
|
298 |
|
299 |
$meta_key = $wpdb->get_blog_prefix() . Yoast_Notification_Center::STORAGE_KEY;
|
300 |
|
364 |
|
365 |
/**
|
366 |
* Updates the internal_link_count column to support improved functionality.
|
367 |
+
*
|
368 |
+
* @param string $version The current version to compare with.
|
369 |
*/
|
370 |
+
private function upgrade_50_51( $version ) {
|
371 |
global $wpdb;
|
372 |
|
373 |
+
if ( version_compare( $version, '5.0', '>=' ) ) {
|
374 |
+
$count_storage = new WPSEO_Meta_Storage();
|
375 |
+
$wpdb->query( 'ALTER TABLE ' . $count_storage->get_table_name() . ' MODIFY internal_link_count int(10) UNSIGNED NULL DEFAULT NULL' );
|
376 |
+
}
|
377 |
}
|
378 |
|
379 |
/**
|
592 |
*
|
593 |
* @return void
|
594 |
*/
|
595 |
+
private function upgrade_90() {
|
596 |
global $wpdb;
|
597 |
|
598 |
// Invalidate all sitemap cache transients.
|
627 |
// Set company_or_person to company when it's an invalid value.
|
628 |
$company_or_person = WPSEO_Options::get( 'company_or_person', '' );
|
629 |
|
630 |
+
if ( ! in_array( $company_or_person, [ 'company', 'person' ], true ) ) {
|
631 |
WPSEO_Options::set( 'company_or_person', 'company' );
|
632 |
}
|
633 |
}
|
638 |
* Removes the about notice when its still in the database.
|
639 |
*/
|
640 |
private function upgrade_123() {
|
641 |
+
$plugins = [
|
642 |
'yoast-seo-premium',
|
643 |
'video-seo-for-wordpress-seo-by-yoast',
|
644 |
'yoast-news-seo',
|
645 |
'local-seo-for-yoast-seo',
|
646 |
'yoast-woocommerce-seo',
|
647 |
'yoast-acf-analysis',
|
648 |
+
];
|
649 |
|
650 |
$center = Yoast_Notification_Center::get();
|
651 |
foreach ( $plugins as $plugin ) {
|
698 |
*/
|
699 |
private function delete_post_meta( $meta_key ) {
|
700 |
global $wpdb;
|
701 |
+
$deleted = $wpdb->delete( $wpdb->postmeta, [ 'meta_key' => $meta_key ], [ '%s' ] );
|
702 |
|
703 |
if ( $deleted ) {
|
704 |
wp_cache_set( 'last_changed', microtime(), 'posts' );
|
736 |
return maybe_unserialize( $results[0]['option_value'] );
|
737 |
}
|
738 |
|
739 |
+
return [];
|
740 |
}
|
741 |
|
742 |
/**
|
747 |
* @return void
|
748 |
*/
|
749 |
protected function cleanup_option_data( $option_name ) {
|
750 |
+
$data = get_option( $option_name, [] );
|
751 |
+
if ( ! is_array( $data ) || $data === [] ) {
|
752 |
return;
|
753 |
}
|
754 |
|
inc/class-wpseo-admin-bar-menu.php
CHANGED
@@ -125,10 +125,10 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
|
|
125 |
return;
|
126 |
}
|
127 |
|
128 |
-
add_action( 'admin_bar_menu',
|
129 |
|
130 |
-
add_action( 'wp_enqueue_scripts',
|
131 |
-
add_action( 'admin_enqueue_scripts',
|
132 |
}
|
133 |
|
134 |
/**
|
@@ -184,32 +184,32 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
|
|
184 |
$alert_popup = $this->get_notification_alert_popup();
|
185 |
}
|
186 |
|
187 |
-
$admin_bar_menu_args =
|
188 |
'id' => self::MENU_IDENTIFIER,
|
189 |
'title' => $title . $score . $counter . $alert_popup,
|
190 |
'href' => $settings_url,
|
191 |
-
'meta' =>
|
192 |
-
|
193 |
$wp_admin_bar->add_menu( $admin_bar_menu_args );
|
194 |
|
195 |
if ( ! empty( $counter ) ) {
|
196 |
-
$admin_bar_menu_args =
|
197 |
'parent' => self::MENU_IDENTIFIER,
|
198 |
'id' => 'wpseo-notifications',
|
199 |
'title' => __( 'Notifications', 'wordpress-seo' ) . $counter,
|
200 |
'href' => $settings_url,
|
201 |
-
'meta' =>
|
202 |
-
|
203 |
$wp_admin_bar->add_menu( $admin_bar_menu_args );
|
204 |
}
|
205 |
|
206 |
if ( ! is_network_admin() && $can_manage_options ) {
|
207 |
-
$admin_bar_menu_args =
|
208 |
'parent' => self::MENU_IDENTIFIER,
|
209 |
'id' => 'wpseo-configuration-wizard',
|
210 |
'title' => __( 'Configuration Wizard', 'wordpress-seo' ),
|
211 |
'href' => admin_url( 'admin.php?page=' . WPSEO_Configuration_Page::PAGE_IDENTIFIER ),
|
212 |
-
|
213 |
$wp_admin_bar->add_menu( $admin_bar_menu_args );
|
214 |
}
|
215 |
}
|
@@ -234,40 +234,40 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
|
|
234 |
}
|
235 |
}
|
236 |
|
237 |
-
$menu_args =
|
238 |
'parent' => self::MENU_IDENTIFIER,
|
239 |
'id' => self::KEYWORD_RESEARCH_SUBMENU_IDENTIFIER,
|
240 |
'title' => __( 'Keyword Research', 'wordpress-seo' ),
|
241 |
-
'meta' =>
|
242 |
-
|
243 |
$wp_admin_bar->add_menu( $menu_args );
|
244 |
|
245 |
-
$submenu_items =
|
246 |
-
|
247 |
'id' => 'wpseo-kwresearchtraining',
|
248 |
'title' => __( 'Keyword research training', 'wordpress-seo' ),
|
249 |
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/wp-admin-bar' ),
|
250 |
-
|
251 |
-
|
252 |
'id' => 'wpseo-adwordsexternal',
|
253 |
'title' => __( 'Google Ads', 'wordpress-seo' ),
|
254 |
'href' => $adwords_url,
|
255 |
-
|
256 |
-
|
257 |
'id' => 'wpseo-googleinsights',
|
258 |
'title' => __( 'Google Trends', 'wordpress-seo' ),
|
259 |
'href' => $trends_url,
|
260 |
-
|
261 |
-
|
262 |
|
263 |
foreach ( $submenu_items as $menu_item ) {
|
264 |
-
$menu_args =
|
265 |
'parent' => self::KEYWORD_RESEARCH_SUBMENU_IDENTIFIER,
|
266 |
'id' => $menu_item['id'],
|
267 |
'title' => $menu_item['title'],
|
268 |
'href' => $menu_item['href'],
|
269 |
-
'meta' =>
|
270 |
-
|
271 |
$wp_admin_bar->add_menu( $menu_args );
|
272 |
}
|
273 |
}
|
@@ -292,82 +292,82 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
|
|
292 |
$focus_keyword = $this->get_post_focus_keyword( $post );
|
293 |
}
|
294 |
|
295 |
-
$menu_args =
|
296 |
'parent' => self::MENU_IDENTIFIER,
|
297 |
'id' => self::ANALYSIS_SUBMENU_IDENTIFIER,
|
298 |
'title' => __( 'Analyze this page', 'wordpress-seo' ),
|
299 |
-
'meta' =>
|
300 |
-
|
301 |
$wp_admin_bar->add_menu( $menu_args );
|
302 |
|
303 |
$encoded_url = urlencode( $url );
|
304 |
-
$submenu_items =
|
305 |
-
|
306 |
'id' => 'wpseo-inlinks',
|
307 |
'title' => __( 'Check links to this URL', 'wordpress-seo' ),
|
308 |
'href' => 'https://search.google.com/search-console/links/drilldown?resource_id=' . urlencode( get_option( 'siteurl' ) ) . '&type=EXTERNAL&target=' . $encoded_url . '&domain=',
|
309 |
-
|
310 |
-
|
311 |
'id' => 'wpseo-kwdensity',
|
312 |
'title' => __( 'Check Keyphrase Density', 'wordpress-seo' ),
|
313 |
// HTTPS not available.
|
314 |
'href' => 'http://www.zippy.co.uk/keyworddensity/index.php?url=' . $encoded_url . '&keyword=' . urlencode( $focus_keyword ),
|
315 |
-
|
316 |
-
|
317 |
'id' => 'wpseo-cache',
|
318 |
'title' => __( 'Check Google Cache', 'wordpress-seo' ),
|
319 |
'href' => '//webcache.googleusercontent.com/search?strip=1&q=cache:' . $encoded_url,
|
320 |
-
|
321 |
-
|
322 |
'id' => 'wpseo-header',
|
323 |
'title' => __( 'Check Headers', 'wordpress-seo' ),
|
324 |
'href' => '//quixapp.com/headers/?r=' . urlencode( $url ),
|
325 |
-
|
326 |
-
|
327 |
'id' => 'wpseo-structureddata',
|
328 |
'title' => __( 'Google Structured Data Test', 'wordpress-seo' ),
|
329 |
'href' => 'https://search.google.com/structured-data/testing-tool#url=' . $encoded_url,
|
330 |
-
|
331 |
-
|
332 |
'id' => 'wpseo-facebookdebug',
|
333 |
'title' => __( 'Facebook Debugger', 'wordpress-seo' ),
|
334 |
'href' => '//developers.facebook.com/tools/debug/og/object?q=' . $encoded_url,
|
335 |
-
|
336 |
-
|
337 |
'id' => 'wpseo-pinterestvalidator',
|
338 |
'title' => __( 'Pinterest Rich Pins Validator', 'wordpress-seo' ),
|
339 |
'href' => 'https://developers.pinterest.com/tools/url-debugger/?link=' . $encoded_url,
|
340 |
-
|
341 |
-
|
342 |
'id' => 'wpseo-htmlvalidation',
|
343 |
'title' => __( 'HTML Validator', 'wordpress-seo' ),
|
344 |
'href' => '//validator.w3.org/check?uri=' . $encoded_url,
|
345 |
-
|
346 |
-
|
347 |
'id' => 'wpseo-cssvalidation',
|
348 |
'title' => __( 'CSS Validator', 'wordpress-seo' ),
|
349 |
'href' => '//jigsaw.w3.org/css-validator/validator?uri=' . $encoded_url,
|
350 |
-
|
351 |
-
|
352 |
'id' => 'wpseo-pagespeed',
|
353 |
'title' => __( 'Google Page Speed Test', 'wordpress-seo' ),
|
354 |
'href' => '//developers.google.com/speed/pagespeed/insights/?url=' . $encoded_url,
|
355 |
-
|
356 |
-
|
357 |
'id' => 'wpseo-google-mobile-friendly',
|
358 |
'title' => __( 'Mobile-Friendly Test', 'wordpress-seo' ),
|
359 |
'href' => 'https://www.google.com/webmasters/tools/mobile-friendly/?url=' . $encoded_url,
|
360 |
-
|
361 |
-
|
362 |
|
363 |
foreach ( $submenu_items as $menu_item ) {
|
364 |
-
$menu_args =
|
365 |
'parent' => self::ANALYSIS_SUBMENU_IDENTIFIER,
|
366 |
'id' => $menu_item['id'],
|
367 |
'title' => $menu_item['title'],
|
368 |
'href' => $menu_item['href'],
|
369 |
-
'meta' =>
|
370 |
-
|
371 |
$wp_admin_bar->add_menu( $menu_args );
|
372 |
}
|
373 |
}
|
@@ -387,12 +387,12 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
|
|
387 |
$admin_menu = new WPSEO_Admin_Menu( new WPSEO_Menu() );
|
388 |
$submenu_pages = $admin_menu->get_submenu_pages();
|
389 |
|
390 |
-
$menu_args =
|
391 |
'parent' => self::MENU_IDENTIFIER,
|
392 |
'id' => self::SETTINGS_SUBMENU_IDENTIFIER,
|
393 |
'title' => __( 'SEO Settings', 'wordpress-seo' ),
|
394 |
-
'meta' =>
|
395 |
-
|
396 |
$wp_admin_bar->add_menu( $menu_args );
|
397 |
|
398 |
foreach ( $submenu_pages as $submenu_page ) {
|
@@ -405,12 +405,12 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
|
|
405 |
$id = 'wpseo-general';
|
406 |
}
|
407 |
|
408 |
-
$menu_args =
|
409 |
'parent' => self::SETTINGS_SUBMENU_IDENTIFIER,
|
410 |
'id' => $id,
|
411 |
'title' => $submenu_page[2],
|
412 |
'href' => admin_url( 'admin.php?page=' . urlencode( $submenu_page[4] ) ),
|
413 |
-
|
414 |
$wp_admin_bar->add_menu( $menu_args );
|
415 |
}
|
416 |
}
|
@@ -430,12 +430,12 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
|
|
430 |
$network_admin_menu = new WPSEO_Network_Admin_Menu( new WPSEO_Menu() );
|
431 |
$submenu_pages = $network_admin_menu->get_submenu_pages();
|
432 |
|
433 |
-
$menu_args =
|
434 |
'parent' => self::MENU_IDENTIFIER,
|
435 |
'id' => self::NETWORK_SETTINGS_SUBMENU_IDENTIFIER,
|
436 |
'title' => __( 'SEO Settings', 'wordpress-seo' ),
|
437 |
-
'meta' =>
|
438 |
-
|
439 |
$wp_admin_bar->add_menu( $menu_args );
|
440 |
|
441 |
foreach ( $submenu_pages as $submenu_page ) {
|
@@ -448,12 +448,12 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
|
|
448 |
$id = 'wpseo-general';
|
449 |
}
|
450 |
|
451 |
-
$menu_args =
|
452 |
'parent' => self::NETWORK_SETTINGS_SUBMENU_IDENTIFIER,
|
453 |
'id' => $id,
|
454 |
'title' => $submenu_page[2],
|
455 |
'href' => network_admin_url( 'admin.php?page=' . urlencode( $submenu_page[4] ) ),
|
456 |
-
|
457 |
$wp_admin_bar->add_menu( $menu_args );
|
458 |
}
|
459 |
}
|
125 |
return;
|
126 |
}
|
127 |
|
128 |
+
add_action( 'admin_bar_menu', [ $this, 'add_menu' ], 95 );
|
129 |
|
130 |
+
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
131 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
132 |
}
|
133 |
|
134 |
/**
|
184 |
$alert_popup = $this->get_notification_alert_popup();
|
185 |
}
|
186 |
|
187 |
+
$admin_bar_menu_args = [
|
188 |
'id' => self::MENU_IDENTIFIER,
|
189 |
'title' => $title . $score . $counter . $alert_popup,
|
190 |
'href' => $settings_url,
|
191 |
+
'meta' => [ 'tabindex' => ! empty( $settings_url ) ? false : '0' ],
|
192 |
+
];
|
193 |
$wp_admin_bar->add_menu( $admin_bar_menu_args );
|
194 |
|
195 |
if ( ! empty( $counter ) ) {
|
196 |
+
$admin_bar_menu_args = [
|
197 |
'parent' => self::MENU_IDENTIFIER,
|
198 |
'id' => 'wpseo-notifications',
|
199 |
'title' => __( 'Notifications', 'wordpress-seo' ) . $counter,
|
200 |
'href' => $settings_url,
|
201 |
+
'meta' => [ 'tabindex' => ! empty( $settings_url ) ? false : '0' ],
|
202 |
+
];
|
203 |
$wp_admin_bar->add_menu( $admin_bar_menu_args );
|
204 |
}
|
205 |
|
206 |
if ( ! is_network_admin() && $can_manage_options ) {
|
207 |
+
$admin_bar_menu_args = [
|
208 |
'parent' => self::MENU_IDENTIFIER,
|
209 |
'id' => 'wpseo-configuration-wizard',
|
210 |
'title' => __( 'Configuration Wizard', 'wordpress-seo' ),
|
211 |
'href' => admin_url( 'admin.php?page=' . WPSEO_Configuration_Page::PAGE_IDENTIFIER ),
|
212 |
+
];
|
213 |
$wp_admin_bar->add_menu( $admin_bar_menu_args );
|
214 |
}
|
215 |
}
|
234 |
}
|
235 |
}
|
236 |
|
237 |
+
$menu_args = [
|
238 |
'parent' => self::MENU_IDENTIFIER,
|
239 |
'id' => self::KEYWORD_RESEARCH_SUBMENU_IDENTIFIER,
|
240 |
'title' => __( 'Keyword Research', 'wordpress-seo' ),
|
241 |
+
'meta' => [ 'tabindex' => '0' ],
|
242 |
+
];
|
243 |
$wp_admin_bar->add_menu( $menu_args );
|
244 |
|
245 |
+
$submenu_items = [
|
246 |
+
[
|
247 |
'id' => 'wpseo-kwresearchtraining',
|
248 |
'title' => __( 'Keyword research training', 'wordpress-seo' ),
|
249 |
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/wp-admin-bar' ),
|
250 |
+
],
|
251 |
+
[
|
252 |
'id' => 'wpseo-adwordsexternal',
|
253 |
'title' => __( 'Google Ads', 'wordpress-seo' ),
|
254 |
'href' => $adwords_url,
|
255 |
+
],
|
256 |
+
[
|
257 |
'id' => 'wpseo-googleinsights',
|
258 |
'title' => __( 'Google Trends', 'wordpress-seo' ),
|
259 |
'href' => $trends_url,
|
260 |
+
],
|
261 |
+
];
|
262 |
|
263 |
foreach ( $submenu_items as $menu_item ) {
|
264 |
+
$menu_args = [
|
265 |
'parent' => self::KEYWORD_RESEARCH_SUBMENU_IDENTIFIER,
|
266 |
'id' => $menu_item['id'],
|
267 |
'title' => $menu_item['title'],
|
268 |
'href' => $menu_item['href'],
|
269 |
+
'meta' => [ 'target' => '_blank' ],
|
270 |
+
];
|
271 |
$wp_admin_bar->add_menu( $menu_args );
|
272 |
}
|
273 |
}
|
292 |
$focus_keyword = $this->get_post_focus_keyword( $post );
|
293 |
}
|
294 |
|
295 |
+
$menu_args = [
|
296 |
'parent' => self::MENU_IDENTIFIER,
|
297 |
'id' => self::ANALYSIS_SUBMENU_IDENTIFIER,
|
298 |
'title' => __( 'Analyze this page', 'wordpress-seo' ),
|
299 |
+
'meta' => [ 'tabindex' => '0' ],
|
300 |
+
];
|
301 |
$wp_admin_bar->add_menu( $menu_args );
|
302 |
|
303 |
$encoded_url = urlencode( $url );
|
304 |
+
$submenu_items = [
|
305 |
+
[
|
306 |
'id' => 'wpseo-inlinks',
|
307 |
'title' => __( 'Check links to this URL', 'wordpress-seo' ),
|
308 |
'href' => 'https://search.google.com/search-console/links/drilldown?resource_id=' . urlencode( get_option( 'siteurl' ) ) . '&type=EXTERNAL&target=' . $encoded_url . '&domain=',
|
309 |
+
],
|
310 |
+
[
|
311 |
'id' => 'wpseo-kwdensity',
|
312 |
'title' => __( 'Check Keyphrase Density', 'wordpress-seo' ),
|
313 |
// HTTPS not available.
|
314 |
'href' => 'http://www.zippy.co.uk/keyworddensity/index.php?url=' . $encoded_url . '&keyword=' . urlencode( $focus_keyword ),
|
315 |
+
],
|
316 |
+
[
|
317 |
'id' => 'wpseo-cache',
|
318 |
'title' => __( 'Check Google Cache', 'wordpress-seo' ),
|
319 |
'href' => '//webcache.googleusercontent.com/search?strip=1&q=cache:' . $encoded_url,
|
320 |
+
],
|
321 |
+
[
|
322 |
'id' => 'wpseo-header',
|
323 |
'title' => __( 'Check Headers', 'wordpress-seo' ),
|
324 |
'href' => '//quixapp.com/headers/?r=' . urlencode( $url ),
|
325 |
+
],
|
326 |
+
[
|
327 |
'id' => 'wpseo-structureddata',
|
328 |
'title' => __( 'Google Structured Data Test', 'wordpress-seo' ),
|
329 |
'href' => 'https://search.google.com/structured-data/testing-tool#url=' . $encoded_url,
|
330 |
+
],
|
331 |
+
[
|
332 |
'id' => 'wpseo-facebookdebug',
|
333 |
'title' => __( 'Facebook Debugger', 'wordpress-seo' ),
|
334 |
'href' => '//developers.facebook.com/tools/debug/og/object?q=' . $encoded_url,
|
335 |
+
],
|
336 |
+
[
|
337 |
'id' => 'wpseo-pinterestvalidator',
|
338 |
'title' => __( 'Pinterest Rich Pins Validator', 'wordpress-seo' ),
|
339 |
'href' => 'https://developers.pinterest.com/tools/url-debugger/?link=' . $encoded_url,
|
340 |
+
],
|
341 |
+
[
|
342 |
'id' => 'wpseo-htmlvalidation',
|
343 |
'title' => __( 'HTML Validator', 'wordpress-seo' ),
|
344 |
'href' => '//validator.w3.org/check?uri=' . $encoded_url,
|
345 |
+
],
|
346 |
+
[
|
347 |
'id' => 'wpseo-cssvalidation',
|
348 |
'title' => __( 'CSS Validator', 'wordpress-seo' ),
|
349 |
'href' => '//jigsaw.w3.org/css-validator/validator?uri=' . $encoded_url,
|
350 |
+
],
|
351 |
+
[
|
352 |
'id' => 'wpseo-pagespeed',
|
353 |
'title' => __( 'Google Page Speed Test', 'wordpress-seo' ),
|
354 |
'href' => '//developers.google.com/speed/pagespeed/insights/?url=' . $encoded_url,
|
355 |
+
],
|
356 |
+
[
|
357 |
'id' => 'wpseo-google-mobile-friendly',
|
358 |
'title' => __( 'Mobile-Friendly Test', 'wordpress-seo' ),
|
359 |
'href' => 'https://www.google.com/webmasters/tools/mobile-friendly/?url=' . $encoded_url,
|
360 |
+
],
|
361 |
+
];
|
362 |
|
363 |
foreach ( $submenu_items as $menu_item ) {
|
364 |
+
$menu_args = [
|
365 |
'parent' => self::ANALYSIS_SUBMENU_IDENTIFIER,
|
366 |
'id' => $menu_item['id'],
|
367 |
'title' => $menu_item['title'],
|
368 |
'href' => $menu_item['href'],
|
369 |
+
'meta' => [ 'target' => '_blank' ],
|
370 |
+
];
|
371 |
$wp_admin_bar->add_menu( $menu_args );
|
372 |
}
|
373 |
}
|
387 |
$admin_menu = new WPSEO_Admin_Menu( new WPSEO_Menu() );
|
388 |
$submenu_pages = $admin_menu->get_submenu_pages();
|
389 |
|
390 |
+
$menu_args = [
|
391 |
'parent' => self::MENU_IDENTIFIER,
|
392 |
'id' => self::SETTINGS_SUBMENU_IDENTIFIER,
|
393 |
'title' => __( 'SEO Settings', 'wordpress-seo' ),
|
394 |
+
'meta' => [ 'tabindex' => '0' ],
|
395 |
+
];
|
396 |
$wp_admin_bar->add_menu( $menu_args );
|
397 |
|
398 |
foreach ( $submenu_pages as $submenu_page ) {
|
405 |
$id = 'wpseo-general';
|
406 |
}
|
407 |
|
408 |
+
$menu_args = [
|
409 |
'parent' => self::SETTINGS_SUBMENU_IDENTIFIER,
|
410 |
'id' => $id,
|
411 |
'title' => $submenu_page[2],
|
412 |
'href' => admin_url( 'admin.php?page=' . urlencode( $submenu_page[4] ) ),
|
413 |
+
];
|
414 |
$wp_admin_bar->add_menu( $menu_args );
|
415 |
}
|
416 |
}
|
430 |
$network_admin_menu = new WPSEO_Network_Admin_Menu( new WPSEO_Menu() );
|
431 |
$submenu_pages = $network_admin_menu->get_submenu_pages();
|
432 |
|
433 |
+
$menu_args = [
|
434 |
'parent' => self::MENU_IDENTIFIER,
|
435 |
'id' => self::NETWORK_SETTINGS_SUBMENU_IDENTIFIER,
|
436 |
'title' => __( 'SEO Settings', 'wordpress-seo' ),
|
437 |
+
'meta' => [ 'tabindex' => '0' ],
|
438 |
+
];
|
439 |
$wp_admin_bar->add_menu( $menu_args );
|
440 |
|
441 |
foreach ( $submenu_pages as $submenu_page ) {
|
448 |
$id = 'wpseo-general';
|
449 |
}
|
450 |
|
451 |
+
$menu_args = [
|
452 |
'parent' => self::NETWORK_SETTINGS_SUBMENU_IDENTIFIER,
|
453 |
'id' => $id,
|
454 |
'title' => $submenu_page[2],
|
455 |
'href' => network_admin_url( 'admin.php?page=' . urlencode( $submenu_page[4] ) ),
|
456 |
+
];
|
457 |
$wp_admin_bar->add_menu( $menu_args );
|
458 |
}
|
459 |
}
|
inc/class-wpseo-content-images.php
CHANGED
@@ -31,11 +31,11 @@ class WPSEO_Content_Images {
|
|
31 |
*/
|
32 |
public function get_images_from_content( $content ) {
|
33 |
if ( ! is_string( $content ) ) {
|
34 |
-
return
|
35 |
}
|
36 |
|
37 |
$content_images = $this->get_img_tags_from_content( $content );
|
38 |
-
$images = array_map(
|
39 |
$images = array_filter( $images );
|
40 |
$images = array_unique( $images );
|
41 |
$images = array_values( $images ); // Reset the array keys.
|
@@ -52,7 +52,7 @@ class WPSEO_Content_Images {
|
|
52 |
*/
|
53 |
private function get_img_tags_from_content( $content ) {
|
54 |
if ( strpos( $content, '<img' ) === false ) {
|
55 |
-
return
|
56 |
}
|
57 |
|
58 |
preg_match_all( '`<img [^>]+>`', $content, $matches );
|
@@ -60,7 +60,7 @@ class WPSEO_Content_Images {
|
|
60 |
return $matches[0];
|
61 |
}
|
62 |
|
63 |
-
return
|
64 |
}
|
65 |
|
66 |
/**
|
31 |
*/
|
32 |
public function get_images_from_content( $content ) {
|
33 |
if ( ! is_string( $content ) ) {
|
34 |
+
return [];
|
35 |
}
|
36 |
|
37 |
$content_images = $this->get_img_tags_from_content( $content );
|
38 |
+
$images = array_map( [ $this, 'get_img_tag_source' ], $content_images );
|
39 |
$images = array_filter( $images );
|
40 |
$images = array_unique( $images );
|
41 |
$images = array_values( $images ); // Reset the array keys.
|
52 |
*/
|
53 |
private function get_img_tags_from_content( $content ) {
|
54 |
if ( strpos( $content, '<img' ) === false ) {
|
55 |
+
return [];
|
56 |
}
|
57 |
|
58 |
preg_match_all( '`<img [^>]+>`', $content, $matches );
|
60 |
return $matches[0];
|
61 |
}
|
62 |
|
63 |
+
return [];
|
64 |
}
|
65 |
|
66 |
/**
|
inc/class-wpseo-custom-fields.php
CHANGED
@@ -32,7 +32,7 @@ class WPSEO_Custom_Fields {
|
|
32 |
return self::$custom_fields;
|
33 |
}
|
34 |
|
35 |
-
self::$custom_fields =
|
36 |
|
37 |
/**
|
38 |
* Filters the number of custom fields to retrieve for the drop-down
|
@@ -50,7 +50,7 @@ class WPSEO_Custom_Fields {
|
|
50 |
$fields = $wpdb->get_col( $wpdb->prepare( $sql, $wpdb->esc_like( '_' ) . '%', $limit ) );
|
51 |
|
52 |
if ( is_array( $fields ) ) {
|
53 |
-
self::$custom_fields = array_map(
|
54 |
}
|
55 |
|
56 |
return self::$custom_fields;
|
32 |
return self::$custom_fields;
|
33 |
}
|
34 |
|
35 |
+
self::$custom_fields = [];
|
36 |
|
37 |
/**
|
38 |
* Filters the number of custom fields to retrieve for the drop-down
|
50 |
$fields = $wpdb->get_col( $wpdb->prepare( $sql, $wpdb->esc_like( '_' ) . '%', $limit ) );
|
51 |
|
52 |
if ( is_array( $fields ) ) {
|
53 |
+
self::$custom_fields = array_map( [ 'WPSEO_Custom_Fields', 'add_custom_field_prefix' ], $fields );
|
54 |
}
|
55 |
|
56 |
return self::$custom_fields;
|
inc/class-wpseo-custom-taxonomies.php
CHANGED
@@ -28,11 +28,11 @@ class WPSEO_Custom_Taxonomies {
|
|
28 |
return self::$custom_taxonomies;
|
29 |
}
|
30 |
|
31 |
-
self::$custom_taxonomies =
|
32 |
-
$args =
|
33 |
'public' => true,
|
34 |
'_builtin' => false,
|
35 |
-
|
36 |
$custom_taxonomies = get_taxonomies( $args, 'names', 'and' );
|
37 |
|
38 |
if ( is_array( $custom_taxonomies ) ) {
|
28 |
return self::$custom_taxonomies;
|
29 |
}
|
30 |
|
31 |
+
self::$custom_taxonomies = [];
|
32 |
+
$args = [
|
33 |
'public' => true,
|
34 |
'_builtin' => false,
|
35 |
+
];
|
36 |
$custom_taxonomies = get_taxonomies( $args, 'names', 'and' );
|
37 |
|
38 |
if ( is_array( $custom_taxonomies ) ) {
|
inc/class-wpseo-endpoint-factory.php
CHANGED
@@ -15,20 +15,20 @@ class WPSEO_Endpoint_Factory {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
private $valid_http_methods =
|
19 |
'GET',
|
20 |
'PATCH',
|
21 |
'POST',
|
22 |
'PUT',
|
23 |
'DELETE',
|
24 |
-
|
25 |
|
26 |
/**
|
27 |
* The arguments.
|
28 |
*
|
29 |
* @var array
|
30 |
*/
|
31 |
-
protected $args =
|
32 |
|
33 |
/**
|
34 |
* The namespace.
|
@@ -128,11 +128,11 @@ class WPSEO_Endpoint_Factory {
|
|
128 |
* @return void
|
129 |
*/
|
130 |
public function register() {
|
131 |
-
$config =
|
132 |
'methods' => $this->method,
|
133 |
'callback' => $this->callback,
|
134 |
'permission_callback' => $this->permission_callback,
|
135 |
-
|
136 |
|
137 |
if ( $this->has_arguments() ) {
|
138 |
$config['args'] = $this->args;
|
@@ -178,10 +178,10 @@ class WPSEO_Endpoint_Factory {
|
|
178 |
return;
|
179 |
}
|
180 |
|
181 |
-
$this->args[ $name ] =
|
182 |
'description' => $description,
|
183 |
'type' => $type,
|
184 |
'required' => $required,
|
185 |
-
|
186 |
}
|
187 |
}
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
private $valid_http_methods = [
|
19 |
'GET',
|
20 |
'PATCH',
|
21 |
'POST',
|
22 |
'PUT',
|
23 |
'DELETE',
|
24 |
+
];
|
25 |
|
26 |
/**
|
27 |
* The arguments.
|
28 |
*
|
29 |
* @var array
|
30 |
*/
|
31 |
+
protected $args = [];
|
32 |
|
33 |
/**
|
34 |
* The namespace.
|
128 |
* @return void
|
129 |
*/
|
130 |
public function register() {
|
131 |
+
$config = [
|
132 |
'methods' => $this->method,
|
133 |
'callback' => $this->callback,
|
134 |
'permission_callback' => $this->permission_callback,
|
135 |
+
];
|
136 |
|
137 |
if ( $this->has_arguments() ) {
|
138 |
$config['args'] = $this->args;
|
178 |
return;
|
179 |
}
|
180 |
|
181 |
+
$this->args[ $name ] = [
|
182 |
'description' => $description,
|
183 |
'type' => $type,
|
184 |
'required' => $required,
|
185 |
+
];
|
186 |
}
|
187 |
}
|
inc/class-wpseo-image-utils.php
CHANGED
@@ -110,7 +110,7 @@ class WPSEO_Image_Utils {
|
|
110 |
}
|
111 |
|
112 |
// Keep only the keys we need, and nothing else.
|
113 |
-
return array_intersect_key( $image, array_flip(
|
114 |
}
|
115 |
|
116 |
/**
|
@@ -121,7 +121,7 @@ class WPSEO_Image_Utils {
|
|
121 |
* @return bool True when the image is within limits, false if not.
|
122 |
*/
|
123 |
public static function has_usable_file_size( $image ) {
|
124 |
-
if ( ! is_array( $image ) || $image ===
|
125 |
return false;
|
126 |
}
|
127 |
|
@@ -255,7 +255,7 @@ class WPSEO_Image_Utils {
|
|
255 |
* @return array The different variations possible for this attachment ID.
|
256 |
*/
|
257 |
public static function get_variations( $attachment_id ) {
|
258 |
-
$variations =
|
259 |
|
260 |
foreach ( self::get_sizes() as $size ) {
|
261 |
$variation = self::get_image( $attachment_id, $size );
|
@@ -287,7 +287,7 @@ class WPSEO_Image_Utils {
|
|
287 |
* @return array Whether a variation is fit for display or not.
|
288 |
*/
|
289 |
public static function filter_usable_dimensions( $usable_dimensions, $variations ) {
|
290 |
-
$filtered =
|
291 |
|
292 |
foreach ( $variations as $variation ) {
|
293 |
$dimensions = $variation;
|
@@ -311,11 +311,11 @@ class WPSEO_Image_Utils {
|
|
311 |
foreach ( $variations as $variation ) {
|
312 |
// We return early to prevent measuring the file size of all the variations.
|
313 |
if ( self::has_usable_file_size( $variation ) ) {
|
314 |
-
return
|
315 |
}
|
316 |
}
|
317 |
|
318 |
-
return
|
319 |
}
|
320 |
|
321 |
/**
|
@@ -329,7 +329,7 @@ class WPSEO_Image_Utils {
|
|
329 |
*
|
330 |
* @api array - The array of image sizes to loop through.
|
331 |
*/
|
332 |
-
return apply_filters( 'wpseo_image_sizes',
|
333 |
}
|
334 |
|
335 |
/**
|
@@ -352,7 +352,7 @@ class WPSEO_Image_Utils {
|
|
352 |
* @return bool True if the image has usable measurements, false if not.
|
353 |
*/
|
354 |
private static function has_usable_dimensions( $dimensions, $usable_dimensions ) {
|
355 |
-
foreach (
|
356 |
$minimum = $usable_dimensions[ 'min_' . $param ];
|
357 |
$maximum = $usable_dimensions[ 'max_' . $param ];
|
358 |
|
110 |
}
|
111 |
|
112 |
// Keep only the keys we need, and nothing else.
|
113 |
+
return array_intersect_key( $image, array_flip( [ 'id', 'alt', 'path', 'width', 'height', 'pixels', 'type', 'size', 'url', 'filesize' ] ) );
|
114 |
}
|
115 |
|
116 |
/**
|
121 |
* @return bool True when the image is within limits, false if not.
|
122 |
*/
|
123 |
public static function has_usable_file_size( $image ) {
|
124 |
+
if ( ! is_array( $image ) || $image === [] ) {
|
125 |
return false;
|
126 |
}
|
127 |
|
255 |
* @return array The different variations possible for this attachment ID.
|
256 |
*/
|
257 |
public static function get_variations( $attachment_id ) {
|
258 |
+
$variations = [];
|
259 |
|
260 |
foreach ( self::get_sizes() as $size ) {
|
261 |
$variation = self::get_image( $attachment_id, $size );
|
287 |
* @return array Whether a variation is fit for display or not.
|
288 |
*/
|
289 |
public static function filter_usable_dimensions( $usable_dimensions, $variations ) {
|
290 |
+
$filtered = [];
|
291 |
|
292 |
foreach ( $variations as $variation ) {
|
293 |
$dimensions = $variation;
|
311 |
foreach ( $variations as $variation ) {
|
312 |
// We return early to prevent measuring the file size of all the variations.
|
313 |
if ( self::has_usable_file_size( $variation ) ) {
|
314 |
+
return [ $variation ];
|
315 |
}
|
316 |
}
|
317 |
|
318 |
+
return [];
|
319 |
}
|
320 |
|
321 |
/**
|
329 |
*
|
330 |
* @api array - The array of image sizes to loop through.
|
331 |
*/
|
332 |
+
return apply_filters( 'wpseo_image_sizes', [ 'full', 'large', 'medium_large' ] );
|
333 |
}
|
334 |
|
335 |
/**
|
352 |
* @return bool True if the image has usable measurements, false if not.
|
353 |
*/
|
354 |
private static function has_usable_dimensions( $dimensions, $usable_dimensions ) {
|
355 |
+
foreach ( [ 'width', 'height' ] as $param ) {
|
356 |
$minimum = $usable_dimensions[ 'min_' . $param ];
|
357 |
$maximum = $usable_dimensions[ 'max_' . $param ];
|
358 |
|
inc/class-wpseo-installation.php
CHANGED
@@ -19,7 +19,7 @@ class WPSEO_Installation {
|
|
19 |
$is_first_install = $this->is_first_install();
|
20 |
|
21 |
if ( $is_first_install && WPSEO_Utils::is_api_available() ) {
|
22 |
-
add_action( 'wpseo_activate',
|
23 |
}
|
24 |
}
|
25 |
|
19 |
$is_first_install = $this->is_first_install();
|
20 |
|
21 |
if ( $is_first_install && WPSEO_Utils::is_api_available() ) {
|
22 |
+
add_action( 'wpseo_activate', [ $this, 'set_first_install_options' ] );
|
23 |
}
|
24 |
}
|
25 |
|
inc/class-wpseo-meta.php
CHANGED
@@ -99,20 +99,20 @@ class WPSEO_Meta {
|
|
99 |
* i.e. an array or object, defaults to false.
|
100 |
* Currently only used by add-on plugins.
|
101 |
*/
|
102 |
-
public static $meta_fields =
|
103 |
-
'general' =>
|
104 |
-
'focuskw' =>
|
105 |
'type' => 'hidden',
|
106 |
'title' => '',
|
107 |
-
|
108 |
-
'title' =>
|
109 |
'type' => 'hidden',
|
110 |
'title' => '', // Translation added later.
|
111 |
'default_value' => '',
|
112 |
'description' => '', // Translation added later.
|
113 |
'help' => '', // Translation added later.
|
114 |
-
|
115 |
-
'metadesc' =>
|
116 |
'type' => 'hidden',
|
117 |
'title' => '', // Translation added later.
|
118 |
'default_value' => '',
|
@@ -120,85 +120,85 @@ class WPSEO_Meta {
|
|
120 |
'rows' => 2,
|
121 |
'description' => '', // Translation added later.
|
122 |
'help' => '', // Translation added later.
|
123 |
-
|
124 |
-
'linkdex' =>
|
125 |
'type' => 'hidden',
|
126 |
'title' => 'linkdex',
|
127 |
'default_value' => '0',
|
128 |
'description' => '',
|
129 |
-
|
130 |
-
'content_score' =>
|
131 |
'type' => 'hidden',
|
132 |
'title' => 'content_score',
|
133 |
'default_value' => '0',
|
134 |
'description' => '',
|
135 |
-
|
136 |
-
'is_cornerstone' =>
|
137 |
'type' => 'hidden',
|
138 |
'title' => 'is_cornerstone',
|
139 |
'default_value' => 'false',
|
140 |
'description' => '',
|
141 |
-
|
142 |
-
|
143 |
-
'advanced' =>
|
144 |
-
'meta-robots-noindex' =>
|
145 |
'type' => 'select',
|
146 |
'title' => '', // Translation added later.
|
147 |
'default_value' => '0', // = post-type default.
|
148 |
-
'options' =>
|
149 |
'0' => '', // Post type default - translation added later.
|
150 |
'2' => '', // Index - translation added later.
|
151 |
'1' => '', // No-index - translation added later.
|
152 |
-
|
153 |
-
|
154 |
-
'meta-robots-nofollow' =>
|
155 |
'type' => 'radio',
|
156 |
'title' => '', // Translation added later.
|
157 |
'default_value' => '0', // = follow.
|
158 |
-
'options' =>
|
159 |
'0' => '', // Follow - translation added later.
|
160 |
'1' => '', // No-follow - translation added later.
|
161 |
-
|
162 |
-
|
163 |
-
'meta-robots-adv' =>
|
164 |
'type' => 'multiselect',
|
165 |
'title' => '', // Translation added later.
|
166 |
'default_value' => '',
|
167 |
'description' => '', // Translation added later.
|
168 |
-
'options' =>
|
169 |
'noimageindex' => '', // Translation added later.
|
170 |
'noarchive' => '', // Translation added later.
|
171 |
'nosnippet' => '', // Translation added later.
|
172 |
-
|
173 |
-
|
174 |
-
'bctitle' =>
|
175 |
'type' => 'text',
|
176 |
'title' => '', // Translation added later.
|
177 |
'default_value' => '',
|
178 |
'description' => '', // Translation added later.
|
179 |
-
|
180 |
-
'canonical' =>
|
181 |
'type' => 'text',
|
182 |
'title' => '', // Translation added later.
|
183 |
'default_value' => '',
|
184 |
'description' => '', // Translation added later.
|
185 |
-
|
186 |
-
'redirect' =>
|
187 |
'type' => 'text',
|
188 |
'title' => '', // Translation added later.
|
189 |
'default_value' => '',
|
190 |
'description' => '', // Translation added later.
|
191 |
-
|
192 |
-
|
193 |
-
'social' =>
|
194 |
/* Fields we should validate & save, but not show on any form. */
|
195 |
-
'non_form' =>
|
196 |
-
'linkdex' =>
|
197 |
'type' => null,
|
198 |
'default_value' => '0',
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
|
203 |
/**
|
204 |
* Helper property - reverse index of the definition array.
|
@@ -209,7 +209,7 @@ class WPSEO_Meta {
|
|
209 |
*
|
210 |
* @var array
|
211 |
*/
|
212 |
-
public static $fields_index =
|
213 |
|
214 |
/**
|
215 |
* Helper property - array containing only the defaults in the format:
|
@@ -217,29 +217,29 @@ class WPSEO_Meta {
|
|
217 |
*
|
218 |
* @var array
|
219 |
*/
|
220 |
-
public static $defaults =
|
221 |
|
222 |
/**
|
223 |
* Helper property to define the social network meta field definitions - networks.
|
224 |
*
|
225 |
* @var array
|
226 |
*/
|
227 |
-
private static $social_networks =
|
228 |
'opengraph' => 'opengraph',
|
229 |
'twitter' => 'twitter',
|
230 |
-
|
231 |
|
232 |
/**
|
233 |
* Helper property to define the social network meta field definitions - fields and their type.
|
234 |
*
|
235 |
* @var array
|
236 |
*/
|
237 |
-
private static $social_fields =
|
238 |
'title' => 'text',
|
239 |
'description' => 'textarea',
|
240 |
'image' => 'upload',
|
241 |
'image-id' => 'hidden',
|
242 |
-
|
243 |
|
244 |
/**
|
245 |
* Register our actions and filters.
|
@@ -251,12 +251,12 @@ class WPSEO_Meta {
|
|
251 |
foreach ( self::$social_networks as $option => $network ) {
|
252 |
if ( true === WPSEO_Options::get( $option, false ) ) {
|
253 |
foreach ( self::$social_fields as $box => $type ) {
|
254 |
-
self::$meta_fields['social'][ $network . '-' . $box ] =
|
255 |
'type' => $type,
|
256 |
'title' => '', // Translation added later.
|
257 |
'default_value' => '',
|
258 |
'description' => '', // Translation added later.
|
259 |
-
|
260 |
}
|
261 |
}
|
262 |
}
|
@@ -266,7 +266,7 @@ class WPSEO_Meta {
|
|
266 |
* Allow add-on plugins to register their meta fields for management by this class.
|
267 |
* Calls to add_filter() must be made before plugins_loaded prio 14.
|
268 |
*/
|
269 |
-
$extra_fields = apply_filters( 'add_extra_wpseo_meta_fields',
|
270 |
if ( is_array( $extra_fields ) ) {
|
271 |
self::$meta_fields = self::array_merge_recursive_distinct( $extra_fields, self::$meta_fields );
|
272 |
}
|
@@ -278,14 +278,14 @@ class WPSEO_Meta {
|
|
278 |
register_meta(
|
279 |
'post',
|
280 |
self::$meta_prefix . $key,
|
281 |
-
|
282 |
);
|
283 |
|
284 |
// Set the $fields_index property for efficiency.
|
285 |
-
self::$fields_index[ self::$meta_prefix . $key ] =
|
286 |
'subset' => $subset,
|
287 |
'key' => $key,
|
288 |
-
|
289 |
|
290 |
// Set the $defaults property for efficiency.
|
291 |
if ( isset( $field_def['default_value'] ) ) {
|
@@ -299,8 +299,8 @@ class WPSEO_Meta {
|
|
299 |
}
|
300 |
unset( $subset, $field_group, $key, $field_def );
|
301 |
|
302 |
-
add_filter( 'update_post_metadata',
|
303 |
-
add_filter( 'add_post_metadata',
|
304 |
}
|
305 |
|
306 |
/**
|
@@ -313,7 +313,7 @@ class WPSEO_Meta {
|
|
313 |
*/
|
314 |
public static function get_meta_field_defs( $tab, $post_type = 'post' ) {
|
315 |
if ( ! isset( self::$meta_fields[ $tab ] ) ) {
|
316 |
-
return
|
317 |
}
|
318 |
|
319 |
$field_defs = self::$meta_fields[ $tab ];
|
@@ -321,14 +321,14 @@ class WPSEO_Meta {
|
|
321 |
switch ( $tab ) {
|
322 |
case 'non-form':
|
323 |
// Prevent non-form fields from being passed to forms.
|
324 |
-
$field_defs =
|
325 |
break;
|
326 |
|
327 |
case 'advanced':
|
328 |
global $post;
|
329 |
|
330 |
if ( ! WPSEO_Capability_Utils::current_user_can( 'wpseo_edit_advanced_metadata' ) && WPSEO_Options::get( 'disableadvanced_meta' ) ) {
|
331 |
-
return
|
332 |
}
|
333 |
|
334 |
$post_type = '';
|
@@ -340,7 +340,7 @@ class WPSEO_Meta {
|
|
340 |
}
|
341 |
|
342 |
if ( $post_type === '' ) {
|
343 |
-
return
|
344 |
}
|
345 |
|
346 |
/* Adjust the no-index text strings based on the post type. */
|
@@ -397,7 +397,7 @@ class WPSEO_Meta {
|
|
397 |
|
398 |
case ( $field_def['type'] === 'checkbox' ):
|
399 |
// Only allow value if it's one of the predefined options.
|
400 |
-
if ( in_array( $meta_value,
|
401 |
$clean = $meta_value;
|
402 |
}
|
403 |
break;
|
@@ -426,9 +426,9 @@ class WPSEO_Meta {
|
|
426 |
break;
|
427 |
|
428 |
|
429 |
-
case ( $field_def['type'] === 'upload' && in_array( $meta_key,
|
430 |
// Validate as url.
|
431 |
-
$url = WPSEO_Utils::sanitize_url( $meta_value,
|
432 |
if ( $url !== '' ) {
|
433 |
$clean = $url;
|
434 |
}
|
@@ -450,7 +450,7 @@ class WPSEO_Meta {
|
|
450 |
if ( is_string( $meta_value ) ) {
|
451 |
// Remove line breaks and tabs.
|
452 |
// @todo [JRF => Yoast] Verify that line breaks and the likes aren't allowed/recommended in meta header fields.
|
453 |
-
$meta_value = str_replace(
|
454 |
$clean = WPSEO_Utils::sanitize_text_field( trim( $meta_value ) );
|
455 |
}
|
456 |
break;
|
@@ -491,18 +491,18 @@ class WPSEO_Meta {
|
|
491 |
$meta_value = explode( ',', $meta_value );
|
492 |
}
|
493 |
|
494 |
-
if ( is_array( $meta_value ) && $meta_value !==
|
495 |
$meta_value = array_map( 'trim', $meta_value );
|
496 |
|
497 |
// Individual selected entries.
|
498 |
-
$cleaning =
|
499 |
foreach ( $meta_value as $value ) {
|
500 |
if ( isset( $options[ $value ] ) ) {
|
501 |
$cleaning[] = $value;
|
502 |
}
|
503 |
}
|
504 |
|
505 |
-
if ( $cleaning !==
|
506 |
$clean = implode( ',', $cleaning );
|
507 |
}
|
508 |
unset( $cleaning, $value );
|
@@ -702,7 +702,7 @@ class WPSEO_Meta {
|
|
702 |
);
|
703 |
$oldies = $wpdb->get_results( $query );
|
704 |
|
705 |
-
if ( is_array( $oldies ) && $oldies !==
|
706 |
foreach ( $oldies as $old ) {
|
707 |
update_post_meta( $old->post_id, $new_metakey, $old->meta_value );
|
708 |
}
|
@@ -754,7 +754,7 @@ class WPSEO_Meta {
|
|
754 |
);
|
755 |
$oldies = $wpdb->get_results( $query );
|
756 |
|
757 |
-
if ( is_array( $oldies ) && $oldies !==
|
758 |
foreach ( $oldies as $old ) {
|
759 |
$old_values = explode( ',', $old->meta_value );
|
760 |
foreach ( $old_values as $value ) {
|
@@ -786,7 +786,7 @@ class WPSEO_Meta {
|
|
786 |
* with that key being deleted, not just the empty fields.
|
787 |
* Still, the below implementation is largely based on the delete_meta() function.}}
|
788 |
*/
|
789 |
-
$query =
|
790 |
|
791 |
foreach ( self::$meta_fields as $subset => $field_group ) {
|
792 |
foreach ( $field_group as $key => $field_def ) {
|
@@ -794,7 +794,7 @@ class WPSEO_Meta {
|
|
794 |
continue;
|
795 |
}
|
796 |
|
797 |
-
if ( isset( $field_def['options'] ) && is_array( $field_def['options'] ) && $field_def['options'] !==
|
798 |
$valid = $field_def['options'];
|
799 |
// Remove the default value from the valid options.
|
800 |
unset( $valid[ $field_def['default_value'] ] );
|
@@ -826,7 +826,7 @@ class WPSEO_Meta {
|
|
826 |
$query = "SELECT meta_id FROM {$wpdb->postmeta} WHERE " . implode( ' OR ', $query ) . ';';
|
827 |
$meta_ids = $wpdb->get_col( $query );
|
828 |
|
829 |
-
if ( is_array( $meta_ids ) && $meta_ids !==
|
830 |
// WP native action.
|
831 |
do_action( 'delete_post_meta', $meta_ids, null, null, null );
|
832 |
|
@@ -858,7 +858,7 @@ class WPSEO_Meta {
|
|
858 |
);
|
859 |
$oldies = $wpdb->get_results( $query );
|
860 |
|
861 |
-
if ( is_array( $oldies ) && $oldies !==
|
862 |
foreach ( $oldies as $old ) {
|
863 |
$clean = self::validate_meta_robots_adv( $old->meta_value );
|
864 |
|
@@ -899,8 +899,8 @@ class WPSEO_Meta {
|
|
899 |
|
900 |
$arrays = func_get_args();
|
901 |
if ( count( $arrays ) < 2 ) {
|
902 |
-
if ( $arrays ===
|
903 |
-
return
|
904 |
}
|
905 |
else {
|
906 |
return $arrays[0];
|
@@ -935,18 +935,18 @@ class WPSEO_Meta {
|
|
935 |
public static function keyword_usage( $keyword, $post_id ) {
|
936 |
|
937 |
if ( empty( $keyword ) ) {
|
938 |
-
return
|
939 |
}
|
940 |
|
941 |
-
$query =
|
942 |
-
'meta_query' =>
|
943 |
'relation' => 'OR',
|
944 |
-
|
945 |
'key' => '_yoast_wpseo_focuskw',
|
946 |
'value' => $keyword,
|
947 |
-
|
948 |
-
|
949 |
-
'post__not_in' =>
|
950 |
'fields' => 'ids',
|
951 |
'post_type' => 'any',
|
952 |
|
@@ -957,15 +957,15 @@ class WPSEO_Meta {
|
|
957 |
* - Two or more: Keyword has been used twice before
|
958 |
*/
|
959 |
'posts_per_page' => 2,
|
960 |
-
|
961 |
|
962 |
// If Yoast SEO Premium is active, get the additional keywords as well.
|
963 |
if ( WPSEO_Utils::is_yoast_seo_premium() ) {
|
964 |
-
$query['meta_query'][] =
|
965 |
'key' => '_yoast_wpseo_focuskeywords',
|
966 |
'value' => sprintf( '"keyword":"%s"', $keyword ),
|
967 |
'compare' => 'LIKE',
|
968 |
-
|
969 |
}
|
970 |
|
971 |
$get_posts = new WP_Query( $query );
|
99 |
* i.e. an array or object, defaults to false.
|
100 |
* Currently only used by add-on plugins.
|
101 |
*/
|
102 |
+
public static $meta_fields = [
|
103 |
+
'general' => [
|
104 |
+
'focuskw' => [
|
105 |
'type' => 'hidden',
|
106 |
'title' => '',
|
107 |
+
],
|
108 |
+
'title' => [
|
109 |
'type' => 'hidden',
|
110 |
'title' => '', // Translation added later.
|
111 |
'default_value' => '',
|
112 |
'description' => '', // Translation added later.
|
113 |
'help' => '', // Translation added later.
|
114 |
+
],
|
115 |
+
'metadesc' => [
|
116 |
'type' => 'hidden',
|
117 |
'title' => '', // Translation added later.
|
118 |
'default_value' => '',
|
120 |
'rows' => 2,
|
121 |
'description' => '', // Translation added later.
|
122 |
'help' => '', // Translation added later.
|
123 |
+
],
|
124 |
+
'linkdex' => [
|
125 |
'type' => 'hidden',
|
126 |
'title' => 'linkdex',
|
127 |
'default_value' => '0',
|
128 |
'description' => '',
|
129 |
+
],
|
130 |
+
'content_score' => [
|
131 |
'type' => 'hidden',
|
132 |
'title' => 'content_score',
|
133 |
'default_value' => '0',
|
134 |
'description' => '',
|
135 |
+
],
|
136 |
+
'is_cornerstone' => [
|
137 |
'type' => 'hidden',
|
138 |
'title' => 'is_cornerstone',
|
139 |
'default_value' => 'false',
|
140 |
'description' => '',
|
141 |
+
],
|
142 |
+
],
|
143 |
+
'advanced' => [
|
144 |
+
'meta-robots-noindex' => [
|
145 |
'type' => 'select',
|
146 |
'title' => '', // Translation added later.
|
147 |
'default_value' => '0', // = post-type default.
|
148 |
+
'options' => [
|
149 |
'0' => '', // Post type default - translation added later.
|
150 |
'2' => '', // Index - translation added later.
|
151 |
'1' => '', // No-index - translation added later.
|
152 |
+
],
|
153 |
+
],
|
154 |
+
'meta-robots-nofollow' => [
|
155 |
'type' => 'radio',
|
156 |
'title' => '', // Translation added later.
|
157 |
'default_value' => '0', // = follow.
|
158 |
+
'options' => [
|
159 |
'0' => '', // Follow - translation added later.
|
160 |
'1' => '', // No-follow - translation added later.
|
161 |
+
],
|
162 |
+
],
|
163 |
+
'meta-robots-adv' => [
|
164 |
'type' => 'multiselect',
|
165 |
'title' => '', // Translation added later.
|
166 |
'default_value' => '',
|
167 |
'description' => '', // Translation added later.
|
168 |
+
'options' => [
|
169 |
'noimageindex' => '', // Translation added later.
|
170 |
'noarchive' => '', // Translation added later.
|
171 |
'nosnippet' => '', // Translation added later.
|
172 |
+
],
|
173 |
+
],
|
174 |
+
'bctitle' => [
|
175 |
'type' => 'text',
|
176 |
'title' => '', // Translation added later.
|
177 |
'default_value' => '',
|
178 |
'description' => '', // Translation added later.
|
179 |
+
],
|
180 |
+
'canonical' => [
|
181 |
'type' => 'text',
|
182 |
'title' => '', // Translation added later.
|
183 |
'default_value' => '',
|
184 |
'description' => '', // Translation added later.
|
185 |
+
],
|
186 |
+
'redirect' => [
|
187 |
'type' => 'text',
|
188 |
'title' => '', // Translation added later.
|
189 |
'default_value' => '',
|
190 |
'description' => '', // Translation added later.
|
191 |
+
],
|
192 |
+
],
|
193 |
+
'social' => [],
|
194 |
/* Fields we should validate & save, but not show on any form. */
|
195 |
+
'non_form' => [
|
196 |
+
'linkdex' => [
|
197 |
'type' => null,
|
198 |
'default_value' => '0',
|
199 |
+
],
|
200 |
+
],
|
201 |
+
];
|
202 |
|
203 |
/**
|
204 |
* Helper property - reverse index of the definition array.
|
209 |
*
|
210 |
* @var array
|
211 |
*/
|
212 |
+
public static $fields_index = [];
|
213 |
|
214 |
/**
|
215 |
* Helper property - array containing only the defaults in the format:
|
217 |
*
|
218 |
* @var array
|
219 |
*/
|
220 |
+
public static $defaults = [];
|
221 |
|
222 |
/**
|
223 |
* Helper property to define the social network meta field definitions - networks.
|
224 |
*
|
225 |
* @var array
|
226 |
*/
|
227 |
+
private static $social_networks = [
|
228 |
'opengraph' => 'opengraph',
|
229 |
'twitter' => 'twitter',
|
230 |
+
];
|
231 |
|
232 |
/**
|
233 |
* Helper property to define the social network meta field definitions - fields and their type.
|
234 |
*
|
235 |
* @var array
|
236 |
*/
|
237 |
+
private static $social_fields = [
|
238 |
'title' => 'text',
|
239 |
'description' => 'textarea',
|
240 |
'image' => 'upload',
|
241 |
'image-id' => 'hidden',
|
242 |
+
];
|
243 |
|
244 |
/**
|
245 |
* Register our actions and filters.
|
251 |
foreach ( self::$social_networks as $option => $network ) {
|
252 |
if ( true === WPSEO_Options::get( $option, false ) ) {
|
253 |
foreach ( self::$social_fields as $box => $type ) {
|
254 |
+
self::$meta_fields['social'][ $network . '-' . $box ] = [
|
255 |
'type' => $type,
|
256 |
'title' => '', // Translation added later.
|
257 |
'default_value' => '',
|
258 |
'description' => '', // Translation added later.
|
259 |
+
];
|
260 |
}
|
261 |
}
|
262 |
}
|
266 |
* Allow add-on plugins to register their meta fields for management by this class.
|
267 |
* Calls to add_filter() must be made before plugins_loaded prio 14.
|
268 |
*/
|
269 |
+
$extra_fields = apply_filters( 'add_extra_wpseo_meta_fields', [] );
|
270 |
if ( is_array( $extra_fields ) ) {
|
271 |
self::$meta_fields = self::array_merge_recursive_distinct( $extra_fields, self::$meta_fields );
|
272 |
}
|
278 |
register_meta(
|
279 |
'post',
|
280 |
self::$meta_prefix . $key,
|
281 |
+
[ 'sanitize_callback' => [ __CLASS__, 'sanitize_post_meta' ] ]
|
282 |
);
|
283 |
|
284 |
// Set the $fields_index property for efficiency.
|
285 |
+
self::$fields_index[ self::$meta_prefix . $key ] = [
|
286 |
'subset' => $subset,
|
287 |
'key' => $key,
|
288 |
+
];
|
289 |
|
290 |
// Set the $defaults property for efficiency.
|
291 |
if ( isset( $field_def['default_value'] ) ) {
|
299 |
}
|
300 |
unset( $subset, $field_group, $key, $field_def );
|
301 |
|
302 |
+
add_filter( 'update_post_metadata', [ __CLASS__, 'remove_meta_if_default' ], 10, 5 );
|
303 |
+
add_filter( 'add_post_metadata', [ __CLASS__, 'dont_save_meta_if_default' ], 10, 4 );
|
304 |
}
|
305 |
|
306 |
/**
|
313 |
*/
|
314 |
public static function get_meta_field_defs( $tab, $post_type = 'post' ) {
|
315 |
if ( ! isset( self::$meta_fields[ $tab ] ) ) {
|
316 |
+
return [];
|
317 |
}
|
318 |
|
319 |
$field_defs = self::$meta_fields[ $tab ];
|
321 |
switch ( $tab ) {
|
322 |
case 'non-form':
|
323 |
// Prevent non-form fields from being passed to forms.
|
324 |
+
$field_defs = [];
|
325 |
break;
|
326 |
|
327 |
case 'advanced':
|
328 |
global $post;
|
329 |
|
330 |
if ( ! WPSEO_Capability_Utils::current_user_can( 'wpseo_edit_advanced_metadata' ) && WPSEO_Options::get( 'disableadvanced_meta' ) ) {
|
331 |
+
return [];
|
332 |
}
|
333 |
|
334 |
$post_type = '';
|
340 |
}
|
341 |
|
342 |
if ( $post_type === '' ) {
|
343 |
+
return [];
|
344 |
}
|
345 |
|
346 |
/* Adjust the no-index text strings based on the post type. */
|
397 |
|
398 |
case ( $field_def['type'] === 'checkbox' ):
|
399 |
// Only allow value if it's one of the predefined options.
|
400 |
+
if ( in_array( $meta_value, [ 'on', 'off' ], true ) ) {
|
401 |
$clean = $meta_value;
|
402 |
}
|
403 |
break;
|
426 |
break;
|
427 |
|
428 |
|
429 |
+
case ( $field_def['type'] === 'upload' && in_array( $meta_key, [ self::$meta_prefix . 'opengraph-image', self::$meta_prefix . 'twitter-image' ], true ) ):
|
430 |
// Validate as url.
|
431 |
+
$url = WPSEO_Utils::sanitize_url( $meta_value, [ 'http', 'https', 'ftp', 'ftps' ] );
|
432 |
if ( $url !== '' ) {
|
433 |
$clean = $url;
|
434 |
}
|
450 |
if ( is_string( $meta_value ) ) {
|
451 |
// Remove line breaks and tabs.
|
452 |
// @todo [JRF => Yoast] Verify that line breaks and the likes aren't allowed/recommended in meta header fields.
|
453 |
+
$meta_value = str_replace( [ "\n", "\r", "\t", ' ' ], ' ', $meta_value );
|
454 |
$clean = WPSEO_Utils::sanitize_text_field( trim( $meta_value ) );
|
455 |
}
|
456 |
break;
|
491 |
$meta_value = explode( ',', $meta_value );
|
492 |
}
|
493 |
|
494 |
+
if ( is_array( $meta_value ) && $meta_value !== [] ) {
|
495 |
$meta_value = array_map( 'trim', $meta_value );
|
496 |
|
497 |
// Individual selected entries.
|
498 |
+
$cleaning = [];
|
499 |
foreach ( $meta_value as $value ) {
|
500 |
if ( isset( $options[ $value ] ) ) {
|
501 |
$cleaning[] = $value;
|
502 |
}
|
503 |
}
|
504 |
|
505 |
+
if ( $cleaning !== [] ) {
|
506 |
$clean = implode( ',', $cleaning );
|
507 |
}
|
508 |
unset( $cleaning, $value );
|
702 |
);
|
703 |
$oldies = $wpdb->get_results( $query );
|
704 |
|
705 |
+
if ( is_array( $oldies ) && $oldies !== [] ) {
|
706 |
foreach ( $oldies as $old ) {
|
707 |
update_post_meta( $old->post_id, $new_metakey, $old->meta_value );
|
708 |
}
|
754 |
);
|
755 |
$oldies = $wpdb->get_results( $query );
|
756 |
|
757 |
+
if ( is_array( $oldies ) && $oldies !== [] ) {
|
758 |
foreach ( $oldies as $old ) {
|
759 |
$old_values = explode( ',', $old->meta_value );
|
760 |
foreach ( $old_values as $value ) {
|
786 |
* with that key being deleted, not just the empty fields.
|
787 |
* Still, the below implementation is largely based on the delete_meta() function.}}
|
788 |
*/
|
789 |
+
$query = [];
|
790 |
|
791 |
foreach ( self::$meta_fields as $subset => $field_group ) {
|
792 |
foreach ( $field_group as $key => $field_def ) {
|
794 |
continue;
|
795 |
}
|
796 |
|
797 |
+
if ( isset( $field_def['options'] ) && is_array( $field_def['options'] ) && $field_def['options'] !== [] ) {
|
798 |
$valid = $field_def['options'];
|
799 |
// Remove the default value from the valid options.
|
800 |
unset( $valid[ $field_def['default_value'] ] );
|
826 |
$query = "SELECT meta_id FROM {$wpdb->postmeta} WHERE " . implode( ' OR ', $query ) . ';';
|
827 |
$meta_ids = $wpdb->get_col( $query );
|
828 |
|
829 |
+
if ( is_array( $meta_ids ) && $meta_ids !== [] ) {
|
830 |
// WP native action.
|
831 |
do_action( 'delete_post_meta', $meta_ids, null, null, null );
|
832 |
|
858 |
);
|
859 |
$oldies = $wpdb->get_results( $query );
|
860 |
|
861 |
+
if ( is_array( $oldies ) && $oldies !== [] ) {
|
862 |
foreach ( $oldies as $old ) {
|
863 |
$clean = self::validate_meta_robots_adv( $old->meta_value );
|
864 |
|
899 |
|
900 |
$arrays = func_get_args();
|
901 |
if ( count( $arrays ) < 2 ) {
|
902 |
+
if ( $arrays === [] ) {
|
903 |
+
return [];
|
904 |
}
|
905 |
else {
|
906 |
return $arrays[0];
|
935 |
public static function keyword_usage( $keyword, $post_id ) {
|
936 |
|
937 |
if ( empty( $keyword ) ) {
|
938 |
+
return [];
|
939 |
}
|
940 |
|
941 |
+
$query = [
|
942 |
+
'meta_query' => [
|
943 |
'relation' => 'OR',
|
944 |
+
[
|
945 |
'key' => '_yoast_wpseo_focuskw',
|
946 |
'value' => $keyword,
|
947 |
+
],
|
948 |
+
],
|
949 |
+
'post__not_in' => [ $post_id ],
|
950 |
'fields' => 'ids',
|
951 |
'post_type' => 'any',
|
952 |
|
957 |
* - Two or more: Keyword has been used twice before
|
958 |
*/
|
959 |
'posts_per_page' => 2,
|
960 |
+
];
|
961 |
|
962 |
// If Yoast SEO Premium is active, get the additional keywords as well.
|
963 |
if ( WPSEO_Utils::is_yoast_seo_premium() ) {
|
964 |
+
$query['meta_query'][] = [
|
965 |
'key' => '_yoast_wpseo_focuskeywords',
|
966 |
'value' => sprintf( '"keyword":"%s"', $keyword ),
|
967 |
'compare' => 'LIKE',
|
968 |
+
];
|
969 |
}
|
970 |
|
971 |
$get_posts = new WP_Query( $query );
|
inc/class-wpseo-primary-term.php
CHANGED
@@ -72,7 +72,7 @@ class WPSEO_Primary_Term {
|
|
72 |
$terms = get_the_terms( $this->post_ID, $this->taxonomy_name );
|
73 |
|
74 |
if ( ! is_array( $terms ) ) {
|
75 |
-
$terms =
|
76 |
}
|
77 |
|
78 |
return $terms;
|
72 |
$terms = get_the_terms( $this->post_ID, $this->taxonomy_name );
|
73 |
|
74 |
if ( ! is_array( $terms ) ) {
|
75 |
+
$terms = [];
|
76 |
}
|
77 |
|
78 |
return $terms;
|
inc/class-wpseo-rank.php
CHANGED
@@ -50,37 +50,37 @@ class WPSEO_Rank {
|
|
50 |
*
|
51 |
* @var array
|
52 |
*/
|
53 |
-
protected static $ranks =
|
54 |
self::BAD,
|
55 |
self::OK,
|
56 |
self::GOOD,
|
57 |
self::NO_FOCUS,
|
58 |
self::NO_INDEX,
|
59 |
-
|
60 |
|
61 |
/**
|
62 |
* Holds the translation from seo score slug to actual score range.
|
63 |
*
|
64 |
* @var array
|
65 |
*/
|
66 |
-
protected static $ranges =
|
67 |
-
self::NO_FOCUS =>
|
68 |
'start' => 0,
|
69 |
'end' => 0,
|
70 |
-
|
71 |
-
self::BAD =>
|
72 |
'start' => 1,
|
73 |
'end' => 40,
|
74 |
-
|
75 |
-
self::OK =>
|
76 |
'start' => 41,
|
77 |
'end' => 70,
|
78 |
-
|
79 |
-
self::GOOD =>
|
80 |
'start' => 71,
|
81 |
'end' => 100,
|
82 |
-
|
83 |
-
|
84 |
|
85 |
/**
|
86 |
* The current rank.
|
@@ -117,13 +117,13 @@ class WPSEO_Rank {
|
|
117 |
* @return string
|
118 |
*/
|
119 |
public function get_css_class() {
|
120 |
-
$labels =
|
121 |
self::NO_FOCUS => 'na',
|
122 |
self::NO_INDEX => 'noindex',
|
123 |
self::BAD => 'bad',
|
124 |
self::OK => 'ok',
|
125 |
self::GOOD => 'good',
|
126 |
-
|
127 |
|
128 |
return $labels[ $this->rank ];
|
129 |
}
|
@@ -134,13 +134,13 @@ class WPSEO_Rank {
|
|
134 |
* @return string
|
135 |
*/
|
136 |
public function get_label() {
|
137 |
-
$labels =
|
138 |
self::NO_FOCUS => __( 'Not available', 'wordpress-seo' ),
|
139 |
self::NO_INDEX => __( 'No index', 'wordpress-seo' ),
|
140 |
self::BAD => __( 'Needs improvement', 'wordpress-seo' ),
|
141 |
self::OK => __( 'OK', 'wordpress-seo' ),
|
142 |
self::GOOD => __( 'Good', 'wordpress-seo' ),
|
143 |
-
|
144 |
|
145 |
return $labels[ $this->rank ];
|
146 |
}
|
@@ -151,7 +151,7 @@ class WPSEO_Rank {
|
|
151 |
* @return mixed
|
152 |
*/
|
153 |
public function get_drop_down_label() {
|
154 |
-
$labels =
|
155 |
self::NO_FOCUS => sprintf(
|
156 |
/* translators: %s expands to the SEO score */
|
157 |
__( 'SEO: %s', 'wordpress-seo' ),
|
@@ -177,7 +177,7 @@ class WPSEO_Rank {
|
|
177 |
__( 'SEO: %s', 'wordpress-seo' ),
|
178 |
__( 'Post Noindexed', 'wordpress-seo' )
|
179 |
),
|
180 |
-
|
181 |
|
182 |
return $labels[ $this->rank ];
|
183 |
}
|
@@ -188,7 +188,7 @@ class WPSEO_Rank {
|
|
188 |
* @return string The readability rank label.
|
189 |
*/
|
190 |
public function get_drop_down_readability_labels() {
|
191 |
-
$labels =
|
192 |
self::BAD => sprintf(
|
193 |
/* translators: %s expands to the readability score */
|
194 |
__( 'Readability: %s', 'wordpress-seo' ),
|
@@ -204,7 +204,7 @@ class WPSEO_Rank {
|
|
204 |
__( 'Readability: %s', 'wordpress-seo' ),
|
205 |
__( 'Good', 'wordpress-seo' )
|
206 |
),
|
207 |
-
|
208 |
|
209 |
return $labels[ $this->rank ];
|
210 |
}
|
@@ -264,7 +264,7 @@ class WPSEO_Rank {
|
|
264 |
* @return WPSEO_Rank[]
|
265 |
*/
|
266 |
public static function get_all_ranks() {
|
267 |
-
return array_map(
|
268 |
}
|
269 |
|
270 |
/**
|
@@ -273,7 +273,7 @@ class WPSEO_Rank {
|
|
273 |
* @return WPSEO_Rank[]
|
274 |
*/
|
275 |
public static function get_all_readability_ranks() {
|
276 |
-
return array_map(
|
277 |
}
|
278 |
|
279 |
/**
|
50 |
*
|
51 |
* @var array
|
52 |
*/
|
53 |
+
protected static $ranks = [
|
54 |
self::BAD,
|
55 |
self::OK,
|
56 |
self::GOOD,
|
57 |
self::NO_FOCUS,
|
58 |
self::NO_INDEX,
|
59 |
+
];
|
60 |
|
61 |
/**
|
62 |
* Holds the translation from seo score slug to actual score range.
|
63 |
*
|
64 |
* @var array
|
65 |
*/
|
66 |
+
protected static $ranges = [
|
67 |
+
self::NO_FOCUS => [
|
68 |
'start' => 0,
|
69 |
'end' => 0,
|
70 |
+
],
|
71 |
+
self::BAD => [
|
72 |
'start' => 1,
|
73 |
'end' => 40,
|
74 |
+
],
|
75 |
+
self::OK => [
|
76 |
'start' => 41,
|
77 |
'end' => 70,
|
78 |
+
],
|
79 |
+
self::GOOD => [
|
80 |
'start' => 71,
|
81 |
'end' => 100,
|
82 |
+
],
|
83 |
+
];
|
84 |
|
85 |
/**
|
86 |
* The current rank.
|
117 |
* @return string
|
118 |
*/
|
119 |
public function get_css_class() {
|
120 |
+
$labels = [
|
121 |
self::NO_FOCUS => 'na',
|
122 |
self::NO_INDEX => 'noindex',
|
123 |
self::BAD => 'bad',
|
124 |
self::OK => 'ok',
|
125 |
self::GOOD => 'good',
|
126 |
+
];
|
127 |
|
128 |
return $labels[ $this->rank ];
|
129 |
}
|
134 |
* @return string
|
135 |
*/
|
136 |
public function get_label() {
|
137 |
+
$labels = [
|
138 |
self::NO_FOCUS => __( 'Not available', 'wordpress-seo' ),
|
139 |
self::NO_INDEX => __( 'No index', 'wordpress-seo' ),
|
140 |
self::BAD => __( 'Needs improvement', 'wordpress-seo' ),
|
141 |
self::OK => __( 'OK', 'wordpress-seo' ),
|
142 |
self::GOOD => __( 'Good', 'wordpress-seo' ),
|
143 |
+
];
|
144 |
|
145 |
return $labels[ $this->rank ];
|
146 |
}
|
151 |
* @return mixed
|
152 |
*/
|
153 |
public function get_drop_down_label() {
|
154 |
+
$labels = [
|
155 |
self::NO_FOCUS => sprintf(
|
156 |
/* translators: %s expands to the SEO score */
|
157 |
__( 'SEO: %s', 'wordpress-seo' ),
|
177 |
__( 'SEO: %s', 'wordpress-seo' ),
|
178 |
__( 'Post Noindexed', 'wordpress-seo' )
|
179 |
),
|
180 |
+
];
|
181 |
|
182 |
return $labels[ $this->rank ];
|
183 |
}
|
188 |
* @return string The readability rank label.
|
189 |
*/
|
190 |
public function get_drop_down_readability_labels() {
|
191 |
+
$labels = [
|
192 |
self::BAD => sprintf(
|
193 |
/* translators: %s expands to the readability score */
|
194 |
__( 'Readability: %s', 'wordpress-seo' ),
|
204 |
__( 'Readability: %s', 'wordpress-seo' ),
|
205 |
__( 'Good', 'wordpress-seo' )
|
206 |
),
|
207 |
+
];
|
208 |
|
209 |
return $labels[ $this->rank ];
|
210 |
}
|
264 |
* @return WPSEO_Rank[]
|
265 |
*/
|
266 |
public static function get_all_ranks() {
|
267 |
+
return array_map( [ 'WPSEO_Rank', 'create_rank' ], self::$ranks );
|
268 |
}
|
269 |
|
270 |
/**
|
273 |
* @return WPSEO_Rank[]
|
274 |
*/
|
275 |
public static function get_all_readability_ranks() {
|
276 |
+
return array_map( [ 'WPSEO_Rank', 'create_rank' ], [ self::BAD, self::OK, self::GOOD ] );
|
277 |
}
|
278 |
|
279 |
/**
|
inc/class-wpseo-replace-vars.php
CHANGED
@@ -26,7 +26,7 @@ class WPSEO_Replace_Vars {
|
|
26 |
*
|
27 |
* @var array
|
28 |
*/
|
29 |
-
protected $defaults =
|
30 |
'ID' => '',
|
31 |
'name' => '',
|
32 |
'post_author' => '',
|
@@ -38,7 +38,7 @@ class WPSEO_Replace_Vars {
|
|
38 |
'taxonomy' => '',
|
39 |
'term_id' => '',
|
40 |
'term404' => '',
|
41 |
-
|
42 |
|
43 |
/**
|
44 |
* Current post/page/cpt information.
|
@@ -59,14 +59,14 @@ class WPSEO_Replace_Vars {
|
|
59 |
*
|
60 |
* @var array
|
61 |
*/
|
62 |
-
protected static $help_texts =
|
63 |
|
64 |
/**
|
65 |
* Register of additional variable replacements registered by other plugins/themes.
|
66 |
*
|
67 |
* @var array
|
68 |
*/
|
69 |
-
protected static $external_replacements =
|
70 |
|
71 |
/**
|
72 |
* Constructor.
|
@@ -81,12 +81,12 @@ class WPSEO_Replace_Vars {
|
|
81 |
* Setup the help texts and external replacements as statics so they will be available to all instances.
|
82 |
*/
|
83 |
public static function setup_statics_once() {
|
84 |
-
if ( self::$help_texts ===
|
85 |
self::set_basic_help_texts();
|
86 |
self::set_advanced_help_texts();
|
87 |
}
|
88 |
|
89 |
-
if ( self::$external_replacements ===
|
90 |
/**
|
91 |
* Action: 'wpseo_register_extra_replacements' - Allows for registration of additional
|
92 |
* variables to replace.
|
@@ -152,7 +152,7 @@ class WPSEO_Replace_Vars {
|
|
152 |
*
|
153 |
* @return string
|
154 |
*/
|
155 |
-
public function replace( $string, $args, $omit =
|
156 |
|
157 |
$string = wp_strip_all_tags( $string );
|
158 |
|
@@ -171,11 +171,11 @@ class WPSEO_Replace_Vars {
|
|
171 |
$this->args = (object) wp_parse_args( $args, $this->defaults );
|
172 |
|
173 |
// Clean $omit array.
|
174 |
-
if ( is_array( $omit ) && $omit !==
|
175 |
-
$omit = array_map(
|
176 |
}
|
177 |
|
178 |
-
$replacements =
|
179 |
if ( preg_match_all( '`%%([^%]+(%%single)?)%%?`iu', $string, $matches ) ) {
|
180 |
$replacements = $this->set_up_replacements( $matches, $omit );
|
181 |
}
|
@@ -191,7 +191,7 @@ class WPSEO_Replace_Vars {
|
|
191 |
$replacements = apply_filters( 'wpseo_replacements', $replacements, $this->args );
|
192 |
|
193 |
// Do the actual replacements.
|
194 |
-
if ( is_array( $replacements ) && $replacements !==
|
195 |
$string = str_replace( array_keys( $replacements ), array_values( $replacements ), $string );
|
196 |
}
|
197 |
|
@@ -206,7 +206,7 @@ class WPSEO_Replace_Vars {
|
|
206 |
if ( apply_filters( 'wpseo_replacements_final', true ) === true && ( isset( $matches[1] ) && is_array( $matches[1] ) ) ) {
|
207 |
// Remove non-replaced variables.
|
208 |
$remove = array_diff( $matches[1], $omit ); // Make sure the $omit variables do not get removed.
|
209 |
-
$remove = array_map(
|
210 |
$string = str_replace( $remove, '', $string );
|
211 |
}
|
212 |
|
@@ -233,7 +233,7 @@ class WPSEO_Replace_Vars {
|
|
233 |
*/
|
234 |
private function set_up_replacements( $matches, $omit ) {
|
235 |
|
236 |
-
$replacements =
|
237 |
|
238 |
// @todo Figure out a way to deal with external functions starting with cf_/ct_.
|
239 |
foreach ( $matches[1] as $k => $var ) {
|
@@ -635,7 +635,7 @@ class WPSEO_Replace_Vars {
|
|
635 |
$pt_plural = null;
|
636 |
$post_type = '';
|
637 |
|
638 |
-
if ( isset( $wp_query->query_vars['post_type'] ) && ( ( is_string( $wp_query->query_vars['post_type'] ) && $wp_query->query_vars['post_type'] !== '' ) || ( is_array( $wp_query->query_vars['post_type'] ) && $wp_query->query_vars['post_type'] !==
|
639 |
$post_type = $wp_query->query_vars['post_type'];
|
640 |
}
|
641 |
elseif ( isset( $this->args->post_type ) && ( is_string( $this->args->post_type ) && $this->args->post_type !== '' ) ) {
|
@@ -752,7 +752,7 @@ class WPSEO_Replace_Vars {
|
|
752 |
$tax = substr( $var, 8 );
|
753 |
if ( is_object( $post ) && isset( $post->ID ) ) {
|
754 |
$terms = get_the_terms( $post->ID, $tax );
|
755 |
-
if ( is_array( $terms ) && $terms !==
|
756 |
$term = current( $terms );
|
757 |
$term_desc = get_term_field( 'description', $term->term_id, $tax );
|
758 |
if ( $term_desc !== '' ) {
|
@@ -1064,7 +1064,7 @@ class WPSEO_Replace_Vars {
|
|
1064 |
private static function register_help_text( $type, WPSEO_Replacement_Variable $replacement_variable ) {
|
1065 |
$identifier = $replacement_variable->get_variable();
|
1066 |
|
1067 |
-
if ( ( is_string( $type ) && in_array( $type,
|
1068 |
&& ( $identifier !== '' && ! isset( self::$help_texts[ $type ][ $identifier ] ) )
|
1069 |
) {
|
1070 |
self::$help_texts[ $type ][ $identifier ] = $replacement_variable;
|
@@ -1085,7 +1085,7 @@ class WPSEO_Replace_Vars {
|
|
1085 |
WPSEO_Custom_Taxonomies::get_custom_taxonomies()
|
1086 |
);
|
1087 |
|
1088 |
-
return array_map(
|
1089 |
}
|
1090 |
|
1091 |
/**
|
@@ -1096,7 +1096,7 @@ class WPSEO_Replace_Vars {
|
|
1096 |
private function get_replacement_variables() {
|
1097 |
$help_texts = array_merge( self::$help_texts['basic'], self::$help_texts['advanced'] );
|
1098 |
|
1099 |
-
return array_filter( array_keys( $help_texts ),
|
1100 |
}
|
1101 |
|
1102 |
/**
|
@@ -1107,7 +1107,7 @@ class WPSEO_Replace_Vars {
|
|
1107 |
* @return bool True when the replacement variable is not prefixed.
|
1108 |
*/
|
1109 |
private function is_not_prefixed( $replacement_variable ) {
|
1110 |
-
$prefixes =
|
1111 |
$prefix = $this->get_prefix( $replacement_variable );
|
1112 |
|
1113 |
return ! in_array( $prefix, $prefixes, true );
|
@@ -1188,11 +1188,11 @@ class WPSEO_Replace_Vars {
|
|
1188 |
* @return array The formatted replacement variable.
|
1189 |
*/
|
1190 |
private function format_replacement_variable( $replacement_variable ) {
|
1191 |
-
return
|
1192 |
'name' => $replacement_variable,
|
1193 |
'value' => '',
|
1194 |
'label' => $this->get_label( $replacement_variable ),
|
1195 |
-
|
1196 |
}
|
1197 |
|
1198 |
/**
|
@@ -1223,10 +1223,10 @@ class WPSEO_Replace_Vars {
|
|
1223 |
$fields = $wpdb->get_col( $wpdb->prepare( $sql, $wpdb->esc_like( '_' ) . '%', $limit ) );
|
1224 |
|
1225 |
if ( is_array( $fields ) ) {
|
1226 |
-
return array_map(
|
1227 |
}
|
1228 |
|
1229 |
-
return
|
1230 |
}
|
1231 |
|
1232 |
/**
|
@@ -1246,23 +1246,23 @@ class WPSEO_Replace_Vars {
|
|
1246 |
* @return array The custom taxonomy prefixed names.
|
1247 |
*/
|
1248 |
private function get_custom_taxonomies() {
|
1249 |
-
$args =
|
1250 |
'public' => true,
|
1251 |
'_builtin' => false,
|
1252 |
-
|
1253 |
$output = 'names';
|
1254 |
$operator = 'and';
|
1255 |
$custom_taxonomies = get_taxonomies( $args, $output, $operator );
|
1256 |
|
1257 |
if ( is_array( $custom_taxonomies ) ) {
|
1258 |
-
$ct_replace_vars =
|
1259 |
foreach ( $custom_taxonomies as $custom_taxonomy ) {
|
1260 |
array_push( $ct_replace_vars, 'ct_' . $custom_taxonomy, 'ct_desc_' . $custom_taxonomy );
|
1261 |
}
|
1262 |
return $ct_replace_vars;
|
1263 |
}
|
1264 |
|
1265 |
-
return
|
1266 |
}
|
1267 |
|
1268 |
/**
|
@@ -1277,7 +1277,7 @@ class WPSEO_Replace_Vars {
|
|
1277 |
'wp_title()'
|
1278 |
);
|
1279 |
|
1280 |
-
$replacement_variables =
|
1281 |
new WPSEO_Replacement_Variable( 'date', __( 'Date', 'wordpress-seo' ), __( 'Replaced with the date of the post/page', 'wordpress-seo' ) ),
|
1282 |
new WPSEO_Replacement_Variable( 'title', __( 'Title', 'wordpress-seo' ), __( 'Replaced with the title of the post/page', 'wordpress-seo' ) ),
|
1283 |
new WPSEO_Replacement_Variable( 'parent_title', __( 'Parent title', 'wordpress-seo' ), __( 'Replaced with the title of the parent page of the current page', 'wordpress-seo' ) ),
|
@@ -1295,7 +1295,7 @@ class WPSEO_Replace_Vars {
|
|
1295 |
new WPSEO_Replacement_Variable( 'term_title', __( 'Term title', 'wordpress-seo' ), __( 'Replaced with the term name', 'wordpress-seo' ) ),
|
1296 |
new WPSEO_Replacement_Variable( 'searchphrase', __( 'Search phrase', 'wordpress-seo' ), __( 'Replaced with the current search phrase', 'wordpress-seo' ) ),
|
1297 |
new WPSEO_Replacement_Variable( 'sep', __( 'Separator', 'wordpress-seo' ), $separator_description ),
|
1298 |
-
|
1299 |
|
1300 |
foreach ( $replacement_variables as $replacement_variable ) {
|
1301 |
self::register_help_text( 'basic', $replacement_variable );
|
@@ -1306,7 +1306,7 @@ class WPSEO_Replace_Vars {
|
|
1306 |
* Set/translate the help texts for the WPSEO standard advanced variables.
|
1307 |
*/
|
1308 |
private static function set_advanced_help_texts() {
|
1309 |
-
$replacement_variables =
|
1310 |
new WPSEO_Replacement_Variable( 'pt_single', __( 'Post type (singular)', 'wordpress-seo' ), __( 'Replaced with the content type single label', 'wordpress-seo' ) ),
|
1311 |
new WPSEO_Replacement_Variable( 'pt_plural', __( 'Post type (plural)', 'wordpress-seo' ), __( 'Replaced with the content type plural label', 'wordpress-seo' ) ),
|
1312 |
new WPSEO_Replacement_Variable( 'modified', __( 'Modified', 'wordpress-seo' ), __( 'Replaced with the post/page modified time', 'wordpress-seo' ) ),
|
@@ -1322,7 +1322,7 @@ class WPSEO_Replace_Vars {
|
|
1322 |
new WPSEO_Replacement_Variable( 'cf_<custom-field-name>', '<custom-field-name> ' . __( '(custom field)', 'wordpress-seo' ), __( 'Replaced with a posts custom field value', 'wordpress-seo' ) ),
|
1323 |
new WPSEO_Replacement_Variable( 'ct_<custom-tax-name>', '<custom-tax-name> ' . __( '(custom taxonomy)', 'wordpress-seo' ), __( 'Replaced with a posts custom taxonomies, comma separated.', 'wordpress-seo' ) ),
|
1324 |
new WPSEO_Replacement_Variable( 'ct_desc_<custom-tax-name>', '<custom-tax-name> ' . __( 'description (custom taxonomy)', 'wordpress-seo' ), __( 'Replaced with a custom taxonomies description', 'wordpress-seo' ) ),
|
1325 |
-
|
1326 |
|
1327 |
foreach ( $replacement_variables as $replacement_variable ) {
|
1328 |
self::register_help_text( 'advanced', $replacement_variable );
|
@@ -1373,7 +1373,7 @@ class WPSEO_Replace_Vars {
|
|
1373 |
}
|
1374 |
elseif ( ! empty( $id ) && ! empty( $taxonomy ) ) {
|
1375 |
$terms = get_the_terms( $id, $taxonomy );
|
1376 |
-
if ( is_array( $terms ) && $terms !==
|
1377 |
foreach ( $terms as $term ) {
|
1378 |
if ( $return_single ) {
|
1379 |
$output = $term->name;
|
26 |
*
|
27 |
* @var array
|
28 |
*/
|
29 |
+
protected $defaults = [
|
30 |
'ID' => '',
|
31 |
'name' => '',
|
32 |
'post_author' => '',
|
38 |
'taxonomy' => '',
|
39 |
'term_id' => '',
|
40 |
'term404' => '',
|
41 |
+
];
|
42 |
|
43 |
/**
|
44 |
* Current post/page/cpt information.
|
59 |
*
|
60 |
* @var array
|
61 |
*/
|
62 |
+
protected static $help_texts = [];
|
63 |
|
64 |
/**
|
65 |
* Register of additional variable replacements registered by other plugins/themes.
|
66 |
*
|
67 |
* @var array
|
68 |
*/
|
69 |
+
protected static $external_replacements = [];
|
70 |
|
71 |
/**
|
72 |
* Constructor.
|
81 |
* Setup the help texts and external replacements as statics so they will be available to all instances.
|
82 |
*/
|
83 |
public static function setup_statics_once() {
|
84 |
+
if ( self::$help_texts === [] ) {
|
85 |
self::set_basic_help_texts();
|
86 |
self::set_advanced_help_texts();
|
87 |
}
|
88 |
|
89 |
+
if ( self::$external_replacements === [] ) {
|
90 |
/**
|
91 |
* Action: 'wpseo_register_extra_replacements' - Allows for registration of additional
|
92 |
* variables to replace.
|
152 |
*
|
153 |
* @return string
|
154 |
*/
|
155 |
+
public function replace( $string, $args, $omit = [] ) {
|
156 |
|
157 |
$string = wp_strip_all_tags( $string );
|
158 |
|
171 |
$this->args = (object) wp_parse_args( $args, $this->defaults );
|
172 |
|
173 |
// Clean $omit array.
|
174 |
+
if ( is_array( $omit ) && $omit !== [] ) {
|
175 |
+
$omit = array_map( [ __CLASS__, 'remove_var_delimiter' ], $omit );
|
176 |
}
|
177 |
|
178 |
+
$replacements = [];
|
179 |
if ( preg_match_all( '`%%([^%]+(%%single)?)%%?`iu', $string, $matches ) ) {
|
180 |
$replacements = $this->set_up_replacements( $matches, $omit );
|
181 |
}
|
191 |
$replacements = apply_filters( 'wpseo_replacements', $replacements, $this->args );
|
192 |
|
193 |
// Do the actual replacements.
|
194 |
+
if ( is_array( $replacements ) && $replacements !== [] ) {
|
195 |
$string = str_replace( array_keys( $replacements ), array_values( $replacements ), $string );
|
196 |
}
|
197 |
|
206 |
if ( apply_filters( 'wpseo_replacements_final', true ) === true && ( isset( $matches[1] ) && is_array( $matches[1] ) ) ) {
|
207 |
// Remove non-replaced variables.
|
208 |
$remove = array_diff( $matches[1], $omit ); // Make sure the $omit variables do not get removed.
|
209 |
+
$remove = array_map( [ __CLASS__, 'add_var_delimiter' ], $remove );
|
210 |
$string = str_replace( $remove, '', $string );
|
211 |
}
|
212 |
|
233 |
*/
|
234 |
private function set_up_replacements( $matches, $omit ) {
|
235 |
|
236 |
+
$replacements = [];
|
237 |
|
238 |
// @todo Figure out a way to deal with external functions starting with cf_/ct_.
|
239 |
foreach ( $matches[1] as $k => $var ) {
|
635 |
$pt_plural = null;
|
636 |
$post_type = '';
|
637 |
|
638 |
+
if ( isset( $wp_query->query_vars['post_type'] ) && ( ( is_string( $wp_query->query_vars['post_type'] ) && $wp_query->query_vars['post_type'] !== '' ) || ( is_array( $wp_query->query_vars['post_type'] ) && $wp_query->query_vars['post_type'] !== [] ) ) ) {
|
639 |
$post_type = $wp_query->query_vars['post_type'];
|
640 |
}
|
641 |
elseif ( isset( $this->args->post_type ) && ( is_string( $this->args->post_type ) && $this->args->post_type !== '' ) ) {
|
752 |
$tax = substr( $var, 8 );
|
753 |
if ( is_object( $post ) && isset( $post->ID ) ) {
|
754 |
$terms = get_the_terms( $post->ID, $tax );
|
755 |
+
if ( is_array( $terms ) && $terms !== [] ) {
|
756 |
$term = current( $terms );
|
757 |
$term_desc = get_term_field( 'description', $term->term_id, $tax );
|
758 |
if ( $term_desc !== '' ) {
|
1064 |
private static function register_help_text( $type, WPSEO_Replacement_Variable $replacement_variable ) {
|
1065 |
$identifier = $replacement_variable->get_variable();
|
1066 |
|
1067 |
+
if ( ( is_string( $type ) && in_array( $type, [ 'basic', 'advanced' ], true ) )
|
1068 |
&& ( $identifier !== '' && ! isset( self::$help_texts[ $type ][ $identifier ] ) )
|
1069 |
) {
|
1070 |
self::$help_texts[ $type ][ $identifier ] = $replacement_variable;
|
1085 |
WPSEO_Custom_Taxonomies::get_custom_taxonomies()
|
1086 |
);
|
1087 |
|
1088 |
+
return array_map( [ $this, 'format_replacement_variable' ], $replacement_variables );
|
1089 |
}
|
1090 |
|
1091 |
/**
|
1096 |
private function get_replacement_variables() {
|
1097 |
$help_texts = array_merge( self::$help_texts['basic'], self::$help_texts['advanced'] );
|
1098 |
|
1099 |
+
return array_filter( array_keys( $help_texts ), [ $this, 'is_not_prefixed' ] );
|
1100 |
}
|
1101 |
|
1102 |
/**
|
1107 |
* @return bool True when the replacement variable is not prefixed.
|
1108 |
*/
|
1109 |
private function is_not_prefixed( $replacement_variable ) {
|
1110 |
+
$prefixes = [ 'cf_', 'ct_' ];
|
1111 |
$prefix = $this->get_prefix( $replacement_variable );
|
1112 |
|
1113 |
return ! in_array( $prefix, $prefixes, true );
|
1188 |
* @return array The formatted replacement variable.
|
1189 |
*/
|
1190 |
private function format_replacement_variable( $replacement_variable ) {
|
1191 |
+
return [
|
1192 |
'name' => $replacement_variable,
|
1193 |
'value' => '',
|
1194 |
'label' => $this->get_label( $replacement_variable ),
|
1195 |
+
];
|
1196 |
}
|
1197 |
|
1198 |
/**
|
1223 |
$fields = $wpdb->get_col( $wpdb->prepare( $sql, $wpdb->esc_like( '_' ) . '%', $limit ) );
|
1224 |
|
1225 |
if ( is_array( $fields ) ) {
|
1226 |
+
return array_map( [ $this, 'add_custom_field_prefix' ], $fields );
|
1227 |
}
|
1228 |
|
1229 |
+
return [];
|
1230 |
}
|
1231 |
|
1232 |
/**
|
1246 |
* @return array The custom taxonomy prefixed names.
|
1247 |
*/
|
1248 |
private function get_custom_taxonomies() {
|
1249 |
+
$args = [
|
1250 |
'public' => true,
|
1251 |
'_builtin' => false,
|
1252 |
+
];
|
1253 |
$output = 'names';
|
1254 |
$operator = 'and';
|
1255 |
$custom_taxonomies = get_taxonomies( $args, $output, $operator );
|
1256 |
|
1257 |
if ( is_array( $custom_taxonomies ) ) {
|
1258 |
+
$ct_replace_vars = [];
|
1259 |
foreach ( $custom_taxonomies as $custom_taxonomy ) {
|
1260 |
array_push( $ct_replace_vars, 'ct_' . $custom_taxonomy, 'ct_desc_' . $custom_taxonomy );
|
1261 |
}
|
1262 |
return $ct_replace_vars;
|
1263 |
}
|
1264 |
|
1265 |
+
return [];
|
1266 |
}
|
1267 |
|
1268 |
/**
|
1277 |
'wp_title()'
|
1278 |
);
|
1279 |
|
1280 |
+
$replacement_variables = [
|
1281 |
new WPSEO_Replacement_Variable( 'date', __( 'Date', 'wordpress-seo' ), __( 'Replaced with the date of the post/page', 'wordpress-seo' ) ),
|
1282 |
new WPSEO_Replacement_Variable( 'title', __( 'Title', 'wordpress-seo' ), __( 'Replaced with the title of the post/page', 'wordpress-seo' ) ),
|
1283 |
new WPSEO_Replacement_Variable( 'parent_title', __( 'Parent title', 'wordpress-seo' ), __( 'Replaced with the title of the parent page of the current page', 'wordpress-seo' ) ),
|
1295 |
new WPSEO_Replacement_Variable( 'term_title', __( 'Term title', 'wordpress-seo' ), __( 'Replaced with the term name', 'wordpress-seo' ) ),
|
1296 |
new WPSEO_Replacement_Variable( 'searchphrase', __( 'Search phrase', 'wordpress-seo' ), __( 'Replaced with the current search phrase', 'wordpress-seo' ) ),
|
1297 |
new WPSEO_Replacement_Variable( 'sep', __( 'Separator', 'wordpress-seo' ), $separator_description ),
|
1298 |
+
];
|
1299 |
|
1300 |
foreach ( $replacement_variables as $replacement_variable ) {
|
1301 |
self::register_help_text( 'basic', $replacement_variable );
|
1306 |
* Set/translate the help texts for the WPSEO standard advanced variables.
|
1307 |
*/
|
1308 |
private static function set_advanced_help_texts() {
|
1309 |
+
$replacement_variables = [
|
1310 |
new WPSEO_Replacement_Variable( 'pt_single', __( 'Post type (singular)', 'wordpress-seo' ), __( 'Replaced with the content type single label', 'wordpress-seo' ) ),
|
1311 |
new WPSEO_Replacement_Variable( 'pt_plural', __( 'Post type (plural)', 'wordpress-seo' ), __( 'Replaced with the content type plural label', 'wordpress-seo' ) ),
|
1312 |
new WPSEO_Replacement_Variable( 'modified', __( 'Modified', 'wordpress-seo' ), __( 'Replaced with the post/page modified time', 'wordpress-seo' ) ),
|
1322 |
new WPSEO_Replacement_Variable( 'cf_<custom-field-name>', '<custom-field-name> ' . __( '(custom field)', 'wordpress-seo' ), __( 'Replaced with a posts custom field value', 'wordpress-seo' ) ),
|
1323 |
new WPSEO_Replacement_Variable( 'ct_<custom-tax-name>', '<custom-tax-name> ' . __( '(custom taxonomy)', 'wordpress-seo' ), __( 'Replaced with a posts custom taxonomies, comma separated.', 'wordpress-seo' ) ),
|
1324 |
new WPSEO_Replacement_Variable( 'ct_desc_<custom-tax-name>', '<custom-tax-name> ' . __( 'description (custom taxonomy)', 'wordpress-seo' ), __( 'Replaced with a custom taxonomies description', 'wordpress-seo' ) ),
|
1325 |
+
];
|
1326 |
|
1327 |
foreach ( $replacement_variables as $replacement_variable ) {
|
1328 |
self::register_help_text( 'advanced', $replacement_variable );
|
1373 |
}
|
1374 |
elseif ( ! empty( $id ) && ! empty( $taxonomy ) ) {
|
1375 |
$terms = get_the_terms( $id, $taxonomy );
|
1376 |
+
if ( is_array( $terms ) && $terms !== [] ) {
|
1377 |
foreach ( $terms as $term ) {
|
1378 |
if ( $return_single ) {
|
1379 |
$output = $term->name;
|
inc/class-wpseo-shortlinker.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_Shortlinker {
|
|
16 |
* @return array The shortlink data.
|
17 |
*/
|
18 |
protected function collect_additional_shortlink_data() {
|
19 |
-
return
|
20 |
'php_version' => $this->get_php_version(),
|
21 |
'platform' => 'wordpress',
|
22 |
'platform_version' => $GLOBALS['wp_version'],
|
@@ -24,7 +24,7 @@ class WPSEO_Shortlinker {
|
|
24 |
'software_version' => WPSEO_VERSION,
|
25 |
'days_active' => $this->get_days_active(),
|
26 |
'user_language' => $this->get_user_language(),
|
27 |
-
|
28 |
}
|
29 |
|
30 |
/**
|
16 |
* @return array The shortlink data.
|
17 |
*/
|
18 |
protected function collect_additional_shortlink_data() {
|
19 |
+
return [
|
20 |
'php_version' => $this->get_php_version(),
|
21 |
'platform' => 'wordpress',
|
22 |
'platform_version' => $GLOBALS['wp_version'],
|
24 |
'software_version' => WPSEO_VERSION,
|
25 |
'days_active' => $this->get_days_active(),
|
26 |
'user_language' => $this->get_user_language(),
|
27 |
+
];
|
28 |
}
|
29 |
|
30 |
/**
|
inc/class-wpseo-statistics.php
CHANGED
@@ -21,31 +21,31 @@ class WPSEO_Statistics {
|
|
21 |
*/
|
22 |
public function get_post_count( $rank ) {
|
23 |
if ( WPSEO_Rank::NO_FOCUS === $rank->get_rank() ) {
|
24 |
-
$posts =
|
25 |
-
'meta_query' =>
|
26 |
'relation' => 'OR',
|
27 |
-
|
28 |
'key' => WPSEO_Meta::$meta_prefix . 'focuskw',
|
29 |
'value' => 'needs-a-value-anyway',
|
30 |
'compare' => 'NOT EXISTS',
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
}
|
35 |
elseif ( WPSEO_Rank::NO_INDEX === $rank->get_rank() ) {
|
36 |
-
$posts =
|
37 |
'meta_key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
38 |
'meta_value' => '1',
|
39 |
'compare' => '=',
|
40 |
-
|
41 |
}
|
42 |
else {
|
43 |
-
$posts =
|
44 |
'meta_key' => WPSEO_Meta::$meta_prefix . 'linkdex',
|
45 |
-
'meta_value' =>
|
46 |
'meta_compare' => 'BETWEEN',
|
47 |
'meta_type' => 'NUMERIC',
|
48 |
-
|
49 |
}
|
50 |
|
51 |
$posts['fields'] = 'ids';
|
21 |
*/
|
22 |
public function get_post_count( $rank ) {
|
23 |
if ( WPSEO_Rank::NO_FOCUS === $rank->get_rank() ) {
|
24 |
+
$posts = [
|
25 |
+
'meta_query' => [
|
26 |
'relation' => 'OR',
|
27 |
+
[
|
28 |
'key' => WPSEO_Meta::$meta_prefix . 'focuskw',
|
29 |
'value' => 'needs-a-value-anyway',
|
30 |
'compare' => 'NOT EXISTS',
|
31 |
+
],
|
32 |
+
],
|
33 |
+
];
|
34 |
}
|
35 |
elseif ( WPSEO_Rank::NO_INDEX === $rank->get_rank() ) {
|
36 |
+
$posts = [
|
37 |
'meta_key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex',
|
38 |
'meta_value' => '1',
|
39 |
'compare' => '=',
|
40 |
+
];
|
41 |
}
|
42 |
else {
|
43 |
+
$posts = [
|
44 |
'meta_key' => WPSEO_Meta::$meta_prefix . 'linkdex',
|
45 |
+
'meta_value' => [ $rank->get_starting_score(), $rank->get_end_score() ],
|
46 |
'meta_compare' => 'BETWEEN',
|
47 |
'meta_type' => 'NUMERIC',
|
48 |
+
];
|
49 |
}
|
50 |
|
51 |
$posts['fields'] = 'ids';
|
inc/class-wpseo-utils.php
CHANGED
@@ -28,7 +28,7 @@ class WPSEO_Utils {
|
|
28 |
*
|
29 |
* @var array
|
30 |
*/
|
31 |
-
protected static $console_notifications =
|
32 |
|
33 |
/**
|
34 |
* Check whether the current user is allowed to access the configuration.
|
@@ -125,7 +125,7 @@ class WPSEO_Utils {
|
|
125 |
static $registered_hook;
|
126 |
|
127 |
if ( is_null( $registered_hook ) ) {
|
128 |
-
add_action( 'admin_footer',
|
129 |
$registered_hook = true;
|
130 |
}
|
131 |
|
@@ -199,7 +199,7 @@ class WPSEO_Utils {
|
|
199 |
* @return string
|
200 |
*/
|
201 |
public static function standardize_whitespace( $string ) {
|
202 |
-
return trim( str_replace( ' ', ' ', str_replace(
|
203 |
}
|
204 |
|
205 |
/**
|
@@ -231,7 +231,7 @@ class WPSEO_Utils {
|
|
231 |
$value = trim( $value );
|
232 |
}
|
233 |
elseif ( is_array( $value ) ) {
|
234 |
-
$value = array_map(
|
235 |
}
|
236 |
|
237 |
return $value;
|
@@ -325,7 +325,7 @@ class WPSEO_Utils {
|
|
325 |
*
|
326 |
* @return string
|
327 |
*/
|
328 |
-
public static function sanitize_url( $value, $allowed_protocols =
|
329 |
return esc_url_raw( sanitize_text_field( rawurldecode( $value ) ), $allowed_protocols );
|
330 |
}
|
331 |
|
@@ -361,7 +361,7 @@ class WPSEO_Utils {
|
|
361 |
* @return bool
|
362 |
*/
|
363 |
public static function emulate_filter_bool( $value ) {
|
364 |
-
$true =
|
365 |
'1',
|
366 |
'true',
|
367 |
'True',
|
@@ -374,8 +374,8 @@ class WPSEO_Utils {
|
|
374 |
'on',
|
375 |
'On',
|
376 |
'ON',
|
377 |
-
|
378 |
-
$false =
|
379 |
'0',
|
380 |
'false',
|
381 |
'False',
|
@@ -388,7 +388,7 @@ class WPSEO_Utils {
|
|
388 |
'off',
|
389 |
'Off',
|
390 |
'OFF',
|
391 |
-
|
392 |
|
393 |
if ( is_bool( $value ) ) {
|
394 |
return $value;
|
@@ -652,7 +652,7 @@ class WPSEO_Utils {
|
|
652 |
* @return string
|
653 |
*/
|
654 |
public static function trim_nbsp_from_string( $string ) {
|
655 |
-
$find =
|
656 |
$string = str_replace( $find, ' ', $string );
|
657 |
$string = trim( $string );
|
658 |
|
@@ -799,7 +799,7 @@ class WPSEO_Utils {
|
|
799 |
* @return bool
|
800 |
*/
|
801 |
public static function is_yoast_seo_free_page( $current_page ) {
|
802 |
-
$yoast_seo_free_pages =
|
803 |
'wpseo_dashboard',
|
804 |
'wpseo_titles',
|
805 |
'wpseo_social',
|
@@ -807,7 +807,7 @@ class WPSEO_Utils {
|
|
807 |
'wpseo_tools',
|
808 |
'wpseo_search_console',
|
809 |
'wpseo_licenses',
|
810 |
-
|
811 |
|
812 |
return in_array( $current_page, $yoast_seo_free_pages, true );
|
813 |
}
|
@@ -1002,7 +1002,7 @@ SVG;
|
|
1002 |
* @return bool Whether or not the metabox should be displayed.
|
1003 |
*/
|
1004 |
protected static function display_taxonomy_metabox( $taxonomy = null ) {
|
1005 |
-
if ( ! isset( $taxonomy ) || ! in_array( $taxonomy, get_taxonomies(
|
1006 |
return false;
|
1007 |
}
|
1008 |
|
@@ -1070,9 +1070,9 @@ SVG;
|
|
1070 |
* @return array The Adminl10n array.
|
1071 |
*/
|
1072 |
public static function get_admin_l10n() {
|
1073 |
-
$wpseo_admin_l10n =
|
1074 |
|
1075 |
-
$additional_entries = apply_filters( 'wpseo_admin_l10n',
|
1076 |
if ( is_array( $additional_entries ) ) {
|
1077 |
$wpseo_admin_l10n = array_merge( $wpseo_admin_l10n, $additional_entries );
|
1078 |
}
|
@@ -1110,7 +1110,7 @@ SVG;
|
|
1110 |
*/
|
1111 |
public static function get_home_url() {
|
1112 |
// Add a new filter to undo WPML's changing of home url.
|
1113 |
-
add_filter( 'wpml_get_home_url',
|
1114 |
|
1115 |
$url = home_url();
|
1116 |
|
@@ -1119,7 +1119,7 @@ SVG;
|
|
1119 |
$url = network_home_url();
|
1120 |
}
|
1121 |
|
1122 |
-
remove_filter( 'wpml_get_home_url',
|
1123 |
|
1124 |
return $url;
|
1125 |
}
|
@@ -1158,11 +1158,8 @@ SVG;
|
|
1158 |
* @return false|string The prepared JSON string.
|
1159 |
*/
|
1160 |
public static function format_json_encode( $data ) {
|
1161 |
-
$flags =
|
1162 |
-
|
1163 |
-
// @codingStandardsIgnoreLine This is used in the wp_json_encode call, which checks for this.
|
1164 |
-
$flags = ( $flags | JSON_UNESCAPED_SLASHES );
|
1165 |
-
}
|
1166 |
if ( self::is_development_mode() ) {
|
1167 |
$flags = ( $flags | JSON_PRETTY_PRINT );
|
1168 |
|
@@ -1208,10 +1205,10 @@ SVG;
|
|
1208 |
return false;
|
1209 |
}
|
1210 |
|
1211 |
-
$output =
|
1212 |
'@context' => 'https://schema.org',
|
1213 |
'@graph' => $graph,
|
1214 |
-
|
1215 |
return "<script type='application/ld+json' class='" . esc_attr( $class ) . "'>" . self::format_json_encode( $output ) . '</script>' . "\n";
|
1216 |
}
|
1217 |
|
@@ -1227,28 +1224,28 @@ SVG;
|
|
1227 |
static $a11y_tags;
|
1228 |
|
1229 |
if ( isset( $a11y_tags ) === false ) {
|
1230 |
-
$a11y_tags =
|
1231 |
-
'button' =>
|
1232 |
'aria-expanded' => true,
|
1233 |
'aria-controls' => true,
|
1234 |
-
|
1235 |
-
'div' =>
|
1236 |
'tabindex' => true,
|
1237 |
-
|
1238 |
// Below are attributes that are needed for backwards compatibility (WP < 5.1).
|
1239 |
-
'span' =>
|
1240 |
'aria-hidden' => true,
|
1241 |
-
|
1242 |
-
'input' =>
|
1243 |
'aria-describedby' => true,
|
1244 |
-
|
1245 |
-
'select' =>
|
1246 |
'aria-describedby' => true,
|
1247 |
-
|
1248 |
-
'textarea' =>
|
1249 |
'aria-describedby' => true,
|
1250 |
-
|
1251 |
-
|
1252 |
|
1253 |
// Add the global allowed attributes to each html element.
|
1254 |
$a11y_tags = array_map( '_wp_add_global_attributes', $a11y_tags );
|
@@ -1269,8 +1266,8 @@ SVG;
|
|
1269 |
static $input_tags;
|
1270 |
|
1271 |
if ( isset( $input_tags ) === false ) {
|
1272 |
-
$input_tags =
|
1273 |
-
'input' =>
|
1274 |
'accept' => true,
|
1275 |
'accesskey' => true,
|
1276 |
'align' => true,
|
@@ -1319,8 +1316,8 @@ SVG;
|
|
1319 |
*/
|
1320 |
'data-target' => true,
|
1321 |
'data-target-id' => true,
|
1322 |
-
|
1323 |
-
'select' =>
|
1324 |
'accesskey' => true,
|
1325 |
'autofocus' => true,
|
1326 |
'contenteditable' => true,
|
@@ -1347,16 +1344,16 @@ SVG;
|
|
1347 |
'spellcheck' => true,
|
1348 |
'tabindex' => true,
|
1349 |
'translate' => true,
|
1350 |
-
|
1351 |
-
'option' =>
|
1352 |
'class' => true,
|
1353 |
'disabled' => true,
|
1354 |
'id' => true,
|
1355 |
'label' => true,
|
1356 |
'selected' => true,
|
1357 |
'value' => true,
|
1358 |
-
|
1359 |
-
|
1360 |
|
1361 |
// Add the global allowed attributes to each html element.
|
1362 |
$input_tags = array_map( '_wp_add_global_attributes', $input_tags );
|
@@ -1371,7 +1368,7 @@ SVG;
|
|
1371 |
* @return string[] The array of enabled features.
|
1372 |
*/
|
1373 |
public static function retrieve_enabled_features() {
|
1374 |
-
$enabled_features =
|
1375 |
if ( defined( 'YOAST_SEO_ENABLED_FEATURES' ) ) {
|
1376 |
$enabled_features = preg_split( '/,\W*/', YOAST_SEO_ENABLED_FEATURES );
|
1377 |
}
|
28 |
*
|
29 |
* @var array
|
30 |
*/
|
31 |
+
protected static $console_notifications = [];
|
32 |
|
33 |
/**
|
34 |
* Check whether the current user is allowed to access the configuration.
|
125 |
static $registered_hook;
|
126 |
|
127 |
if ( is_null( $registered_hook ) ) {
|
128 |
+
add_action( 'admin_footer', [ __CLASS__, 'localize_console_notices' ], 999 );
|
129 |
$registered_hook = true;
|
130 |
}
|
131 |
|
199 |
* @return string
|
200 |
*/
|
201 |
public static function standardize_whitespace( $string ) {
|
202 |
+
return trim( str_replace( ' ', ' ', str_replace( [ "\t", "\n", "\r", "\f" ], ' ', $string ) ) );
|
203 |
}
|
204 |
|
205 |
/**
|
231 |
$value = trim( $value );
|
232 |
}
|
233 |
elseif ( is_array( $value ) ) {
|
234 |
+
$value = array_map( [ __CLASS__, 'trim_recursive' ], $value );
|
235 |
}
|
236 |
|
237 |
return $value;
|
325 |
*
|
326 |
* @return string
|
327 |
*/
|
328 |
+
public static function sanitize_url( $value, $allowed_protocols = [ 'http', 'https' ] ) {
|
329 |
return esc_url_raw( sanitize_text_field( rawurldecode( $value ) ), $allowed_protocols );
|
330 |
}
|
331 |
|
361 |
* @return bool
|
362 |
*/
|
363 |
public static function emulate_filter_bool( $value ) {
|
364 |
+
$true = [
|
365 |
'1',
|
366 |
'true',
|
367 |
'True',
|
374 |
'on',
|
375 |
'On',
|
376 |
'ON',
|
377 |
+
];
|
378 |
+
$false = [
|
379 |
'0',
|
380 |
'false',
|
381 |
'False',
|
388 |
'off',
|
389 |
'Off',
|
390 |
'OFF',
|
391 |
+
];
|
392 |
|
393 |
if ( is_bool( $value ) ) {
|
394 |
return $value;
|
652 |
* @return string
|
653 |
*/
|
654 |
public static function trim_nbsp_from_string( $string ) {
|
655 |
+
$find = [ ' ', chr( 0xC2 ) . chr( 0xA0 ) ];
|
656 |
$string = str_replace( $find, ' ', $string );
|
657 |
$string = trim( $string );
|
658 |
|
799 |
* @return bool
|
800 |
*/
|
801 |
public static function is_yoast_seo_free_page( $current_page ) {
|
802 |
+
$yoast_seo_free_pages = [
|
803 |
'wpseo_dashboard',
|
804 |
'wpseo_titles',
|
805 |
'wpseo_social',
|
807 |
'wpseo_tools',
|
808 |
'wpseo_search_console',
|
809 |
'wpseo_licenses',
|
810 |
+
];
|
811 |
|
812 |
return in_array( $current_page, $yoast_seo_free_pages, true );
|
813 |
}
|
1002 |
* @return bool Whether or not the metabox should be displayed.
|
1003 |
*/
|
1004 |
protected static function display_taxonomy_metabox( $taxonomy = null ) {
|
1005 |
+
if ( ! isset( $taxonomy ) || ! in_array( $taxonomy, get_taxonomies( [ 'public' => true ], 'names' ), true ) ) {
|
1006 |
return false;
|
1007 |
}
|
1008 |
|
1070 |
* @return array The Adminl10n array.
|
1071 |
*/
|
1072 |
public static function get_admin_l10n() {
|
1073 |
+
$wpseo_admin_l10n = [];
|
1074 |
|
1075 |
+
$additional_entries = apply_filters( 'wpseo_admin_l10n', [] );
|
1076 |
if ( is_array( $additional_entries ) ) {
|
1077 |
$wpseo_admin_l10n = array_merge( $wpseo_admin_l10n, $additional_entries );
|
1078 |
}
|
1110 |
*/
|
1111 |
public static function get_home_url() {
|
1112 |
// Add a new filter to undo WPML's changing of home url.
|
1113 |
+
add_filter( 'wpml_get_home_url', [ 'WPSEO_Utils', 'wpml_get_home_url' ], 10, 2 );
|
1114 |
|
1115 |
$url = home_url();
|
1116 |
|
1119 |
$url = network_home_url();
|
1120 |
}
|
1121 |
|
1122 |
+
remove_filter( 'wpml_get_home_url', [ 'WPSEO_Utils', 'wpml_get_home_url' ], 10 );
|
1123 |
|
1124 |
return $url;
|
1125 |
}
|
1158 |
* @return false|string The prepared JSON string.
|
1159 |
*/
|
1160 |
public static function format_json_encode( $data ) {
|
1161 |
+
$flags = JSON_UNESCAPED_SLASHES;
|
1162 |
+
|
|
|
|
|
|
|
1163 |
if ( self::is_development_mode() ) {
|
1164 |
$flags = ( $flags | JSON_PRETTY_PRINT );
|
1165 |
|
1205 |
return false;
|
1206 |
}
|
1207 |
|
1208 |
+
$output = [
|
1209 |
'@context' => 'https://schema.org',
|
1210 |
'@graph' => $graph,
|
1211 |
+
];
|
1212 |
return "<script type='application/ld+json' class='" . esc_attr( $class ) . "'>" . self::format_json_encode( $output ) . '</script>' . "\n";
|
1213 |
}
|
1214 |
|
1224 |
static $a11y_tags;
|
1225 |
|
1226 |
if ( isset( $a11y_tags ) === false ) {
|
1227 |
+
$a11y_tags = [
|
1228 |
+
'button' => [
|
1229 |
'aria-expanded' => true,
|
1230 |
'aria-controls' => true,
|
1231 |
+
],
|
1232 |
+
'div' => [
|
1233 |
'tabindex' => true,
|
1234 |
+
],
|
1235 |
// Below are attributes that are needed for backwards compatibility (WP < 5.1).
|
1236 |
+
'span' => [
|
1237 |
'aria-hidden' => true,
|
1238 |
+
],
|
1239 |
+
'input' => [
|
1240 |
'aria-describedby' => true,
|
1241 |
+
],
|
1242 |
+
'select' => [
|
1243 |
'aria-describedby' => true,
|
1244 |
+
],
|
1245 |
+
'textarea' => [
|
1246 |
'aria-describedby' => true,
|
1247 |
+
],
|
1248 |
+
];
|
1249 |
|
1250 |
// Add the global allowed attributes to each html element.
|
1251 |
$a11y_tags = array_map( '_wp_add_global_attributes', $a11y_tags );
|
1266 |
static $input_tags;
|
1267 |
|
1268 |
if ( isset( $input_tags ) === false ) {
|
1269 |
+
$input_tags = [
|
1270 |
+
'input' => [
|
1271 |
'accept' => true,
|
1272 |
'accesskey' => true,
|
1273 |
'align' => true,
|
1316 |
*/
|
1317 |
'data-target' => true,
|
1318 |
'data-target-id' => true,
|
1319 |
+
],
|
1320 |
+
'select' => [
|
1321 |
'accesskey' => true,
|
1322 |
'autofocus' => true,
|
1323 |
'contenteditable' => true,
|
1344 |
'spellcheck' => true,
|
1345 |
'tabindex' => true,
|
1346 |
'translate' => true,
|
1347 |
+
],
|
1348 |
+
'option' => [
|
1349 |
'class' => true,
|
1350 |
'disabled' => true,
|
1351 |
'id' => true,
|
1352 |
'label' => true,
|
1353 |
'selected' => true,
|
1354 |
'value' => true,
|
1355 |
+
],
|
1356 |
+
];
|
1357 |
|
1358 |
// Add the global allowed attributes to each html element.
|
1359 |
$input_tags = array_map( '_wp_add_global_attributes', $input_tags );
|
1368 |
* @return string[] The array of enabled features.
|
1369 |
*/
|
1370 |
public static function retrieve_enabled_features() {
|
1371 |
+
$enabled_features = [];
|
1372 |
if ( defined( 'YOAST_SEO_ENABLED_FEATURES' ) ) {
|
1373 |
$enabled_features = preg_split( '/,\W*/', YOAST_SEO_ENABLED_FEATURES );
|
1374 |
}
|
inc/endpoints/class-myyoast-connect.php
CHANGED
@@ -28,11 +28,11 @@ class WPSEO_Endpoint_MyYoast_Connect implements WPSEO_Endpoint {
|
|
28 |
register_rest_route(
|
29 |
self::REST_NAMESPACE,
|
30 |
'connect',
|
31 |
-
|
32 |
'methods' => 'POST',
|
33 |
-
'callback' =>
|
34 |
-
'permission_callback' =>
|
35 |
-
|
36 |
);
|
37 |
}
|
38 |
|
@@ -91,9 +91,9 @@ class WPSEO_Endpoint_MyYoast_Connect implements WPSEO_Endpoint {
|
|
91 |
*/
|
92 |
protected function save_secret( $client_secret ) {
|
93 |
$this->get_client()->save_configuration(
|
94 |
-
|
95 |
'secret' => $client_secret,
|
96 |
-
|
97 |
);
|
98 |
}
|
99 |
|
28 |
register_rest_route(
|
29 |
self::REST_NAMESPACE,
|
30 |
'connect',
|
31 |
+
[
|
32 |
'methods' => 'POST',
|
33 |
+
'callback' => [ $this, 'handle_request' ],
|
34 |
+
'permission_callback' => [ $this, 'can_retrieve_data' ],
|
35 |
+
]
|
36 |
);
|
37 |
}
|
38 |
|
91 |
*/
|
92 |
protected function save_secret( $client_secret ) {
|
93 |
$this->get_client()->save_configuration(
|
94 |
+
[
|
95 |
'secret' => $client_secret,
|
96 |
+
]
|
97 |
);
|
98 |
}
|
99 |
|
inc/health-check.php
CHANGED
@@ -51,10 +51,10 @@ abstract class WPSEO_Health_Check {
|
|
51 |
*
|
52 |
* @var array
|
53 |
*/
|
54 |
-
protected $badge =
|
55 |
'label' => '',
|
56 |
'color' => '',
|
57 |
-
|
58 |
|
59 |
/**
|
60 |
* Additional details about the results of the test.
|
@@ -96,14 +96,14 @@ abstract class WPSEO_Health_Check {
|
|
96 |
*/
|
97 |
public function register_test() {
|
98 |
if ( $this->async ) {
|
99 |
-
add_filter( 'site_status_tests',
|
100 |
|
101 |
-
add_action( 'wp_ajax_health-check-' . $this->get_test_name(),
|
102 |
|
103 |
return;
|
104 |
}
|
105 |
|
106 |
-
add_filter( 'site_status_tests',
|
107 |
}
|
108 |
|
109 |
/**
|
@@ -114,10 +114,10 @@ abstract class WPSEO_Health_Check {
|
|
114 |
* @return array The extended array.
|
115 |
*/
|
116 |
public function add_test( $tests ) {
|
117 |
-
$tests['direct'][ $this->name ] =
|
118 |
-
'test' =>
|
119 |
'name' => $this->name,
|
120 |
-
|
121 |
|
122 |
return $tests;
|
123 |
}
|
@@ -130,10 +130,10 @@ abstract class WPSEO_Health_Check {
|
|
130 |
* @return array The extended array.
|
131 |
*/
|
132 |
public function add_async_test( $tests ) {
|
133 |
-
$tests['async'][ $this->name ] =
|
134 |
'test' => $this->get_test_name(),
|
135 |
'name' => $this->name,
|
136 |
-
|
137 |
|
138 |
return $tests;
|
139 |
}
|
@@ -146,13 +146,13 @@ abstract class WPSEO_Health_Check {
|
|
146 |
public function get_test_result() {
|
147 |
$this->run();
|
148 |
|
149 |
-
return
|
150 |
'label' => $this->label,
|
151 |
'status' => $this->status,
|
152 |
'badge' => $this->get_badge(),
|
153 |
'description' => $this->description,
|
154 |
'actions' => $this->actions,
|
155 |
-
|
156 |
}
|
157 |
|
158 |
/**
|
@@ -169,7 +169,7 @@ abstract class WPSEO_Health_Check {
|
|
169 |
*/
|
170 |
protected function get_badge() {
|
171 |
if ( ! is_array( $this->badge ) ) {
|
172 |
-
$this->badge =
|
173 |
}
|
174 |
|
175 |
if ( empty( $this->badge['label'] ) ) {
|
51 |
*
|
52 |
* @var array
|
53 |
*/
|
54 |
+
protected $badge = [
|
55 |
'label' => '',
|
56 |
'color' => '',
|
57 |
+
];
|
58 |
|
59 |
/**
|
60 |
* Additional details about the results of the test.
|
96 |
*/
|
97 |
public function register_test() {
|
98 |
if ( $this->async ) {
|
99 |
+
add_filter( 'site_status_tests', [ $this, 'add_async_test' ] );
|
100 |
|
101 |
+
add_action( 'wp_ajax_health-check-' . $this->get_test_name(), [ $this, 'get_async_test_result' ] );
|
102 |
|
103 |
return;
|
104 |
}
|
105 |
|
106 |
+
add_filter( 'site_status_tests', [ $this, 'add_test' ] );
|
107 |
}
|
108 |
|
109 |
/**
|
114 |
* @return array The extended array.
|
115 |
*/
|
116 |
public function add_test( $tests ) {
|
117 |
+
$tests['direct'][ $this->name ] = [
|
118 |
+
'test' => [ $this, 'get_test_result' ],
|
119 |
'name' => $this->name,
|
120 |
+
];
|
121 |
|
122 |
return $tests;
|
123 |
}
|
130 |
* @return array The extended array.
|
131 |
*/
|
132 |
public function add_async_test( $tests ) {
|
133 |
+
$tests['async'][ $this->name ] = [
|
134 |
'test' => $this->get_test_name(),
|
135 |
'name' => $this->name,
|
136 |
+
];
|
137 |
|
138 |
return $tests;
|
139 |
}
|
146 |
public function get_test_result() {
|
147 |
$this->run();
|
148 |
|
149 |
+
return [
|
150 |
'label' => $this->label,
|
151 |
'status' => $this->status,
|
152 |
'badge' => $this->get_badge(),
|
153 |
'description' => $this->description,
|
154 |
'actions' => $this->actions,
|
155 |
+
];
|
156 |
}
|
157 |
|
158 |
/**
|
169 |
*/
|
170 |
protected function get_badge() {
|
171 |
if ( ! is_array( $this->badge ) ) {
|
172 |
+
$this->badge = [];
|
173 |
}
|
174 |
|
175 |
if ( empty( $this->badge['label'] ) ) {
|
inc/indexables/class-indexable.php
CHANGED
@@ -15,7 +15,7 @@ abstract class WPSEO_Indexable {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $updateable_fields =
|
19 |
|
20 |
/**
|
21 |
* The indexable's data.
|
@@ -29,7 +29,7 @@ abstract class WPSEO_Indexable {
|
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
-
protected $validators =
|
33 |
'WPSEO_Object_Type_Validator',
|
34 |
'WPSEO_Link_Validator',
|
35 |
'WPSEO_Keyword_Validator',
|
@@ -37,7 +37,7 @@ abstract class WPSEO_Indexable {
|
|
37 |
'WPSEO_OpenGraph_Validator',
|
38 |
'WPSEO_Robots_Validator',
|
39 |
'WPSEO_Twitter_Validator',
|
40 |
-
|
41 |
|
42 |
/**
|
43 |
* Indexable constructor.
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $updateable_fields = [];
|
19 |
|
20 |
/**
|
21 |
* The indexable's data.
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
+
protected $validators = [
|
33 |
'WPSEO_Object_Type_Validator',
|
34 |
'WPSEO_Link_Validator',
|
35 |
'WPSEO_Keyword_Validator',
|
37 |
'WPSEO_OpenGraph_Validator',
|
38 |
'WPSEO_Robots_Validator',
|
39 |
'WPSEO_Twitter_Validator',
|
40 |
+
];
|
41 |
|
42 |
/**
|
43 |
* Indexable constructor.
|
inc/indexables/class-post-indexable.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Post_Indexable extends WPSEO_Indexable {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $updateable_fields =
|
19 |
'canonical',
|
20 |
'title',
|
21 |
'description',
|
@@ -36,7 +36,7 @@ class WPSEO_Post_Indexable extends WPSEO_Indexable {
|
|
36 |
'primary_focus_keyword_score',
|
37 |
'readability_score',
|
38 |
'is_cornerstone',
|
39 |
-
|
40 |
|
41 |
/**
|
42 |
* Creates a new Indexable from a passed object.
|
@@ -51,12 +51,12 @@ class WPSEO_Post_Indexable extends WPSEO_Indexable {
|
|
51 |
$post = WPSEO_Post_Object_Type::from_object( $object_id );
|
52 |
|
53 |
$link_count = new WPSEO_Link_Column_Count();
|
54 |
-
$link_count->set(
|
55 |
|
56 |
$post_object_id = $post->get_id();
|
57 |
|
58 |
return new self(
|
59 |
-
|
60 |
'object_id' => $post_object_id,
|
61 |
'object_type' => $post->get_type(),
|
62 |
'object_subtype' => $post->get_subtype(),
|
@@ -84,7 +84,7 @@ class WPSEO_Post_Indexable extends WPSEO_Indexable {
|
|
84 |
'incoming_link_count' => (int) $link_count->get( $post_object_id, 'incoming_link_count' ),
|
85 |
'created_at' => null,
|
86 |
'updated_at' => null,
|
87 |
-
|
88 |
);
|
89 |
}
|
90 |
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $updateable_fields = [
|
19 |
'canonical',
|
20 |
'title',
|
21 |
'description',
|
36 |
'primary_focus_keyword_score',
|
37 |
'readability_score',
|
38 |
'is_cornerstone',
|
39 |
+
];
|
40 |
|
41 |
/**
|
42 |
* Creates a new Indexable from a passed object.
|
51 |
$post = WPSEO_Post_Object_Type::from_object( $object_id );
|
52 |
|
53 |
$link_count = new WPSEO_Link_Column_Count();
|
54 |
+
$link_count->set( [ $object_id ] );
|
55 |
|
56 |
$post_object_id = $post->get_id();
|
57 |
|
58 |
return new self(
|
59 |
+
[
|
60 |
'object_id' => $post_object_id,
|
61 |
'object_type' => $post->get_type(),
|
62 |
'object_subtype' => $post->get_subtype(),
|
84 |
'incoming_link_count' => (int) $link_count->get( $post_object_id, 'incoming_link_count' ),
|
85 |
'created_at' => null,
|
86 |
'updated_at' => null,
|
87 |
+
]
|
88 |
);
|
89 |
}
|
90 |
|
inc/indexables/class-term-indexable.php
CHANGED
@@ -15,7 +15,7 @@ class WPSEO_Term_Indexable extends WPSEO_Indexable {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
protected $updateable_fields =
|
19 |
'canonical',
|
20 |
'title',
|
21 |
'description',
|
@@ -31,7 +31,7 @@ class WPSEO_Term_Indexable extends WPSEO_Indexable {
|
|
31 |
'primary_focus_keyword',
|
32 |
'primary_focus_keyword_score',
|
33 |
'readability_score',
|
34 |
-
|
35 |
|
36 |
/**
|
37 |
* Creates a new Indexable from a passed object.
|
@@ -48,7 +48,7 @@ class WPSEO_Term_Indexable extends WPSEO_Indexable {
|
|
48 |
$term_object_id = $term->get_id();
|
49 |
|
50 |
return new self(
|
51 |
-
|
52 |
'object_id' => $term_object_id,
|
53 |
'object_type' => $term->get_type(),
|
54 |
'object_subtype' => $term->get_subtype(),
|
@@ -76,7 +76,7 @@ class WPSEO_Term_Indexable extends WPSEO_Indexable {
|
|
76 |
'incoming_link_count' => null,
|
77 |
'created_at' => null,
|
78 |
'updated_at' => null,
|
79 |
-
|
80 |
);
|
81 |
}
|
82 |
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
protected $updateable_fields = [
|
19 |
'canonical',
|
20 |
'title',
|
21 |
'description',
|
31 |
'primary_focus_keyword',
|
32 |
'primary_focus_keyword_score',
|
33 |
'readability_score',
|
34 |
+
];
|
35 |
|
36 |
/**
|
37 |
* Creates a new Indexable from a passed object.
|
48 |
$term_object_id = $term->get_id();
|
49 |
|
50 |
return new self(
|
51 |
+
[
|
52 |
'object_id' => $term_object_id,
|
53 |
'object_type' => $term->get_type(),
|
54 |
'object_subtype' => $term->get_subtype(),
|
76 |
'incoming_link_count' => null,
|
77 |
'created_at' => null,
|
78 |
'updated_at' => null,
|
79 |
+
]
|
80 |
);
|
81 |
}
|
82 |
|
inc/indexables/validators/class-object-type-validator.php
CHANGED
@@ -20,7 +20,7 @@ class WPSEO_Object_Type_Validator implements WPSEO_Endpoint_Validator {
|
|
20 |
* @throws WPSEO_Invalid_Argument_Exception Thrown is the object type is invalid.
|
21 |
*/
|
22 |
private static function validate_type( $object_type ) {
|
23 |
-
if ( ! in_array( $object_type,
|
24 |
throw WPSEO_Invalid_Argument_Exception::invalid_type( $object_type );
|
25 |
}
|
26 |
}
|
20 |
* @throws WPSEO_Invalid_Argument_Exception Thrown is the object type is invalid.
|
21 |
*/
|
22 |
private static function validate_type( $object_type ) {
|
23 |
+
if ( ! in_array( $object_type, [ 'post', 'term' ], true ) ) {
|
24 |
throw WPSEO_Invalid_Argument_Exception::invalid_type( $object_type );
|
25 |
}
|
26 |
}
|
inc/indexables/validators/class-robots-validator.php
CHANGED
@@ -15,13 +15,13 @@ class WPSEO_Robots_Validator implements WPSEO_Endpoint_Validator {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
private $robots_to_validate =
|
19 |
'is_robots_nofollow',
|
20 |
'is_robots_noarchive',
|
21 |
'is_robots_noimageindex',
|
22 |
'is_robots_nosnippet',
|
23 |
'is_robots_noindex',
|
24 |
-
|
25 |
|
26 |
/**
|
27 |
* Validates the passed request data.
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
private $robots_to_validate = [
|
19 |
'is_robots_nofollow',
|
20 |
'is_robots_noarchive',
|
21 |
'is_robots_noimageindex',
|
22 |
'is_robots_nosnippet',
|
23 |
'is_robots_noindex',
|
24 |
+
];
|
25 |
|
26 |
/**
|
27 |
* Validates the passed request data.
|
inc/language-utils.php
CHANGED
@@ -75,13 +75,13 @@ class WPSEO_Language_Utils {
|
|
75 |
* @return array The l10n array.
|
76 |
*/
|
77 |
public static function get_knowledge_graph_company_info_missing_l10n() {
|
78 |
-
return
|
79 |
'URL' => esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/3r3' ) ),
|
80 |
/* translators: 1: expands to a link opening tag; 2: expands to a link closing tag */
|
81 |
'message' => esc_html__(
|
82 |
'A company name and logo need to be set for structured data to work properly. %1$sLearn more about the importance of structured data.%2$s',
|
83 |
'wordpress-seo'
|
84 |
),
|
85 |
-
|
86 |
}
|
87 |
}
|
75 |
* @return array The l10n array.
|
76 |
*/
|
77 |
public static function get_knowledge_graph_company_info_missing_l10n() {
|
78 |
+
return [
|
79 |
'URL' => esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/3r3' ) ),
|
80 |
/* translators: 1: expands to a link opening tag; 2: expands to a link closing tag */
|
81 |
'message' => esc_html__(
|
82 |
'A company name and logo need to be set for structured data to work properly. %1$sLearn more about the importance of structured data.%2$s',
|
83 |
'wordpress-seo'
|
84 |
),
|
85 |
+
];
|
86 |
}
|
87 |
}
|
inc/options/class-wpseo-option-ms.php
CHANGED
@@ -48,7 +48,7 @@ class WPSEO_Option_MS extends WPSEO_Option {
|
|
48 |
*
|
49 |
* @var array
|
50 |
*/
|
51 |
-
protected $defaults =
|
52 |
|
53 |
/**
|
54 |
* Available options for the 'access' setting. Used for input validation.
|
@@ -59,10 +59,10 @@ class WPSEO_Option_MS extends WPSEO_Option {
|
|
59 |
*
|
60 |
* @var array
|
61 |
*/
|
62 |
-
public static $allowed_access_options =
|
63 |
'admin',
|
64 |
'superadmin',
|
65 |
-
|
66 |
|
67 |
/**
|
68 |
* Get the singleton instance of this class.
|
@@ -82,7 +82,7 @@ class WPSEO_Option_MS extends WPSEO_Option {
|
|
82 |
*/
|
83 |
public function __construct() {
|
84 |
$allow_prefix = self::ALLOW_KEY_PREFIX;
|
85 |
-
$this->defaults =
|
86 |
'access' => 'admin',
|
87 |
'defaultblog' => '', // Numeric blog ID or empty.
|
88 |
"{$allow_prefix}disableadvanced_meta" => true,
|
@@ -93,12 +93,12 @@ class WPSEO_Option_MS extends WPSEO_Option {
|
|
93 |
"{$allow_prefix}enable_cornerstone_content" => true,
|
94 |
"{$allow_prefix}enable_xml_sitemap" => true,
|
95 |
"{$allow_prefix}enable_text_link_counter" => true,
|
96 |
-
|
97 |
|
98 |
if ( is_multisite() ) {
|
99 |
parent::__construct();
|
100 |
|
101 |
-
add_filter( 'admin_title',
|
102 |
}
|
103 |
}
|
104 |
|
@@ -109,8 +109,8 @@ class WPSEO_Option_MS extends WPSEO_Option {
|
|
109 |
*/
|
110 |
public function add_default_filters() {
|
111 |
// Don't change, needs to check for false as could return prio 0 which would evaluate to false.
|
112 |
-
if ( has_filter( 'default_site_option_' . $this->option_name,
|
113 |
-
add_filter( 'default_site_option_' . $this->option_name,
|
114 |
}
|
115 |
}
|
116 |
|
@@ -121,7 +121,7 @@ class WPSEO_Option_MS extends WPSEO_Option {
|
|
121 |
* @return void
|
122 |
*/
|
123 |
public function remove_default_filters() {
|
124 |
-
remove_filter( 'default_site_option_' . $this->option_name,
|
125 |
}
|
126 |
|
127 |
/**
|
@@ -131,8 +131,8 @@ class WPSEO_Option_MS extends WPSEO_Option {
|
|
131 |
*/
|
132 |
public function add_option_filters() {
|
133 |
// Don't change, needs to check for false as could return prio 0 which would evaluate to false.
|
134 |
-
if ( has_filter( 'site_option_' . $this->option_name,
|
135 |
-
add_filter( 'site_option_' . $this->option_name,
|
136 |
}
|
137 |
}
|
138 |
|
@@ -143,7 +143,7 @@ class WPSEO_Option_MS extends WPSEO_Option {
|
|
143 |
* @return void
|
144 |
*/
|
145 |
public function remove_option_filters() {
|
146 |
-
remove_filter( 'site_option_' . $this->option_name,
|
147 |
}
|
148 |
|
149 |
/* *********** METHODS influencing add_uption(), update_option() and saving from admin pages *********** */
|
48 |
*
|
49 |
* @var array
|
50 |
*/
|
51 |
+
protected $defaults = [];
|
52 |
|
53 |
/**
|
54 |
* Available options for the 'access' setting. Used for input validation.
|
59 |
*
|
60 |
* @var array
|
61 |
*/
|
62 |
+
public static $allowed_access_options = [
|
63 |
'admin',
|
64 |
'superadmin',
|
65 |
+
];
|
66 |
|
67 |
/**
|
68 |
* Get the singleton instance of this class.
|
82 |
*/
|
83 |
public function __construct() {
|
84 |
$allow_prefix = self::ALLOW_KEY_PREFIX;
|
85 |
+
$this->defaults = [
|
86 |
'access' => 'admin',
|
87 |
'defaultblog' => '', // Numeric blog ID or empty.
|
88 |
"{$allow_prefix}disableadvanced_meta" => true,
|
93 |
"{$allow_prefix}enable_cornerstone_content" => true,
|
94 |
"{$allow_prefix}enable_xml_sitemap" => true,
|
95 |
"{$allow_prefix}enable_text_link_counter" => true,
|
96 |
+
];
|
97 |
|
98 |
if ( is_multisite() ) {
|
99 |
parent::__construct();
|
100 |
|
101 |
+
add_filter( 'admin_title', [ 'Yoast_Input_Validation', 'add_yoast_admin_document_title_errors' ] );
|
102 |
}
|
103 |
}
|
104 |
|
109 |
*/
|
110 |
public function add_default_filters() {
|
111 |
// Don't change, needs to check for false as could return prio 0 which would evaluate to false.
|
112 |
+
if ( has_filter( 'default_site_option_' . $this->option_name, [ $this, 'get_defaults' ] ) === false ) {
|
113 |
+
add_filter( 'default_site_option_' . $this->option_name, [ $this, 'get_defaults' ] );
|
114 |
}
|
115 |
}
|
116 |
|
121 |
* @return void
|
122 |
*/
|
123 |
public function remove_default_filters() {
|
124 |
+
remove_filter( 'default_site_option_' . $this->option_name, [ $this, 'get_defaults' ] );
|
125 |
}
|
126 |
|
127 |
/**
|
131 |
*/
|
132 |
public function add_option_filters() {
|
133 |
// Don't change, needs to check for false as could return prio 0 which would evaluate to false.
|
134 |
+
if ( has_filter( 'site_option_' . $this->option_name, [ $this, 'get_option' ] ) === false ) {
|
135 |
+
add_filter( 'site_option_' . $this->option_name, [ $this, 'get_option' ] );
|
136 |
}
|
137 |
}
|
138 |
|
143 |
* @return void
|
144 |
*/
|
145 |
public function remove_option_filters() {
|
146 |
+
remove_filter( 'site_option_' . $this->option_name, [ $this, 'get_option' ] );
|
147 |
}
|
148 |
|
149 |
/* *********** METHODS influencing add_uption(), update_option() and saving from admin pages *********** */
|
inc/options/class-wpseo-option-social.php
CHANGED
@@ -24,7 +24,7 @@ class WPSEO_Option_Social extends WPSEO_Option {
|
|
24 |
*
|
25 |
* @var array
|
26 |
*/
|
27 |
-
protected $defaults =
|
28 |
// Form fields.
|
29 |
'facebook_site' => '', // Text field.
|
30 |
'instagram_url' => '',
|
@@ -46,18 +46,18 @@ class WPSEO_Option_Social extends WPSEO_Option {
|
|
46 |
'wikipedia_url' => '',
|
47 |
// Form field, but not always available.
|
48 |
'fbadminapp' => '', // Facebook app ID.
|
49 |
-
|
50 |
|
51 |
/**
|
52 |
* Array of sub-options which should not be overloaded with multi-site defaults.
|
53 |
*
|
54 |
* @var array
|
55 |
*/
|
56 |
-
public $ms_exclude =
|
57 |
/* Privacy. */
|
58 |
'pinterestverify',
|
59 |
'fbadminapp',
|
60 |
-
|
61 |
|
62 |
/**
|
63 |
* Array of allowed twitter card types.
|
@@ -70,7 +70,7 @@ class WPSEO_Option_Social extends WPSEO_Option {
|
|
70 |
*
|
71 |
* @var array
|
72 |
*/
|
73 |
-
public static $twitter_card_types =
|
74 |
'summary' => '',
|
75 |
'summary_large_image' => '',
|
76 |
// 'photo' => '',
|
@@ -78,7 +78,7 @@ class WPSEO_Option_Social extends WPSEO_Option {
|
|
78 |
// 'app' => '',
|
79 |
// 'player' => '',
|
80 |
// 'product' => '',
|
81 |
-
|
82 |
|
83 |
/**
|
84 |
* Add the actions and filters for the option.
|
@@ -86,7 +86,7 @@ class WPSEO_Option_Social extends WPSEO_Option {
|
|
86 |
protected function __construct() {
|
87 |
parent::__construct();
|
88 |
|
89 |
-
add_filter( 'admin_title',
|
90 |
}
|
91 |
|
92 |
/**
|
@@ -247,7 +247,7 @@ class WPSEO_Option_Social extends WPSEO_Option {
|
|
247 |
$old_option = null;
|
248 |
if ( isset( $all_old_option_values ) ) {
|
249 |
// Ok, we have an import.
|
250 |
-
if ( isset( $all_old_option_values['wpseo_indexation'] ) && is_array( $all_old_option_values['wpseo_indexation'] ) && $all_old_option_values['wpseo_indexation'] !==
|
251 |
$old_option = $all_old_option_values['wpseo_indexation'];
|
252 |
}
|
253 |
}
|
@@ -255,10 +255,10 @@ class WPSEO_Option_Social extends WPSEO_Option {
|
|
255 |
$old_option = get_option( 'wpseo_indexation' );
|
256 |
}
|
257 |
|
258 |
-
if ( is_array( $old_option ) && $old_option !==
|
259 |
-
$move =
|
260 |
'opengraph',
|
261 |
-
|
262 |
foreach ( $move as $key ) {
|
263 |
if ( isset( $old_option[ $key ] ) && ! isset( $option_value[ $key ] ) ) {
|
264 |
$option_value[ $key ] = $old_option[ $key ];
|
24 |
*
|
25 |
* @var array
|
26 |
*/
|
27 |
+
protected $defaults = [
|
28 |
// Form fields.
|
29 |
'facebook_site' => '', // Text field.
|
30 |
'instagram_url' => '',
|
46 |
'wikipedia_url' => '',
|
47 |
// Form field, but not always available.
|
48 |
'fbadminapp' => '', // Facebook app ID.
|
49 |
+
];
|
50 |
|
51 |
/**
|
52 |
* Array of sub-options which should not be overloaded with multi-site defaults.
|
53 |
*
|
54 |
* @var array
|
55 |
*/
|
56 |
+
public $ms_exclude = [
|
57 |
/* Privacy. */
|
58 |
'pinterestverify',
|
59 |
'fbadminapp',
|
60 |
+
];
|
61 |
|
62 |
/**
|
63 |
* Array of allowed twitter card types.
|
70 |
*
|
71 |
* @var array
|
72 |
*/
|
73 |
+
public static $twitter_card_types = [
|
74 |
'summary' => '',
|
75 |
'summary_large_image' => '',
|
76 |
// 'photo' => '',
|
78 |
// 'app' => '',
|
79 |
// 'player' => '',
|
80 |
// 'product' => '',
|
81 |
+
];
|
82 |
|
83 |
/**
|
84 |
* Add the actions and filters for the option.
|
86 |
protected function __construct() {
|
87 |
parent::__construct();
|
88 |
|
89 |
+
add_filter( 'admin_title', [ 'Yoast_Input_Validation', 'add_yoast_admin_document_title_errors' ] );
|
90 |
}
|
91 |
|
92 |
/**
|
247 |
$old_option = null;
|
248 |
if ( isset( $all_old_option_values ) ) {
|
249 |
// Ok, we have an import.
|
250 |
+
if ( isset( $all_old_option_values['wpseo_indexation'] ) && is_array( $all_old_option_values['wpseo_indexation'] ) && $all_old_option_values['wpseo_indexation'] !== [] ) {
|
251 |
$old_option = $all_old_option_values['wpseo_indexation'];
|
252 |
}
|
253 |
}
|
255 |
$old_option = get_option( 'wpseo_indexation' );
|
256 |
}
|
257 |
|
258 |
+
if ( is_array( $old_option ) && $old_option !== [] ) {
|
259 |
+
$move = [
|
260 |
'opengraph',
|
261 |
+
];
|
262 |
foreach ( $move as $key ) {
|
263 |
if ( isset( $old_option[ $key ] ) && ! isset( $option_value[ $key ] ) ) {
|
264 |
$option_value[ $key ] = $old_option[ $key ];
|
inc/options/class-wpseo-option-titles.php
CHANGED
@@ -26,7 +26,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
26 |
*
|
27 |
* @var array
|
28 |
*/
|
29 |
-
protected $defaults =
|
30 |
// Non-form fields, set via (ajax) function.
|
31 |
'title_test' => 0,
|
32 |
// Form fields.
|
@@ -95,7 +95,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
95 |
* - 'noindex-tax-' . $tax->name => false;
|
96 |
* - 'display-metabox-tax-' . $tax->name => false;
|
97 |
*/
|
98 |
-
|
99 |
|
100 |
/**
|
101 |
* Used for "caching" during pageload.
|
@@ -109,7 +109,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
109 |
*
|
110 |
* @var array
|
111 |
*/
|
112 |
-
protected $variable_array_key_patterns =
|
113 |
'title-',
|
114 |
'metadesc-',
|
115 |
'noindex-',
|
@@ -118,18 +118,18 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
118 |
'bctitle-ptarchive-',
|
119 |
'post_types-',
|
120 |
'taxonomy-',
|
121 |
-
|
122 |
|
123 |
/**
|
124 |
* Array of sub-options which should not be overloaded with multi-site defaults.
|
125 |
*
|
126 |
* @var array
|
127 |
*/
|
128 |
-
public $ms_exclude =
|
129 |
/* Theme dependent. */
|
130 |
'title_test',
|
131 |
'forcerewritetitle',
|
132 |
-
|
133 |
|
134 |
/**
|
135 |
* Add the actions and filters for the option.
|
@@ -140,15 +140,15 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
140 |
*/
|
141 |
protected function __construct() {
|
142 |
parent::__construct();
|
143 |
-
add_action( 'update_option_' . $this->option_name,
|
144 |
-
add_action( 'init',
|
145 |
|
146 |
-
add_action( 'registered_post_type',
|
147 |
-
add_action( 'unregistered_post_type',
|
148 |
-
add_action( 'registered_taxonomy',
|
149 |
-
add_action( 'unregistered_taxonomy',
|
150 |
|
151 |
-
add_filter( 'admin_title',
|
152 |
}
|
153 |
|
154 |
/**
|
@@ -186,7 +186,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
186 |
*/
|
187 |
$filtered_separators = apply_filters( 'wpseo_separator_options', $separators );
|
188 |
|
189 |
-
if ( is_array( $filtered_separators ) && $filtered_separators !==
|
190 |
$separators = array_merge( $separators, $filtered_separators );
|
191 |
}
|
192 |
|
@@ -202,15 +202,15 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
202 |
$separators = $this->get_separator_options();
|
203 |
$separator_list = self::get_separator_option_list();
|
204 |
|
205 |
-
$separator_options =
|
206 |
|
207 |
foreach ( $separators as $key => $label ) {
|
208 |
$aria_label = isset( $separator_list[ $key ]['label'] ) ? $separator_list[ $key ]['label'] : '';
|
209 |
|
210 |
-
$separator_options[ $key ] =
|
211 |
'label' => $label,
|
212 |
'aria_label' => $aria_label,
|
213 |
-
|
214 |
}
|
215 |
|
216 |
return $separator_options;
|
@@ -248,7 +248,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
248 |
return;
|
249 |
}
|
250 |
|
251 |
-
$enriched_defaults =
|
252 |
|
253 |
/*
|
254 |
* Retrieve all the relevant post type and taxonomy arrays.
|
@@ -256,7 +256,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
256 |
* WPSEO_Post_Type::get_accessible_post_types() should *not* be used here.
|
257 |
* These are the defaults and can be prepared for any public post type.
|
258 |
*/
|
259 |
-
$post_type_objects = get_post_types(
|
260 |
|
261 |
if ( $post_type_objects ) {
|
262 |
/* translators: %s expands to the name of a post type (plural). */
|
@@ -279,7 +279,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
279 |
}
|
280 |
}
|
281 |
|
282 |
-
$taxonomy_objects = get_taxonomies(
|
283 |
|
284 |
if ( $taxonomy_objects ) {
|
285 |
/* translators: %s expands to the variable used for term title. */
|
@@ -365,7 +365,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
365 |
|
366 |
case 'company_or_person':
|
367 |
if ( isset( $dirty[ $key ] ) ) {
|
368 |
-
if ( in_array( $dirty[ $key ],
|
369 |
$clean[ $key ] = $dirty[ $key ];
|
370 |
}
|
371 |
else {
|
@@ -410,11 +410,11 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
410 |
|
411 |
/* 'post_types-' . $pt->name . '-maintax' fields. */
|
412 |
case 'post_types-':
|
413 |
-
$post_type = str_replace(
|
414 |
$taxonomies = get_object_taxonomies( $post_type, 'names' );
|
415 |
|
416 |
if ( isset( $dirty[ $key ] ) ) {
|
417 |
-
if ( $taxonomies !==
|
418 |
$clean[ $key ] = $dirty[ $key ];
|
419 |
}
|
420 |
elseif ( (string) $dirty[ $key ] === '0' || (string) $dirty[ $key ] === '' ) {
|
@@ -451,7 +451,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
451 |
/* 'taxonomy-' . $tax->name . '-ptparent' fields. */
|
452 |
case 'taxonomy-':
|
453 |
if ( isset( $dirty[ $key ] ) ) {
|
454 |
-
if ( $allowed_post_types !==
|
455 |
$clean[ $key ] = $dirty[ $key ];
|
456 |
}
|
457 |
elseif ( (string) $dirty[ $key ] === '0' || (string) $dirty[ $key ] === '' ) {
|
@@ -470,7 +470,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
470 |
* @todo [JRF =? whomever] Maybe change the untranslated $tax name in the
|
471 |
* error message to the nicely translated label ?
|
472 |
*/
|
473 |
-
$tax = str_replace(
|
474 |
add_settings_error(
|
475 |
$this->group_name, // Slug title of the setting.
|
476 |
'_' . $tax, // Suffix-ID for the error message box.
|
@@ -565,18 +565,18 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
565 |
* @return array
|
566 |
*/
|
567 |
protected function get_allowed_post_types() {
|
568 |
-
$allowed_post_types =
|
569 |
|
570 |
/*
|
571 |
* WPSEO_Post_Type::get_accessible_post_types() should *not* be used here.
|
572 |
*/
|
573 |
-
$post_types = get_post_types(
|
574 |
|
575 |
if ( get_option( 'show_on_front' ) === 'page' && get_option( 'page_for_posts' ) > 0 ) {
|
576 |
$allowed_post_types[] = 'post';
|
577 |
}
|
578 |
|
579 |
-
if ( is_array( $post_types ) && $post_types !==
|
580 |
foreach ( $post_types as $type ) {
|
581 |
if ( WPSEO_Post_Type::has_archive( $type ) ) {
|
582 |
$allowed_post_types[] = $type->name;
|
@@ -604,9 +604,9 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
604 |
|
605 |
// Double-run this function to ensure renaming of the taxonomy options will work.
|
606 |
if ( ! isset( $original )
|
607 |
-
&& has_action( 'wpseo_double_clean_titles',
|
608 |
) {
|
609 |
-
add_action( 'wpseo_double_clean_titles',
|
610 |
$original = $option_value;
|
611 |
}
|
612 |
|
@@ -621,22 +621,22 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
621 |
$old_option = null;
|
622 |
if ( isset( $all_old_option_values ) ) {
|
623 |
// Ok, we have an import.
|
624 |
-
if ( isset( $all_old_option_values['wpseo_indexation'] ) && is_array( $all_old_option_values['wpseo_indexation'] ) && $all_old_option_values['wpseo_indexation'] !==
|
625 |
$old_option = $all_old_option_values['wpseo_indexation'];
|
626 |
}
|
627 |
}
|
628 |
else {
|
629 |
$old_option = get_option( 'wpseo_indexation' );
|
630 |
}
|
631 |
-
if ( is_array( $old_option ) && $old_option !==
|
632 |
-
$move =
|
633 |
'noindexauthor' => 'noindex-author',
|
634 |
'disableauthor' => 'disable-author',
|
635 |
'noindexdate' => 'noindex-archive',
|
636 |
'noindexcat' => 'noindex-category',
|
637 |
'noindextag' => 'noindex-post_tag',
|
638 |
'noindexpostformat' => 'noindex-post_format',
|
639 |
-
|
640 |
foreach ( $move as $old => $new ) {
|
641 |
if ( isset( $old_option[ $old ] ) && ! isset( $option_value[ $new ] ) ) {
|
642 |
$option_value[ $new ] = $old_option[ $old ];
|
@@ -661,7 +661,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
661 |
* Similarly, renaming the tax options to avoid a custom post type and a taxonomy
|
662 |
* with the same name occupying the same option.
|
663 |
*/
|
664 |
-
$rename =
|
665 |
'title-home' => 'title-home-wpseo',
|
666 |
'title-author' => 'title-author-wpseo',
|
667 |
'title-archive' => 'title-archive-wpseo',
|
@@ -672,7 +672,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
672 |
'metadesc-archive' => 'metadesc-archive-wpseo',
|
673 |
'noindex-author' => 'noindex-author-wpseo',
|
674 |
'noindex-archive' => 'noindex-archive-wpseo',
|
675 |
-
|
676 |
foreach ( $rename as $old => $new ) {
|
677 |
if ( isset( $option_value[ $old ] ) && ! isset( $option_value[ $new ] ) ) {
|
678 |
$option_value[ $new ] = $option_value[ $old ];
|
@@ -687,18 +687,18 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
687 |
* and post_types have been registered, i.e. at the end of the init action.}}
|
688 |
*/
|
689 |
if ( isset( $original ) && current_filter() === 'wpseo_double_clean_titles' || did_action( 'wpseo_double_clean_titles' ) > 0 ) {
|
690 |
-
$rename =
|
691 |
'title-' => 'title-tax-',
|
692 |
'metadesc-' => 'metadesc-tax-',
|
693 |
'noindex-' => 'noindex-tax-',
|
694 |
'tax-hideeditbox-' => 'hideeditbox-tax-',
|
695 |
|
696 |
-
|
697 |
|
698 |
-
$taxonomy_names = get_taxonomies(
|
699 |
-
$post_type_names = get_post_types(
|
700 |
$defaults = $this->get_defaults();
|
701 |
-
if ( $taxonomy_names !==
|
702 |
foreach ( $taxonomy_names as $tax ) {
|
703 |
foreach ( $rename as $old_prefix => $new_prefix ) {
|
704 |
if (
|
@@ -736,7 +736,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
736 |
* Make sure the values of the variable option key options are cleaned as they
|
737 |
* may be retained and would not be cleaned/validated then.
|
738 |
*/
|
739 |
-
if ( is_array( $option_value ) && $option_value !==
|
740 |
foreach ( $option_value as $key => $value ) {
|
741 |
$switch_key = $this->get_switch_key( $key );
|
742 |
|
@@ -792,7 +792,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
792 |
* @return array
|
793 |
*/
|
794 |
protected function retain_variable_keys( $dirty, $clean ) {
|
795 |
-
if ( ( is_array( $this->variable_array_key_patterns ) && $this->variable_array_key_patterns !==
|
796 |
|
797 |
// Add the extra pattern.
|
798 |
$patterns = $this->variable_array_key_patterns;
|
@@ -830,64 +830,64 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
|
830 |
* @return array An array of the separator options.
|
831 |
*/
|
832 |
protected static function get_separator_option_list() {
|
833 |
-
$separators =
|
834 |
-
'sc-dash' =>
|
835 |
'option' => '-',
|
836 |
'label' => __( 'Dash', 'wordpress-seo' ),
|
837 |
-
|
838 |
-
'sc-ndash' =>
|
839 |
'option' => '–',
|
840 |
'label' => __( 'En dash', 'wordpress-seo' ),
|
841 |
-
|
842 |
-
'sc-mdash' =>
|
843 |
'option' => '—',
|
844 |
'label' => __( 'Em dash', 'wordpress-seo' ),
|
845 |
-
|
846 |
-
'sc-colon' =>
|
847 |
'option' => ':',
|
848 |
'label' => __( 'Colon', 'wordpress-seo' ),
|
849 |
-
|
850 |
-
'sc-middot' =>
|
851 |
'option' => '·',
|
852 |
'label' => __( 'Middle dot', 'wordpress-seo' ),
|
853 |
-
|
854 |
-
'sc-bull' =>
|
855 |
'option' => '•',
|
856 |
'label' => __( 'Bullet', 'wordpress-seo' ),
|
857 |
-
|
858 |
-
'sc-star' =>
|
859 |
'option' => '*',
|
860 |
'label' => __( 'Asterisk', 'wordpress-seo' ),
|
861 |
-
|
862 |
-
'sc-smstar' =>
|
863 |
'option' => '⋆',
|
864 |
'label' => __( 'Low asterisk', 'wordpress-seo' ),
|
865 |
-
|
866 |
-
'sc-pipe' =>
|
867 |
'option' => '|',
|
868 |
'label' => __( 'Vertical bar', 'wordpress-seo' ),
|
869 |
-
|
870 |
-
'sc-tilde' =>
|
871 |
'option' => '~',
|
872 |
'label' => __( 'Small tilde', 'wordpress-seo' ),
|
873 |
-
|
874 |
-
'sc-laquo' =>
|
875 |
'option' => '«',
|
876 |
'label' => __( 'Left angle quotation mark', 'wordpress-seo' ),
|
877 |
-
|
878 |
-
'sc-raquo' =>
|
879 |
'option' => '»',
|
880 |
'label' => __( 'Right angle quotation mark', 'wordpress-seo' ),
|
881 |
-
|
882 |
-
'sc-lt' =>
|
883 |
'option' => '<',
|
884 |
'label' => __( 'Less than sign', 'wordpress-seo' ),
|
885 |
-
|
886 |
-
'sc-gt' =>
|
887 |
'option' => '>',
|
888 |
'label' => __( 'Greater than sign', 'wordpress-seo' ),
|
889 |
-
|
890 |
-
|
891 |
|
892 |
/**
|
893 |
* Allows altering the separator options array.
|
26 |
*
|
27 |
* @var array
|
28 |
*/
|
29 |
+
protected $defaults = [
|
30 |
// Non-form fields, set via (ajax) function.
|
31 |
'title_test' => 0,
|
32 |
// Form fields.
|
95 |
* - 'noindex-tax-' . $tax->name => false;
|
96 |
* - 'display-metabox-tax-' . $tax->name => false;
|
97 |
*/
|
98 |
+
];
|
99 |
|
100 |
/**
|
101 |
* Used for "caching" during pageload.
|
109 |
*
|
110 |
* @var array
|
111 |
*/
|
112 |
+
protected $variable_array_key_patterns = [
|
113 |
'title-',
|
114 |
'metadesc-',
|
115 |
'noindex-',
|
118 |
'bctitle-ptarchive-',
|
119 |
'post_types-',
|
120 |
'taxonomy-',
|
121 |
+
];
|
122 |
|
123 |
/**
|
124 |
* Array of sub-options which should not be overloaded with multi-site defaults.
|
125 |
*
|
126 |
* @var array
|
127 |
*/
|
128 |
+
public $ms_exclude = [
|
129 |
/* Theme dependent. */
|
130 |
'title_test',
|
131 |
'forcerewritetitle',
|
132 |
+
];
|
133 |
|
134 |
/**
|
135 |
* Add the actions and filters for the option.
|
140 |
*/
|
141 |
protected function __construct() {
|
142 |
parent::__construct();
|
143 |
+
add_action( 'update_option_' . $this->option_name, [ 'WPSEO_Utils', 'clear_cache' ] );
|
144 |
+
add_action( 'init', [ $this, 'end_of_init' ], 999 );
|
145 |
|
146 |
+
add_action( 'registered_post_type', [ $this, 'invalidate_enrich_defaults_cache' ] );
|
147 |
+
add_action( 'unregistered_post_type', [ $this, 'invalidate_enrich_defaults_cache' ] );
|
148 |
+
add_action( 'registered_taxonomy', [ $this, 'invalidate_enrich_defaults_cache' ] );
|
149 |
+
add_action( 'unregistered_taxonomy', [ $this, 'invalidate_enrich_defaults_cache' ] );
|
150 |
|
151 |
+
add_filter( 'admin_title', [ 'Yoast_Input_Validation', 'add_yoast_admin_document_title_errors' ] );
|
152 |
}
|
153 |
|
154 |
/**
|
186 |
*/
|
187 |
$filtered_separators = apply_filters( 'wpseo_separator_options', $separators );
|
188 |
|
189 |
+
if ( is_array( $filtered_separators ) && $filtered_separators !== [] ) {
|
190 |
$separators = array_merge( $separators, $filtered_separators );
|
191 |
}
|
192 |
|
202 |
$separators = $this->get_separator_options();
|
203 |
$separator_list = self::get_separator_option_list();
|
204 |
|
205 |
+
$separator_options = [];
|
206 |
|
207 |
foreach ( $separators as $key => $label ) {
|
208 |
$aria_label = isset( $separator_list[ $key ]['label'] ) ? $separator_list[ $key ]['label'] : '';
|
209 |
|
210 |
+
$separator_options[ $key ] = [
|
211 |
'label' => $label,
|
212 |
'aria_label' => $aria_label,
|
213 |
+
];
|
214 |
}
|
215 |
|
216 |
return $separator_options;
|
248 |
return;
|
249 |
}
|
250 |
|
251 |
+
$enriched_defaults = [];
|
252 |
|
253 |
/*
|
254 |
* Retrieve all the relevant post type and taxonomy arrays.
|
256 |
* WPSEO_Post_Type::get_accessible_post_types() should *not* be used here.
|
257 |
* These are the defaults and can be prepared for any public post type.
|
258 |
*/
|
259 |
+
$post_type_objects = get_post_types( [ 'public' => true ], 'objects' );
|
260 |
|
261 |
if ( $post_type_objects ) {
|
262 |
/* translators: %s expands to the name of a post type (plural). */
|
279 |
}
|
280 |
}
|
281 |
|
282 |
+
$taxonomy_objects = get_taxonomies( [ 'public' => true ], 'object' );
|
283 |
|
284 |
if ( $taxonomy_objects ) {
|
285 |
/* translators: %s expands to the variable used for term title. */
|
365 |
|
366 |
case 'company_or_person':
|
367 |
if ( isset( $dirty[ $key ] ) ) {
|
368 |
+
if ( in_array( $dirty[ $key ], [ 'company', 'person' ], true ) ) {
|
369 |
$clean[ $key ] = $dirty[ $key ];
|
370 |
}
|
371 |
else {
|
410 |
|
411 |
/* 'post_types-' . $pt->name . '-maintax' fields. */
|
412 |
case 'post_types-':
|
413 |
+
$post_type = str_replace( [ 'post_types-', '-maintax' ], '', $key );
|
414 |
$taxonomies = get_object_taxonomies( $post_type, 'names' );
|
415 |
|
416 |
if ( isset( $dirty[ $key ] ) ) {
|
417 |
+
if ( $taxonomies !== [] && in_array( $dirty[ $key ], $taxonomies, true ) ) {
|
418 |
$clean[ $key ] = $dirty[ $key ];
|
419 |
}
|
420 |
elseif ( (string) $dirty[ $key ] === '0' || (string) $dirty[ $key ] === '' ) {
|
451 |
/* 'taxonomy-' . $tax->name . '-ptparent' fields. */
|
452 |
case 'taxonomy-':
|
453 |
if ( isset( $dirty[ $key ] ) ) {
|
454 |
+
if ( $allowed_post_types !== [] && in_array( $dirty[ $key ], $allowed_post_types, true ) ) {
|
455 |
$clean[ $key ] = $dirty[ $key ];
|
456 |
}
|
457 |
elseif ( (string) $dirty[ $key ] === '0' || (string) $dirty[ $key ] === '' ) {
|
470 |
* @todo [JRF =? whomever] Maybe change the untranslated $tax name in the
|
471 |
* error message to the nicely translated label ?
|
472 |
*/
|
473 |
+
$tax = str_replace( [ 'taxonomy-', '-ptparent' ], '', $key );
|
474 |
add_settings_error(
|
475 |
$this->group_name, // Slug title of the setting.
|
476 |
'_' . $tax, // Suffix-ID for the error message box.
|
565 |
* @return array
|
566 |
*/
|
567 |
protected function get_allowed_post_types() {
|
568 |
+
$allowed_post_types = [];
|
569 |
|
570 |
/*
|
571 |
* WPSEO_Post_Type::get_accessible_post_types() should *not* be used here.
|
572 |
*/
|
573 |
+
$post_types = get_post_types( [ 'public' => true ], 'objects' );
|
574 |
|
575 |
if ( get_option( 'show_on_front' ) === 'page' && get_option( 'page_for_posts' ) > 0 ) {
|
576 |
$allowed_post_types[] = 'post';
|
577 |
}
|
578 |
|
579 |
+
if ( is_array( $post_types ) && $post_types !== [] ) {
|
580 |
foreach ( $post_types as $type ) {
|
581 |
if ( WPSEO_Post_Type::has_archive( $type ) ) {
|
582 |
$allowed_post_types[] = $type->name;
|
604 |
|
605 |
// Double-run this function to ensure renaming of the taxonomy options will work.
|
606 |
if ( ! isset( $original )
|
607 |
+
&& has_action( 'wpseo_double_clean_titles', [ $this, 'clean' ] ) === false
|
608 |
) {
|
609 |
+
add_action( 'wpseo_double_clean_titles', [ $this, 'clean' ] );
|
610 |
$original = $option_value;
|
611 |
}
|
612 |
|
621 |
$old_option = null;
|
622 |
if ( isset( $all_old_option_values ) ) {
|
623 |
// Ok, we have an import.
|
624 |
+
if ( isset( $all_old_option_values['wpseo_indexation'] ) && is_array( $all_old_option_values['wpseo_indexation'] ) && $all_old_option_values['wpseo_indexation'] !== [] ) {
|
625 |
$old_option = $all_old_option_values['wpseo_indexation'];
|
626 |
}
|
627 |
}
|
628 |
else {
|
629 |
$old_option = get_option( 'wpseo_indexation' );
|
630 |
}
|
631 |
+
if ( is_array( $old_option ) && $old_option !== [] ) {
|
632 |
+
$move = [
|
633 |
'noindexauthor' => 'noindex-author',
|
634 |
'disableauthor' => 'disable-author',
|
635 |
'noindexdate' => 'noindex-archive',
|
636 |
'noindexcat' => 'noindex-category',
|
637 |
'noindextag' => 'noindex-post_tag',
|
638 |
'noindexpostformat' => 'noindex-post_format',
|
639 |
+
];
|
640 |
foreach ( $move as $old => $new ) {
|
641 |
if ( isset( $old_option[ $old ] ) && ! isset( $option_value[ $new ] ) ) {
|
642 |
$option_value[ $new ] = $old_option[ $old ];
|
661 |
* Similarly, renaming the tax options to avoid a custom post type and a taxonomy
|
662 |
* with the same name occupying the same option.
|
663 |
*/
|
664 |
+
$rename = [
|
665 |
'title-home' => 'title-home-wpseo',
|
666 |
'title-author' => 'title-author-wpseo',
|
667 |
'title-archive' => 'title-archive-wpseo',
|
672 |
'metadesc-archive' => 'metadesc-archive-wpseo',
|
673 |
'noindex-author' => 'noindex-author-wpseo',
|
674 |
'noindex-archive' => 'noindex-archive-wpseo',
|
675 |
+
];
|
676 |
foreach ( $rename as $old => $new ) {
|
677 |
if ( isset( $option_value[ $old ] ) && ! isset( $option_value[ $new ] ) ) {
|
678 |
$option_value[ $new ] = $option_value[ $old ];
|
687 |
* and post_types have been registered, i.e. at the end of the init action.}}
|
688 |
*/
|
689 |
if ( isset( $original ) && current_filter() === 'wpseo_double_clean_titles' || did_action( 'wpseo_double_clean_titles' ) > 0 ) {
|
690 |
+
$rename = [
|
691 |
'title-' => 'title-tax-',
|
692 |
'metadesc-' => 'metadesc-tax-',
|
693 |
'noindex-' => 'noindex-tax-',
|
694 |
'tax-hideeditbox-' => 'hideeditbox-tax-',
|
695 |
|
696 |
+
];
|
697 |
|
698 |
+
$taxonomy_names = get_taxonomies( [ 'public' => true ], 'names' );
|
699 |
+
$post_type_names = get_post_types( [ 'public' => true ], 'names' );
|
700 |
$defaults = $this->get_defaults();
|
701 |
+
if ( $taxonomy_names !== [] ) {
|
702 |
foreach ( $taxonomy_names as $tax ) {
|
703 |
foreach ( $rename as $old_prefix => $new_prefix ) {
|
704 |
if (
|
736 |
* Make sure the values of the variable option key options are cleaned as they
|
737 |
* may be retained and would not be cleaned/validated then.
|
738 |
*/
|
739 |
+
if ( is_array( $option_value ) && $option_value !== [] ) {
|
740 |
foreach ( $option_value as $key => $value ) {
|
741 |
$switch_key = $this->get_switch_key( $key );
|
742 |
|
792 |
* @return array
|
793 |
*/
|
794 |
protected function retain_variable_keys( $dirty, $clean ) {
|
795 |
+
if ( ( is_array( $this->variable_array_key_patterns ) && $this->variable_array_key_patterns !== [] ) && ( is_array( $dirty ) && $dirty !== [] ) ) {
|
796 |
|
797 |
// Add the extra pattern.
|
798 |
$patterns = $this->variable_array_key_patterns;
|
830 |
* @return array An array of the separator options.
|
831 |
*/
|
832 |
protected static function get_separator_option_list() {
|
833 |
+
$separators = [
|
834 |
+
'sc-dash' => [
|
835 |
'option' => '-',
|
836 |
'label' => __( 'Dash', 'wordpress-seo' ),
|
837 |
+
],
|
838 |
+
'sc-ndash' => [
|
839 |
'option' => '–',
|
840 |
'label' => __( 'En dash', 'wordpress-seo' ),
|
841 |
+
],
|
842 |
+
'sc-mdash' => [
|
843 |
'option' => '—',
|
844 |
'label' => __( 'Em dash', 'wordpress-seo' ),
|
845 |
+
],
|
846 |
+
'sc-colon' => [
|
847 |
'option' => ':',
|
848 |
'label' => __( 'Colon', 'wordpress-seo' ),
|
849 |
+
],
|
850 |
+
'sc-middot' => [
|
851 |
'option' => '·',
|
852 |
'label' => __( 'Middle dot', 'wordpress-seo' ),
|
853 |
+
],
|
854 |
+
'sc-bull' => [
|
855 |
'option' => '•',
|
856 |
'label' => __( 'Bullet', 'wordpress-seo' ),
|
857 |
+
],
|
858 |
+
'sc-star' => [
|
859 |
'option' => '*',
|
860 |
'label' => __( 'Asterisk', 'wordpress-seo' ),
|
861 |
+
],
|
862 |
+
'sc-smstar' => [
|
863 |
'option' => '⋆',
|
864 |
'label' => __( 'Low asterisk', 'wordpress-seo' ),
|
865 |
+
],
|
866 |
+
'sc-pipe' => [
|
867 |
'option' => '|',
|
868 |
'label' => __( 'Vertical bar', 'wordpress-seo' ),
|
869 |
+
],
|
870 |
+
'sc-tilde' => [
|
871 |
'option' => '~',
|
872 |
'label' => __( 'Small tilde', 'wordpress-seo' ),
|
873 |
+
],
|
874 |
+
'sc-laquo' => [
|
875 |
'option' => '«',
|
876 |
'label' => __( 'Left angle quotation mark', 'wordpress-seo' ),
|
877 |
+
],
|
878 |
+
'sc-raquo' => [
|
879 |
'option' => '»',
|
880 |
'label' => __( 'Right angle quotation mark', 'wordpress-seo' ),
|
881 |
+
],
|
882 |
+
'sc-lt' => [
|
883 |
'option' => '<',
|
884 |
'label' => __( 'Less than sign', 'wordpress-seo' ),
|
885 |
+
],
|
886 |
+
'sc-gt' => [
|
887 |
'option' => '>',
|
888 |
'label' => __( 'Greater than sign', 'wordpress-seo' ),
|
889 |
+
],
|
890 |
+
];
|
891 |
|
892 |
/**
|
893 |
* Allows altering the separator options array.
|
inc/options/class-wpseo-option-wpseo.php
CHANGED
@@ -24,7 +24,7 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
|
|
24 |
*
|
25 |
* @var array
|
26 |
*/
|
27 |
-
protected $defaults =
|
28 |
// Non-form fields, set via (ajax) function.
|
29 |
'ms_defaults_set' => false,
|
30 |
// Non-form field, should only be set via validation routine.
|
@@ -48,34 +48,34 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
|
|
48 |
'enable_text_link_counter' => true,
|
49 |
'show_onboarding_notice' => false,
|
50 |
'first_activated_on' => false,
|
51 |
-
'myyoast-oauth' =>
|
52 |
-
'config' =>
|
53 |
'clientId' => null,
|
54 |
'secret' => null,
|
55 |
-
|
56 |
-
'access_tokens' =>
|
57 |
-
|
58 |
-
|
59 |
|
60 |
/**
|
61 |
* Sub-options which should not be overloaded with multi-site defaults.
|
62 |
*
|
63 |
* @var array
|
64 |
*/
|
65 |
-
public $ms_exclude =
|
66 |
/* Privacy. */
|
67 |
'baiduverify',
|
68 |
'googleverify',
|
69 |
'msverify',
|
70 |
'yandexverify',
|
71 |
-
|
72 |
|
73 |
/**
|
74 |
* Possible values for the site_type option.
|
75 |
*
|
76 |
* @var array
|
77 |
*/
|
78 |
-
protected $site_types =
|
79 |
'',
|
80 |
'blog',
|
81 |
'shop',
|
@@ -83,30 +83,30 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
|
|
83 |
'smallBusiness',
|
84 |
'corporateOther',
|
85 |
'personalOther',
|
86 |
-
|
87 |
|
88 |
/**
|
89 |
* Possible environment types.
|
90 |
*
|
91 |
* @var array
|
92 |
*/
|
93 |
-
protected $environment_types =
|
94 |
'',
|
95 |
'production',
|
96 |
'staging',
|
97 |
'development',
|
98 |
-
|
99 |
|
100 |
/**
|
101 |
* Possible has_multiple_authors options.
|
102 |
*
|
103 |
* @var array
|
104 |
*/
|
105 |
-
protected $has_multiple_authors_options =
|
106 |
'',
|
107 |
true,
|
108 |
false,
|
109 |
-
|
110 |
|
111 |
/**
|
112 |
* Name for an option higher in the hierarchy to override setting access.
|
@@ -128,10 +128,10 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
|
|
128 |
parent::__construct();
|
129 |
|
130 |
/* Clear the cache on update/add. */
|
131 |
-
add_action( 'add_option_' . $this->option_name,
|
132 |
-
add_action( 'update_option_' . $this->option_name,
|
133 |
|
134 |
-
add_filter( 'admin_title',
|
135 |
|
136 |
/**
|
137 |
* Filter the `wpseo` option defaults.
|
@@ -322,13 +322,13 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
|
|
322 |
*
|
323 |
* @return mixed Filtered $options value.
|
324 |
*/
|
325 |
-
public function verify_features_against_network( $options =
|
326 |
if ( ! is_array( $options ) || empty( $options ) ) {
|
327 |
return $options;
|
328 |
}
|
329 |
|
330 |
// For the feature variables, set their values to off in case they are disabled.
|
331 |
-
$feature_vars =
|
332 |
'disableadvanced_meta' => false,
|
333 |
'onpage_indexability' => false,
|
334 |
'content_analysis_active' => false,
|
@@ -337,7 +337,7 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
|
|
337 |
'enable_cornerstone_content' => false,
|
338 |
'enable_xml_sitemap' => false,
|
339 |
'enable_text_link_counter' => false,
|
340 |
-
|
341 |
|
342 |
// We can reuse this logic from the base class with the above defaults to parse with the correct feature values.
|
343 |
$options = $this->prevent_disabled_options_update( $options, $feature_vars );
|
@@ -353,11 +353,11 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
|
|
353 |
* and the third is the hook priority.
|
354 |
*/
|
355 |
protected function get_verify_features_option_filter_hook() {
|
356 |
-
return
|
357 |
"option_{$this->option_name}",
|
358 |
-
|
359 |
11,
|
360 |
-
|
361 |
}
|
362 |
|
363 |
/**
|
@@ -367,11 +367,11 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
|
|
367 |
* and the third is the hook priority.
|
368 |
*/
|
369 |
protected function get_verify_features_default_option_filter_hook() {
|
370 |
-
return
|
371 |
"default_option_{$this->option_name}",
|
372 |
-
|
373 |
11,
|
374 |
-
|
375 |
}
|
376 |
|
377 |
/**
|
24 |
*
|
25 |
* @var array
|
26 |
*/
|
27 |
+
protected $defaults = [
|
28 |
// Non-form fields, set via (ajax) function.
|
29 |
'ms_defaults_set' => false,
|
30 |
// Non-form field, should only be set via validation routine.
|
48 |
'enable_text_link_counter' => true,
|
49 |
'show_onboarding_notice' => false,
|
50 |
'first_activated_on' => false,
|
51 |
+
'myyoast-oauth' => [
|
52 |
+
'config' => [
|
53 |
'clientId' => null,
|
54 |
'secret' => null,
|
55 |
+
],
|
56 |
+
'access_tokens' => [],
|
57 |
+
],
|
58 |
+
];
|
59 |
|
60 |
/**
|
61 |
* Sub-options which should not be overloaded with multi-site defaults.
|
62 |
*
|
63 |
* @var array
|
64 |
*/
|
65 |
+
public $ms_exclude = [
|
66 |
/* Privacy. */
|
67 |
'baiduverify',
|
68 |
'googleverify',
|
69 |
'msverify',
|
70 |
'yandexverify',
|
71 |
+
];
|
72 |
|
73 |
/**
|
74 |
* Possible values for the site_type option.
|
75 |
*
|
76 |
* @var array
|
77 |
*/
|
78 |
+
protected $site_types = [
|
79 |
'',
|
80 |
'blog',
|
81 |
'shop',
|
83 |
'smallBusiness',
|
84 |
'corporateOther',
|
85 |
'personalOther',
|
86 |
+
];
|
87 |
|
88 |
/**
|
89 |
* Possible environment types.
|
90 |
*
|
91 |
* @var array
|
92 |
*/
|
93 |
+
protected $environment_types = [
|
94 |
'',
|
95 |
'production',
|
96 |
'staging',
|
97 |
'development',
|
98 |
+
];
|
99 |
|
100 |
/**
|
101 |
* Possible has_multiple_authors options.
|
102 |
*
|
103 |
* @var array
|
104 |
*/
|
105 |
+
protected $has_multiple_authors_options = [
|
106 |
'',
|
107 |
true,
|
108 |
false,
|
109 |
+
];
|
110 |
|
111 |
/**
|
112 |
* Name for an option higher in the hierarchy to override setting access.
|
128 |
parent::__construct();
|
129 |
|
130 |
/* Clear the cache on update/add. */
|
131 |
+
add_action( 'add_option_' . $this->option_name, [ 'WPSEO_Utils', 'clear_cache' ] );
|
132 |
+
add_action( 'update_option_' . $this->option_name, [ 'WPSEO_Utils', 'clear_cache' ] );
|
133 |
|
134 |
+
add_filter( 'admin_title', [ 'Yoast_Input_Validation', 'add_yoast_admin_document_title_errors' ] );
|
135 |
|
136 |
/**
|
137 |
* Filter the `wpseo` option defaults.
|
322 |
*
|
323 |
* @return mixed Filtered $options value.
|
324 |
*/
|
325 |
+
public function verify_features_against_network( $options = [] ) {
|
326 |
if ( ! is_array( $options ) || empty( $options ) ) {
|
327 |
return $options;
|
328 |
}
|
329 |
|
330 |
// For the feature variables, set their values to off in case they are disabled.
|
331 |
+
$feature_vars = [
|
332 |
'disableadvanced_meta' => false,
|
333 |
'onpage_indexability' => false,
|
334 |
'content_analysis_active' => false,
|
337 |
'enable_cornerstone_content' => false,
|
338 |
'enable_xml_sitemap' => false,
|
339 |
'enable_text_link_counter' => false,
|
340 |
+
];
|
341 |
|
342 |
// We can reuse this logic from the base class with the above defaults to parse with the correct feature values.
|
343 |
$options = $this->prevent_disabled_options_update( $options, $feature_vars );
|
353 |
* and the third is the hook priority.
|
354 |
*/
|
355 |
protected function get_verify_features_option_filter_hook() {
|
356 |
+
return [
|
357 |
"option_{$this->option_name}",
|
358 |
+
[ $this, 'verify_features_against_network' ],
|
359 |
11,
|
360 |
+
];
|
361 |
}
|
362 |
|
363 |
/**
|
367 |
* and the third is the hook priority.
|
368 |
*/
|
369 |
protected function get_verify_features_default_option_filter_hook() {
|
370 |
+
return [
|
371 |
"default_option_{$this->option_name}",
|
372 |
+
[ $this, 'verify_features_against_network' ],
|
373 |
11,
|
374 |
+
];
|
375 |
}
|
376 |
|
377 |
/**
|
inc/options/class-wpseo-option.php
CHANGED
@@ -121,7 +121,7 @@ abstract class WPSEO_Option {
|
|
121 |
*
|
122 |
* @var array
|
123 |
*/
|
124 |
-
public $ms_exclude =
|
125 |
|
126 |
/**
|
127 |
* Name for an option higher in the hierarchy to override setting access.
|
@@ -157,9 +157,9 @@ abstract class WPSEO_Option {
|
|
157 |
* The option validation routines remove the default filters to prevent failing
|
158 |
* to insert an option if it's new. Let's add them back afterwards.
|
159 |
*/
|
160 |
-
add_action( 'add_option',
|
161 |
|
162 |
-
add_action( 'update_option',
|
163 |
}
|
164 |
elseif ( is_multisite() ) {
|
165 |
/*
|
@@ -170,8 +170,8 @@ abstract class WPSEO_Option {
|
|
170 |
* on an insert/update failure. Please use the WPSEO_Options::update_site_option() method
|
171 |
* for updating site options to make sure the filters are in place.
|
172 |
*/
|
173 |
-
add_action( 'add_site_option_' . $this->option_name,
|
174 |
-
add_action( 'update_site_option_' . $this->option_name,
|
175 |
|
176 |
}
|
177 |
|
@@ -180,13 +180,13 @@ abstract class WPSEO_Option {
|
|
180 |
* Make sure the option will always get validated, independently of register_setting()
|
181 |
* (only available on back-end).
|
182 |
*/
|
183 |
-
add_filter( 'sanitize_option_' . $this->option_name,
|
184 |
|
185 |
// Flushes the rewrite rules when option is updated.
|
186 |
-
add_action( 'update_option_' . $this->option_name,
|
187 |
|
188 |
/* Register our option for the admin pages */
|
189 |
-
add_action( 'admin_init',
|
190 |
|
191 |
|
192 |
/* Set option group name if not given */
|
@@ -196,7 +196,7 @@ abstract class WPSEO_Option {
|
|
196 |
|
197 |
/* Translate some defaults as early as possible - textdomain is loaded in init on priority 1. */
|
198 |
if ( method_exists( $this, 'translate_defaults' ) ) {
|
199 |
-
add_action( 'init',
|
200 |
}
|
201 |
|
202 |
/**
|
@@ -207,7 +207,7 @@ abstract class WPSEO_Option {
|
|
207 |
* enrichment are used before the enriching.
|
208 |
*/
|
209 |
if ( method_exists( $this, 'enrich_defaults' ) ) {
|
210 |
-
add_action( 'init',
|
211 |
}
|
212 |
}
|
213 |
|
121 |
*
|
122 |
* @var array
|
123 |
*/
|
124 |
+
public $ms_exclude = [];
|
125 |
|
126 |
/**
|
127 |
* Name for an option higher in the hierarchy to override setting access.
|
157 |
* The option validation routines remove the default filters to prevent failing
|
158 |
* to insert an option if it's new. Let's add them back afterwards.
|
159 |
*/
|
160 |
+
add_action( 'add_option', [ $this, 'add_default_filters' ] ); // Adding back after INSERT.
|
161 |
|
162 |
+
add_action( 'update_option', [ $this, 'add_default_filters' ] );
|
163 |
}
|
164 |
elseif ( is_multisite() ) {
|
165 |
/*
|
170 |
* on an insert/update failure. Please use the WPSEO_Options::update_site_option() method
|
171 |
* for updating site options to make sure the filters are in place.
|
172 |
*/
|
173 |
+
add_action( 'add_site_option_' . $this->option_name, [ $this, 'add_default_filters' ] );
|
174 |
+
add_action( 'update_site_option_' . $this->option_name, [ $this, 'add_default_filters' ] );
|
175 |
|
176 |
}
|
177 |
|
180 |
* Make sure the option will always get validated, independently of register_setting()
|
181 |
* (only available on back-end).
|
182 |
*/
|
183 |
+
add_filter( 'sanitize_option_' . $this->option_name, [ $this, 'validate' ] );
|
184 |
|
185 |
// Flushes the rewrite rules when option is updated.
|
186 |
+
add_action( 'update_option_' . $this->option_name, [ 'WPSEO_Utils', 'clear_rewrites' ] );
|
187 |
|
188 |
/* Register our option for the admin pages */
|
189 |
+
add_action( 'admin_init', [ $this, 'register_setting' ] );
|
190 |
|
191 |
|
192 |
/* Set option group name if not given */
|
196 |
|
197 |
/* Translate some defaults as early as possible - textdomain is loaded in init on priority 1. */
|
198 |
if ( method_exists( $this, 'translate_defaults' ) ) {
|
199 |
+
add_action( 'init', [ $this, 'translate_defaults' ], 2 );
|
200 |
}
|
201 |
|
202 |
/**
|
207 |
* enrichment are used before the enriching.
|
208 |
*/
|
209 |
if ( method_exists( $this, 'enrich_defaults' ) ) {
|
210 |
+
add_action( 'init', [ $this, 'enrich_defaults' ], 99 );
|
211 |
}
|
212 |
}
|
213 |
|
inc/options/class-wpseo-options-backfill.php
CHANGED
@@ -32,15 +32,15 @@ class WPSEO_Options_Backfill implements WPSEO_WordPress_Integration {
|
|
32 |
|
33 |
// Backfill options that were removed.
|
34 |
foreach ( $this->get_lookups() as $option ) {
|
35 |
-
add_filter( 'pre_option_' . $option,
|
36 |
}
|
37 |
|
38 |
// Make sure renamed meta key is backfilled.
|
39 |
-
add_filter( 'get_user_metadata',
|
40 |
|
41 |
// Extend the options that have removed items.
|
42 |
-
add_filter( 'option_wpseo_titles',
|
43 |
-
add_filter( 'option_wpseo',
|
44 |
}
|
45 |
|
46 |
/**
|
@@ -49,15 +49,15 @@ class WPSEO_Options_Backfill implements WPSEO_WordPress_Integration {
|
|
49 |
public function remove_hooks() {
|
50 |
// Remove backfill options filter.
|
51 |
foreach ( $this->get_lookups() as $option ) {
|
52 |
-
remove_filter( 'pre_option_' . $option,
|
53 |
}
|
54 |
|
55 |
// Remove user meta filter.
|
56 |
-
remove_filter( 'get_user_metadata',
|
57 |
|
58 |
// Remove option extending filters.
|
59 |
-
remove_filter( 'option_wpseo_titles',
|
60 |
-
remove_filter( 'option_wpseo',
|
61 |
|
62 |
$this->hooked = false;
|
63 |
}
|
@@ -70,12 +70,12 @@ class WPSEO_Options_Backfill implements WPSEO_WordPress_Integration {
|
|
70 |
* @return array List of options that need to be backfilled.
|
71 |
*/
|
72 |
protected function get_lookups() {
|
73 |
-
return
|
74 |
'wpseo_internallinks',
|
75 |
'wpseo_rss',
|
76 |
'wpseo_xml',
|
77 |
'wpseo_permalinks',
|
78 |
-
|
79 |
}
|
80 |
|
81 |
/**
|
@@ -88,16 +88,16 @@ class WPSEO_Options_Backfill implements WPSEO_WordPress_Integration {
|
|
88 |
* @return array The settings for the provided option.
|
89 |
*/
|
90 |
protected function get_settings( $option ) {
|
91 |
-
$settings =
|
92 |
-
'wpseo' =>
|
93 |
'website_name' => 'website_name',
|
94 |
'alternate_website_name' => 'alternate_website_name',
|
95 |
'company_logo' => 'company_logo',
|
96 |
'company_name' => 'company_name',
|
97 |
'company_or_person' => 'company_or_person',
|
98 |
'person_name' => 'person_name',
|
99 |
-
|
100 |
-
'wpseo_internallinks' =>
|
101 |
'breadcrumbs-404crumb' => 'breadcrumbs-404crumb',
|
102 |
'breadcrumbs-blog-remove' => 'breadcrumbs-display-blog-page',
|
103 |
'breadcrumbs-boldlast' => 'breadcrumbs-boldlast',
|
@@ -107,24 +107,24 @@ class WPSEO_Options_Backfill implements WPSEO_WordPress_Integration {
|
|
107 |
'breadcrumbs-prefix' => 'breadcrumbs-prefix',
|
108 |
'breadcrumbs-searchprefix' => 'breadcrumbs-searchprefix',
|
109 |
'breadcrumbs-sep' => 'breadcrumbs-sep',
|
110 |
-
|
111 |
-
'wpseo_rss' =>
|
112 |
'rssbefore' => 'rssbefore',
|
113 |
'rssafter' => 'rssafter',
|
114 |
-
|
115 |
-
'wpseo_xml' =>
|
116 |
'enablexmlsitemap' => 'enable_xml_sitemap',
|
117 |
'disable_author_sitemap' => 'noindex-author-wpseo',
|
118 |
'disable_author_noposts' => 'noindex-author-noposts-wpseo',
|
119 |
-
|
120 |
-
'wpseo_permalinks' =>
|
121 |
'redirectattachment' => 'disable-attachment',
|
122 |
'stripcategorybase' => 'stripcategorybase',
|
123 |
-
|
124 |
-
|
125 |
|
126 |
if ( ! isset( $settings[ $option ] ) ) {
|
127 |
-
return
|
128 |
}
|
129 |
|
130 |
return $settings[ $option ];
|
@@ -198,7 +198,7 @@ class WPSEO_Options_Backfill implements WPSEO_WordPress_Integration {
|
|
198 |
* @return array Option data.
|
199 |
*/
|
200 |
public function backfill_option( $value, $option ) {
|
201 |
-
$output =
|
202 |
|
203 |
foreach ( $this->get_settings( $option ) as $old_key => $new_key ) {
|
204 |
$output[ $old_key ] = WPSEO_Options::get( $new_key );
|
@@ -274,7 +274,7 @@ class WPSEO_Options_Backfill implements WPSEO_WordPress_Integration {
|
|
274 |
// Add defaults for completely removed settings in the option.
|
275 |
return array_merge(
|
276 |
$data,
|
277 |
-
|
278 |
'cleanpermalinks' => false,
|
279 |
'cleanpermalink-extravars' => '',
|
280 |
'cleanpermalink-googlecampaign' => false,
|
@@ -282,7 +282,7 @@ class WPSEO_Options_Backfill implements WPSEO_WordPress_Integration {
|
|
282 |
'cleanreplytocom' => false,
|
283 |
'cleanslugs' => false,
|
284 |
'trailingslash' => false,
|
285 |
-
|
286 |
);
|
287 |
}
|
288 |
|
@@ -304,10 +304,10 @@ class WPSEO_Options_Backfill implements WPSEO_WordPress_Integration {
|
|
304 |
// Add dynamic implementations for settings that are not in any option anymore.
|
305 |
return array_merge(
|
306 |
$data,
|
307 |
-
|
308 |
'entries-per-page' => (int) apply_filters( 'wpseo_sitemap_entries_per_page', 1000 ),
|
309 |
-
'excluded-posts' => apply_filters( 'wpseo_exclude_from_sitemap_by_post_ids',
|
310 |
-
|
311 |
);
|
312 |
}
|
313 |
}
|
32 |
|
33 |
// Backfill options that were removed.
|
34 |
foreach ( $this->get_lookups() as $option ) {
|
35 |
+
add_filter( 'pre_option_' . $option, [ $this, 'backfill_option' ], 10, 2 );
|
36 |
}
|
37 |
|
38 |
// Make sure renamed meta key is backfilled.
|
39 |
+
add_filter( 'get_user_metadata', [ $this, 'backfill_usermeta' ], 10, 3 );
|
40 |
|
41 |
// Extend the options that have removed items.
|
42 |
+
add_filter( 'option_wpseo_titles', [ $this, 'extend_wpseo_titles' ], 10, 1 );
|
43 |
+
add_filter( 'option_wpseo', [ $this, 'extend_wpseo' ], 10, 1 );
|
44 |
}
|
45 |
|
46 |
/**
|
49 |
public function remove_hooks() {
|
50 |
// Remove backfill options filter.
|
51 |
foreach ( $this->get_lookups() as $option ) {
|
52 |
+
remove_filter( 'pre_option_' . $option, [ $this, 'backfill_option' ], 10 );
|
53 |
}
|
54 |
|
55 |
// Remove user meta filter.
|
56 |
+
remove_filter( 'get_user_metadata', [ $this, 'backfill_usermeta' ], 10 );
|
57 |
|
58 |
// Remove option extending filters.
|
59 |
+
remove_filter( 'option_wpseo_titles', [ $this, 'extend_wpseo_titles' ], 10 );
|
60 |
+
remove_filter( 'option_wpseo', [ $this, 'extend_wpseo' ], 10 );
|
61 |
|
62 |
$this->hooked = false;
|
63 |
}
|
70 |
* @return array List of options that need to be backfilled.
|
71 |
*/
|
72 |
protected function get_lookups() {
|
73 |
+
return [
|
74 |
'wpseo_internallinks',
|
75 |
'wpseo_rss',
|
76 |
'wpseo_xml',
|
77 |
'wpseo_permalinks',
|
78 |
+
];
|
79 |
}
|
80 |
|
81 |
/**
|
88 |
* @return array The settings for the provided option.
|
89 |
*/
|
90 |
protected function get_settings( $option ) {
|
91 |
+
$settings = [
|
92 |
+
'wpseo' => [
|
93 |
'website_name' => 'website_name',
|
94 |
'alternate_website_name' => 'alternate_website_name',
|
95 |
'company_logo' => 'company_logo',
|
96 |
'company_name' => 'company_name',
|
97 |
'company_or_person' => 'company_or_person',
|
98 |
'person_name' => 'person_name',
|
99 |
+
],
|
100 |
+
'wpseo_internallinks' => [
|
101 |
'breadcrumbs-404crumb' => 'breadcrumbs-404crumb',
|
102 |
'breadcrumbs-blog-remove' => 'breadcrumbs-display-blog-page',
|
103 |
'breadcrumbs-boldlast' => 'breadcrumbs-boldlast',
|
107 |
'breadcrumbs-prefix' => 'breadcrumbs-prefix',
|
108 |
'breadcrumbs-searchprefix' => 'breadcrumbs-searchprefix',
|
109 |
'breadcrumbs-sep' => 'breadcrumbs-sep',
|
110 |
+
],
|
111 |
+
'wpseo_rss' => [
|
112 |
'rssbefore' => 'rssbefore',
|
113 |
'rssafter' => 'rssafter',
|
114 |
+
],
|
115 |
+
'wpseo_xml' => [
|
116 |
'enablexmlsitemap' => 'enable_xml_sitemap',
|
117 |
'disable_author_sitemap' => 'noindex-author-wpseo',
|
118 |
'disable_author_noposts' => 'noindex-author-noposts-wpseo',
|
119 |
+
],
|
120 |
+
'wpseo_permalinks' => [
|
121 |
'redirectattachment' => 'disable-attachment',
|
122 |
'stripcategorybase' => 'stripcategorybase',
|
123 |
+
],
|
124 |
+
];
|
125 |
|
126 |
if ( ! isset( $settings[ $option ] ) ) {
|
127 |
+
return [];
|
128 |
}
|
129 |
|
130 |
return $settings[ $option ];
|
198 |
* @return array Option data.
|
199 |
*/
|
200 |
public function backfill_option( $value, $option ) {
|
201 |
+
$output = [];
|
202 |
|
203 |
foreach ( $this->get_settings( $option ) as $old_key => $new_key ) {
|
204 |
$output[ $old_key ] = WPSEO_Options::get( $new_key );
|
274 |
// Add defaults for completely removed settings in the option.
|
275 |
return array_merge(
|
276 |
$data,
|
277 |
+
[
|
278 |
'cleanpermalinks' => false,
|
279 |
'cleanpermalink-extravars' => '',
|
280 |
'cleanpermalink-googlecampaign' => false,
|
282 |
'cleanreplytocom' => false,
|
283 |
'cleanslugs' => false,
|
284 |
'trailingslash' => false,
|
285 |
+
]
|
286 |
);
|
287 |
}
|
288 |
|
304 |
// Add dynamic implementations for settings that are not in any option anymore.
|
305 |
return array_merge(
|
306 |
$data,
|
307 |
+
[
|
308 |
'entries-per-page' => (int) apply_filters( 'wpseo_sitemap_entries_per_page', 1000 ),
|
309 |
+
'excluded-posts' => apply_filters( 'wpseo_exclude_from_sitemap_by_post_ids', [] ),
|
310 |
+
]
|
311 |
);
|
312 |
}
|
313 |
}
|
inc/options/class-wpseo-options.php
CHANGED
@@ -17,27 +17,27 @@ class WPSEO_Options {
|
|
17 |
*
|
18 |
* @var array Array format: (string) option_name => (string) name of concrete class for the option.
|
19 |
*/
|
20 |
-
public static $options =
|
21 |
'wpseo' => 'WPSEO_Option_Wpseo',
|
22 |
'wpseo_titles' => 'WPSEO_Option_Titles',
|
23 |
'wpseo_social' => 'WPSEO_Option_Social',
|
24 |
'wpseo_ms' => 'WPSEO_Option_MS',
|
25 |
'wpseo_taxonomy_meta' => 'WPSEO_Taxonomy_Meta',
|
26 |
-
|
27 |
|
28 |
/**
|
29 |
* Array of instantiated option objects.
|
30 |
*
|
31 |
* @var array
|
32 |
*/
|
33 |
-
protected static $option_instances =
|
34 |
|
35 |
/**
|
36 |
* Array with the option names.
|
37 |
*
|
38 |
* @var array
|
39 |
*/
|
40 |
-
protected static $option_names =
|
41 |
|
42 |
/**
|
43 |
* Instance of this class.
|
@@ -62,7 +62,7 @@ class WPSEO_Options {
|
|
62 |
self::$backfill->register_hooks();
|
63 |
|
64 |
foreach ( self::$options as $option_name => $option_class ) {
|
65 |
-
self::register_option( call_user_func(
|
66 |
}
|
67 |
}
|
68 |
|
@@ -176,7 +176,7 @@ class WPSEO_Options {
|
|
176 |
*/
|
177 |
public static function get_option_names() {
|
178 |
$option_names = array_values( self::$option_names );
|
179 |
-
if ( $option_names ===
|
180 |
foreach ( self::$option_instances as $option_name => $option_object ) {
|
181 |
if ( $option_object->include_in_all === true ) {
|
182 |
$option_names[] = $option_name;
|
@@ -212,7 +212,7 @@ class WPSEO_Options {
|
|
212 |
* @return array Array combining the values of the requested options.
|
213 |
*/
|
214 |
public static function get_options( array $option_names ) {
|
215 |
-
$options =
|
216 |
$option_names = array_filter( $option_names, 'is_string' );
|
217 |
foreach ( $option_names as $option_name ) {
|
218 |
if ( isset( self::$option_instances[ $option_name ] ) ) {
|
@@ -329,7 +329,7 @@ class WPSEO_Options {
|
|
329 |
self::$option_instances[ $option_name ]->clean( $current_version );
|
330 |
}
|
331 |
}
|
332 |
-
elseif ( isset( $option_name ) && is_array( $option_name ) && $option_name !==
|
333 |
foreach ( $option_name as $option ) {
|
334 |
if ( isset( self::$option_instances[ $option ] ) ) {
|
335 |
self::$option_instances[ $option ]->clean( $current_version );
|
@@ -379,7 +379,7 @@ class WPSEO_Options {
|
|
379 |
public static function reset() {
|
380 |
if ( ! is_multisite() ) {
|
381 |
$option_names = self::get_option_names();
|
382 |
-
if ( is_array( $option_names ) && $option_names !==
|
383 |
foreach ( $option_names as $option_name ) {
|
384 |
delete_option( $option_name );
|
385 |
update_option( $option_name, get_option( $option_name ) );
|
@@ -429,7 +429,7 @@ class WPSEO_Options {
|
|
429 |
$options = get_site_option( 'wpseo_ms' );
|
430 |
$option_names = self::get_option_names();
|
431 |
|
432 |
-
if ( is_array( $option_names ) && $option_names !==
|
433 |
$base_blog_id = $blog_id;
|
434 |
if ( $options['defaultblog'] !== '' && $options['defaultblog'] !== 0 ) {
|
435 |
$base_blog_id = $options['defaultblog'];
|
@@ -441,7 +441,7 @@ class WPSEO_Options {
|
|
441 |
$new_option = get_blog_option( $base_blog_id, $option_name );
|
442 |
|
443 |
/* Remove sensitive, theme dependent and site dependent info. */
|
444 |
-
if ( isset( self::$option_instances[ $option_name ] ) && self::$option_instances[ $option_name ]->ms_exclude !==
|
445 |
foreach ( self::$option_instances[ $option_name ]->ms_exclude as $key ) {
|
446 |
unset( $new_option[ $key ] );
|
447 |
}
|
@@ -521,7 +521,7 @@ class WPSEO_Options {
|
|
521 |
* @return array The lookup table.
|
522 |
*/
|
523 |
private static function get_lookup_table() {
|
524 |
-
$lookup_table =
|
525 |
|
526 |
self::$backfill->remove_hooks();
|
527 |
|
@@ -543,9 +543,9 @@ class WPSEO_Options {
|
|
543 |
* @return array The lookup table.
|
544 |
*/
|
545 |
private static function get_pattern_table() {
|
546 |
-
$pattern_table =
|
547 |
foreach ( self::$options as $option_name => $option_class ) {
|
548 |
-
$instance = call_user_func(
|
549 |
foreach ( $instance->get_patterns() as $key ) {
|
550 |
$pattern_table[ $key ] = $option_name;
|
551 |
}
|
17 |
*
|
18 |
* @var array Array format: (string) option_name => (string) name of concrete class for the option.
|
19 |
*/
|
20 |
+
public static $options = [
|
21 |
'wpseo' => 'WPSEO_Option_Wpseo',
|
22 |
'wpseo_titles' => 'WPSEO_Option_Titles',
|
23 |
'wpseo_social' => 'WPSEO_Option_Social',
|
24 |
'wpseo_ms' => 'WPSEO_Option_MS',
|
25 |
'wpseo_taxonomy_meta' => 'WPSEO_Taxonomy_Meta',
|
26 |
+
];
|
27 |
|
28 |
/**
|
29 |
* Array of instantiated option objects.
|
30 |
*
|
31 |
* @var array
|
32 |
*/
|
33 |
+
protected static $option_instances = [];
|
34 |
|
35 |
/**
|
36 |
* Array with the option names.
|
37 |
*
|
38 |
* @var array
|
39 |
*/
|
40 |
+
protected static $option_names = [];
|
41 |
|
42 |
/**
|
43 |
* Instance of this class.
|
62 |
self::$backfill->register_hooks();
|
63 |
|
64 |
foreach ( self::$options as $option_name => $option_class ) {
|
65 |
+
self::register_option( call_user_func( [ $option_class, 'get_instance' ] ) );
|
66 |
}
|
67 |
}
|
68 |
|
176 |
*/
|
177 |
public static function get_option_names() {
|
178 |
$option_names = array_values( self::$option_names );
|
179 |
+
if ( $option_names === [] ) {
|
180 |
foreach ( self::$option_instances as $option_name => $option_object ) {
|
181 |
if ( $option_object->include_in_all === true ) {
|
182 |
$option_names[] = $option_name;
|
212 |
* @return array Array combining the values of the requested options.
|
213 |
*/
|
214 |
public static function get_options( array $option_names ) {
|
215 |
+
$options = [];
|
216 |
$option_names = array_filter( $option_names, 'is_string' );
|
217 |
foreach ( $option_names as $option_name ) {
|
218 |
if ( isset( self::$option_instances[ $option_name ] ) ) {
|
329 |
self::$option_instances[ $option_name ]->clean( $current_version );
|
330 |
}
|
331 |
}
|
332 |
+
elseif ( isset( $option_name ) && is_array( $option_name ) && $option_name !== [] ) {
|
333 |
foreach ( $option_name as $option ) {
|
334 |
if ( isset( self::$option_instances[ $option ] ) ) {
|
335 |
self::$option_instances[ $option ]->clean( $current_version );
|
379 |
public static function reset() {
|
380 |
if ( ! is_multisite() ) {
|
381 |
$option_names = self::get_option_names();
|
382 |
+
if ( is_array( $option_names ) && $option_names !== [] ) {
|
383 |
foreach ( $option_names as $option_name ) {
|
384 |
delete_option( $option_name );
|
385 |
update_option( $option_name, get_option( $option_name ) );
|
429 |
$options = get_site_option( 'wpseo_ms' );
|
430 |
$option_names = self::get_option_names();
|
431 |
|
432 |
+
if ( is_array( $option_names ) && $option_names !== [] ) {
|
433 |
$base_blog_id = $blog_id;
|
434 |
if ( $options['defaultblog'] !== '' && $options['defaultblog'] !== 0 ) {
|
435 |
$base_blog_id = $options['defaultblog'];
|
441 |
$new_option = get_blog_option( $base_blog_id, $option_name );
|
442 |
|
443 |
/* Remove sensitive, theme dependent and site dependent info. */
|
444 |
+
if ( isset( self::$option_instances[ $option_name ] ) && self::$option_instances[ $option_name ]->ms_exclude !== [] ) {
|
445 |
foreach ( self::$option_instances[ $option_name ]->ms_exclude as $key ) {
|
446 |
unset( $new_option[ $key ] );
|
447 |
}
|
521 |
* @return array The lookup table.
|
522 |
*/
|
523 |
private static function get_lookup_table() {
|
524 |
+
$lookup_table = [];
|
525 |
|
526 |
self::$backfill->remove_hooks();
|
527 |
|
543 |
* @return array The lookup table.
|
544 |
*/
|
545 |
private static function get_pattern_table() {
|
546 |
+
$pattern_table = [];
|
547 |
foreach ( self::$options as $option_name => $option_class ) {
|
548 |
+
$instance = call_user_func( [ $option_class, 'get_instance' ] );
|
549 |
foreach ( $instance->get_patterns() as $key ) {
|
550 |
$pattern_table[ $key ] = $option_name;
|
551 |
}
|
inc/options/class-wpseo-taxonomy-meta.php
CHANGED
@@ -36,7 +36,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
-
protected $defaults =
|
40 |
|
41 |
/**
|
42 |
* Option name - same as $option_name property, but now also available to static methods.
|
@@ -50,7 +50,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
50 |
*
|
51 |
* @var array
|
52 |
*/
|
53 |
-
public static $defaults_per_term =
|
54 |
'wpseo_title' => '',
|
55 |
'wpseo_desc' => '',
|
56 |
'wpseo_canonical' => '',
|
@@ -71,7 +71,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
71 |
'wpseo_twitter-description' => '',
|
72 |
'wpseo_twitter-image' => '',
|
73 |
'wpseo_twitter-image-id' => '',
|
74 |
-
|
75 |
|
76 |
/**
|
77 |
* Available index options.
|
@@ -82,11 +82,11 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
82 |
*
|
83 |
* @var array
|
84 |
*/
|
85 |
-
public static $no_index_options =
|
86 |
'default' => '',
|
87 |
'index' => '',
|
88 |
'noindex' => '',
|
89 |
-
|
90 |
|
91 |
/**
|
92 |
* Add the actions and filters for the option.
|
@@ -103,8 +103,8 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
103 |
self::$name = $this->option_name;
|
104 |
|
105 |
/* On succesfull update/add of the option, flush the W3TC cache. */
|
106 |
-
add_action( 'add_option_' . $this->option_name,
|
107 |
-
add_action( 'update_option_' . $this->option_name,
|
108 |
}
|
109 |
|
110 |
/**
|
@@ -125,7 +125,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
125 |
* Add extra default options received from a filter.
|
126 |
*/
|
127 |
public function enrich_defaults() {
|
128 |
-
$extra_defaults_per_term = apply_filters( 'wpseo_add_extra_taxmeta_term_defaults',
|
129 |
if ( is_array( $extra_defaults_per_term ) ) {
|
130 |
self::$defaults_per_term = array_merge( $extra_defaults_per_term, self::$defaults_per_term );
|
131 |
}
|
@@ -207,7 +207,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
207 |
|
208 |
foreach ( $dirty as $taxonomy => $terms ) {
|
209 |
/* Don't validate taxonomy - may not be registered yet and we don't want to remove valid ones. */
|
210 |
-
if ( is_array( $terms ) && $terms !==
|
211 |
foreach ( $terms as $term_id => $meta_data ) {
|
212 |
/* Only validate term if the taxonomy exists. */
|
213 |
if ( taxonomy_exists( $taxonomy ) && get_term_by( 'id', $term_id, $taxonomy ) === false ) {
|
@@ -218,11 +218,11 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
218 |
continue;
|
219 |
}
|
220 |
|
221 |
-
if ( is_array( $meta_data ) && $meta_data !==
|
222 |
/* Validate meta data. */
|
223 |
$old_meta = self::get_term_meta( $term_id, $taxonomy );
|
224 |
$meta_data = self::validate_term_meta_data( $meta_data, $old_meta );
|
225 |
-
if ( $meta_data !==
|
226 |
$clean[ $taxonomy ][ $term_id ] = $meta_data;
|
227 |
}
|
228 |
}
|
@@ -249,9 +249,9 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
249 |
public static function validate_term_meta_data( $meta_data, $old_meta ) {
|
250 |
|
251 |
$clean = self::$defaults_per_term;
|
252 |
-
$meta_data = array_map(
|
253 |
|
254 |
-
if ( ! is_array( $meta_data ) || $meta_data ===
|
255 |
return $clean;
|
256 |
}
|
257 |
|
@@ -294,7 +294,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
294 |
if ( isset( $meta_data[ $key ] ) && is_string( $meta_data[ $key ] ) ) {
|
295 |
// The data is stringified JSON. Use `json_decode` and `json_encode` around the sanitation.
|
296 |
$input = json_decode( $meta_data[ $key ], true );
|
297 |
-
$sanitized = array_map(
|
298 |
$clean[ $key ] = WPSEO_Utils::format_json_encode( $sanitized );
|
299 |
}
|
300 |
elseif ( isset( $old_meta[ $key ] ) ) {
|
@@ -309,12 +309,12 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
309 |
$input = json_decode( $meta_data[ $key ], true );
|
310 |
|
311 |
// This data has two known keys: `keyword` and `score`.
|
312 |
-
$sanitized =
|
313 |
foreach ( $input as $entry ) {
|
314 |
-
$sanitized[] =
|
315 |
'keyword' => WPSEO_Utils::sanitize_text_field( $entry['keyword'] ),
|
316 |
'score' => WPSEO_Utils::sanitize_text_field( $entry['score'] ),
|
317 |
-
|
318 |
}
|
319 |
|
320 |
$clean[ $key ] = WPSEO_Utils::format_json_encode( $sanitized );
|
@@ -335,14 +335,14 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
335 |
}
|
336 |
|
337 |
if ( 'wpseo_focuskw' === $key ) {
|
338 |
-
$search =
|
339 |
'<',
|
340 |
'>',
|
341 |
'`',
|
342 |
'<',
|
343 |
'>',
|
344 |
'`',
|
345 |
-
|
346 |
|
347 |
$clean[ $key ] = str_replace( $search, '', $clean[ $key ] );
|
348 |
}
|
@@ -373,14 +373,14 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
373 |
protected function clean_option( $option_value, $current_version = null, $all_old_option_values = null ) {
|
374 |
|
375 |
/* Clean up old values and remove empty arrays. */
|
376 |
-
if ( is_array( $option_value ) && $option_value !==
|
377 |
|
378 |
foreach ( $option_value as $taxonomy => $terms ) {
|
379 |
|
380 |
-
if ( is_array( $terms ) && $terms !==
|
381 |
|
382 |
foreach ( $terms as $term_id => $meta_data ) {
|
383 |
-
if ( ! is_array( $meta_data ) || $meta_data ===
|
384 |
// Remove empty term arrays.
|
385 |
unset( $option_value[ $taxonomy ][ $term_id ] );
|
386 |
}
|
@@ -520,7 +520,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
520 |
$meta_key = 'wpseo_' . $meta_key;
|
521 |
}
|
522 |
|
523 |
-
self::set_values( $term_id, $taxonomy,
|
524 |
}
|
525 |
|
526 |
/**
|
@@ -536,7 +536,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
536 |
$tax_meta = self::get_tax_meta();
|
537 |
|
538 |
|
539 |
-
$found =
|
540 |
// @todo Check for terms of all taxonomies, not only the current taxonomy.
|
541 |
foreach ( $tax_meta as $taxonomy_name => $terms ) {
|
542 |
foreach ( $terms as $term_id => $meta_values ) {
|
@@ -547,7 +547,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
547 |
}
|
548 |
}
|
549 |
|
550 |
-
return
|
551 |
}
|
552 |
|
553 |
/**
|
@@ -561,12 +561,12 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
|
561 |
$tax_meta = self::get_tax_meta();
|
562 |
|
563 |
/* Add/remove the result to/from the original option value. */
|
564 |
-
if ( $clean !==
|
565 |
$tax_meta[ $taxonomy ][ $term_id ] = $clean;
|
566 |
}
|
567 |
else {
|
568 |
unset( $tax_meta[ $taxonomy ][ $term_id ] );
|
569 |
-
if ( isset( $tax_meta[ $taxonomy ] ) && $tax_meta[ $taxonomy ] ===
|
570 |
unset( $tax_meta[ $taxonomy ] );
|
571 |
}
|
572 |
}
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
+
protected $defaults = [];
|
40 |
|
41 |
/**
|
42 |
* Option name - same as $option_name property, but now also available to static methods.
|
50 |
*
|
51 |
* @var array
|
52 |
*/
|
53 |
+
public static $defaults_per_term = [
|
54 |
'wpseo_title' => '',
|
55 |
'wpseo_desc' => '',
|
56 |
'wpseo_canonical' => '',
|
71 |
'wpseo_twitter-description' => '',
|
72 |
'wpseo_twitter-image' => '',
|
73 |
'wpseo_twitter-image-id' => '',
|
74 |
+
];
|
75 |
|
76 |
/**
|
77 |
* Available index options.
|
82 |
*
|
83 |
* @var array
|
84 |
*/
|
85 |
+
public static $no_index_options = [
|
86 |
'default' => '',
|
87 |
'index' => '',
|
88 |
'noindex' => '',
|
89 |
+
];
|
90 |
|
91 |
/**
|
92 |
* Add the actions and filters for the option.
|
103 |
self::$name = $this->option_name;
|
104 |
|
105 |
/* On succesfull update/add of the option, flush the W3TC cache. */
|
106 |
+
add_action( 'add_option_' . $this->option_name, [ 'WPSEO_Utils', 'flush_w3tc_cache' ] );
|
107 |
+
add_action( 'update_option_' . $this->option_name, [ 'WPSEO_Utils', 'flush_w3tc_cache' ] );
|
108 |
}
|
109 |
|
110 |
/**
|
125 |
* Add extra default options received from a filter.
|
126 |
*/
|
127 |
public function enrich_defaults() {
|
128 |
+
$extra_defaults_per_term = apply_filters( 'wpseo_add_extra_taxmeta_term_defaults', [] );
|
129 |
if ( is_array( $extra_defaults_per_term ) ) {
|
130 |
self::$defaults_per_term = array_merge( $extra_defaults_per_term, self::$defaults_per_term );
|
131 |
}
|
207 |
|
208 |
foreach ( $dirty as $taxonomy => $terms ) {
|
209 |
/* Don't validate taxonomy - may not be registered yet and we don't want to remove valid ones. */
|
210 |
+
if ( is_array( $terms ) && $terms !== [] ) {
|
211 |
foreach ( $terms as $term_id => $meta_data ) {
|
212 |
/* Only validate term if the taxonomy exists. */
|
213 |
if ( taxonomy_exists( $taxonomy ) && get_term_by( 'id', $term_id, $taxonomy ) === false ) {
|
218 |
continue;
|
219 |
}
|
220 |
|
221 |
+
if ( is_array( $meta_data ) && $meta_data !== [] ) {
|
222 |
/* Validate meta data. */
|
223 |
$old_meta = self::get_term_meta( $term_id, $taxonomy );
|
224 |
$meta_data = self::validate_term_meta_data( $meta_data, $old_meta );
|
225 |
+
if ( $meta_data !== [] ) {
|
226 |
$clean[ $taxonomy ][ $term_id ] = $meta_data;
|
227 |
}
|
228 |
}
|
249 |
public static function validate_term_meta_data( $meta_data, $old_meta ) {
|
250 |
|
251 |
$clean = self::$defaults_per_term;
|
252 |
+
$meta_data = array_map( [ 'WPSEO_Utils', 'trim_recursive' ], $meta_data );
|
253 |
|
254 |
+
if ( ! is_array( $meta_data ) || $meta_data === [] ) {
|
255 |
return $clean;
|
256 |
}
|
257 |
|
294 |
if ( isset( $meta_data[ $key ] ) && is_string( $meta_data[ $key ] ) ) {
|
295 |
// The data is stringified JSON. Use `json_decode` and `json_encode` around the sanitation.
|
296 |
$input = json_decode( $meta_data[ $key ], true );
|
297 |
+
$sanitized = array_map( [ 'WPSEO_Utils', 'sanitize_text_field' ], $input );
|
298 |
$clean[ $key ] = WPSEO_Utils::format_json_encode( $sanitized );
|
299 |
}
|
300 |
elseif ( isset( $old_meta[ $key ] ) ) {
|
309 |
$input = json_decode( $meta_data[ $key ], true );
|
310 |
|
311 |
// This data has two known keys: `keyword` and `score`.
|
312 |
+
$sanitized = [];
|
313 |
foreach ( $input as $entry ) {
|
314 |
+
$sanitized[] = [
|
315 |
'keyword' => WPSEO_Utils::sanitize_text_field( $entry['keyword'] ),
|
316 |
'score' => WPSEO_Utils::sanitize_text_field( $entry['score'] ),
|
317 |
+
];
|
318 |
}
|
319 |
|
320 |
$clean[ $key ] = WPSEO_Utils::format_json_encode( $sanitized );
|
335 |
}
|
336 |
|
337 |
if ( 'wpseo_focuskw' === $key ) {
|
338 |
+
$search = [
|
339 |
'<',
|
340 |
'>',
|
341 |
'`',
|
342 |
'<',
|
343 |
'>',
|
344 |
'`',
|
345 |
+
];
|
346 |
|
347 |
$clean[ $key ] = str_replace( $search, '', $clean[ $key ] );
|
348 |
}
|
373 |
protected function clean_option( $option_value, $current_version = null, $all_old_option_values = null ) {
|
374 |
|
375 |
/* Clean up old values and remove empty arrays. */
|
376 |
+
if ( is_array( $option_value ) && $option_value !== [] ) {
|
377 |
|
378 |
foreach ( $option_value as $taxonomy => $terms ) {
|
379 |
|
380 |
+
if ( is_array( $terms ) && $terms !== [] ) {
|
381 |
|
382 |
foreach ( $terms as $term_id => $meta_data ) {
|
383 |
+
if ( ! is_array( $meta_data ) || $meta_data === [] ) {
|
384 |
// Remove empty term arrays.
|
385 |
unset( $option_value[ $taxonomy ][ $term_id ] );
|
386 |
}
|
520 |
$meta_key = 'wpseo_' . $meta_key;
|
521 |
}
|
522 |
|
523 |
+
self::set_values( $term_id, $taxonomy, [ $meta_key => $meta_value ] );
|
524 |
}
|
525 |
|
526 |
/**
|
536 |
$tax_meta = self::get_tax_meta();
|
537 |
|
538 |
|
539 |
+
$found = [];
|
540 |
// @todo Check for terms of all taxonomies, not only the current taxonomy.
|
541 |
foreach ( $tax_meta as $taxonomy_name => $terms ) {
|
542 |
foreach ( $terms as $term_id => $meta_values ) {
|
547 |
}
|
548 |
}
|
549 |
|
550 |
+
return [ $keyword => $found ];
|
551 |
}
|
552 |
|
553 |
/**
|
561 |
$tax_meta = self::get_tax_meta();
|
562 |
|
563 |
/* Add/remove the result to/from the original option value. */
|
564 |
+
if ( $clean !== [] ) {
|
565 |
$tax_meta[ $taxonomy ][ $term_id ] = $clean;
|
566 |
}
|
567 |
else {
|
568 |
unset( $tax_meta[ $taxonomy ][ $term_id ] );
|
569 |
+
if ( isset( $tax_meta[ $taxonomy ] ) && $tax_meta[ $taxonomy ] === [] ) {
|
570 |
unset( $tax_meta[ $taxonomy ] );
|
571 |
}
|
572 |
}
|
inc/sitemaps/class-author-sitemap-provider.php
CHANGED
@@ -36,7 +36,7 @@ class WPSEO_Author_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
36 |
public function get_index_links( $max_entries ) {
|
37 |
|
38 |
if ( ! $this->handles_type( 'author' ) ) {
|
39 |
-
return
|
40 |
}
|
41 |
|
42 |
// @todo Consider doing this less often / when necessary. R.
|
@@ -44,7 +44,7 @@ class WPSEO_Author_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
44 |
|
45 |
$has_exclude_filter = has_filter( 'wpseo_sitemap_exclude_author' );
|
46 |
|
47 |
-
$query_arguments =
|
48 |
|
49 |
if ( ! $has_exclude_filter ) { // We only need full users if legacy filter(s) hooked to exclusion logic. R.
|
50 |
$query_arguments['fields'] = 'ID';
|
@@ -58,10 +58,10 @@ class WPSEO_Author_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
58 |
}
|
59 |
|
60 |
if ( empty( $users ) ) {
|
61 |
-
return
|
62 |
}
|
63 |
|
64 |
-
$index =
|
65 |
$page = 1;
|
66 |
$user_pages = array_chunk( $users, $max_entries );
|
67 |
|
@@ -73,10 +73,10 @@ class WPSEO_Author_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
73 |
|
74 |
$user_id = array_shift( $users_page ); // Time descending, first user on page is most recently updated.
|
75 |
$user = get_user_by( 'id', $user_id );
|
76 |
-
$index[] =
|
77 |
'loc' => WPSEO_Sitemaps_Router::get_base_url( 'author-sitemap' . $page . '.xml' ),
|
78 |
'lastmod' => '@' . $user->_yoast_wpseo_profile_updated, // @ for explicit timestamp format
|
79 |
-
|
80 |
|
81 |
$page++;
|
82 |
}
|
@@ -91,37 +91,37 @@ class WPSEO_Author_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
91 |
*
|
92 |
* @return array
|
93 |
*/
|
94 |
-
protected function get_users( $arguments =
|
95 |
|
96 |
global $wpdb;
|
97 |
|
98 |
-
$defaults =
|
99 |
// @todo Re-enable after plugin requirements raised to WP 4.6 with the fix.
|
100 |
// 'who' => 'authors', Breaks meta keys, {@link https://core.trac.wordpress.org/ticket/36724#ticket} R.
|
101 |
'meta_key' => '_yoast_wpseo_profile_updated',
|
102 |
'orderby' => 'meta_value_num',
|
103 |
'order' => 'DESC',
|
104 |
-
'meta_query' =>
|
105 |
'relation' => 'AND',
|
106 |
-
|
107 |
'key' => $wpdb->get_blog_prefix() . 'user_level',
|
108 |
'value' => '0',
|
109 |
'compare' => '!=',
|
110 |
-
|
111 |
-
|
112 |
'relation' => 'OR',
|
113 |
-
|
114 |
'key' => 'wpseo_noindex_author',
|
115 |
'value' => 'on',
|
116 |
'compare' => '!=',
|
117 |
-
|
118 |
-
|
119 |
'key' => 'wpseo_noindex_author',
|
120 |
'compare' => 'NOT EXISTS',
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
|
126 |
if ( WPSEO_Options::get( 'noindex-author-noposts-wpseo', true ) ) {
|
127 |
// $defaults['who'] = ''; // Otherwise it cancels out next argument.
|
@@ -144,16 +144,16 @@ class WPSEO_Author_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
144 |
*/
|
145 |
public function get_sitemap_links( $type, $max_entries, $current_page ) {
|
146 |
|
147 |
-
$links =
|
148 |
|
149 |
if ( ! $this->handles_type( 'author' ) ) {
|
150 |
return $links;
|
151 |
}
|
152 |
|
153 |
-
$user_criteria =
|
154 |
-
'offset' => ( $current_page - 1 ) * $max_entries,
|
155 |
'number' => $max_entries,
|
156 |
-
|
157 |
|
158 |
$users = $this->get_users( $user_criteria );
|
159 |
|
@@ -164,7 +164,7 @@ class WPSEO_Author_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
164 |
|
165 |
$users = $this->exclude_users( $users );
|
166 |
if ( empty( $users ) ) {
|
167 |
-
$users =
|
168 |
}
|
169 |
|
170 |
$time = time();
|
@@ -183,14 +183,14 @@ class WPSEO_Author_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
183 |
$mod = $user->_yoast_wpseo_profile_updated;
|
184 |
}
|
185 |
|
186 |
-
$url =
|
187 |
'loc' => $author_link,
|
188 |
'mod' => date( DATE_W3C, $mod ),
|
189 |
|
190 |
// Deprecated, kept for backwards data compat. R.
|
191 |
'chf' => 'daily',
|
192 |
'pri' => 1,
|
193 |
-
|
194 |
|
195 |
/** This filter is documented at inc/sitemaps/class-post-type-sitemap-provider.php */
|
196 |
$url = apply_filters( 'wpseo_sitemap_entry', $url, 'user', $user );
|
@@ -210,15 +210,15 @@ class WPSEO_Author_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
210 |
*/
|
211 |
protected function update_user_meta() {
|
212 |
|
213 |
-
$user_criteria =
|
214 |
'who' => 'authors',
|
215 |
-
'meta_query' =>
|
216 |
-
|
217 |
'key' => '_yoast_wpseo_profile_updated',
|
218 |
'compare' => 'NOT EXISTS',
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
$users = get_users( $user_criteria );
|
223 |
|
224 |
$time = time();
|
36 |
public function get_index_links( $max_entries ) {
|
37 |
|
38 |
if ( ! $this->handles_type( 'author' ) ) {
|
39 |
+
return [];
|
40 |
}
|
41 |
|
42 |
// @todo Consider doing this less often / when necessary. R.
|
44 |
|
45 |
$has_exclude_filter = has_filter( 'wpseo_sitemap_exclude_author' );
|
46 |
|
47 |
+
$query_arguments = [];
|
48 |
|
49 |
if ( ! $has_exclude_filter ) { // We only need full users if legacy filter(s) hooked to exclusion logic. R.
|
50 |
$query_arguments['fields'] = 'ID';
|
58 |
}
|
59 |
|
60 |
if ( empty( $users ) ) {
|
61 |
+
return [];
|
62 |
}
|
63 |
|
64 |
+
$index = [];
|
65 |
$page = 1;
|
66 |
$user_pages = array_chunk( $users, $max_entries );
|
67 |
|
73 |
|
74 |
$user_id = array_shift( $users_page ); // Time descending, first user on page is most recently updated.
|
75 |
$user = get_user_by( 'id', $user_id );
|
76 |
+
$index[] = [
|
77 |
'loc' => WPSEO_Sitemaps_Router::get_base_url( 'author-sitemap' . $page . '.xml' ),
|
78 |
'lastmod' => '@' . $user->_yoast_wpseo_profile_updated, // @ for explicit timestamp format
|
79 |
+
];
|
80 |
|
81 |
$page++;
|
82 |
}
|
91 |
*
|
92 |
* @return array
|
93 |
*/
|
94 |
+
protected function get_users( $arguments = [] ) {
|
95 |
|
96 |
global $wpdb;
|
97 |
|
98 |
+
$defaults = [
|
99 |
// @todo Re-enable after plugin requirements raised to WP 4.6 with the fix.
|
100 |
// 'who' => 'authors', Breaks meta keys, {@link https://core.trac.wordpress.org/ticket/36724#ticket} R.
|
101 |
'meta_key' => '_yoast_wpseo_profile_updated',
|
102 |
'orderby' => 'meta_value_num',
|
103 |
'order' => 'DESC',
|
104 |
+
'meta_query' => [
|
105 |
'relation' => 'AND',
|
106 |
+
[
|
107 |
'key' => $wpdb->get_blog_prefix() . 'user_level',
|
108 |
'value' => '0',
|
109 |
'compare' => '!=',
|
110 |
+
],
|
111 |
+
[
|
112 |
'relation' => 'OR',
|
113 |
+
[
|
114 |
'key' => 'wpseo_noindex_author',
|
115 |
'value' => 'on',
|
116 |
'compare' => '!=',
|
117 |
+
],
|
118 |
+
[
|
119 |
'key' => 'wpseo_noindex_author',
|
120 |
'compare' => 'NOT EXISTS',
|
121 |
+
],
|
122 |
+
],
|
123 |
+
],
|
124 |
+
];
|
125 |
|
126 |
if ( WPSEO_Options::get( 'noindex-author-noposts-wpseo', true ) ) {
|
127 |
// $defaults['who'] = ''; // Otherwise it cancels out next argument.
|
144 |
*/
|
145 |
public function get_sitemap_links( $type, $max_entries, $current_page ) {
|
146 |
|
147 |
+
$links = [];
|
148 |
|
149 |
if ( ! $this->handles_type( 'author' ) ) {
|
150 |
return $links;
|
151 |
}
|
152 |
|
153 |
+
$user_criteria = [
|
154 |
+
'offset' => ( ( $current_page - 1 ) * $max_entries ),
|
155 |
'number' => $max_entries,
|
156 |
+
];
|
157 |
|
158 |
$users = $this->get_users( $user_criteria );
|
159 |
|
164 |
|
165 |
$users = $this->exclude_users( $users );
|
166 |
if ( empty( $users ) ) {
|
167 |
+
$users = [];
|
168 |
}
|
169 |
|
170 |
$time = time();
|
183 |
$mod = $user->_yoast_wpseo_profile_updated;
|
184 |
}
|
185 |
|
186 |
+
$url = [
|
187 |
'loc' => $author_link,
|
188 |
'mod' => date( DATE_W3C, $mod ),
|
189 |
|
190 |
// Deprecated, kept for backwards data compat. R.
|
191 |
'chf' => 'daily',
|
192 |
'pri' => 1,
|
193 |
+
];
|
194 |
|
195 |
/** This filter is documented at inc/sitemaps/class-post-type-sitemap-provider.php */
|
196 |
$url = apply_filters( 'wpseo_sitemap_entry', $url, 'user', $user );
|
210 |
*/
|
211 |
protected function update_user_meta() {
|
212 |
|
213 |
+
$user_criteria = [
|
214 |
'who' => 'authors',
|
215 |
+
'meta_query' => [
|
216 |
+
[
|
217 |
'key' => '_yoast_wpseo_profile_updated',
|
218 |
'compare' => 'NOT EXISTS',
|
219 |
+
],
|
220 |
+
],
|
221 |
+
];
|
222 |
$users = get_users( $user_criteria );
|
223 |
|
224 |
$time = time();
|
inc/sitemaps/class-post-type-sitemap-provider.php
CHANGED
@@ -35,7 +35,7 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
35 |
* Set up object properties for data reuse.
|
36 |
*/
|
37 |
public function __construct() {
|
38 |
-
add_filter( 'save_post',
|
39 |
|
40 |
/**
|
41 |
* Filter - Allows excluding images from the XML sitemap.
|
@@ -93,11 +93,10 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
93 |
public function get_index_links( $max_entries ) {
|
94 |
global $wpdb;
|
95 |
|
96 |
-
// Consider using WPSEO_Post_Type::get_accessible_post_types() to filter out any `no-index` post-types.
|
97 |
$post_types = WPSEO_Post_Type::get_accessible_post_types();
|
98 |
-
$post_types = array_filter( $post_types,
|
99 |
$last_modified_times = WPSEO_Sitemaps::get_last_modified_gmt( $post_types, true );
|
100 |
-
$index =
|
101 |
|
102 |
foreach ( $post_types as $post_type ) {
|
103 |
|
@@ -108,7 +107,7 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
108 |
$max_pages = (int) ceil( $total_count / $max_entries );
|
109 |
}
|
110 |
|
111 |
-
$all_dates =
|
112 |
|
113 |
if ( $max_pages > 1 ) {
|
114 |
$post_statuses = array_map( 'esc_sql', WPSEO_Sitemaps::get_post_statuses( $post_type ) );
|
@@ -141,10 +140,10 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
141 |
$date = $all_dates[ $page_counter ];
|
142 |
}
|
143 |
|
144 |
-
$index[] =
|
145 |
'loc' => WPSEO_Sitemaps_Router::get_base_url( $post_type . '-sitemap' . $current_page . '.xml' ),
|
146 |
'lastmod' => $date,
|
147 |
-
|
148 |
}
|
149 |
}
|
150 |
|
@@ -164,11 +163,11 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
164 |
*/
|
165 |
public function get_sitemap_links( $type, $max_entries, $current_page ) {
|
166 |
|
167 |
-
$links =
|
168 |
$post_type = $type;
|
169 |
|
170 |
if ( ! $this->is_valid_post_type( $post_type ) ) {
|
171 |
-
|
172 |
}
|
173 |
|
174 |
$steps = min( 100, $max_entries );
|
@@ -287,7 +286,7 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
287 |
* @return array Array with post ids to exclude.
|
288 |
*/
|
289 |
protected function get_excluded_posts( $post_type ) {
|
290 |
-
$excluded_posts_ids =
|
291 |
|
292 |
$page_on_front_id = ( $post_type === 'page' ) ? (int) get_option( 'page_on_front' ) : 0;
|
293 |
if ( $page_on_front_id > 0 ) {
|
@@ -301,7 +300,7 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
301 |
*/
|
302 |
$excluded_posts_ids = apply_filters( 'wpseo_exclude_from_sitemap_by_post_ids', $excluded_posts_ids );
|
303 |
if ( ! is_array( $excluded_posts_ids ) ) {
|
304 |
-
$excluded_posts_ids =
|
305 |
}
|
306 |
|
307 |
$excluded_posts_ids = array_map( 'intval', $excluded_posts_ids );
|
@@ -363,7 +362,7 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
363 |
*/
|
364 |
protected function get_first_links( $post_type ) {
|
365 |
|
366 |
-
$links =
|
367 |
$archive_url = false;
|
368 |
|
369 |
if ( $post_type === 'page' ) {
|
@@ -376,9 +375,9 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
376 |
}
|
377 |
|
378 |
if ( empty( $front_page ) ) {
|
379 |
-
$front_page =
|
380 |
'loc' => WPSEO_Utils::home_url(),
|
381 |
-
|
382 |
}
|
383 |
|
384 |
// Deprecated, kept for backwards data compat. R.
|
@@ -403,14 +402,14 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
403 |
|
404 |
if ( $archive_url ) {
|
405 |
|
406 |
-
$links[] =
|
407 |
'loc' => $archive_url,
|
408 |
'mod' => WPSEO_Sitemaps::get_last_modified_gmt( $post_type ),
|
409 |
|
410 |
// Deprecated, kept for backwards data compat. R.
|
411 |
'chf' => 'daily',
|
412 |
'pri' => 1,
|
413 |
-
|
414 |
}
|
415 |
|
416 |
return $links;
|
@@ -496,11 +495,11 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
496 |
|
497 |
global $wpdb;
|
498 |
|
499 |
-
static $filters =
|
500 |
|
501 |
if ( ! isset( $filters[ $post_type ] ) ) {
|
502 |
// Make sure you're wpdb->preparing everything you throw into this!!
|
503 |
-
$filters[ $post_type ] =
|
504 |
/**
|
505 |
* Filter JOIN query part for the post type.
|
506 |
*
|
@@ -516,7 +515,7 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
516 |
* @param string $post_type Post type name.
|
517 |
*/
|
518 |
'where' => apply_filters( 'wpseo_posts_where', false, $post_type ),
|
519 |
-
|
520 |
}
|
521 |
|
522 |
$join_filter = $filters[ $post_type ]['join'];
|
@@ -543,7 +542,7 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
543 |
|
544 |
$posts = $wpdb->get_results( $wpdb->prepare( $sql, $count, $offset ) );
|
545 |
|
546 |
-
$post_ids =
|
547 |
|
548 |
foreach ( $posts as $post ) {
|
549 |
$post->post_type = $post_type;
|
@@ -577,7 +576,7 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
577 |
// Based on WP_Query->get_posts(). R.
|
578 |
if ( 'attachment' === $post_type ) {
|
579 |
$join = " LEFT JOIN {$wpdb->posts} AS p2 ON ({$wpdb->posts}.post_parent = p2.ID) ";
|
580 |
-
$parent_statuses = array_diff( $post_statuses,
|
581 |
$status_where = "p2.post_status IN ('" . implode( "','", $parent_statuses ) . "') AND p2.post_password = ''";
|
582 |
}
|
583 |
|
@@ -601,7 +600,7 @@ class WPSEO_Post_Type_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
601 |
*/
|
602 |
protected function get_url( $post ) {
|
603 |
|
604 |
-
$url =
|
605 |
|
606 |
/**
|
607 |
* Filter the URL Yoast SEO uses in the XML sitemap.
|
35 |
* Set up object properties for data reuse.
|
36 |
*/
|
37 |
public function __construct() {
|
38 |
+
add_filter( 'save_post', [ $this, 'save_post' ] );
|
39 |
|
40 |
/**
|
41 |
* Filter - Allows excluding images from the XML sitemap.
|
93 |
public function get_index_links( $max_entries ) {
|
94 |
global $wpdb;
|
95 |
|
|
|
96 |
$post_types = WPSEO_Post_Type::get_accessible_post_types();
|
97 |
+
$post_types = array_filter( $post_types, [ $this, 'is_valid_post_type' ] );
|
98 |
$last_modified_times = WPSEO_Sitemaps::get_last_modified_gmt( $post_types, true );
|
99 |
+
$index = [];
|
100 |
|
101 |
foreach ( $post_types as $post_type ) {
|
102 |
|
107 |
$max_pages = (int) ceil( $total_count / $max_entries );
|
108 |
}
|
109 |
|
110 |
+
$all_dates = [];
|
111 |
|
112 |
if ( $max_pages > 1 ) {
|
113 |
$post_statuses = array_map( 'esc_sql', WPSEO_Sitemaps::get_post_statuses( $post_type ) );
|
140 |
$date = $all_dates[ $page_counter ];
|
141 |
}
|
142 |
|
143 |
+
$index[] = [
|
144 |
'loc' => WPSEO_Sitemaps_Router::get_base_url( $post_type . '-sitemap' . $current_page . '.xml' ),
|
145 |
'lastmod' => $date,
|
146 |
+
];
|
147 |
}
|
148 |
}
|
149 |
|
163 |
*/
|
164 |
public function get_sitemap_links( $type, $max_entries, $current_page ) {
|
165 |
|
166 |
+
$links = [];
|
167 |
$post_type = $type;
|
168 |
|
169 |
if ( ! $this->is_valid_post_type( $post_type ) ) {
|
170 |
+
throw new OutOfBoundsException( 'Invalid sitemap page requested' );
|
171 |
}
|
172 |
|
173 |
$steps = min( 100, $max_entries );
|
286 |
* @return array Array with post ids to exclude.
|
287 |
*/
|
288 |
protected function get_excluded_posts( $post_type ) {
|
289 |
+
$excluded_posts_ids = [];
|
290 |
|
291 |
$page_on_front_id = ( $post_type === 'page' ) ? (int) get_option( 'page_on_front' ) : 0;
|
292 |
if ( $page_on_front_id > 0 ) {
|
300 |
*/
|
301 |
$excluded_posts_ids = apply_filters( 'wpseo_exclude_from_sitemap_by_post_ids', $excluded_posts_ids );
|
302 |
if ( ! is_array( $excluded_posts_ids ) ) {
|
303 |
+
$excluded_posts_ids = [];
|
304 |
}
|
305 |
|
306 |
$excluded_posts_ids = array_map( 'intval', $excluded_posts_ids );
|
362 |
*/
|
363 |
protected function get_first_links( $post_type ) {
|
364 |
|
365 |
+
$links = [];
|
366 |
$archive_url = false;
|
367 |
|
368 |
if ( $post_type === 'page' ) {
|
375 |
}
|
376 |
|
377 |
if ( empty( $front_page ) ) {
|
378 |
+
$front_page = [
|
379 |
'loc' => WPSEO_Utils::home_url(),
|
380 |
+
];
|
381 |
}
|
382 |
|
383 |
// Deprecated, kept for backwards data compat. R.
|
402 |
|
403 |
if ( $archive_url ) {
|
404 |
|
405 |
+
$links[] = [
|
406 |
'loc' => $archive_url,
|
407 |
'mod' => WPSEO_Sitemaps::get_last_modified_gmt( $post_type ),
|
408 |
|
409 |
// Deprecated, kept for backwards data compat. R.
|
410 |
'chf' => 'daily',
|
411 |
'pri' => 1,
|
412 |
+
];
|
413 |
}
|
414 |
|
415 |
return $links;
|
495 |
|
496 |
global $wpdb;
|
497 |
|
498 |
+
static $filters = [];
|
499 |
|
500 |
if ( ! isset( $filters[ $post_type ] ) ) {
|
501 |
// Make sure you're wpdb->preparing everything you throw into this!!
|
502 |
+
$filters[ $post_type ] = [
|
503 |
/**
|
504 |
* Filter JOIN query part for the post type.
|
505 |
*
|
515 |
* @param string $post_type Post type name.
|
516 |
*/
|
517 |
'where' => apply_filters( 'wpseo_posts_where', false, $post_type ),
|
518 |
+
];
|
519 |
}
|
520 |
|
521 |
$join_filter = $filters[ $post_type ]['join'];
|
542 |
|
543 |
$posts = $wpdb->get_results( $wpdb->prepare( $sql, $count, $offset ) );
|
544 |
|
545 |
+
$post_ids = [];
|
546 |
|
547 |
foreach ( $posts as $post ) {
|
548 |
$post->post_type = $post_type;
|
576 |
// Based on WP_Query->get_posts(). R.
|
577 |
if ( 'attachment' === $post_type ) {
|
578 |
$join = " LEFT JOIN {$wpdb->posts} AS p2 ON ({$wpdb->posts}.post_parent = p2.ID) ";
|
579 |
+
$parent_statuses = array_diff( $post_statuses, [ 'inherit' ] );
|
580 |
$status_where = "p2.post_status IN ('" . implode( "','", $parent_statuses ) . "') AND p2.post_password = ''";
|
581 |
}
|
582 |
|
600 |
*/
|
601 |
protected function get_url( $post ) {
|
602 |
|
603 |
+
$url = [];
|
604 |
|
605 |
/**
|
606 |
* Filter the URL Yoast SEO uses in the XML sitemap.
|
inc/sitemaps/class-sitemap-cache-data.php
CHANGED
@@ -114,10 +114,10 @@ class WPSEO_Sitemap_Cache_Data implements WPSEO_Sitemap_Cache_Data_Interface, Se
|
|
114 |
*/
|
115 |
public function serialize() {
|
116 |
|
117 |
-
$data =
|
118 |
'status' => $this->status,
|
119 |
'xml' => $this->sitemap,
|
120 |
-
|
121 |
|
122 |
return serialize( $data );
|
123 |
}
|
114 |
*/
|
115 |
public function serialize() {
|
116 |
|
117 |
+
$data = [
|
118 |
'status' => $this->status,
|
119 |
'xml' => $this->sitemap,
|
120 |
+
];
|
121 |
|
122 |
return serialize( $data );
|
123 |
}
|
inc/sitemaps/class-sitemap-image-parser.php
CHANGED
@@ -36,7 +36,7 @@ class WPSEO_Sitemap_Image_Parser {
|
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
-
protected $attachments =
|
40 |
|
41 |
/**
|
42 |
* Holds blog charset value for use in DOM parsing.
|
@@ -73,7 +73,7 @@ class WPSEO_Sitemap_Image_Parser {
|
|
73 |
*/
|
74 |
public function get_images( $post ) {
|
75 |
|
76 |
-
$images =
|
77 |
|
78 |
if ( ! is_object( $post ) ) {
|
79 |
return $images;
|
@@ -103,7 +103,7 @@ class WPSEO_Sitemap_Image_Parser {
|
|
103 |
$images[] = $this->get_image_item( $post, $image['src'], $image['title'], $image['alt'] );
|
104 |
}
|
105 |
|
106 |
-
foreach ( $this->parse_galleries( $
|
107 |
|
108 |
$src = $this->get_absolute_url( $this->image_url( $attachment->ID ) );
|
109 |
$alt = WPSEO_Image_Utils::get_alt_tag( $attachment->ID );
|
@@ -150,11 +150,11 @@ class WPSEO_Sitemap_Image_Parser {
|
|
150 |
|
151 |
foreach ( $this->parse_galleries( $term->description ) as $attachment ) {
|
152 |
|
153 |
-
$images[] =
|
154 |
'src' => $this->get_absolute_url( $this->image_url( $attachment->ID ) ),
|
155 |
'title' => $attachment->post_title,
|
156 |
'alt' => WPSEO_Image_Utils::get_alt_tag( $attachment->ID ),
|
157 |
-
|
158 |
}
|
159 |
|
160 |
return $images;
|
@@ -169,7 +169,7 @@ class WPSEO_Sitemap_Image_Parser {
|
|
169 |
*/
|
170 |
private function parse_html_images( $content ) {
|
171 |
|
172 |
-
$images =
|
173 |
|
174 |
if ( ! class_exists( 'DOMDocument' ) ) {
|
175 |
return $images;
|
@@ -218,11 +218,11 @@ class WPSEO_Sitemap_Image_Parser {
|
|
218 |
continue;
|
219 |
}
|
220 |
|
221 |
-
$images[] =
|
222 |
'src' => $src,
|
223 |
'title' => $img->getAttribute( 'title' ),
|
224 |
'alt' => $img->getAttribute( 'alt' ),
|
225 |
-
|
226 |
}
|
227 |
|
228 |
return $images;
|
@@ -238,7 +238,7 @@ class WPSEO_Sitemap_Image_Parser {
|
|
238 |
*/
|
239 |
protected function parse_galleries( $content, $post_id = 0 ) {
|
240 |
|
241 |
-
$attachments =
|
242 |
$galleries = $this->get_content_galleries( $content );
|
243 |
|
244 |
foreach ( $galleries as $gallery ) {
|
@@ -256,16 +256,10 @@ class WPSEO_Sitemap_Image_Parser {
|
|
256 |
|
257 |
$gallery_attachments = $this->get_gallery_attachments( $id, $gallery );
|
258 |
|
259 |
-
|
260 |
$attachments = array_merge( $attachments, $gallery_attachments );
|
261 |
}
|
262 |
|
263 |
-
|
264 |
-
// phpcs:ignore PHPCompatibility.FunctionUse.NewFunctionParameters.array_unique_sort_flagsFound -- Wrapped in version check.
|
265 |
-
return array_unique( $attachments, SORT_REGULAR );
|
266 |
-
}
|
267 |
-
|
268 |
-
return $attachments;
|
269 |
}
|
270 |
|
271 |
/**
|
@@ -279,27 +273,21 @@ class WPSEO_Sitemap_Image_Parser {
|
|
279 |
*/
|
280 |
protected function get_content_galleries( $content ) {
|
281 |
|
282 |
-
|
283 |
-
return array();
|
284 |
-
}
|
285 |
-
|
286 |
-
$galleries = array();
|
287 |
|
288 |
-
if ( ! preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) ) {
|
289 |
return $galleries;
|
290 |
}
|
291 |
|
292 |
foreach ( $matches as $shortcode ) {
|
293 |
-
if ( 'gallery' === $shortcode[2] ) {
|
294 |
|
295 |
-
|
296 |
|
297 |
-
|
298 |
-
|
299 |
-
}
|
300 |
-
|
301 |
-
$galleries[] = $attributes;
|
302 |
}
|
|
|
|
|
303 |
}
|
304 |
|
305 |
return $galleries;
|
@@ -317,7 +305,7 @@ class WPSEO_Sitemap_Image_Parser {
|
|
317 |
*/
|
318 |
protected function get_image_item( $post, $src, $title = '', $alt = '' ) {
|
319 |
|
320 |
-
$image =
|
321 |
|
322 |
/**
|
323 |
* Filter image URL to be included in XML sitemap for the post.
|
@@ -439,7 +427,7 @@ class WPSEO_Sitemap_Image_Parser {
|
|
439 |
|
440 |
// When $id is empty, just return empty array.
|
441 |
if ( empty( $id ) ) {
|
442 |
-
return
|
443 |
}
|
444 |
|
445 |
return $this->get_gallery_attachments_for_parent( $id, $gallery );
|
@@ -454,10 +442,10 @@ class WPSEO_Sitemap_Image_Parser {
|
|
454 |
* @return array The selected attachments.
|
455 |
*/
|
456 |
protected function get_gallery_attachments_for_parent( $id, $gallery ) {
|
457 |
-
$query =
|
458 |
'posts_per_page' => -1,
|
459 |
'post_parent' => $id,
|
460 |
-
|
461 |
|
462 |
// When there are posts that should be excluded from result set.
|
463 |
if ( ! empty( $gallery['exclude'] ) ) {
|
@@ -477,13 +465,13 @@ class WPSEO_Sitemap_Image_Parser {
|
|
477 |
protected function get_gallery_attachments_for_included( $include ) {
|
478 |
$ids_to_include = wp_parse_id_list( $include );
|
479 |
$attachments = $this->get_attachments(
|
480 |
-
|
481 |
'posts_per_page' => count( $ids_to_include ),
|
482 |
'post__in' => $ids_to_include,
|
483 |
-
|
484 |
);
|
485 |
|
486 |
-
$gallery_attachments =
|
487 |
foreach ( $attachments as $key => $val ) {
|
488 |
$gallery_attachments[ $val->ID ] = $val;
|
489 |
}
|
@@ -499,7 +487,7 @@ class WPSEO_Sitemap_Image_Parser {
|
|
499 |
* @return array The found attachments.
|
500 |
*/
|
501 |
protected function get_attachments( $args ) {
|
502 |
-
$default_args =
|
503 |
'post_status' => 'inherit',
|
504 |
'post_type' => 'attachment',
|
505 |
'post_mime_type' => 'image',
|
@@ -512,7 +500,7 @@ class WPSEO_Sitemap_Image_Parser {
|
|
512 |
'suppress_filters' => true,
|
513 |
'ignore_sticky_posts' => true,
|
514 |
'no_found_rows' => true,
|
515 |
-
|
516 |
|
517 |
$args = wp_parse_args( $args, $default_args );
|
518 |
|
36 |
*
|
37 |
* @var array
|
38 |
*/
|
39 |
+
protected $attachments = [];
|
40 |
|
41 |
/**
|
42 |
* Holds blog charset value for use in DOM parsing.
|
73 |
*/
|
74 |
public function get_images( $post ) {
|
75 |
|
76 |
+
$images = [];
|
77 |
|
78 |
if ( ! is_object( $post ) ) {
|
79 |
return $images;
|
103 |
$images[] = $this->get_image_item( $post, $image['src'], $image['title'], $image['alt'] );
|
104 |
}
|
105 |
|
106 |
+
foreach ( $this->parse_galleries( $content, $post->ID ) as $attachment ) {
|
107 |
|
108 |
$src = $this->get_absolute_url( $this->image_url( $attachment->ID ) );
|
109 |
$alt = WPSEO_Image_Utils::get_alt_tag( $attachment->ID );
|
150 |
|
151 |
foreach ( $this->parse_galleries( $term->description ) as $attachment ) {
|
152 |
|
153 |
+
$images[] = [
|
154 |
'src' => $this->get_absolute_url( $this->image_url( $attachment->ID ) ),
|
155 |
'title' => $attachment->post_title,
|
156 |
'alt' => WPSEO_Image_Utils::get_alt_tag( $attachment->ID ),
|
157 |
+
];
|
158 |
}
|
159 |
|
160 |
return $images;
|
169 |
*/
|
170 |
private function parse_html_images( $content ) {
|
171 |
|
172 |
+
$images = [];
|
173 |
|
174 |
if ( ! class_exists( 'DOMDocument' ) ) {
|
175 |
return $images;
|
218 |
continue;
|
219 |
}
|
220 |
|
221 |
+
$images[] = [
|
222 |
'src' => $src,
|
223 |
'title' => $img->getAttribute( 'title' ),
|
224 |
'alt' => $img->getAttribute( 'alt' ),
|
225 |
+
];
|
226 |
}
|
227 |
|
228 |
return $images;
|
238 |
*/
|
239 |
protected function parse_galleries( $content, $post_id = 0 ) {
|
240 |
|
241 |
+
$attachments = [];
|
242 |
$galleries = $this->get_content_galleries( $content );
|
243 |
|
244 |
foreach ( $galleries as $gallery ) {
|
256 |
|
257 |
$gallery_attachments = $this->get_gallery_attachments( $id, $gallery );
|
258 |
|
|
|
259 |
$attachments = array_merge( $attachments, $gallery_attachments );
|
260 |
}
|
261 |
|
262 |
+
return array_unique( $attachments, SORT_REGULAR );
|
|
|
|
|
|
|
|
|
|
|
263 |
}
|
264 |
|
265 |
/**
|
273 |
*/
|
274 |
protected function get_content_galleries( $content ) {
|
275 |
|
276 |
+
$galleries = [];
|
|
|
|
|
|
|
|
|
277 |
|
278 |
+
if ( ! preg_match_all( '/' . get_shortcode_regex( [ 'gallery' ] ) . '/s', $content, $matches, PREG_SET_ORDER ) ) {
|
279 |
return $galleries;
|
280 |
}
|
281 |
|
282 |
foreach ( $matches as $shortcode ) {
|
|
|
283 |
|
284 |
+
$attributes = shortcode_parse_atts( $shortcode[3] );
|
285 |
|
286 |
+
if ( '' === $attributes ) { // Valid shortcode without any attributes. R.
|
287 |
+
$attributes = [];
|
|
|
|
|
|
|
288 |
}
|
289 |
+
|
290 |
+
$galleries[] = $attributes;
|
291 |
}
|
292 |
|
293 |
return $galleries;
|
305 |
*/
|
306 |
protected function get_image_item( $post, $src, $title = '', $alt = '' ) {
|
307 |
|
308 |
+
$image = [];
|
309 |
|
310 |
/**
|
311 |
* Filter image URL to be included in XML sitemap for the post.
|
427 |
|
428 |
// When $id is empty, just return empty array.
|
429 |
if ( empty( $id ) ) {
|
430 |
+
return [];
|
431 |
}
|
432 |
|
433 |
return $this->get_gallery_attachments_for_parent( $id, $gallery );
|
442 |
* @return array The selected attachments.
|
443 |
*/
|
444 |
protected function get_gallery_attachments_for_parent( $id, $gallery ) {
|
445 |
+
$query = [
|
446 |
'posts_per_page' => -1,
|
447 |
'post_parent' => $id,
|
448 |
+
];
|
449 |
|
450 |
// When there are posts that should be excluded from result set.
|
451 |
if ( ! empty( $gallery['exclude'] ) ) {
|
465 |
protected function get_gallery_attachments_for_included( $include ) {
|
466 |
$ids_to_include = wp_parse_id_list( $include );
|
467 |
$attachments = $this->get_attachments(
|
468 |
+
[
|
469 |
'posts_per_page' => count( $ids_to_include ),
|
470 |
'post__in' => $ids_to_include,
|
471 |
+
]
|
472 |
);
|
473 |
|
474 |
+
$gallery_attachments = [];
|
475 |
foreach ( $attachments as $key => $val ) {
|
476 |
$gallery_attachments[ $val->ID ] = $val;
|
477 |
}
|
487 |
* @return array The found attachments.
|
488 |
*/
|
489 |
protected function get_attachments( $args ) {
|
490 |
+
$default_args = [
|
491 |
'post_status' => 'inherit',
|
492 |
'post_type' => 'attachment',
|
493 |
'post_mime_type' => 'image',
|
500 |
'suppress_filters' => true,
|
501 |
'ignore_sticky_posts' => true,
|
502 |
'no_found_rows' => true,
|
503 |
+
];
|
504 |
|
505 |
$args = wp_parse_args( $args, $default_args );
|
506 |
|
inc/sitemaps/class-sitemaps-admin.php
CHANGED
@@ -15,14 +15,14 @@ class WPSEO_Sitemaps_Admin {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
private $importing_post_types =
|
19 |
|
20 |
/**
|
21 |
* Class constructor.
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
-
add_action( 'transition_post_status',
|
25 |
-
add_action( 'admin_footer',
|
26 |
|
27 |
WPSEO_Sitemaps_Cache::register_clear_on_option_update( 'wpseo_titles', '' );
|
28 |
WPSEO_Sitemaps_Cache::register_clear_on_option_update( 'wpseo', '' );
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
private $importing_post_types = [];
|
19 |
|
20 |
/**
|
21 |
* Class constructor.
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
+
add_action( 'transition_post_status', [ $this, 'status_transition' ], 10, 3 );
|
25 |
+
add_action( 'admin_footer', [ $this, 'status_transition_bulk_finished' ] );
|
26 |
|
27 |
WPSEO_Sitemaps_Cache::register_clear_on_option_update( 'wpseo_titles', '' );
|
28 |
WPSEO_Sitemaps_Cache::register_clear_on_option_update( 'wpseo', '' );
|
inc/sitemaps/class-sitemaps-cache-validator.php
CHANGED
@@ -184,7 +184,7 @@ class WPSEO_Sitemaps_Cache_Validator {
|
|
184 |
*
|
185 |
* We can't use `esc_like` here because we need the % in the query.
|
186 |
*/
|
187 |
-
$where =
|
188 |
$where[] = sprintf( "option_name LIKE '%s'", addcslashes( '_transient_' . $like, '_' ) );
|
189 |
$where[] = sprintf( "option_name LIKE '%s'", addcslashes( '_transient_timeout_' . $like, '_' ) );
|
190 |
|
184 |
*
|
185 |
* We can't use `esc_like` here because we need the % in the query.
|
186 |
*/
|
187 |
+
$where = [];
|
188 |
$where[] = sprintf( "option_name LIKE '%s'", addcslashes( '_transient_' . $like, '_' ) );
|
189 |
$where[] = sprintf( "option_name LIKE '%s'", addcslashes( '_transient_timeout_' . $like, '_' ) );
|
190 |
|
inc/sitemaps/class-sitemaps-cache.php
CHANGED
@@ -17,7 +17,7 @@ class WPSEO_Sitemaps_Cache {
|
|
17 |
*
|
18 |
* @var array
|
19 |
*/
|
20 |
-
protected static $cache_clear =
|
21 |
|
22 |
/**
|
23 |
* Mirror of enabled status for static calls.
|
@@ -38,27 +38,27 @@ class WPSEO_Sitemaps_Cache {
|
|
38 |
*
|
39 |
* @var array
|
40 |
*/
|
41 |
-
protected static $clear_types =
|
42 |
|
43 |
/**
|
44 |
* Hook methods for invalidation on necessary events.
|
45 |
*/
|
46 |
public function __construct() {
|
47 |
|
48 |
-
add_action( 'init',
|
49 |
|
50 |
-
add_action( 'deleted_term_relationships',
|
51 |
|
52 |
-
add_action( 'update_option',
|
53 |
|
54 |
-
add_action( 'edited_terms',
|
55 |
-
add_action( 'clean_term_cache',
|
56 |
-
add_action( 'clean_object_term_cache',
|
57 |
|
58 |
-
add_action( 'user_register',
|
59 |
-
add_action( 'delete_user',
|
60 |
|
61 |
-
add_action( 'shutdown',
|
62 |
}
|
63 |
|
64 |
/**
|
@@ -179,7 +179,7 @@ class WPSEO_Sitemaps_Cache {
|
|
179 |
*/
|
180 |
public static function invalidate( $type ) {
|
181 |
|
182 |
-
self::clear(
|
183 |
}
|
184 |
|
185 |
/**
|
@@ -261,7 +261,7 @@ class WPSEO_Sitemaps_Cache {
|
|
261 |
*
|
262 |
* @return void
|
263 |
*/
|
264 |
-
public static function clear( $types =
|
265 |
|
266 |
if ( ! self::$is_enabled ) {
|
267 |
return;
|
@@ -295,7 +295,7 @@ class WPSEO_Sitemaps_Cache {
|
|
295 |
|
296 |
WPSEO_Sitemaps_Cache_Validator::invalidate_storage();
|
297 |
self::$clear_all = false;
|
298 |
-
self::$clear_types =
|
299 |
|
300 |
return;
|
301 |
}
|
@@ -304,7 +304,7 @@ class WPSEO_Sitemaps_Cache {
|
|
304 |
WPSEO_Sitemaps_Cache_Validator::invalidate_storage( $type );
|
305 |
}
|
306 |
|
307 |
-
self::$clear_types =
|
308 |
}
|
309 |
|
310 |
/**
|
17 |
*
|
18 |
* @var array
|
19 |
*/
|
20 |
+
protected static $cache_clear = [];
|
21 |
|
22 |
/**
|
23 |
* Mirror of enabled status for static calls.
|
38 |
*
|
39 |
* @var array
|
40 |
*/
|
41 |
+
protected static $clear_types = [];
|
42 |
|
43 |
/**
|
44 |
* Hook methods for invalidation on necessary events.
|
45 |
*/
|
46 |
public function __construct() {
|
47 |
|
48 |
+
add_action( 'init', [ $this, 'init' ] );
|
49 |
|
50 |
+
add_action( 'deleted_term_relationships', [ __CLASS__, 'invalidate' ] );
|
51 |
|
52 |
+
add_action( 'update_option', [ __CLASS__, 'clear_on_option_update' ] );
|
53 |
|
54 |
+
add_action( 'edited_terms', [ __CLASS__, 'invalidate_helper' ], 10, 2 );
|
55 |
+
add_action( 'clean_term_cache', [ __CLASS__, 'invalidate_helper' ], 10, 2 );
|
56 |
+
add_action( 'clean_object_term_cache', [ __CLASS__, 'invalidate_helper' ], 10, 2 );
|
57 |
|
58 |
+
add_action( 'user_register', [ __CLASS__, 'invalidate_author' ] );
|
59 |
+
add_action( 'delete_user', [ __CLASS__, 'invalidate_author' ] );
|
60 |
|
61 |
+
add_action( 'shutdown', [ __CLASS__, 'clear_queued' ] );
|
62 |
}
|
63 |
|
64 |
/**
|
179 |
*/
|
180 |
public static function invalidate( $type ) {
|
181 |
|
182 |
+
self::clear( [ $type ] );
|
183 |
}
|
184 |
|
185 |
/**
|
261 |
*
|
262 |
* @return void
|
263 |
*/
|
264 |
+
public static function clear( $types = [] ) {
|
265 |
|
266 |
if ( ! self::$is_enabled ) {
|
267 |
return;
|
295 |
|
296 |
WPSEO_Sitemaps_Cache_Validator::invalidate_storage();
|
297 |
self::$clear_all = false;
|
298 |
+
self::$clear_types = [];
|
299 |
|
300 |
return;
|
301 |
}
|
304 |
WPSEO_Sitemaps_Cache_Validator::invalidate_storage( $type );
|
305 |
}
|
306 |
|
307 |
+
self::$clear_types = [];
|
308 |
}
|
309 |
|
310 |
/**
|
inc/sitemaps/class-sitemaps-renderer.php
CHANGED
@@ -232,7 +232,7 @@ class WPSEO_Sitemaps_Renderer {
|
|
232 |
$output .= empty( $date ) ? '' : "\t\t<lastmod>" . htmlspecialchars( $date, ENT_COMPAT, $this->output_charset, false ) . "</lastmod>\n";
|
233 |
|
234 |
if ( empty( $url['images'] ) ) {
|
235 |
-
$url['images'] =
|
236 |
}
|
237 |
|
238 |
foreach ( $url['images'] as $img ) {
|
232 |
$output .= empty( $date ) ? '' : "\t\t<lastmod>" . htmlspecialchars( $date, ENT_COMPAT, $this->output_charset, false ) . "</lastmod>\n";
|
233 |
|
234 |
if ( empty( $url['images'] ) ) {
|
235 |
+
$url['images'] = [];
|
236 |
}
|
237 |
|
238 |
foreach ( $url['images'] as $img ) {
|
inc/sitemaps/class-sitemaps-router.php
CHANGED
@@ -15,9 +15,9 @@ class WPSEO_Sitemaps_Router {
|
|
15 |
*/
|
16 |
public function __construct() {
|
17 |
|
18 |
-
add_action( 'init',
|
19 |
-
add_filter( 'redirect_canonical',
|
20 |
-
add_action( 'template_redirect',
|
21 |
}
|
22 |
|
23 |
/**
|
@@ -91,7 +91,7 @@ class WPSEO_Sitemaps_Router {
|
|
91 |
}
|
92 |
|
93 |
// Due to different environment configurations, we need to check both SERVER_NAME and HTTP_HOST.
|
94 |
-
$check_urls =
|
95 |
if ( ! empty( $_SERVER['HTTP_HOST'] ) ) {
|
96 |
$check_urls[] = $protocol . sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) . $path;
|
97 |
}
|
15 |
*/
|
16 |
public function __construct() {
|
17 |
|
18 |
+
add_action( 'init', [ $this, 'init' ], 1 );
|
19 |
+
add_filter( 'redirect_canonical', [ $this, 'redirect_canonical' ] );
|
20 |
+
add_action( 'template_redirect', [ $this, 'template_redirect' ], 0 );
|
21 |
}
|
22 |
|
23 |
/**
|
91 |
}
|
92 |
|
93 |
// Due to different environment configurations, we need to check both SERVER_NAME and HTTP_HOST.
|
94 |
+
$check_urls = [ $protocol . $domain . $path ];
|
95 |
if ( ! empty( $_SERVER['HTTP_HOST'] ) ) {
|
96 |
$check_urls[] = $protocol . sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) . $path;
|
97 |
}
|
inc/sitemaps/class-sitemaps.php
CHANGED
@@ -103,11 +103,11 @@ class WPSEO_Sitemaps {
|
|
103 |
*/
|
104 |
public function __construct() {
|
105 |
|
106 |
-
add_action( 'after_setup_theme',
|
107 |
-
add_action( 'after_setup_theme',
|
108 |
-
add_action( 'pre_get_posts',
|
109 |
-
add_action( 'wpseo_hit_sitemap_index',
|
110 |
-
add_action( 'wpseo_ping_search_engines',
|
111 |
|
112 |
$this->timezone = new WPSEO_Sitemap_Timezone();
|
113 |
$this->router = new WPSEO_Sitemaps_Router();
|
@@ -126,13 +126,13 @@ class WPSEO_Sitemaps {
|
|
126 |
*/
|
127 |
public function init_sitemaps_providers() {
|
128 |
|
129 |
-
$this->providers =
|
130 |
new WPSEO_Post_Type_Sitemap_Provider(),
|
131 |
new WPSEO_Taxonomy_Sitemap_Provider(),
|
132 |
new WPSEO_Author_Sitemap_Provider(),
|
133 |
-
|
134 |
|
135 |
-
$external_providers = apply_filters( 'wpseo_sitemaps_providers',
|
136 |
|
137 |
foreach ( $external_providers as $provider ) {
|
138 |
if ( is_object( $provider ) && $provider instanceof WPSEO_Sitemap_Provider ) {
|
@@ -150,7 +150,7 @@ class WPSEO_Sitemaps {
|
|
150 |
}
|
151 |
$request_uri = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
|
152 |
$extension = substr( $request_uri, -4 );
|
153 |
-
if ( false !== stripos( $request_uri, 'sitemap' ) && in_array( $extension,
|
154 |
remove_all_actions( 'widgets_init' );
|
155 |
}
|
156 |
}
|
@@ -388,7 +388,7 @@ class WPSEO_Sitemaps {
|
|
388 |
*/
|
389 |
public function build_root_map() {
|
390 |
|
391 |
-
$links =
|
392 |
$entries_per_page = $this->get_entries_per_page();
|
393 |
|
394 |
foreach ( $this->providers as $provider ) {
|
@@ -476,7 +476,7 @@ class WPSEO_Sitemaps {
|
|
476 |
static $post_type_dates = null;
|
477 |
|
478 |
if ( ! is_array( $post_types ) ) {
|
479 |
-
$post_types =
|
480 |
}
|
481 |
|
482 |
foreach ( $post_types as $post_type ) {
|
@@ -488,10 +488,8 @@ class WPSEO_Sitemaps {
|
|
488 |
|
489 |
if ( is_null( $post_type_dates ) ) {
|
490 |
|
491 |
-
$post_type_dates =
|
492 |
-
|
493 |
-
// Consider using WPSEO_Post_Type::get_accessible_post_types() to filter out any `no-index` post-types.
|
494 |
-
$post_type_names = get_post_types( array( 'public' => true ) );
|
495 |
|
496 |
if ( ! empty( $post_type_names ) ) {
|
497 |
$post_statuses = array_map( 'esc_sql', self::get_post_statuses() );
|
@@ -561,8 +559,8 @@ class WPSEO_Sitemaps {
|
|
561 |
}
|
562 |
|
563 |
// Ping Google and Bing.
|
564 |
-
wp_remote_get( 'https://www.google.com/ping?sitemap=' . $url,
|
565 |
-
wp_remote_get( 'https://www.bing.com/ping?sitemap=' . $url,
|
566 |
}
|
567 |
|
568 |
/**
|
@@ -600,10 +598,10 @@ class WPSEO_Sitemaps {
|
|
600 |
* @param array $post_statuses Post status list, defaults to array( 'publish' ).
|
601 |
* @param string $type Post type or SITEMAP_INDEX_TYPE.
|
602 |
*/
|
603 |
-
$post_statuses = apply_filters( 'wpseo_sitemap_post_statuses',
|
604 |
|
605 |
if ( ! is_array( $post_statuses ) || empty( $post_statuses ) ) {
|
606 |
-
$post_statuses =
|
607 |
}
|
608 |
|
609 |
if ( ( $type === self::SITEMAP_INDEX_TYPE || $type === 'attachment' )
|
@@ -623,12 +621,12 @@ class WPSEO_Sitemaps {
|
|
623 |
return;
|
624 |
}
|
625 |
|
626 |
-
$headers =
|
627 |
$this->http_protocol . ' 200 OK' => 200,
|
628 |
// Prevent the search engines from indexing the XML Sitemap.
|
629 |
'X-Robots-Tag: noindex, follow' => '',
|
630 |
'Content-Type: text/xml; charset=' . esc_attr( $this->renderer->get_output_charset() ) => '',
|
631 |
-
|
632 |
|
633 |
/**
|
634 |
* Filter the HTTP headers we send before an XML sitemap.
|
103 |
*/
|
104 |
public function __construct() {
|
105 |
|
106 |
+
add_action( 'after_setup_theme', [ $this, 'init_sitemaps_providers' ] );
|
107 |
+
add_action( 'after_setup_theme', [ $this, 'reduce_query_load' ], 99 );
|
108 |
+
add_action( 'pre_get_posts', [ $this, 'redirect' ], 1 );
|
109 |
+
add_action( 'wpseo_hit_sitemap_index', [ $this, 'hit_sitemap_index' ] );
|
110 |
+
add_action( 'wpseo_ping_search_engines', [ __CLASS__, 'ping_search_engines' ] );
|
111 |
|
112 |
$this->timezone = new WPSEO_Sitemap_Timezone();
|
113 |
$this->router = new WPSEO_Sitemaps_Router();
|
126 |
*/
|
127 |
public function init_sitemaps_providers() {
|
128 |
|
129 |
+
$this->providers = [
|
130 |
new WPSEO_Post_Type_Sitemap_Provider(),
|
131 |
new WPSEO_Taxonomy_Sitemap_Provider(),
|
132 |
new WPSEO_Author_Sitemap_Provider(),
|
133 |
+
];
|
134 |
|
135 |
+
$external_providers = apply_filters( 'wpseo_sitemaps_providers', [] );
|
136 |
|
137 |
foreach ( $external_providers as $provider ) {
|
138 |
if ( is_object( $provider ) && $provider instanceof WPSEO_Sitemap_Provider ) {
|
150 |
}
|
151 |
$request_uri = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
|
152 |
$extension = substr( $request_uri, -4 );
|
153 |
+
if ( false !== stripos( $request_uri, 'sitemap' ) && in_array( $extension, [ '.xml', '.xsl' ], true ) ) {
|
154 |
remove_all_actions( 'widgets_init' );
|
155 |
}
|
156 |
}
|
388 |
*/
|
389 |
public function build_root_map() {
|
390 |
|
391 |
+
$links = [];
|
392 |
$entries_per_page = $this->get_entries_per_page();
|
393 |
|
394 |
foreach ( $this->providers as $provider ) {
|
476 |
static $post_type_dates = null;
|
477 |
|
478 |
if ( ! is_array( $post_types ) ) {
|
479 |
+
$post_types = [ $post_types ];
|
480 |
}
|
481 |
|
482 |
foreach ( $post_types as $post_type ) {
|
488 |
|
489 |
if ( is_null( $post_type_dates ) ) {
|
490 |
|
491 |
+
$post_type_dates = [];
|
492 |
+
$post_type_names = WPSEO_Post_Type::get_accessible_post_types();
|
|
|
|
|
493 |
|
494 |
if ( ! empty( $post_type_names ) ) {
|
495 |
$post_statuses = array_map( 'esc_sql', self::get_post_statuses() );
|
559 |
}
|
560 |
|
561 |
// Ping Google and Bing.
|
562 |
+
wp_remote_get( 'https://www.google.com/ping?sitemap=' . $url, [ 'blocking' => false ] );
|
563 |
+
wp_remote_get( 'https://www.bing.com/ping?sitemap=' . $url, [ 'blocking' => false ] );
|
564 |
}
|
565 |
|
566 |
/**
|
598 |
* @param array $post_statuses Post status list, defaults to array( 'publish' ).
|
599 |
* @param string $type Post type or SITEMAP_INDEX_TYPE.
|
600 |
*/
|
601 |
+
$post_statuses = apply_filters( 'wpseo_sitemap_post_statuses', [ 'publish' ], $type );
|
602 |
|
603 |
if ( ! is_array( $post_statuses ) || empty( $post_statuses ) ) {
|
604 |
+
$post_statuses = [ 'publish' ];
|
605 |
}
|
606 |
|
607 |
if ( ( $type === self::SITEMAP_INDEX_TYPE || $type === 'attachment' )
|
621 |
return;
|
622 |
}
|
623 |
|
624 |
+
$headers = [
|
625 |
$this->http_protocol . ' 200 OK' => 200,
|
626 |
// Prevent the search engines from indexing the XML Sitemap.
|
627 |
'X-Robots-Tag: noindex, follow' => '',
|
628 |
'Content-Type: text/xml; charset=' . esc_attr( $this->renderer->get_output_charset() ) => '',
|
629 |
+
];
|
630 |
|
631 |
/**
|
632 |
* Filter the HTTP headers we send before an XML sitemap.
|
inc/sitemaps/class-taxonomy-sitemap-provider.php
CHANGED
@@ -63,13 +63,13 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
63 |
*/
|
64 |
public function get_index_links( $max_entries ) {
|
65 |
|
66 |
-
$taxonomies = get_taxonomies(
|
67 |
|
68 |
if ( empty( $taxonomies ) ) {
|
69 |
-
return
|
70 |
}
|
71 |
|
72 |
-
$taxonomy_names = array_filter( array_keys( $taxonomies ),
|
73 |
$taxonomies = array_intersect_key( $taxonomies, array_flip( $taxonomy_names ) );
|
74 |
|
75 |
// Retrieve all the taxonomies and their terms so we can do a proper count on them.
|
@@ -81,7 +81,7 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
81 |
*/
|
82 |
$hide_empty = apply_filters( 'wpseo_sitemap_exclude_empty_terms', true, $taxonomy_names );
|
83 |
|
84 |
-
$all_taxonomies =
|
85 |
|
86 |
foreach ( $taxonomy_names as $taxonomy_name ) {
|
87 |
/**
|
@@ -92,10 +92,10 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
92 |
*/
|
93 |
$hide_empty_tax = apply_filters( 'wpseo_sitemap_exclude_empty_terms_taxonomy', $hide_empty, $taxonomy_name );
|
94 |
|
95 |
-
$term_args =
|
96 |
'hide_empty' => $hide_empty_tax,
|
97 |
'fields' => 'ids',
|
98 |
-
|
99 |
$taxonomy_terms = get_terms( $taxonomy_name, $term_args );
|
100 |
|
101 |
if ( count( $taxonomy_terms ) > 0 ) {
|
@@ -103,7 +103,7 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
103 |
}
|
104 |
}
|
105 |
|
106 |
-
$index =
|
107 |
|
108 |
foreach ( $taxonomies as $tax_name => $tax ) {
|
109 |
|
@@ -134,18 +134,18 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
134 |
continue;
|
135 |
}
|
136 |
|
137 |
-
$args =
|
138 |
'post_type' => $tax->object_type,
|
139 |
-
'tax_query' =>
|
140 |
-
|
141 |
'taxonomy' => $tax_name,
|
142 |
'terms' => $terms,
|
143 |
-
|
144 |
-
|
145 |
'orderby' => 'modified',
|
146 |
'order' => 'DESC',
|
147 |
'posts_per_page' => 1,
|
148 |
-
|
149 |
$query = new WP_Query( $args );
|
150 |
|
151 |
if ( $query->have_posts() ) {
|
@@ -155,10 +155,10 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
155 |
$date = $last_modified_gmt;
|
156 |
}
|
157 |
|
158 |
-
$index[] =
|
159 |
'loc' => WPSEO_Sitemaps_Router::get_base_url( $tax_name . '-sitemap' . $current_page . '.xml' ),
|
160 |
'lastmod' => $date,
|
161 |
-
|
162 |
}
|
163 |
}
|
164 |
|
@@ -179,7 +179,7 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
179 |
public function get_sitemap_links( $type, $max_entries, $current_page ) {
|
180 |
global $wpdb;
|
181 |
|
182 |
-
$links =
|
183 |
if ( ! $this->handles_type( $type ) ) {
|
184 |
return $links;
|
185 |
}
|
@@ -190,10 +190,10 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
190 |
$offset = ( $current_page > 1 ) ? ( ( $current_page - 1 ) * $max_entries ) : 0;
|
191 |
|
192 |
/** This filter is documented in inc/sitemaps/class-taxonomy-sitemap-provider.php */
|
193 |
-
$hide_empty = apply_filters( 'wpseo_sitemap_exclude_empty_terms', true,
|
194 |
/** This filter is documented in inc/sitemaps/class-taxonomy-sitemap-provider.php */
|
195 |
$hide_empty_tax = apply_filters( 'wpseo_sitemap_exclude_empty_terms_taxonomy', $hide_empty, $taxonomy->name );
|
196 |
-
$terms = get_terms( $taxonomy->name,
|
197 |
|
198 |
// If the total term count is lower than the offset, we are on an invalid page.
|
199 |
if ( count( $terms ) < $offset ) {
|
@@ -226,7 +226,7 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
226 |
*
|
227 |
* @api array $terms_to_exclude The terms to exclude.
|
228 |
*/
|
229 |
-
$terms_to_exclude = apply_filters( 'wpseo_exclude_from_sitemap_by_term_ids',
|
230 |
|
231 |
foreach ( $terms as $term ) {
|
232 |
|
@@ -234,7 +234,7 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
234 |
continue;
|
235 |
}
|
236 |
|
237 |
-
$url =
|
238 |
|
239 |
$tax_noindex = WPSEO_Taxonomy_Meta::get_term_meta( $term, $term->taxonomy, 'noindex' );
|
240 |
|
@@ -282,7 +282,7 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
|
|
282 |
return false;
|
283 |
}
|
284 |
|
285 |
-
if ( in_array( $taxonomy_name,
|
286 |
return false;
|
287 |
}
|
288 |
|
63 |
*/
|
64 |
public function get_index_links( $max_entries ) {
|
65 |
|
66 |
+
$taxonomies = get_taxonomies( [ 'public' => true ], 'objects' );
|
67 |
|
68 |
if ( empty( $taxonomies ) ) {
|
69 |
+
return [];
|
70 |
}
|
71 |
|
72 |
+
$taxonomy_names = array_filter( array_keys( $taxonomies ), [ $this, 'is_valid_taxonomy' ] );
|
73 |
$taxonomies = array_intersect_key( $taxonomies, array_flip( $taxonomy_names ) );
|
74 |
|
75 |
// Retrieve all the taxonomies and their terms so we can do a proper count on them.
|
81 |
*/
|
82 |
$hide_empty = apply_filters( 'wpseo_sitemap_exclude_empty_terms', true, $taxonomy_names );
|
83 |
|
84 |
+
$all_taxonomies = [];
|
85 |
|
86 |
foreach ( $taxonomy_names as $taxonomy_name ) {
|
87 |
/**
|
92 |
*/
|
93 |
$hide_empty_tax = apply_filters( 'wpseo_sitemap_exclude_empty_terms_taxonomy', $hide_empty, $taxonomy_name );
|
94 |
|
95 |
+
$term_args = [
|
96 |
'hide_empty' => $hide_empty_tax,
|
97 |
'fields' => 'ids',
|
98 |
+
];
|
99 |
$taxonomy_terms = get_terms( $taxonomy_name, $term_args );
|
100 |
|
101 |
if ( count( $taxonomy_terms ) > 0 ) {
|
103 |
}
|
104 |
}
|
105 |
|
106 |
+
$index = [];
|
107 |
|
108 |
foreach ( $taxonomies as $tax_name => $tax ) {
|
109 |
|
134 |
continue;
|
135 |
}
|
136 |
|
137 |
+
$args = [
|
138 |
'post_type' => $tax->object_type,
|
139 |
+
'tax_query' => [
|
140 |
+
[
|
141 |
'taxonomy' => $tax_name,
|
142 |
'terms' => $terms,
|
143 |
+
],
|
144 |
+
],
|
145 |
'orderby' => 'modified',
|
146 |
'order' => 'DESC',
|
147 |
'posts_per_page' => 1,
|
148 |
+
];
|
149 |
$query = new WP_Query( $args );
|
150 |
|
151 |
if ( $query->have_posts() ) {
|
155 |
$date = $last_modified_gmt;
|
156 |
}
|
157 |
|
158 |
+
$index[] = [
|
159 |
'loc' => WPSEO_Sitemaps_Router::get_base_url( $tax_name . '-sitemap' . $current_page . '.xml' ),
|
160 |
'lastmod' => $date,
|
161 |
+
];
|
162 |
}
|
163 |
}
|
164 |
|
179 |
public function get_sitemap_links( $type, $max_entries, $current_page ) {
|
180 |
global $wpdb;
|
181 |
|
182 |
+
$links = [];
|
183 |
if ( ! $this->handles_type( $type ) ) {
|
184 |
return $links;
|
185 |
}
|
190 |
$offset = ( $current_page > 1 ) ? ( ( $current_page - 1 ) * $max_entries ) : 0;
|
191 |
|
192 |
/** This filter is documented in inc/sitemaps/class-taxonomy-sitemap-provider.php */
|
193 |
+
$hide_empty = apply_filters( 'wpseo_sitemap_exclude_empty_terms', true, [ $taxonomy->name ] );
|
194 |
/** This filter is documented in inc/sitemaps/class-taxonomy-sitemap-provider.php */
|
195 |
$hide_empty_tax = apply_filters( 'wpseo_sitemap_exclude_empty_terms_taxonomy', $hide_empty, $taxonomy->name );
|
196 |
+
$terms = get_terms( $taxonomy->name, [ 'hide_empty' => $hide_empty_tax ] );
|
197 |
|
198 |
// If the total term count is lower than the offset, we are on an invalid page.
|
199 |
if ( count( $terms ) < $offset ) {
|
226 |
*
|
227 |
* @api array $terms_to_exclude The terms to exclude.
|
228 |
*/
|
229 |
+
$terms_to_exclude = apply_filters( 'wpseo_exclude_from_sitemap_by_term_ids', [] );
|
230 |
|
231 |
foreach ( $terms as $term ) {
|
232 |
|
234 |
continue;
|
235 |
}
|
236 |
|
237 |
+
$url = [];
|
238 |
|
239 |
$tax_noindex = WPSEO_Taxonomy_Meta::get_term_meta( $term, $term->taxonomy, 'noindex' );
|
240 |
|
282 |
return false;
|
283 |
}
|
284 |
|
285 |
+
if ( in_array( $taxonomy_name, [ 'link_category', 'nav_menu' ], true ) ) {
|
286 |
return false;
|
287 |
}
|
288 |
|
inc/wpseo-functions.php
CHANGED
@@ -90,7 +90,7 @@ if ( ! function_exists( 'yoast_get_primary_term' ) ) {
|
|
90 |
*
|
91 |
* @return string
|
92 |
*/
|
93 |
-
function wpseo_replace_vars( $string, $args, $omit =
|
94 |
$replacer = new WPSEO_Replace_Vars();
|
95 |
|
96 |
return $replacer->replace( $string, $args, $omit );
|
@@ -159,12 +159,12 @@ function wpseo_register_var_replacement( $var, $replace_function, $type = 'advan
|
|
159 |
function wpseo_wpml_config( $config ) {
|
160 |
global $sitepress;
|
161 |
|
162 |
-
if ( ( is_array( $config ) && isset( $config['wpml-config']['admin-texts']['key'] ) ) && ( is_array( $config['wpml-config']['admin-texts']['key'] ) && $config['wpml-config']['admin-texts']['key'] !==
|
163 |
$admin_texts = $config['wpml-config']['admin-texts']['key'];
|
164 |
foreach ( $admin_texts as $k => $val ) {
|
165 |
if ( $val['attr']['name'] === 'wpseo_titles' ) {
|
166 |
$translate_cp = array_keys( $sitepress->get_translatable_documents() );
|
167 |
-
if ( is_array( $translate_cp ) && $translate_cp !==
|
168 |
foreach ( $translate_cp as $post_type ) {
|
169 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'title-' . $post_type;
|
170 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'metadesc-' . $post_type;
|
@@ -172,7 +172,7 @@ function wpseo_wpml_config( $config ) {
|
|
172 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'metadesc-ptarchive-' . $post_type;
|
173 |
|
174 |
$translate_tax = $sitepress->get_translatable_taxonomies( false, $post_type );
|
175 |
-
if ( is_array( $translate_tax ) && $translate_tax !==
|
176 |
foreach ( $translate_tax as $taxonomy ) {
|
177 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'title-tax-' . $taxonomy;
|
178 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'metadesc-tax-' . $taxonomy;
|
@@ -233,7 +233,7 @@ if ( ! extension_loaded( 'ctype' ) || ! function_exists( 'ctype_digit' ) ) {
|
|
233 |
* @param string $taxonomy The taxonomy that the taxonomy term was splitted for.
|
234 |
*/
|
235 |
function wpseo_split_shared_term( $old_term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {
|
236 |
-
$tax_meta = get_option( 'wpseo_taxonomy_meta',
|
237 |
|
238 |
if ( ! empty( $tax_meta[ $taxonomy ][ $old_term_id ] ) ) {
|
239 |
$tax_meta[ $taxonomy ][ $new_term_id ] = $tax_meta[ $taxonomy ][ $old_term_id ];
|
90 |
*
|
91 |
* @return string
|
92 |
*/
|
93 |
+
function wpseo_replace_vars( $string, $args, $omit = [] ) {
|
94 |
$replacer = new WPSEO_Replace_Vars();
|
95 |
|
96 |
return $replacer->replace( $string, $args, $omit );
|
159 |
function wpseo_wpml_config( $config ) {
|
160 |
global $sitepress;
|
161 |
|
162 |
+
if ( ( is_array( $config ) && isset( $config['wpml-config']['admin-texts']['key'] ) ) && ( is_array( $config['wpml-config']['admin-texts']['key'] ) && $config['wpml-config']['admin-texts']['key'] !== [] ) ) {
|
163 |
$admin_texts = $config['wpml-config']['admin-texts']['key'];
|
164 |
foreach ( $admin_texts as $k => $val ) {
|
165 |
if ( $val['attr']['name'] === 'wpseo_titles' ) {
|
166 |
$translate_cp = array_keys( $sitepress->get_translatable_documents() );
|
167 |
+
if ( is_array( $translate_cp ) && $translate_cp !== [] ) {
|
168 |
foreach ( $translate_cp as $post_type ) {
|
169 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'title-' . $post_type;
|
170 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'metadesc-' . $post_type;
|
172 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'metadesc-ptarchive-' . $post_type;
|
173 |
|
174 |
$translate_tax = $sitepress->get_translatable_taxonomies( false, $post_type );
|
175 |
+
if ( is_array( $translate_tax ) && $translate_tax !== [] ) {
|
176 |
foreach ( $translate_tax as $taxonomy ) {
|
177 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'title-tax-' . $taxonomy;
|
178 |
$admin_texts[ $k ]['key'][]['attr']['name'] = 'metadesc-tax-' . $taxonomy;
|
233 |
* @param string $taxonomy The taxonomy that the taxonomy term was splitted for.
|
234 |
*/
|
235 |
function wpseo_split_shared_term( $old_term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {
|
236 |
+
$tax_meta = get_option( 'wpseo_taxonomy_meta', [] );
|
237 |
|
238 |
if ( ! empty( $tax_meta[ $taxonomy ][ $old_term_id ] ) ) {
|
239 |
$tax_meta[ $taxonomy ][ $new_term_id ] = $tax_meta[ $taxonomy ][ $old_term_id ];
|
inc/wpseo-non-ajax-functions.php
CHANGED
@@ -32,7 +32,7 @@ add_action( 'wp_loaded', 'wpseo_initialize_admin_bar' );
|
|
32 |
* @return array $required_capabilities Filtered capabilities.
|
33 |
*/
|
34 |
function allow_custom_field_edits( $required_capabilities, $capabilities, $args ) {
|
35 |
-
if ( ! in_array( $args[0],
|
36 |
return $required_capabilities;
|
37 |
}
|
38 |
|
@@ -77,7 +77,7 @@ function wpseo_admin_bar_menu() {
|
|
77 |
return;
|
78 |
}
|
79 |
|
80 |
-
$options = WPSEO_Options::get_options(
|
81 |
|
82 |
if ( $options['enable_admin_bar_menu'] !== true ) {
|
83 |
return;
|
32 |
* @return array $required_capabilities Filtered capabilities.
|
33 |
*/
|
34 |
function allow_custom_field_edits( $required_capabilities, $capabilities, $args ) {
|
35 |
+
if ( ! in_array( $args[0], [ 'edit_post_meta', 'add_post_meta' ], true ) ) {
|
36 |
return $required_capabilities;
|
37 |
}
|
38 |
|
77 |
return;
|
78 |
}
|
79 |
|
80 |
+
$options = WPSEO_Options::get_options( [ 'wpseo', 'wpseo_ms' ] );
|
81 |
|
82 |
if ( $options['enable_admin_bar_menu'] !== true ) {
|
83 |
return;
|
js/dist/{analysis-1262.min.js → analysis-1270.min.js}
RENAMED
File without changes
|
js/dist/{babel-polyfill-1262.min.js → babel-polyfill-1270.min.js}
RENAMED
File without changes
|
js/dist/{commons-1262.min.js → commons-1270.min.js}
RENAMED
File without changes
|
js/dist/components-1262.min.js
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=409)}([function(e,t){e.exports=React},function(e,t){e.exports=window.yoast.styledComponents},function(e,t,n){e.exports=n(985)()},function(e,t,n){e.exports=n(728)()},function(e,t,n){e.exports=n(444)()},function(e,t){e.exports=window.wp.i18n},function(e,t,n){"use strict";t.a=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rgba=t.breakpoints=t.colors=void 0;var r=a(n(987)),o=a(n(988)),i=n(989);function a(e){return e&&e.__esModule?e:{default:e}}t.colors=r.default,t.breakpoints=o.default,t.rgba=i.rgba},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:H(e)}function r(e){return l(e)?e:V(e)}function o(e){return u(e)?e:Y(e)}function i(e){return a(e)&&!s(e)?e:G(e)}function a(e){return!(!e||!e[f])}function l(e){return!(!e||!e[d])}function u(e){return!(!e||!e[p])}function s(e){return l(e)||u(e)}function c(e){return!(!e||!e[h])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=l,n.isIndexed=u,n.isAssociative=s,n.isOrdered=c,n.Keyed=r,n.Indexed=o,n.Set=i;var f="@@__IMMUTABLE_ITERABLE__@@",d="@@__IMMUTABLE_KEYED__@@",p="@@__IMMUTABLE_INDEXED__@@",h="@@__IMMUTABLE_ORDERED__@@",g=5,y=1<<g,m=y-1,v={},b={value:!1},_={value:!1};function x(e){return e.value=!1,e}function w(e){e&&(e.value=!0)}function C(){}function k(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function S(e){return void 0===e.size&&(e.size=e.__iterate(E)),e.size}function O(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?S(e)+t:t}function E(){return!0}function T(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function P(e,t){return M(e,t,0)}function j(e,t){return M(e,t,t)}function M(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var I=0,R=1,N=2,A="function"==typeof Symbol&&Symbol.iterator,B="@@iterator",L=A||B;function D(e){this.next=e}function q(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function z(){return{value:void 0,done:!0}}function $(e){return!!U(e)}function F(e){return e&&"function"==typeof e.next}function W(e){var t=U(e);return t&&t.call(e)}function U(e){var t=e&&(A&&e[A]||e[B]);if("function"==typeof t)return t}function K(e){return e&&"number"==typeof e.length}function H(e){return null===e||void 0===e?ie():a(e)?e.toSeq():function(e){var t=ue(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function V(e){return null===e||void 0===e?ie().toKeyedSeq():a(e)?l(e)?e.toSeq():e.fromEntrySeq():ae(e)}function Y(e){return null===e||void 0===e?ie():a(e)?l(e)?e.entrySeq():e.toIndexedSeq():le(e)}function G(e){return(null===e||void 0===e?ie():a(e)?l(e)?e.entrySeq():e:le(e)).toSetSeq()}D.prototype.toString=function(){return"[Iterator]"},D.KEYS=I,D.VALUES=R,D.ENTRIES=N,D.prototype.inspect=D.prototype.toSource=function(){return this.toString()},D.prototype[L]=function(){return this},t(H,n),H.of=function(){return H(arguments)},H.prototype.toSeq=function(){return this},H.prototype.toString=function(){return this.__toString("Seq {","}")},H.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},H.prototype.__iterate=function(e,t){return se(this,e,t,!0)},H.prototype.__iterator=function(e,t){return ce(this,e,t,!0)},t(V,H),V.prototype.toKeyedSeq=function(){return this},t(Y,H),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return se(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return ce(this,e,t,!1)},t(G,H),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},H.isSeq=oe,H.Keyed=V,H.Set=G,H.Indexed=Y;var X,J,Q,Z="@@__IMMUTABLE_SEQ__@@";function ee(e){this._array=e,this.size=e.length}function te(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function ne(e){this._iterable=e,this.size=e.length||e.size}function re(e){this._iterator=e,this._iteratorCache=[]}function oe(e){return!(!e||!e[Z])}function ie(){return X||(X=new ee([]))}function ae(e){var t=Array.isArray(e)?new ee(e).fromEntrySeq():F(e)?new re(e).fromEntrySeq():$(e)?new ne(e).fromEntrySeq():"object"==typeof e?new te(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function le(e){var t=ue(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ue(e){return K(e)?new ee(e):F(e)?new re(e):$(e)?new ne(e):void 0}function se(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var l=o[n?i-a:a];if(!1===t(l[1],r?l[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function ce(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new D(function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:q(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function fe(e,t){return t?function e(t,n,r,o){return Array.isArray(n)?t.call(o,r,Y(n).map(function(r,o){return e(t,r,o,n)})):pe(n)?t.call(o,r,V(n).map(function(r,o){return e(t,r,o,n)})):n}(t,e,"",{"":e}):de(e)}function de(e){return Array.isArray(e)?Y(e).map(de).toList():pe(e)?V(e).map(de).toMap():e}function pe(e){return e&&(e.constructor===Object||void 0===e.constructor)}function he(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ge(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||l(e)!==l(t)||u(e)!==u(t)||c(e)!==c(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!s(e);if(c(e)){var r=e.entries();return t.every(function(e,t){var o=r.next().value;return o&&he(o[1],e)&&(n||he(o[0],t))})&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var f=!0,d=t.__iterate(function(t,r){if(n?!e.has(t):o?!he(t,e.get(r,v)):!he(e.get(r,v),t))return f=!1,!1});return f&&e.size===d}function ye(e,t){if(!(this instanceof ye))return new ye(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(J)return J;J=this}}function me(e,t){if(!e)throw new Error(t)}function ve(e,t,n){if(!(this instanceof ve))return new ve(e,t,n);if(me(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(Q)return Q;Q=this}}function be(){throw TypeError("Abstract")}function _e(){}function xe(){}function we(){}H.prototype[Z]=!0,t(ee,Y),ee.prototype.get=function(e,t){return this.has(e)?this._array[O(this,e)]:t},ee.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},ee.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new D(function(){return o>r?{value:void 0,done:!0}:q(e,o,n[t?r-o++:o++])})},t(te,V),te.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},te.prototype.has=function(e){return this._object.hasOwnProperty(e)},te.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},te.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new D(function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:q(e,a,n[a])})},te.prototype[h]=!0,t(ne,Y),ne.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=W(n),o=0;if(F(r))for(var i;!(i=r.next()).done&&!1!==e(i.value,o++,this););return o},ne.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=W(n);if(!F(r))return new D(z);var o=0;return new D(function(){var t=r.next();return t.done?t:q(e,o++,t.value)})},t(re,Y),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new D(function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return q(e,o,r[o++])})},t(ye,Y),ye.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ye.prototype.get=function(e,t){return this.has(e)?this._value:t},ye.prototype.includes=function(e){return he(this._value,e)},ye.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:new ye(this._value,j(t,n)-P(e,n))},ye.prototype.reverse=function(){return this},ye.prototype.indexOf=function(e){return he(this._value,e)?0:-1},ye.prototype.lastIndexOf=function(e){return he(this._value,e)?this.size:-1},ye.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},ye.prototype.__iterator=function(e,t){var n=this,r=0;return new D(function(){return r<n.size?q(e,r++,n._value):{value:void 0,done:!0}})},ye.prototype.equals=function(e){return e instanceof ye?he(this._value,e._value):ge(e)},t(ve,Y),ve.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},ve.prototype.get=function(e,t){return this.has(e)?this._start+O(this,e)*this._step:t},ve.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},ve.prototype.slice=function(e,t){return T(e,t,this.size)?this:(e=P(e,this.size),(t=j(t,this.size))<=e?new ve(0,0):new ve(this.get(e,this._end),this.get(t,this._end),this._step))},ve.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},ve.prototype.lastIndexOf=function(e){return this.indexOf(e)},ve.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},ve.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new D(function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:q(e,i++,a)})},ve.prototype.equals=function(e){return e instanceof ve?this._start===e._start&&this._end===e._end&&this._step===e._step:ge(this,e)},t(be,n),t(_e,be),t(xe,be),t(we,be),be.Keyed=_e,be.Indexed=xe,be.Set=we;var Ce="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ke(e){return e>>>1&1073741824|3221225471&e}function Se(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return ke(n)}if("string"===t)return e.length>Re?function(e){var t=Be[e];return void 0===t&&(t=Oe(e),Ae===Ne&&(Ae=0,Be={}),Ae++,Be[e]=t),t}(e):Oe(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(je&&void 0!==(t=Ee.get(e)))return t;if(void 0!==(t=e[Ie]))return t;if(!Pe){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Ie]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Me,1073741824&Me&&(Me=0),je)Ee.set(e,t);else{if(void 0!==Te&&!1===Te(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Pe)Object.defineProperty(e,Ie,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Ie]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Ie]=t}}return t}(e);if("function"==typeof e.toString)return Oe(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function Oe(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ke(t)}var Ee,Te=Object.isExtensible,Pe=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),je="function"==typeof WeakMap;je&&(Ee=new WeakMap);var Me=0,Ie="__immutablehash__";"function"==typeof Symbol&&(Ie=Symbol(Ie));var Re=16,Ne=255,Ae=0,Be={};function Le(e){me(e!==1/0,"Cannot perform this action with an infinite size.")}function De(e){return null===e||void 0===e?Qe():qe(e)&&!c(e)?e:Qe().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function qe(e){return!(!e||!e[$e])}t(De,_e),De.prototype.toString=function(){return this.__toString("Map {","}")},De.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},De.prototype.set=function(e,t){return Ze(this,e,t)},De.prototype.setIn=function(e,t){return this.updateIn(e,v,function(){return t})},De.prototype.remove=function(e){return Ze(this,e,v)},De.prototype.deleteIn=function(e){return this.updateIn(e,function(){return v})},De.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},De.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,o){var i=t===v,a=n.next();if(a.done){var l=i?r:t,u=o(l);return u===l?t:u}me(i||t&&t.set,"invalid keyPath");var s=a.value,c=i?v:t.get(s,v),f=e(c,n,r,o);return f===c?t:f===v?t.remove(s):(i?Qe():t).set(s,f)}(this,nn(e),t,n);return r===v?void 0:r},De.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qe()},De.prototype.merge=function(){return rt(this,void 0,arguments)},De.prototype.mergeWith=function(t){var n=e.call(arguments,1);return rt(this,t,n)},De.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Qe(),function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]})},De.prototype.mergeDeep=function(){return rt(this,ot,arguments)},De.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return rt(this,it(t),n)},De.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Qe(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]})},De.prototype.sort=function(e){return Pt(Kt(this,e))},De.prototype.sortBy=function(e,t){return Pt(Kt(this,t,e))},De.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},De.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new C)},De.prototype.asImmutable=function(){return this.__ensureOwner()},De.prototype.wasAltered=function(){return this.__altered},De.prototype.__iterator=function(e,t){return new Ye(this,e,t)},De.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},De.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Je(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},De.isMap=qe;var ze,$e="@@__IMMUTABLE_MAP__@@",Fe=De.prototype;function We(e,t){this.ownerID=e,this.entries=t}function Ue(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function Ke(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function He(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&Xe(e._root)}function Ge(e,t){return q(e,t[0],t[1])}function Xe(e,t){return{node:e,index:0,__prev:t}}function Je(e,t,n,r){var o=Object.create(Fe);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Qe(){return ze||(ze=Je(0))}function Ze(e,t,n){var r,o;if(e._root){var i=x(b),a=x(_);if(r=et(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===v?-1:1:0)}else{if(n===v)return e;o=1,r=new We(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Je(o,r):Qe()}function et(e,t,n,r,o,i,a,l){return e?e.update(t,n,r,o,i,a,l):i===v?e:(w(l),w(a),new Ve(t,r,[o,i]))}function tt(e){return e.constructor===Ve||e.constructor===He}function nt(e,t,n,r,o){if(e.keyHash===r)return new He(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&m,l=(0===n?r:r>>>n)&m,u=a===l?[nt(e,t,n+g,r,o)]:(i=new Ve(t,r,o),a<l?[e,i]:[i,e]);return new Ue(t,1<<a|1<<l,u)}function rt(e,t,n){for(var o=[],i=0;i<n.length;i++){var l=n[i],u=r(l);a(l)||(u=u.map(function(e){return fe(e)})),o.push(u)}return at(e,t,o)}function ot(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):he(e,t)?e:t}function it(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return he(t,o)?t:o}}function at(e,t,n){return 0===(n=n.filter(function(e){return 0!==e.size})).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,v,function(e){return e===v?n:t(e,n,r)})}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)}):e.constructor(n[0])}function lt(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function ut(e,t,n,r){var o=r?e:k(e);return o[t]=n,o}Fe[$e]=!0,Fe.delete=Fe.remove,Fe.removeIn=Fe.deleteIn,We.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(he(n,o[i][0]))return o[i][1];return r},We.prototype.update=function(e,t,n,r,o,i,a){for(var l=o===v,u=this.entries,s=0,c=u.length;s<c&&!he(r,u[s][0]);s++);var f=s<c;if(f?u[s][1]===o:l)return this;if(w(a),(l||!f)&&w(i),!l||1!==u.length){if(!f&&!l&&u.length>=st)return function(e,t,n,r){e||(e=new C);for(var o=new Ve(e,Se(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,u,r,o);var d=e&&e===this.ownerID,p=d?u:k(u);return f?l?s===c-1?p.pop():p[s]=p.pop():p[s]=[r,o]:p.push([r,o]),d?(this.entries=p,this):new We(e,p)}},Ue.prototype.get=function(e,t,n,r){void 0===t&&(t=Se(n));var o=1<<((0===e?t:t>>>e)&m),i=this.bitmap;return 0==(i&o)?r:this.nodes[lt(i&o-1)].get(e+g,t,n,r)},Ue.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Se(r));var l=(0===t?n:n>>>t)&m,u=1<<l,s=this.bitmap,c=0!=(s&u);if(!c&&o===v)return this;var f=lt(s&u-1),d=this.nodes,p=c?d[f]:void 0,h=et(p,e,t+g,n,r,o,i,a);if(h===p)return this;if(!c&&h&&d.length>=ct)return function(e,t,n,r,o){for(var i=0,a=new Array(y),l=0;0!==n;l++,n>>>=1)a[l]=1&n?t[i++]:void 0;return a[r]=o,new Ke(e,i+1,a)}(e,d,s,l,h);if(c&&!h&&2===d.length&&tt(d[1^f]))return d[1^f];if(c&&h&&1===d.length&&tt(h))return h;var b=e&&e===this.ownerID,_=c?h?s:s^u:s|u,x=c?h?ut(d,f,h,b):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(d,f,b):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,l=0;l<o;l++)l===t?(i[l]=n,a=-1):i[l]=e[l+a];return i}(d,f,h,b);return b?(this.bitmap=_,this.nodes=x,this):new Ue(e,_,x)},Ke.prototype.get=function(e,t,n,r){void 0===t&&(t=Se(n));var o=(0===e?t:t>>>e)&m,i=this.nodes[o];return i?i.get(e+g,t,n,r):r},Ke.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Se(r));var l=(0===t?n:n>>>t)&m,u=o===v,s=this.nodes,c=s[l];if(u&&!c)return this;var f=et(c,e,t+g,n,r,o,i,a);if(f===c)return this;var d=this.count;if(c){if(!f&&--d<ft)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),l=0,u=1,s=t.length;l<s;l++,u<<=1){var c=t[l];void 0!==c&&l!==r&&(o|=u,a[i++]=c)}return new Ue(e,o,a)}(e,s,d,l)}else d++;var p=e&&e===this.ownerID,h=ut(s,l,f,p);return p?(this.count=d,this.nodes=h,this):new Ke(e,d,h)},He.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(he(n,o[i][0]))return o[i][1];return r},He.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Se(r));var l=o===v;if(n!==this.keyHash)return l?this:(w(a),w(i),nt(this,e,t,n,[r,o]));for(var u=this.entries,s=0,c=u.length;s<c&&!he(r,u[s][0]);s++);var f=s<c;if(f?u[s][1]===o:l)return this;if(w(a),(l||!f)&&w(i),l&&2===c)return new Ve(e,this.keyHash,u[1^s]);var d=e&&e===this.ownerID,p=d?u:k(u);return f?l?s===c-1?p.pop():p[s]=p.pop():p[s]=[r,o]:p.push([r,o]),d?(this.entries=p,this):new He(e,this.keyHash,p)},Ve.prototype.get=function(e,t,n,r){return he(n,this.entry[0])?this.entry[1]:r},Ve.prototype.update=function(e,t,n,r,o,i,a){var l=o===v,u=he(r,this.entry[0]);return(u?o===this.entry[1]:l)?this:(w(a),l?void w(i):u?e&&e===this.ownerID?(this.entry[1]=o,this):new Ve(e,this.keyHash,[r,o]):(w(i),nt(this,e,t,Se(r),[r,o])))},We.prototype.iterate=He.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},Ue.prototype.iterate=Ke.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},Ve.prototype.iterate=function(e,t){return e(this.entry)},t(Ye,D),Ye.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return Ge(e,r.entry)}else if(r.entries){if(n=r.entries.length-1,o<=n)return Ge(e,r.entries[this._reverse?n-o:o])}else if(n=r.nodes.length-1,o<=n){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return Ge(e,i.entry);t=this._stack=Xe(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var st=y/4,ct=y/2,ft=y/4;function dt(e){var t=wt();if(null===e||void 0===e)return t;if(pt(e))return e;var n=o(e),r=n.size;return 0===r?t:(Le(r),r>0&&r<y?xt(0,r,g,null,new yt(n.toArray())):t.withMutations(function(e){e.setSize(r),n.forEach(function(t,n){return e.set(n,t)})}))}function pt(e){return!(!e||!e[ht])}t(dt,xe),dt.of=function(){return this(arguments)},dt.prototype.toString=function(){return this.__toString("List [","]")},dt.prototype.get=function(e,t){if((e=O(this,e))>=0&&e<this.size){var n=St(this,e+=this._origin);return n&&n.array[e&m]}return t},dt.prototype.set=function(e,t){return function(e,t,n){if((t=O(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?Ot(e,t).set(0,n):Ot(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,o=e._root,i=x(_);return t>=Tt(e._capacity)?r=Ct(r,e.__ownerID,0,t,n,i):o=Ct(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):xt(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},dt.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},dt.prototype.insert=function(e,t){return this.splice(e,0,t)},dt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=g,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):wt()},dt.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){Ot(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},dt.prototype.pop=function(){return Ot(this,0,-1)},dt.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){Ot(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},dt.prototype.shift=function(){return Ot(this,1)},dt.prototype.merge=function(){return Et(this,void 0,arguments)},dt.prototype.mergeWith=function(t){var n=e.call(arguments,1);return Et(this,t,n)},dt.prototype.mergeDeep=function(){return Et(this,ot,arguments)},dt.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Et(this,it(t),n)},dt.prototype.setSize=function(e){return Ot(this,0,e)},dt.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:Ot(this,P(e,n),j(t,n))},dt.prototype.__iterator=function(e,t){var n=0,r=_t(this,t);return new D(function(){var t=r();return t===bt?{value:void 0,done:!0}:q(e,n++,t)})},dt.prototype.__iterate=function(e,t){for(var n,r=0,o=_t(this,t);(n=o())!==bt&&!1!==e(n,r++,this););return r},dt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},dt.isList=pt;var ht="@@__IMMUTABLE_LIST__@@",gt=dt.prototype;function yt(e,t){this.array=e,this.ownerID=t}gt[ht]=!0,gt.delete=gt.remove,gt.setIn=Fe.setIn,gt.deleteIn=gt.removeIn=Fe.removeIn,gt.update=Fe.update,gt.updateIn=Fe.updateIn,gt.mergeIn=Fe.mergeIn,gt.mergeDeepIn=Fe.mergeDeepIn,gt.withMutations=Fe.withMutations,gt.asMutable=Fe.asMutable,gt.asImmutable=Fe.asImmutable,gt.wasAltered=Fe.wasAltered,yt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&m;if(r>=this.array.length)return new yt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-g,n))===a&&i)return this}if(i&&!o)return this;var l=kt(this,e);if(!i)for(var u=0;u<r;u++)l.array[u]=void 0;return o&&(l.array[r]=o),l},yt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&m;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-g,n))===i&&o===this.array.length-1)return this}var a=kt(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var mt,vt,bt={};function _t(e,t){var n=e._origin,r=e._capacity,o=Tt(r),i=e._tail;return a(e._root,e._level,0);function a(e,l,u){return 0===l?function(e,a){var l=a===o?i&&i.array:e&&e.array,u=a>n?0:n-a,s=r-a;return s>y&&(s=y),function(){if(u===s)return bt;var e=t?--s:u++;return l&&l[e]}}(e,u):function(e,o,i){var l,u=e&&e.array,s=i>n?0:n-i>>o,c=1+(r-i>>o);return c>y&&(c=y),function(){for(;;){if(l){var e=l();if(e!==bt)return e;l=null}if(s===c)return bt;var n=t?--c:s++;l=a(u&&u[n],o-g,i+(n<<o))}}}(e,l,u)}}function xt(e,t,n,r,o,i,a){var l=Object.create(gt);return l.size=t-e,l._origin=e,l._capacity=t,l._level=n,l._root=r,l._tail=o,l.__ownerID=i,l.__hash=a,l.__altered=!1,l}function wt(){return mt||(mt=xt(0,0,g))}function Ct(e,t,n,r,o,i){var a,l=r>>>n&m,u=e&&l<e.array.length;if(!u&&void 0===o)return e;if(n>0){var s=e&&e.array[l],c=Ct(s,t,n-g,r,o,i);return c===s?e:((a=kt(e,t)).array[l]=c,a)}return u&&e.array[l]===o?e:(w(i),a=kt(e,t),void 0===o&&l===a.array.length-1?a.array.pop():a.array[l]=o,a)}function kt(e,t){return t&&e&&t===e.ownerID?e:new yt(e?e.array.slice():[],t)}function St(e,t){if(t>=Tt(e._capacity))return e._tail;if(t<1<<e._level+g){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&m],r-=g;return n}}function Ot(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new C,o=e._origin,i=e._capacity,a=o+t,l=void 0===n?i:n<0?i+n:o+n;if(a===o&&l===i)return e;if(a>=l)return e.clear();for(var u=e._level,s=e._root,c=0;a+c<0;)s=new yt(s&&s.array.length?[void 0,s]:[],r),c+=1<<(u+=g);c&&(a+=c,o+=c,l+=c,i+=c);for(var f=Tt(i),d=Tt(l);d>=1<<u+g;)s=new yt(s&&s.array.length?[s]:[],r),u+=g;var p=e._tail,h=d<f?St(e,l-1):d>f?new yt([],r):p;if(p&&d>f&&a<i&&p.array.length){for(var y=s=kt(s,r),v=u;v>g;v-=g){var b=f>>>v&m;y=y.array[b]=kt(y.array[b],r)}y.array[f>>>g&m]=p}if(l<i&&(h=h&&h.removeAfter(r,0,l)),a>=d)a-=d,l-=d,u=g,s=null,h=h&&h.removeBefore(r,0,a);else if(a>o||d<f){for(c=0;s;){var _=a>>>u&m;if(_!==d>>>u&m)break;_&&(c+=(1<<u)*_),u-=g,s=s.array[_]}s&&a>o&&(s=s.removeBefore(r,u,a-c)),s&&d<f&&(s=s.removeAfter(r,u,d-c)),c&&(a-=c,l-=c)}return e.__ownerID?(e.size=l-a,e._origin=a,e._capacity=l,e._level=u,e._root=s,e._tail=h,e.__hash=void 0,e.__altered=!0,e):xt(a,l,u,s,h)}function Et(e,t,n){for(var r=[],i=0,l=0;l<n.length;l++){var u=n[l],s=o(u);s.size>i&&(i=s.size),a(u)||(s=s.map(function(e){return fe(e)})),r.push(s)}return i>e.size&&(e=e.setSize(i)),at(e,t,r)}function Tt(e){return e<y?0:e-1>>>g<<g}function Pt(e){return null===e||void 0===e?It():jt(e)?e:It().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function jt(e){return qe(e)&&c(e)}function Mt(e,t,n,r){var o=Object.create(Pt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function It(){return vt||(vt=Mt(Qe(),wt()))}function Rt(e,t,n){var r,o,i=e._map,a=e._list,l=i.get(t),u=void 0!==l;if(n===v){if(!u)return e;a.size>=y&&a.size>=2*i.size?(o=a.filter(function(e,t){return void 0!==e&&l!==t}),r=o.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(n===a.get(l)[1])return e;r=i,o=a.set(l,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Mt(r,o)}function Nt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function At(e){this._iter=e,this.size=e.size}function Bt(e){this._iter=e,this.size=e.size}function Lt(e){this._iter=e,this.size=e.size}function Dt(e){var t=Zt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=en,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===N){var r=e.__iterator(t,n);return new D(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===R?I:R,n)},t}function qt(e,t,n){var r=Zt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,v);return i===v?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate(function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)},o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(N,o);return new D(function(){var o=i.next();if(o.done)return o;var a=o.value,l=a[0];return q(r,l,t.call(n,a[1],l,e),o)})},r}function zt(e,t){var n=Zt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Dt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=en,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function $t(e,t,n,r){var o=Zt(e);return r&&(o.has=function(r){var o=e.get(r,v);return o!==v&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,v);return i!==v&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,l=0;return e.__iterate(function(e,i,u){if(t.call(n,e,i,u))return l++,o(e,r?i:l-1,a)},i),l},o.__iteratorUncached=function(o,i){var a=e.__iterator(N,i),l=0;return new D(function(){for(;;){var i=a.next();if(i.done)return i;var u=i.value,s=u[0],c=u[1];if(t.call(n,c,s,e))return q(o,r?s:l++,c,i)}})},o}function Ft(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n|=0),T(t,n,o))return e;var i=P(t,o),a=j(n,o);if(i!=i||a!=a)return Ft(e.toSeq().cacheResult(),t,n,r);var l,u=a-i;u==u&&(l=u<0?0:u);var s=Zt(e);return s.size=0===l?l:e.size&&l||void 0,!r&&oe(e)&&l>=0&&(s.get=function(t,n){return(t=O(this,t))>=0&&t<l?e.get(t+i,n):n}),s.__iterateUncached=function(t,n){var o=this;if(0===l)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,u=!0,s=0;return e.__iterate(function(e,n){if(!u||!(u=a++<i))return s++,!1!==t(e,r?n:s-1,o)&&s!==l}),s},s.__iteratorUncached=function(t,n){if(0!==l&&n)return this.cacheResult().__iterator(t,n);var o=0!==l&&e.__iterator(t,n),a=0,u=0;return new D(function(){for(;a++<i;)o.next();if(++u>l)return{value:void 0,done:!0};var e=o.next();return r||t===R?e:q(t,u-1,t===I?void 0:e.value[1],e)})},s}function Wt(e,t,n,r){var o=Zt(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var l=!0,u=0;return e.__iterate(function(e,i,s){if(!l||!(l=t.call(n,e,i,s)))return u++,o(e,r?i:u-1,a)}),u},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var l=e.__iterator(N,i),u=!0,s=0;return new D(function(){var e,i,c;do{if((e=l.next()).done)return r||o===R?e:q(o,s++,o===I?void 0:e.value[1],e);var f=e.value;i=f[0],c=f[1],u&&(u=t.call(n,c,i,a))}while(u);return o===N?e:q(o,i,c,e)})},o}function Ut(e,t,n){var r=Zt(e);return r.__iterateUncached=function(r,o){var i=0,l=!1;return function e(u,s){var c=this;u.__iterate(function(o,u){return(!t||s<t)&&a(o)?e(o,s+1):!1===r(o,n?u:i++,c)&&(l=!0),!l},o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),l=[],u=0;return new D(function(){for(;i;){var e=i.next();if(!1===e.done){var s=e.value;if(r===N&&(s=s[1]),t&&!(l.length<t)||!a(s))return n?e:q(r,u++,s,e);l.push(i),i=s.__iterator(r,o)}else i=l.pop()}return{value:void 0,done:!0}})},r}function Kt(e,t,n){t||(t=tn);var r=l(e),o=0,i=e.toSeq().map(function(t,r){return[r,t,o++,n?n(t,r,e):t]}).toArray();return i.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?V(i):u(e)?Y(i):G(i)}function Ht(e,t,n){if(t||(t=tn),n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return Vt(t,e[1],n[1])?n:e});return r&&r[0]}return e.reduce(function(e,n){return Vt(t,e,n)?n:e})}function Vt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(void 0===n||null===n||n!=n)||r>0}function Yt(e,t,r){var o=Zt(e);return o.size=new ee(r).map(function(e){return e.size}).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(R,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map(function(e){return e=n(e),W(o?e.reverse():e)}),a=0,l=!1;return new D(function(){var n;return l||(n=i.map(function(e){return e.next()}),l=n.some(function(e){return e.done})),l?{value:void 0,done:!0}:q(e,a++,t.apply(null,n.map(function(e){return e.value})))})},o}function Gt(e,t){return oe(e)?t:e.constructor(t)}function Xt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Jt(e){return Le(e.size),S(e)}function Qt(e){return l(e)?r:u(e)?o:i}function Zt(e){return Object.create((l(e)?V:u(e)?Y:G).prototype)}function en(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):H.prototype.cacheResult.call(this)}function tn(e,t){return e>t?1:e<t?-1:0}function nn(e){var t=W(e);if(!t){if(!K(e))throw new TypeError("Expected iterable or array-like: "+e);t=W(n(e))}return t}function rn(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);!function(e,t){try{t.forEach(function(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){me(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}.bind(void 0,e))}catch(e){}}(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=De(i)},o=r.prototype=Object.create(on);return o.constructor=r,r}t(Pt,De),Pt.of=function(){return this(arguments)},Pt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Pt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Pt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Pt.prototype.set=function(e,t){return Rt(this,e,t)},Pt.prototype.remove=function(e){return Rt(this,e,v)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Pt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Pt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Mt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Pt.isOrderedMap=jt,Pt.prototype[h]=!0,Pt.prototype.delete=Pt.prototype.remove,t(Nt,V),Nt.prototype.get=function(e,t){return this._iter.get(e,t)},Nt.prototype.has=function(e){return this._iter.has(e)},Nt.prototype.valueSeq=function(){return this._iter.valueSeq()},Nt.prototype.reverse=function(){var e=this,t=zt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Nt.prototype.map=function(e,t){var n=this,r=qt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Nt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Jt(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Nt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(R,t),r=t?Jt(this):0;return new D(function(){var o=n.next();return o.done?o:q(e,t?--r:r++,o.value,o)})},Nt.prototype[h]=!0,t(At,Y),At.prototype.includes=function(e){return this._iter.includes(e)},At.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},At.prototype.__iterator=function(e,t){var n=this._iter.__iterator(R,t),r=0;return new D(function(){var t=n.next();return t.done?t:q(e,r++,t.value,t)})},t(Bt,G),Bt.prototype.has=function(e){return this._iter.includes(e)},Bt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},Bt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(R,t);return new D(function(){var t=n.next();return t.done?t:q(e,t.value,t.value,t)})},t(Lt,V),Lt.prototype.entrySeq=function(){return this._iter.toSeq()},Lt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){Xt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},Lt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(R,t);return new D(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Xt(r);var o=a(r);return q(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}})},At.prototype.cacheResult=Nt.prototype.cacheResult=Bt.prototype.cacheResult=Lt.prototype.cacheResult=en,t(rn,_e),rn.prototype.toString=function(){return this.__toString(ln(this)+" {","}")},rn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},rn.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},rn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=an(this,Qe()))},rn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+ln(this));var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:an(this,n)},rn.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:an(this,t)},rn.prototype.wasAltered=function(){return this._map.wasAltered()},rn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterator(e,t)},rn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterate(e,t)},rn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?an(this,t,e):(this.__ownerID=e,this._map=t,this)};var on=rn.prototype;function an(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function ln(e){return e._name||e.constructor.name||"Record"}function un(e){return null===e||void 0===e?gn():sn(e)&&!c(e)?e:gn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function sn(e){return!(!e||!e[fn])}on.delete=on.remove,on.deleteIn=on.removeIn=Fe.removeIn,on.merge=Fe.merge,on.mergeWith=Fe.mergeWith,on.mergeIn=Fe.mergeIn,on.mergeDeep=Fe.mergeDeep,on.mergeDeepWith=Fe.mergeDeepWith,on.mergeDeepIn=Fe.mergeDeepIn,on.setIn=Fe.setIn,on.update=Fe.update,on.updateIn=Fe.updateIn,on.withMutations=Fe.withMutations,on.asMutable=Fe.asMutable,on.asImmutable=Fe.asImmutable,t(un,we),un.of=function(){return this(arguments)},un.fromKeys=function(e){return this(r(e).keySeq())},un.prototype.toString=function(){return this.__toString("Set {","}")},un.prototype.has=function(e){return this._map.has(e)},un.prototype.add=function(e){return pn(this,this._map.set(e,!0))},un.prototype.remove=function(e){return pn(this,this._map.remove(e))},un.prototype.clear=function(){return pn(this,this._map.clear())},un.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter(function(e){return 0!==e.size})).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},un.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(e){return e.includes(n)})||e.remove(n)})})},un.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(e){return e.includes(n)})&&e.remove(n)})})},un.prototype.merge=function(){return this.union.apply(this,arguments)},un.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},un.prototype.sort=function(e){return yn(Kt(this,e))},un.prototype.sortBy=function(e,t){return yn(Kt(this,t,e))},un.prototype.wasAltered=function(){return this._map.wasAltered()},un.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},un.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},un.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},un.isSet=sn;var cn,fn="@@__IMMUTABLE_SET__@@",dn=un.prototype;function pn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function hn(e,t){var n=Object.create(dn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function gn(){return cn||(cn=hn(Qe()))}function yn(e){return null===e||void 0===e?xn():mn(e)?e:xn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function mn(e){return sn(e)&&c(e)}dn[fn]=!0,dn.delete=dn.remove,dn.mergeDeep=dn.merge,dn.mergeDeepWith=dn.mergeWith,dn.withMutations=Fe.withMutations,dn.asMutable=Fe.asMutable,dn.asImmutable=Fe.asImmutable,dn.__empty=gn,dn.__make=hn,t(yn,un),yn.of=function(){return this(arguments)},yn.fromKeys=function(e){return this(r(e).keySeq())},yn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},yn.isOrderedSet=mn;var vn,bn=yn.prototype;function _n(e,t){var n=Object.create(bn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function xn(){return vn||(vn=_n(It()))}function wn(e){return null===e||void 0===e?Tn():Cn(e)?e:Tn().unshiftAll(e)}function Cn(e){return!(!e||!e[Sn])}bn[h]=!0,bn.__empty=xn,bn.__make=_n,t(wn,xe),wn.of=function(){return this(arguments)},wn.prototype.toString=function(){return this.__toString("Stack [","]")},wn.prototype.get=function(e,t){var n=this._head;for(e=O(this,e);n&&e--;)n=n.next;return n?n.value:t},wn.prototype.peek=function(){return this._head&&this._head.value},wn.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):En(e,t)},wn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Le(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):En(t,n)},wn.prototype.pop=function(){return this.slice(1)},wn.prototype.unshift=function(){return this.push.apply(this,arguments)},wn.prototype.unshiftAll=function(e){return this.pushAll(e)},wn.prototype.shift=function(){return this.pop.apply(this,arguments)},wn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Tn()},wn.prototype.slice=function(e,t){if(T(e,t,this.size))return this;var n=P(e,this.size),r=j(t,this.size);if(r!==this.size)return xe.prototype.slice.call(this,e,t);for(var o=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):En(o,i)},wn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?En(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},wn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},wn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new D(function(){if(r){var t=r.value;return r=r.next,q(e,n++,t)}return{value:void 0,done:!0}})},wn.isStack=Cn;var kn,Sn="@@__IMMUTABLE_STACK__@@",On=wn.prototype;function En(e,t,n,r){var o=Object.create(On);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Tn(){return kn||(kn=En(0))}function Pn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}On[Sn]=!0,On.withMutations=Fe.withMutations,On.asMutable=Fe.asMutable,On.asImmutable=Fe.asImmutable,On.wasAltered=Fe.wasAltered,n.Iterator=D,Pn(n,{toArray:function(){Le(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new At(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new Nt(this,!0)},toMap:function(){return De(this.toKeyedSeq())},toObject:function(){Le(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Pt(this.toKeyedSeq())},toOrderedSet:function(){return yn(l(this)?this.valueSeq():this)},toSet:function(){return un(l(this)?this.valueSeq():this)},toSetSeq:function(){return new Bt(this)},toSeq:function(){return u(this)?this.toIndexedSeq():l(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return wn(l(this)?this.valueSeq():this)},toList:function(){return dt(l(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return Gt(this,function(e,t){var n=l(e),o=[e].concat(t).map(function(e){return a(e)?n&&(e=r(e)):e=n?ae(e):le(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&l(i)||u(e)&&u(i))return i}var s=new ee(o);return n?s=s.toKeyedSeq():u(e)||(s=s.toSetSeq()),(s=s.flatten(!0)).size=o.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),s}(this,t))},includes:function(e){return this.some(function(t){return he(t,e)})},entries:function(){return this.__iterator(N)},every:function(e,t){Le(this.size);var n=!0;return this.__iterate(function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1}),n},filter:function(e,t){return Gt(this,$t(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},findEntry:function(e,t){var n;return this.__iterate(function(r,o,i){if(e.call(t,r,o,i))return n=[o,r],!1}),n},findLastEntry:function(e,t){return this.toSeq().reverse().findEntry(e,t)},forEach:function(e,t){return Le(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Le(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(I)},map:function(e,t){return Gt(this,qt(this,e,t))},reduce:function(e,t,n){var r,o;return Le(this.size),arguments.length<2?o=!0:r=t,this.__iterate(function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Gt(this,zt(this,!0))},slice:function(e,t){return Gt(this,Ft(this,e,t,!0))},some:function(e,t){return!this.every(Nn(e),t)},sort:function(e){return Gt(this,Kt(this,e))},values:function(){return this.__iterator(R)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return S(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=De().asMutable();return e.__iterate(function(o,i){r.update(t.call(n,o,i,e),0,function(e){return e+1})}),r.asImmutable()}(this,e,t)},equals:function(e){return ge(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ee(e._cache);var t=e.toSeq().map(Rn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Nn(e),t)},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},first:function(){return this.find(E)},flatMap:function(e,t){return Gt(this,function(e,t,n){var r=Qt(e);return e.toSeq().map(function(o,i){return r(t.call(n,o,i,e))}).flatten(!0)}(this,e,t))},flatten:function(e){return Gt(this,Ut(this,e,!0))},fromEntrySeq:function(){return new Lt(this)},get:function(e,t){return this.find(function(t,n){return he(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,o=nn(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,v):v)===v)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=l(e),o=(c(e)?Pt():De()).asMutable();e.__iterate(function(i,a){o.update(t.call(n,i,a,e),function(e){return(e=e||[]).push(r?[a,i]:i),e})});var i=Qt(e);return o.map(function(t){return Gt(e,i(t))})}(this,e,t)},has:function(e){return this.get(e,v)!==v},hasIn:function(e){return this.getIn(e,v)!==v},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keySeq:function(){return this.toSeq().map(In).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(e){return Ht(this,e)},maxBy:function(e,t){return Ht(this,t,e)},min:function(e){return Ht(this,e?An(e):Dn)},minBy:function(e,t){return Ht(this,t?An(t):Dn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Gt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Gt(this,Wt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Nn(e),t)},sortBy:function(e,t){return Gt(this,Kt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Gt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Gt(this,function(e,t,n){var r=Zt(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate(function(e,o,l){return t.call(n,e,o,l)&&++a&&r(e,o,i)}),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(N,o),l=!0;return new D(function(){if(!l)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,u=o[0],s=o[1];return t.call(n,s,u,i)?r===N?e:q(r,u,s,e):(l=!1,{value:void 0,done:!0})})},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Nn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=c(e),n=l(e),r=t?1:0;return function(e,t){return t=Ce(t,3432918353),t=Ce(t<<15|t>>>-15,461845907),t=Ce(t<<13|t>>>-13,5),t=Ce((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=ke((t=Ce(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+qn(Se(e),Se(t))|0}:function(e,t){r=r+qn(Se(e),Se(t))|0}:t?function(e){r=31*r+Se(e)|0}:function(e){r=r+Se(e)|0}),r)}(this))}});var jn=n.prototype;jn[f]=!0,jn[L]=jn.values,jn.__toJS=jn.toArray,jn.__toStringMapper=Bn,jn.inspect=jn.toSource=function(){return this.toString()},jn.chain=jn.flatMap,jn.contains=jn.includes,function(){try{Object.defineProperty(jn,"length",{get:function(){if(!n.noLengthWarning){var e;try{throw new Error}catch(t){e=t.stack}if(-1===e.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+e),this.size}}})}catch(e){}}(),Pn(r,{flip:function(){return Gt(this,Dt(this))},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLastKey:function(e,t){return this.toSeq().reverse().findKey(e,t)},keyOf:function(e){return this.findKey(function(t){return he(t,e)})},lastKeyOf:function(e){return this.findLastKey(function(t){return he(t,e)})},mapEntries:function(e,t){var n=this,r=0;return Gt(this,this.toSeq().map(function(o,i){return e.call(t,[i,o],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Gt(this,this.toSeq().flip().map(function(r,o){return e.call(t,r,o,n)}).flip())}});var Mn=r.prototype;function In(e,t){return t}function Rn(e,t){return[t,e]}function Nn(e){return function(){return!e.apply(this,arguments)}}function An(e){return function(){return-e.apply(this,arguments)}}function Bn(e){return"string"==typeof e?JSON.stringify(e):e}function Ln(){return k(arguments)}function Dn(e,t){return e<t?1:e>t?-1:0}function qn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Mn[d]=!0,Mn[L]=jn.entries,Mn.__toJS=jn.toObject,Mn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Bn(e)},Pn(o,{toKeyedSeq:function(){return new Nt(this,!1)},filter:function(e,t){return Gt(this,$t(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.toKeyedSeq().keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.toKeyedSeq().reverse().keyOf(e);return void 0===t?-1:t},reverse:function(){return Gt(this,zt(this,!1))},slice:function(e,t){return Gt(this,Ft(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=P(e,e<0?this.count():this.size);var r=this.slice(0,e);return Gt(this,1===n?r:r.concat(k(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.toKeyedSeq().findLastKey(e,t);return void 0===n?-1:n},first:function(){return this.get(0)},flatten:function(e){return Gt(this,Ut(this,e,!1))},get:function(e,t){return(e=O(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=O(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Gt(this,function(e,t){var n=Zt(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate(function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)},r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(R,r),a=0;return new D(function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?q(n,a++,t):q(n,a++,o.value,o)})},n}(this,e))},interleave:function(){var e=[this].concat(k(arguments)),t=Yt(this.toSeq(),Y.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Gt(this,n)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Gt(this,Wt(this,e,t,!1))},zip:function(){return Gt(this,Yt(this,Ln,[this].concat(k(arguments))))},zipWith:function(e){var t=k(arguments);return t[0]=this,Gt(this,Yt(this,e,t))}}),o.prototype[p]=!0,o.prototype[h]=!0,Pn(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=jn.includes,Pn(V,r.prototype),Pn(Y,o.prototype),Pn(G,i.prototype),Pn(_e,r.prototype),Pn(xe,o.prototype),Pn(we,i.prototype),{Iterable:n,Seq:H,Collection:be,Map:De,OrderedMap:Pt,List:dt,Stack:wn,Set:un,OrderedSet:yn,Record:rn,Range:ve,Repeat:ye,is:he,fromJS:fe}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rgba=t.breakpoints=t.colors=void 0;var r=a(n(732)),o=a(n(733)),i=n(734);function a(e){return e&&e.__esModule?e:{default:e}}t.colors=r.default,t.breakpoints=o.default,t.rgba=i.rgba},function(e,t,n){"use strict";var r=n(142),o="object"==typeof self&&self&&self.Object===Object&&self,i=r.a||o||Function("return this")();t.a=i},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,i,a,l,u){if(r(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,o,i,a,l,u],f=0;(s=new Error(t.replace(/%s/g,function(){return c[f++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rgba=t.breakpoints=t.colors=void 0;var r=a(n(446)),o=a(n(447)),i=n(448);function a(e){return e&&e.__esModule?e:{default:e}}t.colors=r.default,t.breakpoints=o.default,t.rgba=i.rgba},function(e,t,n){"use strict";var r=n(16),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,l=r.a?r.a.toStringTag:void 0;var u=function(e){var t=i.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[l]=n:delete e[l]),o},s=Object.prototype.toString;var c=function(e){return s.call(e)},f="[object Null]",d="[object Undefined]",p=r.a?r.a.toStringTag:void 0;t.a=function(e){return null==e?void 0===e?d:f:p&&p in Object(e)?u(e):c(e)}},function(e,t,n){"use strict";var r=n(42)||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var o=n(339),i=n(208),a=n(823),l=n(8),u=n(90),s=l.OrderedSet,c=l.Record,f=l.Stack,d=c({allowUndo:!0,currentContent:null,decorator:null,directionMap:null,forceSelection:!1,inCompositionMode:!1,inlineStyleOverride:null,lastChangeType:null,nativelyRenderedContent:null,redoStack:f(),selection:null,treeMap:null,undoStack:f()}),p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._immutable=t}return e.createEmpty=function(t){return e.createWithContent(i.createFromText(""),t)},e.createWithContent=function(t,n){var r=t.getBlockMap().first().getKey();return e.create({currentContent:t,undoStack:f(),redoStack:f(),decorator:n||null,selection:u.createEmpty(r)})},e.create=function(t){var n=t.currentContent,o=t.decorator,i=r({},t,{treeMap:g(n,o),directionMap:a.getDirectionMap(n)});return new e(new d(i))},e.set=function(t,n){return new e(t.getImmutable().withMutations(function(e){var r=e.get("decorator"),i=r;null===n.decorator?i=null:n.decorator&&(i=n.decorator);var a=n.currentContent||t.getCurrentContent();if(i!==r){var l,u=e.get("treeMap");return l=i&&r?function(e,t,n,r,i){return n.merge(t.toSeq().filter(function(t){return r.getDecorations(t,e)!==i.getDecorations(t,e)}).map(function(t){return o.generate(e,t,r)}))}(a,a.getBlockMap(),u,i,r):g(a,i),void e.merge({decorator:i,treeMap:l,nativelyRenderedContent:null})}a!==t.getCurrentContent()&&e.set("treeMap",function(e,t,n,r){var i=e.getCurrentContent().set("entityMap",n),a=i.getBlockMap();return e.getImmutable().get("treeMap").merge(t.toSeq().filter(function(e,t){return e!==a.get(t)}).map(function(e){return o.generate(i,e,r)}))}(t,a.getBlockMap(),a.getEntityMap(),i)),e.merge(n)}))},e.prototype.toJS=function(){return this.getImmutable().toJS()},e.prototype.getAllowUndo=function(){return this.getImmutable().get("allowUndo")},e.prototype.getCurrentContent=function(){return this.getImmutable().get("currentContent")},e.prototype.getUndoStack=function(){return this.getImmutable().get("undoStack")},e.prototype.getRedoStack=function(){return this.getImmutable().get("redoStack")},e.prototype.getSelection=function(){return this.getImmutable().get("selection")},e.prototype.getDecorator=function(){return this.getImmutable().get("decorator")},e.prototype.isInCompositionMode=function(){return this.getImmutable().get("inCompositionMode")},e.prototype.mustForceSelection=function(){return this.getImmutable().get("forceSelection")},e.prototype.getNativelyRenderedContent=function(){return this.getImmutable().get("nativelyRenderedContent")},e.prototype.getLastChangeType=function(){return this.getImmutable().get("lastChangeType")},e.prototype.getInlineStyleOverride=function(){return this.getImmutable().get("inlineStyleOverride")},e.setInlineStyleOverride=function(t,n){return e.set(t,{inlineStyleOverride:n})},e.prototype.getCurrentInlineStyle=function(){var e=this.getInlineStyleOverride();if(null!=e)return e;var t=this.getCurrentContent(),n=this.getSelection();return n.isCollapsed()?function(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);if(r>0)return o.getInlineStyleAt(r-1);if(o.getLength())return o.getInlineStyleAt(0);return y(e,n)}(t,n):function(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);if(r<o.getLength())return o.getInlineStyleAt(r);if(r>0)return o.getInlineStyleAt(r-1);return y(e,n)}(t,n)},e.prototype.getBlockTree=function(e){return this.getImmutable().getIn(["treeMap",e])},e.prototype.isSelectionAtStartOfContent=function(){var e=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(e,0,0)},e.prototype.isSelectionAtEndOfContent=function(){var e=this.getCurrentContent().getBlockMap().last(),t=e.getLength();return this.getSelection().hasEdgeWithin(e.getKey(),t,t)},e.prototype.getDirectionMap=function(){return this.getImmutable().get("directionMap")},e.acceptSelection=function(e,t){return h(e,t,!1)},e.forceSelection=function(e,t){return t.getHasFocus()||(t=t.set("hasFocus",!0)),h(e,t,!0)},e.moveSelectionToEnd=function(t){var n=t.getCurrentContent().getLastBlock(),r=n.getKey(),o=n.getLength();return e.acceptSelection(t,new u({anchorKey:r,anchorOffset:o,focusKey:r,focusOffset:o,isBackward:!1}))},e.moveFocusToEnd=function(t){var n=e.moveSelectionToEnd(t);return e.forceSelection(n,n.getSelection())},e.push=function(t,n,r){if(t.getCurrentContent()===n)return t;var o="insert-characters"!==r,i=a.getDirectionMap(n,t.getDirectionMap());if(!t.getAllowUndo())return e.set(t,{currentContent:n,directionMap:i,lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:o,inlineStyleOverride:null});var l=t.getSelection(),u=t.getCurrentContent(),s=t.getUndoStack(),c=n;l!==u.getSelectionAfter()||function(e,t){var n=e.getLastChangeType();return t!==n||"insert-characters"!==t&&"backspace-character"!==t&&"delete-character"!==t}(t,r)?(s=s.push(u),c=c.set("selectionBefore",l)):"insert-characters"!==r&&"backspace-character"!==r&&"delete-character"!==r||(c=c.set("selectionBefore",u.getSelectionBefore()));var d=t.getInlineStyleOverride();-1===["adjust-depth","change-block-type","split-block"].indexOf(r)&&(d=null);var p={currentContent:c,directionMap:i,undoStack:s,redoStack:f(),lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:o,inlineStyleOverride:d};return e.set(t,p)},e.undo=function(t){if(!t.getAllowUndo())return t;var n=t.getUndoStack(),r=n.peek();if(!r)return t;var o=t.getCurrentContent(),i=a.getDirectionMap(r,t.getDirectionMap());return e.set(t,{currentContent:r,directionMap:i,undoStack:n.shift(),redoStack:t.getRedoStack().push(o),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:o.getSelectionBefore()})},e.redo=function(t){if(!t.getAllowUndo())return t;var n=t.getRedoStack(),r=n.peek();if(!r)return t;var o=t.getCurrentContent(),i=a.getDirectionMap(r,t.getDirectionMap());return e.set(t,{currentContent:r,directionMap:i,undoStack:t.getUndoStack().push(o),redoStack:n.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:r.getSelectionAfter()})},e.prototype.getImmutable=function(){return this._immutable},e}();function h(e,t,n){return p.set(e,{selection:t,forceSelection:n,nativelyRenderedContent:null,inlineStyleOverride:null})}function g(e,t){return e.getBlockMap().map(function(n){return o.generate(e,n,t)}).toOrderedMap()}function y(e,t){var n=e.getBlockMap().reverse().skipUntil(function(e,n){return n===t}).skip(1).skipUntil(function(e,t){return e.getLength()}).first();return n?n.getInlineStyleAt(n.getLength()-1):s()}e.exports=p},function(e,t,n){e.exports=n(566)()},function(e,t,n){"use strict";var r=n(10).a.Symbol;t.a=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenReaderShortcut=t.ScreenReaderText=t.Row=t.ZebrafiedListTable=t.ListTable=t.Checkbox=t.WordOccurrences=t.WordList=t.YouTubeVideo=t.Warning=t.Tabs=t.YoastSeoIcon=t.Modal=t.Logo=t.YoastLinkButton=t.InputField=t.YoastButton=t.UpsellLinkButton=t.UpsellButton=t.Toggle=t.Textfield=t.Textarea=t.SynonymsInput=t.icons=t.SvgIcon=t.StackedProgressBar=t.ScoreAssessments=t.SectionTitle=t.Section=t.ProgressBar=t.Paper=t.Notification=t.MultiStepProgress=t.Loader=t.languageNoticePropType=t.LanguageNotice=t.Label=t.KeywordSuggestions=t.Input=t.IFrame=t.IconButtonToggle=t.Icon=t.HelpText=t.HelpCenterButton=t.Heading=t.ErrorBoundary=t.IconsButton=t.IconButton=t.IconLabeledButton=t.CourseDetails=t.CardBanner=t.FullHeightCard=t.Card=t.ArticleList=t.Alert=t.wrapInHeading=t.StyledContainerTopLevel=t.StyledContainer=t.StyledIconsButton=t.CollapsibleStateless=t.Collapsible=t.addButtonStyles=t.addBaseStyle=t.addFocusStyle=t.addActiveStyle=t.addHoverStyle=t.BaseButton=t.Button=t.LinkButton=t.StyledHeading=t.StyledSectionBase=t.StyledSection=void 0;var r=n(92);Object.defineProperty(t,"Button",{enumerable:!0,get:function(){return ie(r).default}}),Object.defineProperty(t,"BaseButton",{enumerable:!0,get:function(){return r.BaseButton}}),Object.defineProperty(t,"addHoverStyle",{enumerable:!0,get:function(){return r.addHoverStyle}}),Object.defineProperty(t,"addActiveStyle",{enumerable:!0,get:function(){return r.addActiveStyle}}),Object.defineProperty(t,"addFocusStyle",{enumerable:!0,get:function(){return r.addFocusStyle}}),Object.defineProperty(t,"addBaseStyle",{enumerable:!0,get:function(){return r.addBaseStyle}}),Object.defineProperty(t,"addButtonStyles",{enumerable:!0,get:function(){return r.addButtonStyles}});var o=n(997);Object.defineProperty(t,"Collapsible",{enumerable:!0,get:function(){return ie(o).default}}),Object.defineProperty(t,"CollapsibleStateless",{enumerable:!0,get:function(){return o.CollapsibleStateless}}),Object.defineProperty(t,"StyledIconsButton",{enumerable:!0,get:function(){return o.StyledIconsButton}}),Object.defineProperty(t,"StyledContainer",{enumerable:!0,get:function(){return o.StyledContainer}}),Object.defineProperty(t,"StyledContainerTopLevel",{enumerable:!0,get:function(){return o.StyledContainerTopLevel}}),Object.defineProperty(t,"wrapInHeading",{enumerable:!0,get:function(){return o.wrapInHeading}});var i=n(998);Object.defineProperty(t,"Alert",{enumerable:!0,get:function(){return ie(i).default}});var a=n(999);Object.defineProperty(t,"ArticleList",{enumerable:!0,get:function(){return ie(a).default}});var l=n(1e3);Object.defineProperty(t,"Card",{enumerable:!0,get:function(){return ie(l).default}}),Object.defineProperty(t,"FullHeightCard",{enumerable:!0,get:function(){return l.FullHeightCard}});var u=n(383);Object.defineProperty(t,"CardBanner",{enumerable:!0,get:function(){return ie(u).default}});var s=n(1001);Object.defineProperty(t,"CourseDetails",{enumerable:!0,get:function(){return ie(s).default}});var c=n(1002);Object.defineProperty(t,"IconLabeledButton",{enumerable:!0,get:function(){return ie(c).default}});var f=n(1003);Object.defineProperty(t,"IconButton",{enumerable:!0,get:function(){return ie(f).default}});var d=n(382);Object.defineProperty(t,"IconsButton",{enumerable:!0,get:function(){return ie(d).default}});var p=n(1004);Object.defineProperty(t,"ErrorBoundary",{enumerable:!0,get:function(){return ie(p).default}});var h=n(221);Object.defineProperty(t,"Heading",{enumerable:!0,get:function(){return ie(h).default}});var g=n(1005);Object.defineProperty(t,"HelpCenterButton",{enumerable:!0,get:function(){return g.HelpCenterButton}});var y=n(1006);Object.defineProperty(t,"HelpText",{enumerable:!0,get:function(){return ie(y).default}});var m=n(1007);Object.defineProperty(t,"Icon",{enumerable:!0,get:function(){return ie(m).default}});var v=n(1008);Object.defineProperty(t,"IconButtonToggle",{enumerable:!0,get:function(){return ie(v).default}});var b=n(384);Object.defineProperty(t,"IFrame",{enumerable:!0,get:function(){return ie(b).default}});var _=n(385);Object.defineProperty(t,"Input",{enumerable:!0,get:function(){return ie(_).default}});var x=n(1009);Object.defineProperty(t,"KeywordSuggestions",{enumerable:!0,get:function(){return ie(x).default}});var w=n(388);Object.defineProperty(t,"Label",{enumerable:!0,get:function(){return ie(w).default}});var C=n(1010);Object.defineProperty(t,"LanguageNotice",{enumerable:!0,get:function(){return ie(C).default}}),Object.defineProperty(t,"languageNoticePropType",{enumerable:!0,get:function(){return C.languageNoticePropType}});var k=n(1011);Object.defineProperty(t,"Loader",{enumerable:!0,get:function(){return ie(k).default}});var S=n(1012);Object.defineProperty(t,"MultiStepProgress",{enumerable:!0,get:function(){return ie(S).default}});var O=n(1013);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return ie(O).default}});var E=n(389);Object.defineProperty(t,"Paper",{enumerable:!0,get:function(){return ie(E).default}});var T=n(1014);Object.defineProperty(t,"ProgressBar",{enumerable:!0,get:function(){return ie(T).default}});var P=n(390);Object.defineProperty(t,"Section",{enumerable:!0,get:function(){return ie(P).default}});var j=n(379);Object.defineProperty(t,"SectionTitle",{enumerable:!0,get:function(){return j.SectionTitle}});var M=n(1015);Object.defineProperty(t,"ScoreAssessments",{enumerable:!0,get:function(){return ie(M).default}});var I=n(1016);Object.defineProperty(t,"StackedProgressBar",{enumerable:!0,get:function(){return ie(I).default}});var R=n(56);Object.defineProperty(t,"SvgIcon",{enumerable:!0,get:function(){return ie(R).default}}),Object.defineProperty(t,"icons",{enumerable:!0,get:function(){return R.icons}});var N=n(1017);Object.defineProperty(t,"SynonymsInput",{enumerable:!0,get:function(){return ie(N).default}});var A=n(392);Object.defineProperty(t,"Textarea",{enumerable:!0,get:function(){return ie(A).default}});var B=n(1020);Object.defineProperty(t,"Textfield",{enumerable:!0,get:function(){return ie(B).default}});var L=n(1021);Object.defineProperty(t,"Toggle",{enumerable:!0,get:function(){return ie(L).default}});var D=n(1022);Object.defineProperty(t,"UpsellButton",{enumerable:!0,get:function(){return D.UpsellButton}});var q=n(1023);Object.defineProperty(t,"UpsellLinkButton",{enumerable:!0,get:function(){return q.UpsellLinkButton}});var z=n(140);Object.defineProperty(t,"YoastButton",{enumerable:!0,get:function(){return z.YoastButton}});var $=n(391);Object.defineProperty(t,"InputField",{enumerable:!0,get:function(){return $.InputField}});var F=n(1024);Object.defineProperty(t,"YoastLinkButton",{enumerable:!0,get:function(){return F.YoastLinkButton}});var W=n(1025);Object.defineProperty(t,"Logo",{enumerable:!0,get:function(){return ie(W).default}});var U=n(1026);Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return ie(U).default}});var K=n(1027);Object.defineProperty(t,"YoastSeoIcon",{enumerable:!0,get:function(){return ie(K).default}});var H=n(1028);Object.defineProperty(t,"Tabs",{enumerable:!0,get:function(){return ie(H).default}});var V=n(1029);Object.defineProperty(t,"Warning",{enumerable:!0,get:function(){return ie(V).default}});var Y=n(1030);Object.defineProperty(t,"YouTubeVideo",{enumerable:!0,get:function(){return ie(Y).default}});var G=n(386);Object.defineProperty(t,"WordList",{enumerable:!0,get:function(){return ie(G).default}});var X=n(387);Object.defineProperty(t,"WordOccurrences",{enumerable:!0,get:function(){return ie(X).default}});var J=n(1031);Object.defineProperty(t,"Checkbox",{enumerable:!0,get:function(){return ie(J).default}});var Q=n(1032);Object.defineProperty(t,"ListTable",{enumerable:!0,get:function(){return Q.ListTable}}),Object.defineProperty(t,"ZebrafiedListTable",{enumerable:!0,get:function(){return Q.ZebrafiedListTable}});var Z=n(1033);Object.defineProperty(t,"Row",{enumerable:!0,get:function(){return Z.Row}});var ee=n(380);Object.defineProperty(t,"ScreenReaderText",{enumerable:!0,get:function(){return ie(ee).default}});var te=n(1034);Object.defineProperty(t,"ScreenReaderShortcut",{enumerable:!0,get:function(){return ie(te).default}});var ne=n(1035),re=ie(ne),oe=n(1036);function ie(e){return e&&e.__esModule?e:{default:e}}t.StyledSection=re.default,t.StyledSectionBase=ne.StyledSectionBase,t.StyledHeading=ne.StyledHeading,t.LinkButton=oe.LinkButton},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeOutboundLink=t.getFeed=t.getCourseFeed=t.getPostFeed=t.decodeHTML=t.sendRequest=t.getDirectionalStyle=t.createSvgIconComponent=void 0;var r=n(990);Object.defineProperty(t,"makeOutboundLink",{enumerable:!0,get:function(){return r.makeOutboundLink}});var o=n(992),i=f(n(993)),a=f(n(994)),l=f(n(220)),u=f(n(995)),s=f(n(378)),c=f(n(996));function f(e){return e&&e.__esModule?e:{default:e}}t.createSvgIconComponent=c.default,t.getDirectionalStyle=o.getDirectionalStyle,t.sendRequest=i.default,t.decodeHTML=a.default,t.getPostFeed=s.default,t.getCourseFeed=u.default,t.getFeed=l.default},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){e.exports={default:n(604),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(606));t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),(0,r.default)(e,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(186));t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,r.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){"use strict";t.__esModule=!0;var r=a(n(628)),o=a(n(632)),i=a(n(186));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,i.default)(t)));e.prototype=(0,o.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.default?(0,r.default)(e,t):e.__proto__=t)}},function(e,t){e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";(function(e){var r=n(10),o=n(57),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,l=a&&a.exports===i?r.a.Buffer:void 0,u=(l?l.isBuffer:void 0)||o.a;t.a=u}).call(this,n(225)(e))},function(e,t,n){"use strict";var r=n(13),o=n(66),i=n(6),a="[object Object]",l=Function.prototype,u=Object.prototype,s=l.toString,c=u.hasOwnProperty,f=s.call(Object);t.a=function(e){if(!Object(i.a)(e)||Object(r.a)(e)!=a)return!1;var t=Object(o.a)(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==f}},function(e,t,n){"use strict";(function(e){var r=n(142),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.a.process,l=function(){try{return a&&a.binding&&a.binding("util")}catch(e){}}();t.a=l}).call(this,n(225)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeOutboundLink=t.getFeed=t.getCourseFeed=t.getPostFeed=t.decodeHTML=t.sendRequest=t.getDirectionalStyle=t.createSvgIconComponent=void 0;var r=n(735);Object.defineProperty(t,"makeOutboundLink",{enumerable:!0,get:function(){return r.makeOutboundLink}});var o=n(737),i=f(n(738)),a=f(n(739)),l=f(n(200)),u=f(n(740)),s=f(n(313)),c=f(n(741));function f(e){return e&&e.__esModule?e:{default:e}}t.createSvgIconComponent=c.default,t.getDirectionalStyle=o.getDirectionalStyle,t.sendRequest=i.default,t.decodeHTML=a.default,t.getPostFeed=s.default,t.getCourseFeed=u.default,t.getFeed=l.default},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(597));t.default=r.default||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";var r=n(39),o=n(812),i=n(63),a=n(8),l=n(813),u=n(815),s=n(134),c=n(818),f=n(819),d=n(11),p=n(820),h=n(336),g=n(821),y=n(822),m=a.OrderedSet,v={replaceText:function(e,t,n,o,i){var a=h(e,t),l=g(a,t),u=r.create({style:o||m(),entity:i||null});return f(l,l.getSelectionAfter(),n,u)},insertText:function(e,t,n,r,o){return t.isCollapsed()||d(!1),v.replaceText(e,t,n,r,o)},moveText:function(e,t,n){var r=s(e,t),o=v.removeRange(e,t,"backward");return v.replaceWithFragment(o,n,r)},replaceWithFragment:function(e,t,n){var r=h(e,t),o=g(r,t);return c(o,o.getSelectionAfter(),n)},removeRange:function(e,t,n){var r,o,a=void 0,l=void 0;t.getIsBackward()&&(t=t.merge({anchorKey:t.getFocusKey(),anchorOffset:t.getFocusOffset(),focusKey:t.getAnchorKey(),focusOffset:t.getAnchorOffset(),isBackward:!1})),r=t.getAnchorKey(),o=t.getFocusKey(),a=e.getBlockForKey(r),l=e.getBlockForKey(o);var s=t.getStartOffset(),c=t.getEndOffset(),f=a.getEntityAt(s),d=l.getEntityAt(c-1);if(r===o&&f&&f===d){var p=u(e.getEntityMap(),a,l,t,n);return g(e,p)}var y=t;i.draft_segmented_entities_behavior&&(y=u(e.getEntityMap(),a,l,t,n));var m=h(e,y);return g(m,y)},splitBlock:function(e,t){var n=h(e,t),r=g(n,t);return y(r,r.getSelectionAfter())},applyInlineStyle:function(e,t,n){return o.add(e,t,n)},removeInlineStyle:function(e,t,n){return o.remove(e,t,n)},setBlockType:function(e,t,n){return p(e,t,function(e){return e.merge({type:n,depth:0})})},setBlockData:function(e,t,n){return p(e,t,function(e){return e.merge({data:n})})},mergeBlockData:function(e,t,n){return p(e,t,function(e){return e.merge({data:e.getData().merge(n)})})},applyEntity:function(e,t,n){var r=h(e,t);return l(r,t,n)}};e.exports=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeOutboundLink=t.getFeed=t.getCourseFeed=t.getPostFeed=t.decodeHTML=t.sendRequest=t.getDirectionalStyle=t.createSvgIconComponent=void 0;var r=n(449);Object.defineProperty(t,"makeOutboundLink",{enumerable:!0,get:function(){return r.makeOutboundLink}});var o=n(451),i=f(n(452)),a=f(n(453)),l=f(n(152)),u=f(n(454)),s=f(n(241)),c=f(n(455));function f(e){return e&&e.__esModule?e:{default:e}}t.createSvgIconComponent=c.default,t.getDirectionalStyle=o.getDirectionalStyle,t.sendRequest=i.default,t.decodeHTML=a.default,t.getPostFeed=s.default,t.getCourseFeed=u.default,t.getFeed=l.default},function(e,t,n){var r=n(153),o=n(457),i=n(506),a=n(121),l=n(80),u=n(512),s=n(230),c=n(252),f=s(function(e,t){var n={};if(null==e)return n;var s=!1;t=r(t,function(t){return t=a(t,e),s||(s=t.length>1),t}),l(e,c(e),n),s&&(n=o(n,7,u));for(var f=t.length;f--;)i(n,t[f]);return n});e.exports=f},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";var r=n(810),o=n(107),i=n(39),a=n(826),l=n(74),u=n(208),s=n(211),c=n(342),f=n(827),d=n(344),p=n(135),h=n(34),g=n(340),y=n(14),m=n(218),v=n(358),b=n(90),_=n(889),x={Editor:f,EditorBlock:d,EditorState:y,CompositeDecorator:a,Entity:p,EntityInstance:g,BlockMapBuilder:o,CharacterMetadata:i,ContentBlock:l,ContentState:u,SelectionState:b,AtomicBlockUtils:r,KeyBindingUtil:m,Modifier:h,RichUtils:v,DefaultDraftBlockRenderMap:s,DefaultDraftInlineStyle:c,convertFromHTML:n(356),convertFromRaw:n(892),convertToRaw:_,genKey:n(58),getDefaultKeyBinding:n(359),getVisibleSelectionRect:n(897)};e.exports=x},function(e,t,n){"use strict";var r=n(8),o=r.Map,i=r.OrderedSet,a=r.Record,l=i(),u={style:l,entity:null},s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getStyle=function(){return this.get("style")},t.prototype.getEntity=function(){return this.get("entity")},t.prototype.hasStyle=function(e){return this.getStyle().includes(e)},t.applyStyle=function(e,n){var r=e.set("style",e.getStyle().add(n));return t.create(r)},t.removeStyle=function(e,n){var r=e.set("style",e.getStyle().remove(n));return t.create(r)},t.applyEntity=function(e,n){var r=e.getEntity()===n?e:e.set("entity",n);return t.create(r)},t.create=function(e){if(!e)return c;var n=o({style:l,entity:null}).merge(e),r=f.get(n);if(r)return r;var i=new t(n);return f=f.set(n,i),i},t}(a(u)),c=new s,f=o([[o(u),c]]);s.EMPTY=c,e.exports=s},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=l(n(0)),i=l(n(544)),a=l(n(547));function l(e){return e&&e.__esModule?e:{default:e}}var u=void 0;function s(e,t){var n,a,l,c,f,d,p,h,g=[],y={};for(d=0;d<e.length;d++)if("string"!==(f=e[d]).type){if(!t.hasOwnProperty(f.value)||void 0===t[f.value])throw new Error("Invalid interpolation, missing component node: `"+f.value+"`");if("object"!==r(t[f.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+f.value+"`","\n> "+u);if("componentClose"===f.type)throw new Error("Missing opening component token: `"+f.value+"`");if("componentOpen"===f.type){n=t[f.value],l=d;break}g.push(t[f.value])}else g.push(f.value);return n&&(c=function(e,t){var n,r,o=t[e],i=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===o.value){if("componentOpen"===n.type){i++;continue}if("componentClose"===n.type){if(0===i)return r;i--}}throw new Error("Missing closing component token `"+o.value+"`")}(l,e),p=s(e.slice(l+1,c),t),a=o.default.cloneElement(n,{},p),g.push(a),c<e.length-1&&(h=s(e.slice(c+1),t),g=g.concat(h))),1===g.length?g[0]:(g.forEach(function(e,t){e&&(y["interpolation-child-"+t]=e)}),(0,i.default)(y))}t.default=function(e){var t=e.mixedString,n=e.components,o=e.throwErrors;if(u=t,!n)return t;if("object"!==(void 0===n?"undefined":r(n))){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var i=(0,a.default)(t);try{return s(i,n)}catch(e){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},function(e,t,n){"use strict";
|
2 |
-
/*
|
3 |
-
object-assign
|
4 |
-
(c) Sindre Sorhus
|
5 |
-
@license MIT
|
6 |
-
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,l=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u<arguments.length;u++){for(var s in n=Object(arguments[u]))o.call(n,s)&&(l[s]=n[s]);if(r){a=r(n);for(var c=0;c<a.length;c++)i.call(n,a[c])&&(l[a[c]]=n[a[c]])}}return l}},function(e,t,n){"use strict";var r=n(39),o=n(8),i=n(108),a=o.List,l=o.Map,u=o.OrderedSet,s=o.Record,c=o.Repeat,f=u(),d={parent:null,characterList:a(),data:l(),depth:0,key:"",text:"",type:"unstyled",children:a(),prevSibling:null,nextSibling:null},p=function(e,t){return e.getStyle()===t.getStyle()},h=function(e,t){return e.getEntity()===t.getEntity()},g=function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=a(c(r.EMPTY,n.length))),e},y=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,g(n)))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getKey=function(){return this.get("key")},t.prototype.getType=function(){return this.get("type")},t.prototype.getText=function(){return this.get("text")},t.prototype.getCharacterList=function(){return this.get("characterList")},t.prototype.getLength=function(){return this.getText().length},t.prototype.getDepth=function(){return this.get("depth")},t.prototype.getData=function(){return this.get("data")},t.prototype.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():f},t.prototype.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},t.prototype.getChildKeys=function(){return this.get("children")},t.prototype.getParentKey=function(){return this.get("parent")},t.prototype.getPrevSiblingKey=function(){return this.get("prevSibling")},t.prototype.getNextSiblingKey=function(){return this.get("nextSibling")},t.prototype.findStyleRanges=function(e,t){i(this.getCharacterList(),p,e,t)},t.prototype.findEntityRanges=function(e,t){i(this.getCharacterList(),h,e,t)},t}(s(d));e.exports=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenReaderShortcut=t.ScreenReaderText=t.Row=t.ZebrafiedListTable=t.ListTable=t.Checkbox=t.WordOccurrences=t.WordList=t.YouTubeVideo=t.Warning=t.Tabs=t.YoastSeoIcon=t.Modal=t.Logo=t.YoastLinkButton=t.InputField=t.YoastButton=t.UpsellLinkButton=t.UpsellButton=t.Toggle=t.Textfield=t.Textarea=t.SynonymsInput=t.icons=t.SvgIcon=t.StackedProgressBar=t.ScoreAssessments=t.SectionTitle=t.Section=t.ProgressBar=t.Paper=t.Notification=t.MultiStepProgress=t.Loader=t.languageNoticePropType=t.LanguageNotice=t.Label=t.KeywordSuggestions=t.Input=t.IFrame=t.IconButtonToggle=t.Icon=t.HelpText=t.HelpCenterButton=t.Heading=t.ErrorBoundary=t.IconsButton=t.IconButton=t.IconLabeledButton=t.CourseDetails=t.CardBanner=t.FullHeightCard=t.Card=t.ArticleList=t.Alert=t.wrapInHeading=t.StyledContainerTopLevel=t.StyledContainer=t.StyledIconsButton=t.CollapsibleStateless=t.Collapsible=t.addButtonStyles=t.addBaseStyle=t.addFocusStyle=t.addActiveStyle=t.addHoverStyle=t.BaseButton=t.Button=t.LinkButton=t.StyledHeading=t.StyledSectionBase=t.StyledSection=void 0;var r=n(77);Object.defineProperty(t,"Button",{enumerable:!0,get:function(){return ie(r).default}}),Object.defineProperty(t,"BaseButton",{enumerable:!0,get:function(){return r.BaseButton}}),Object.defineProperty(t,"addHoverStyle",{enumerable:!0,get:function(){return r.addHoverStyle}}),Object.defineProperty(t,"addActiveStyle",{enumerable:!0,get:function(){return r.addActiveStyle}}),Object.defineProperty(t,"addFocusStyle",{enumerable:!0,get:function(){return r.addFocusStyle}}),Object.defineProperty(t,"addBaseStyle",{enumerable:!0,get:function(){return r.addBaseStyle}}),Object.defineProperty(t,"addButtonStyles",{enumerable:!0,get:function(){return r.addButtonStyles}});var o=n(456);Object.defineProperty(t,"Collapsible",{enumerable:!0,get:function(){return ie(o).default}}),Object.defineProperty(t,"CollapsibleStateless",{enumerable:!0,get:function(){return o.CollapsibleStateless}}),Object.defineProperty(t,"StyledIconsButton",{enumerable:!0,get:function(){return o.StyledIconsButton}}),Object.defineProperty(t,"StyledContainer",{enumerable:!0,get:function(){return o.StyledContainer}}),Object.defineProperty(t,"StyledContainerTopLevel",{enumerable:!0,get:function(){return o.StyledContainerTopLevel}}),Object.defineProperty(t,"wrapInHeading",{enumerable:!0,get:function(){return o.wrapInHeading}});var i=n(514);Object.defineProperty(t,"Alert",{enumerable:!0,get:function(){return ie(i).default}});var a=n(515);Object.defineProperty(t,"ArticleList",{enumerable:!0,get:function(){return ie(a).default}});var l=n(516);Object.defineProperty(t,"Card",{enumerable:!0,get:function(){return ie(l).default}}),Object.defineProperty(t,"FullHeightCard",{enumerable:!0,get:function(){return l.FullHeightCard}});var u=n(260);Object.defineProperty(t,"CardBanner",{enumerable:!0,get:function(){return ie(u).default}});var s=n(517);Object.defineProperty(t,"CourseDetails",{enumerable:!0,get:function(){return ie(s).default}});var c=n(518);Object.defineProperty(t,"IconLabeledButton",{enumerable:!0,get:function(){return ie(c).default}});var f=n(519);Object.defineProperty(t,"IconButton",{enumerable:!0,get:function(){return ie(f).default}});var d=n(259);Object.defineProperty(t,"IconsButton",{enumerable:!0,get:function(){return ie(d).default}});var p=n(520);Object.defineProperty(t,"ErrorBoundary",{enumerable:!0,get:function(){return ie(p).default}});var h=n(170);Object.defineProperty(t,"Heading",{enumerable:!0,get:function(){return ie(h).default}});var g=n(539);Object.defineProperty(t,"HelpCenterButton",{enumerable:!0,get:function(){return g.HelpCenterButton}});var y=n(540);Object.defineProperty(t,"HelpText",{enumerable:!0,get:function(){return ie(y).default}});var m=n(541);Object.defineProperty(t,"Icon",{enumerable:!0,get:function(){return ie(m).default}});var v=n(542);Object.defineProperty(t,"IconButtonToggle",{enumerable:!0,get:function(){return ie(v).default}});var b=n(264);Object.defineProperty(t,"IFrame",{enumerable:!0,get:function(){return ie(b).default}});var _=n(265);Object.defineProperty(t,"Input",{enumerable:!0,get:function(){return ie(_).default}});var x=n(543);Object.defineProperty(t,"KeywordSuggestions",{enumerable:!0,get:function(){return ie(x).default}});var w=n(269);Object.defineProperty(t,"Label",{enumerable:!0,get:function(){return ie(w).default}});var C=n(548);Object.defineProperty(t,"LanguageNotice",{enumerable:!0,get:function(){return ie(C).default}}),Object.defineProperty(t,"languageNoticePropType",{enumerable:!0,get:function(){return C.languageNoticePropType}});var k=n(549);Object.defineProperty(t,"Loader",{enumerable:!0,get:function(){return ie(k).default}});var S=n(550);Object.defineProperty(t,"MultiStepProgress",{enumerable:!0,get:function(){return ie(S).default}});var O=n(551);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return ie(O).default}});var E=n(270);Object.defineProperty(t,"Paper",{enumerable:!0,get:function(){return ie(E).default}});var T=n(552);Object.defineProperty(t,"ProgressBar",{enumerable:!0,get:function(){return ie(T).default}});var P=n(271);Object.defineProperty(t,"Section",{enumerable:!0,get:function(){return ie(P).default}});var j=n(256);Object.defineProperty(t,"SectionTitle",{enumerable:!0,get:function(){return j.SectionTitle}});var M=n(553);Object.defineProperty(t,"ScoreAssessments",{enumerable:!0,get:function(){return ie(M).default}});var I=n(554);Object.defineProperty(t,"StackedProgressBar",{enumerable:!0,get:function(){return ie(I).default}});var R=n(52);Object.defineProperty(t,"SvgIcon",{enumerable:!0,get:function(){return ie(R).default}}),Object.defineProperty(t,"icons",{enumerable:!0,get:function(){return R.icons}});var N=n(555);Object.defineProperty(t,"SynonymsInput",{enumerable:!0,get:function(){return ie(N).default}});var A=n(273);Object.defineProperty(t,"Textarea",{enumerable:!0,get:function(){return ie(A).default}});var B=n(558);Object.defineProperty(t,"Textfield",{enumerable:!0,get:function(){return ie(B).default}});var L=n(559);Object.defineProperty(t,"Toggle",{enumerable:!0,get:function(){return ie(L).default}});var D=n(560);Object.defineProperty(t,"UpsellButton",{enumerable:!0,get:function(){return D.UpsellButton}});var q=n(561);Object.defineProperty(t,"UpsellLinkButton",{enumerable:!0,get:function(){return q.UpsellLinkButton}});var z=n(124);Object.defineProperty(t,"YoastButton",{enumerable:!0,get:function(){return z.YoastButton}});var $=n(272);Object.defineProperty(t,"InputField",{enumerable:!0,get:function(){return $.InputField}});var F=n(562);Object.defineProperty(t,"YoastLinkButton",{enumerable:!0,get:function(){return F.YoastLinkButton}});var W=n(563);Object.defineProperty(t,"Logo",{enumerable:!0,get:function(){return ie(W).default}});var U=n(564);Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return ie(U).default}});var K=n(575);Object.defineProperty(t,"YoastSeoIcon",{enumerable:!0,get:function(){return ie(K).default}});var H=n(576);Object.defineProperty(t,"Tabs",{enumerable:!0,get:function(){return ie(H).default}});var V=n(579);Object.defineProperty(t,"Warning",{enumerable:!0,get:function(){return ie(V).default}});var Y=n(580);Object.defineProperty(t,"YouTubeVideo",{enumerable:!0,get:function(){return ie(Y).default}});var G=n(267);Object.defineProperty(t,"WordList",{enumerable:!0,get:function(){return ie(G).default}});var X=n(268);Object.defineProperty(t,"WordOccurrences",{enumerable:!0,get:function(){return ie(X).default}});var J=n(581);Object.defineProperty(t,"Checkbox",{enumerable:!0,get:function(){return ie(J).default}});var Q=n(582);Object.defineProperty(t,"ListTable",{enumerable:!0,get:function(){return Q.ListTable}}),Object.defineProperty(t,"ZebrafiedListTable",{enumerable:!0,get:function(){return Q.ZebrafiedListTable}});var Z=n(583);Object.defineProperty(t,"Row",{enumerable:!0,get:function(){return Z.Row}});var ee=n(257);Object.defineProperty(t,"ScreenReaderText",{enumerable:!0,get:function(){return ie(ee).default}});var te=n(584);Object.defineProperty(t,"ScreenReaderShortcut",{enumerable:!0,get:function(){return ie(te).default}});var ne=n(585),re=ie(ne),oe=n(586);function ie(e){return e&&e.__esModule?e:{default:e}}t.StyledSection=re.default,t.StyledSectionBase=ne.StyledSectionBase,t.StyledHeading=ne.StyledHeading,t.LinkButton=oe.LinkButton},function(e,t,n){var r=n(231),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(183)("wks"),o=n(127),i=n(61).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={easeOutFunction:"cubic-bezier(0.23, 1, 0.32, 1)",easeInOutFunction:"cubic-bezier(0.445, 0.05, 0.55, 0.95)",easeOut:function(e,t,n,r){if(r=r||this.easeOutFunction,t&&"[object Array]"===Object.prototype.toString.call(t)){for(var o="",i=0;i<t.length;i++)o&&(o+=","),o+=this.create(e,t[i],n,r);return o}return this.create(e,t,n,r)},create:function(e,t,n,r){return e=e||"450ms",t=t||"all",n=n||"0ms",t+" "+e+" "+(r=r||"linear")+" "+n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenReaderShortcut=t.ScreenReaderText=t.Row=t.ZebrafiedListTable=t.ListTable=t.Checkbox=t.WordOccurrences=t.WordList=t.YouTubeVideo=t.Warning=t.Tabs=t.YoastSeoIcon=t.Modal=t.Logo=t.YoastLinkButton=t.InputField=t.YoastButton=t.UpsellLinkButton=t.UpsellButton=t.Toggle=t.Textfield=t.Textarea=t.SynonymsInput=t.icons=t.SvgIcon=t.StackedProgressBar=t.ScoreAssessments=t.SectionTitle=t.Section=t.ProgressBar=t.Paper=t.Notification=t.MultiStepProgress=t.Loader=t.languageNoticePropType=t.LanguageNotice=t.Label=t.KeywordSuggestions=t.Input=t.IFrame=t.IconButtonToggle=t.Icon=t.HelpText=t.HelpCenterButton=t.Heading=t.ErrorBoundary=t.IconsButton=t.IconButton=t.IconLabeledButton=t.CourseDetails=t.CardBanner=t.FullHeightCard=t.Card=t.ArticleList=t.Alert=t.wrapInHeading=t.StyledContainerTopLevel=t.StyledContainer=t.StyledIconsButton=t.CollapsibleStateless=t.Collapsible=t.addButtonStyles=t.addBaseStyle=t.addFocusStyle=t.addActiveStyle=t.addHoverStyle=t.BaseButton=t.Button=t.LinkButton=t.StyledHeading=t.StyledSectionBase=t.StyledSection=void 0;var r=n(89);Object.defineProperty(t,"Button",{enumerable:!0,get:function(){return ie(r).default}}),Object.defineProperty(t,"BaseButton",{enumerable:!0,get:function(){return r.BaseButton}}),Object.defineProperty(t,"addHoverStyle",{enumerable:!0,get:function(){return r.addHoverStyle}}),Object.defineProperty(t,"addActiveStyle",{enumerable:!0,get:function(){return r.addActiveStyle}}),Object.defineProperty(t,"addFocusStyle",{enumerable:!0,get:function(){return r.addFocusStyle}}),Object.defineProperty(t,"addBaseStyle",{enumerable:!0,get:function(){return r.addBaseStyle}}),Object.defineProperty(t,"addButtonStyles",{enumerable:!0,get:function(){return r.addButtonStyles}});var o=n(742);Object.defineProperty(t,"Collapsible",{enumerable:!0,get:function(){return ie(o).default}}),Object.defineProperty(t,"CollapsibleStateless",{enumerable:!0,get:function(){return o.CollapsibleStateless}}),Object.defineProperty(t,"StyledIconsButton",{enumerable:!0,get:function(){return o.StyledIconsButton}}),Object.defineProperty(t,"StyledContainer",{enumerable:!0,get:function(){return o.StyledContainer}}),Object.defineProperty(t,"StyledContainerTopLevel",{enumerable:!0,get:function(){return o.StyledContainerTopLevel}}),Object.defineProperty(t,"wrapInHeading",{enumerable:!0,get:function(){return o.wrapInHeading}});var i=n(743);Object.defineProperty(t,"Alert",{enumerable:!0,get:function(){return ie(i).default}});var a=n(744);Object.defineProperty(t,"ArticleList",{enumerable:!0,get:function(){return ie(a).default}});var l=n(745);Object.defineProperty(t,"Card",{enumerable:!0,get:function(){return ie(l).default}}),Object.defineProperty(t,"FullHeightCard",{enumerable:!0,get:function(){return l.FullHeightCard}});var u=n(318);Object.defineProperty(t,"CardBanner",{enumerable:!0,get:function(){return ie(u).default}});var s=n(746);Object.defineProperty(t,"CourseDetails",{enumerable:!0,get:function(){return ie(s).default}});var c=n(747);Object.defineProperty(t,"IconLabeledButton",{enumerable:!0,get:function(){return ie(c).default}});var f=n(748);Object.defineProperty(t,"IconButton",{enumerable:!0,get:function(){return ie(f).default}});var d=n(317);Object.defineProperty(t,"IconsButton",{enumerable:!0,get:function(){return ie(d).default}});var p=n(749);Object.defineProperty(t,"ErrorBoundary",{enumerable:!0,get:function(){return ie(p).default}});var h=n(201);Object.defineProperty(t,"Heading",{enumerable:!0,get:function(){return ie(h).default}});var g=n(750);Object.defineProperty(t,"HelpCenterButton",{enumerable:!0,get:function(){return g.HelpCenterButton}});var y=n(751);Object.defineProperty(t,"HelpText",{enumerable:!0,get:function(){return ie(y).default}});var m=n(752);Object.defineProperty(t,"Icon",{enumerable:!0,get:function(){return ie(m).default}});var v=n(753);Object.defineProperty(t,"IconButtonToggle",{enumerable:!0,get:function(){return ie(v).default}});var b=n(319);Object.defineProperty(t,"IFrame",{enumerable:!0,get:function(){return ie(b).default}});var _=n(320);Object.defineProperty(t,"Input",{enumerable:!0,get:function(){return ie(_).default}});var x=n(754);Object.defineProperty(t,"KeywordSuggestions",{enumerable:!0,get:function(){return ie(x).default}});var w=n(323);Object.defineProperty(t,"Label",{enumerable:!0,get:function(){return ie(w).default}});var C=n(755);Object.defineProperty(t,"LanguageNotice",{enumerable:!0,get:function(){return ie(C).default}}),Object.defineProperty(t,"languageNoticePropType",{enumerable:!0,get:function(){return C.languageNoticePropType}});var k=n(756);Object.defineProperty(t,"Loader",{enumerable:!0,get:function(){return ie(k).default}});var S=n(757);Object.defineProperty(t,"MultiStepProgress",{enumerable:!0,get:function(){return ie(S).default}});var O=n(758);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return ie(O).default}});var E=n(324);Object.defineProperty(t,"Paper",{enumerable:!0,get:function(){return ie(E).default}});var T=n(759);Object.defineProperty(t,"ProgressBar",{enumerable:!0,get:function(){return ie(T).default}});var P=n(325);Object.defineProperty(t,"Section",{enumerable:!0,get:function(){return ie(P).default}});var j=n(314);Object.defineProperty(t,"SectionTitle",{enumerable:!0,get:function(){return j.SectionTitle}});var M=n(760);Object.defineProperty(t,"ScoreAssessments",{enumerable:!0,get:function(){return ie(M).default}});var I=n(761);Object.defineProperty(t,"StackedProgressBar",{enumerable:!0,get:function(){return ie(I).default}});var R=n(54);Object.defineProperty(t,"SvgIcon",{enumerable:!0,get:function(){return ie(R).default}}),Object.defineProperty(t,"icons",{enumerable:!0,get:function(){return R.icons}});var N=n(762);Object.defineProperty(t,"SynonymsInput",{enumerable:!0,get:function(){return ie(N).default}});var A=n(327);Object.defineProperty(t,"Textarea",{enumerable:!0,get:function(){return ie(A).default}});var B=n(765);Object.defineProperty(t,"Textfield",{enumerable:!0,get:function(){return ie(B).default}});var L=n(766);Object.defineProperty(t,"Toggle",{enumerable:!0,get:function(){return ie(L).default}});var D=n(767);Object.defineProperty(t,"UpsellButton",{enumerable:!0,get:function(){return D.UpsellButton}});var q=n(768);Object.defineProperty(t,"UpsellLinkButton",{enumerable:!0,get:function(){return q.UpsellLinkButton}});var z=n(132);Object.defineProperty(t,"YoastButton",{enumerable:!0,get:function(){return z.YoastButton}});var $=n(326);Object.defineProperty(t,"InputField",{enumerable:!0,get:function(){return $.InputField}});var F=n(769);Object.defineProperty(t,"YoastLinkButton",{enumerable:!0,get:function(){return F.YoastLinkButton}});var W=n(770);Object.defineProperty(t,"Logo",{enumerable:!0,get:function(){return ie(W).default}});var U=n(771);Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return ie(U).default}});var K=n(772);Object.defineProperty(t,"YoastSeoIcon",{enumerable:!0,get:function(){return ie(K).default}});var H=n(773);Object.defineProperty(t,"Tabs",{enumerable:!0,get:function(){return ie(H).default}});var V=n(774);Object.defineProperty(t,"Warning",{enumerable:!0,get:function(){return ie(V).default}});var Y=n(775);Object.defineProperty(t,"YouTubeVideo",{enumerable:!0,get:function(){return ie(Y).default}});var G=n(321);Object.defineProperty(t,"WordList",{enumerable:!0,get:function(){return ie(G).default}});var X=n(322);Object.defineProperty(t,"WordOccurrences",{enumerable:!0,get:function(){return ie(X).default}});var J=n(776);Object.defineProperty(t,"Checkbox",{enumerable:!0,get:function(){return ie(J).default}});var Q=n(777);Object.defineProperty(t,"ListTable",{enumerable:!0,get:function(){return Q.ListTable}}),Object.defineProperty(t,"ZebrafiedListTable",{enumerable:!0,get:function(){return Q.ZebrafiedListTable}});var Z=n(778);Object.defineProperty(t,"Row",{enumerable:!0,get:function(){return Z.Row}});var ee=n(315);Object.defineProperty(t,"ScreenReaderText",{enumerable:!0,get:function(){return ie(ee).default}});var te=n(779);Object.defineProperty(t,"ScreenReaderShortcut",{enumerable:!0,get:function(){return ie(te).default}});var ne=n(780),re=ie(ne),oe=n(781);function ie(e){return e&&e.__esModule?e:{default:e}}t.StyledSection=re.default,t.StyledSectionBase=ne.StyledSectionBase,t.StyledHeading=ne.StyledHeading,t.LinkButton=oe.LinkButton},function(e,t,n){"use strict";e.exports=function(e){if(null!=e)return e;throw new Error("Got unexpected null or undefined")}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.icons=void 0;var r=a(n(0)),o=a(n(1)),i=n(35);function a(e){return e&&e.__esModule?e:{default:e}}var l=o.default.svg.withConfig({displayName:"SvgIcon__StyledSvgSpinner",componentId:"w0wn5g-0"})(["width:",";height:",";flex:none;animation:loadingSpinnerRotator 1.4s linear infinite;& .path{stroke:",";stroke-dasharray:187;stroke-dashoffset:0;transform-origin:center;animation:loadingSpinnerDash 1.4s ease-in-out infinite;}@keyframes loadingSpinnerRotator{0%{transform:rotate( 0deg );}100%{transform:rotate( 270deg );}}@keyframes loadingSpinnerDash{0%{stroke-dashoffset:187;}50%{stroke-dashoffset:47;transform:rotate( 135deg );}100%{stroke-dashoffset:187;transform:rotate( 450deg );}}"],function(e){return e.size},function(e){return e.size},function(e){return e.fill}),u=t.icons={"chevron-down":{viewbox:"0 0 24 24",width:"24px",path:[r.default.createElement("g",{key:"1"},r.default.createElement("path",{fill:"none",d:"M0,0h24v24H0V0z"})),r.default.createElement("g",{key:"2"},r.default.createElement("path",{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))]},"chevron-up":{viewbox:"0 0 24 24",width:"24px",path:[r.default.createElement("g",{key:"1"},r.default.createElement("path",{fill:"none",d:"M0,0h24v24H0V0z"})),r.default.createElement("g",{key:"2"},r.default.createElement("path",{d:"M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"}))]},clipboard:{viewbox:"0 0 1792 1792",path:"M768 1664h896v-640h-416q-40 0-68-28t-28-68v-416h-384v1152zm256-1440v-64q0-13-9.5-22.5t-22.5-9.5h-704q-13 0-22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h704q13 0 22.5-9.5t9.5-22.5zm256 672h299l-299-299v299zm512 128v672q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-160h-544q-40 0-68-28t-28-68v-1344q0-40 28-68t68-28h1088q40 0 68 28t28 68v328q21 13 36 28l408 408q28 28 48 76t20 88z"},check:{viewbox:"0 0 1792 1792",path:"M249.2,431.2c-23,0-45.6,9.4-61.8,25.6L25.6,618.6C9.4,634.8,0,657.4,0,680.4c0,23,9.4,45.6,25.6,61.8 l593.1,593.1c16.2,16.2,38.8,25.6,61.8,25.6c23,0,45.6-9.4,61.8-25.6L1766.4,311c16.2-16.2,25.6-38.8,25.6-61.8 s-9.4-45.6-25.6-61.8L1604.5,25.6C1588.3,9.4,1565.8,0,1542.8,0c-23,0-45.6,9.4-61.8,25.6L680.4,827L311,456.3 C294.8,440.5,272.3,431.2,249.2,431.2z"},"angle-down":{viewbox:"0 0 1792 1792",path:"M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z"},"angle-left":{viewbox:"0 0 1792 1792",path:"M1203 544q0 13-10 23l-393 393 393 393q10 10 10 23t-10 23l-50 50q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l50 50q10 10 10 23z"},"angle-right":{viewbox:"0 0 1792 1792",path:"M1171 960q0 13-10 23l-466 466q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l393-393-393-393q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l466 466q10 10 10 23z"},"angle-up":{viewbox:"0 0 1792 1792",path:"M1395 1184q0 13-10 23l-50 50q-10 10-23 10t-23-10l-393-393-393 393q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l466 466q10 10 10 23z"},"arrow-down":{viewbox:"0 0 1792 1792",path:"M896 1791L120.91 448.5L1671.09 448.5z"},"arrow-left":{viewbox:"0 0 1792 1792",path:"M1343.5 1671.09L1 896L1343.5 120.91z"},"arrow-right":{viewbox:"0 0 1792 1792",path:"M1791 896L448.5 1671.09L448.5 120.91z"},"arrow-up":{viewbox:"0 0 1792 1792",path:"M1671.09 1343.5L120.91 1343.5L896 1z"},"caret-right":{viewbox:"0 0 192 512",path:"M 0 384.662 V 127.338 c 0 -17.818 21.543 -26.741 34.142 -14.142 l 128.662 128.662 c 7.81 7.81 7.81 20.474 0 28.284 L 34.142 398.804 C 21.543 411.404 0 402.48 0 384.662 Z"},circle:{viewbox:"0 0 1792 1792",path:"M1664 896q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"},desktop:{viewbox:"0 0 1792 1792",path:"M1728 992v-832q0-13-9.5-22.5t-22.5-9.5h-1600q-13 0-22.5 9.5t-9.5 22.5v832q0 13 9.5 22.5t22.5 9.5h1600q13 0 22.5-9.5t9.5-22.5zm128-832v1088q0 66-47 113t-113 47h-544q0 37 16 77.5t32 71 16 43.5q0 26-19 45t-45 19h-512q-26 0-45-19t-19-45q0-14 16-44t32-70 16-78h-544q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1600q66 0 113 47t47 113z"},edit:{viewbox:"0 0 1792 1792",path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z"},eye:{viewbox:"0 0 1792 1792",path:"M1664 960q-152-236-381-353 61 104 61 225 0 185-131.5 316.5t-316.5 131.5-316.5-131.5-131.5-316.5q0-121 61-225-229 117-381 353 133 205 333.5 326.5t434.5 121.5 434.5-121.5 333.5-326.5zm-720-384q0-20-14-34t-34-14q-125 0-214.5 89.5t-89.5 214.5q0 20 14 34t34 14 34-14 14-34q0-86 61-147t147-61q20 0 34-14t14-34zm848 384q0 34-20 69-140 230-376.5 368.5t-499.5 138.5-499.5-139-376.5-368q-20-35-20-69t20-69q140-229 376.5-368t499.5-139 499.5 139 376.5 368q20 35 20 69z"},"exclamation-triangle":{viewbox:"0 0 1792 1792",path:"M1024 1375v-190q0-14-9.5-23.5T992 1152H800q-13 0-22.5 9.5T768 1185v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11H786q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17H128q-34 0-63.5-17T18 1601q-37-63-2-126L784 67q17-31 47-49t65-18 65 18 47 49z"},"file-text":{viewbox:"0 0 1792 1792",path:"M1596 380q28 28 48 76t20 88v1152q0 40-28 68t-68 28h-1344q-40 0-68-28t-28-68v-1600q0-40 28-68t68-28h896q40 0 88 20t76 48zm-444-244v376h376q-10-29-22-41l-313-313q-12-12-41-22zm384 1528v-1024h-416q-40 0-68-28t-28-68v-416h-768v1536h1280zm-1024-864q0-14 9-23t23-9h704q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64zm736 224q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704zm0 256q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704z"},gear:{viewbox:"0 0 1792 1792",path:"M1800 800h-218q-26 -107 -81 -193l154 -154l-210 -210l-154 154q-88 -55 -191 -79v-218h-300v218q-103 24 -191 79l-154 -154l-212 212l154 154q-55 88 -79 191h-218v297h217q23 101 80 194l-154 154l210 210l154 -154q85 54 193 81v218h300v-218q103 -24 191 -79 l154 154l212 -212l-154 -154q57 -93 80 -194h217v-297zM950 650q124 0 212 88t88 212t-88 212t-212 88t-212 -88t-88 -212t88 -212t212 -88z"},key:{viewbox:"0 0 1792 1792",path:"M832 512q0-80-56-136t-136-56-136 56-56 136q0 42 19 83-41-19-83-19-80 0-136 56t-56 136 56 136 136 56 136-56 56-136q0-42-19-83 41 19 83 19 80 0 136-56t56-136zm851 704q0 17-49 66t-66 49q-9 0-28.5-16t-36.5-33-38.5-40-24.5-26l-96 96 220 220q28 28 28 68 0 42-39 81t-81 39q-40 0-68-28l-671-671q-176 131-365 131-163 0-265.5-102.5t-102.5-265.5q0-160 95-313t248-248 313-95q163 0 265.5 102.5t102.5 265.5q0 189-131 365l355 355 96-96q-3-3-26-24.5t-40-38.5-33-36.5-16-28.5q0-17 49-66t66-49q13 0 23 10 6 6 46 44.5t82 79.5 86.5 86 73 78 28.5 41z"},list:{viewbox:"0 0 1792 1792",path:"M384 1408q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm0-512q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm1408 416v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5zm-1408-928q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm1408 416v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5zm0-512v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5z"},"loading-spinner":{viewbox:"0 0 66 66",CustomComponent:l,path:[r.default.createElement("circle",{key:"5",className:"path",fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})]},mobile:{viewbox:"0 0 1792 1792",path:"M976 1408q0-33-23.5-56.5t-56.5-23.5-56.5 23.5-23.5 56.5 23.5 56.5 56.5 23.5 56.5-23.5 23.5-56.5zm208-160v-704q0-13-9.5-22.5t-22.5-9.5h-512q-13 0-22.5 9.5t-9.5 22.5v704q0 13 9.5 22.5t22.5 9.5h512q13 0 22.5-9.5t9.5-22.5zm-192-848q0-16-16-16h-160q-16 0-16 16t16 16h160q16 0 16-16zm288-16v1024q0 52-38 90t-90 38h-512q-52 0-90-38t-38-90v-1024q0-52 38-90t90-38h512q52 0 90 38t38 90z"},"pencil-square":{viewbox:"0 0 1792 1792",path:"M888 1184l116-116-152-152-116 116v56h96v96h56zm440-720q-16-16-33 1l-350 350q-17 17-1 33t33-1l350-350q17-17 1-33zm80 594v190q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q63 0 117 25 15 7 18 23 3 17-9 29l-49 49q-14 14-32 8-23-6-45-6h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-126q0-13 9-22l64-64q15-15 35-7t20 29zm-96-738l288 288-672 672h-288v-288zm444 132l-92 92-288-288 92-92q28-28 68-28t68 28l152 152q28 28 28 68t-28 68z"},plus:{viewbox:"0 0 1792 1792",path:"M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"},"plus-circle":{viewbox:"0 0 1792 1792",path:"M1344 960v-128q0-26-19-45t-45-19h-256v-256q0-26-19-45t-45-19h-128q-26 0-45 19t-19 45v256h-256q-26 0-45 19t-19 45v128q0 26 19 45t45 19h256v256q0 26 19 45t45 19h128q26 0 45-19t19-45v-256h256q26 0 45-19t19-45zm320-64q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"},"question-circle":{viewbox:"0 0 1792 1792",path:"M1024 1376v-192q0-14-9-23t-23-9h-192q-14 0-23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23-9t9-23zm256-672q0-88-55.5-163t-138.5-116-170-41q-243 0-371 213-15 24 8 42l132 100q7 6 19 6 16 0 25-12 53-68 86-92 34-24 86-24 48 0 85.5 26t37.5 59q0 38-20 61t-68 45q-63 28-115.5 86.5t-52.5 125.5v36q0 14 9 23t23 9h192q14 0 23-9t9-23q0-19 21.5-49.5t54.5-49.5q32-18 49-28.5t46-35 44.5-48 28-60.5 12.5-81zm384 192q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"},search:{viewbox:"0 0 1792 1792",path:"M1216 832q0-185-131.5-316.5t-316.5-131.5-316.5 131.5-131.5 316.5 131.5 316.5 316.5 131.5 316.5-131.5 131.5-316.5zm512 832q0 52-38 90t-90 38q-54 0-90-38l-343-342q-179 124-399 124-143 0-273.5-55.5t-225-150-150-225-55.5-273.5 55.5-273.5 150-225 225-150 273.5-55.5 273.5 55.5 225 150 150 225 55.5 273.5q0 220-124 399l343 343q37 37 37 90z"},"seo-score-bad":{viewbox:"0 0 496 512",path:"M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8z M328 176c17.7 0 32 14.3 32 32 s-14.3 32-32 32s-32-14.3-32-32S310.3 176 328 176z M168 176c17.7 0 32 14.3 32 32s-14.3 32-32 32s-32-14.3-32-32S150.3 176 168 176 z M338.2 394.2C315.8 367.4 282.9 352 248 352s-67.8 15.4-90.2 42.2c-13.5 16.3-38.1-4.2-24.6-20.5C161.7 339.6 203.6 320 248 320 s86.3 19.6 114.7 53.8C376.3 390 351.7 410.5 338.2 394.2L338.2 394.2z"},"seo-score-good":{viewbox:"0 0 496 512",path:"M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8z M328 176c17.7 0 32 14.3 32 32 s-14.3 32-32 32s-32-14.3-32-32S310.3 176 328 176z M168 176c17.7 0 32 14.3 32 32s-14.3 32-32 32s-32-14.3-32-32S150.3 176 168 176 z M362.8 346.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5c22.4 26.9 55.2 42.2 90.2 42.2 s67.8-15.4 90.2-42.2C351.6 309.5 376.3 329.9 362.8 346.2L362.8 346.2z"},"seo-score-none":{viewbox:"0 0 496 512",path:"M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8z"},"seo-score-ok":{viewbox:"0 0 496 512",path:[r.default.createElement("path",{key:"1",fill:"#000000",d:"M344 336c21.2 0 21.2 32 0 32H152c-21.2 0-21.2-32 0-32H344z"}),r.default.createElement("circle",{key:"2",fill:"#000000",cx:"328",cy:"208",r:"32"}),r.default.createElement("circle",{key:"3",fill:"#000000",cx:"168",cy:"208",r:"32"}),r.default.createElement("path",{key:"4",d:"M248 8c137 0 248 111 248 248S385 504 248 504S0 393 0 256S111 8 248 8z M360 208c0-17.7-14.3-32-32-32 s-32 14.3-32 32s14.3 32 32 32S360 225.7 360 208z M344 368c21.2 0 21.2-32 0-32H152c-21.2 0-21.2 32 0 32H344z M200 208 c0-17.7-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32S200 225.7 200 208z"})]},times:{viewbox:"0 0 1792 1792",path:"M1490 1322q0 40-28 68l-136 136q-28 28-68 28t-68-28l-294-294-294 294q-28 28-68 28t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 294 294-294q28-28 68-28t68 28l136 136q28 28 28 68t-28 68l-294 294 294 294q28 28 28 68z"},"times-circle":{viewbox:"0 0 20 20",path:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm5 11l-3-3 3-3-2-2-3 3-3-3-2 2 3 3-3 3 2 2 3-3 3 3z"},"alert-info":{viewbox:"0 0 512 512",path:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},"alert-error":{viewbox:"0 0 512 512",path:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"},"alert-success":{viewbox:"0 0 512 512",path:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},"alert-warning":{viewbox:"0 0 576 512",path:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}};t.default=(0,i.createSvgIconComponent)(u)},function(e,t,n){e.exports=n(589)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.icons=void 0;var r=a(n(0)),o=a(n(1)),i=n(30);function a(e){return e&&e.__esModule?e:{default:e}}var l=o.default.svg.withConfig({displayName:"SvgIcon__StyledSvgSpinner",componentId:"w0wn5g-0"})(["width:",";height:",";flex:none;animation:loadingSpinnerRotator 1.4s linear infinite;& .path{stroke:",";stroke-dasharray:187;stroke-dashoffset:0;transform-origin:center;animation:loadingSpinnerDash 1.4s ease-in-out infinite;}@keyframes loadingSpinnerRotator{0%{transform:rotate( 0deg );}100%{transform:rotate( 270deg );}}@keyframes loadingSpinnerDash{0%{stroke-dashoffset:187;}50%{stroke-dashoffset:47;transform:rotate( 135deg );}100%{stroke-dashoffset:187;transform:rotate( 450deg );}}"],function(e){return e.size},function(e){return e.size},function(e){return e.fill}),u=t.icons={"chevron-down":{viewbox:"0 0 24 24",width:"24px",path:[r.default.createElement("g",{key:"1"},r.default.createElement("path",{fill:"none",d:"M0,0h24v24H0V0z"})),r.default.createElement("g",{key:"2"},r.default.createElement("path",{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))]},"chevron-up":{viewbox:"0 0 24 24",width:"24px",path:[r.default.createElement("g",{key:"1"},r.default.createElement("path",{fill:"none",d:"M0,0h24v24H0V0z"})),r.default.createElement("g",{key:"2"},r.default.createElement("path",{d:"M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"}))]},clipboard:{viewbox:"0 0 1792 1792",path:"M768 1664h896v-640h-416q-40 0-68-28t-28-68v-416h-384v1152zm256-1440v-64q0-13-9.5-22.5t-22.5-9.5h-704q-13 0-22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h704q13 0 22.5-9.5t9.5-22.5zm256 672h299l-299-299v299zm512 128v672q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-160h-544q-40 0-68-28t-28-68v-1344q0-40 28-68t68-28h1088q40 0 68 28t28 68v328q21 13 36 28l408 408q28 28 48 76t20 88z"},check:{viewbox:"0 0 1792 1792",path:"M249.2,431.2c-23,0-45.6,9.4-61.8,25.6L25.6,618.6C9.4,634.8,0,657.4,0,680.4c0,23,9.4,45.6,25.6,61.8 l593.1,593.1c16.2,16.2,38.8,25.6,61.8,25.6c23,0,45.6-9.4,61.8-25.6L1766.4,311c16.2-16.2,25.6-38.8,25.6-61.8 s-9.4-45.6-25.6-61.8L1604.5,25.6C1588.3,9.4,1565.8,0,1542.8,0c-23,0-45.6,9.4-61.8,25.6L680.4,827L311,456.3 C294.8,440.5,272.3,431.2,249.2,431.2z"},"angle-down":{viewbox:"0 0 1792 1792",path:"M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z"},"angle-left":{viewbox:"0 0 1792 1792",path:"M1203 544q0 13-10 23l-393 393 393 393q10 10 10 23t-10 23l-50 50q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l50 50q10 10 10 23z"},"angle-right":{viewbox:"0 0 1792 1792",path:"M1171 960q0 13-10 23l-466 466q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l393-393-393-393q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l466 466q10 10 10 23z"},"angle-up":{viewbox:"0 0 1792 1792",path:"M1395 1184q0 13-10 23l-50 50q-10 10-23 10t-23-10l-393-393-393 393q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l466 466q10 10 10 23z"},"arrow-down":{viewbox:"0 0 1792 1792",path:"M896 1791L120.91 448.5L1671.09 448.5z"},"arrow-left":{viewbox:"0 0 1792 1792",path:"M1343.5 1671.09L1 896L1343.5 120.91z"},"arrow-right":{viewbox:"0 0 1792 1792",path:"M1791 896L448.5 1671.09L448.5 120.91z"},"arrow-up":{viewbox:"0 0 1792 1792",path:"M1671.09 1343.5L120.91 1343.5L896 1z"},"caret-right":{viewbox:"0 0 192 512",path:"M 0 384.662 V 127.338 c 0 -17.818 21.543 -26.741 34.142 -14.142 l 128.662 128.662 c 7.81 7.81 7.81 20.474 0 28.284 L 34.142 398.804 C 21.543 411.404 0 402.48 0 384.662 Z"},circle:{viewbox:"0 0 1792 1792",path:"M1664 896q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"},desktop:{viewbox:"0 0 1792 1792",path:"M1728 992v-832q0-13-9.5-22.5t-22.5-9.5h-1600q-13 0-22.5 9.5t-9.5 22.5v832q0 13 9.5 22.5t22.5 9.5h1600q13 0 22.5-9.5t9.5-22.5zm128-832v1088q0 66-47 113t-113 47h-544q0 37 16 77.5t32 71 16 43.5q0 26-19 45t-45 19h-512q-26 0-45-19t-19-45q0-14 16-44t32-70 16-78h-544q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1600q66 0 113 47t47 113z"},edit:{viewbox:"0 0 1792 1792",path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z"},eye:{viewbox:"0 0 1792 1792",path:"M1664 960q-152-236-381-353 61 104 61 225 0 185-131.5 316.5t-316.5 131.5-316.5-131.5-131.5-316.5q0-121 61-225-229 117-381 353 133 205 333.5 326.5t434.5 121.5 434.5-121.5 333.5-326.5zm-720-384q0-20-14-34t-34-14q-125 0-214.5 89.5t-89.5 214.5q0 20 14 34t34 14 34-14 14-34q0-86 61-147t147-61q20 0 34-14t14-34zm848 384q0 34-20 69-140 230-376.5 368.5t-499.5 138.5-499.5-139-376.5-368q-20-35-20-69t20-69q140-229 376.5-368t499.5-139 499.5 139 376.5 368q20 35 20 69z"},"exclamation-triangle":{viewbox:"0 0 1792 1792",path:"M1024 1375v-190q0-14-9.5-23.5T992 1152H800q-13 0-22.5 9.5T768 1185v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11H786q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17H128q-34 0-63.5-17T18 1601q-37-63-2-126L784 67q17-31 47-49t65-18 65 18 47 49z"},"file-text":{viewbox:"0 0 1792 1792",path:"M1596 380q28 28 48 76t20 88v1152q0 40-28 68t-68 28h-1344q-40 0-68-28t-28-68v-1600q0-40 28-68t68-28h896q40 0 88 20t76 48zm-444-244v376h376q-10-29-22-41l-313-313q-12-12-41-22zm384 1528v-1024h-416q-40 0-68-28t-28-68v-416h-768v1536h1280zm-1024-864q0-14 9-23t23-9h704q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64zm736 224q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704zm0 256q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704z"},gear:{viewbox:"0 0 1792 1792",path:"M1800 800h-218q-26 -107 -81 -193l154 -154l-210 -210l-154 154q-88 -55 -191 -79v-218h-300v218q-103 24 -191 79l-154 -154l-212 212l154 154q-55 88 -79 191h-218v297h217q23 101 80 194l-154 154l210 210l154 -154q85 54 193 81v218h300v-218q103 -24 191 -79 l154 154l212 -212l-154 -154q57 -93 80 -194h217v-297zM950 650q124 0 212 88t88 212t-88 212t-212 88t-212 -88t-88 -212t88 -212t212 -88z"},key:{viewbox:"0 0 1792 1792",path:"M832 512q0-80-56-136t-136-56-136 56-56 136q0 42 19 83-41-19-83-19-80 0-136 56t-56 136 56 136 136 56 136-56 56-136q0-42-19-83 41 19 83 19 80 0 136-56t56-136zm851 704q0 17-49 66t-66 49q-9 0-28.5-16t-36.5-33-38.5-40-24.5-26l-96 96 220 220q28 28 28 68 0 42-39 81t-81 39q-40 0-68-28l-671-671q-176 131-365 131-163 0-265.5-102.5t-102.5-265.5q0-160 95-313t248-248 313-95q163 0 265.5 102.5t102.5 265.5q0 189-131 365l355 355 96-96q-3-3-26-24.5t-40-38.5-33-36.5-16-28.5q0-17 49-66t66-49q13 0 23 10 6 6 46 44.5t82 79.5 86.5 86 73 78 28.5 41z"},list:{viewbox:"0 0 1792 1792",path:"M384 1408q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm0-512q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm1408 416v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5zm-1408-928q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm1408 416v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5zm0-512v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5z"},"loading-spinner":{viewbox:"0 0 66 66",CustomComponent:l,path:[r.default.createElement("circle",{key:"5",className:"path",fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})]},mobile:{viewbox:"0 0 1792 1792",path:"M976 1408q0-33-23.5-56.5t-56.5-23.5-56.5 23.5-23.5 56.5 23.5 56.5 56.5 23.5 56.5-23.5 23.5-56.5zm208-160v-704q0-13-9.5-22.5t-22.5-9.5h-512q-13 0-22.5 9.5t-9.5 22.5v704q0 13 9.5 22.5t22.5 9.5h512q13 0 22.5-9.5t9.5-22.5zm-192-848q0-16-16-16h-160q-16 0-16 16t16 16h160q16 0 16-16zm288-16v1024q0 52-38 90t-90 38h-512q-52 0-90-38t-38-90v-1024q0-52 38-90t90-38h512q52 0 90 38t38 90z"},"pencil-square":{viewbox:"0 0 1792 1792",path:"M888 1184l116-116-152-152-116 116v56h96v96h56zm440-720q-16-16-33 1l-350 350q-17 17-1 33t33-1l350-350q17-17 1-33zm80 594v190q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q63 0 117 25 15 7 18 23 3 17-9 29l-49 49q-14 14-32 8-23-6-45-6h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-126q0-13 9-22l64-64q15-15 35-7t20 29zm-96-738l288 288-672 672h-288v-288zm444 132l-92 92-288-288 92-92q28-28 68-28t68 28l152 152q28 28 28 68t-28 68z"},plus:{viewbox:"0 0 1792 1792",path:"M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"},"plus-circle":{viewbox:"0 0 1792 1792",path:"M1344 960v-128q0-26-19-45t-45-19h-256v-256q0-26-19-45t-45-19h-128q-26 0-45 19t-19 45v256h-256q-26 0-45 19t-19 45v128q0 26 19 45t45 19h256v256q0 26 19 45t45 19h128q26 0 45-19t19-45v-256h256q26 0 45-19t19-45zm320-64q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"},"question-circle":{viewbox:"0 0 1792 1792",path:"M1024 1376v-192q0-14-9-23t-23-9h-192q-14 0-23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23-9t9-23zm256-672q0-88-55.5-163t-138.5-116-170-41q-243 0-371 213-15 24 8 42l132 100q7 6 19 6 16 0 25-12 53-68 86-92 34-24 86-24 48 0 85.5 26t37.5 59q0 38-20 61t-68 45q-63 28-115.5 86.5t-52.5 125.5v36q0 14 9 23t23 9h192q14 0 23-9t9-23q0-19 21.5-49.5t54.5-49.5q32-18 49-28.5t46-35 44.5-48 28-60.5 12.5-81zm384 192q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"},search:{viewbox:"0 0 1792 1792",path:"M1216 832q0-185-131.5-316.5t-316.5-131.5-316.5 131.5-131.5 316.5 131.5 316.5 316.5 131.5 316.5-131.5 131.5-316.5zm512 832q0 52-38 90t-90 38q-54 0-90-38l-343-342q-179 124-399 124-143 0-273.5-55.5t-225-150-150-225-55.5-273.5 55.5-273.5 150-225 225-150 273.5-55.5 273.5 55.5 225 150 150 225 55.5 273.5q0 220-124 399l343 343q37 37 37 90z"},"seo-score-bad":{viewbox:"0 0 496 512",path:"M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8z M328 176c17.7 0 32 14.3 32 32 s-14.3 32-32 32s-32-14.3-32-32S310.3 176 328 176z M168 176c17.7 0 32 14.3 32 32s-14.3 32-32 32s-32-14.3-32-32S150.3 176 168 176 z M338.2 394.2C315.8 367.4 282.9 352 248 352s-67.8 15.4-90.2 42.2c-13.5 16.3-38.1-4.2-24.6-20.5C161.7 339.6 203.6 320 248 320 s86.3 19.6 114.7 53.8C376.3 390 351.7 410.5 338.2 394.2L338.2 394.2z"},"seo-score-good":{viewbox:"0 0 496 512",path:"M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8z M328 176c17.7 0 32 14.3 32 32 s-14.3 32-32 32s-32-14.3-32-32S310.3 176 328 176z M168 176c17.7 0 32 14.3 32 32s-14.3 32-32 32s-32-14.3-32-32S150.3 176 168 176 z M362.8 346.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5c22.4 26.9 55.2 42.2 90.2 42.2 s67.8-15.4 90.2-42.2C351.6 309.5 376.3 329.9 362.8 346.2L362.8 346.2z"},"seo-score-none":{viewbox:"0 0 496 512",path:"M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8z"},"seo-score-ok":{viewbox:"0 0 496 512",path:[r.default.createElement("path",{key:"1",fill:"#000000",d:"M344 336c21.2 0 21.2 32 0 32H152c-21.2 0-21.2-32 0-32H344z"}),r.default.createElement("circle",{key:"2",fill:"#000000",cx:"328",cy:"208",r:"32"}),r.default.createElement("circle",{key:"3",fill:"#000000",cx:"168",cy:"208",r:"32"}),r.default.createElement("path",{key:"4",d:"M248 8c137 0 248 111 248 248S385 504 248 504S0 393 0 256S111 8 248 8z M360 208c0-17.7-14.3-32-32-32 s-32 14.3-32 32s14.3 32 32 32S360 225.7 360 208z M344 368c21.2 0 21.2-32 0-32H152c-21.2 0-21.2 32 0 32H344z M200 208 c0-17.7-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32S200 225.7 200 208z"})]},times:{viewbox:"0 0 1792 1792",path:"M1490 1322q0 40-28 68l-136 136q-28 28-68 28t-68-28l-294-294-294 294q-28 28-68 28t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 294 294-294q28-28 68-28t68 28l136 136q28 28 28 68t-28 68l-294 294 294 294q28 28 28 68z"},"times-circle":{viewbox:"0 0 20 20",path:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm5 11l-3-3 3-3-2-2-3 3-3-3-2 2 3 3-3 3 2 2 3-3 3 3z"},"alert-info":{viewbox:"0 0 512 512",path:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},"alert-error":{viewbox:"0 0 512 512",path:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"},"alert-success":{viewbox:"0 0 512 512",path:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},"alert-warning":{viewbox:"0 0 576 512",path:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}};t.default=(0,i.createSvgIconComponent)(u)},function(e,t,n){"use strict";var r=n(833),o=n(836),i=n(837),a=n(838);function l(e,t,n,r){if(e===n)return!0;if(!n.startsWith(e))return!1;var i=n.slice(e.length);return!!t&&(i=r?r(i):i,o.contains(i,t))}function u(e){return"Windows"===r.platformName?e.replace(/^\s*NT/,""):e}var s={isBrowser:function(e){return l(r.browserName,r.browserFullVersion,e)},isBrowserArchitecture:function(e){return l(r.browserArchitecture,null,e)},isDevice:function(e){return l(r.deviceName,null,e)},isEngine:function(e){return l(r.engineName,r.engineVersion,e)},isPlatform:function(e){return l(r.platformName,r.platformFullVersion,e,u)},isPlatformArchitecture:function(e){return l(r.platformArchitecture,null,e)}};e.exports=i(s,a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.icons=void 0;var r=a(n(0)),o=a(n(1)),i=n(18);function a(e){return e&&e.__esModule?e:{default:e}}var l=o.default.svg.withConfig({displayName:"SvgIcon__StyledSvgSpinner",componentId:"w0wn5g-0"})(["width:",";height:",";flex:none;animation:loadingSpinnerRotator 1.4s linear infinite;& .path{stroke:",";stroke-dasharray:187;stroke-dashoffset:0;transform-origin:center;animation:loadingSpinnerDash 1.4s ease-in-out infinite;}@keyframes loadingSpinnerRotator{0%{transform:rotate( 0deg );}100%{transform:rotate( 270deg );}}@keyframes loadingSpinnerDash{0%{stroke-dashoffset:187;}50%{stroke-dashoffset:47;transform:rotate( 135deg );}100%{stroke-dashoffset:187;transform:rotate( 450deg );}}"],function(e){return e.size},function(e){return e.size},function(e){return e.fill}),u=t.icons={"chevron-down":{viewbox:"0 0 24 24",width:"24px",path:[r.default.createElement("g",{key:"1"},r.default.createElement("path",{fill:"none",d:"M0,0h24v24H0V0z"})),r.default.createElement("g",{key:"2"},r.default.createElement("path",{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))]},"chevron-up":{viewbox:"0 0 24 24",width:"24px",path:[r.default.createElement("g",{key:"1"},r.default.createElement("path",{fill:"none",d:"M0,0h24v24H0V0z"})),r.default.createElement("g",{key:"2"},r.default.createElement("path",{d:"M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"}))]},clipboard:{viewbox:"0 0 1792 1792",path:"M768 1664h896v-640h-416q-40 0-68-28t-28-68v-416h-384v1152zm256-1440v-64q0-13-9.5-22.5t-22.5-9.5h-704q-13 0-22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h704q13 0 22.5-9.5t9.5-22.5zm256 672h299l-299-299v299zm512 128v672q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-160h-544q-40 0-68-28t-28-68v-1344q0-40 28-68t68-28h1088q40 0 68 28t28 68v328q21 13 36 28l408 408q28 28 48 76t20 88z"},check:{viewbox:"0 0 1792 1792",path:"M249.2,431.2c-23,0-45.6,9.4-61.8,25.6L25.6,618.6C9.4,634.8,0,657.4,0,680.4c0,23,9.4,45.6,25.6,61.8 l593.1,593.1c16.2,16.2,38.8,25.6,61.8,25.6c23,0,45.6-9.4,61.8-25.6L1766.4,311c16.2-16.2,25.6-38.8,25.6-61.8 s-9.4-45.6-25.6-61.8L1604.5,25.6C1588.3,9.4,1565.8,0,1542.8,0c-23,0-45.6,9.4-61.8,25.6L680.4,827L311,456.3 C294.8,440.5,272.3,431.2,249.2,431.2z"},"angle-down":{viewbox:"0 0 1792 1792",path:"M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z"},"angle-left":{viewbox:"0 0 1792 1792",path:"M1203 544q0 13-10 23l-393 393 393 393q10 10 10 23t-10 23l-50 50q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l50 50q10 10 10 23z"},"angle-right":{viewbox:"0 0 1792 1792",path:"M1171 960q0 13-10 23l-466 466q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l393-393-393-393q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l466 466q10 10 10 23z"},"angle-up":{viewbox:"0 0 1792 1792",path:"M1395 1184q0 13-10 23l-50 50q-10 10-23 10t-23-10l-393-393-393 393q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l466 466q10 10 10 23z"},"arrow-down":{viewbox:"0 0 1792 1792",path:"M896 1791L120.91 448.5L1671.09 448.5z"},"arrow-left":{viewbox:"0 0 1792 1792",path:"M1343.5 1671.09L1 896L1343.5 120.91z"},"arrow-right":{viewbox:"0 0 1792 1792",path:"M1791 896L448.5 1671.09L448.5 120.91z"},"arrow-up":{viewbox:"0 0 1792 1792",path:"M1671.09 1343.5L120.91 1343.5L896 1z"},"caret-right":{viewbox:"0 0 192 512",path:"M 0 384.662 V 127.338 c 0 -17.818 21.543 -26.741 34.142 -14.142 l 128.662 128.662 c 7.81 7.81 7.81 20.474 0 28.284 L 34.142 398.804 C 21.543 411.404 0 402.48 0 384.662 Z"},circle:{viewbox:"0 0 1792 1792",path:"M1664 896q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"},desktop:{viewbox:"0 0 1792 1792",path:"M1728 992v-832q0-13-9.5-22.5t-22.5-9.5h-1600q-13 0-22.5 9.5t-9.5 22.5v832q0 13 9.5 22.5t22.5 9.5h1600q13 0 22.5-9.5t9.5-22.5zm128-832v1088q0 66-47 113t-113 47h-544q0 37 16 77.5t32 71 16 43.5q0 26-19 45t-45 19h-512q-26 0-45-19t-19-45q0-14 16-44t32-70 16-78h-544q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1600q66 0 113 47t47 113z"},edit:{viewbox:"0 0 1792 1792",path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z"},eye:{viewbox:"0 0 1792 1792",path:"M1664 960q-152-236-381-353 61 104 61 225 0 185-131.5 316.5t-316.5 131.5-316.5-131.5-131.5-316.5q0-121 61-225-229 117-381 353 133 205 333.5 326.5t434.5 121.5 434.5-121.5 333.5-326.5zm-720-384q0-20-14-34t-34-14q-125 0-214.5 89.5t-89.5 214.5q0 20 14 34t34 14 34-14 14-34q0-86 61-147t147-61q20 0 34-14t14-34zm848 384q0 34-20 69-140 230-376.5 368.5t-499.5 138.5-499.5-139-376.5-368q-20-35-20-69t20-69q140-229 376.5-368t499.5-139 499.5 139 376.5 368q20 35 20 69z"},"exclamation-triangle":{viewbox:"0 0 1792 1792",path:"M1024 1375v-190q0-14-9.5-23.5T992 1152H800q-13 0-22.5 9.5T768 1185v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11H786q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17H128q-34 0-63.5-17T18 1601q-37-63-2-126L784 67q17-31 47-49t65-18 65 18 47 49z"},"file-text":{viewbox:"0 0 1792 1792",path:"M1596 380q28 28 48 76t20 88v1152q0 40-28 68t-68 28h-1344q-40 0-68-28t-28-68v-1600q0-40 28-68t68-28h896q40 0 88 20t76 48zm-444-244v376h376q-10-29-22-41l-313-313q-12-12-41-22zm384 1528v-1024h-416q-40 0-68-28t-28-68v-416h-768v1536h1280zm-1024-864q0-14 9-23t23-9h704q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64zm736 224q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704zm0 256q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704z"},gear:{viewbox:"0 0 1792 1792",path:"M1800 800h-218q-26 -107 -81 -193l154 -154l-210 -210l-154 154q-88 -55 -191 -79v-218h-300v218q-103 24 -191 79l-154 -154l-212 212l154 154q-55 88 -79 191h-218v297h217q23 101 80 194l-154 154l210 210l154 -154q85 54 193 81v218h300v-218q103 -24 191 -79 l154 154l212 -212l-154 -154q57 -93 80 -194h217v-297zM950 650q124 0 212 88t88 212t-88 212t-212 88t-212 -88t-88 -212t88 -212t212 -88z"},key:{viewbox:"0 0 1792 1792",path:"M832 512q0-80-56-136t-136-56-136 56-56 136q0 42 19 83-41-19-83-19-80 0-136 56t-56 136 56 136 136 56 136-56 56-136q0-42-19-83 41 19 83 19 80 0 136-56t56-136zm851 704q0 17-49 66t-66 49q-9 0-28.5-16t-36.5-33-38.5-40-24.5-26l-96 96 220 220q28 28 28 68 0 42-39 81t-81 39q-40 0-68-28l-671-671q-176 131-365 131-163 0-265.5-102.5t-102.5-265.5q0-160 95-313t248-248 313-95q163 0 265.5 102.5t102.5 265.5q0 189-131 365l355 355 96-96q-3-3-26-24.5t-40-38.5-33-36.5-16-28.5q0-17 49-66t66-49q13 0 23 10 6 6 46 44.5t82 79.5 86.5 86 73 78 28.5 41z"},list:{viewbox:"0 0 1792 1792",path:"M384 1408q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm0-512q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm1408 416v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5zm-1408-928q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm1408 416v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5zm0-512v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5z"},"loading-spinner":{viewbox:"0 0 66 66",CustomComponent:l,path:[r.default.createElement("circle",{key:"5",className:"path",fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})]},mobile:{viewbox:"0 0 1792 1792",path:"M976 1408q0-33-23.5-56.5t-56.5-23.5-56.5 23.5-23.5 56.5 23.5 56.5 56.5 23.5 56.5-23.5 23.5-56.5zm208-160v-704q0-13-9.5-22.5t-22.5-9.5h-512q-13 0-22.5 9.5t-9.5 22.5v704q0 13 9.5 22.5t22.5 9.5h512q13 0 22.5-9.5t9.5-22.5zm-192-848q0-16-16-16h-160q-16 0-16 16t16 16h160q16 0 16-16zm288-16v1024q0 52-38 90t-90 38h-512q-52 0-90-38t-38-90v-1024q0-52 38-90t90-38h512q52 0 90 38t38 90z"},"pencil-square":{viewbox:"0 0 1792 1792",path:"M888 1184l116-116-152-152-116 116v56h96v96h56zm440-720q-16-16-33 1l-350 350q-17 17-1 33t33-1l350-350q17-17 1-33zm80 594v190q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q63 0 117 25 15 7 18 23 3 17-9 29l-49 49q-14 14-32 8-23-6-45-6h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-126q0-13 9-22l64-64q15-15 35-7t20 29zm-96-738l288 288-672 672h-288v-288zm444 132l-92 92-288-288 92-92q28-28 68-28t68 28l152 152q28 28 28 68t-28 68z"},plus:{viewbox:"0 0 1792 1792",path:"M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"},"plus-circle":{viewbox:"0 0 1792 1792",path:"M1344 960v-128q0-26-19-45t-45-19h-256v-256q0-26-19-45t-45-19h-128q-26 0-45 19t-19 45v256h-256q-26 0-45 19t-19 45v128q0 26 19 45t45 19h256v256q0 26 19 45t45 19h128q26 0 45-19t19-45v-256h256q26 0 45-19t19-45zm320-64q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"},"question-circle":{viewbox:"0 0 1792 1792",path:"M1024 1376v-192q0-14-9-23t-23-9h-192q-14 0-23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23-9t9-23zm256-672q0-88-55.5-163t-138.5-116-170-41q-243 0-371 213-15 24 8 42l132 100q7 6 19 6 16 0 25-12 53-68 86-92 34-24 86-24 48 0 85.5 26t37.5 59q0 38-20 61t-68 45q-63 28-115.5 86.5t-52.5 125.5v36q0 14 9 23t23 9h192q14 0 23-9t9-23q0-19 21.5-49.5t54.5-49.5q32-18 49-28.5t46-35 44.5-48 28-60.5 12.5-81zm384 192q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"},search:{viewbox:"0 0 1792 1792",path:"M1216 832q0-185-131.5-316.5t-316.5-131.5-316.5 131.5-131.5 316.5 131.5 316.5 316.5 131.5 316.5-131.5 131.5-316.5zm512 832q0 52-38 90t-90 38q-54 0-90-38l-343-342q-179 124-399 124-143 0-273.5-55.5t-225-150-150-225-55.5-273.5 55.5-273.5 150-225 225-150 273.5-55.5 273.5 55.5 225 150 150 225 55.5 273.5q0 220-124 399l343 343q37 37 37 90z"},"seo-score-bad":{viewbox:"0 0 496 512",path:"M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8z M328 176c17.7 0 32 14.3 32 32 s-14.3 32-32 32s-32-14.3-32-32S310.3 176 328 176z M168 176c17.7 0 32 14.3 32 32s-14.3 32-32 32s-32-14.3-32-32S150.3 176 168 176 z M338.2 394.2C315.8 367.4 282.9 352 248 352s-67.8 15.4-90.2 42.2c-13.5 16.3-38.1-4.2-24.6-20.5C161.7 339.6 203.6 320 248 320 s86.3 19.6 114.7 53.8C376.3 390 351.7 410.5 338.2 394.2L338.2 394.2z"},"seo-score-good":{viewbox:"0 0 496 512",path:"M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8z M328 176c17.7 0 32 14.3 32 32 s-14.3 32-32 32s-32-14.3-32-32S310.3 176 328 176z M168 176c17.7 0 32 14.3 32 32s-14.3 32-32 32s-32-14.3-32-32S150.3 176 168 176 z M362.8 346.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5c22.4 26.9 55.2 42.2 90.2 42.2 s67.8-15.4 90.2-42.2C351.6 309.5 376.3 329.9 362.8 346.2L362.8 346.2z"},"seo-score-none":{viewbox:"0 0 496 512",path:"M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8z"},"seo-score-ok":{viewbox:"0 0 496 512",path:[r.default.createElement("path",{key:"1",fill:"#000000",d:"M344 336c21.2 0 21.2 32 0 32H152c-21.2 0-21.2-32 0-32H344z"}),r.default.createElement("circle",{key:"2",fill:"#000000",cx:"328",cy:"208",r:"32"}),r.default.createElement("circle",{key:"3",fill:"#000000",cx:"168",cy:"208",r:"32"}),r.default.createElement("path",{key:"4",d:"M248 8c137 0 248 111 248 248S385 504 248 504S0 393 0 256S111 8 248 8z M360 208c0-17.7-14.3-32-32-32 s-32 14.3-32 32s14.3 32 32 32S360 225.7 360 208z M344 368c21.2 0 21.2-32 0-32H152c-21.2 0-21.2 32 0 32H344z M200 208 c0-17.7-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32S200 225.7 200 208z"})]},times:{viewbox:"0 0 1792 1792",path:"M1490 1322q0 40-28 68l-136 136q-28 28-68 28t-68-28l-294-294-294 294q-28 28-68 28t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 294 294-294q28-28 68-28t68 28l136 136q28 28 28 68t-28 68l-294 294 294 294q28 28 28 68z"},"times-circle":{viewbox:"0 0 20 20",path:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm5 11l-3-3 3-3-2-2-3 3-3-3-2 2 3 3-3 3 2 2 3-3 3 3z"},"alert-info":{viewbox:"0 0 512 512",path:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},"alert-error":{viewbox:"0 0 512 512",path:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"},"alert-success":{viewbox:"0 0 512 512",path:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},"alert-warning":{viewbox:"0 0 576 512",path:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}};t.default=(0,i.createSvgIconComponent)(u)},function(e,t,n){"use strict";t.a=function(){return!1}},function(e,t,n){"use strict";var r={},o=Math.pow(2,24);e.exports=function(){for(var e=void 0;void 0===e||r.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*o).toString(32);return r[e]=!0,e}},function(e,t,n){var r=n(79),o=n(429),i=n(430),a="[object Null]",l="[object Undefined]",u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?l:a:u&&u in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(61),o=n(33),i=n(177),a=n(83),l=n(73),u=function(e,t,n){var s,c,f,d=e&u.F,p=e&u.G,h=e&u.S,g=e&u.P,y=e&u.B,m=e&u.W,v=p?o:o[t]||(o[t]={}),b=v.prototype,_=p?r:h?r[t]:(r[t]||{}).prototype;for(s in p&&(n=t),n)(c=!d&&_&&void 0!==_[s])&&l(v,s)||(f=c?_[s]:n[s],v[s]=p&&"function"!=typeof _[s]?n[s]:y&&c?i(f,r):m&&_[s]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):g&&"function"==typeof f?i(Function.call,f):f,g&&((v.virtual||(v.virtual={}))[s]=f,e&u.R&&b&&!b[s]&&a(b,s,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(71),o=n(279),i=n(178),a=Object.defineProperty;t.f=n(72)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";var r=n(811);e.exports=r},function(e,t){e.exports=function(e){return JSON.parse(JSON.stringify(e))}},function(e,t,n){var r;
|
7 |
-
/*!
|
8 |
-
Copyright (c) 2017 Jed Watson.
|
9 |
-
Licensed under the MIT License (MIT), see
|
10 |
-
http://jedwatson.github.io/classnames
|
11 |
-
*/
|
12 |
-
/*!
|
13 |
-
Copyright (c) 2017 Jed Watson.
|
14 |
-
Licensed under the MIT License (MIT), see
|
15 |
-
http://jedwatson.github.io/classnames
|
16 |
-
*/
|
17 |
-
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var l in r)n.call(r,l)&&r[l]&&e.push(l)}}return e.join(" ")}void 0!==e&&e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";var r=n(143),o=Object(r.a)(Object.getPrototypeOf,Object);t.a=o},function(e,t,n){var r=n(434),o=n(437);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(243),o=n(244),i=n(69);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){var r=n(235),o=n(160);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.speak=t.setup=void 0;var r=l(n(521)),o=l(n(522)),i=l(n(523)),a=l(n(524));function l(e){return e&&e.__esModule?e:{default:e}}var u=t.setup=function(){var e=document.getElementById("a11y-speak-polite"),t=document.getElementById("a11y-speak-assertive");null===e&&(e=(0,r.default)("polite")),null===t&&(t=(0,r.default)("assertive"))};(0,i.default)(u);t.speak=function(e,t){(0,o.default)(),e=(0,a.default)(e);var n=document.getElementById("a11y-speak-polite"),r=document.getElementById("a11y-speak-assertive");r&&"assertive"===t?r.textContent=e:n&&(n.textContent=e)}},function(e,t,n){var r=n(84);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(85)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";var r=n(39),o=n(8),i=n(108),a=o.List,l=o.Map,u=o.OrderedSet,s=o.Record,c=o.Repeat,f=u(),d=function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=a(c(r.EMPTY,n.length))),e},p=function(e){function t(n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,d(n)))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getKey=function(){return this.get("key")},t.prototype.getType=function(){return this.get("type")},t.prototype.getText=function(){return this.get("text")},t.prototype.getCharacterList=function(){return this.get("characterList")},t.prototype.getLength=function(){return this.getText().length},t.prototype.getDepth=function(){return this.get("depth")},t.prototype.getData=function(){return this.get("data")},t.prototype.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():f},t.prototype.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},t.prototype.findStyleRanges=function(e,t){i(this.getCharacterList(),h,e,t)},t.prototype.findEntityRanges=function(e,t){i(this.getCharacterList(),g,e,t)},t}(s({key:"",type:"unstyled",text:"",characterList:a(),depth:0,data:l()}));function h(e,t){return e.getStyle()===t.getStyle()}function g(e,t){return e.getEntity()===t.getEntity()}e.exports=p},function(e,t,n){"use strict";var r=n(11),o=55296,i=56319,a=56320,l=57343,u=/[\uD800-\uDFFF]/;function s(e){return o<=e&&e<=l}function c(e){return u.test(e)}function f(e,t){return 1+s(e.charCodeAt(t))}function d(e,t,n){if(t=t||0,n=void 0===n?1/0:n||0,!c(e))return e.substr(t,n);var r=e.length;if(r<=0||t>r||n<=0)return"";var o=0;if(t>0){for(;t>0&&o<r;t--)o+=f(e,o);if(o>=r)return""}else if(t<0){for(o=r;t<0&&0<o;t++)o-=f(e,o-1);o<0&&(o=0)}var i=r;if(n<r)for(i=o;n>0&&i<r;n--)i+=f(e,i);return e.substring(o,i)}var p={getCodePoints:function(e){for(var t=[],n=0;n<e.length;n+=f(e,n))t.push(e.codePointAt(n));return t},getUTF16Length:f,hasSurrogateUnit:c,isCodeUnitInSurrogateRange:s,isSurrogatePair:function(e,t){if(0<=t&&t<e.length||r(!1),t+1===e.length)return!1;var n=e.charCodeAt(t),u=e.charCodeAt(t+1);return o<=n&&n<=i&&a<=u&&u<=l},strlen:function(e){if(!c(e))return e.length;for(var t=0,n=0;n<e.length;n+=f(e,n))t++;return t},substring:function(e,t,n){t=t||0,n=void 0===n?1/0:n||0,t<0&&(t=0),n<0&&(n=0);var r=Math.abs(n-t);return d(e,t=t<n?t:n,r)},substr:d};e.exports=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.recommendedReplacementVariablesShape=t.replacementVariablesShape=t.lengthProgressShape=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(3));t.lengthProgressShape=r.default.shape({max:r.default.number,actual:r.default.number,score:r.default.number}),t.replacementVariablesShape=r.default.arrayOf(r.default.shape({name:r.default.string.isRequired,value:r.default.string.isRequired,label:r.default.string,description:r.default.string})),t.recommendedReplacementVariablesShape=r.default.arrayOf(r.default.string)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseButton=t.addButtonStyles=void 0,t.addBaseStyle=f,t.addFocusStyle=d,t.addHoverStyle=p,t.addActiveStyle=h;var r=u(n(1)),o=u(n(78)),i=u(n(4)),a=n(12),l=n(35);function u(e){return e&&e.__esModule?e:{default:e}}var s={minHeight:32,verticalPadding:4,borderWidth:1},c=s.minHeight-2*s.verticalPadding-2*s.borderWidth;function f(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-0"})(["display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;border-width:",";border-style:solid;margin:0;padding:"," 10px;border-radius:3px;cursor:pointer;box-sizing:border-box;font-size:inherit;font-family:inherit;font-weight:inherit;text-align:",";overflow:visible;min-height:",';svg{align-self:center;}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){::after{display:inline-block;content:"";min-height:',";}}"],s.borderWidth+"px",s.verticalPadding+"px",(0,l.getDirectionalStyle)("left","right"),s.minHeight+"px",c+"px")}function d(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-1"})(["&::-moz-focus-inner{border-width:0;}&:focus{outline:none;border-color:",";color:",";background-color:",";box-shadow:0 0 3px ",";}"],function(e){return e.focusBorderColor},function(e){return e.focusColor},function(e){return e.focusBackgroundColor},(0,a.rgba)(a.colors.$color_blue_dark,.8))}function p(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-2"})(["&:hover{color:",";background-color:",";border-color:",";}"],function(e){return e.hoverColor},function(e){return e.hoverBackgroundColor},function(e){return e.hoverBorderColor})}function h(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-3"})(["&:active{color:",";background-color:",";border-color:",";box-shadow:inset 0 2px 5px -3px ",";}"],function(e){return e.activeColor},function(e){return e.activeBackgroundColor},function(e){return e.activeBorderColor},(0,a.rgba)(a.colors.$color_button_border_active,.5))}var g=t.addButtonStyles=(0,o.default)([h,d,p,f]),y=t.BaseButton=g(r.default.button.withConfig({displayName:"Button__BaseButton",componentId:"grb41s-4"})(["color:",";border-color:",";background:",";box-shadow:0 1px 0 ",";"],function(e){return e.textColor},function(e){return e.borderColor},function(e){return e.backgroundColor},function(e){return(0,a.rgba)(e.boxShadowColor,1)}));y.propTypes={type:i.default.string,backgroundColor:i.default.string,textColor:i.default.string,borderColor:i.default.string,boxShadowColor:i.default.string,hoverColor:i.default.string,hoverBackgroundColor:i.default.string,hoverBorderColor:i.default.string,activeColor:i.default.string,activeBackgroundColor:i.default.string,activeBorderColor:i.default.string,focusColor:i.default.string,focusBackgroundColor:i.default.string,focusBorderColor:i.default.string},y.defaultProps={type:"button",backgroundColor:a.colors.$color_button,textColor:a.colors.$color_button_text,borderColor:a.colors.$color_button_border,boxShadowColor:a.colors.$color_button_border,hoverColor:a.colors.$color_button_text_hover,hoverBackgroundColor:a.colors.$color_button_hover,hoverBorderColor:a.colors.$color_button_border_hover,activeColor:a.colors.$color_button_text_hover,activeBackgroundColor:a.colors.$color_button,activeBorderColor:a.colors.$color_button_border_hover,focusColor:a.colors.$color_button_text_hover,focusBackgroundColor:a.colors.$color_white,focusBorderColor:a.colors.$color_blue},t.default=y},function(e,t,n){var r=n(424)();e.exports=r},function(e,t,n){var r=n(45).Symbol;e.exports=r},function(e,t,n){var r=n(157),o=n(242);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var l=-1,u=t.length;++l<u;){var s=t[l],c=i?i(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),a?o(n,s,c):r(n,s,c)}return n}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){var r=n(62),o=n(104);e.exports=n(72)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(282),o=n(180);e.exports=function(e){return r(o(e))}},function(e,t){e.exports={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(n)return[e,t];return e},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseButton=t.addButtonStyles=void 0,t.addBaseStyle=f,t.addFocusStyle=d,t.addHoverStyle=p,t.addActiveStyle=h;var r=u(n(1)),o=u(n(78)),i=u(n(3)),a=n(9),l=n(30);function u(e){return e&&e.__esModule?e:{default:e}}var s={minHeight:32,verticalPadding:4,borderWidth:1},c=s.minHeight-2*s.verticalPadding-2*s.borderWidth;function f(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-0"})(["display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;border-width:",";border-style:solid;margin:0;padding:"," 10px;border-radius:3px;cursor:pointer;box-sizing:border-box;font-size:inherit;font-family:inherit;font-weight:inherit;text-align:",";overflow:visible;min-height:",';svg{align-self:center;}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){::after{display:inline-block;content:"";min-height:',";}}"],s.borderWidth+"px",s.verticalPadding+"px",(0,l.getDirectionalStyle)("left","right"),s.minHeight+"px",c+"px")}function d(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-1"})(["&::-moz-focus-inner{border-width:0;}&:focus{outline:none;border-color:",";color:",";background-color:",";box-shadow:0 0 3px ",";}"],function(e){return e.focusBorderColor},function(e){return e.focusColor},function(e){return e.focusBackgroundColor},(0,a.rgba)(a.colors.$color_blue_dark,.8))}function p(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-2"})(["&:hover{color:",";background-color:",";border-color:",";}"],function(e){return e.hoverColor},function(e){return e.hoverBackgroundColor},function(e){return e.hoverBorderColor})}function h(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-3"})(["&:active{color:",";background-color:",";border-color:",";box-shadow:inset 0 2px 5px -3px ",";}"],function(e){return e.activeColor},function(e){return e.activeBackgroundColor},function(e){return e.activeBorderColor},(0,a.rgba)(a.colors.$color_button_border_active,.5))}var g=t.addButtonStyles=(0,o.default)([h,d,p,f]),y=t.BaseButton=g(r.default.button.withConfig({displayName:"Button__BaseButton",componentId:"grb41s-4"})(["color:",";border-color:",";background:",";box-shadow:0 1px 0 ",";"],function(e){return e.textColor},function(e){return e.borderColor},function(e){return e.backgroundColor},function(e){return(0,a.rgba)(e.boxShadowColor,1)}));y.propTypes={type:i.default.string,backgroundColor:i.default.string,textColor:i.default.string,borderColor:i.default.string,boxShadowColor:i.default.string,hoverColor:i.default.string,hoverBackgroundColor:i.default.string,hoverBorderColor:i.default.string,activeColor:i.default.string,activeBackgroundColor:i.default.string,activeBorderColor:i.default.string,focusColor:i.default.string,focusBackgroundColor:i.default.string,focusBorderColor:i.default.string},y.defaultProps={type:"button",backgroundColor:a.colors.$color_button,textColor:a.colors.$color_button_text,borderColor:a.colors.$color_button_border,boxShadowColor:a.colors.$color_button_border,hoverColor:a.colors.$color_button_text_hover,hoverBackgroundColor:a.colors.$color_button_hover,hoverBorderColor:a.colors.$color_button_border_hover,activeColor:a.colors.$color_button_text_hover,activeBackgroundColor:a.colors.$color_button,activeBorderColor:a.colors.$color_button_border_hover,focusColor:a.colors.$color_button_text_hover,focusBackgroundColor:a.colors.$color_white,focusBorderColor:a.colors.$color_blue},t.default=y},function(e,t,n){"use strict";var r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.serialize=function(){return"Anchor: "+this.getAnchorKey()+":"+this.getAnchorOffset()+", Focus: "+this.getFocusKey()+":"+this.getFocusOffset()+", Is Backward: "+String(this.getIsBackward())+", Has Focus: "+String(this.getHasFocus())},t.prototype.getAnchorKey=function(){return this.get("anchorKey")},t.prototype.getAnchorOffset=function(){return this.get("anchorOffset")},t.prototype.getFocusKey=function(){return this.get("focusKey")},t.prototype.getFocusOffset=function(){return this.get("focusOffset")},t.prototype.getIsBackward=function(){return this.get("isBackward")},t.prototype.getHasFocus=function(){return this.get("hasFocus")},t.prototype.hasEdgeWithin=function(e,t,n){var r=this.getAnchorKey(),o=this.getFocusKey();if(r===o&&r===e){var i=this.getStartOffset();return t<=this.getEndOffset()&&i<=n}if(e!==r&&e!==o)return!1;var a=e===r?this.getAnchorOffset():this.getFocusOffset();return t<=a&&n>=a},t.prototype.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},t.prototype.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},t.prototype.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},t.prototype.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},t.prototype.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},t.createEmpty=function(e){return new t({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},t}((0,n(8).Record)({anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1}));e.exports=r},function(e,t,n){"use strict";function r(e){return e.replace(/\//g,"-")}e.exports=function(e){return"object"==typeof e?Object.keys(e).filter(function(t){return e[t]}).map(r).join(" "):Array.prototype.map.call(arguments,r).join(" ")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseButton=t.addButtonStyles=void 0,t.addBaseStyle=f,t.addFocusStyle=d,t.addHoverStyle=p,t.addActiveStyle=h;var r=u(n(1)),o=u(n(78)),i=u(n(2)),a=n(7),l=n(18);function u(e){return e&&e.__esModule?e:{default:e}}var s={minHeight:32,verticalPadding:4,borderWidth:1},c=s.minHeight-2*s.verticalPadding-2*s.borderWidth;function f(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-0"})(["display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;border-width:",";border-style:solid;margin:0;padding:"," 10px;border-radius:3px;cursor:pointer;box-sizing:border-box;font-size:inherit;font-family:inherit;font-weight:inherit;text-align:",";overflow:visible;min-height:",';svg{align-self:center;}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){::after{display:inline-block;content:"";min-height:',";}}"],s.borderWidth+"px",s.verticalPadding+"px",(0,l.getDirectionalStyle)("left","right"),s.minHeight+"px",c+"px")}function d(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-1"})(["&::-moz-focus-inner{border-width:0;}&:focus{outline:none;border-color:",";color:",";background-color:",";box-shadow:0 0 3px ",";}"],function(e){return e.focusBorderColor},function(e){return e.focusColor},function(e){return e.focusBackgroundColor},(0,a.rgba)(a.colors.$color_blue_dark,.8))}function p(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-2"})(["&:hover{color:",";background-color:",";border-color:",";}"],function(e){return e.hoverColor},function(e){return e.hoverBackgroundColor},function(e){return e.hoverBorderColor})}function h(e){return(0,r.default)(e).withConfig({displayName:"Button",componentId:"grb41s-3"})(["&:active{color:",";background-color:",";border-color:",";box-shadow:inset 0 2px 5px -3px ",";}"],function(e){return e.activeColor},function(e){return e.activeBackgroundColor},function(e){return e.activeBorderColor},(0,a.rgba)(a.colors.$color_button_border_active,.5))}var g=t.addButtonStyles=(0,o.default)([h,d,p,f]),y=t.BaseButton=g(r.default.button.withConfig({displayName:"Button__BaseButton",componentId:"grb41s-4"})(["color:",";border-color:",";background:",";box-shadow:0 1px 0 ",";"],function(e){return e.textColor},function(e){return e.borderColor},function(e){return e.backgroundColor},function(e){return(0,a.rgba)(e.boxShadowColor,1)}));y.propTypes={type:i.default.string,backgroundColor:i.default.string,textColor:i.default.string,borderColor:i.default.string,boxShadowColor:i.default.string,hoverColor:i.default.string,hoverBackgroundColor:i.default.string,hoverBorderColor:i.default.string,activeColor:i.default.string,activeBackgroundColor:i.default.string,activeBorderColor:i.default.string,focusColor:i.default.string,focusBackgroundColor:i.default.string,focusBorderColor:i.default.string},y.defaultProps={type:"button",backgroundColor:a.colors.$color_button,textColor:a.colors.$color_button_text,borderColor:a.colors.$color_button_border,boxShadowColor:a.colors.$color_button_border,hoverColor:a.colors.$color_button_text_hover,hoverBackgroundColor:a.colors.$color_button_hover,hoverBorderColor:a.colors.$color_button_border_hover,activeColor:a.colors.$color_button_text_hover,activeBackgroundColor:a.colors.$color_button,activeBorderColor:a.colors.$color_button_border_hover,focusColor:a.colors.$color_button_text_hover,focusBackgroundColor:a.colors.$color_white,focusBorderColor:a.colors.$color_blue},t.default=y},function(e,t,n){"use strict";var r=n(111);function o(e,t){var r=n(94),o=this;"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):o.stack=(new Error).stack||"Cannot get a stacktrace, browser is too old",this.name="AlgoliaSearchError",this.message=e||"Unknown error",t&&r(t,function(e,t){o[t]=e})}function i(e,t){function n(){var n=Array.prototype.slice.call(arguments,0);"string"!=typeof n[0]&&n.unshift(t),o.apply(this,n),this.name="AlgoliaSearch"+e+"Error"}return r(n,o),n}r(o,Error),e.exports={AlgoliaSearchError:o,UnparsableJSON:i("UnparsableJSON","Could not parse the incoming response as JSON, see err.more for details"),RequestTimeout:i("RequestTimeout","Request timedout before getting a response"),Network:i("Network","Network issue, see err.more for details"),JSONPScriptFail:i("JSONPScriptFail","<script> was loaded but did not call our provided callback"),JSONPScriptError:i("JSONPScriptError","<script> unable to load due to an `error` event on it"),Unknown:i("Unknown","Unknown error occured")}},function(e,t){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,t,o){if("[object Function]"!==r.call(t))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var a=0;a<i;a++)t.call(o,e[a],a,e);else for(var l in e)n.call(e,l)&&t.call(o,e[l],l,e)}},function(e,t,n){var r=n(94);e.exports=function(e,t){var n=[];return r(e,function(r,o){n.push(t(r,o,e))}),n}},function(e,t){!function(e){"use strict";if(!e.fetch){var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(e){return e&&DataView.prototype.isPrototypeOf(e)},o=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};c.prototype.append=function(e,t){e=l(e),t=u(t);var n=this.map[e];n||(n=[],this.map[e]=n),n.push(t)},c.prototype.delete=function(e){delete this.map[l(e)]},c.prototype.get=function(e){var t=this.map[l(e)];return t?t[0]:null},c.prototype.getAll=function(e){return this.map[l(e)]||[]},c.prototype.has=function(e){return this.map.hasOwnProperty(l(e))},c.prototype.set=function(e,t){this.map[l(e)]=[u(t)]},c.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(r){e.call(t,r,n,this)},this)},this)},c.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),s(e)},c.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),s(e)},t.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var i=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},g.call(y.prototype),g.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var a=[301,302,303,307,308];v.redirect=function(e,t){if(-1===a.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},e.Headers=c,e.Request=y,e.Response=v,e.fetch=function(e,n){return new Promise(function(r,o){var i=new y(e,n),a=new XMLHttpRequest;a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:function(e){var t=new c;return e.split("\r\n").forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}(a.getAllResponseHeaders()||"")};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var t="response"in a?a.response:a.responseText;r(new v(t,e))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.open(i.method,i.url,!0),"include"===i.credentials&&(a.withCredentials=!0),"responseType"in a&&t.blob&&(a.responseType="blob"),i.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function c(e){this.map={},e instanceof c?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function p(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&r(e))this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!o(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=h(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=d(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}function y(e,t){var n=(t=t||{}).body;if("string"==typeof e)this.url=e;else{if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=function(e){var t=e.toUpperCase();return i.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function m(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function v(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this)},function(e,t,n){(function(t){(function(){"use strict";var t=this;function n(e){return"string"==typeof e}function r(e,t,n){return e.call.apply(e.bind,arguments)}function o(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function i(e,t,n){return(i=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?r:o).apply(null,arguments)}function a(e){var t=te;function n(){}n.prototype=t.prototype,e.G=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.F=function(e,n,r){for(var o=Array(arguments.length-2),i=2;i<arguments.length;i++)o[i-2]=arguments[i];return t.prototype[n].apply(e,o)}}var l=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function u(e,t){return-1!=e.indexOf(t)}function s(e,t){return e<t?-1:e>t?1:0}var c,f=Array.prototype.indexOf?function(e,t,n){return Array.prototype.indexOf.call(e,t,n)}:function(e,t,r){if(r=null==r?0:0>r?Math.max(0,e.length+r):r,n(e))return n(t)&&1==t.length?e.indexOf(t,r):-1;for(;r<e.length;r++)if(r in e&&e[r]===t)return r;return-1},d=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,r){for(var o=e.length,i=n(e)?e.split(""):e,a=0;a<o;a++)a in i&&t.call(r,i[a],a,e)},p=Array.prototype.filter?function(e,t,n){return Array.prototype.filter.call(e,t,n)}:function(e,t,r){for(var o=e.length,i=[],a=0,l=n(e)?e.split(""):e,u=0;u<o;u++)if(u in l){var s=l[u];t.call(r,s,u,e)&&(i[a++]=s)}return i},h=Array.prototype.reduce?function(e,t,n,r){return r&&(t=i(t,r)),Array.prototype.reduce.call(e,t,n)}:function(e,t,n,r){var o=n;return d(e,function(n,i){o=t.call(r,o,n,i,e)}),o},g=Array.prototype.some?function(e,t,n){return Array.prototype.some.call(e,t,n)}:function(e,t,r){for(var o=e.length,i=n(e)?e.split(""):e,a=0;a<o;a++)if(a in i&&t.call(r,i[a],a,e))return!0;return!1};e:{var y=t.navigator;if(y){var m=y.userAgent;if(m){c=m;break e}}c=""}var v,b=u(c,"Opera")||u(c,"OPR"),_=u(c,"Trident")||u(c,"MSIE"),x=u(c,"Edge"),w=u(c,"Gecko")&&!(u(c.toLowerCase(),"webkit")&&!u(c,"Edge"))&&!(u(c,"Trident")||u(c,"MSIE"))&&!u(c,"Edge"),C=u(c.toLowerCase(),"webkit")&&!u(c,"Edge");function k(){var e=t.document;return e?e.documentMode:void 0}e:{var S="",O=function(){var e=c;return w?/rv\:([^\);]+)(\)|;)/.exec(e):x?/Edge\/([\d\.]+)/.exec(e):_?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):C?/WebKit\/(\S+)/.exec(e):b?/(?:Version)[ \/]?(\S+)/.exec(e):void 0}();if(O&&(S=O?O[1]:""),_){var E=k();if(null!=E&&E>parseFloat(S)){v=String(E);break e}}v=S}var T={};function P(e){if(!T[e]){for(var t=0,n=l(String(v)).split("."),r=l(String(e)).split("."),o=Math.max(n.length,r.length),i=0;0==t&&i<o;i++){var a=n[i]||"",u=r[i]||"",c=/(\d*)(\D*)/g,f=/(\d*)(\D*)/g;do{var d=c.exec(a)||["","",""],p=f.exec(u)||["","",""];if(0==d[0].length&&0==p[0].length)break;t=s(0==d[1].length?0:parseInt(d[1],10),0==p[1].length?0:parseInt(p[1],10))||s(0==d[2].length,0==p[2].length)||s(d[2],p[2])}while(0==t)}T[e]=0<=t}}var j=t.document,M=j&&_?k()||("CSS1Compat"==j.compatMode?parseInt(v,10):5):void 0,I=_&&!(9<=Number(M)),R=_&&!(8<=Number(M));function N(e,t,n,r){this.a=e,this.nodeName=n,this.nodeValue=r,this.nodeType=2,this.parentNode=this.ownerElement=t}function A(e,t){var n=R&&"href"==t.nodeName?e.getAttribute(t.nodeName,2):t.nodeValue;return new N(t,e,t.nodeName,n)}function B(e){var t=null;if(1==(n=e.nodeType)&&(t=void 0==(t=void 0==(t=e.textContent)||null==t?e.innerText:t)||null==t?"":t),"string"!=typeof t)if(I&&"title"==e.nodeName.toLowerCase()&&1==n)t=e.text;else if(9==n||1==n){e=9==n?e.documentElement:e.firstChild;var n=0,r=[];for(t="";e;){do{1!=e.nodeType&&(t+=e.nodeValue),I&&"title"==e.nodeName.toLowerCase()&&(t+=e.text),r[n++]=e}while(e=e.firstChild);for(;n&&!(e=r[--n].nextSibling););}}else t=e.nodeValue;return""+t}function L(e,t,n){if(null===t)return!0;try{if(!e.getAttribute)return!1}catch(e){return!1}return R&&"class"==t&&(t="className"),null==n?!!e.getAttribute(t):e.getAttribute(t,2)==n}function D(e,t,r,o,i){return(I?function(e,t,n,r,o){if(e instanceof Te||8==e.b||n&&null===e.b){var i=t.all;if(!i)return o;if("*"!=(e=$(e))&&!(i=t.getElementsByTagName(e)))return o;if(n){for(var a=[],l=0;t=i[l++];)L(t,n,r)&&a.push(t);i=a}for(l=0;t=i[l++];)"*"==e&&"!"==t.tagName||X(o,t);return o}return z(e,t,n,r,o),o}:function(e,t,n,r,o){return t.getElementsByName&&r&&"name"==n&&!_?(t=t.getElementsByName(r),d(t,function(t){e.a(t)&&X(o,t)})):t.getElementsByClassName&&r&&"class"==n?(t=t.getElementsByClassName(r),d(t,function(t){t.className==r&&e.a(t)&&X(o,t)})):e instanceof _e?z(e,t,n,r,o):t.getElementsByTagName&&(t=t.getElementsByTagName(e.f()),d(t,function(e){L(e,n,r)&&X(o,e)})),o}).call(null,e,t,n(r)?r:null,n(o)?o:null,i||new H)}function q(e,t,n,r,o){for(t=t.firstChild;t;t=t.nextSibling)L(t,n,r)&&e.a(t)&&X(o,t);return o}function z(e,t,n,r,o){for(t=t.firstChild;t;t=t.nextSibling)L(t,n,r)&&e.a(t)&&X(o,t),z(e,t,n,r,o)}function $(e){if(e instanceof _e){if(8==e.b)return"!";if(null===e.b)return"*"}return e.f()}function F(e,t){if(!e||!t)return!1;if(e.contains&&1==t.nodeType)return e==t||e.contains(t);if(void 0!==e.compareDocumentPosition)return e==t||!!(16&e.compareDocumentPosition(t));for(;t&&e!=t;)t=t.parentNode;return t==e}function W(e,n){if(e==n)return 0;if(e.compareDocumentPosition)return 2&e.compareDocumentPosition(n)?1:-1;if(_&&!(9<=Number(M))){if(9==e.nodeType)return-1;if(9==n.nodeType)return 1}if("sourceIndex"in e||e.parentNode&&"sourceIndex"in e.parentNode){var r=1==e.nodeType,o=1==n.nodeType;if(r&&o)return e.sourceIndex-n.sourceIndex;var i=e.parentNode,a=n.parentNode;return i==a?K(e,n):!r&&F(i,n)?-1*U(e,n):!o&&F(a,e)?U(n,e):(r?e.sourceIndex:i.sourceIndex)-(o?n.sourceIndex:a.sourceIndex)}return(r=(o=9==e.nodeType?e:e.ownerDocument||e.document).createRange()).selectNode(e),r.collapse(!0),(o=o.createRange()).selectNode(n),o.collapse(!0),r.compareBoundaryPoints(t.Range.START_TO_END,o)}function U(e,t){var n=e.parentNode;if(n==t)return-1;for(var r=t;r.parentNode!=n;)r=r.parentNode;return K(r,e)}function K(e,t){for(var n=t;n=n.previousSibling;)if(n==e)return-1;return 1}function H(){this.b=this.a=null,this.l=0}function V(e){this.node=e,this.a=this.b=null}function Y(e,t){if(!e.a)return t;if(!t.a)return e;for(var n=e.a,r=t.a,o=null,i=null,a=0;n&&r;){i=n.node;var l=r.node;i==l||i instanceof N&&l instanceof N&&i.a==l.a?(i=n,n=n.a,r=r.a):0<W(n.node,r.node)?(i=r,r=r.a):(i=n,n=n.a),(i.b=o)?o.a=i:e.a=i,o=i,a++}for(i=n||r;i;)i.b=o,o=o.a=i,a++,i=i.a;return e.b=o,e.l=a,e}function G(e,t){var n=new V(t);n.a=e.a,e.b?e.a.b=n:e.a=e.b=n,e.a=n,e.l++}function X(e,t){var n=new V(t);n.b=e.b,e.a?e.b.a=n:e.a=e.b=n,e.b=n,e.l++}function J(e){return(e=e.a)?e.node:null}function Q(e){return(e=J(e))?B(e):""}function Z(e,t){return new function(e,t){this.f=e,this.b=(this.c=t)?e.b:e.a,this.a=null}(e,!!t)}function ee(e){var t=e.b;if(null==t)return null;var n=e.a=t;return e.b=e.c?t.b:t.a,n.node}function te(e){this.i=e,this.b=this.g=!1,this.f=null}function ne(e){return"\n "+e.toString().split("\n").join("\n ")}function re(e,t){e.g=t}function oe(e,t){e.b=t}function ie(e,t){var n=e.a(t);return n instanceof H?+Q(n):+n}function ae(e,t){var n=e.a(t);return n instanceof H?Q(n):""+n}function le(e,t){var n=e.a(t);return n instanceof H?!!n.l:!!n}function ue(e,t,n){te.call(this,e.i),this.c=e,this.h=t,this.o=n,this.g=t.g||n.g,this.b=t.b||n.b,this.c==pe&&(n.b||n.g||4==n.i||0==n.i||!t.f?t.b||t.g||4==t.i||0==t.i||!n.f||(this.f={name:n.f.name,s:t}):this.f={name:t.f.name,s:n})}function se(e,t,n,r,o){var i;if(t=t.a(r),n=n.a(r),t instanceof H&&n instanceof H){for(r=ee(t=Z(t));r;r=ee(t))for(i=ee(o=Z(n));i;i=ee(o))if(e(B(r),B(i)))return!0;return!1}if(t instanceof H||n instanceof H){t instanceof H?(o=t,r=n):(o=n,r=t);for(var a=typeof r,l=ee(i=Z(o));l;l=ee(i)){switch(a){case"number":l=+B(l);break;case"boolean":l=!!B(l);break;case"string":l=B(l);break;default:throw Error("Illegal primitive type for comparison.")}if(o==t&&e(l,r)||o==n&&e(r,l))return!0}return!1}return o?"boolean"==typeof t||"boolean"==typeof n?e(!!t,!!n):"number"==typeof t||"number"==typeof n?e(+t,+n):e(t,n):e(+t,+n)}function ce(e,t,n,r){this.a=e,this.w=t,this.i=n,this.m=r}!w&&!_||_&&9<=Number(M)||w&&P("1.9.1"),_&&P("9"),a(ue),ue.prototype.a=function(e){return this.c.m(this.h,this.o,e)},ue.prototype.toString=function(){return"Binary Expression: "+this.c+ne(this.h)+ne(this.o)},ce.prototype.toString=function(){return this.a};var fe={};function de(e,t,n,r){if(fe.hasOwnProperty(e))throw Error("Binary operator already created: "+e);return e=new ce(e,t,n,r),fe[e.toString()]=e}de("div",6,1,function(e,t,n){return ie(e,n)/ie(t,n)}),de("mod",6,1,function(e,t,n){return ie(e,n)%ie(t,n)}),de("*",6,1,function(e,t,n){return ie(e,n)*ie(t,n)}),de("+",5,1,function(e,t,n){return ie(e,n)+ie(t,n)}),de("-",5,1,function(e,t,n){return ie(e,n)-ie(t,n)}),de("<",4,2,function(e,t,n){return se(function(e,t){return e<t},e,t,n)}),de(">",4,2,function(e,t,n){return se(function(e,t){return e>t},e,t,n)}),de("<=",4,2,function(e,t,n){return se(function(e,t){return e<=t},e,t,n)}),de(">=",4,2,function(e,t,n){return se(function(e,t){return e>=t},e,t,n)});var pe=de("=",3,2,function(e,t,n){return se(function(e,t){return e==t},e,t,n,!0)});function he(e,t,n){this.a=e,this.b=t||1,this.f=n||1}function ge(e,t){if(t.a.length&&4!=e.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");te.call(this,e.i),this.c=e,this.h=t,this.g=e.g,this.b=e.b}function ye(e,t){if(t.length<e.A)throw Error("Function "+e.j+" expects at least"+e.A+" arguments, "+t.length+" given");if(null!==e.v&&t.length>e.v)throw Error("Function "+e.j+" expects at most "+e.v+" arguments, "+t.length+" given");e.B&&d(t,function(t,n){if(4!=t.i)throw Error("Argument "+n+" to function "+e.j+" is not of type Nodeset: "+t)}),te.call(this,e.i),this.h=e,this.c=t,re(this,e.g||g(t,function(e){return e.g})),oe(this,e.D&&!t.length||e.C&&!!t.length||g(t,function(e){return e.b}))}function me(e,t,n,r,o,i,a,l,u){this.j=e,this.i=t,this.g=n,this.D=r,this.C=o,this.m=i,this.A=a,this.v=void 0!==l?l:a,this.B=!!u}de("!=",3,2,function(e,t,n){return se(function(e,t){return e!=t},e,t,n,!0)}),de("and",2,2,function(e,t,n){return le(e,n)&&le(t,n)}),de("or",1,2,function(e,t,n){return le(e,n)||le(t,n)}),a(ge),ge.prototype.a=function(e){return e=this.c.a(e),Ae(this.h,e)},ge.prototype.toString=function(){return"Filter:"+ne(this.c)+ne(this.h)},a(ye),ye.prototype.a=function(e){return this.h.m.apply(null,function(e){return Array.prototype.concat.apply(Array.prototype,arguments)}(e,this.c))},ye.prototype.toString=function(){var e="Function: "+this.h;if(this.c.length)e=e+ne(h(this.c,function(e,t){return e+ne(t)},"Arguments:"));return e},me.prototype.toString=function(){return this.j};var ve={};function be(e,t,n,r,o,i,a,l){if(ve.hasOwnProperty(e))throw Error("Function already created: "+e+".");ve[e]=new me(e,t,n,r,!1,o,i,a,l)}function _e(e,t){switch(this.h=e,this.c=void 0!==t?t:null,this.b=null,e){case"comment":this.b=8;break;case"text":this.b=3;break;case"processing-instruction":this.b=7;break;case"node":break;default:throw Error("Unexpected argument")}}function xe(e){return"comment"==e||"text"==e||"processing-instruction"==e||"node"==e}be("boolean",2,!1,!1,function(e,t){return le(t,e)},1),be("ceiling",1,!1,!1,function(e,t){return Math.ceil(ie(t,e))},1),be("concat",3,!1,!1,function(e,t){return h(function(e,t,n){return 2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,n)}(arguments,1),function(t,n){return t+ae(n,e)},"")},2,null),be("contains",2,!1,!1,function(e,t,n){return u(ae(t,e),ae(n,e))},2),be("count",1,!1,!1,function(e,t){return t.a(e).l},1,1,!0),be("false",2,!1,!1,function(){return!1},0),be("floor",1,!1,!1,function(e,t){return Math.floor(ie(t,e))},1),be("id",4,!1,!1,function(e,t){function r(e){if(I){var t=o.all[e];if(t){if(t.nodeType&&e==t.id)return t;if(t.length)return function(e,t){var r;e:{r=e.length;for(var o=n(e)?e.split(""):e,i=0;i<r;i++)if(i in o&&t.call(void 0,o[i],i,e)){r=i;break e}r=-1}return 0>r?null:n(e)?e.charAt(r):e[r]}(t,function(t){return e==t.id})}return null}return o.getElementById(e)}var o=9==(i=e.a).nodeType?i:i.ownerDocument,i=ae(t,e).split(/\s+/),a=[];d(i,function(e){!(e=r(e))||0<=f(a,e)||a.push(e)}),a.sort(W);var l=new H;return d(a,function(e){X(l,e)}),l},1),be("lang",2,!1,!1,function(){return!1},1),be("last",1,!0,!1,function(e){if(1!=arguments.length)throw Error("Function last expects ()");return e.f},0),be("local-name",3,!1,!0,function(e,t){var n=t?J(t.a(e)):e.a;return n?n.localName||n.nodeName.toLowerCase():""},0,1,!0),be("name",3,!1,!0,function(e,t){var n=t?J(t.a(e)):e.a;return n?n.nodeName.toLowerCase():""},0,1,!0),be("namespace-uri",3,!0,!1,function(){return""},0,1,!0),be("normalize-space",3,!1,!0,function(e,t){return(t?ae(t,e):B(e.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1),be("not",2,!1,!1,function(e,t){return!le(t,e)},1),be("number",1,!1,!0,function(e,t){return t?ie(t,e):+B(e.a)},0,1),be("position",1,!0,!1,function(e){return e.b},0),be("round",1,!1,!1,function(e,t){return Math.round(ie(t,e))},1),be("starts-with",2,!1,!1,function(e,t,n){return t=ae(t,e),e=ae(n,e),0==t.lastIndexOf(e,0)},2),be("string",3,!1,!0,function(e,t){return t?ae(t,e):B(e.a)},0,1),be("string-length",1,!1,!0,function(e,t){return(t?ae(t,e):B(e.a)).length},0,1),be("substring",3,!1,!1,function(e,t,n,r){if(n=ie(n,e),isNaN(n)||1/0==n||-1/0==n)return"";if(r=r?ie(r,e):1/0,isNaN(r)||-1/0===r)return"";n=Math.round(n)-1;var o=Math.max(n,0);return e=ae(t,e),1/0==r?e.substring(o):e.substring(o,n+Math.round(r))},2,3),be("substring-after",3,!1,!1,function(e,t,n){return t=ae(t,e),e=ae(n,e),-1==(n=t.indexOf(e))?"":t.substring(n+e.length)},2),be("substring-before",3,!1,!1,function(e,t,n){return t=ae(t,e),e=ae(n,e),-1==(e=t.indexOf(e))?"":t.substring(0,e)},2),be("sum",1,!1,!1,function(e,t){for(var n=Z(t.a(e)),r=0,o=ee(n);o;o=ee(n))r+=+B(o);return r},1,1,!0),be("translate",3,!1,!1,function(e,t,n,r){t=ae(t,e),n=ae(n,e);var o=ae(r,e);for(e={},r=0;r<n.length;r++){var i=n.charAt(r);i in e||(e[i]=o.charAt(r))}for(n="",r=0;r<t.length;r++)n+=(i=t.charAt(r))in e?e[i]:i;return n},3),be("true",2,!1,!1,function(){return!0},0),_e.prototype.a=function(e){return null===this.b||this.b==e.nodeType},_e.prototype.f=function(){return this.h},_e.prototype.toString=function(){var e="Kind Test: "+this.h;return null===this.c||(e+=ne(this.c)),e};var we=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,Ce=/^\s/;function ke(e,t){return e.b[e.a+(t||0)]}function Se(e){return e.b[e.a++]}function Oe(e){return e.b.length<=e.a}function Ee(e){te.call(this,3),this.c=e.substring(1,e.length-1)}function Te(e,t){var n;this.j=e.toLowerCase(),n="*"==this.j?"*":"http://www.w3.org/1999/xhtml",this.c=t?t.toLowerCase():n}function Pe(e,t){if(te.call(this,e.i),this.h=e,this.c=t,this.g=e.g,this.b=e.b,1==this.c.length){var n=this.c[0];n.u||n.c!=ze||"*"!=(n=n.o).f()&&(this.f={name:n.f(),s:null})}}function je(){te.call(this,4)}function Me(){te.call(this,4)}function Ie(e){return"/"==e||"//"==e}function Re(e){te.call(this,4),this.c=e,re(this,g(this.c,function(e){return e.g})),oe(this,g(this.c,function(e){return e.b}))}function Ne(e,t){this.a=e,this.b=!!t}function Ae(e,t,n){for(n=n||0;n<e.a.length;n++)for(var r,o=e.a[n],i=Z(t),a=t.l,l=0;r=ee(i);l++){var u=e.b?a-l:l+1;if("number"==typeof(r=o.a(new he(r,u,a))))u=u==r;else if("string"==typeof r||"boolean"==typeof r)u=!!r;else{if(!(r instanceof H))throw Error("Predicate.evaluate returned an unexpected type.");u=0<r.l}if(!u){if(r=(u=i).f,!(c=u.a))throw Error("Next must be called at least once before remove.");var s=c.b,c=c.a;s?s.a=c:r.a=c,c?c.b=s:r.b=s,r.l--,u.a=null}}return t}function Be(e,t,n,r){te.call(this,4),this.c=e,this.o=t,this.h=n||new Ne([]),this.u=!!r,t=0<(t=this.h).a.length?t.a[0].f:null,e.b&&t&&(e=t.name,e=I?e.toLowerCase():e,this.f={name:e,s:t.s});e:{for(e=this.h,t=0;t<e.a.length;t++)if((n=e.a[t]).g||1==n.i||0==n.i){e=!0;break e}e=!1}this.g=e}function Le(e,t,n,r){this.j=e,this.f=t,this.a=n,this.b=r}a(Ee),Ee.prototype.a=function(){return this.c},Ee.prototype.toString=function(){return"Literal: "+this.c},Te.prototype.a=function(e){var t=e.nodeType;return(1==t||2==t)&&(t=void 0!==e.localName?e.localName:e.nodeName,("*"==this.j||this.j==t.toLowerCase())&&("*"==this.c||this.c==(e.namespaceURI?e.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")))},Te.prototype.f=function(){return this.j},Te.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j},a(Pe),a(je),je.prototype.a=function(e){var t=new H;return 9==(e=e.a).nodeType?X(t,e):X(t,e.ownerDocument),t},je.prototype.toString=function(){return"Root Helper Expression"},a(Me),Me.prototype.a=function(e){var t=new H;return X(t,e.a),t},Me.prototype.toString=function(){return"Context Helper Expression"},Pe.prototype.a=function(e){var t=this.h.a(e);if(!(t instanceof H))throw Error("Filter expression must evaluate to nodeset.");for(var n=0,r=(e=this.c).length;n<r&&t.l;n++){var o,i=e[n],a=Z(t,i.c.a);if(i.g||i.c!=We)if(i.g||i.c!=Ke)for(o=ee(a),t=i.a(new he(o));null!=(o=ee(a));)t=Y(t,o=i.a(new he(o)));else o=ee(a),t=i.a(new he(o));else{for(o=ee(a);(t=ee(a))&&(!o.contains||o.contains(t))&&8&t.compareDocumentPosition(o);o=t);t=i.a(new he(o))}}return t},Pe.prototype.toString=function(){var e;(e="Path Expression:"+ne(this.h),this.c.length)&&(e+=ne(h(this.c,function(e,t){return e+ne(t)},"Steps:")));return e},a(Re),Re.prototype.a=function(e){var t=new H;return d(this.c,function(n){if(!((n=n.a(e))instanceof H))throw Error("Path expression must evaluate to NodeSet.");t=Y(t,n)}),t},Re.prototype.toString=function(){return h(this.c,function(e,t){return e+ne(t)},"Union Expression:")},Ne.prototype.toString=function(){return h(this.a,function(e,t){return e+ne(t)},"Predicates:")},a(Be),Be.prototype.a=function(e){var t=e.a,n=null,r=null,o=null,i=0;if((n=this.f)&&(r=n.name,o=n.s?ae(n.s,e):null,i=1),this.u)if(this.g||this.c!=$e)if(t=ee(e=Z(new Be(Fe,new _e("node")).a(e))))for(n=this.m(t,r,o,i);null!=(t=ee(e));)n=Y(n,this.m(t,r,o,i));else n=new H;else n=D(this.o,t,r,o),n=Ae(this.h,n,i);else n=this.m(e.a,r,o,i);return n},Be.prototype.m=function(e,t,n,r){return e=this.c.f(this.o,e,t,n),Ae(this.h,e,r)},Be.prototype.toString=function(){var e;(e="Step:"+ne("Operator: "+(this.u?"//":"/")),this.c.j&&(e+=ne("Axis: "+this.c)),e+=ne(this.o),this.h.a.length)&&(e+=ne(h(this.h.a,function(e,t){return e+ne(t)},"Predicates:")));return e},Le.prototype.toString=function(){return this.j};var De={};function qe(e,t,n,r){if(De.hasOwnProperty(e))throw Error("Axis already created: "+e);return t=new Le(e,t,n,!!r),De[e]=t}qe("ancestor",function(e,t){for(var n=new H,r=t;r=r.parentNode;)e.a(r)&&G(n,r);return n},!0),qe("ancestor-or-self",function(e,t){var n=new H,r=t;do{e.a(r)&&G(n,r)}while(r=r.parentNode);return n},!0);var ze=qe("attribute",function(e,t){var n=new H;if("style"==(i=e.f())&&I&&t.style)return X(n,new N(t.style,t,"style",t.style.cssText)),n;var r=t.attributes;if(r)if(e instanceof _e&&null===e.b||"*"==i)for(var o,i=0;o=r[i];i++)I?o.nodeValue&&X(n,A(t,o)):X(n,o);else(o=r.getNamedItem(i))&&(I?o.nodeValue&&X(n,A(t,o)):X(n,o));return n},!1),$e=qe("child",function(e,t,r,o,i){return(I?function(e,t,n,r,o){var i;if((e instanceof Te||8==e.b||n&&null===e.b)&&(i=t.childNodes)){var a=$(e);return"*"==a||(i=p(i,function(e){return e.tagName&&e.tagName.toLowerCase()==a}))?(n&&(i=p(i,function(e){return L(e,n,r)})),d(i,function(e){"*"==a&&("!"==e.tagName||"*"==a&&1!=e.nodeType)||X(o,e)}),o):o}return q(e,t,n,r,o)}:q).call(null,e,t,n(r)?r:null,n(o)?o:null,i||new H)},!1,!0);qe("descendant",D,!1,!0);var Fe=qe("descendant-or-self",function(e,t,n,r){var o=new H;return L(t,n,r)&&e.a(t)&&X(o,t),D(e,t,n,r,o)},!1,!0),We=qe("following",function(e,t,n,r){var o=new H;do{for(var i=t;i=i.nextSibling;)L(i,n,r)&&e.a(i)&&X(o,i),o=D(e,i,n,r,o)}while(t=t.parentNode);return o},!1,!0);qe("following-sibling",function(e,t){for(var n=new H,r=t;r=r.nextSibling;)e.a(r)&&X(n,r);return n},!1),qe("namespace",function(){return new H},!1);var Ue=qe("parent",function(e,t){var n=new H;if(9==t.nodeType)return n;if(2==t.nodeType)return X(n,t.ownerElement),n;var r=t.parentNode;return e.a(r)&&X(n,r),n},!1),Ke=qe("preceding",function(e,t,n,r){var o=new H,i=[];do{i.unshift(t)}while(t=t.parentNode);for(var a=1,l=i.length;a<l;a++){var u=[];for(t=i[a];t=t.previousSibling;)u.unshift(t);for(var s=0,c=u.length;s<c;s++)L(t=u[s],n,r)&&e.a(t)&&X(o,t),o=D(e,t,n,r,o)}return o},!0,!0);qe("preceding-sibling",function(e,t){for(var n=new H,r=t;r=r.previousSibling;)e.a(r)&&G(n,r);return n},!0);var He=qe("self",function(e,t){var n=new H;return e.a(t)&&X(n,t),n},!1);function Ve(e){te.call(this,1),this.c=e,this.g=e.g,this.b=e.b}function Ye(e){te.call(this,1),this.c=e}function Ge(e){for(var t,n=[];;){Xe(e,"Missing right hand side of binary expression."),t=rt(e);var r=Se(e.a);if(!r)break;var o=(r=fe[r]||null)&&r.w;if(!o){e.a.a--;break}for(;n.length&&o<=n[n.length-1].w;)t=new ue(n.pop(),n.pop(),t);n.push(t,r)}for(;n.length;)t=new ue(n.pop(),n.pop(),t);return t}function Xe(e,t){if(Oe(e.a))throw Error(t)}function Je(e,t){var n=Se(e.a);if(n!=t)throw Error("Bad token, expected: "+t+" got: "+n)}function Qe(e){if(")"!=(e=Se(e.a)))throw Error("Bad token: "+e)}function Ze(e){if(2>(e=Se(e.a)).length)throw Error("Unclosed literal string");return new Ee(e)}function et(e){var t,n,r=[];if(Ie(ke(e.a))){if(t=Se(e.a),n=ke(e.a),"/"==t&&(Oe(e.a)||"."!=n&&".."!=n&&"@"!=n&&"*"!=n&&!/(?![0-9])[\w]/.test(n)))return new je;n=new je,Xe(e,"Missing next location step."),t=tt(e,t),r.push(t)}else{e:{switch(n=(t=ke(e.a)).charAt(0)){case"$":throw Error("Variable reference not allowed in HTML XPath");case"(":Se(e.a),t=Ge(e),Xe(e,'unclosed "("'),Je(e,")");break;case'"':case"'":t=Ze(e);break;default:if(isNaN(+t)){if(xe(t)||!/(?![0-9])[\w]/.test(n)||"("!=ke(e.a,1)){t=null;break e}for(t=Se(e.a),t=ve[t]||null,Se(e.a),n=[];")"!=ke(e.a)&&(Xe(e,"Missing function argument list."),n.push(Ge(e)),","==ke(e.a));)Se(e.a);Xe(e,"Unclosed function argument list."),Qe(e),t=new ye(t,n)}else t=new Ye(+Se(e.a))}"["==ke(e.a)&&(t=new ge(t,n=new Ne(nt(e))))}if(t){if(!Ie(ke(e.a)))return t;n=t}else t=tt(e,"/"),n=new Me,r.push(t)}for(;Ie(ke(e.a));)t=Se(e.a),Xe(e,"Missing next location step."),t=tt(e,t),r.push(t);return new Pe(n,r)}function tt(e,t){var n,r,o,i;if("/"!=t&&"//"!=t)throw Error('Step op should be "/" or "//"');if("."==ke(e.a))return r=new Be(He,new _e("node")),Se(e.a),r;if(".."==ke(e.a))return r=new Be(Ue,new _e("node")),Se(e.a),r;if("@"==ke(e.a))i=ze,Se(e.a),Xe(e,"Missing attribute name");else if("::"==ke(e.a,1)){if(!/(?![0-9])[\w]/.test(ke(e.a).charAt(0)))throw Error("Bad token: "+Se(e.a));if(n=Se(e.a),!(i=De[n]||null))throw Error("No axis with name: "+n);Se(e.a),Xe(e,"Missing node name")}else i=$e;if(n=ke(e.a),!/(?![0-9])[\w\*]/.test(n.charAt(0)))throw Error("Bad token: "+Se(e.a));if("("==ke(e.a,1)){if(!xe(n))throw Error("Invalid node type: "+n);if(!xe(n=Se(e.a)))throw Error("Invalid type name: "+n);Je(e,"("),Xe(e,"Bad nodetype");var a=null;'"'!=(o=ke(e.a).charAt(0))&&"'"!=o||(a=Ze(e)),Xe(e,"Bad nodetype"),Qe(e),n=new _e(n,a)}else if(-1==(o=(n=Se(e.a)).indexOf(":")))n=new Te(n);else{var l;if("*"==(a=n.substring(0,o)))l="*";else if(!(l=e.b(a)))throw Error("Namespace prefix not declared: "+a);n=new Te(n=n.substr(o+1),l)}return o=new Ne(nt(e),i.a),r||new Be(i,n,o,"//"==t)}function nt(e){for(var t=[];"["==ke(e.a);){Se(e.a),Xe(e,"Missing predicate expression.");var n=Ge(e);t.push(n),Xe(e,"Unclosed predicate expression."),Je(e,"]")}return t}function rt(e){if("-"==ke(e.a))return Se(e.a),new Ve(rt(e));var t=et(e);if("|"!=ke(e.a))e=t;else{for(t=[t];"|"==Se(e.a);)Xe(e,"Missing next union location path."),t.push(et(e));e.a.a--,e=new Re(t)}return e}function ot(e){switch(e.nodeType){case 1:return function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}(at,e);case 9:return ot(e.documentElement);case 11:case 10:case 6:case 12:return it;default:return e.parentNode?ot(e.parentNode):it}}function it(){return null}function at(e,t){if(e.prefix==t)return e.namespaceURI||"http://www.w3.org/1999/xhtml";var n=e.getAttributeNode("xmlns:"+t);return n&&n.specified?n.value||null:e.parentNode&&9!=e.parentNode.nodeType?at(e.parentNode,t):null}function lt(e,t){if(!e.length)throw Error("Empty XPath expression.");var n=function(e){e=e.match(we);for(var t=0;t<e.length;t++)Ce.test(e[t])&&e.splice(t,1);return new function(e){this.b=e,this.a=0}(e)}(e);if(Oe(n))throw Error("Invalid XPath expression.");t?"function"==function(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t}(t)||(t=i(t.lookupNamespaceURI,t)):t=function(){return null};var r=Ge(new function(e,t){this.a=e,this.b=t}(n,t));if(!Oe(n))throw Error("Bad token: "+Se(n));this.evaluate=function(e,t){return new ut(r.a(new he(e)),t)}}function ut(e,t){if(0==t)if(e instanceof H)t=4;else if("string"==typeof e)t=2;else if("number"==typeof e)t=1;else{if("boolean"!=typeof e)throw Error("Unexpected evaluation result.");t=3}if(2!=t&&1!=t&&3!=t&&!(e instanceof H))throw Error("value could not be converted to the specified type");var n;switch(this.resultType=t,t){case 2:this.stringValue=e instanceof H?Q(e):""+e;break;case 1:this.numberValue=e instanceof H?+Q(e):+e;break;case 3:this.booleanValue=e instanceof H?0<e.l:!!e;break;case 4:case 5:case 6:case 7:var r=Z(e);n=[];for(var o=ee(r);o;o=ee(r))n.push(o instanceof N?o.a:o);this.snapshotLength=e.l,this.invalidIteratorState=!1;break;case 8:case 9:r=J(e),this.singleNodeValue=r instanceof N?r.a:r;break;default:throw Error("Unknown XPathResult type.")}var i=0;this.iterateNext=function(){if(4!=t&&5!=t)throw Error("iterateNext called with wrong result type");return i>=n.length?null:n[i++]},this.snapshotItem=function(e){if(6!=t&&7!=t)throw Error("snapshotItem called with wrong result type");return e>=n.length||0>e?null:n[e]}}function st(e,n){var r=e||t,o=r.Document&&r.Document.prototype||r.document;o.evaluate&&!n||(r.XPathResult=ut,o.evaluate=function(e,t,n,r){return new lt(e,n).evaluate(t,r)},o.createExpression=function(e,t){return new lt(e,t)},o.createNSResolver=function(e){return new function(e){this.lookupNamespaceURI=ot(e)}(e)})}a(Ve),Ve.prototype.a=function(e){return-ie(this.c,e)},Ve.prototype.toString=function(){return"Unary Expression: -"+ne(this.c)},a(Ye),Ye.prototype.a=function(){return this.c},Ye.prototype.toString=function(){return"Number: "+this.c},ut.ANY_TYPE=0,ut.NUMBER_TYPE=1,ut.STRING_TYPE=2,ut.BOOLEAN_TYPE=3,ut.UNORDERED_NODE_ITERATOR_TYPE=4,ut.ORDERED_NODE_ITERATOR_TYPE=5,ut.UNORDERED_NODE_SNAPSHOT_TYPE=6,ut.ORDERED_NODE_SNAPSHOT_TYPE=7,ut.ANY_UNORDERED_NODE_TYPE=8,ut.FIRST_ORDERED_NODE_TYPE=9;var ct,ft=["wgxpath","install"],dt=t;ft[0]in dt||!dt.execScript||dt.execScript("var "+ft[0]);for(;ft.length&&(ct=ft.shift());)ft.length||void 0===st?dt=dt[ct]?dt[ct]:dt[ct]={}:dt[ct]=st;e.exports.install=st,e.exports.XPathResultType={ANY_TYPE:0,NUMBER_TYPE:1,STRING_TYPE:2,BOOLEAN_TYPE:3,UNORDERED_NODE_ITERATOR_TYPE:4,ORDERED_NODE_ITERATOR_TYPE:5,UNORDERED_NODE_SNAPSHOT_TYPE:6,ORDERED_NODE_SNAPSHOT_TYPE:7,ANY_UNORDERED_NODE_TYPE:8,FIRST_ORDERED_NODE_TYPE:9}}).call(t)}).call(this,n(21))},function(e,t){e.exports=function(){}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(492),o=n(155),i=n(493),a=n(494),l=n(238),u=n(59),s=n(236),c=s(r),f=s(o),d=s(i),p=s(a),h=s(l),g=u;(r&&"[object DataView]"!=g(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=g(new o)||i&&"[object Promise]"!=g(i.resolve())||a&&"[object Set]"!=g(new a)||l&&"[object WeakMap]"!=g(new l))&&(g=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?s(n):"";if(r)switch(r){case c:return"[object DataView]";case f:return"[object Map]";case d:return"[object Promise]";case p:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=g},function(e,t,n){var r=n(122),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},function(e,t,n){e.exports=n(577)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(596));t.default=r.default},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(281),o=n(184);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(180);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";var r=n(8).OrderedMap,o={createFromArray:function(e){return r(e.map(function(e){return[e.getKey(),e]}))}};e.exports=o},function(e,t,n){"use strict";e.exports=function(e,t,n,r){if(e.size){var o=0;e.reduce(function(e,i,a){return t(e,i)||(n(e)&&r(o,a),o=a),i}),n(e.last())&&r(o,e.count())}}},function(e,t,n){"use strict";e.exports=function(e){return"handled"===e||!0===e}},function(e,t,n){"use strict";var r=n(34);e.exports=function(e,t,n){var o=e.getSelection(),i=e.getCurrentContent(),a=o;if(o.isCollapsed()){if("forward"===n){if(e.isSelectionAtEndOfContent())return i}else if(e.isSelectionAtStartOfContent())return i;if((a=t(e))===o)return i}return r.removeRange(i,a,n)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(428),o=n(46),i=Object.prototype,a=i.hasOwnProperty,l=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!l.call(e,"callee")};e.exports=u},function(e,t,n){var r=n(458),o=n(459),i=n(460),a=n(461),l=n(462);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=l,e.exports=u},function(e,t,n){var r=n(115);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(67)(Object,"create");e.exports=r},function(e,t,n){var r=n(476);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){(function(e){var r=n(45),o=n(483),i="object"==typeof t&&t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,l=a&&a.exports===i?r.Buffer:void 0,u=(l?l.isBuffer:void 0)||o;e.exports=u}).call(this,n(81)(e))},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(231),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,l=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=l}).call(this,n(81)(e))},function(e,t,n){var r=n(19),o=n(164),i=n(507),a=n(165);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},function(e,t,n){var r=n(59),o=n(46),i="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==i}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.YoastButton=t.YoastButtonBase=void 0,t.addButtonStyles=c;var r=l(n(0)),o=l(n(4)),i=l(n(1)),a=n(12);function l(e){return e&&e.__esModule?e:{default:e}}var u={minHeight:48,verticalPadding:0,borderWidth:0},s=u.minHeight-2*u.verticalPadding-2*u.borderWidth;function c(e){return(0,i.default)(e).withConfig({displayName:"YoastButton",componentId:"v1c803-0"})(["display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;min-height:",";margin:0;padding:0 16px;padding:",' 16px;border:0;border-radius:4px;box-sizing:border-box;font:400 14px/24px "Open Sans",sans-serif;text-transform:uppercase;box-shadow:0 2px 8px 0 ',";transition:box-shadow 150ms ease-out;&:hover,&:focus,&:active{box-shadow:0 4px 10px 0 ",",inset 0 0 0 100px ",";color:",';}&:active{transform:translateY( 1px );box-shadow:none;}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){::after{display:inline-block;content:"";min-height:',";}}"],u.minHeight+"px",u.verticalPadding+"px",(0,a.rgba)(a.colors.$color_black,.3),(0,a.rgba)(a.colors.$color_black,.2),(0,a.rgba)(a.colors.$color_black,.1),function(e){return e.textColor},s+"px")}var f=t.YoastButtonBase=function(e){var t=e.className,n=e.onClick,o=e.type,i=e.children,a=e.isExpanded;return r.default.createElement("button",{className:t,onClick:n,type:o,"aria-expanded":a},r.default.createElement("span",null,i))};f.propTypes={className:o.default.string,onClick:o.default.func,type:o.default.string,isExpanded:o.default.bool,children:o.default.oneOfType([o.default.arrayOf(o.default.node),o.default.node,o.default.string])},f.defaultProps={type:"button"};var d=t.YoastButton=c((0,i.default)(f).withConfig({displayName:"YoastButton",componentId:"v1c803-1"})(["color:",";background:",";min-width:152px;",";overflow:visible;cursor:pointer;&::-moz-focus-inner{border-width:0;}span{display:inherit;align-items:inherit;justify-content:inherit;width:100%;}"],function(e){return e.textColor},function(e){return e.backgroundColor},function(e){return e.withTextShadow?"text-shadow: 0 0 2px "+a.colors.$color_black:""}));d.propTypes={backgroundColor:o.default.string,textColor:o.default.string,withTextShadow:o.default.bool},d.defaultProps={backgroundColor:a.colors.$color_green_medium_light,textColor:a.colors.$color_white,withTextShadow:!0}},function(e,t,n){var r=n(244),o=n(100),i=n(112),a=n(19),l=n(69),u=n(118),s=n(99),c=n(159),f="[object Map]",d="[object Set]",p=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(l(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||c(e)||i(e)))return!e.length;var t=o(e);if(t==f||t==d)return!e.size;if(s(e))return!r(e).length;for(var n in e)if(p.call(e,n))return!1;return!0}},function(e,t){e.exports=!0},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";var r=n(611)(!0);n(286)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t){e.exports=function(e){return void 0===e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={set:function(e,t,n){e[t]=n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.YoastButton=t.YoastButtonBase=void 0,t.addButtonStyles=c;var r=l(n(0)),o=l(n(3)),i=l(n(1)),a=n(9);function l(e){return e&&e.__esModule?e:{default:e}}var u={minHeight:48,verticalPadding:0,borderWidth:0},s=u.minHeight-2*u.verticalPadding-2*u.borderWidth;function c(e){return(0,i.default)(e).withConfig({displayName:"YoastButton",componentId:"v1c803-0"})(["display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;min-height:",";margin:0;padding:0 16px;padding:",' 16px;border:0;border-radius:4px;box-sizing:border-box;font:400 14px/24px "Open Sans",sans-serif;text-transform:uppercase;box-shadow:0 2px 8px 0 ',";transition:box-shadow 150ms ease-out;&:hover,&:focus,&:active{box-shadow:0 4px 10px 0 ",",inset 0 0 0 100px ",";color:",';}&:active{transform:translateY( 1px );box-shadow:none;}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){::after{display:inline-block;content:"";min-height:',";}}"],u.minHeight+"px",u.verticalPadding+"px",(0,a.rgba)(a.colors.$color_black,.3),(0,a.rgba)(a.colors.$color_black,.2),(0,a.rgba)(a.colors.$color_black,.1),function(e){return e.textColor},s+"px")}var f=t.YoastButtonBase=function(e){var t=e.className,n=e.onClick,o=e.type,i=e.children,a=e.isExpanded;return r.default.createElement("button",{className:t,onClick:n,type:o,"aria-expanded":a},r.default.createElement("span",null,i))};f.propTypes={className:o.default.string,onClick:o.default.func,type:o.default.string,isExpanded:o.default.bool,children:o.default.oneOfType([o.default.arrayOf(o.default.node),o.default.node,o.default.string])},f.defaultProps={type:"button"};var d=t.YoastButton=c((0,i.default)(f).withConfig({displayName:"YoastButton",componentId:"v1c803-1"})(["color:",";background:",";min-width:152px;",";overflow:visible;cursor:pointer;&::-moz-focus-inner{border-width:0;}span{display:inherit;align-items:inherit;justify-content:inherit;width:100%;}"],function(e){return e.textColor},function(e){return e.backgroundColor},function(e){return e.withTextShadow?"text-shadow: 0 0 2px "+a.colors.$color_black:""}));d.propTypes={backgroundColor:o.default.string,textColor:o.default.string,withTextShadow:o.default.bool},d.defaultProps={backgroundColor:a.colors.$color_green_medium_light,textColor:a.colors.$color_white,withTextShadow:!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TriggerReplacementVariableSuggestionsButton=t.SimulatedLabel=t.StyledEditor=t.FormSection=t.DescriptionInputContainer=t.TitleInputContainer=t.withCaretStyles=t.InputContainer=t.angleLeft=t.angleRight=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),o=n(49),i=n(9),a=n(30);var l=t.angleRight=function(e){return"data:image/svg+xml;charset=utf8,"+encodeURIComponent('<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path fill="'+e+'" d="M1152 896q0 26-19 45l-448 448q-19 19-45 19t-45-19-19-45v-896q0-26 19-45t45-19 45 19l448 448q19 19 19 45z" /></svg>')},u=t.angleLeft=function(e){return"data:image/svg+xml;charset=utf8,"+encodeURIComponent('<svg width="1792" height="1792" viewBox="0 0 192 512" xmlns="http://www.w3.org/2000/svg"><path fill="'+e+'" d="M192 127.338v257.324c0 17.818-21.543 26.741-34.142 14.142L29.196 270.142c-7.81-7.81-7.81-20.474 0-28.284l128.662-128.662c12.599-12.6 34.142-3.676 34.142 14.142z"/></svg>')};function s(e){switch(!0){case e.isActive:return i.colors.$color_snippet_focus;case e.isHovered:return i.colors.$color_snippet_hover;default:return"transparent"}}var c=t.InputContainer=r.default.div.attrs({}).withConfig({displayName:"shared__InputContainer",componentId:"sc-1qsmlb9-0"})(["flex:0 1 100%;border:1px solid ",";padding:3px 5px;box-sizing:border-box;box-shadow:",";background-color:#fff;color:#32373c;outline:0;transition:50ms border-color ease-in-out;position:relative;font-family:Arial,Roboto-Regular,HelveticaNeue,sans-serif;font-size:14px;cursor:text;"],function(e){return e.isActive?"#5b9dd9":"#ddd"},function(e){return e.isActive?"0 0 2px rgba(30,140,190,.8);":"inset 0 1px 2px rgba(0,0,0,.07)"});function f(e){return(0,a.getDirectionalStyle)(l(s(e)),u(s(e)))(e)}t.withCaretStyles=function(e){return(0,r.default)(e).withConfig({displayName:"shared",componentId:"sc-1qsmlb9-1"})(["&::before{display:block;position:absolute;top:-1px;",":-25px;width:24px;height:24px;background-image:url( ",' );background-size:25px;content:"";}'],(0,a.getDirectionalStyle)("left","right"),f)},t.TitleInputContainer=(0,r.default)(c).withConfig({displayName:"shared__TitleInputContainer",componentId:"sc-1qsmlb9-2"})([".public-DraftStyleDefault-block{line-height:24px;}"]),t.DescriptionInputContainer=(0,r.default)(c).withConfig({displayName:"shared__DescriptionInputContainer",componentId:"sc-1qsmlb9-3"})(["min-height:72px;padding:2px 6px;line-height:24px;.public-DraftEditorPlaceholder-root{color:",";}.public-DraftEditorPlaceholder-hasFocus{color:",";}"],i.colors.$color_grey_text,i.colors.$color_grey_text),t.FormSection=r.default.div.withConfig({displayName:"shared__FormSection",componentId:"sc-1qsmlb9-4"})(["display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;margin:24px 0 0 0;"]),t.StyledEditor=r.default.section.withConfig({displayName:"shared__StyledEditor",componentId:"sc-1qsmlb9-5"})(["padding:",";"],function(e){return e.padding?e.padding:"0 20px"}),t.SimulatedLabel=r.default.div.withConfig({displayName:"shared__SimulatedLabel",componentId:"sc-1qsmlb9-6"})(["flex:1 1 200px;min-width:200px;cursor:pointer;font-size:16px;font-family:Arial,Roboto-Regular,HelveticaNeue,sans-serif;margin:4px 0;"]),t.TriggerReplacementVariableSuggestionsButton=(0,r.default)(o.Button).withConfig({displayName:"shared__TriggerReplacementVariableSuggestionsButton",componentId:"sc-1qsmlb9-7"})(["box-shadow:none;font-family:Arial,Roboto-Regular,HelveticaNeue,sans-serif;padding-left:8px;height:33px;border:1px solid #dbdbdb;font-size:13px;& svg{",":7px;fill:",";}"],(0,a.getDirectionalStyle)("margin-right","margin-left"),i.colors.$color_grey_dark)},function(e,t,n){"use strict";var r=n(335),o=n(336);e.exports=function(e,t){var n=t.getStartKey(),i=t.getStartOffset(),a=t.getEndKey(),l=t.getEndOffset(),u=o(e,t).getBlockMap(),s=u.keySeq(),c=s.indexOf(n),f=s.indexOf(a)+1;return r(u.slice(c,f).map(function(e,t){var r=e.getText(),o=e.getCharacterList();return n===a?e.merge({text:r.slice(i,l),characterList:o.slice(i,l)}):t===n?e.merge({text:r.slice(i),characterList:o.slice(i)}):t===a?e.merge({text:r.slice(0,l),characterList:o.slice(0,l)}):e}))}},function(e,t,n){"use strict";var r=n(42)||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(340),i=n(8),a=n(11),l=(0,i.Map)(),u=0;function s(e,t){console.warn("WARNING: "+e+' will be deprecated soon!\nPlease use "'+t+'" instead.')}var c={getLastCreatedEntityKey:function(){return s("DraftEntity.getLastCreatedEntityKey","contentState.getLastCreatedEntityKey"),c.__getLastCreatedEntityKey()},create:function(e,t,n){return s("DraftEntity.create","contentState.createEntity"),c.__create(e,t,n)},add:function(e){return s("DraftEntity.add","contentState.addEntity"),c.__add(e)},get:function(e){return s("DraftEntity.get","contentState.getEntity"),c.__get(e)},mergeData:function(e,t){return s("DraftEntity.mergeData","contentState.mergeEntityData"),c.__mergeData(e,t)},replaceData:function(e,t){return s("DraftEntity.replaceData","contentState.replaceEntityData"),c.__replaceData(e,t)},__getLastCreatedEntityKey:function(){return""+u},__create:function(e,t,n){return c.__add(new o({type:e,mutability:t,data:n||{}}))},__add:function(e){var t=""+ ++u;return l=l.set(t,e),t},__get:function(e){var t=l.get(e);return t||a(!1),t},__mergeData:function(e,t){var n=c.__get(e),o=r({},n.getData(),t),i=n.set("data",o);return l=l.set(e,i),i},__replaceData:function(e,t){var n=c.__get(e).set("data",t);return l=l.set(e,n),n}};e.exports=c},function(e,t,n){"use strict";var r={encode:function(e,t,n){return e+"-"+t+"-"+n},decode:function(e){var t=e.split("-"),n=t[0],r=t[1],o=t[2];return{blockKey:n,decoratorKey:parseInt(r,10),leafKey:parseInt(o,10)}}};e.exports=r},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,s=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?s=u.concat(s):f=-1,s.length&&p())}function p(){if(!c){var e=l(d);c=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new h(e,t)),1!==s.length||c||l(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){e.exports=n(976)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SiteSEOReport=t.renderRatingToColor=t.AnalysisList=t.AnalysisResult=t.ContentAnalysis=void 0;var r=n(376),o=u(r),i=u(n(1037)),a=u(n(377)),l=u(n(1038));function u(e){return e&&e.__esModule?e:{default:e}}t.ContentAnalysis=i.default,t.AnalysisResult=a.default,t.AnalysisList=o.default,t.renderRatingToColor=r.renderRatingToColor,t.SiteSEOReport=l.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.YoastButton=t.YoastButtonBase=void 0,t.addButtonStyles=c;var r=l(n(0)),o=l(n(2)),i=l(n(1)),a=n(7);function l(e){return e&&e.__esModule?e:{default:e}}var u={minHeight:48,verticalPadding:0,borderWidth:0},s=u.minHeight-2*u.verticalPadding-2*u.borderWidth;function c(e){return(0,i.default)(e).withConfig({displayName:"YoastButton",componentId:"v1c803-0"})(["display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;min-height:",";margin:0;padding:0 16px;padding:",' 16px;border:0;border-radius:4px;box-sizing:border-box;font:400 14px/24px "Open Sans",sans-serif;text-transform:uppercase;box-shadow:0 2px 8px 0 ',";transition:box-shadow 150ms ease-out;&:hover,&:focus,&:active{box-shadow:0 4px 10px 0 ",",inset 0 0 0 100px ",";color:",';}&:active{transform:translateY( 1px );box-shadow:none;}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){::after{display:inline-block;content:"";min-height:',";}}"],u.minHeight+"px",u.verticalPadding+"px",(0,a.rgba)(a.colors.$color_black,.3),(0,a.rgba)(a.colors.$color_black,.2),(0,a.rgba)(a.colors.$color_black,.1),function(e){return e.textColor},s+"px")}var f=t.YoastButtonBase=function(e){var t=e.className,n=e.onClick,o=e.type,i=e.children,a=e.isExpanded;return r.default.createElement("button",{className:t,onClick:n,type:o,"aria-expanded":a},r.default.createElement("span",null,i))};f.propTypes={className:o.default.string,onClick:o.default.func,type:o.default.string,isExpanded:o.default.bool,children:o.default.oneOfType([o.default.arrayOf(o.default.node),o.default.node,o.default.string])},f.defaultProps={type:"button"};var d=t.YoastButton=c((0,i.default)(f).withConfig({displayName:"YoastButton",componentId:"v1c803-1"})(["color:",";background:",";min-width:152px;",";overflow:visible;cursor:pointer;&::-moz-focus-inner{border-width:0;}span{display:inherit;align-items:inherit;justify-content:inherit;width:100%;}"],function(e){return e.textColor},function(e){return e.backgroundColor},function(e){return e.withTextShadow?"text-shadow: 0 0 2px "+a.colors.$color_black:""}));d.propTypes={backgroundColor:o.default.string,textColor:o.default.string,withTextShadow:o.default.bool},d.defaultProps={backgroundColor:a.colors.$color_green_medium_light,textColor:a.colors.$color_white,withTextShadow:!0}},function(e,t,n){(function(r){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e}(t=e.exports=n(1079)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&"%c"===e&&(i=++o)}),e.splice(i,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}).call(this,n(137))},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(21))},function(e,t,n){"use strict";t.a=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){"use strict";(function(e){var r=n(10),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.a.Buffer:void 0,l=a?a.allocUnsafe:void 0;t.a=function(e,t){if(t)return e.slice();var n=e.length,r=l?l(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(225)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getXPathText=i,t.parseFeed=l,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.parseFeedItem;return fetch(e).then(function(e){return e.text()}).then(function(e){return l(e,t,n)})};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(97)),o=n(229);function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(0!==t.evaluate("count("+e+")",n||t,r,XPathResult.ANY_TYPE,null).numberValue){var o=t.evaluate(e,n||t,r,XPathResult.STRING_TYPE,null);return o.stringValue?o.stringValue:null}}function a(e,t,n,r){var o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t.evaluate(e,n||t,r,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null)}("/rss/channel/item",e),i=o.snapshotLength,a=[];0!==n&&(i=Math.min(i,n));for(var l=0;l<i;l++){var u=o.snapshotItem(l);a.push(r(e,u,t))}return a}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments[2];return new Promise(function(o,l){try{"evaluate"in document==!1&&r.default.install();var u=(new DOMParser).parseFromString(e,"application/xml"),s=u.createNSResolver(u.documentElement),c=function(e){var t={};return t.title=i("/rss/channel/title",e),t.description=i("/rss/channel/description",e),t.link=i("/rss/channel/link",e),t}(u);c.items=a(u,s,t,n),o(c)}catch(e){l(e)}})}},function(e,t,n){var r=n(147),o=n(148);function i(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},function(e,t,n){var r=n(51),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(147),o=n(148),i=4294967295;function a(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=i,this.__views__=[]}a.prototype=r(o.prototype),a.prototype.constructor=a,e.exports=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getXPathText=i,t.parseFeed=l,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.parseFeedItem;return fetch(e).then(function(e){return e.text()}).then(function(e){return l(e,t,n)})};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(97)),o=n(241);function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(0!==t.evaluate("count("+e+")",n||t,r,XPathResult.ANY_TYPE,null).numberValue){var o=t.evaluate(e,n||t,r,XPathResult.STRING_TYPE,null);return o.stringValue?o.stringValue:null}}function a(e,t,n,r){var o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t.evaluate(e,n||t,r,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null)}("/rss/channel/item",e),i=o.snapshotLength,a=[];0!==n&&(i=Math.min(i,n));for(var l=0;l<i;l++){var u=o.snapshotItem(l);a.push(r(e,u,t))}return a}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments[2];return new Promise(function(o,l){try{"evaluate"in document==!1&&r.default.install();var u=(new DOMParser).parseFromString(e,"application/xml"),s=u.createNSResolver(u.documentElement),c=function(e){var t={};return t.title=i("/rss/channel/title",e),t.description=i("/rss/channel/description",e),t.link=i("/rss/channel/link",e),t}(u);c.items=a(u,s,t,n),o(c)}catch(e){l(e)}})}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t,n){var r=n(113),o=n(463),i=n(464),a=n(465),l=n(466),u=n(467);function s(e){var t=this.__data__=new r(e);this.size=t.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=a,s.prototype.has=l,s.prototype.set=u,e.exports=s},function(e,t,n){var r=n(67)(n(45),"Map");e.exports=r},function(e,t,n){var r=n(468),o=n(475),i=n(477),a=n(478),l=n(479);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=l,e.exports=u},function(e,t,n){var r=n(242),o=n(115),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(484),o=n(119),i=n(120),a=i&&i.isTypedArray,l=a?o(a):r;e.exports=l},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t,n){var r=n(247),o=n(248),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,l=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=l},function(e,t,n){var r=n(245)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(253);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t,n){var r=n(19),o=n(122),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},function(e,t,n){var r=n(254);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(121),o=n(101);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(169)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(4));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var t="h"+e.level;return r.default.createElement(t,{className:e.className},e.children)};a.propTypes={level:o.default.number,className:o.default.string,children:o.default.any},a.defaultProps={level:1},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isFeatureEnabled=function(e){return!!self.wpseoFeatureFlags&&self.wpseoFeatureFlags.includes(e)},t.enableFeatures=function(e){self.wpseoFeatureFlags||(self.wpseoFeatureFlags=[]),e.forEach(function(e){self.wpseoFeatureFlags.includes(e)||self.wpseoFeatureFlags.push(e)})},t.enabledFeatures=function(){return self.wpseoFeatureFlags||[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return e&&e.__esModule?e:{default:e}}(n(565));t.default=r.default,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(573)).default,o=r.canUseDOM?window.HTMLElement:{};t.canUseDOM=r.canUseDOM;t.default=o},function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==l){var u=e.displayName||e.name,s="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+u+" uses "+s+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var c=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",function(){return a}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},function(e,t,n){"use strict";t.__esModule=!0;var r=i(n(592)),o=i(n(176));i(n(277)),i(n(278));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){return(0,r.default)(function(e,t){return!(0,o.default)(e,t)})(e)}},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(595));t.default=r.default},function(e,t,n){var r=n(600);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(84);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(183)("keys"),o=n(127);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(33),o=n(61),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(126)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){"use strict";t.__esModule=!0;var r=a(n(609)),o=a(n(618)),i="function"==typeof o.default&&"symbol"==typeof r.default?function(e){return typeof e}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};function a(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof o.default&&"symbol"===i(r.default)?function(e){return void 0===e?"undefined":i(e)}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":void 0===e?"undefined":i(e)}},function(e,t,n){var r=n(71),o=n(613),i=n(184),a=n(182)("IE_PROTO"),l=function(){},u=function(){var e,t=n(280)("iframe"),r=i.length;for(t.style.display="none",n(614).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[i[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(l.prototype=r(e),n=new l,l.prototype=null,n[a]=e):n=u(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(62).f,o=n(73),i=n(47)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){n(615);for(var r=n(61),o=n(83),i=n(87),a=n(47)("toStringTag"),l="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<l.length;u++){var s=l[u],c=r[s],f=c&&c.prototype;f&&!f[a]&&o(f,a,s),i[s]=i.Array}},function(e,t,n){t.f=n(47)},function(e,t,n){var r=n(61),o=n(33),i=n(126),a=n(190),l=n(62).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||l(t,e,{value:a.f(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(291));t.default=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),h=1;h<t;h++)n[h-1]=arguments[h];var g=e=o.default.apply(void 0,[{zIndex:l.default,isRtl:!1,userAgent:void 0},a.default,e].concat(n)),y=g.spacing,m=g.fontFamily,v=g.palette,b={spacing:y,fontFamily:m,palette:v};e=(0,o.default)({appBar:{color:v.primary1Color,textColor:v.alternateTextColor,height:y.desktopKeylineIncrement,titleFontWeight:d.default.fontWeightNormal,padding:y.desktopGutter},avatar:{color:v.canvasColor,backgroundColor:(0,i.emphasize)(v.canvasColor,.26)},badge:{color:v.alternateTextColor,textColor:v.textColor,primaryColor:v.primary1Color,primaryTextColor:v.alternateTextColor,secondaryColor:v.accent1Color,secondaryTextColor:v.alternateTextColor,fontWeight:d.default.fontWeightMedium},bottomNavigation:{backgroundColor:v.canvasColor,unselectedColor:(0,i.fade)(v.textColor,.54),selectedColor:v.primary1Color,height:56,unselectedFontSize:12,selectedFontSize:14},button:{height:36,minWidth:88,iconButtonSize:2*y.iconSize},card:{titleColor:(0,i.fade)(v.textColor,.87),subtitleColor:(0,i.fade)(v.textColor,.54),fontWeight:d.default.fontWeightMedium},cardMedia:{color:p.darkWhite,overlayContentBackground:p.lightBlack,titleColor:p.darkWhite,subtitleColor:p.lightWhite},cardText:{textColor:v.textColor},checkbox:{boxColor:v.textColor,checkedColor:v.primary1Color,requiredColor:v.primary1Color,disabledColor:v.disabledColor,labelColor:v.textColor,labelDisabledColor:v.disabledColor},chip:{backgroundColor:(0,i.emphasize)(v.canvasColor,.12),deleteIconColor:(0,i.fade)(v.textColor,.26),textColor:(0,i.fade)(v.textColor,.87),fontSize:14,fontWeight:d.default.fontWeightNormal,shadow:"0 1px 6px "+(0,i.fade)(v.shadowColor,.12)+",\n 0 1px 4px "+(0,i.fade)(v.shadowColor,.12)},datePicker:{color:v.primary1Color,textColor:v.alternateTextColor,calendarTextColor:v.textColor,selectColor:v.primary2Color,selectTextColor:v.alternateTextColor,calendarYearBackgroundColor:v.canvasColor,headerColor:v.pickerHeaderColor||v.primary1Color},dialog:{titleFontSize:22,bodyFontSize:16,bodyColor:(0,i.fade)(v.textColor,.6)},dropDownMenu:{accentColor:v.borderColor},enhancedButton:{tapHighlightColor:p.transparent},flatButton:{color:p.transparent,buttonFilterColor:"#999999",disabledTextColor:(0,i.fade)(v.textColor,.3),textColor:v.textColor,primaryTextColor:v.primary1Color,secondaryTextColor:v.accent1Color,fontSize:d.default.fontStyleButtonFontSize,fontWeight:d.default.fontWeightMedium},floatingActionButton:{buttonSize:56,miniSize:40,color:v.primary1Color,iconColor:v.alternateTextColor,secondaryColor:v.accent1Color,secondaryIconColor:v.alternateTextColor,disabledTextColor:v.disabledColor,disabledColor:(0,i.emphasize)(v.canvasColor,.12)},gridTile:{textColor:p.white},icon:{color:v.canvasColor,backgroundColor:v.primary1Color},inkBar:{backgroundColor:v.accent1Color},drawer:{width:4*y.desktopKeylineIncrement,color:v.canvasColor},listItem:{nestedLevelDepth:18,secondaryTextColor:v.secondaryTextColor,leftIconColor:p.grey600,rightIconColor:p.grey600},menu:{backgroundColor:v.canvasColor,containerBackgroundColor:v.canvasColor},menuItem:{dataHeight:32,height:48,hoverColor:(0,i.fade)(v.textColor,.1),padding:y.desktopGutter,selectedTextColor:v.accent1Color,rightIconDesktopFill:p.grey600},menuSubheader:{padding:y.desktopGutter,borderColor:v.borderColor,textColor:v.primary1Color},overlay:{backgroundColor:p.lightBlack},paper:{color:v.textColor,backgroundColor:v.canvasColor,zDepthShadows:[[1,6,.12,1,4,.12],[3,10,.16,3,10,.23],[10,30,.19,6,10,.23],[14,45,.25,10,18,.22],[19,60,.3,15,20,.22]].map(function(e){return"0 "+e[0]+"px "+e[1]+"px "+(0,i.fade)(v.shadowColor,e[2])+",\n 0 "+e[3]+"px "+e[4]+"px "+(0,i.fade)(v.shadowColor,e[5])})},radioButton:{borderColor:v.textColor,backgroundColor:v.alternateTextColor,checkedColor:v.primary1Color,requiredColor:v.primary1Color,disabledColor:v.disabledColor,size:24,labelColor:v.textColor,labelDisabledColor:v.disabledColor},raisedButton:{color:v.alternateTextColor,textColor:v.textColor,primaryColor:v.primary1Color,primaryTextColor:v.alternateTextColor,secondaryColor:v.accent1Color,secondaryTextColor:v.alternateTextColor,disabledColor:(0,i.darken)(v.alternateTextColor,.1),disabledTextColor:(0,i.fade)(v.textColor,.3),fontSize:d.default.fontStyleButtonFontSize,fontWeight:d.default.fontWeightMedium},refreshIndicator:{strokeColor:v.borderColor,loadingStrokeColor:v.primary1Color},ripple:{color:(0,i.fade)(v.textColor,.87)},slider:{trackSize:2,trackColor:v.primary3Color,trackColorSelected:v.accent3Color,handleSize:12,handleSizeDisabled:8,handleSizeActive:18,handleColorZero:v.primary3Color,handleFillColor:v.alternateTextColor,selectionColor:v.primary1Color,rippleColor:v.primary1Color},snackbar:{textColor:v.alternateTextColor,backgroundColor:v.textColor,actionColor:v.accent1Color},subheader:{color:(0,i.fade)(v.textColor,.54),fontWeight:d.default.fontWeightMedium},stepper:{backgroundColor:"transparent",hoverBackgroundColor:(0,i.fade)(p.black,.06),iconColor:v.primary1Color,hoveredIconColor:p.grey700,inactiveIconColor:p.grey500,textColor:(0,i.fade)(p.black,.87),disabledTextColor:(0,i.fade)(p.black,.26),connectorLineColor:p.grey400},svgIcon:{color:v.textColor},table:{backgroundColor:v.canvasColor},tableFooter:{borderColor:v.borderColor,textColor:v.accent3Color},tableHeader:{borderColor:v.borderColor},tableHeaderColumn:{textColor:v.accent3Color,height:56,spacing:24},tableRow:{hoverColor:v.accent2Color,stripeColor:(0,i.fade)((0,i.lighten)(v.primary1Color,.5),.4),selectedColor:v.borderColor,textColor:v.textColor,borderColor:v.borderColor,height:48},tableRowColumn:{height:48,spacing:24},tabs:{backgroundColor:v.primary1Color,textColor:(0,i.fade)(v.alternateTextColor,.7),selectedTextColor:v.alternateTextColor},textField:{textColor:v.textColor,hintColor:v.disabledColor,floatingLabelColor:v.disabledColor,disabledTextColor:v.disabledColor,errorColor:p.red500,focusColor:v.primary1Color,backgroundColor:"transparent",borderColor:v.borderColor},timePicker:{color:v.alternateTextColor,textColor:v.alternateTextColor,accentColor:v.primary1Color,clockColor:v.textColor,clockCircleColor:v.clockCircleColor,headerColor:v.pickerHeaderColor||v.primary1Color,selectColor:v.primary2Color,selectTextColor:v.alternateTextColor},toggle:{thumbOnColor:v.primary1Color,thumbOffColor:v.accent2Color,thumbDisabledColor:v.borderColor,thumbRequiredColor:v.primary1Color,trackOnColor:(0,i.fade)(v.primary1Color,.5),trackOffColor:v.primary3Color,trackDisabledColor:v.primary3Color,labelColor:v.textColor,labelDisabledColor:v.disabledColor,trackRequiredColor:(0,i.fade)(v.primary1Color,.5)},toolbar:{color:(0,i.fade)(v.textColor,.54),hoverColor:(0,i.fade)(v.textColor,.87),backgroundColor:(0,i.darken)(v.accent2Color,.05),height:56,titleFontSize:20,iconColor:(0,i.fade)(v.textColor,.4),separatorColor:(0,i.fade)(v.textColor,.175),menuHoverColor:(0,i.fade)(v.textColor,.1)},tooltip:{color:p.white,rippleBackgroundColor:p.grey700,opacity:.9}},e,{baseTheme:b,rawTheme:b});var _=[u.default,c.default,s.default].map(function(t){return t(e)}).filter(function(e){return e});return e.prepareStyles=f.default.apply(void 0,(0,r.default)(_)),e};var o=h(n(641)),i=n(295),a=h(n(642)),l=h(n(644)),u=h(n(645)),s=h(n(670)),c=h(n(671)),f=h(n(675)),d=h(n(676)),p=n(193);function h(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.red50="#ffebee",t.red100="#ffcdd2",t.red200="#ef9a9a",t.red300="#e57373",t.red400="#ef5350",t.red500="#f44336",t.red600="#e53935",t.red700="#d32f2f",t.red800="#c62828",t.red900="#b71c1c",t.redA100="#ff8a80",t.redA200="#ff5252",t.redA400="#ff1744",t.redA700="#d50000",t.pink50="#fce4ec",t.pink100="#f8bbd0",t.pink200="#f48fb1",t.pink300="#f06292",t.pink400="#ec407a",t.pink500="#e91e63",t.pink600="#d81b60",t.pink700="#c2185b",t.pink800="#ad1457",t.pink900="#880e4f",t.pinkA100="#ff80ab",t.pinkA200="#ff4081",t.pinkA400="#f50057",t.pinkA700="#c51162",t.purple50="#f3e5f5",t.purple100="#e1bee7",t.purple200="#ce93d8",t.purple300="#ba68c8",t.purple400="#ab47bc",t.purple500="#9c27b0",t.purple600="#8e24aa",t.purple700="#7b1fa2",t.purple800="#6a1b9a",t.purple900="#4a148c",t.purpleA100="#ea80fc",t.purpleA200="#e040fb",t.purpleA400="#d500f9",t.purpleA700="#aa00ff",t.deepPurple50="#ede7f6",t.deepPurple100="#d1c4e9",t.deepPurple200="#b39ddb",t.deepPurple300="#9575cd",t.deepPurple400="#7e57c2",t.deepPurple500="#673ab7",t.deepPurple600="#5e35b1",t.deepPurple700="#512da8",t.deepPurple800="#4527a0",t.deepPurple900="#311b92",t.deepPurpleA100="#b388ff",t.deepPurpleA200="#7c4dff",t.deepPurpleA400="#651fff",t.deepPurpleA700="#6200ea",t.indigo50="#e8eaf6",t.indigo100="#c5cae9",t.indigo200="#9fa8da",t.indigo300="#7986cb",t.indigo400="#5c6bc0",t.indigo500="#3f51b5",t.indigo600="#3949ab",t.indigo700="#303f9f",t.indigo800="#283593",t.indigo900="#1a237e",t.indigoA100="#8c9eff",t.indigoA200="#536dfe",t.indigoA400="#3d5afe",t.indigoA700="#304ffe",t.blue50="#e3f2fd",t.blue100="#bbdefb",t.blue200="#90caf9",t.blue300="#64b5f6",t.blue400="#42a5f5",t.blue500="#2196f3",t.blue600="#1e88e5",t.blue700="#1976d2",t.blue800="#1565c0",t.blue900="#0d47a1",t.blueA100="#82b1ff",t.blueA200="#448aff",t.blueA400="#2979ff",t.blueA700="#2962ff",t.lightBlue50="#e1f5fe",t.lightBlue100="#b3e5fc",t.lightBlue200="#81d4fa",t.lightBlue300="#4fc3f7",t.lightBlue400="#29b6f6",t.lightBlue500="#03a9f4",t.lightBlue600="#039be5",t.lightBlue700="#0288d1",t.lightBlue800="#0277bd",t.lightBlue900="#01579b",t.lightBlueA100="#80d8ff",t.lightBlueA200="#40c4ff",t.lightBlueA400="#00b0ff",t.lightBlueA700="#0091ea",t.cyan50="#e0f7fa",t.cyan100="#b2ebf2",t.cyan200="#80deea",t.cyan300="#4dd0e1",t.cyan400="#26c6da",t.cyan500="#00bcd4",t.cyan600="#00acc1",t.cyan700="#0097a7",t.cyan800="#00838f",t.cyan900="#006064",t.cyanA100="#84ffff",t.cyanA200="#18ffff",t.cyanA400="#00e5ff",t.cyanA700="#00b8d4",t.teal50="#e0f2f1",t.teal100="#b2dfdb",t.teal200="#80cbc4",t.teal300="#4db6ac",t.teal400="#26a69a",t.teal500="#009688",t.teal600="#00897b",t.teal700="#00796b",t.teal800="#00695c",t.teal900="#004d40",t.tealA100="#a7ffeb",t.tealA200="#64ffda",t.tealA400="#1de9b6",t.tealA700="#00bfa5",t.green50="#e8f5e9",t.green100="#c8e6c9",t.green200="#a5d6a7",t.green300="#81c784",t.green400="#66bb6a",t.green500="#4caf50",t.green600="#43a047",t.green700="#388e3c",t.green800="#2e7d32",t.green900="#1b5e20",t.greenA100="#b9f6ca",t.greenA200="#69f0ae",t.greenA400="#00e676",t.greenA700="#00c853",t.lightGreen50="#f1f8e9",t.lightGreen100="#dcedc8",t.lightGreen200="#c5e1a5",t.lightGreen300="#aed581",t.lightGreen400="#9ccc65",t.lightGreen500="#8bc34a",t.lightGreen600="#7cb342",t.lightGreen700="#689f38",t.lightGreen800="#558b2f",t.lightGreen900="#33691e",t.lightGreenA100="#ccff90",t.lightGreenA200="#b2ff59",t.lightGreenA400="#76ff03",t.lightGreenA700="#64dd17",t.lime50="#f9fbe7",t.lime100="#f0f4c3",t.lime200="#e6ee9c",t.lime300="#dce775",t.lime400="#d4e157",t.lime500="#cddc39",t.lime600="#c0ca33",t.lime700="#afb42b",t.lime800="#9e9d24",t.lime900="#827717",t.limeA100="#f4ff81",t.limeA200="#eeff41",t.limeA400="#c6ff00",t.limeA700="#aeea00",t.yellow50="#fffde7",t.yellow100="#fff9c4",t.yellow200="#fff59d",t.yellow300="#fff176",t.yellow400="#ffee58",t.yellow500="#ffeb3b",t.yellow600="#fdd835",t.yellow700="#fbc02d",t.yellow800="#f9a825",t.yellow900="#f57f17",t.yellowA100="#ffff8d",t.yellowA200="#ffff00",t.yellowA400="#ffea00",t.yellowA700="#ffd600",t.amber50="#fff8e1",t.amber100="#ffecb3",t.amber200="#ffe082",t.amber300="#ffd54f",t.amber400="#ffca28",t.amber500="#ffc107",t.amber600="#ffb300",t.amber700="#ffa000",t.amber800="#ff8f00",t.amber900="#ff6f00",t.amberA100="#ffe57f",t.amberA200="#ffd740",t.amberA400="#ffc400",t.amberA700="#ffab00",t.orange50="#fff3e0",t.orange100="#ffe0b2",t.orange200="#ffcc80",t.orange300="#ffb74d",t.orange400="#ffa726",t.orange500="#ff9800",t.orange600="#fb8c00",t.orange700="#f57c00",t.orange800="#ef6c00",t.orange900="#e65100",t.orangeA100="#ffd180",t.orangeA200="#ffab40",t.orangeA400="#ff9100",t.orangeA700="#ff6d00",t.deepOrange50="#fbe9e7",t.deepOrange100="#ffccbc",t.deepOrange200="#ffab91",t.deepOrange300="#ff8a65",t.deepOrange400="#ff7043",t.deepOrange500="#ff5722",t.deepOrange600="#f4511e",t.deepOrange700="#e64a19",t.deepOrange800="#d84315",t.deepOrange900="#bf360c",t.deepOrangeA100="#ff9e80",t.deepOrangeA200="#ff6e40",t.deepOrangeA400="#ff3d00",t.deepOrangeA700="#dd2c00",t.brown50="#efebe9",t.brown100="#d7ccc8",t.brown200="#bcaaa4",t.brown300="#a1887f",t.brown400="#8d6e63",t.brown500="#795548",t.brown600="#6d4c41",t.brown700="#5d4037",t.brown800="#4e342e",t.brown900="#3e2723",t.blueGrey50="#eceff1",t.blueGrey100="#cfd8dc",t.blueGrey200="#b0bec5",t.blueGrey300="#90a4ae",t.blueGrey400="#78909c",t.blueGrey500="#607d8b",t.blueGrey600="#546e7a",t.blueGrey700="#455a64",t.blueGrey800="#37474f",t.blueGrey900="#263238",t.grey50="#fafafa",t.grey100="#f5f5f5",t.grey200="#eeeeee",t.grey300="#e0e0e0",t.grey400="#bdbdbd",t.grey500="#9e9e9e",t.grey600="#757575",t.grey700="#616161",t.grey800="#424242",t.grey900="#212121",t.black="#000000",t.white="#ffffff",t.transparent="rgba(0, 0, 0, 0)",t.fullBlack="rgba(0, 0, 0, 1)",t.darkBlack="rgba(0, 0, 0, 0.87)",t.lightBlack="rgba(0, 0, 0, 0.54)",t.minBlack="rgba(0, 0, 0, 0.26)",t.faintBlack="rgba(0, 0, 0, 0.12)",t.fullWhite="rgba(255, 255, 255, 1)",t.darkWhite="rgba(255, 255, 255, 0.87)",t.lightWhite="rgba(255, 255, 255, 0.54)"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"string"==typeof e&&r.test(e)};var r=/-webkit-|-moz-|-ms-/;e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getXPathText=i,t.parseFeed=l,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.parseFeedItem;return fetch(e).then(function(e){return e.text()}).then(function(e){return l(e,t,n)})};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(97)),o=n(301);function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(0!==t.evaluate("count("+e+")",n||t,r,XPathResult.ANY_TYPE,null).numberValue){var o=t.evaluate(e,n||t,r,XPathResult.STRING_TYPE,null);return o.stringValue?o.stringValue:null}}function a(e,t,n,r){var o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t.evaluate(e,n||t,r,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null)}("/rss/channel/item",e),i=o.snapshotLength,a=[];0!==n&&(i=Math.min(i,n));for(var l=0;l<i;l++){var u=o.snapshotItem(l);a.push(r(e,u,t))}return a}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments[2];return new Promise(function(o,l){try{"evaluate"in document==!1&&r.default.install();var u=(new DOMParser).parseFromString(e,"application/xml"),s=u.createNSResolver(u.documentElement),c=function(e){var t={};return t.title=i("/rss/channel/title",e),t.description=i("/rss/channel/description",e),t.link=i("/rss/channel/link",e),t}(u);c.items=a(u,s,t,n),o(c)}catch(e){l(e)}})}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=u(n(695)),i=u(n(0)),a=u(n(15)),l=(u(n(82)),n(696));function u(e){return e&&e.__esModule?e:{default:e}}a.default.any,a.default.func,a.default.node;var s=function(e){function t(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o));return i.performAppear=function(e,t){i.currentlyTransitioningKeys[e]=!0,t.componentWillAppear?t.componentWillAppear(i._handleDoneAppearing.bind(i,e,t)):i._handleDoneAppearing(e,t)},i._handleDoneAppearing=function(e,t){t.componentDidAppear&&t.componentDidAppear(),delete i.currentlyTransitioningKeys[e];var n=(0,l.getChildMapping)(i.props.children);n&&n.hasOwnProperty(e)||i.performLeave(e,t)},i.performEnter=function(e,t){i.currentlyTransitioningKeys[e]=!0,t.componentWillEnter?t.componentWillEnter(i._handleDoneEntering.bind(i,e,t)):i._handleDoneEntering(e,t)},i._handleDoneEntering=function(e,t){t.componentDidEnter&&t.componentDidEnter(),delete i.currentlyTransitioningKeys[e];var n=(0,l.getChildMapping)(i.props.children);n&&n.hasOwnProperty(e)||i.performLeave(e,t)},i.performLeave=function(e,t){i.currentlyTransitioningKeys[e]=!0,t.componentWillLeave?t.componentWillLeave(i._handleDoneLeaving.bind(i,e,t)):i._handleDoneLeaving(e,t)},i._handleDoneLeaving=function(e,t){t.componentDidLeave&&t.componentDidLeave(),delete i.currentlyTransitioningKeys[e];var n=(0,l.getChildMapping)(i.props.children);n&&n.hasOwnProperty(e)?i.keysToEnter.push(e):i.setState(function(t){var n=r({},t.children);return delete n[e],{children:n}})},i.childRefs=Object.create(null),i.state={children:(0,l.getChildMapping)(n.children)},i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentWillMount=function(){this.currentlyTransitioningKeys={},this.keysToEnter=[],this.keysToLeave=[]},t.prototype.componentDidMount=function(){var e=this.state.children;for(var t in e)e[t]&&this.performAppear(t,this.childRefs[t])},t.prototype.componentWillReceiveProps=function(e){var t=(0,l.getChildMapping)(e.children),n=this.state.children;for(var r in this.setState({children:(0,l.mergeChildMappings)(n,t)}),t){var o=n&&n.hasOwnProperty(r);!t[r]||o||this.currentlyTransitioningKeys[r]||this.keysToEnter.push(r)}for(var i in n){var a=t&&t.hasOwnProperty(i);!n[i]||a||this.currentlyTransitioningKeys[i]||this.keysToLeave.push(i)}},t.prototype.componentDidUpdate=function(){var e=this,t=this.keysToEnter;this.keysToEnter=[],t.forEach(function(t){return e.performEnter(t,e.childRefs[t])});var n=this.keysToLeave;this.keysToLeave=[],n.forEach(function(t){return e.performLeave(t,e.childRefs[t])})},t.prototype.render=function(){var e=this,t=[],n=function(n){var r=e.state.children[n];if(r){var a="string"!=typeof r.ref,l=e.props.childFactory(r),u=function(t){e.childRefs[n]=t};l===r&&a&&(u=(0,o.default)(r.ref,u)),t.push(i.default.cloneElement(l,{key:n,ref:u}))}};for(var a in this.state.children)n(a);var l=r({},this.props);return delete l.transitionLeave,delete l.transitionName,delete l.transitionAppear,delete l.transitionEnter,delete l.childFactory,delete l.transitionLeaveTimeout,delete l.transitionEnterTimeout,delete l.transitionAppearTimeout,delete l.component,i.default.createElement(this.props.component,l,t)},t}(i.default.Component);s.displayName="TransitionGroup",s.propTypes={},s.defaultProps={component:"span",childFactory:function(e){return e}},t.default=s,e.exports=t.default},function(e,t,n){var r=n(51),o=n(730),i=n(312),a="Expected a function",l=Math.max,u=Math.min;e.exports=function(e,t,n){var s,c,f,d,p,h,g=0,y=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError(a);function b(t){var n=s,r=c;return s=c=void 0,g=t,d=e.apply(r,n)}function _(e){var n=e-h;return void 0===h||n>=t||n<0||m&&e-g>=f}function x(){var e=o();if(_(e))return w(e);p=setTimeout(x,function(e){var n=t-(e-h);return m?u(n,f-(e-g)):n}(e))}function w(e){return p=void 0,v&&s?b(e):(s=c=void 0,d)}function C(){var e=o(),n=_(e);if(s=arguments,c=this,h=e,n){if(void 0===p)return function(e){return g=e,p=setTimeout(x,t),y?b(e):d}(h);if(m)return p=setTimeout(x,t),b(h)}return void 0===p&&(p=setTimeout(x,t)),d}return t=i(t)||0,r(n)&&(y=!!n.leading,f=(m="maxWait"in n)?l(i(n.maxWait)||0,t):f,v="trailing"in n?!!n.trailing:v),C.cancel=function(){void 0!==p&&clearTimeout(p),g=0,s=h=c=p=void 0},C.flush=function(){return void 0===p?d:w(o())},C}},function(e,t,n){var r=n(165),o=0;e.exports=function(e){var t=++o;return r(e)+t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getXPathText=i,t.parseFeed=l,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.parseFeedItem;return fetch(e).then(function(e){return e.text()}).then(function(e){return l(e,t,n)})};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(97)),o=n(313);function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(0!==t.evaluate("count("+e+")",n||t,r,XPathResult.ANY_TYPE,null).numberValue){var o=t.evaluate(e,n||t,r,XPathResult.STRING_TYPE,null);return o.stringValue?o.stringValue:null}}function a(e,t,n,r){var o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t.evaluate(e,n||t,r,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null)}("/rss/channel/item",e),i=o.snapshotLength,a=[];0!==n&&(i=Math.min(i,n));for(var l=0;l<i;l++){var u=o.snapshotItem(l);a.push(r(e,u,t))}return a}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments[2];return new Promise(function(o,l){try{"evaluate"in document==!1&&r.default.install();var u=(new DOMParser).parseFromString(e,"application/xml"),s=u.createNSResolver(u.documentElement),c=function(e){var t={};return t.title=i("/rss/channel/title",e),t.description=i("/rss/channel/description",e),t.link=i("/rss/channel/link",e),t}(u);c.items=a(u,s,t,n),o(c)}catch(e){l(e)}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(3));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var t="h"+e.level;return r.default.createElement(t,{className:e.className},e.children)};a.propTypes={level:o.default.number,className:o.default.string,children:o.default.any},a.defaultProps={level:1},t.default=a},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t,n){var r=n(802);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t){e.exports=window.yoast.analysis},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.MODE_MOBILE="mobile",o=t.MODE_DESKTOP="desktop",i=t.MODES=[o,r],a=t.DEFAULT_MODE=r;t.default={MODE_MOBILE:r,MODE_DESKTOP:o,MODES:i,DEFAULT_MODE:a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=d(n(0)),i=d(n(3)),a=d(n(199)),l=n(5),u=n(49),s=d(n(807)),c=n(133),f=n(76);function d(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));switch(n.uniqueId=(0,a.default)(),e.type){case"description":n.InputContainer=c.DescriptionInputContainer;break;case"title":n.InputContainer=c.TitleInputContainer;break;default:n.InputContainer=c.TitleInputContainer}return e.withCaret&&(n.InputContainer=(0,c.withCaretStyles)(n.InputContainer)),n.triggerReplacementVariableSuggestions=n.triggerReplacementVariableSuggestions.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default.Component),r(t,[{key:"triggerReplacementVariableSuggestions",value:function(){this.ref.triggerReplacementVariableSuggestions()}},{key:"render",value:function(){var e=this,t=this.props,n=t.label,r=t.onChange,i=t.content,a=t.onFocus,f=t.onBlur,d=t.isActive,p=t.isHovered,h=t.replacementVariables,g=t.recommendedReplacementVariables,y=t.editorRef,m=t.placeholder,v=t.fieldId,b=this.InputContainer,_=o.default.createElement(c.TriggerReplacementVariableSuggestionsButton,{onClick:function(){return e.triggerReplacementVariableSuggestions()}},o.default.createElement(u.SvgIcon,{icon:"plus-circle"}),(0,l.__)("Insert snippet variable","yoast-components"));return o.default.createElement(o.default.Fragment,null,o.default.createElement(c.SimulatedLabel,{id:this.uniqueId,onClick:a},n),_,o.default.createElement(b,{onClick:a,isActive:d,isHovered:p},o.default.createElement(s.default,{fieldId:v,placeholder:m,content:i,onChange:r,onFocus:a,onBlur:f,replacementVariables:h,recommendedReplacementVariables:g,ref:function(t){e.ref=t,y(t)},ariaLabelledBy:this.uniqueId})))}}]),t}();p.propTypes={editorRef:i.default.func,content:i.default.string.isRequired,onChange:i.default.func.isRequired,onBlur:i.default.func,replacementVariables:f.replacementVariablesShape,recommendedReplacementVariables:f.recommendedReplacementVariablesShape,isActive:i.default.bool,isHovered:i.default.bool,withCaret:i.default.bool,onFocus:i.default.func,label:i.default.string,placeholder:i.default.string,type:i.default.oneOf(["title","description"]),fieldId:i.default.string},p.defaultProps={replacementVariables:[]},t.default=p},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";var r=n(107),o=n(39),i=n(74),a=n(43),l=n(135),u=n(63),s=n(8),c=n(90),f=n(58),d=n(209),p=s.List,h=s.Record,g=s.Repeat,y=u.draft_tree_data_support?a:i,m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getEntityMap=function(){return l},t.prototype.getBlockMap=function(){return this.get("blockMap")},t.prototype.getSelectionBefore=function(){return this.get("selectionBefore")},t.prototype.getSelectionAfter=function(){return this.get("selectionAfter")},t.prototype.getBlockForKey=function(e){return this.getBlockMap().get(e)},t.prototype.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},t.prototype.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},t.prototype.getBlockAfter=function(e){return this.getBlockMap().skipUntil(function(t,n){return n===e}).skip(1).first()},t.prototype.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil(function(t,n){return n===e}).skip(1).first()},t.prototype.getBlocksAsArray=function(){return this.getBlockMap().toArray()},t.prototype.getFirstBlock=function(){return this.getBlockMap().first()},t.prototype.getLastBlock=function(){return this.getBlockMap().last()},t.prototype.getPlainText=function(e){return this.getBlockMap().map(function(e){return e?e.getText():""}).join(e||"\n")},t.prototype.getLastCreatedEntityKey=function(){return l.__getLastCreatedEntityKey()},t.prototype.hasText=function(){var e=this.getBlockMap();return e.size>1||e.first().getLength()>0},t.prototype.createEntity=function(e,t,n){return l.__create(e,t,n),this},t.prototype.mergeEntityData=function(e,t){return l.__mergeData(e,t),this},t.prototype.replaceEntityData=function(e,t){return l.__replaceData(e,t),this},t.prototype.addEntity=function(e){return l.__add(e),this},t.prototype.getEntity=function(e){return l.__get(e)},t.createFromBlockArray=function(e,n){var o=Array.isArray(e)?e:e.contentBlocks,i=r.createFromArray(o),a=i.isEmpty()?new c:c.createEmpty(i.first().getKey());return new t({blockMap:i,entityMap:n||l,selectionBefore:a,selectionAfter:a})},t.createFromText=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,r=e.split(n).map(function(e){return e=d(e),new y({key:f(),text:e,type:"unstyled",characterList:p(g(o.EMPTY,e.length))})});return t.createFromBlockArray(r)},t}(h({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}));e.exports=m},function(e,t,n){"use strict";var r=new RegExp("\r","g");e.exports=function(e){return e.replace(r,"")}},function(e,t,n){"use strict";var r=n(11),o="LTR",i="RTL",a=null;function l(e){return e===o||e===i}function u(e){return l(e)||r(!1),e===o?"ltr":"rtl"}function s(e){a=e}var c={NEUTRAL:"NEUTRAL",LTR:o,RTL:i,isStrong:l,getHTMLDir:u,getHTMLDirIfDifferent:function(e,t){return l(e)||r(!1),l(t)||r(!1),e===t?null:u(e)},setGlobalDir:s,initGlobalDir:function(){s(o)},getGlobalDir:function(){return a||this.initGlobalDir(),a||r(!1),a}};e.exports=c},function(e,t,n){"use strict";var r=n(8).Map,o=n(0),i=n(91),a=r({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},"unordered-list-item":{element:"li",wrapper:o.createElement("ul",{className:i("public/DraftStyleDefault/ul")})},"ordered-list-item":{element:"li",wrapper:o.createElement("ol",{className:i("public/DraftStyleDefault/ol")})},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:o.createElement("pre",{className:i("public/DraftStyleDefault/pre")})},unstyled:{element:"div",aliasedElements:["p"]}});e.exports=a},function(e,t,n){"use strict";e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},function(e,t,n){"use strict";function r(e,t){return t&&"MUTABLE"===e.__get(t).getMutability()?t:null}e.exports=function(e,t){var n;if(t.isCollapsed()){var o=t.getAnchorKey(),i=t.getAnchorOffset();return i>0?(n=e.getBlockForKey(o).getEntityAt(i-1))!==e.getBlockForKey(o).getEntityAt(i)?null:r(e.getEntityMap(),n):null}var a=t.getStartKey(),l=t.getStartOffset(),u=e.getBlockForKey(a);return n=l===u.getLength()?null:u.getEntityAt(l),r(e.getEntityMap(),n)}},function(e,t,n){"use strict";var r=n(841);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},function(e,t,n){"use strict";function r(e,t){var n=o.get(e,t);return"auto"===n||"scroll"===n}var o={get:n(843),getScrollParent:function(e){if(!e)return null;for(var t=e.ownerDocument;e&&e!==t.body;){if(r(e,"overflow")||r(e,"overflowY")||r(e,"overflowX"))return e;e=e.parentNode}return t.defaultView||t.parentWindow}};e.exports=o},function(e,t,n){"use strict";var r=n(848),o=n(849);e.exports=function(e){var t=r(e.ownerDocument||e.document);e.Window&&e instanceof e.Window&&(e=t);var n=o(e),i=e===t?e.ownerDocument.documentElement:e,a=e.scrollWidth-i.clientWidth,l=e.scrollHeight-i.clientHeight;return n.x=Math.max(0,Math.min(n.x,a)),n.y=Math.max(0,Math.min(n.y,l)),n}},function(e,t,n){"use strict";var r=n(348);e.exports=function(e){for(var t=e;t&&t!==document.documentElement;){var n=r(t);if(null!=n)return n;t=t.parentNode}return null}},function(e,t,n){"use strict";var r=n(55).isPlatform("Mac OS X"),o={isCtrlKeyCommand:function(e){return!!e.ctrlKey&&!e.altKey},isOptionKeyCommand:function(e){return r&&e.altKey},hasCommandModifier:function(e){return r?!!e.metaKey&&!e.altKey:o.isCtrlKeyCommand(e)}};e.exports=o},function(e,t,n){"use strict";e.exports=function(e,t){var n=e.getSelection(),r=e.getCurrentContent(),o=n.getStartKey(),i=n.getStartOffset(),a=o,l=0;if(t>i){var u=r.getKeyBefore(o);null==u?a=o:(a=u,l=r.getBlockForKey(u).getText().length)}else l=i-t;return n.merge({focusKey:a,focusOffset:l,isBackward:!0})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getXPathText=i,t.parseFeed=l,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.parseFeedItem;return fetch(e).then(function(e){return e.text()}).then(function(e){return l(e,t,n)})};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(97)),o=n(378);function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(0!==t.evaluate("count("+e+")",n||t,r,XPathResult.ANY_TYPE,null).numberValue){var o=t.evaluate(e,n||t,r,XPathResult.STRING_TYPE,null);return o.stringValue?o.stringValue:null}}function a(e,t,n,r){var o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t.evaluate(e,n||t,r,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null)}("/rss/channel/item",e),i=o.snapshotLength,a=[];0!==n&&(i=Math.min(i,n));for(var l=0;l<i;l++){var u=o.snapshotItem(l);a.push(r(e,u,t))}return a}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments[2];return new Promise(function(o,l){try{"evaluate"in document==!1&&r.default.install();var u=(new DOMParser).parseFromString(e,"application/xml"),s=u.createNSResolver(u.documentElement),c=function(e){var t={};return t.title=i("/rss/channel/title",e),t.description=i("/rss/channel/description",e),t.link=i("/rss/channel/link",e),t}(u);c.items=a(u,s,t,n),o(c)}catch(e){l(e)}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(2));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var t="h"+e.level;return r.default.createElement(t,{className:e.className},e.children)};a.propTypes={level:o.default.number,className:o.default.string,children:o.default.any},a.defaultProps={level:1},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSeoResultsForKeyword=function(e,t){return{type:i,keyword:e,results:t}},t.setSeoResults=function(e){return{type:o,resultsPerKeyword:e}},t.updateSeoResult=function(e,t){return{type:a,keyword:e,result:t}},t.removeKeyword=function(e){return{type:l,keyword:e}},t.setReadabilityResults=function(e){return{type:u,results:e}},t.updateReadabilityResult=function(e){return{type:s,result:e}},t.setOverallReadabilityScore=function(e){return{type:c,overallScore:e}},t.setOverallSeoScore=function(e,t){return{type:f,keyword:t,overallScore:e}};var r="CONTENT_ANALYSIS_",o=t.SET_SEO_RESULTS=r+"SET_SEO_RESULTS",i=t.SET_SEO_RESULTS_FOR_KEYWORD=r+"SET_SEO_RESULTS_FOR_KEYWORD",a=t.UPDATE_SEO_RESULT=r+"UPDATE_SEO_RESULT",l=t.REMOVE_KEYWORD=r+"REMOVE_KEYWORD",u=t.SET_READABILITY_RESULTS=r+"SET_READABILITY_RESULTS",s=t.UPDATE_READABILITY_RESULT=r+"UPDATE_READABILITY_RESULT",c=t.SET_OVERALL_READABILITY_SCORE=r+"SET_OVERALL_READABILITY_SCORE",f=t.SET_OVERALL_SEO_SCORE=r+"SET_OVERALL_SEO_SCORE"},function(e,t){e.exports=function(e,t){var n=!1;return function(){return n||(console.warn(t),n=!0),e.apply(this,arguments)}}},function(e,t){e.exports=function(e,t){return"algoliasearch: `"+e+"` was replaced by `"+t+"`. Please see https://github.com/algolia/algoliasearch-client-javascript/wiki/Deprecated#"+e.toLowerCase().replace(/[\.\(\)]/g,"")}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";n.r(t);n(102);var r=n(0),o=n.n(r);function i(e){return e.type&&"Tab"===e.type.tabsRole}function a(e){return e.type&&"TabPanel"===e.type.tabsRole}function l(e){return e.type&&"TabList"===e.type.tabsRole}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return r.Children.map(e,function(e){return null===e?null:function(e){return i(e)||l(e)||a(e)}(e)?t(e):e.props&&e.props.children&&"object"==typeof e.props.children?Object(r.cloneElement)(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){u(e,t,n[t])})}return e}({},e.props,{children:s(e.props.children,t)})):e})}function c(e,t){return r.Children.forEach(e,function(e){null!==e&&(i(e)||a(e)?t(e):e.props&&e.props.children&&"object"==typeof e.props.children&&(l(e)&&t(e),c(e.props.children,t)))})}var f,d=n(65),p=n.n(d),h=0;function g(){return"react-tabs-"+h++}function y(){h=0}function m(e){var t=0;return c(e,function(e){i(e)&&t++}),t}function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e){return"getAttribute"in e&&"tab"===e.getAttribute("role")}function _(e){return"true"===e.getAttribute("aria-disabled")}try{f=!("undefined"==typeof window||!window.document||!window.document.activeElement)}catch(e){f=!1}var x=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).tabNodes=[],t.handleKeyDown=function(e){if(t.isTabFromContainer(e.target)){var n=t.props.selectedIndex,r=!1,o=!1;32!==e.keyCode&&13!==e.keyCode||(r=!0,o=!1,t.handleClick(e)),37===e.keyCode||38===e.keyCode?(n=t.getPrevTab(n),r=!0,o=!0):39===e.keyCode||40===e.keyCode?(n=t.getNextTab(n),r=!0,o=!0):35===e.keyCode?(n=t.getLastTab(),r=!0,o=!0):36===e.keyCode&&(n=t.getFirstTab(),r=!0,o=!0),r&&e.preventDefault(),o&&t.setSelected(n,e)}},t.handleClick=function(e){var n=e.target;do{if(t.isTabFromContainer(n)){if(_(n))return;var r=[].slice.call(n.parentNode.children).filter(b).indexOf(n);return void t.setSelected(r,e)}}while(null!==(n=n.parentNode))},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var n=t.prototype;return n.setSelected=function(e,t){if(!(e<0||e>=this.getTabsCount())){var n=this.props;(0,n.onSelect)(e,n.selectedIndex,t)}},n.getNextTab=function(e){for(var t=this.getTabsCount(),n=e+1;n<t;n++)if(!_(this.getTab(n)))return n;for(var r=0;r<e;r++)if(!_(this.getTab(r)))return r;return e},n.getPrevTab=function(e){for(var t=e;t--;)if(!_(this.getTab(t)))return t;for(t=this.getTabsCount();t-- >e;)if(!_(this.getTab(t)))return t;return e},n.getFirstTab=function(){for(var e=this.getTabsCount(),t=0;t<e;t++)if(!_(this.getTab(t)))return t;return null},n.getLastTab=function(){for(var e=this.getTabsCount();e--;)if(!_(this.getTab(e)))return e;return null},n.getTabsCount=function(){return m(this.props.children)},n.getPanelsCount=function(){return function(e){var t=0;return c(e,function(e){a(e)&&t++}),t}(this.props.children)},n.getTab=function(e){return this.tabNodes["tabs-"+e]},n.getChildren=function(){var e=this,t=0,n=this.props,u=n.children,c=n.disabledTabClassName,d=n.focus,p=n.forceRenderTabPanel,h=n.selectedIndex,y=n.selectedTabClassName,m=n.selectedTabPanelClassName;this.tabIds=this.tabIds||[],this.panelIds=this.panelIds||[];for(var v=this.tabIds.length-this.getTabsCount();v++<0;)this.tabIds.push(g()),this.panelIds.push(g());return s(u,function(n){var u=n;if(l(n)){var g=0,v=!1;f&&(v=o.a.Children.toArray(n.props.children).filter(i).some(function(t,n){return document.activeElement===e.getTab(n)})),u=Object(r.cloneElement)(n,{children:s(n.props.children,function(t){var n="tabs-"+g,o=h===g,i={tabRef:function(t){e.tabNodes[n]=t},id:e.tabIds[g],panelId:e.panelIds[g],selected:o,focus:o&&(d||v)};return y&&(i.selectedClassName=y),c&&(i.disabledClassName=c),g++,Object(r.cloneElement)(t,i)})})}else if(a(n)){var b={id:e.panelIds[t],tabId:e.tabIds[t],selected:h===t};p&&(b.forceRender=p),m&&(b.selectedClassName=m),t++,u=Object(r.cloneElement)(n,b)}return u})},n.isTabFromContainer=function(e){if(!b(e))return!1;var t=e.parentElement;do{if(t===this.node)return!0;if(t.getAttribute("data-tabs"))break;t=t.parentElement}while(t);return!1},n.render=function(){var e=this,t=this.props,n=(t.children,t.className),r=(t.disabledTabClassName,t.domRef),i=(t.focus,t.forceRenderTabPanel,t.onSelect,t.selectedIndex,t.selectedTabClassName,t.selectedTabPanelClassName,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName"]));return o.a.createElement("div",v({},i,{className:p()(n),onClick:this.handleClick,onKeyDown:this.handleKeyDown,ref:function(t){e.node=t,r&&r(t)},"data-tabs":!0}),this.getChildren())},t}(r.Component);x.defaultProps={className:"react-tabs",focus:!1},x.propTypes={};var w=function(e){function t(n){var r;return(r=e.call(this,n)||this).handleSelected=function(e,n,o){var i=r.props.onSelect;if("function"!=typeof i||!1!==i(e,n,o)){var a={focus:"keydown"===o.type};t.inUncontrolledMode(r.props)&&(a.selectedIndex=e),r.setState(a)}},r.state=t.copyPropsToState(r.props,{},n.defaultFocus),r}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var n=t.prototype;return n.componentWillReceiveProps=function(e){this.setState(function(n){return t.copyPropsToState(e,n)})},t.inUncontrolledMode=function(e){return null===e.selectedIndex},t.copyPropsToState=function(e,n,r){void 0===r&&(r=!1);var o={focus:r};if(t.inUncontrolledMode(e)){var i=m(e.children)-1,a=null;a=null!=n.selectedIndex?Math.min(n.selectedIndex,i):e.defaultIndex||0,o.selectedIndex=a}return o},n.render=function(){var e=this.props,t=e.children,n=(e.defaultIndex,e.defaultFocus,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["children","defaultIndex","defaultFocus"])),r=this.state,i=r.focus,a=r.selectedIndex;return n.focus=i,n.onSelect=this.handleSelected,null!=a&&(n.selectedIndex=a),o.a.createElement(x,n,t)},t}(r.Component);function C(){return(C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}w.defaultProps={defaultFocus:!1,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null},w.propTypes={},w.tabsRole="Tabs";var k=function(e){function t(){return e.apply(this,arguments)||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){var e=this.props,t=e.children,n=e.className,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["children","className"]);return o.a.createElement("ul",C({},r,{className:p()(n),role:"tablist"}),t)},t}(r.Component);function S(){return(S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}k.defaultProps={className:"react-tabs__tab-list"},k.propTypes={},k.tabsRole="TabList";var O=function(e){function t(){return e.apply(this,arguments)||this}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var n=t.prototype;return n.componentDidMount=function(){this.checkFocus()},n.componentDidUpdate=function(){this.checkFocus()},n.checkFocus=function(){var e=this.props,t=e.selected,n=e.focus;t&&n&&this.node.focus()},n.render=function(){var e,t=this,n=this.props,r=n.children,i=n.className,a=n.disabled,l=n.disabledClassName,u=(n.focus,n.id),s=n.panelId,c=n.selected,f=n.selectedClassName,d=n.tabIndex,h=n.tabRef,g=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(n,["children","className","disabled","disabledClassName","focus","id","panelId","selected","selectedClassName","tabIndex","tabRef"]);return o.a.createElement("li",S({},g,{className:p()(i,(e={},e[f]=c,e[l]=a,e)),ref:function(e){t.node=e,h&&h(e)},role:"tab",id:u,"aria-selected":c?"true":"false","aria-disabled":a?"true":"false","aria-controls":s,tabIndex:d||(c?"0":null)}),r)},t}(r.Component);function E(){return(E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}O.defaultProps={className:"react-tabs__tab",disabledClassName:"react-tabs__tab--disabled",focus:!1,id:null,panelId:null,selected:!1,selectedClassName:"react-tabs__tab--selected"},O.propTypes={},O.tabsRole="Tab";var T=function(e){function t(){return e.apply(this,arguments)||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){var e,t=this.props,n=t.children,r=t.className,i=t.forceRender,a=t.id,l=t.selected,u=t.selectedClassName,s=t.tabId,c=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["children","className","forceRender","id","selected","selectedClassName","tabId"]);return o.a.createElement("div",E({},c,{className:p()(r,(e={},e[u]=l,e)),role:"tabpanel",id:a,"aria-labelledby":s}),i||l?n:null)},t}(r.Component);T.defaultProps={className:"react-tabs__tab-panel",forceRender:!1,selectedClassName:"react-tabs__tab-panel--selected"},T.propTypes={},T.tabsRole="TabPanel",n.d(t,"Tabs",function(){return w}),n.d(t,"TabList",function(){return k}),n.d(t,"Tab",function(){return O}),n.d(t,"TabPanel",function(){return T}),n.d(t,"resetIdCounter",function(){return y})},function(e,t,n){e.exports=n(1053)},function(e,t,n){e.exports=n(416)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFeedItem=i,t.default=function(e,t){return(0,o.default)(e,t,i)};var r=n(145),o=function(e){return e&&e.__esModule?e:{default:e}}(r);function i(e,t,n){var o={};return o.title=(0,r.getXPathText)("child::title",e,t),o.link=(0,r.getXPathText)("child::link",e,t),o.content=(0,r.getXPathText)("child::content:encoded",e,t,n),o.description=(0,r.getXPathText)("child::description",e,t),o.creator=(0,r.getXPathText)("child::dc:creator",e,t,n),o.date=(0,r.getXPathText)("child::pubDate",e,t),o}},function(e,t,n){var r=n(425),o=n(232),i=n(233);e.exports=function(e){return i(o(e,void 0,r),e+"")}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(21))},function(e,t,n){var r=n(431),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,l=o(i.length-t,0),u=Array(l);++a<l;)u[a]=i[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=i[a];return s[t]=n(u),r(e,this,s)}}},function(e,t,n){var r=n(432),o=n(438)(r);e.exports=o},function(e,t,n){var r=n(67),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){var r=n(59),o=n(51),i="[object AsyncFunction]",a="[object Function]",l="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==a||t==l||t==i||t==u}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(439),o=n(98),i=r?function(e){return r.get(e)}:o;e.exports=i},function(e,t,n){var r=n(67)(n(45),"WeakMap");e.exports=r},function(e,t,n){var r=n(440),o=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",n=r[t],i=o.call(r,t)?n.length:0;i--;){var a=n[i],l=a.func;if(null==l||l==e)return a.name}return t}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFeedItem=i,t.default=function(e,t){return(0,o.default)(e,t,i)};var r=n(152),o=function(e){return e&&e.__esModule?e:{default:e}}(r);function i(e,t,n){var o={};return o.title=(0,r.getXPathText)("child::title",e,t),o.link=(0,r.getXPathText)("child::link",e,t),o.content=(0,r.getXPathText)("child::content:encoded",e,t,n),o.description=(0,r.getXPathText)("child::description",e,t),o.creator=(0,r.getXPathText)("child::dc:creator",e,t,n),o.date=(0,r.getXPathText)("child::pubDate",e,t),o}},function(e,t,n){var r=n(234);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(482),o=n(112),i=n(19),a=n(118),l=n(158),u=n(159),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),c=!n&&o(e),f=!n&&!c&&a(e),d=!n&&!c&&!f&&u(e),p=n||c||f||d,h=p?r(e.length,String):[],g=h.length;for(var y in e)!t&&!s.call(e,y)||p&&("length"==y||f&&("offset"==y||"parent"==y)||d&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||l(y,g))||h.push(y);return h}},function(e,t,n){var r=n(99),o=n(485),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(243),o=n(487),i=n(69);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(149),o=n(162),i=n(161),a=n(248),l=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=l},function(e,t,n){var r=n(251),o=n(161),i=n(68);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(149),o=n(19);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},function(e,t,n){var r=n(251),o=n(249),i=n(246);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(45).Uint8Array;e.exports=r},function(e,t,n){var r=n(79),o=n(153),i=n(19),a=n(122),l=1/0,u=r?r.prototype:void 0,s=u?u.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return s?s.call(t):"";var n=t+"";return"0"==n&&1/t==-l?"-0":n}},function(e,t){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SectionTitle=t.StyledSubTitle=t.StyledTitle=t.StyledTitleContainer=void 0;var r=u(n(0)),o=u(n(4)),i=u(n(1)),a=n(12),l=u(n(257));function u(e){return e&&e.__esModule?e:{default:e}}var s=t.StyledTitleContainer=i.default.span.withConfig({displayName:"SectionTitle__StyledTitleContainer",componentId:"nlobus-0"})(["flex-grow:1;overflow-x:hidden;line-height:normal;"]),c=t.StyledTitle=i.default.span.withConfig({displayName:"SectionTitle__StyledTitle",componentId:"nlobus-1"})(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;color:",";"],a.colors.$color_headings),f=t.StyledSubTitle=i.default.span.withConfig({displayName:"SectionTitle__StyledSubTitle",componentId:"nlobus-2"})(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;font-size:0.8125rem;margin-top:2px;"]);(t.SectionTitle=function(e){return r.default.createElement(s,null,r.default.createElement(c,null,e.title,e.titleScreenReaderText&&r.default.createElement(l.default,null," "+e.titleScreenReaderText)),e.subTitle&&r.default.createElement(f,null,e.subTitle))}).propTypes={title:o.default.string.isRequired,titleScreenReaderText:o.default.string,subTitle:o.default.string}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),o=a(n(4)),i=a(n(258));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return r.default.createElement("span",{className:"screen-reader-text",style:i.default.ScreenReaderText.default},e.children)};l.propTypes={children:o.default.string.isRequired},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={ScreenReaderText:{default:{clip:"rect(1px, 1px, 1px, 1px)",position:"absolute",height:"1px",width:"1px",overflow:"hidden"},focused:{clip:"auto",display:"block",left:"5px",top:"5px",height:"auto",width:"auto",zIndex:"100000",position:"absolute",backgroundColor:"#eeeeee ",padding:"10px"}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=u(n(0)),i=u(n(4)),a=u(n(77)),l=n(44);function u(e){return e&&e.__esModule?e:{default:e}}var s=function(e){var t=e.children,n=e.className,i=e.prefixIcon,u=e.suffixIcon,s=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["children","className","prefixIcon","suffixIcon"]);return o.default.createElement(a.default,r({className:n},s),i&&i.icon&&o.default.createElement(l.SvgIcon,{icon:i.icon,color:i.color,size:i.size}),t,u&&u.icon&&o.default.createElement(l.SvgIcon,{icon:u.icon,color:u.color,size:u.size}))};s.propTypes={className:i.default.string,prefixIcon:i.default.shape({icon:i.default.string,color:i.default.string,size:i.default.string}),suffixIcon:i.default.shape({icon:i.default.string,color:i.default.string,size:i.default.string}),children:i.default.oneOfType([i.default.arrayOf(i.default.node),i.default.node,i.default.string])},t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var r=n(0),o=u(r),i=u(n(4)),a=u(n(1)),l=n(12);function u(e){return e&&e.__esModule?e:{default:e}}var s=a.default.span.withConfig({displayName:"CardBanner__BannerContents",componentId:"oi8gid-0"})(["position:absolute;top:8px;left:-8px;font-weight:500;color:",";line-height:16px;background-color:",";padding:8px 16px;box-shadow:0 2px 4px 0 rgba(0,0,0,0.2);"],function(e){return e.textColor},function(e){return e.backgroundColor}),c=a.default.span.withConfig({displayName:"CardBanner__BannerTriangle",componentId:"oi8gid-1"})(["position:absolute;top:40px;left:-8px;border-top:8px solid ",";border-left:8px solid transparent;"],l.colors.$color_purple_dark);function f(e){return o.default.createElement(r.Fragment,null,o.default.createElement(s,{backgroundColor:e.backgroundColor,textColor:e.textColor},e.children),o.default.createElement(c,null))}f.propTypes={backgroundColor:i.default.string,textColor:i.default.string,children:i.default.any},f.defaultProps={backgroundColor:l.colors.$color_pink_dark,textColor:l.colors.$color_white,children:null}},function(e,t,n){var r=n(527),o=n(532);e.exports=n(168)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=l;var o=a(n(0)),i=a(n(4));function a(e){return e&&e.__esModule?e:{default:e}}function l(e){return o.default.createElement("iframe",r({title:e.title},e))}l.propTypes={title:i.default.string.isRequired}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=l(n(0)),a=l(n(4));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default.Component),o(t,[{key:"componentDidUpdate",value:function(){this.props.hasFocus&&this.ref.focus()}},{key:"setReference",value:function(e){this.ref=e}},{key:"render",value:function(){return i.default.createElement("input",r({ref:this.setReference.bind(this),type:this.props.type,name:this.props.name,defaultValue:this.props.value,onChange:this.props.onChange,autoComplete:this.props.autoComplete},this.props.optionalAttributes))}}]),t}();u.propTypes={name:a.default.string.isRequired,type:a.default.oneOf(["button","checkbox","number","password","progress","radio","submit","text"]).isRequired,value:a.default.any,onChange:a.default.func,optionalAttributes:a.default.object,hasFocus:a.default.bool,autoComplete:a.default.string},u.defaultProps={name:"input",type:"text",value:"",hasFocus:!1},t.default=u},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(4));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var t=e.title,n=e.classNamePrefix,o=e.words,i=e.header,a=e.footer,l=r.default.createElement("ol",{className:n+"__list"},o.map(function(e){return r.default.createElement("li",{key:e,className:n+"__item"},e)}));return r.default.createElement("div",{className:n},r.default.createElement("p",null,r.default.createElement("strong",null,t)),i,l,a)};a.propTypes={words:o.default.array.isRequired,title:o.default.string.isRequired,header:o.default.string,footer:o.default.string,classNamePrefix:o.default.string},a.defaultProps={classNamePrefix:"",header:"",footer:""},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(0)),i=u(n(4)),a=u(n(1)),l=n(5);function u(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var c=a.default.span.withConfig({displayName:"WordOccurrences__ProminentWordOccurrence",componentId:"v5jj49-0"})(["display:inline-block;margin:2px 8px;"]),f=(0,a.default)(c).withConfig({displayName:"WordOccurrences__ProminentWord",componentId:"v5jj49-1"})(["font-weight:bold;overflow:hidden;text-overflow:ellipsis;"]),d=a.default.ol.withConfig({displayName:"WordOccurrences__WordOccurrencesList",componentId:"v5jj49-2"})(["list-style:none;padding:0;width:100%;margin:0;"]),p=a.default.li.withConfig({displayName:"WordOccurrences__WordBarContainer",componentId:"v5jj49-3"})(["margin:8px 0;height:calc( 1.375em + 4px );display:flex;max-width:600px;justify-content:space-between;background:linear-gradient( to right,rgba(164,40,106,0.2) ",",",",transparent );"],function(e){return e.barWidth},function(e){return e.barWidth}),h=function(e){var t=e.word,n=e.occurrence,r=e.width;return o.default.createElement(p,{barWidth:r},o.default.createElement(f,null,t),o.default.createElement(c,null,o.default.createElement("span",{"aria-hidden":!0},n),o.default.createElement("span",{className:"screen-reader-text"},(0,l.sprintf)((0,l.__)("%d occurrences","yoast-components"),n))))};h.propTypes={word:i.default.string.isRequired,occurrence:i.default.number.isRequired,width:i.default.string.isRequired};var g=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={words:[].concat(s(e.words))||[],occurrences:{min:0,max:0}},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default.Component),r(t,[{key:"render",value:function(){var e=this;return o.default.createElement(o.default.Fragment,null,this.props.header,o.default.createElement(d,{"aria-label":(0,l.__)("Prominent words","yoast-components")},this.state.words.map(function(t){var n=t.getWord(),r=t.getOccurrences(),i=r/e.state.occurrences.max*100+"%";return o.default.createElement(h,{key:"wordbar-"+n,word:n,width:i,occurrence:r})})),this.props.footer)}}],[{key:"getDerivedStateFromProps",value:function(e){var t=[].concat(s(e.words));t.sort(function(e,t){return t.getOccurrences()-e.getOccurrences()});var n=t.map(function(e){return e.getOccurrences()});return{occurrences:{min:Math.min.apply(Math,s(n)),max:Math.max.apply(Math,s(n))},words:t}}}]),t}();g.propTypes={words:i.default.array.isRequired,header:i.default.element,footer:i.default.element},g.defaultProps={header:null,footer:null},t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=a(n(0)),i=a(n(4));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return o.default.createElement("label",r({htmlFor:e.for},e.optionalAttributes),e.children)};l.propTypes={for:i.default.string.isRequired,optionalAttributes:i.default.shape({"aria-label":i.default.string,onClick:i.default.func,className:i.default.string}),children:i.default.any.isRequired},l.defaultProps={htmlFor:""},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(4)),o=a(n(1)),i=n(12);function a(e){return e&&e.__esModule?e:{default:e}}var l=o.default.div.withConfig({displayName:"Paper",componentId:"sc-1fchzjl-0"})(["box-shadow:0 1px 2px rgba(0,0,0,0.2);background-color:",";min-height:",";"],function(e){return e.backgroundColor},function(e){return e.minHeight});l.propTypes={backgroundColor:r.default.string,minHeight:r.default.string},l.defaultProps={backgroundColor:i.colors.$color_white,minHeight:"0"},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),o=a(n(4)),i=a(n(170));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return r.default.createElement("section",{className:e.className},e.headingText&&r.default.createElement(i.default,{level:e.headingLevel,className:e.headingClassName},e.headingText),e.children)};l.propTypes={className:o.default.string,headingText:o.default.string,headingLevel:o.default.number,headingClassName:o.default.string,children:o.default.any},l.defaultProps={headingLevel:1},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InputField=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),o=n(12);t.InputField=r.default.input.withConfig({displayName:"InputField",componentId:"sc-12z9z15-0"})(["&&&{padding:0 8px;min-height:34px;font-size:1em;box-shadow:inset 0 1px 2px ",";border:1px solid ",";border-radius:0;&:focus{border-color:#5b9dd9;box-shadow:0 0 2px ",";}}"],(0,o.rgba)(o.colors.$color_black,.07),o.colors.$color_input_border,(0,o.rgba)(o.colors.$color_snippet_focus,.8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=l(n(0)),a=l(n(4));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default.Component),o(t,[{key:"render",value:function(){return i.default.createElement("textarea",r({ref:this.setReference.bind(this),name:this.props.name,value:this.props.value,onChange:this.props.onChange},this.props.optionalAttributes))}},{key:"setReference",value:function(e){this.ref=e}},{key:"componentDidUpdate",value:function(){this.props.hasFocus&&this.ref.focus()}}]),t}();u.propTypes={name:a.default.string.isRequired,value:a.default.string,onChange:a.default.func,optionalAttributes:a.default.object,hasFocus:a.default.bool},u.defaultProps={name:"textarea",value:"",hasFocus:!1},t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return[].slice.call(e.querySelectorAll("*"),0).filter(a)};
|
18 |
-
/*!
|
19 |
-
* Adapted from jQuery UI core
|
20 |
-
*
|
21 |
-
* http://jqueryui.com
|
22 |
-
*
|
23 |
-
* Copyright 2014 jQuery Foundation and other contributors
|
24 |
-
* Released under the MIT license.
|
25 |
-
* http://jquery.org/license
|
26 |
-
*
|
27 |
-
* http://api.jqueryui.com/category/ui-core/
|
28 |
-
*/
|
29 |
-
var r=/input|select|textarea|button|object/;function o(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;var n=window.getComputedStyle(e);return t?"visible"!==n.getPropertyValue("overflow"):"none"==n.getPropertyValue("display")}function i(e,t){var n=e.nodeName.toLowerCase();return(r.test(n)&&!e.disabled||"a"===n&&e.href||t)&&function(e){for(var t=e;t&&t!==document.body;){if(o(t))return!1;t=t.parentNode}return!0}(e)}function a(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&i(e,!n)}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertNodeList=a,t.setElement=function(e){var t=e;if("string"==typeof t&&o.canUseDOM){var n=document.querySelectorAll(t);a(n,t),t="length"in n?n[0]:n}return i=t||i},t.validateElement=l,t.hide=function(e){l(e)&&(e||i).setAttribute("aria-hidden","true")},t.show=function(e){l(e)&&(e||i).removeAttribute("aria-hidden")},t.documentNotReadyOrSSRTesting=function(){i=null},t.resetForTesting=function(){i=null};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(82)),o=n(173);var i=null;function a(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function l(e){return!(!e&&!i)||((0,r.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),!1)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),o=a(n(175)),i=a(n(103));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return r.default.createElement(i.default,e,r.default.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}))};(l=(0,o.default)(l)).displayName="NavigationClose",l.muiName="SvgIcon",t.default=l},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(593));t.default=function(e){return(0,r.default)("displayName",e)}},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(594));t.default=function(e,t){return t+"("+(0,r.default)(e)+")"}},function(e,t,n){e.exports=!n(72)&&!n(85)(function(){return 7!=Object.defineProperty(n(280)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(84),o=n(61).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(73),o=n(86),i=n(602)(!1),a=n(182)("IE_PROTO");e.exports=function(e,t){var n,l=o(e),u=0,s=[];for(n in l)n!=a&&r(l,n)&&s.push(n);for(;t.length>u;)r(l,n=t[u++])&&(~i(s,n)||s.push(n));return s}},function(e,t,n){var r=n(179);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(181),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(73),o=n(106),i=n(182)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(60),o=n(33),i=n(85);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){"use strict";var r=n(126),o=n(60),i=n(287),a=n(83),l=n(87),u=n(612),s=n(188),c=n(284),f=n(47)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,n,h,g,y,m){u(n,t,h);var v,b,_,x=function(e){if(!d&&e in S)return S[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},w=t+" Iterator",C="values"==g,k=!1,S=e.prototype,O=S[f]||S["@@iterator"]||g&&S[g],E=O||x(g),T=g?C?x("entries"):E:void 0,P="Array"==t&&S.entries||O;if(P&&(_=c(P.call(new e)))!==Object.prototype&&_.next&&(s(_,w,!0),r||"function"==typeof _[f]||a(_,f,p)),C&&O&&"values"!==O.name&&(k=!0,E=function(){return O.call(this)}),r&&!m||!d&&!k&&S[f]||a(S,f,E),l[t]=E,l[w]=p,g)if(v={values:C?E:x("values"),keys:y?E:x("keys"),entries:T},m)for(b in v)b in S||i(S,b,v[b]);else o(o.P+o.F*(d||k),t,v);return v}},function(e,t,n){e.exports=n(83)},function(e,t,n){var r=n(281),o=n(184).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(128),o=n(104),i=n(86),a=n(178),l=n(73),u=n(279),s=Object.getOwnPropertyDescriptor;t.f=n(72)?s:function(e,t){if(e=i(e),t=a(t,!0),u)try{return s(e,t)}catch(e){}if(l(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(22)),o=f(n(20)),i=f(n(23)),a=f(n(24)),l=f(n(25)),u=n(0),s=f(n(15)),c=f(n(192));function f(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,i.default)(t,[{key:"getChildContext",value:function(){return{muiTheme:this.props.muiTheme||(0,c.default)()}}},{key:"render",value:function(){return this.props.children}}]),t}(u.Component);d.childContextTypes={muiTheme:s.default.object.isRequired},d.propTypes={},t.default=d},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(292));t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,r.default)(e)}},function(e,t,n){e.exports={default:n(635),__esModule:!0}},function(e,t,n){var r=n(294),o=n(47)("iterator"),i=n(87);e.exports=n(33).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(179),o=n(47)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertColorToString=o,t.convertHexToRGB=i,t.decomposeColor=a,t.getContrastRatio=function(e,t){var n=l(e),r=l(t),o=(Math.max(n,r)+.05)/(Math.min(n,r)+.05);return Number(o.toFixed(2))},t.getLuminance=l,t.emphasize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(e)>.5?u(e,t):s(e,t)},t.fade=function(e,t){e=a(e),t=r(t,0,1),("rgb"===e.type||"hsl"===e.type)&&(e.type+="a");return e.values[3]=t,o(e)},t.darken=u,t.lighten=s;!function(e){e&&e.__esModule}(n(82));function r(e,t,n){return e<t?t:e>n?n:e}function o(e){var t=e.type,n=e.values;if(t.indexOf("rgb")>-1)for(var r=0;r<3;r++)n[r]=parseInt(n[r]);var o=void 0;return o=t.indexOf("hsl")>-1?e.type+"("+n[0]+", "+n[1]+"%, "+n[2]+"%":e.type+"("+n[0]+", "+n[1]+", "+n[2],4===n.length?o+=", "+e.values[3]+")":o+=")",o}function i(e){if(4===e.length){for(var t="#",n=1;n<e.length;n++)t+=e.charAt(n)+e.charAt(n);e=t}return"rgb("+parseInt(e.substr(1,2),16)+", "+parseInt(e.substr(3,2),16)+", "+parseInt(e.substr(5,2),16)+")"}function a(e){if("#"===e.charAt(0))return a(i(e));var t=e.indexOf("("),n=e.substring(0,t),r=e.substring(t+1,e.length-1).split(",");return{type:n,values:r=r.map(function(e){return parseFloat(e)})}}function l(e){if((e=a(e)).type.indexOf("rgb")>-1){var t=e.values.map(function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}if(e.type.indexOf("hsl")>-1)return e.values[2]/100}function u(e,t){if(e=a(e),t=r(t,0,1),e.type.indexOf("hsl")>-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")>-1)for(var n=0;n<3;n++)e.values[n]*=1-t;return o(e)}function s(e,t){if(e=a(e),t=r(t,0,1),e.type.indexOf("hsl")>-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")>-1)for(var n=0;n<3;n++)e.values[n]+=(255-e.values[n])*t;return o(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,o){for(var i=0,a=e.length;i<a;++i){var l=e[i](t,n,r,o);if(l)return l}},e.exports=t.default},function(e,t,n){"use strict";function r(e,t){-1===e.indexOf(t)&&e.push(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(Array.isArray(t))for(var n=0,o=t.length;n<o;++n)r(e,t[n]);else r(e,t)},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e instanceof Object&&!Array.isArray(e)},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.default)(e)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(661));e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeOutboundLink=t.getFeed=t.getCourseFeed=t.getPostFeed=t.decodeHTML=t.sendRequest=t.getDirectionalStyle=t.createSvgIconComponent=void 0;var r=n(677);Object.defineProperty(t,"makeOutboundLink",{enumerable:!0,get:function(){return r.makeOutboundLink}});var o=n(679),i=f(n(680)),a=f(n(681)),l=f(n(196)),u=f(n(682)),s=f(n(301)),c=f(n(683));function f(e){return e&&e.__esModule?e:{default:e}}t.createSvgIconComponent=c.default,t.getDirectionalStyle=o.getDirectionalStyle,t.sendRequest=i.default,t.decodeHTML=a.default,t.getPostFeed=s.default,t.getCourseFeed=u.default,t.getFeed=l.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFeedItem=i,t.default=function(e,t){return(0,o.default)(e,t,i)};var r=n(196),o=function(e){return e&&e.__esModule?e:{default:e}}(r);function i(e,t,n){var o={};return o.title=(0,r.getXPathText)("child::title",e,t),o.link=(0,r.getXPathText)("child::link",e,t),o.content=(0,r.getXPathText)("child::content:encoded",e,t,n),o.description=(0,r.getXPathText)("child::description",e,t),o.creator=(0,r.getXPathText)("child::dc:creator",e,t,n),o.date=(0,r.getXPathText)("child::pubDate",e,t),o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rgba=t.breakpoints=t.colors=void 0;var r=a(n(685)),o=a(n(686)),i=n(687);function a(e){return e&&e.__esModule?e:{default:e}}t.colors=r.default,t.breakpoints=o.default,t.rgba=i.rgba},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Stepper=t.StepLabel=t.StepContent=t.StepButton=t.Step=void 0;var r=u(n(689)),o=u(n(690)),i=u(n(703)),a=u(n(305)),l=u(n(706));function u(e){return e&&e.__esModule?e:{default:e}}t.Step=r.default,t.StepButton=o.default,t.StepContent=i.default,t.StepLabel=a.default,t.Stepper=l.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(31)),o=v(n(32)),i=v(n(22)),a=v(n(20)),l=v(n(23)),u=v(n(24)),s=v(n(25)),c=v(n(26)),f=n(0),d=v(f),p=v(n(15)),h=v(n(691)),g=v(n(692)),y=v(n(693)),m=v(n(698));function v(e){return e&&e.__esModule?e:{default:e}}var b=!1,_=!1,x=!1;var w=function(e){function t(){var e,n,r,o;(0,a.default)(this,t);for(var l=arguments.length,s=Array(l),c=0;c<l;c++)s[c]=arguments[c];return n=r=(0,u.default)(this,(e=t.__proto__||(0,i.default)(t)).call.apply(e,[this].concat(s))),r.state={isKeyboardFocused:!1},r.handleKeyDown=function(e){r.props.disabled||r.props.disableKeyboardFocus||("enter"===(0,g.default)(e)&&r.state.isKeyboardFocused&&r.handleClick(e),"esc"===(0,g.default)(e)&&r.state.isKeyboardFocused&&r.removeKeyboardFocus(e)),r.props.onKeyDown(e)},r.handleKeyUp=function(e){r.props.disabled||r.props.disableKeyboardFocus||"space"===(0,g.default)(e)&&r.state.isKeyboardFocused&&r.handleClick(e),r.props.onKeyUp(e)},r.handleBlur=function(e){r.cancelFocusTimeout(),r.removeKeyboardFocus(e),r.props.onBlur(e)},r.handleFocus=function(e){e&&e.persist(),r.props.disabled||r.props.disableKeyboardFocus||(r.focusTimeout=setTimeout(function(){x&&(r.setKeyboardFocus(e),x=!1)},150),r.props.onFocus(e))},r.handleClick=function(e){r.cancelFocusTimeout(),r.props.disabled||(x=!1,r.removeKeyboardFocus(e),r.props.onClick(e))},o=n,(0,u.default)(r,o)}return(0,s.default)(t,e),(0,l.default)(t,[{key:"componentWillMount",value:function(){var e=this.props,t=e.disabled,n=e.disableKeyboardFocus,r=e.keyboardFocused;t||!r||n||this.setState({isKeyboardFocused:!0})}},{key:"componentDidMount",value:function(){!function(){if(!b){var e=document.createElement("style");e.innerHTML="\n button::-moz-focus-inner,\n input::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n ",document.body.appendChild(e),b=!0}}(),_||(h.default.on(window,"keydown",function(e){x="tab"===(0,g.default)(e)}),_=!0),this.state.isKeyboardFocused&&(this.button.focus(),this.props.onKeyboardFocus(null,!0))}},{key:"componentWillReceiveProps",value:function(e){(e.disabled||e.disableKeyboardFocus)&&this.state.isKeyboardFocused&&(this.setState({isKeyboardFocused:!1}),e.onKeyboardFocus&&e.onKeyboardFocus(null,!1))}},{key:"componentWillUnmount",value:function(){this.focusTimeout&&clearTimeout(this.focusTimeout)}},{key:"isKeyboardFocused",value:function(){return this.state.isKeyboardFocused}},{key:"removeKeyboardFocus",value:function(e){this.state.isKeyboardFocused&&(this.setState({isKeyboardFocused:!1}),this.props.onKeyboardFocus(e,!1))}},{key:"setKeyboardFocus",value:function(e){this.state.isKeyboardFocused||(this.setState({isKeyboardFocused:!0}),this.props.onKeyboardFocus(e,!0))}},{key:"cancelFocusTimeout",value:function(){this.focusTimeout&&(clearTimeout(this.focusTimeout),this.focusTimeout=null)}},{key:"createButtonChildren",value:function(){var e=this.props,t=e.centerRipple,n=e.children,r=e.disabled,o=e.disableFocusRipple,i=e.disableKeyboardFocus,a=e.disableTouchRipple,l=e.focusRippleColor,u=e.focusRippleOpacity,s=e.touchRippleColor,c=e.touchRippleOpacity,f=this.state.isKeyboardFocused,p=!f||r||o||i?void 0:d.default.createElement(y.default,{color:l,opacity:u,show:f,style:{overflow:"hidden"},key:"focusRipple"}),h=r||a?void 0:d.default.createElement(m.default,{centerRipple:t,color:s,opacity:c,key:"touchRipple"},n);return[p,h,h?void 0:n]}},{key:"render",value:function(){var e=this,t=this.props,n=(t.centerRipple,t.children),i=t.containerElement,a=t.disabled,l=(t.disableFocusRipple,t.disableKeyboardFocus),u=(t.disableTouchRipple,t.focusRippleColor,t.focusRippleOpacity,t.href),s=(t.keyboardFocused,t.touchRippleColor,t.touchRippleOpacity,t.onBlur,t.onClick,t.onFocus,t.onKeyUp,t.onKeyDown,t.onKeyboardFocus,t.style),f=t.tabIndex,p=t.type,h=(0,o.default)(t,["centerRipple","children","containerElement","disabled","disableFocusRipple","disableKeyboardFocus","disableTouchRipple","focusRippleColor","focusRippleOpacity","href","keyboardFocused","touchRippleColor","touchRippleOpacity","onBlur","onClick","onFocus","onKeyUp","onKeyDown","onKeyboardFocus","style","tabIndex","type"]),g=this.context.muiTheme,y=g.prepareStyles,m=g.enhancedButton,v=(0,c.default)({border:10,boxSizing:"border-box",display:"inline-block",fontFamily:this.context.muiTheme.baseTheme.fontFamily,WebkitTapHighlightColor:m.tapHighlightColor,cursor:a?"default":"pointer",textDecoration:"none",margin:0,padding:0,outline:"none",fontSize:"inherit",fontWeight:"inherit",position:"relative",verticalAlign:u?"middle":null},s);if(v.backgroundColor||v.background||(v.background="none"),a&&u)return d.default.createElement("span",(0,r.default)({},h,{style:v}),n);var b=(0,r.default)({},h,{style:y(v),ref:function(t){return e.button=t},disabled:a,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyUp:this.handleKeyUp,onKeyDown:this.handleKeyDown,onClick:this.handleClick,tabIndex:a||l?-1:f});u&&(b.href=u);var _=this.createButtonChildren();return d.default.isValidElement(i)?d.default.cloneElement(i,b,_):(u||"button"!==i||(b.type=p),d.default.createElement(u?"a":i,b,_))}}]),t}(f.Component);w.defaultProps={containerElement:"button",onBlur:function(){},onClick:function(){},onFocus:function(){},onKeyDown:function(){},onKeyUp:function(){},onKeyboardFocus:function(){},tabIndex:0,type:"button"},w.contextTypes={muiTheme:p.default.object.isRequired},w.propTypes={},t.default=w},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(31)),o=f(n(32)),i=f(n(186)),a=f(n(26)),l=f(n(0)),u=f(n(15)),s=f(n(702)),c=f(n(103));function f(e){return e&&e.__esModule?e:{default:e}}var d=function(e,t){e.active;var n=e.children,u=e.completed,f=e.icon,d=e.iconContainerStyle,p=(e.last,e.style),h=(0,o.default)(e,["active","children","completed","icon","iconContainerStyle","last","style"]),g=t.muiTheme.prepareStyles,y=function(e,t){var n=e.active,r=e.completed,o=e.disabled,i=t.muiTheme,a=t.stepper,l=i.stepper,u=l.textColor,s=l.disabledTextColor,c=l.iconColor,f=l.inactiveIconColor,d=i.baseTheme,p={root:{height:"horizontal"===a.orientation?72:64,color:u,display:"flex",alignItems:"center",fontFamily:d.fontFamily,fontSize:14,paddingLeft:14,paddingRight:14},icon:{color:c,display:"block",fontSize:24,width:24,height:24},iconContainer:{paddingRight:8}};return n&&(p.root.fontWeight=500),r||n||(p.icon.color=f),o&&(p.icon.color=f,p.root.color=s,p.root.cursor="default"),p}(e,t),m=function(e,t,n){var r=void 0===t?"undefined":(0,i.default)(t);return"number"===r||"string"===r?e?l.default.createElement(s.default,{color:n.icon.color,style:n.icon}):l.default.createElement(c.default,{color:n.icon.color,style:n.icon},l.default.createElement("circle",{cx:"12",cy:"12",r:"10"}),l.default.createElement("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"12",fill:"#fff"},t)):t}(u,f,y);return l.default.createElement("span",(0,r.default)({style:g((0,a.default)(y.root,p))},h),m&&l.default.createElement("span",{style:g((0,a.default)(y.iconContainer,d))},m),n)};d.muiName="StepLabel",d.propTypes={},d.contextTypes={muiTheme:u.default.object.isRequired,stepper:u.default.object},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(709));t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return e&&e.__esModule?e:{default:e}}(n(15));var o=r.default.oneOf(["left","middle","right"]),i=r.default.oneOf(["top","center","bottom"]);t.default={corners:r.default.oneOf(["bottom-left","bottom-right","top-left","top-right"]),horizontal:o,vertical:i,origin:r.default.shape({horizontal:o,vertical:i}),cornersAndCenter:r.default.oneOf(["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"]),stringOrNumber:r.default.oneOfType([r.default.string,r.default.number]),zDepth:r.default.oneOf([0,1,2,3,4,5])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(309));function i(e){return e&&e.__esModule?e:{default:e}}var a={refresh:{display:"inline-block",position:"relative"}};t.default=function(){return r.default.createElement("div",{className:"yoast-wizard-overlay-loader"},r.default.createElement(o.default,{size:40,left:10,top:100,status:"loading",style:a.refresh}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(714));t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(311);Object.defineProperty(t,"FixedWidthContainer",{enumerable:!0,get:function(){return c(r).default}});var o=n(731);Object.defineProperty(t,"HelpTextWrapper",{enumerable:!0,get:function(){return c(o).default}});var i=n(331);Object.defineProperty(t,"SnippetPreview",{enumerable:!0,get:function(){return c(i).default}});var a=n(206);Object.defineProperty(t,"ReplacementVariableEditor",{enumerable:!0,get:function(){return c(a).default}});var l=n(970);Object.defineProperty(t,"SettingsSnippetEditor",{enumerable:!0,get:function(){return c(l).default}});var u=n(972);Object.defineProperty(t,"SnippetEditor",{enumerable:!0,get:function(){return c(u).default}});var s=n(76);function c(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"lengthProgressShape",{enumerable:!0,get:function(){return s.lengthProgressShape}}),Object.defineProperty(t,"recommendedReplacementVariablesShape",{enumerable:!0,get:function(){return s.recommendedReplacementVariablesShape}}),Object.defineProperty(t,"replacementVariablesShape",{enumerable:!0,get:function(){return s.replacementVariablesShape}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=c(o),a=c(n(1)),l=c(n(3)),u=c(n(198)),s=n(5);function c(e){return e&&e.__esModule?e:{default:e}}var f=a.default.div.withConfig({displayName:"FixedWidthContainer__FixedWidth",componentId:"sc-12v6gqu-0"})(["overflow:auto;width:","px;padding:0 ","px;max-width:100%;box-sizing:border-box;"],function(e){return e.widthValue},function(e){return e.paddingValue}),d=a.default.div.withConfig({displayName:"FixedWidthContainer__Inner",componentId:"sc-12v6gqu-1"})(["width:","px;"],function(e){return e.widthValue}),p=a.default.div.withConfig({displayName:"FixedWidthContainer__ScrollHintContainer",componentId:"sc-12v6gqu-2"})(["text-align:center;margin:1em 0 5px;"]),h=a.default.div.withConfig({displayName:"FixedWidthContainer__ScrollHint",componentId:"sc-12v6gqu-3"})(['display:inline-block;box-sizing:border-box;&:before{display:inline-block;margin-right:10px;font-size:20px;line-height:inherit;vertical-align:text-top;content:"\\21c4";box-sizing:border-box;}']),g=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={showScrollHint:!1},n.setContainerRef=n.setContainerRef.bind(n),n.determineSize=(0,u.default)(n.determineSize.bind(n),100),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.Component),r(t,[{key:"setContainerRef",value:function(e){if(!e)return null;this._container=e,this.determineSize(),window.addEventListener("resize",this.determineSize)}},{key:"determineSize",value:function(){var e=this._container.offsetWidth;this.setState({showScrollHint:e<this.props.width})}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.determineSize)}},{key:"render",value:function(){var e=this.props,t=e.width,n=e.padding,r=e.children,o=e.className,a=e.id,l=t-2*n;return i.default.createElement(i.default.Fragment,null,i.default.createElement(f,{id:a,className:o,widthValue:t,paddingValue:n,ref:this.setContainerRef},i.default.createElement(d,{widthValue:l},r)),this.state.showScrollHint&&i.default.createElement(p,null,i.default.createElement(h,null,(0,s.__)("Scroll to see the preview content.","yoast-components"))))}}]),t}();t.default=g,g.propTypes={id:l.default.string,width:l.default.number.isRequired,padding:l.default.number,children:l.default.node.isRequired,className:l.default.string},g.defaultProps={id:"",padding:0,className:""}},function(e,t,n){var r=n(51),o=n(122),i=NaN,a=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return i;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=u.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):l.test(e)?i:+e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFeedItem=i,t.default=function(e,t){return(0,o.default)(e,t,i)};var r=n(200),o=function(e){return e&&e.__esModule?e:{default:e}}(r);function i(e,t,n){var o={};return o.title=(0,r.getXPathText)("child::title",e,t),o.link=(0,r.getXPathText)("child::link",e,t),o.content=(0,r.getXPathText)("child::content:encoded",e,t,n),o.description=(0,r.getXPathText)("child::description",e,t),o.creator=(0,r.getXPathText)("child::dc:creator",e,t,n),o.date=(0,r.getXPathText)("child::pubDate",e,t),o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SectionTitle=t.StyledSubTitle=t.StyledTitle=t.StyledTitleContainer=void 0;var r=u(n(0)),o=u(n(3)),i=u(n(1)),a=n(9),l=u(n(315));function u(e){return e&&e.__esModule?e:{default:e}}var s=t.StyledTitleContainer=i.default.span.withConfig({displayName:"SectionTitle__StyledTitleContainer",componentId:"nlobus-0"})(["flex-grow:1;overflow-x:hidden;line-height:normal;"]),c=t.StyledTitle=i.default.span.withConfig({displayName:"SectionTitle__StyledTitle",componentId:"nlobus-1"})(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;color:",";"],a.colors.$color_headings),f=t.StyledSubTitle=i.default.span.withConfig({displayName:"SectionTitle__StyledSubTitle",componentId:"nlobus-2"})(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;font-size:0.8125rem;margin-top:2px;"]);(t.SectionTitle=function(e){return r.default.createElement(s,null,r.default.createElement(c,null,e.title,e.titleScreenReaderText&&r.default.createElement(l.default,null," "+e.titleScreenReaderText)),e.subTitle&&r.default.createElement(f,null,e.subTitle))}).propTypes={title:o.default.string.isRequired,titleScreenReaderText:o.default.string,subTitle:o.default.string}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),o=a(n(3)),i=a(n(316));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return r.default.createElement("span",{className:"screen-reader-text",style:i.default.ScreenReaderText.default},e.children)};l.propTypes={children:o.default.string.isRequired},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={ScreenReaderText:{default:{clip:"rect(1px, 1px, 1px, 1px)",position:"absolute",height:"1px",width:"1px",overflow:"hidden"},focused:{clip:"auto",display:"block",left:"5px",top:"5px",height:"auto",width:"auto",zIndex:"100000",position:"absolute",backgroundColor:"#eeeeee ",padding:"10px"}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=u(n(0)),i=u(n(3)),a=u(n(89)),l=n(49);function u(e){return e&&e.__esModule?e:{default:e}}var s=function(e){var t=e.children,n=e.className,i=e.prefixIcon,u=e.suffixIcon,s=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["children","className","prefixIcon","suffixIcon"]);return o.default.createElement(a.default,r({className:n},s),i&&i.icon&&o.default.createElement(l.SvgIcon,{icon:i.icon,color:i.color,size:i.size}),t,u&&u.icon&&o.default.createElement(l.SvgIcon,{icon:u.icon,color:u.color,size:u.size}))};s.propTypes={className:i.default.string,prefixIcon:i.default.shape({icon:i.default.string,color:i.default.string,size:i.default.string}),suffixIcon:i.default.shape({icon:i.default.string,color:i.default.string,size:i.default.string}),children:i.default.oneOfType([i.default.arrayOf(i.default.node),i.default.node,i.default.string])},t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var r=n(0),o=u(r),i=u(n(3)),a=u(n(1)),l=n(9);function u(e){return e&&e.__esModule?e:{default:e}}var s=a.default.span.withConfig({displayName:"CardBanner__BannerContents",componentId:"oi8gid-0"})(["position:absolute;top:8px;left:-8px;font-weight:500;color:",";line-height:16px;background-color:",";padding:8px 16px;box-shadow:0 2px 4px 0 rgba(0,0,0,0.2);"],function(e){return e.textColor},function(e){return e.backgroundColor}),c=a.default.span.withConfig({displayName:"CardBanner__BannerTriangle",componentId:"oi8gid-1"})(["position:absolute;top:40px;left:-8px;border-top:8px solid ",";border-left:8px solid transparent;"],l.colors.$color_purple_dark);function f(e){return o.default.createElement(r.Fragment,null,o.default.createElement(s,{backgroundColor:e.backgroundColor,textColor:e.textColor},e.children),o.default.createElement(c,null))}f.propTypes={backgroundColor:i.default.string,textColor:i.default.string,children:i.default.any},f.defaultProps={backgroundColor:l.colors.$color_pink_dark,textColor:l.colors.$color_white,children:null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=l;var o=a(n(0)),i=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}function l(e){return o.default.createElement("iframe",r({title:e.title},e))}l.propTypes={title:i.default.string.isRequired}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=l(n(0)),a=l(n(3));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default.Component),o(t,[{key:"componentDidUpdate",value:function(){this.props.hasFocus&&this.ref.focus()}},{key:"setReference",value:function(e){this.ref=e}},{key:"render",value:function(){return i.default.createElement("input",r({ref:this.setReference.bind(this),type:this.props.type,name:this.props.name,defaultValue:this.props.value,onChange:this.props.onChange,autoComplete:this.props.autoComplete},this.props.optionalAttributes))}}]),t}();u.propTypes={name:a.default.string.isRequired,type:a.default.oneOf(["button","checkbox","number","password","progress","radio","submit","text"]).isRequired,value:a.default.any,onChange:a.default.func,optionalAttributes:a.default.object,hasFocus:a.default.bool,autoComplete:a.default.string},u.defaultProps={name:"input",type:"text",value:"",hasFocus:!1},t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(3));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var t=e.title,n=e.classNamePrefix,o=e.words,i=e.header,a=e.footer,l=r.default.createElement("ol",{className:n+"__list"},o.map(function(e){return r.default.createElement("li",{key:e,className:n+"__item"},e)}));return r.default.createElement("div",{className:n},r.default.createElement("p",null,r.default.createElement("strong",null,t)),i,l,a)};a.propTypes={words:o.default.array.isRequired,title:o.default.string.isRequired,header:o.default.string,footer:o.default.string,classNamePrefix:o.default.string},a.defaultProps={classNamePrefix:"",header:"",footer:""},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(0)),i=u(n(3)),a=u(n(1)),l=n(5);function u(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var c=a.default.span.withConfig({displayName:"WordOccurrences__ProminentWordOccurrence",componentId:"v5jj49-0"})(["display:inline-block;margin:2px 8px;"]),f=(0,a.default)(c).withConfig({displayName:"WordOccurrences__ProminentWord",componentId:"v5jj49-1"})(["font-weight:bold;overflow:hidden;text-overflow:ellipsis;"]),d=a.default.ol.withConfig({displayName:"WordOccurrences__WordOccurrencesList",componentId:"v5jj49-2"})(["list-style:none;padding:0;width:100%;margin:0;"]),p=a.default.li.withConfig({displayName:"WordOccurrences__WordBarContainer",componentId:"v5jj49-3"})(["margin:8px 0;height:calc( 1.375em + 4px );display:flex;max-width:600px;justify-content:space-between;background:linear-gradient( to right,rgba(164,40,106,0.2) ",",",",transparent );"],function(e){return e.barWidth},function(e){return e.barWidth}),h=function(e){var t=e.word,n=e.occurrence,r=e.width;return o.default.createElement(p,{barWidth:r},o.default.createElement(f,null,t),o.default.createElement(c,null,o.default.createElement("span",{"aria-hidden":!0},n),o.default.createElement("span",{className:"screen-reader-text"},(0,l.sprintf)((0,l.__)("%d occurrences","yoast-components"),n))))};h.propTypes={word:i.default.string.isRequired,occurrence:i.default.number.isRequired,width:i.default.string.isRequired};var g=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={words:[].concat(s(e.words))||[],occurrences:{min:0,max:0}},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default.Component),r(t,[{key:"render",value:function(){var e=this;return o.default.createElement(o.default.Fragment,null,this.props.header,o.default.createElement(d,{"aria-label":(0,l.__)("Prominent words","yoast-components")},this.state.words.map(function(t){var n=t.getWord(),r=t.getOccurrences(),i=r/e.state.occurrences.max*100+"%";return o.default.createElement(h,{key:"wordbar-"+n,word:n,width:i,occurrence:r})})),this.props.footer)}}],[{key:"getDerivedStateFromProps",value:function(e){var t=[].concat(s(e.words));t.sort(function(e,t){return t.getOccurrences()-e.getOccurrences()});var n=t.map(function(e){return e.getOccurrences()});return{occurrences:{min:Math.min.apply(Math,s(n)),max:Math.max.apply(Math,s(n))},words:t}}}]),t}();g.propTypes={words:i.default.array.isRequired,header:i.default.element,footer:i.default.element},g.defaultProps={header:null,footer:null},t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=a(n(0)),i=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return o.default.createElement("label",r({htmlFor:e.for},e.optionalAttributes),e.children)};l.propTypes={for:i.default.string.isRequired,optionalAttributes:i.default.shape({"aria-label":i.default.string,onClick:i.default.func,className:i.default.string}),children:i.default.any.isRequired},l.defaultProps={htmlFor:""},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(3)),o=a(n(1)),i=n(9);function a(e){return e&&e.__esModule?e:{default:e}}var l=o.default.div.withConfig({displayName:"Paper",componentId:"sc-1fchzjl-0"})(["box-shadow:0 1px 2px rgba(0,0,0,0.2);background-color:",";min-height:",";"],function(e){return e.backgroundColor},function(e){return e.minHeight});l.propTypes={backgroundColor:r.default.string,minHeight:r.default.string},l.defaultProps={backgroundColor:i.colors.$color_white,minHeight:"0"},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),o=a(n(3)),i=a(n(201));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return r.default.createElement("section",{className:e.className},e.headingText&&r.default.createElement(i.default,{level:e.headingLevel,className:e.headingClassName},e.headingText),e.children)};l.propTypes={className:o.default.string,headingText:o.default.string,headingLevel:o.default.number,headingClassName:o.default.string,children:o.default.any},l.defaultProps={headingLevel:1},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InputField=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),o=n(9);t.InputField=r.default.input.withConfig({displayName:"InputField",componentId:"sc-12z9z15-0"})(["&&&{padding:0 8px;min-height:34px;font-size:1em;box-shadow:inset 0 1px 2px ",";border:1px solid ",";border-radius:0;&:focus{border-color:#5b9dd9;box-shadow:0 0 2px ",";}}"],(0,o.rgba)(o.colors.$color_black,.07),o.colors.$color_input_border,(0,o.rgba)(o.colors.$color_snippet_focus,.8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=l(n(0)),a=l(n(3));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default.Component),o(t,[{key:"render",value:function(){return i.default.createElement("textarea",r({ref:this.setReference.bind(this),name:this.props.name,value:this.props.value,onChange:this.props.onChange},this.props.optionalAttributes))}},{key:"setReference",value:function(e){this.ref=e}},{key:"componentDidUpdate",value:function(){this.props.hasFocus&&this.ref.focus()}}]),t}();u.propTypes={name:a.default.string.isRequired,value:a.default.string,onChange:a.default.func,optionalAttributes:a.default.object,hasFocus:a.default.bool},u.defaultProps={name:"textarea",value:"",hasFocus:!1},t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.default=t.EXITING=t.ENTERED=t.ENTERING=t.EXITED=t.UNMOUNTED=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(3)),o=l(n(0)),i=l(n(37)),a=n(174);n(329);function l(e){return e&&e.__esModule?e:{default:e}}var u="unmounted";t.UNMOUNTED=u;var s="exited";t.EXITED=s;var c="entering";t.ENTERING=c;var f="entered";t.ENTERED=f;t.EXITING="exiting";var d=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n.transitionGroup,a=i&&!i.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?a?(o=s,r.appearStatus=c):o=f:o=t.unmountOnExit||t.mountOnEnter?u:s,r.state={status:o},r.nextCallback=null,r}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===u?{status:s}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==c&&n!==f&&(t=c):n!==c&&n!==f||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=i.default.findDOMNode(this);t===c?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===s&&this.setState({status:u})},n.performEnter=function(e,t){var n=this,r=this.props.enter,o=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,i=this.getTimeouts(),a=o?i.appear:i.enter;t||r?(this.props.onEnter(e,o),this.safeSetState({status:c},function(){n.props.onEntering(e,o),n.onTransitionEnd(e,a,function(){n.safeSetState({status:f},function(){n.props.onEntered(e,o)})})})):this.safeSetState({status:f},function(){n.props.onEntered(e)})},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();n?(this.props.onExit(e),this.safeSetState({status:"exiting"},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:s},function(){t.props.onExited(e)})})})):this.safeSetState({status:s},function(){t.props.onExited(e)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;e&&!r?(this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===u)return null;var t=this.props,n=t.children,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var i=o.default.Children.only(n);return o.default.cloneElement(i,r)},t}(o.default.Component);function p(){}d.contextTypes={transitionGroup:r.object},d.childContextTypes={transitionGroup:function(){}},d.propTypes={},d.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:p,onEntering:p,onEntered:p,onExit:p,onExiting:p,onExited:p},d.UNMOUNTED=0,d.EXITED=1,d.ENTERING=2,d.ENTERED=3,d.EXITING=4;var h=(0,a.polyfill)(d);t.default=h},function(e,t,n){"use strict";t.__esModule=!0,t.classNamesShape=t.timeoutsShape=void 0;!function(e){e&&e.__esModule}(n(3));t.timeoutsShape=null;t.classNamesShape=null},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=l(n(3)),o=l(n(0)),i=n(174),a=n(790);function l(e){return e&&e.__esModule?e:{default:e}}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var c=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},f=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(s(s(r)));return r.state={handleExited:o,firstRender:!0},r}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},n.componentDidMount=function(){this.appeared=!0,this.mounted=!0},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?(0,a.getInitialChildMapping)(e,r):(0,a.getNextChildMapping)(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=(0,a.getChildMapping)(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=u({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["component","childFactory"]),i=c(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?i:o.default.createElement(t,r,i)},t}(o.default.Component);f.childContextTypes={transitionGroup:r.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(e){return e}};var d=(0,i.polyfill)(f);t.default=d,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=_(i),l=_(n(1)),u=_(n(41)),s=_(n(3)),c=_(n(792)),f=n(803),d=n(5),p=n(9),h=n(204),g=n(30),y=n(49),m=_(n(311)),v=n(205),b=n(133);function _(e){return e&&e.__esModule?e:{default:e}}var x=h.string.transliterate,w=h.string.createRegexFromArray,C=h.string.replaceDiacritics,k=(0,l.default)(m.default).withConfig({displayName:"SnippetPreview__DesktopContainer",componentId:"waz8ku-0"})(["background-color:#fff;font-family:arial,sans-serif;box-sizing:border-box;"]),S=l.default.div.withConfig({displayName:"SnippetPreview__MobileContainer",componentId:"waz8ku-1"})(["border-bottom:1px hidden #fff;border-radius:8px;box-shadow:0 1px 6px rgba(32,33,36,0.28);font-family:Arial,Roboto-Regular,HelveticaNeue,sans-serif;max-width:","px;box-sizing:border-box;font-size:14px;"],400),O=l.default.div.withConfig({displayName:"SnippetPreview__BaseTitle",componentId:"waz8ku-2"})(["cursor:pointer;position:relative;"]);function E(e,t,n){return(0,l.default)(e).withConfig({displayName:"SnippetPreview",componentId:"waz8ku-3"})(["&::before{display:block;position:absolute;top:0;",":",";width:22px;height:22px;background-image:url( ",' );background-size:24px;background-repeat:no-repeat;background-position:center;content:"";}'],(0,g.getDirectionalStyle)("left","right"),function(){return n===v.MODE_DESKTOP?"-22px":"-40px"},(0,g.getDirectionalStyle)((0,b.angleRight)(t),(0,b.angleLeft)(t)))}var T=l.default.div.withConfig({displayName:"SnippetPreview__Title",componentId:"waz8ku-4"})(["color:",";text-decoration:none;font-size:",";line-height:",";font-weight:normal;margin:0;display:inline-block;overflow:hidden;max-width:","px;vertical-align:top;text-overflow:ellipsis;"],function(e){return e.screenMode===v.MODE_DESKTOP?"#1a0dab":"#1967d2"},function(e){return e.screenMode===v.MODE_DESKTOP?"20px":"16px"},function(e){return e.screenMode===v.MODE_DESKTOP?"1.3":"20px"},600),P=(0,l.default)(T).withConfig({displayName:"SnippetPreview__TitleBounded",componentId:"waz8ku-5"})(["max-width:","px;vertical-align:top;text-overflow:ellipsis;"],600),j=l.default.span.withConfig({displayName:"SnippetPreview__TitleUnboundedDesktop",componentId:"waz8ku-6"})(["white-space:nowrap;"]),M=l.default.span.withConfig({displayName:"SnippetPreview__TitleUnboundedMobile",componentId:"waz8ku-7"})(["display:inline-block;max-height:40px;padding-top:1px;vertical-align:top;overflow:hidden;text-overflow:ellipsis;"]),I=l.default.div.withConfig({displayName:"SnippetPreview__BaseUrl",componentId:"waz8ku-8"})(["display:inline-block;cursor:pointer;position:relative;max-width:90%;white-space:nowrap;font-size:14px;vertical-align:top;"]),R=(0,l.default)(I).withConfig({displayName:"SnippetPreview__BaseUrlOverflowContainer",componentId:"waz8ku-9"})(["overflow:hidden;text-overflow:ellipsis;max-width:100%;margin-bottom:",";padding-top:1px;line-height:",";vertical-align:",";"],function(e){return e.screenMode===v.MODE_DESKTOP?"0":"12px"},function(e){return e.screenMode===v.MODE_DESKTOP?"1.5":"20px"},function(e){return e.screenMode===v.MODE_DESKTOP?"baseline":"top"}),N=l.default.span.withConfig({displayName:"SnippetPreview__UrlContentContainer",componentId:"waz8ku-10"})(["font-size:",";color:",";"],function(e){return e.screenMode===v.MODE_DESKTOP?"16px":"12px"},function(e){return e.screenMode===v.MODE_DESKTOP?"#006621":"#3c4043"});R.displayName="SnippetPreview__BaseUrlOverflowContainer";var A=l.default.div.withConfig({displayName:"SnippetPreview__DesktopDescription",componentId:"waz8ku-11"})(["color:",";cursor:pointer;position:relative;max-width:","px;padding-top:",";font-size:14px;line-height:1.57;"],function(e){return e.isDescriptionPlaceholder?"#767676":"#545454"},600,function(e){return e.screenMode===v.MODE_DESKTOP?"0":"1px"}),B=l.default.div.withConfig({displayName:"SnippetPreview__MobileDescription",componentId:"waz8ku-12"})(["color:",";font-size:14px;line-height:20px;cursor:pointer;position:relative;max-width:",'px;&:after{display:table;content:"";clear:both;}'],"#3c4043",600),L=l.default.div.withConfig({displayName:"SnippetPreview__MobileDescriptionImageContainer",componentId:"waz8ku-13"})(["float:right;width:104px;height:104px;margin:4px 0 4px 16px;border-radius:8px;overflow:hidden;"]),D=l.default.img.withConfig({displayName:"SnippetPreview__MobileDescriptionImage",componentId:"waz8ku-14"})(["&&&{display:block;width:104px;height:104px;object-fit:cover;}"]),q=l.default.div.withConfig({displayName:"SnippetPreview__MobilePartContainer",componentId:"waz8ku-15"})(["padding:12px 16px;&:first-child{margin-bottom:-16px;}"]),z=l.default.div.withConfig({displayName:"SnippetPreview__DesktopPartContainer",componentId:"waz8ku-16"})([""]),$=l.default.div.withConfig({displayName:"SnippetPreview__UrlDownArrow",componentId:"waz8ku-17"})(["display:inline-block;margin-top:9px;margin-left:6px;border-top:5px solid #006621;border-right:4px solid transparent;border-left:4px solid transparent;vertical-align:top;"]),F=l.default.span.withConfig({displayName:"SnippetPreview__DatePreview",componentId:"waz8ku-18"})(["color:",";"],function(e){return e.screenMode===v.MODE_DESKTOP?"#777":"#70757a"}),W=l.default.img.withConfig({displayName:"SnippetPreview__Favicon",componentId:"waz8ku-19"})(["width:16px;height:16px;margin-right:12px;vertical-align:middle;"]),U=l.default.div.withConfig({displayName:"SnippetPreview__Amp",componentId:"waz8ku-20"})(["background-size:100% 100%;display:inline-block;height:12px;width:12px;margin-bottom:-1px;opacity:0.46;margin-right:6px;background-image:url( "," )"],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAABr0lEQVR4AbWWJYCUURhFD04Zi7hrLzgFd4nzV9x6wKHinmYb7g4zq71gIw2LWBnZ3Q8df/fh96Tn/t2HVIw4CVKk+fSFNCkSxInxW1pFkhLmoMRjVvFLmkEX5ocuZuBVPw5jv8hh+iEU5QEmuMK+prz7RN3dPMMEGQYzxpH/lGjzou5jgl7mAvOdZfcbF+jbm3MAbFZ7VX9SJnlL1D8UMyjLe+BrAYDb+jJUr59JrlNWRtcqX9GkrPCR4QBAf4qYJAkQoyQrbKKs8RiaEjEI0GvvQ1mLMC9xaBFFBaZS1TbMSwJSomg39erDF+TxpCCNOXjGQJTCvG6qn4ZPzkcxA61Tjhaf4KMj+6Q3XvW6Lopraa8IozRQxIi0a7NXorULc5JyHX/3F3q+0PsFYytVTaGgjz/AvCyiegE69IUsPxHNBMpa738i6tGWlzkAABjKe/+j9YeRHGVd9oWRnwe2ewDASp/L/UqoPQ5AmFeYZMavBP8dAJz0GWWDHQlzXApMdz4KYUfKICcxkKeOfGmQyrIPcgE9m+g/+kT812/Nr3+0kqzitxQjoKXh6xfor99nlEdFjyvH15gAAAAASUVORK5CYII=");function K(e,t,n,r){if(0===t.length)return n;var o=r||n,i=[];t.forEach(function(t){t=r?C(t):t,i.push(t);var n=x(t,e);n!==t&&i.push(n)});var l=w(i,!1,"",!1);return o=o.replace(l,function(e){return"{{strong}}"+e+"{{/strong}}"}),(0,u.default)({mixedString:o,components:{strong:a.default.createElement("strong",null)}})}var H=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={title:e.title,description:e.description,isDescriptionPlaceholder:!0},n.setTitleRef=n.setTitleRef.bind(n),n.setDescriptionRef=n.setDescriptionRef.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.PureComponent),o(t,[{key:"setTitleRef",value:function(e){this._titleElement=e}},{key:"setDescriptionRef",value:function(e){this._descriptionElement=e}},{key:"hasOverflowedContent",value:function(e){return Math.abs(e.clientHeight-e.scrollHeight)>=2}},{key:"fitTitle",value:function(){var e=this._titleElement;if(this.hasOverflowedContent(e)){var t=this.state.title,n=e.clientWidth/3;t.length>n&&(t=t.substring(0,n));var r=this.dropLastWord(t);this.setState({title:r})}}},{key:"dropLastWord",value:function(e){var t=e.split(" ");return t.pop(),t.join(" ")}},{key:"getTitle",value:function(){return this.props.title!==this.state.title?this.state.title+" ...":this.props.title}},{key:"getDescription",value:function(){return this.props.description?(0,c.default)(this.props.description,{length:156,separator:" ",omission:" ..."}):(0,d.__)("Please provide a meta description by editing the snippet below. If you don’t, Google will try to find a relevant part of your post to show in the search results.","yoast-components")}},{key:"renderDate",value:function(){var e=this.props.mode===v.MODE_DESKTOP?"-":"⋅";return this.props.date&&a.default.createElement(F,{screenMode:this.props.mode},this.props.date," ",e," ")}},{key:"addCaretStyles",value:function(e,t){var n=this.props,r=n.mode,o=n.hoveredField;return n.activeField===e?E(t,p.colors.$color_snippet_active,r):o===e?E(t,p.colors.$color_snippet_hover,r):t}},{key:"getBreadcrumbs",value:function(e){var t=this.props.breadcrumbs,n=encodeURI(e.replace(/\?|#/g,"")),r=(0,f.parse)(n),o=r.protocol,i=r.hostname,a=r.pathname,l="https:"===o?o+"//"+i:i,u=t||a.split("/"),s=[l].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(u)).filter(function(e){return!!e}).join(" › ");return decodeURI(s)}},{key:"renderUrl",value:function(){var e=this.props,t=e.url,n=e.onMouseUp,r=e.onMouseEnter,o=e.onMouseLeave,i=e.mode,l=e.faviconSrc,u=i===v.MODE_MOBILE,s=C(t);u?s=this.getBreadcrumbs(s):function(e){return e.lastIndexOf("/")===e.length-1}(s)||(s+="/");var c=this.addCaretStyles("url",I);return a.default.createElement(a.default.Fragment,null,a.default.createElement(y.ScreenReaderText,null,(0,d.__)("Url preview","yoast-components")+":"),a.default.createElement(c,null,a.default.createElement(R,{onMouseUp:n.bind(null,"url"),onMouseEnter:r.bind(null,"url"),onMouseLeave:o.bind(null),screenMode:i},u&&a.default.createElement(W,{src:l||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABs0lEQVR4AWL4//8/RRjO8Iucx+noO0MWUDo16FYABMGP6ZfUcRnWtm27jVPbtm3bttuH2t3eFPcY9pLz7NxiLjCyVd87pKnHyqXyxtCs8APd0rnyxiu4qSeA3QEDrAwBDrT1s1Rc/OrjLZwqVmOSu6+Lamcpp2KKMA9PH1BYXMe1mUP5qotvXTywsOEEYHXxrY+3cqk6TMkYpNr2FeoY3KIr0RPtn9wQ2unlA+GMkRw6+9TFw4YTwDUzx/JVvARj9KaedXRO8P5B1Du2S32smzqUrcKGEyA+uAgQjKX7zf0boWHGfn71jIKj2689gxp7OAGShNcBUmLMPVjZuiKcA2vuWHHDCQxMCz629kXAIU4ApY15QwggAFbfOP9DhgBJ+nWVJ1AZAfICAj1pAlY6hCADZnveQf7bQIwzVONGJonhLIlS9gr5mFg44Xd+4S3XHoGNPdJl1INIwKyEgHckEhgTe1bGiFY9GSFBYUwLh1IkiJUbY407E7syBSFxKTszEoiE/YdrgCEayDmtaJwCI9uu8TKMuZSVfSa4BpGgzvomBR/INhLGzrqDotp01ZR8pn/1L0JN9d9XNyx0AAAAAElFTkSuQmCC",alt:""}),a.default.createElement(N,{screenMode:i},s))))}},{key:"componentWillReceiveProps",value:function(e){var t={};this.props.title!==e.title&&(t.title=e.title),this.props.description!==e.description&&(t.description=e.description),this.setState(t)}},{key:"componentDidUpdate",value:function(){var e=this;this.setState({isDescriptionPlaceholder:!this.props.description}),this.props.mode===v.MODE_MOBILE&&(clearTimeout(this.fitTitleTimeout),this.fitTitleTimeout=setTimeout(function(){e.fitTitle()},10))}},{key:"componentDidMount",value:function(){this.setState({isDescriptionPlaceholder:!this.props.description})}},{key:"renderDescription",value:function(){var e=this.props,t=e.wordsToHighlight,n=e.locale,o=e.onMouseUp,i=e.onMouseLeave,l=e.onMouseEnter,u=e.mode,s=e.mobileImageSrc,c=this.renderDate(),f={isDescriptionPlaceholder:this.state.isDescriptionPlaceholder,onMouseUp:o.bind(null,"description"),onMouseEnter:l.bind(null,"description"),onMouseLeave:i.bind(null)};if(u===v.MODE_DESKTOP){var d=this.addCaretStyles("description",A);return a.default.createElement(d,r({},f,{ref:this.setDescriptionRef}),c,K(n,t,this.getDescription()))}if(u===v.MODE_MOBILE){var p=this.addCaretStyles("description",B);return a.default.createElement(p,f,a.default.createElement(B,{isDescriptionPlaceholder:this.state.isDescriptionPlaceholder,ref:this.setDescriptionRef},s&&a.default.createElement(L,null,a.default.createElement(D,{src:s,alt:""})),c,K(n,t,this.getDescription())))}return null}},{key:"render",value:function(){var e=this.props,t=e.onMouseUp,n=e.onMouseLeave,r=e.onMouseEnter,o=e.mode,i=e.isAmp,l=this.getPreparedComponents(o),u=l.PartContainer,s=l.Container,c=l.TitleUnbounded,f=l.SnippetTitle,p=o===v.MODE_DESKTOP,h=p?a.default.createElement($,null):null,g=p||!i?null:a.default.createElement(U,null);return a.default.createElement("section",null,a.default.createElement(s,{id:"yoast-snippet-preview-container",onMouseLeave:this.onMouseLeave,width:p?640:null,padding:20},a.default.createElement(u,null,!p&&this.renderUrl(),a.default.createElement(y.ScreenReaderText,null,(0,d.__)("SEO title preview","yoast-components")+":"),a.default.createElement(f,{onMouseUp:t.bind(null,"title"),onMouseEnter:r.bind(null,"title"),onMouseLeave:n.bind(null)},a.default.createElement(P,{screenMode:o},a.default.createElement(c,{ref:this.setTitleRef},this.getTitle()))),g,p&&this.renderUrl(),h),a.default.createElement(u,null,a.default.createElement(y.ScreenReaderText,null,(0,d.__)("Meta description preview","yoast-components")+":"),this.renderDescription())))}},{key:"getPreparedComponents",value:function(e){return{PartContainer:e===v.MODE_DESKTOP?z:q,Container:e===v.MODE_DESKTOP?k:S,TitleUnbounded:e===v.MODE_DESKTOP?j:M,SnippetTitle:this.addCaretStyles("title",O)}}}]),t}();t.default=H,H.propTypes={title:s.default.string.isRequired,url:s.default.string.isRequired,description:s.default.string.isRequired,date:s.default.string,breadcrumbs:s.default.array,hoveredField:s.default.string,activeField:s.default.string,keyword:s.default.string,wordsToHighlight:s.default.array,locale:s.default.string,mode:s.default.oneOf(v.MODES),isAmp:s.default.bool,faviconSrc:s.default.string,mobileImageSrc:s.default.string,onMouseUp:s.default.func.isRequired,onHover:s.default.func,onMouseEnter:s.default.func,onMouseLeave:s.default.func},H.defaultProps={date:"",keyword:"",wordsToHighlight:[],breadcrumbs:null,locale:"en",hoveredField:"",activeField:"",mode:v.DEFAULT_MODE,isAmp:!1,faviconSrc:"",mobileImageSrc:"",onHover:function(){},onMouseEnter:function(){},onMouseLeave:function(){}}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){"use strict";t.decode=t.parse=n(806),t.encode=t.stringify=n(334)},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,l){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),function(a){var l=encodeURIComponent(r(a))+n;return o(e[a])?i(e[a],function(e){return l+encodeURIComponent(r(e))}).join(t):l+encodeURIComponent(r(e[a]))}).join(t):l?encodeURIComponent(r(l))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";var r=n(43),o=n(8),i=n(58),a=o.OrderedMap;e.exports=function(e){return e.first()instanceof r?function(e){var t={},n=void 0;return a(e.withMutations(function(e){e.forEach(function(r,o){var a=r.getKey(),l=r.getNextSiblingKey(),u=r.getPrevSiblingKey(),s=r.getChildKeys(),c=r.getParentKey(),f=i();if(t[a]=f,l&&(e.get(l)?e.setIn([l,"prevSibling"],f):e.setIn([a,"nextSibling"],null)),u&&(e.get(u)?e.setIn([u,"nextSibling"],f):e.setIn([a,"prevSibling"],null)),c&&e.get(c)){var d=e.get(c).getChildKeys();e.setIn([c,"children"],d.set(d.indexOf(r.getKey()),f))}else e.setIn([a,"parent"],null),n&&(e.setIn([n.getKey(),"nextSibling"],f),e.setIn([a,"prevSibling"],t[n.getKey()])),n=e.get(a);s.forEach(function(t){e.get(t)?e.setIn([t,"parent"],f):e.setIn([a,"children"],r.getChildKeys().filter(function(e){return e!==t}))})})}).toArray().map(function(e){return[t[e.getKey()],e.set("key",t[e.getKey()])]}))}(e):function(e){return a(e.toArray().map(function(e){var t=i();return[t,e.set("key",t)]}))}(e)}},function(e,t,n){"use strict";var r=n(39),o=n(108),i=n(11);function a(e,t,n){var a=t.getCharacterList(),l=n>0?a.get(n-1):void 0,u=n<a.count()?a.get(n):void 0,s=l?l.getEntity():void 0,c=u?u.getEntity():void 0;if(c&&c===s&&"MUTABLE"!==e.__get(c).getMutability()){for(var f,d=function(e,t,n){var r;return o(e,function(e,t){return e.getEntity()===t.getEntity()},function(e){return e.getEntity()===t},function(e,t){e<=n&&t>=n&&(r={start:e,end:t})}),"object"!=typeof r&&i(!1),r}(a,c,n),p=d.start,h=d.end;p<h;)f=a.get(p),a=a.set(p,r.applyEntity(f,null)),p++;return t.set("characterList",a)}return t}e.exports=function(e,t){var n=e.getBlockMap(),r=e.getEntityMap(),o={},i=t.getStartKey(),l=t.getStartOffset(),u=n.get(i),s=a(r,u,l);s!==u&&(o[i]=s);var c=t.getEndKey(),f=t.getEndOffset(),d=n.get(c);i===c&&(d=s);var p=a(r,d,f);return p!==d&&(o[c]=p),Object.keys(o).length?e.merge({blockMap:n.merge(o),selectionAfter:t}):e.set("selectionAfter",t)}},function(e,t,n){"use strict";e.exports=function(e,t,n){if(n===e.count())t.forEach(function(t){e=e.push(t)});else if(0===n)t.reverse().forEach(function(t){e=e.unshift(t)});else{var r=e.slice(0,n),o=e.slice(n);e=r.concat(t,o).toList()}return e}},function(e,t,n){"use strict";var r=n(43);e.exports=function(e,t){if(!(e instanceof r))return null;var n=e.getNextSiblingKey();if(n)return n;var o=e.getParentKey();if(!o)return null;for(var i=t.get(o);i&&!i.getNextSiblingKey();){var a=i.getParentKey();i=a?t.get(a):null}return i?i.getNextSiblingKey():null}},function(e,t,n){"use strict";var r=n(8),o=n(207),i=n(108),a=r.List,l=r.Repeat,u=r.Record,s=o.thatReturnsTrue,c=u({start:null,end:null}),f=u({start:null,end:null,decoratorKey:null,leaves:null}),d={generate:function(e,t,n){var r=t.getLength();if(!r)return a.of(new f({start:0,end:0,decoratorKey:null,leaves:a.of(new c({start:0,end:0}))}));var o=[],u=n?n.getDecorations(t,e):a(l(null,r)),d=t.getCharacterList();return i(u,p,s,function(e,t){o.push(new f({start:e,end:t,decoratorKey:u.get(e),leaves:function(e,t){var n=[],r=e.map(function(e){return e.getStyle()}).toList();return i(r,p,s,function(e,r){n.push(new c({start:e+t,end:r+t}))}),a(n)}(d.slice(e,t).toList(),e)}))}),a(o)},getFingerprint:function(e){return e.map(function(e){var t=e.get("decoratorKey");return(null!==t?t+"."+(e.get("end")-e.get("start")):"")+"."+e.get("leaves").size}).join("-")}};function p(e,t){return e===t}e.exports=d},function(e,t,n){"use strict";var r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getType=function(){return this.get("type")},t.prototype.getMutability=function(){return this.get("mutability")},t.prototype.getData=function(){return this.get("data")},t}((0,n(8).Record)({type:"TOKEN",mutability:"IMMUTABLE",data:Object}));e.exports=r},function(e,t,n){"use strict";var r=n(210),o=n(11),i="־׀׃׆-א-ת-ׯװ-ײ׳-״-߀-߉ߊ-ߪߴ-ߵߺ-߿ࠀ-ࠕࠚࠤࠨ-࠰-࠾ࡀ-ࡘ-࡞-࢟יִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏ",a="؈؋؍؛؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍ܐܒ-ܯ-ݍ-ޥޱ-ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-ﯓ-ﴽ﵀-﵏ﵐ-ﶏ-ﶒ-ﷇ-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴﹶ-ﻼ-",l=new RegExp("["+"A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"+i+a+"]"),u=new RegExp("["+i+a+"]");function s(e){var t=l.exec(e);return null==t?null:t[0]}function c(e){var t=s(e);return null==t?r.NEUTRAL:u.exec(t)?r.RTL:r.LTR}function f(e,t){if(t=t||r.NEUTRAL,!e.length)return t;var n=c(e);return n===r.NEUTRAL?t:n}function d(e,t){return t||(t=r.getGlobalDir()),r.isStrong(t)||o(!1),f(e,t)}var p={firstStrongChar:s,firstStrongCharDir:c,resolveBlockDir:f,getDirection:d,isDirectionLTR:function(e,t){return d(e,t)===r.LTR},isDirectionRTL:function(e,t){return d(e,t)===r.RTL}};e.exports=p},function(e,t,n){"use strict";e.exports={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}}},function(e,t,n){"use strict";e.exports=function(e){var t=e.getSelection(),n=t.getAnchorKey(),r=e.getBlockTree(n),o=t.getStartOffset(),i=!1;return r.some(function(e){return o===e.get("start")?(i=!0,!0):o<e.get("end")&&e.get("leaves").some(function(e){var t=e.get("start");return o===t&&(i=!0,!0)})}),i}},function(e,t,n){"use strict";var r=n(42)||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var o=n(831),i=n(136),a=n(0),l=n(37),u=n(346),s=n(215),c=n(341),f=n(210),d=n(91),p=n(846),h=n(216),g=n(850),y=n(11),m=n(50),v=function(e,t){return e.getAnchorKey()===t||e.getFocusKey()===t},b=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.block!==e.block||this.props.tree!==e.tree||this.props.direction!==e.direction||v(e.selection,e.block.getKey())&&e.forceSelection},t.prototype.componentDidMount=function(){var e=this.props.selection,t=e.getEndKey();if(e.getHasFocus()&&t===this.props.block.getKey()){var n=l.findDOMNode(this),r=s.getScrollParent(n),o=h(r),i=void 0;if(r===window){var a=p(n);(i=a.y+a.height-g().height)>0&&window.scrollTo(o.x,o.y+i+10)}else{n instanceof HTMLElement||y(!1),(i=n.offsetHeight+n.offsetTop-(r.offsetHeight+o.y))>0&&u.setTop(r,u.getTop(r)+i+10)}}},t.prototype._renderChildren=function(){var e=this,t=this.props.block,n=t.getKey(),l=t.getText(),u=this.props.tree.size-1,s=v(this.props.selection,n);return this.props.tree.map(function(d,p){var h=d.get("leaves"),g=h.size-1,y=h.map(function(r,c){var f=i.encode(n,p,c),d=r.get("start"),h=r.get("end");return a.createElement(o,{key:f,offsetKey:f,block:t,start:d,selection:s?e.props.selection:null,forceSelection:e.props.forceSelection,text:l.slice(d,h),styleSet:t.getInlineStyleAt(d),customStyleMap:e.props.customStyleMap,customStyleFn:e.props.customStyleFn,isLast:p===u&&c===g})}).toArray(),v=d.get("decoratorKey");if(null==v)return y;if(!e.props.decorator)return y;var b=m(e.props.decorator),_=b.getComponentForKey(v);if(!_)return y;var x=b.getPropsForKey(v),w=i.encode(n,p,0),C=l.slice(h.first().get("start"),h.last().get("end")),k=f.getHTMLDirIfDifferent(c.getDirection(C),e.props.direction);return a.createElement(_,r({},x,{contentState:e.props.contentState,decoratedText:C,dir:k,key:w,entityKey:t.getEntityAt(d.get("start")),offsetKey:w}),y)}).toArray()},t.prototype.render=function(){var e=this.props,t=e.direction,n=e.offsetKey,r=d({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===t,"public/DraftStyleDefault/rtl":"RTL"===t});return a.createElement("div",{"data-offset-key":n,className:r},this._renderChildren())},t}(a.Component);e.exports=b},function(e,t,n){"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},function(e,t,n){"use strict";function r(e,t){return!!t&&(e===t.documentElement||e===t.body)}var o={getTop:function(e){var t=e.ownerDocument;return r(e,t)?t.body.scrollTop||t.documentElement.scrollTop:e.scrollTop},setTop:function(e,t){var n=e.ownerDocument;r(e,n)?n.body.scrollTop=n.documentElement.scrollTop=t:e.scrollTop=t},getLeft:function(e){var t=e.ownerDocument;return r(e,t)?t.body.scrollLeft||t.documentElement.scrollLeft:e.scrollLeft},setLeft:function(e,t){var n=e.ownerDocument;r(e,n)?n.body.scrollLeft=n.documentElement.scrollLeft=t:e.scrollLeft=t}};e.exports=o},function(e,t,n){"use strict";var r=n(853),o=n(854),i=n(207),a=new RegExp("\r\n","g"),l={"text/rtf":1,"text/html":1};function u(e){if("file"==e.kind)return e.getAsFile()}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data=t,this.types=t.types?o(t.types):[]}return e.prototype.isRichText=function(){return!(!this.getHTML()||!this.getText())||!this.isImage()&&this.types.some(function(e){return l[e]})},e.prototype.getText=function(){var e;return this.data.getData&&(this.types.length?-1!=this.types.indexOf("text/plain")&&(e=this.data.getData("text/plain")):e=this.data.getData("Text")),e?e.replace(a,"\n"):null},e.prototype.getHTML=function(){if(this.data.getData){if(!this.types.length)return this.data.getData("Text");if(-1!=this.types.indexOf("text/html"))return this.data.getData("text/html")}},e.prototype.isLink=function(){return this.types.some(function(e){return-1!=e.indexOf("Url")||-1!=e.indexOf("text/uri-list")||e.indexOf("text/x-moz-url")})},e.prototype.getLink=function(){return this.data.getData?-1!=this.types.indexOf("text/x-moz-url")?this.data.getData("text/x-moz-url").split("\n")[0]:-1!=this.types.indexOf("text/uri-list")?this.data.getData("text/uri-list"):this.data.getData("url"):null},e.prototype.isImage=function(){var e=this.types.some(function(e){return-1!=e.indexOf("application/x-moz-file")});if(e)return!0;for(var t=this.getFiles(),n=0;n<t.length;n++){var o=t[n].type;if(!r.isImage(o))return!1}return!0},e.prototype.getCount=function(){return this.data.hasOwnProperty("items")?this.data.items.length:this.data.hasOwnProperty("mozItemCount")?this.data.mozItemCount:this.data.files?this.data.files.length:null},e.prototype.getFiles=function(){return this.data.items?Array.prototype.slice.call(this.data.items).map(u).filter(i.thatReturnsArgument):this.data.files?Array.prototype.slice.call(this.data.files):[]},e.prototype.hasFiles=function(){return this.getFiles().length>0},e}();e.exports=s},function(e,t,n){"use strict";e.exports=function e(t){if(t instanceof Element){var n=t.getAttribute("data-offset-key");if(n)return n;for(var r=0;r<t.childNodes.length;r++){var o=e(t.childNodes[r]);if(o)return o}}return null}},function(e,t,n){"use strict";(function(t){var r=n(11),o=/\.textClipping$/,i={"text/plain":!0,"text/html":!0,"text/rtf":!0},a=5e3;e.exports=function(e,n){var l=0,u=[];e.forEach(function(s){!function(e,n){if(t.FileReader&&(!e.type||e.type in i)){if(""===e.type){var a="";return o.test(e.name)&&(a=e.name.replace(o,"")),void n(a)}var l=new FileReader;l.onload=function(){var e=l.result;"string"!=typeof e&&r(!1),n(e)},l.onerror=function(){n("")},l.readAsText(e)}else n("")}(s,function(t){l++,t&&u.push(t.slice(0,a)),l==e.length&&n(u.join("\r"))})})}}).call(this,n(21))},function(e,t,n){"use strict";var r=n(136),o=n(50);e.exports=function(e,t,n,i,a){var l=o(e.getSelection()),u=r.decode(t),s=u.blockKey,c=e.getBlockTree(s).getIn([u.decoratorKey,"leaves",u.leafKey]),f=r.decode(i),d=f.blockKey,p=e.getBlockTree(d).getIn([f.decoratorKey,"leaves",f.leafKey]),h=c.get("start"),g=p.get("start"),y=c?h+n:null,m=p?g+a:null;if(l.getAnchorKey()===s&&l.getAnchorOffset()===y&&l.getFocusKey()===d&&l.getFocusOffset()===m)return l;var v=!1;if(s===d){var b=c.get("end"),_=p.get("end");v=g===h&&_===b?a<n:g<h}else v=e.getCurrentContent().getBlockMap().keySeq().skipUntil(function(e){return e===s||e===d}).first()===d;return l.merge({anchorKey:s,anchorOffset:y,focusKey:d,focusOffset:m,isBackward:v})}},function(e,t,n){"use strict";var r=n(134);e.exports=function(e){var t=e.getSelection();return t.isCollapsed()?null:r(e.getCurrentContent(),t)}},function(e,t,n){"use strict";var r=n(55),o=n(11);var i=r.isBrowser("Chrome")?function(e){for(var t=e.cloneRange(),n=[],r=e.endContainer;null!=r;r=r.parentNode){var i=r===e.commonAncestorContainer;i?t.setStart(e.startContainer,e.startOffset):t.setStart(t.endContainer,0);var a,l=Array.from(t.getClientRects());if(n.push(l),i)return n.reverse(),(a=[]).concat.apply(a,n);t.setEndBefore(r)}o(!1)}:function(e){return Array.from(e.getClientRects())};e.exports=i},function(e,t,n){"use strict";var r=n(217),o=n(348),i=n(350),a=n(11),l=n(50);function u(e,t,n){var i=t,u=r(i);if(null!=u||e&&(e===i||e.firstChild===i)||a(!1),e===i&&((i=i.firstChild)instanceof Element&&"true"===i.getAttribute("data-contents")||a(!1),n>0&&(n=i.childNodes.length)),0===n){var c=null;if(null!=u)c=u;else{var f=function(e){for(;e.firstChild&&(e.firstChild instanceof Element&&"true"===e.firstChild.getAttribute("data-blocks")||o(e.firstChild));)e=e.firstChild;return e}(i);c=l(o(f))}return{key:c,offset:0}}var d=i.childNodes[n-1],p=null,h=null;if(o(d)){var g=function(e){for(;e.lastChild&&(e.lastChild instanceof Element&&"true"===e.lastChild.getAttribute("data-blocks")||o(e.lastChild));)e=e.lastChild;return e}(d);p=l(o(g)),h=s(g)}else p=l(u),h=s(d);return{key:p,offset:h}}function s(e){var t=e.textContent;return"\n"===t?0:t.length}e.exports=function(e,t,n,o,a,s){var c=n.nodeType===Node.TEXT_NODE,f=a.nodeType===Node.TEXT_NODE;if(c&&f)return{selectionState:i(e,l(r(n)),o,l(r(a)),s),needsRecovery:!1};var d=null,p=null,h=!0;return c?(d={key:l(r(n)),offset:o},p=u(t,a,s)):f?(p={key:l(r(a)),offset:s},d=u(t,n,o)):(d=u(t,n,o),p=u(t,a,s),n===a&&o===s&&(h=!!n.firstChild&&"BR"!==n.firstChild.nodeName)),{selectionState:i(e,d.key,d.offset,p.key,p.offset),needsRecovery:h}}},function(e,t,n){"use strict";var r="\\s|(?![_])"+n(872).getPunctuation(),o=new RegExp("^(?:"+r+")*(?:['‘’]|(?!"+r+").)*(?:(?!"+r+").)"),i=new RegExp("(?:(?!"+r+").)(?:['‘’]|(?!"+r+").)*(?:"+r+")*$");function a(e,t){var n=t?i.exec(e):o.exec(e);return n?n[0]:e}var l={getBackward:function(e){return a(e,!0)},getForward:function(e){return a(e,!1)}};e.exports=l},function(e,t,n){"use strict";e.exports=function(e,t){var n,r=e.getSelection(),o=r.getStartKey(),i=r.getStartOffset(),a=e.getCurrentContent(),l=o;return t>a.getBlockForKey(o).getText().length-i?(l=a.getKeyAfter(o),n=0):n=i+t,r.merge({focusKey:l,focusOffset:n})}},function(e,t,n){"use strict";var r,o=i||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(42);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=n(39),u=n(74),s=n(43),c=n(211),f=n(135),d=n(63),p=n(8),h=n(8).Set,g=n(883),y=n(91),m=n(58),v=n(357),b=n(11),_=n(209),x=d.draft_tree_data_support,w=p.List,C=p.OrderedSet,k=new RegExp("\r","g"),S=new RegExp("\n","g"),O=new RegExp(" ","g"),E=new RegExp(" ?","g"),T=new RegExp("​?","g"),P=["bold","bolder","500","600","700","800","900"],j=["light","lighter","100","200","300","400"],M={b:"BOLD",code:"CODE",del:"STRIKETHROUGH",em:"ITALIC",i:"ITALIC",s:"STRIKETHROUGH",strike:"STRIKETHROUGH",strong:"BOLD",u:"UNDERLINE"},I=(a(r={},y("public/DraftStyleDefault/depth0"),0),a(r,y("public/DraftStyleDefault/depth1"),1),a(r,y("public/DraftStyleDefault/depth2"),2),a(r,y("public/DraftStyleDefault/depth3"),3),a(r,y("public/DraftStyleDefault/depth4"),4),r),R=["className","href","rel","target","title"],N=["alt","className","height","src","width"],A=void 0,B={text:"",inlines:[],entities:[],blocks:[]},L={children:w(),depth:0,key:"",type:""},D=function(e,t){return"li"===e?"ol"===t?"ordered-list-item":"unordered-list-item":null},q=function(e,t,n){var r=n.filter(function(t){return t.element===e||t.wrapper===e||t.aliasedElements&&t.aliasedElements.some(function(t){return t===e})}).keySeq().toSet().toArray().sort();switch(r.length){case 0:return"unstyled";case 1:return r[0];default:return function(e,t,n){for(var r=0;r<n.length;r++){var o=n[r](e,t);if(o)return o}return null}(e,t,[D])||"unstyled"}},z=function(e,t,n){var r=e.text.slice(-1),o=t.text.slice(0,1);if("\r"!==r||"\r"!==o||n||(e.text=e.text.slice(0,-1),e.inlines.pop(),e.entities.pop(),e.blocks.pop()),"\r"===r){if(" "===t.text||"\n"===t.text)return e;" "!==o&&"\n"!==o||(t.text=t.text.slice(1),t.inlines.shift(),t.entities.shift())}return{text:e.text+t.text,inlines:e.inlines.concat(t.inlines),entities:e.entities.concat(t.entities),blocks:e.blocks.concat(t.blocks)}},$=function(e){e instanceof HTMLAnchorElement||b(!1);var t=e.protocol;return"http:"===t||"https:"===t||"mailto:"===t},F=function(){return o({},B,{text:"\n",inlines:[C()],entities:new Array(1)})},W=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{text:"\r",inlines:[C()],entities:new Array(1),blocks:[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o({},L,e)}({parent:n,key:m(),type:e,depth:Math.max(0,Math.min(4,t))})]}},U=function e(t,n,r,i,a,l,u,s,c,d){var p=A,h=n.nodeName.toLowerCase(),y=t,m="unstyled",v=!1,b=a&&q(a,i,s),_=o({},B),w=void 0;if("#text"===h){var k=n.textContent,O=k.trim();if(i&&""===O&&n.parentElement){var E=n.parentElement.nodeName.toLowerCase();if("ol"===E||"ul"===E)return{chunk:o({},B),entityMap:t}}return""===O&&"pre"!==a?{chunk:function(e){var t=new Array(1);return e&&(t[0]=e),o({},B,{text:" ",inlines:[C()],entities:t})}(c),entityMap:t}:("pre"!==a&&(k=k.replace(S," ")),A=h,{chunk:{text:k,inlines:Array(k.length).fill(r),entities:Array(k.length).fill(c),blocks:[]},entityMap:t})}if(A=h,"br"===h)return"br"!==p||a&&"unstyled"!==b?{chunk:F(),entityMap:t}:{chunk:W("unstyled",u,d),entityMap:t};if("img"===h&&n instanceof HTMLImageElement&&n.attributes.getNamedItem("src")&&n.attributes.getNamedItem("src").value){var T=n,L={};N.forEach(function(e){var t=T.getAttribute(e);t&&(L[e]=t)}),n.textContent="📷",c=f.__create("IMAGE","MUTABLE",L||{})}r=function(e,t,n){var r=M[e];if(r)n=n.add(r).toOrderedSet();else if(t instanceof HTMLElement){var o=t;n=n.withMutations(function(e){var t=o.style.fontWeight,n=o.style.fontStyle,r=o.style.textDecoration;P.indexOf(t)>=0?e.add("BOLD"):j.indexOf(t)>=0&&e.remove("BOLD"),"italic"===n?e.add("ITALIC"):"normal"===n&&e.remove("ITALIC"),"underline"===r&&e.add("UNDERLINE"),"line-through"===r&&e.add("STRIKETHROUGH"),"none"===r&&(e.remove("UNDERLINE"),e.remove("STRIKETHROUGH"))}).toOrderedSet()}return n}(h,n,r),"ul"!==h&&"ol"!==h||(i&&(u+=1),i=h),!x&&"li"===h&&n instanceof HTMLElement&&(u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object.keys(I).some(function(n){e.classList.contains(n)&&(t=I[n])}),t}(n,u));var D=q(h,i,s),U=i&&"li"===a&&"li"===h,K=(!a||x)&&-1!==l.indexOf(h);(U||K)&&(w=(_=W(D,u,d)).blocks[0].key,a=h,v=!x),U&&(m="ul"===i?"unordered-list-item":"ordered-list-item");var H=n.firstChild;null!=H&&(h=H.nodeName.toLowerCase());for(var V=null;H;){H instanceof HTMLAnchorElement&&H.href&&$(H)?function(){var e=H,t={};R.forEach(function(n){var r=e.getAttribute(n);r&&(t[n]=r)}),t.url=new g(e.href).toString(),V=f.__create("LINK","MUTABLE",t||{})}():V=void 0;var Y=e(y,H,r,i,a,l,u,s,V||c,x?w:null),G=Y.chunk;y=Y.entityMap,_=z(_,G,x);var X=H.nextSibling;!d&&X&&l.indexOf(h)>=0&&a&&(_=z(_,F())),X&&(h=X.nodeName.toLowerCase()),H=X}return v&&(_=z(_,W(m,u,d))),{chunk:_,entityMap:y}},K=function(e,t,n,r){e=e.trim().replace(k,"").replace(O," ").replace(E,"").replace(T,"");var i=function(e){var t=e.get("unstyled").element,n=h([]);return e.forEach(function(e){e.aliasedElements&&e.aliasedElements.forEach(function(e){n=n.add(e)}),n=n.add(e.element)}),n.filter(function(e){return e&&e!==t}).toArray().sort()}(n),a=t(e);if(!a)return null;A=null;var l=function(e,t){return t.some(function(t){return-1!==e.indexOf("<"+t)})}(e,i)?i:["div"],u=U(r,a,C(),"ul",null,l,-1,n),s=u.chunk,c=u.entityMap;return 0===s.text.indexOf("\r")&&(s={text:s.text.slice(1),inlines:s.inlines.slice(1),entities:s.entities.slice(1),blocks:s.blocks}),"\r"===s.text.slice(-1)&&(s.text=s.text.slice(0,-1),s.inlines=s.inlines.slice(0,-1),s.entities=s.entities.slice(0,-1),s.blocks.pop()),0===s.blocks.length&&s.blocks.push(o({},B,{type:"unstyled",depth:0})),s.text.split("\r").length===s.blocks.length+1&&s.blocks.unshift({type:"unstyled",depth:0}),{chunk:s,entityMap:c}};e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,r=K(e,t,n,f);if(null==r)return null;var o=r.chunk,i=r.entityMap;return{contentBlocks:function(e){if(!e||!e.text||!Array.isArray(e.blocks))return null;var t=0,n=e.blocks,r=e.inlines,o=e.entities,i=x?s:u;return e.text.split("\r").reduce(function(e,a,u){a=_(a);var c=n[u],f=t+a.length,d=r.slice(t,f),p=o.slice(t,f),h=w(d.map(function(e,t){var n={style:e,entity:null};return p[t]&&(n.entity=p[t]),l.create(n)}));t=f+1;var g=c.depth,y=c.type,v=c.parent,b=c.key||m(),x=null;if(v){var C=e.cacheRef[v],k=e.contentBlocks[C];if(k.getChildKeys().isEmpty()&&k.getText()){var S=k.getCharacterList(),O=k.getText();x=m();var E=new s({key:x,text:O,characterList:S,parent:v,nextSibling:b});e.contentBlocks.push(E),k=k.withMutations(function(e){e.set("characterList",w()).set("text","").set("children",k.children.push(E.getKey()))})}e.contentBlocks[C]=k.set("children",k.children.push(b))}var T=new i({key:b,parent:v,type:y,depth:g,text:a,characterList:h,prevSibling:x||(0===u||n[u-1].parent!==v?null:n[u-1].key),nextSibling:u===n.length-1||n[u+1].parent!==v?null:n[u+1].key});return e.contentBlocks.push(T),e.cacheRef[T.key]=u,e},{cacheRef:{},contentBlocks:[]}).contentBlocks}(o),entityMap:i}}},function(e,t,n){"use strict";var r=n(55),o=n(11),i=r.isBrowser("IE <= 9");e.exports=function(e){var t,n=null;return!i&&document.implementation&&document.implementation.createHTMLDocument&&((t=document.implementation.createHTMLDocument("foo")).documentElement||o(!1),t.documentElement.innerHTML=e,n=t.getElementsByTagName("body")[0]),n}},function(e,t,n){"use strict";var r=n(34),o=n(14),i=(n(90),n(884)),a=n(50),l={currentBlockContainsLink:function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=n.getEntityMap();return n.getBlockForKey(t.getAnchorKey()).getCharacterList().slice(t.getStartOffset(),t.getEndOffset()).some(function(e){var t=e.getEntity();return!!t&&"LINK"===r.__get(t).getType()})},getCurrentBlockType:function(e){var t=e.getSelection();return e.getCurrentContent().getBlockForKey(t.getStartKey()).getType()},getDataObjectForLinkURL:function(e){return{url:e.toString()}},handleKeyCommand:function(e,t){switch(t){case"bold":return l.toggleInlineStyle(e,"BOLD");case"italic":return l.toggleInlineStyle(e,"ITALIC");case"underline":return l.toggleInlineStyle(e,"UNDERLINE");case"code":return l.toggleCode(e);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return l.onBackspace(e);case"delete":case"delete-word":case"delete-to-end-of-block":return l.onDelete(e);default:return null}},insertSoftNewline:function(e){var t=r.insertText(e.getCurrentContent(),e.getSelection(),"\n",e.getCurrentInlineStyle(),null),n=o.push(e,t,"insert-characters");return o.forceSelection(n,t.getSelectionAfter())},onBackspace:function(e){var t=e.getSelection();if(!t.isCollapsed()||t.getAnchorOffset()||t.getFocusOffset())return null;var n=e.getCurrentContent(),r=t.getStartKey(),i=n.getBlockBefore(r);if(i&&"atomic"===i.getType()){var a=n.getBlockMap().delete(i.getKey()),u=n.merge({blockMap:a,selectionAfter:t});if(u!==n)return o.push(e,u,"remove-range")}var s=l.tryToRemoveBlockStyle(e);return s?o.push(e,s,"change-block-type"):null},onDelete:function(e){var t=e.getSelection();if(!t.isCollapsed())return null;var n=e.getCurrentContent(),i=t.getStartKey(),a=n.getBlockForKey(i).getLength();if(t.getStartOffset()<a)return null;var l=n.getBlockAfter(i);if(!l||"atomic"!==l.getType())return null;var u=t.merge({focusKey:l.getKey(),focusOffset:l.getLength()}),s=r.removeRange(n,u,"forward");return s!==n?o.push(e,s,"remove-range"):null},onTab:function(e,t,n){var r=t.getSelection(),a=r.getAnchorKey();if(a!==r.getFocusKey())return t;var l=t.getCurrentContent(),u=l.getBlockForKey(a),s=u.getType();if("unordered-list-item"!==s&&"ordered-list-item"!==s)return t;e.preventDefault();var c=l.getBlockBefore(a);if(!c)return t;var f=c.getType();if("unordered-list-item"!==f&&"ordered-list-item"!==f)return t;var d=u.getDepth();if(!e.shiftKey&&d===n)return t;n=Math.min(c.getDepth()+1,n);var p=i(l,r,e.shiftKey?-1:1,n);return o.push(t,p,"adjust-depth")},toggleBlockType:function(e,t){var n=e.getSelection(),i=n.getStartKey(),l=n.getEndKey(),u=e.getCurrentContent(),s=n;if(i!==l&&0===n.getEndOffset()){var c=a(u.getBlockBefore(l));l=c.getKey(),s=s.merge({anchorKey:i,anchorOffset:n.getStartOffset(),focusKey:l,focusOffset:c.getLength(),isBackward:!1})}if(u.getBlockMap().skipWhile(function(e,t){return t!==i}).reverse().skipWhile(function(e,t){return t!==l}).some(function(e){return"atomic"===e.getType()}))return e;var f=u.getBlockForKey(i).getType()===t?"unstyled":t;return o.push(e,r.setBlockType(u,s,f),"change-block-type")},toggleCode:function(e){var t=e.getSelection(),n=t.getAnchorKey(),r=t.getFocusKey();return t.isCollapsed()||n!==r?l.toggleBlockType(e,"code-block"):l.toggleInlineStyle(e,"CODE")},toggleInlineStyle:function(e,t){var n=e.getSelection(),i=e.getCurrentInlineStyle();if(n.isCollapsed())return o.setInlineStyleOverride(e,i.has(t)?i.remove(t):i.add(t));var a,l=e.getCurrentContent();return a=i.has(t)?r.removeInlineStyle(l,n,t):r.applyInlineStyle(l,n,t),o.push(e,a,"change-inline-style")},toggleLink:function(e,t,n){var i=r.applyEntity(e.getCurrentContent(),t,n);return o.push(e,i,"apply-entity")},tryToRemoveBlockStyle:function(e){var t=e.getSelection(),n=t.getAnchorOffset();if(t.isCollapsed()&&0===n){var o=t.getAnchorKey(),i=e.getCurrentContent(),a=i.getBlockForKey(o),l=i.getFirstBlock();if(a.getLength()>0&&a!==l)return null;var u=a.getType(),s=i.getBlockBefore(o);if("code-block"===u&&s&&"code-block"===s.getType()&&0!==s.getLength())return null;if("unstyled"!==u)return r.setBlockType(i,t,"unstyled")}return null}};e.exports=l},function(e,t,n){"use strict";var r=n(218),o=n(212),i=n(55),a=i.isPlatform("Mac OS X"),l=i.isPlatform("Windows"),u=a&&i.isBrowser("Firefox < 29"),s=r.hasCommandModifier,c=r.isCtrlKeyCommand;function f(e){return a&&e.altKey||c(e)}e.exports=function(e){switch(e.keyCode){case 66:return s(e)?"bold":null;case 68:return c(e)?"delete":null;case 72:return c(e)?"backspace":null;case 73:return s(e)?"italic":null;case 74:return s(e)?"code":null;case 75:return!l&&c(e)?"secondary-cut":null;case 77:case 79:return c(e)?"split-block":null;case 84:return a&&c(e)?"transpose-characters":null;case 85:return s(e)?"underline":null;case 87:return a&&c(e)?"backspace-word":null;case 89:return c(e)?l?"redo":"secondary-paste":null;case 90:return function(e){return s(e)?e.shiftKey?"redo":"undo":null}(e)||null;case o.RETURN:return"split-block";case o.DELETE:return function(e){return l&&e.shiftKey?null:f(e)?"delete-word":"delete"}(e);case o.BACKSPACE:return function(e){return s(e)&&a?"backspace-to-start-of-line":f(e)?"backspace-word":"backspace"}(e);case o.LEFT:return u&&s(e)?"move-selection-to-start-of-block":null;case o.RIGHT:return u&&s(e)?"move-selection-to-end-of-block":null;default:return null}}},function(e,t,n){"use strict";var r={stringify:function(e){return"_"+String(e)},unstringify:function(e){return e.slice(1)}};e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(i);t.default=function(e,t){var n,l;return l=n=function(n){function l(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(l,i.Component),o(l,[{key:"render",value:function(){return a.default.createElement(e,r({},this.props,t))}}]),l}(),n.displayName="Decorated("+function(e){return e.displayName||e.name||"Component"}(e)+")",l}},function(e,t,n){e.exports=n(913)()},function(e,t,n){(function(t){var n=1/0,r="[object Symbol]",o=/[\\^$.*+?()[\]{}|]/g,i=RegExp(o.source),a="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,u=a||l||Function("return this")(),s=Object.prototype.toString,c=u.Symbol,f=c?c.prototype:void 0,d=f?f.toString:void 0;function p(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&s.call(e)==r}(e))return d?d.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}e.exports=function(e){return(e=function(e){return null==e?"":p(e)}(e))&&i.test(e)?e.replace(o,"\\$&"):e}}).call(this,n(21))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return e&&e.__esModule?e:{default:e}}(n(917));t.default=function(e,t,n){var o=t.getAnchorKey(),i=t.getAnchorOffset()-n.length,a=e.getCurrentContent().getBlockForKey(o).getText();return(0,r.default)(a,i)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){return"@"===e?"mention":e+"mention"}},function(e,t,n){var r=n(939),o=n(952),i=n(150),a=n(19),l=n(956);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):l(e)}},function(e,t,n){var r=n(941),o=n(46);e.exports=function e(t,n,i,a,l){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,l))}},function(e,t,n){var r=n(942),o=n(945),i=n(946),a=1,l=2;e.exports=function(e,t,n,u,s,c){var f=n&a,d=e.length,p=t.length;if(d!=p&&!(f&&p>d))return!1;var h=c.get(e);if(h&&c.get(t))return h==t;var g=-1,y=!0,m=n&l?new r:void 0;for(c.set(e,t),c.set(t,e);++g<d;){var v=e[g],b=t[g];if(u)var _=f?u(b,v,g,t,e,c):u(v,b,g,e,t,c);if(void 0!==_){if(_)continue;y=!1;break}if(m){if(!o(t,function(e,t){if(!i(m,t)&&(v===e||s(v,e,n,u,c)))return m.push(t)})){y=!1;break}}else if(v!==b&&!s(v,b,n,u,c)){y=!1;break}}return c.delete(e),c.delete(t),y}},function(e,t,n){var r=n(51);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t,n){var r=n(166);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderRatingToColor=d,t.default=p;var r=n(5),o=c(n(0)),i=c(n(1)),a=c(n(138)),l=c(n(98)),u=n(374),s=c(n(375));function c(e){return e&&e.__esModule?e:{default:e}}var f=i.default.ul.withConfig({displayName:"AnalysisList__AnalysisListBase",componentId:"sc-1ozeatw-0"})(["margin:8px 0;padding:0;list-style:none;"]);function d(e){switch(e){case"good":return u.colors.$color_good;case"OK":return u.colors.$color_ok;case"bad":return u.colors.$color_bad;default:return u.colors.$color_score_icon}}function p(e){var t=e.results,n=e.marksButtonActivatedResult,i=e.marksButtonStatus,a=e.marksButtonClassName,l=e.onMarksButtonClick;return o.default.createElement(f,{role:"list"},t.map(function(e){var t=d(e.rating),u=e.markerId===n,c="";return c="disabled"===i?(0,r.__)("Marks are disabled in current view","yoast-components"):u?(0,r.__)("Remove highlight from the text","yoast-components"):(0,r.__)("Highlight this result in the text","yoast-components"),o.default.createElement(s.default,{key:e.id,text:e.text,bulletColor:t,hasMarksButton:e.hasMarks,ariaLabel:c,pressed:u,buttonId:e.id,onButtonClick:function(){return l(e.id,e.marker)},marksButtonClassName:a,marksButtonStatus:i})}))}p.propTypes={results:a.default.array.isRequired,marksButtonActivatedResult:a.default.string,marksButtonStatus:a.default.string,marksButtonClassName:a.default.string,onMarksButtonClick:a.default.func},p.defaultProps={marksButtonActivatedResult:"",marksButtonStatus:"enabled",marksButtonClassName:"",onMarksButtonClick:l.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rgba=t.breakpoints=t.colors=void 0;var r=a(n(978)),o=a(n(979)),i=n(980);function a(e){return e&&e.__esModule?e:{default:e}}t.colors=r.default,t.breakpoints=o.default,t.rgba=i.rgba},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalysisResult=void 0;var r=l(n(0)),o=l(n(138)),i=l(n(1)),a=n(44);function l(e){return e&&e.__esModule?e:{default:e}}var u=i.default.li.withConfig({displayName:"AnalysisResult__AnalysisResultBase",componentId:"pf0ln6-0"})(["min-height:24px;padding:0;display:flex;align-items:flex-start;"]),s=(0,i.default)(a.SvgIcon).withConfig({displayName:"AnalysisResult__ScoreIcon",componentId:"pf0ln6-1"})(["margin:3px 11px 0 0;"]),c=i.default.p.withConfig({displayName:"AnalysisResult__AnalysisResultText",componentId:"pf0ln6-2"})(["margin:0 16px 0 0;flex:1 1 auto;"]),f=t.AnalysisResult=function(e){return r.default.createElement(u,e,r.default.createElement(s,{icon:"circle",color:e.bulletColor,size:"13px"}),r.default.createElement(c,{dangerouslySetInnerHTML:{__html:e.text}}),e.hasMarksButton&&!function(e){return"hidden"===e.marksButtonStatus}(e)&&r.default.createElement(a.IconButtonToggle,{marksButtonStatus:e.marksButtonStatus,className:e.marksButtonClassName,onClick:e.onButtonClick,id:e.buttonId,icon:"eye",pressed:e.pressed,ariaLabel:e.ariaLabel}))};f.propTypes={text:o.default.string.isRequired,bulletColor:o.default.string.isRequired,hasMarksButton:o.default.bool.isRequired,buttonId:o.default.string.isRequired,pressed:o.default.bool.isRequired,ariaLabel:o.default.string.isRequired,onButtonClick:o.default.func.isRequired,marksButtonStatus:o.default.string,marksButtonClassName:o.default.string},f.defaultProps={marksButtonStatus:"enabled",marksButtonClassName:""},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderRatingToColor=d,t.default=p;var r=n(5),o=c(n(0)),i=c(n(1)),a=c(n(2)),l=c(n(98)),u=n(7),s=c(n(377));function c(e){return e&&e.__esModule?e:{default:e}}var f=i.default.ul.withConfig({displayName:"AnalysisList__AnalysisListBase",componentId:"sc-1ozeatw-0"})(["margin:8px 0;padding:0;list-style:none;"]);function d(e){switch(e){case"good":return u.colors.$color_good;case"OK":return u.colors.$color_ok;case"bad":return u.colors.$color_bad;default:return u.colors.$color_score_icon}}function p(e){var t=e.results,n=e.marksButtonActivatedResult,i=e.marksButtonStatus,a=e.marksButtonClassName,l=e.onMarksButtonClick;return o.default.createElement(f,{role:"list"},t.map(function(e){var t=d(e.rating),u=e.markerId===n,c="";return c="disabled"===i?(0,r.__)("Marks are disabled in current view","yoast-components"):u?(0,r.__)("Remove highlight from the text","yoast-components"):(0,r.__)("Highlight this result in the text","yoast-components"),o.default.createElement(s.default,{key:e.id,text:e.text,bulletColor:t,hasMarksButton:e.hasMarks,ariaLabel:c,pressed:u,buttonId:e.id,onButtonClick:function(){return l(e.id,e.marker)},marksButtonClassName:a,marksButtonStatus:i})}))}p.propTypes={results:a.default.array.isRequired,marksButtonActivatedResult:a.default.string,marksButtonStatus:a.default.string,marksButtonClassName:a.default.string,onMarksButtonClick:a.default.func},p.defaultProps={marksButtonActivatedResult:"",marksButtonStatus:"enabled",marksButtonClassName:"",onMarksButtonClick:l.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalysisResult=void 0;var r=l(n(0)),o=l(n(2)),i=l(n(1)),a=n(17);function l(e){return e&&e.__esModule?e:{default:e}}var u=i.default.li.withConfig({displayName:"AnalysisResult__AnalysisResultBase",componentId:"pf0ln6-0"})(["min-height:24px;padding:0;display:flex;align-items:flex-start;"]),s=(0,i.default)(a.SvgIcon).withConfig({displayName:"AnalysisResult__ScoreIcon",componentId:"pf0ln6-1"})(["margin:3px 11px 0 0;"]),c=i.default.p.withConfig({displayName:"AnalysisResult__AnalysisResultText",componentId:"pf0ln6-2"})(["margin:0 16px 0 0;flex:1 1 auto;"]),f=t.AnalysisResult=function(e){return r.default.createElement(u,null,r.default.createElement(s,{icon:"circle",color:e.bulletColor,size:"13px"}),r.default.createElement(c,{dangerouslySetInnerHTML:{__html:e.text}}),e.hasMarksButton&&!function(e){return"hidden"===e.marksButtonStatus}(e)&&r.default.createElement(a.IconButtonToggle,{marksButtonStatus:e.marksButtonStatus,className:e.marksButtonClassName,onClick:e.onButtonClick,id:e.buttonId,icon:"eye",pressed:e.pressed,ariaLabel:e.ariaLabel}))};f.propTypes={text:o.default.string.isRequired,bulletColor:o.default.string.isRequired,hasMarksButton:o.default.bool.isRequired,buttonId:o.default.string.isRequired,pressed:o.default.bool.isRequired,ariaLabel:o.default.string.isRequired,onButtonClick:o.default.func.isRequired,marksButtonStatus:o.default.string,marksButtonClassName:o.default.string},f.defaultProps={marksButtonStatus:"enabled",marksButtonClassName:""},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFeedItem=i,t.default=function(e,t){return(0,o.default)(e,t,i)};var r=n(220),o=function(e){return e&&e.__esModule?e:{default:e}}(r);function i(e,t,n){var o={};return o.title=(0,r.getXPathText)("child::title",e,t),o.link=(0,r.getXPathText)("child::link",e,t),o.content=(0,r.getXPathText)("child::content:encoded",e,t,n),o.description=(0,r.getXPathText)("child::description",e,t),o.creator=(0,r.getXPathText)("child::dc:creator",e,t,n),o.date=(0,r.getXPathText)("child::pubDate",e,t),o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SectionTitle=t.StyledSubTitle=t.StyledTitle=t.StyledTitleContainer=void 0;var r=u(n(0)),o=u(n(2)),i=u(n(1)),a=n(7),l=u(n(380));function u(e){return e&&e.__esModule?e:{default:e}}var s=t.StyledTitleContainer=i.default.span.withConfig({displayName:"SectionTitle__StyledTitleContainer",componentId:"nlobus-0"})(["flex-grow:1;overflow-x:hidden;line-height:normal;"]),c=t.StyledTitle=i.default.span.withConfig({displayName:"SectionTitle__StyledTitle",componentId:"nlobus-1"})(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;color:",";"],a.colors.$color_headings),f=t.StyledSubTitle=i.default.span.withConfig({displayName:"SectionTitle__StyledSubTitle",componentId:"nlobus-2"})(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;font-size:0.8125rem;margin-top:2px;"]);(t.SectionTitle=function(e){return r.default.createElement(s,null,r.default.createElement(c,null,e.title,e.titleScreenReaderText&&r.default.createElement(l.default,null," "+e.titleScreenReaderText)),e.subTitle&&r.default.createElement(f,null,e.subTitle))}).propTypes={title:o.default.string.isRequired,titleScreenReaderText:o.default.string,subTitle:o.default.string}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),o=a(n(2)),i=a(n(381));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return r.default.createElement("span",{className:"screen-reader-text",style:i.default.ScreenReaderText.default},e.children)};l.propTypes={children:o.default.string.isRequired},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={ScreenReaderText:{default:{clip:"rect(1px, 1px, 1px, 1px)",position:"absolute",height:"1px",width:"1px",overflow:"hidden"},focused:{clip:"auto",display:"block",left:"5px",top:"5px",height:"auto",width:"auto",zIndex:"100000",position:"absolute",backgroundColor:"#eeeeee ",padding:"10px"}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=u(n(0)),i=u(n(2)),a=u(n(92)),l=n(17);function u(e){return e&&e.__esModule?e:{default:e}}var s=function(e){var t=e.children,n=e.className,i=e.prefixIcon,u=e.suffixIcon,s=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["children","className","prefixIcon","suffixIcon"]);return o.default.createElement(a.default,r({className:n},s),i&&i.icon&&o.default.createElement(l.SvgIcon,{icon:i.icon,color:i.color,size:i.size}),t,u&&u.icon&&o.default.createElement(l.SvgIcon,{icon:u.icon,color:u.color,size:u.size}))};s.propTypes={className:i.default.string,prefixIcon:i.default.shape({icon:i.default.string,color:i.default.string,size:i.default.string}),suffixIcon:i.default.shape({icon:i.default.string,color:i.default.string,size:i.default.string}),children:i.default.oneOfType([i.default.arrayOf(i.default.node),i.default.node,i.default.string])},t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var r=n(0),o=u(r),i=u(n(2)),a=u(n(1)),l=n(7);function u(e){return e&&e.__esModule?e:{default:e}}var s=a.default.span.withConfig({displayName:"CardBanner__BannerContents",componentId:"oi8gid-0"})(["position:absolute;top:8px;left:-8px;font-weight:500;color:",";line-height:16px;background-color:",";padding:8px 16px;box-shadow:0 2px 4px 0 rgba(0,0,0,0.2);"],function(e){return e.textColor},function(e){return e.backgroundColor}),c=a.default.span.withConfig({displayName:"CardBanner__BannerTriangle",componentId:"oi8gid-1"})(["position:absolute;top:40px;left:-8px;border-top:8px solid ",";border-left:8px solid transparent;"],l.colors.$color_purple_dark);function f(e){return o.default.createElement(r.Fragment,null,o.default.createElement(s,{backgroundColor:e.backgroundColor,textColor:e.textColor},e.children),o.default.createElement(c,null))}f.propTypes={backgroundColor:i.default.string,textColor:i.default.string,children:i.default.any},f.defaultProps={backgroundColor:l.colors.$color_pink_dark,textColor:l.colors.$color_white,children:null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=l;var o=a(n(0)),i=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}function l(e){return o.default.createElement("iframe",r({title:e.title},e))}l.propTypes={title:i.default.string.isRequired}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=l(n(0)),a=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default.Component),o(t,[{key:"componentDidUpdate",value:function(){this.props.hasFocus&&this.ref.focus()}},{key:"setReference",value:function(e){this.ref=e}},{key:"render",value:function(){return i.default.createElement("input",r({ref:this.setReference.bind(this),type:this.props.type,name:this.props.name,defaultValue:this.props.value,onChange:this.props.onChange,autoComplete:this.props.autoComplete},this.props.optionalAttributes))}}]),t}();u.propTypes={name:a.default.string.isRequired,type:a.default.oneOf(["button","checkbox","number","password","progress","radio","submit","text"]).isRequired,value:a.default.any,onChange:a.default.func,optionalAttributes:a.default.object,hasFocus:a.default.bool,autoComplete:a.default.string},u.defaultProps={name:"input",type:"text",value:"",hasFocus:!1},t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(2));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var t=e.title,n=e.classNamePrefix,o=e.words,i=e.header,a=e.footer,l=r.default.createElement("ol",{className:n+"__list"},o.map(function(e){return r.default.createElement("li",{key:e,className:n+"__item"},e)}));return r.default.createElement("div",{className:n},r.default.createElement("p",null,r.default.createElement("strong",null,t)),i,l,a)};a.propTypes={words:o.default.array.isRequired,title:o.default.string.isRequired,header:o.default.string,footer:o.default.string,classNamePrefix:o.default.string},a.defaultProps={classNamePrefix:"",header:"",footer:""},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(0)),i=u(n(2)),a=u(n(1)),l=n(5);function u(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var c=a.default.span.withConfig({displayName:"WordOccurrences__ProminentWordOccurrence",componentId:"v5jj49-0"})(["display:inline-block;margin:2px 8px;"]),f=(0,a.default)(c).withConfig({displayName:"WordOccurrences__ProminentWord",componentId:"v5jj49-1"})(["font-weight:bold;overflow:hidden;text-overflow:ellipsis;"]),d=a.default.ol.withConfig({displayName:"WordOccurrences__WordOccurrencesList",componentId:"v5jj49-2"})(["list-style:none;padding:0;width:100%;margin:0;"]),p=a.default.li.withConfig({displayName:"WordOccurrences__WordBarContainer",componentId:"v5jj49-3"})(["margin:8px 0;height:calc( 1.375em + 4px );display:flex;max-width:600px;justify-content:space-between;background:linear-gradient( to right,rgba(164,40,106,0.2) ",",",",transparent );"],function(e){return e.barWidth},function(e){return e.barWidth}),h=function(e){var t=e.word,n=e.occurrence,r=e.width;return o.default.createElement(p,{barWidth:r},o.default.createElement(f,null,t),o.default.createElement(c,null,o.default.createElement("span",{"aria-hidden":!0},n),o.default.createElement("span",{className:"screen-reader-text"},(0,l.sprintf)((0,l.__)("%d occurrences","yoast-components"),n))))};h.propTypes={word:i.default.string.isRequired,occurrence:i.default.number.isRequired,width:i.default.string.isRequired};var g=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={words:[].concat(s(e.words))||[],occurrences:{min:0,max:0}},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default.Component),r(t,[{key:"render",value:function(){var e=this;return o.default.createElement(o.default.Fragment,null,this.props.header,o.default.createElement(d,{"aria-label":(0,l.__)("Prominent words","yoast-components")},this.state.words.map(function(t){var n=t.getWord(),r=t.getOccurrences(),i=r/e.state.occurrences.max*100+"%";return o.default.createElement(h,{key:"wordbar-"+n,word:n,width:i,occurrence:r})})),this.props.footer)}}],[{key:"getDerivedStateFromProps",value:function(e){var t=[].concat(s(e.words));t.sort(function(e,t){return t.getOccurrences()-e.getOccurrences()});var n=t.map(function(e){return e.getOccurrences()});return{occurrences:{min:Math.min.apply(Math,s(n)),max:Math.max.apply(Math,s(n))},words:t}}}]),t}();g.propTypes={words:i.default.array.isRequired,header:i.default.element,footer:i.default.element},g.defaultProps={header:null,footer:null},t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=a(n(0)),i=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return o.default.createElement("label",r({htmlFor:e.for},e.optionalAttributes),e.children)};l.propTypes={for:i.default.string.isRequired,optionalAttributes:i.default.shape({"aria-label":i.default.string,onClick:i.default.func,className:i.default.string}),children:i.default.any.isRequired},l.defaultProps={htmlFor:""},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(2)),o=a(n(1)),i=n(7);function a(e){return e&&e.__esModule?e:{default:e}}var l=o.default.div.withConfig({displayName:"Paper",componentId:"sc-1fchzjl-0"})(["box-shadow:0 1px 2px rgba(0,0,0,0.2);background-color:",";min-height:",";"],function(e){return e.backgroundColor},function(e){return e.minHeight});l.propTypes={backgroundColor:r.default.string,minHeight:r.default.string},l.defaultProps={backgroundColor:i.colors.$color_white,minHeight:"0"},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),o=a(n(2)),i=a(n(221));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return r.default.createElement("section",{className:e.className},e.headingText&&r.default.createElement(i.default,{level:e.headingLevel,className:e.headingClassName},e.headingText),e.children)};l.propTypes={className:o.default.string,headingText:o.default.string,headingLevel:o.default.number,headingClassName:o.default.string,children:o.default.any},l.defaultProps={headingLevel:1},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InputField=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),o=n(7);t.InputField=r.default.input.withConfig({displayName:"InputField",componentId:"sc-12z9z15-0"})(["&&&{padding:0 8px;min-height:34px;font-size:1em;box-shadow:inset 0 1px 2px ",";border:1px solid ",";border-radius:0;&:focus{border-color:#5b9dd9;box-shadow:0 0 2px ",";}}"],(0,o.rgba)(o.colors.$color_black,.07),o.colors.$color_input_border,(0,o.rgba)(o.colors.$color_snippet_focus,.8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=l(n(0)),a=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default.Component),o(t,[{key:"render",value:function(){return i.default.createElement("textarea",r({ref:this.setReference.bind(this),name:this.props.name,value:this.props.value,onChange:this.props.onChange},this.props.optionalAttributes))}},{key:"setReference",value:function(e){this.ref=e}},{key:"componentDidUpdate",value:function(){this.props.hasFocus&&this.ref.focus()}}]),t}();u.propTypes={name:a.default.string.isRequired,value:a.default.string,onChange:a.default.func,optionalAttributes:a.default.object,hasFocus:a.default.bool},u.defaultProps={name:"textarea",value:"",hasFocus:!1},t.default=u},function(e,t,n){var r=n(372),o=n(366),i=n(203),a=Math.max;e.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var u=null==n?0:i(n);return u<0&&(u=a(l+u,0)),r(e,o(t,3),u)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setProminentWords=function(e){return{type:r,prominentWords:e}};var r=t.SET_PROMINENT_WORDS="INSIGHTS_SET_PROMINENT_WORDS"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(309));function i(e){return e&&e.__esModule?e:{default:e}}var a={refresh:{display:"inline-block",position:"relative"}};t.default=function(){return r.default.createElement("div",{className:"yoast-wizard-overlay-loader"},r.default.createElement(o.default,{size:40,left:10,top:100,status:"loading",style:a.refresh}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(0)),i=u(n(2)),a=u(n(1)),l=n(17);function u(e){return e&&e.__esModule?e:{default:e}}var s=(0,a.default)(l.IFrame).withConfig({displayName:"ArticleContent__ArticleContentFullWidth",componentId:"h5gxjn-0"})(["width:100%;height:600px;border:none;"]),c=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default.Component),r(t,[{key:"toAmp",value:function(e){return e+"amp/?source=wpseo-kb-search"}},{key:"render",value:function(){return o.default.createElement(s,{src:this.toAmp(this.props.post.permalink),className:"kb-search-content-frame",title:this.props.title})}}]),t}();c.propTypes={post:i.default.object.isRequired,title:i.default.string},c.defaultProps={title:"Knowledge base article"},t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(2));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return r.default.createElement("div",{className:"wpseo-kb-loader"},e.placeholder)};a.propTypes={placeholder:o.default.string.isRequired},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=f(n(0)),i=f(n(2)),a=f(n(1)),l=f(n(198)),u=n(5),s=n(17),c=n(7);function f(e){return e&&e.__esModule?e:{default:e}}var d=a.default.div.withConfig({displayName:"SearchBar__SearchBarWrapper",componentId:"sc-15uwp94-0"})(["form{display:flex;flex-wrap:wrap;}@media screen and ( max-width:"," ){button{min-width:100%;margin-top:1em;}}"],c.breakpoints.mobile),p=a.default.label.withConfig({displayName:"SearchBar__SearchLabel",componentId:"sc-15uwp94-1"})(["flex:0 1 100%;font-size:1em;margin:0.5em 16px;font-weight:600;"]),h=a.default.input.withConfig({displayName:"SearchBar__SearchBarInput",componentId:"sc-15uwp94-2"})(["&&{flex:1 1 auto;box-sizing:border-box;height:48px;box-shadow:inset 0 2px 8px 0px rgba( 0,0,0,0.3 );background:",";border:1px solid transparent;font-size:1em;margin-right:24px;padding:0 8px 0 15px;:focus{box-shadow:inset 0 2px 8px 0px rgba( 0,0,0,0.3 ),0 0 2px rgba( 30,140,190,0.8 );}@media screen and ( max-width:"," ){margin-right:0;}}"],c.colors.$color_grey_light,c.breakpoints.mobile),g=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={doRequest:!1,searchString:""},n.doFormSubmission=(0,l.default)(function(e){n.props.submitAction(e)},1e3),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default.Component),r(t,[{key:"componentWillUnmount",value:function(){this.doFormSubmission.cancel()}},{key:"onSearchChange",value:function(e){var t=this;this.props.enableLiveSearch?(e.persist(),this.setState({searchString:e.target.value},function(){t.doFormSubmission(t.state.searchString)})):this.setState({searchString:e.target.value})}},{key:"onSubmit",value:function(e){e.preventDefault(),this.doFormSubmission.cancel(),this.props.submitAction(this.state.searchString)}},{key:"render",value:function(){var e=(0,u.__)("Search the Yoast Knowledge Base for answers to your questions:","yoast-components"),t=(0,u.__)("Type here to search...","yoast-components");return o.default.createElement(d,{role:"search"},o.default.createElement("form",{onSubmit:this.onSubmit.bind(this)},o.default.createElement(p,{htmlFor:"kb-search-input"},e),o.default.createElement(h,{onChange:this.onSearchChange.bind(this),type:"text",id:"kb-search-input",name:"search-input",defaultValue:this.props.searchString,autoComplete:"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:"false",placeholder:t}),!this.props.enableLiveSearch&&o.default.createElement(s.YoastButton,{type:"submit"},(0,u.__)("Search","yoast-components"))))}}]),t}();g.propTypes={searchString:i.default.string,submitAction:i.default.func,enableLiveSearch:i.default.bool},g.defaultProps={},t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=d(n(0)),i=d(n(2)),a=d(n(1)),l=n(5),u=n(17),s=n(18),c=n(7),f=d(n(396));function d(e){return e&&e.__esModule?e:{default:e}}var p=a.default.section.withConfig({displayName:"SearchResultDetail__Detail",componentId:"sc-1la41zi-0"})(["outline:none;@media screen and ( max-width:"," ){margin:0 -16px;}"],c.breakpoints.mobile),h=a.default.nav.withConfig({displayName:"SearchResultDetail__Nav",componentId:"sc-1la41zi-1"})(["padding:0 16px 16px;"]),g=(0,s.makeOutboundLink)((0,a.default)(u.YoastLinkButton).withConfig({displayName:"SearchResultDetail__RightYoastLinkButton",componentId:"sc-1la41zi-2"})(["float:right;"])),y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default.Component),r(t,[{key:"createNavigation",value:function(){var e=(0,l.__)("View in KB","yoast-components"),t=(0,l.__)("Open the knowledge base article in a new window or read it in the iframe below","yoast-components"),n=(0,l.__)("Go back","yoast-components"),r=(0,l.__)("Go back to the search results","yoast-components");return o.default.createElement(h,null,o.default.createElement(u.YoastButton,{"aria-label":r,onClick:this.props.onBackButtonClicked},o.default.createElement(u.SvgIcon,{size:"24px",color:c.colors.$color_white,icon:"angle-left"}),n),o.default.createElement(g,{href:this.props.post.permalink,"aria-label":t},e,o.default.createElement(u.SvgIcon,{size:"24px",color:c.colors.$color_white,icon:"angle-right"})))}},{key:"render",value:function(){var e=this;return o.default.createElement(p,{"aria-label":(0,l.__)("Search result","yoast-components"),tabIndex:"-1",ref:function(t){e.detailWrapper=t}},this.createNavigation(),o.default.createElement(f.default,{post:this.props.post,title:(0,l.__)("Knowledge base article","yoast-components")}))}},{key:"componentDidMount",value:function(){null!==this.detailWrapper&&this.detailWrapper.focus()}}]),t}();y.propTypes={post:i.default.object.isRequired,onBackButtonClicked:i.default.func.isRequired},t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.SearchResult=h;var o=f(n(0)),i=f(n(2)),a=n(70),l=f(n(1)),u=n(5),s=n(17),c=n(7);function f(e){return e&&e.__esModule?e:{default:e}}var d=l.default.p.withConfig({displayName:"SearchResults__SearchResultTitle",componentId:"sc-1wvtim7-0"})(["margin:0;font-size:1em;font-weight:normal;"]),p=l.default.a.withConfig({displayName:"SearchResults__SearchResultLink",componentId:"sc-1wvtim7-1"})(["color:",";padding:8px 16px;&:hover,&:focus{color:",";}"],c.colors.$color_black,c.colors.$color_pink_dark);function h(e){var t=e.post;return o.default.createElement(s.Row,e,o.default.createElement(p,{href:t.permalink,onClick:e.onClick},o.default.createElement(d,null,t.post_title)))}h.propTypes={onClick:i.default.func.isRequired,post:i.default.object.isRequired};var g=l.default.div.withConfig({displayName:"SearchResults__SearchResultsWrapper",componentId:"sc-1wvtim7-2"})(["margin-top:20px;clear:both;"]),y=l.default.p.withConfig({displayName:"SearchResults__NoResults",componentId:"sc-1wvtim7-3"})(["margin-left:10px;"]),m=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={results:e.results},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default.Component),r(t,[{key:"handleZeroResults",value:function(){return""!==this.props.searchString?this.renderNoResultsFound():null}},{key:"renderNoResultsFound",value:function(){var e=(0,u.__)("No results found.","yoast-components");return(0,a.speak)(e),o.default.createElement(y,null,e)}},{key:"resultsToSearchItem",value:function(e){var t=this;return e.map(function(e,n){return o.default.createElement(h,{rowHeight:"32px",key:e.objectID,post:e,onClick:function(e){e.preventDefault(),e.stopPropagation(),t.props.onClick(n)}})})}},{key:"render",value:function(){var e=this.props.results.length;if(e<=0)return this.handleZeroResults();var t=(0,u.sprintf)((0,u.__)("Number of results found: %d","yoast-components"),e);return(0,a.speak)(t),o.default.createElement(g,null,o.default.createElement("h2",{className:"screen-reader-text"},(0,u.__)("Search results","yoast-components")),o.default.createElement(s.ZebrafiedListTable,null,this.resultsToSearchItem(this.props.results)))}}]),t}();m.propTypes={onClick:i.default.func.isRequired,searchString:i.default.string,results:i.default.array},m.defaultProps={searchString:"",results:[]},t.default=m},function(e,t,n){"use strict";var r=n(1071),o=n(1082);e.exports=o(r)},function(e,t,n){var r=n(403),o=n(223),i=n(224);function a(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}}e.exports=a,a.prototype.clearCache=function(){this.cache={}},a.prototype.search=r("query"),a.prototype.similarSearch=o(r("similarQuery"),i("index.similarSearch(query[, callback])","index.search({ similarQuery: query }[, callback])")),a.prototype.browse=function(e,t,r){var o,i,a=n(404);0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(o=0,r=arguments[0],e=void 0):"number"==typeof arguments[0]?(o=arguments[0],"number"==typeof arguments[1]?i=arguments[1]:"function"==typeof arguments[1]&&(r=arguments[1],i=void 0),e=void 0,t=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(r=arguments[1]),t=arguments[0],e=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(r=arguments[1],t=void 0),t=a({},t||{},{page:o,hitsPerPage:i,query:e});var l=this.as._getSearchParams(t,"");return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse",body:{params:l},hostType:"read",callback:r})},a.prototype.browseFrom=function(e,t){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse",body:{cursor:e},hostType:"read",callback:t})},a.prototype.searchForFacetValues=function(e,t){var r=n(64),o=n(405);if(void 0===e.facetName||void 0===e.facetQuery)throw new Error("Usage: index.searchForFacetValues({facetName, facetQuery, ...params}[, callback])");var i=e.facetName,a=o(r(e),function(e){return"facetName"===e}),l=this.as._getSearchParams(a,"");return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/facets/"+encodeURIComponent(i)+"/query",hostType:"read",body:{params:l},callback:t})},a.prototype.searchFacet=o(function(e,t){return this.searchForFacetValues(e,t)},i("index.searchFacet(params[, callback])","index.searchForFacetValues(params[, callback])")),a.prototype._search=function(e,t,n,r){return this.as._jsonRequest({cache:this.cache,method:"POST",url:t||"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:n,additionalUA:r})},a.prototype.getObject=function(e,t,n){1!==arguments.length&&"function"!=typeof t||(n=t,t=void 0);var r="";if(void 0!==t){r="?attributes=";for(var o=0;o<t.length;++o)0!==o&&(r+=","),r+=t[o]}return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(e)+r,hostType:"read",callback:n})},a.prototype.getObjects=function(e,t,r){var o=n(40),i=n(95);if(!o(e))throw new Error("Usage: index.getObjects(arrayOfObjectIDs[, callback])");var a=this;1!==arguments.length&&"function"!=typeof t||(r=t,t=void 0);var l={requests:i(e,function(e){var n={indexName:a.indexName,objectID:e};return t&&(n.attributesToRetrieve=t.join(",")),n})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/*/objects",hostType:"read",body:l,callback:r})},a.prototype.as=null,a.prototype.indexName=null,a.prototype.typeAheadArgs=null,a.prototype.typeAheadValueOption=null},function(e,t,n){e.exports=function(e,t){return function(n,o,i){if("function"==typeof n&&"object"==typeof o||"object"==typeof i)throw new r.AlgoliaSearchError("index.search usage is index.search(query, params, cb)");0===arguments.length||"function"==typeof n?(i=n,n=""):1!==arguments.length&&"function"!=typeof o||(i=o,o=void 0),"object"==typeof n&&null!==n?(o=n,n=void 0):void 0!==n&&null!==n||(n="");var a,l="";return void 0!==n&&(l+=e+"="+encodeURIComponent(n)),void 0!==o&&(o.additionalUA&&(a=o.additionalUA,delete o.additionalUA),l=this.as._getSearchParams(o,l)),this._search(l,t,i,a)}};var r=n(93)},function(e,t,n){var r=n(94);e.exports=function e(t){var n=Array.prototype.slice.call(arguments);return r(n,function(n){for(var r in n)n.hasOwnProperty(r)&&("object"==typeof t[r]&&"object"==typeof n[r]?t[r]=e({},t[r],n[r]):void 0!==n[r]&&(t[r]=n[r]))}),t}},function(e,t,n){e.exports=function(e,t){var r=n(1073),o={};return n(94)(r(e),function(n){!0!==t(n)&&(o[n]=e[n])}),o}},function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t=r.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}},function(e,t){e.exports=function(e,t){t(e,0)}},function(e,t,n){"use strict";n.r(t);var r=n(28),o=n(227),i=n.n(o),a={INIT:"@@redux/INIT"};function l(e,t,n){var o;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(l)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var u=e,s=t,c=[],f=c,d=!1;function p(){f===c&&(f=c.slice())}function h(){return s}function g(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return p(),f.push(e),function(){if(t){t=!1,p();var n=f.indexOf(e);f.splice(n,1)}}}function y(e){if(!Object(r.a)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,s=u(s,e)}finally{d=!1}for(var t=c=f,n=0;n<t.length;n++){(0,t[n])()}return e}return y({type:a.INIT}),(o={dispatch:y,subscribe:g,getState:h,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");u=e,y({type:a.INIT})}})[i.a]=function(){var e,t=g;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(h())}return n(),{unsubscribe:t(n)}}})[i.a]=function(){return this},e},o}function u(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function s(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var i=Object.keys(n);var l=void 0;try{!function(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:a.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+a.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(n)}catch(e){l=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(l)throw l;for(var r=!1,o={},a=0;a<i.length;a++){var s=i[a],c=n[s],f=e[s],d=c(f,t);if(void 0===d){var p=u(s,t);throw new Error(p)}o[s]=d,r=r||d!==f}return r?o:e}}function c(e,t){return function(){return t(e.apply(void 0,arguments))}}function f(e,t){if("function"==typeof e)return c(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),r={},o=0;o<n.length;o++){var i=n[o],a=e[i];"function"==typeof a&&(r[i]=c(a,t))}return r}function d(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function h(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var i,a=e(n,r,o),l=a.dispatch,u={getState:a.getState,dispatch:function(e){return l(e)}};return i=t.map(function(e){return e(u)}),l=d.apply(void 0,i)(a.dispatch),p({},a,{dispatch:l})}}}n.d(t,"createStore",function(){return l}),n.d(t,"combineReducers",function(){return s}),n.d(t,"bindActionCreators",function(){return f}),n.d(t,"applyMiddleware",function(){return h}),n.d(t,"compose",function(){return d})},function(e,t,n){"use strict";window.yoast=window.yoast||{},window.yoast.styleGuide=n(410),window.yoast.helpers=n(414),window.yoast.componentsNew=n(44),window.yoast.configurationWizard=n(587),window.yoast.searchMetadataPreviews=n(310),window.yoast.analysisReport=n(975),window.yoast.components=n(983)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rgba=t.breakpoints=t.colors=void 0;var r=a(n(411)),o=a(n(412)),i=n(413);function a(e){return e&&e.__esModule?e:{default:e}}t.colors=r.default,t.breakpoints=o.default,t.rgba=i.rgba},function(e){e.exports={$palette_white:"#fff",$palette_grey_ultra_light:"#f7f7f7",$palette_grey_light:"#f1f1f1",$palette_grey_medium_light:"#e2e4e7",$palette_grey:"#ddd",$palette_grey_medium:"#ccc",$palette_grey_disabled:"#a0a5aa",$palette_grey_medium_dark:"#888",$palette_grey_text_light:"#767676",$palette_grey_text:"#616161",$palette_grey_dark:"#555",$palette_black:"#000",$palette_purple:"#5d237a",$palette_purple_dark:"#6c2548",$palette_pink:"#d73763",$palette_pink_light:"#e1bee7",$palette_pink_dark:"#a4286a",$palette_blue:"#0066cd",$palette_blue_light:"#a9a9ce",$palette_blue_medium:"#1e8cbe",$palette_blue_link:"#0073aa",$palette_blue_focus:"#5b9dd9",$palette_yoast_focus:"#007fff",$palette_blue_dark:"#084a67",$palette_green:"#77b227",$palette_green_light:"#7ad03a",$palette_green_medium_light:"#64a60a",$palette_green_medium:"#008a00",$palette_green_blue:"#009288",$palette_orange:"#dc5c04",$palette_orange_light:"#ee7c1b",$palette_red:"#dc3232",$palette_red_light:"#f9bdbd",$palette_yellow:"#ffeb3b",$palette_yellow_score:"#f5c819",$palette_button_upsell:"#fec228",$palette_button_upsell_hover:"#f2ae01",$palette_link_text:"#004973",$palette_error_background:"#f9dcdc",$palette_error_text:"#8f1919",$palette_error_emphasis:"#dc3232",$palette_info_background:"#cce5ff",$palette_info_text:"#00468f",$palette_info_emphasis:"#007dff",$palette_success_background:"#e2f2cc",$palette_success_text:"#395315",$palette_success_emphasis:"#6ea029",$palette_warning_background:"#fff3cd",$palette_warning_text:"#674e00",$palette_warning_emphasis:"#ffc201",$color_bad:"#dc3232",$color_ok:"#ee7c1b",$color_good:"#7ad03a",$color_noindex:"#1e8cbe",$color_score_icon:"#888",$color_white:"#fff",$color_black:"#000",$color_green:"#77b227",$color_green_medium:"#008a00",$color_green_blue:"#009288",$color_grey:"#ddd",$color_grey_dark:"#555",$color_purple:"#5d237a",$color_purple_dark:"#6c2548",$color_pink:"#d73763",$color_pink_light:"#e1bee7",$color_pink_dark:"#a4286a",$color_blue:"#0066cd",$color_blue_light:"#a9a9ce",$color_blue_dark:"#084a67",$color_red:"#dc3232",$color_border_light:"#f7f7f7",$color_border_gutenberg:"#e2e4e7",$color_border:"#ccc",$color_input_border:"#ddd",$color_help_text:"#767676",$color_upsell_text:"#767676",$color_background_light:"#f7f7f7",$color_button:"#f7f7f7",$color_button_text:"#555",$color_button_border:"#ccc",$color_button_hover:"#fff",$color_button_border_hover:"#888",$color_button_text_hover:"#000",$color_button_border_active:"#000",$color_button_upsell:"#fec228",$color_button_upsell_hover:"#f2ae01",$color_headings:"#555",$color_marker_inactive:"#555",$color_marker_active:"#fff",$color_marker_disabled:"#a0a5aa",$color_error:"#dc3232",$color_orange:"#dc5c04",$color_orange_hover:"#c35204",$color_grey_hover:"#cecece",$color_pink_hover:"#cc2956",$color_grey_cta:"#ddd",$color_grey_line:"#ddd",$color_grey_quote:"#616161",$color_grey_text:"#616161",$color_grey_text_light:"#767676",$color_snippet_focus:"#1e8cbe",$color_snippet_hover:"#ccc",$color_snippet_active:"#555",$color_blue_link:"#0073aa",$color_blue_focus:"#5b9dd9",$color_blue_focus_shadow:"#1e8cbe",$color_yoast_focus:"#007fff",$color_yoast_focus_outer:"rgba(0,127,255,0.25)",$color_grey_medium_dark:"#888",$color_green_medium_light:"#64a60a",$color_grey_disabled:"#a0a5aa",$color_grey_medium:"#ccc",$color_grey_light:"#f1f1f1",$color_yellow:"#ffeb3b",$color_yellow_score:"#f5c819",$color_error_message:"#f9bdbd",$color_alert_link_text:"#004973",$color_alert_error_text:"#8f1919",$color_alert_error_background:"#f9dcdc",$color_alert_info_text:"#00468f",$color_alert_info_background:"#cce5ff",$color_alert_success_text:"#395315",$color_alert_success_background:"#e2f2cc",$color_alert_warning_text:"#674e00",$color_alert_warning_background:"#fff3cd"}},function(e){e.exports={mobile:"768px",tablet:"1224px"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rgba=function(e,t){return"rgba( "+function(e){if("string"!=typeof e)throw new Error("Please pass a string representation of a color in hex notation.");if(e.match(/^#[a-fA-F0-9]{6}$/))return parseInt(""+e[1]+e[2],16)+", "+parseInt(""+e[3]+e[4],16)+", "+parseInt(""+e[5]+e[6],16);if(e.match(/^#[a-fA-F0-9]{3}$/))return parseInt(""+e[1]+e[1],16)+", "+parseInt(""+e[2]+e[2],16)+", "+parseInt(" "+e[3]+e[3],16);throw new Error("Couldn't parse the color string. Please provide the color as a string in hex notation.")}(e)+", "+t+" )"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeOutboundLink=t.getFeed=t.getCourseFeed=t.getPostFeed=t.decodeHTML=t.sendRequest=t.getDirectionalStyle=t.createSvgIconComponent=void 0;var r=n(415);Object.defineProperty(t,"makeOutboundLink",{enumerable:!0,get:function(){return r.makeOutboundLink}});var o=n(419),i=f(n(420)),a=f(n(421)),l=f(n(145)),u=f(n(422)),s=f(n(229)),c=f(n(423));function f(e){return e&&e.__esModule?e:{default:e}}t.createSvgIconComponent=c.default,t.getDirectionalStyle=o.getDirectionalStyle,t.sendRequest=i.default,t.decodeHTML=a.default,t.getPostFeed=s.default,t.getCourseFeed=u.default,t.getFeed=l.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeOutboundLink=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(0)),i=u(n(228)),a=n(5),l=n(418);function u(e){return e&&e.__esModule?e:{default:e}}t.makeOutboundLink=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"a",t=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.isYoastLink=t.isYoastLink.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.default.Component),r(n,[{key:"isYoastLink",value:function(e){return/yoast\.com|yoast\.test|yoa\.st/.test(e)}},{key:"render",value:function(){if(!this.props.href)return null;var t=this.isYoastLink(this.props.href),n=Object.assign({},this.props,{target:"_blank",rel:t?this.props.rel:"noopener"});return o.default.createElement(e,n,this.props.children,o.default.createElement(l.A11yNotice,null,(0,a.__)("(Opens in a new browser tab)","yoast-components")))}}]),n}();return t.propTypes={children:i.default.oneOfType([i.default.node]),href:i.default.string,rel:i.default.string},t.defaultProps={children:null,href:null,rel:null},t}},function(e,t,n){"use strict";var r=n(417);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.A11yNotice=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(1));t.A11yNotice=r.default.span.withConfig({displayName:"A11yNotice",componentId:"u1v0gg-0"})(["border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute !important;width:1px;word-wrap:normal !important;transform:translateY(1em);"])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDirectionalStyle=function(e,t){return function(n){return n.theme.isRtl?t:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(96);var r=function(e,t){var n=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(void 0!==e[n]&&""!==e[n]||(e[n]=t[n]));return e}(e,{dataType:"json",method:"POST",contentType:"application/json"});return void 0===n.headers&&""===n.headers||function(e,t){"jquery"===e&&Object.assign(t,{beforeSend:function(e){jQuery.each(t.headers,function(t,n){e.setRequestHeader(t,n)})}}),"fetch"===e&&"json"===t.dataType&&Object.assign(t.headers,{Accepts:"application/json","Content-Type":"application/json"})}(t,n),"json"===n.dataType&&(n.data=JSON.stringify(n.data)),"fetch"===t&&Object.assign(n,{body:n.data}),n};t.default=function(e,t){return"undefined"!=typeof jQuery&&jQuery&&jQuery.ajax?function(e,t){return Object.assign(t,{url:e}),new Promise(function(e,n){jQuery.ajax(t).done(function(t){e(t)}).fail(function(){n("Wrong request")})})}(e,r(t,"jquery")):function(e,t){var n=fetch(e,t);return new Promise(function(e,t){n.then(function(n){return 200===n.status?e(n.json()):t("Response status is not 200")}).catch(function(){return t("Wrong request")})})}(e,r(t,"fetch"))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,o.default)(e,t,i)};var r=n(145),o=function(e){return e&&e.__esModule?e:{default:e}}(r);function i(e,t,n){var o={};return o.id=(0,r.getXPathText)("child::content:slug",e,t,n),o.title=(0,r.getXPathText)("child::title",e,t),o.link=(0,r.getXPathText)("child::link",e,t),o.content=(0,r.getXPathText)("child::content:encoded",e,t,n),o.image=(0,r.getXPathText)("child::content:image",e,t,n),o.ctaButtonCopy=(0,r.getXPathText)("child::content:cta_button_copy",e,t,n),o.ctaButtonType=(0,r.getXPathText)("child::content:cta_button_type",e,t,n),o.ctaButtonUrl=(0,r.getXPathText)("child::content:cta_button_url",e,t,n),o.readMoreLinkText=(0,r.getXPathText)("child::content:read_more_link_text",e,t,n),o.isFree=(0,r.getXPathText)("child::content:is_free",e,t,n),o.isBundle=(0,r.getXPathText)("child::content:is_bundle",e,t,n),o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(228)),a=s(n(0)),l=s(n(1)),u=s(n(19));function s(e){return e&&e.__esModule?e:{default:e}}var c=l.default.svg.withConfig({displayName:"createSvgIconComponent__StyledSvg",componentId:"f1towz-0"})(["width:",";height:",";flex:none;"],function(e){return e.size},function(e){return e.size}),f=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.default.Component),o(t,[{key:"render",value:function(){var e=this.props,t=e.iconSet,n=e.icon,r=e.className,o=e.color,i=e.size,l=t[n];if(!l)return console.warn('Invalid icon name ("'+n+'") passed to the SvgIcon component.'),null;var s=l.path,f=l.viewbox,d=["yoast-svg-icon","yoast-svg-icon-"+n,r].filter(Boolean).join(" ");return a.default.createElement(c,{"aria-hidden":!0,role:"img",focusable:"false",size:i,className:d,xmlns:"http://www.w3.org/2000/svg",viewBox:f,fill:o},(0,u.default)(s)?s:a.default.createElement("path",{d:s}))}}]),t}();f.propTypes={icon:i.default.string.isRequired,iconSet:i.default.object.isRequired,color:i.default.string,size:i.default.string,className:i.default.string},f.defaultProps={size:"16px",color:"currentColor",className:""},t.default=function(e){var t=function(t){return a.default.createElement(f,r({},t,{iconSet:e}))};return t.propTypes={icon:i.default.string.isRequired,color:i.default.string,size:i.default.string,className:i.default.string},t.defaultProps={size:"16px",color:"currentColor",className:""},t}},function(e,t,n){var r=n(146),o=n(230),i=n(237),a=n(239),l=n(19),u=n(441),s="Expected a function",c=8,f=32,d=128,p=256;e.exports=function(e){return o(function(t){var n=t.length,o=n,h=r.prototype.thru;for(e&&t.reverse();o--;){var g=t[o];if("function"!=typeof g)throw new TypeError(s);if(h&&!y&&"wrapper"==a(g))var y=new r([],!0)}for(o=y?o:n;++o<n;){g=t[o];var m=a(g),v="wrapper"==m?i(g):void 0;y=v&&u(v[0])&&v[1]==(d|c|f|p)&&!v[4].length&&1==v[9]?y[a(v[0])].apply(y,v[3]):1==g.length&&u(g)?y[m]():y.thru(g)}return function(){var e=arguments,r=e[0];if(y&&1==e.length&&l(r))return y.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}})}},function(e,t,n){var r=n(426);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},function(e,t,n){var r=n(149),o=n(427);e.exports=function e(t,n,i,a,l){var u=-1,s=t.length;for(i||(i=o),l||(l=[]);++u<s;){var c=t[u];n>0&&i(c)?n>1?e(c,n-1,i,a,l):r(l,c):a||(l[l.length]=c)}return l}},function(e,t,n){var r=n(79),o=n(112),i=n(19),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t,n){var r=n(59),o=n(46),i="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t,n){var r=n(79),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[l]=n:delete e[l]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(433),o=n(234),i=n(150),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t,n){var r=n(235),o=n(435),i=n(51),a=n(236),l=/^\[object .+?Constructor\]$/,u=Function.prototype,s=Object.prototype,c=u.toString,f=s.hasOwnProperty,d=RegExp("^"+c.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?d:l).test(a(e))}},function(e,t,n){var r=n(436),o=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(45)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t){var n=800,r=16,o=Date.now;e.exports=function(e){var t=0,i=0;return function(){var a=o(),l=r-(a-i);if(i=a,l>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var r=n(238),o=r&&new r;e.exports=o},function(e,t){e.exports={}},function(e,t,n){var r=n(151),o=n(237),i=n(239),a=n(442);e.exports=function(e){var t=i(e),n=a[t];if("function"!=typeof n||!(t in r.prototype))return!1;if(e===n)return!0;var l=o(n);return!!l&&e===l[0]}},function(e,t,n){var r=n(151),o=n(146),i=n(148),a=n(19),l=n(46),u=n(443),s=Object.prototype.hasOwnProperty;function c(e){if(l(e)&&!a(e)&&!(e instanceof r)){if(e instanceof o)return e;if(s.call(e,"__wrapped__"))return u(e)}return new o(e)}c.prototype=i.prototype,c.prototype.constructor=c,e.exports=c},function(e,t,n){var r=n(151),o=n(146),i=n(240);e.exports=function(e){if(e instanceof r)return e.clone();var t=new o(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},function(e,t,n){"use strict";var r=n(445);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e){e.exports={$palette_white:"#fff",$palette_grey_ultra_light:"#f7f7f7",$palette_grey_light:"#f1f1f1",$palette_grey_medium_light:"#e2e4e7",$palette_grey:"#ddd",$palette_grey_medium:"#ccc",$palette_grey_disabled:"#a0a5aa",$palette_grey_medium_dark:"#888",$palette_grey_text_light:"#767676",$palette_grey_text:"#616161",$palette_grey_dark:"#555",$palette_black:"#000",$palette_purple:"#5d237a",$palette_purple_dark:"#6c2548",$palette_pink:"#d73763",$palette_pink_li
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|