Version Description
Download this release
Release Info
Developer | Yoast |
Plugin | Yoast SEO |
Version | 10.1 |
Comparing to | |
See all releases |
Code changes from version 10.0.1 to 10.1
- admin/ajax/class-yoast-dismissable-notice.php +5 -1
- admin/capabilities/class-abstract-capability-manager.php +1 -1
- admin/capabilities/class-capability-manager-integration.php +3 -3
- admin/class-admin-asset-manager.php +3 -1
- admin/class-admin-init.php +0 -24
- admin/class-admin-recommended-replace-vars.php +3 -1
- admin/class-admin-user-profile.php +2 -2
- admin/class-admin.php +14 -113
- admin/class-asset.php +3 -0
- admin/class-bulk-editor-list-table.php +4 -1
- admin/class-config.php +3 -1
- admin/class-expose-shortlinks.php +3 -1
- admin/class-extension.php +3 -1
- admin/class-extensions.php +7 -2
- admin/class-gutenberg-compatibility.php +2 -2
- admin/class-help-center.php +0 -13
- admin/class-meta-columns.php +6 -6
- admin/class-meta-storage.php +1 -1
- admin/class-meta-table-accessible.php +0 -15
- admin/class-my-yoast-proxy.php +2 -2
- admin/class-my-yoast-route.php +315 -0
- admin/class-option-tabs.php +1 -1
- admin/class-paper-presenter.php +9 -3
- admin/class-plugin-compatibility.php +1 -1
- admin/class-social-admin.php +1 -1
- admin/class-suggested-plugins.php +6 -6
- admin/class-yoast-dashboard-widget.php +0 -13
- admin/class-yoast-form.php +37 -29
- admin/class-yoast-notification-center.php +1 -1
- admin/class-yoast-notification.php +8 -2
- admin/class-yoast-plugin-conflict.php +2 -1
- admin/config-ui/class-configuration-components.php +0 -1
- admin/config-ui/class-configuration-page.php +1 -19
- admin/config-ui/class-configuration-storage.php +1 -1
- admin/config-ui/class-configuration-structure.php +1 -4
- admin/config-ui/components/class-component-configuration-choices.php +0 -116
- admin/config-ui/fields/class-field-company-name.php +1 -0
- admin/config-ui/fields/class-field-configuration-choices.php +0 -43
- admin/config-ui/fields/class-field-person-name.php +1 -0
- admin/config-ui/fields/class-field-profile-url-wikipedia.php +33 -0
- admin/endpoints/class-endpoint-indexable.php +3 -1
- admin/formatter/class-metabox-formatter.php +3 -1
- admin/formatter/class-post-metabox-formatter.php +3 -1
- admin/formatter/class-term-metabox-formatter.php +3 -1
- admin/google_search_console/class-gsc-table.php +6 -1
- admin/google_search_console/class-gsc.php +6 -2
- admin/import/plugins/class-abstract-plugin-importer.php +4 -1
- admin/import/plugins/class-importers.php +2 -0
- admin/links/class-link-columns.php +6 -2
- admin/links/class-link-storage.php +1 -1
- admin/links/class-link-table-accessible.php +0 -15
- admin/links/class-link-utils.php +0 -11
- admin/menu/class-admin-menu.php +1 -7
- admin/menu/class-replacevar-field.php +15 -5
- admin/metabox/class-metabox-addon-section.php +1 -1
- admin/metabox/class-metabox-editor.php +3 -1
- admin/metabox/class-metabox-section-react.php +2 -1
- admin/metabox/class-metabox-tab-section.php +2 -1
- admin/metabox/class-metabox.php +14 -2
- admin/onpage/class-onpage-option.php +3 -1
- admin/onpage/class-onpage.php +3 -1
- admin/pages/social.php +1 -1
- admin/services/class-indexable-post-provider.php +5 -2
- admin/services/class-indexable-provider.php +3 -1
- admin/services/class-indexable-term-provider.php +5 -2
- admin/services/interface-indexable-provider.php +2 -1
- admin/statistics/class-statistics-service.php +1 -1
- admin/taxonomy/class-taxonomy-columns.php +4 -2
- admin/taxonomy/class-taxonomy-fields-presenter.php +3 -3
- admin/taxonomy/class-taxonomy-fields.php +1 -1
- admin/taxonomy/class-taxonomy-settings-fields.php +3 -1
- admin/taxonomy/class-taxonomy-social-fields.php +1 -1
- admin/views/class-yoast-feature-toggles.php +2 -1
- admin/views/class-yoast-form-fieldset.php +15 -5
- admin/views/class-yoast-input-select.php +6 -2
- admin/views/licenses.php +108 -104
- admin/views/tabs/dashboard/features.php +5 -1
- admin/views/tabs/metas/paper-content/general/knowledge-graph.php +3 -3
- admin/views/tabs/network/features.php +5 -1
- admin/views/tabs/network/general.php +4 -1
- admin/views/tabs/social/accounts.php +3 -2
- admin/views/tabs/social/google.php +0 -25
- css/dist/admin-global-1001-rtl.min.css +0 -1
- css/dist/admin-global-1001.min.css +0 -1
- css/dist/admin-global-1010-rtl.min.css +1 -0
- css/dist/admin-global-1010.min.css +1 -0
- css/dist/adminbar-1001-rtl.min.css +0 -1
- css/dist/adminbar-1001.min.css +0 -1
- css/dist/adminbar-1010-rtl.min.css +1 -0
- css/dist/adminbar-1010.min.css +1 -0
- css/dist/alerts-1001-rtl.min.css +0 -1
- css/dist/alerts-1001.min.css +0 -1
- css/dist/alerts-1010-rtl.min.css +1 -0
- css/dist/alerts-1010.min.css +1 -0
- css/dist/{dashboard-1001-rtl.min.css → dashboard-1010-rtl.min.css} +1 -1
- css/dist/{dashboard-1001.min.css → dashboard-1010.min.css} +1 -1
- css/dist/{edit-page-1001-rtl.min.css → edit-page-1010-rtl.min.css} +1 -1
- css/dist/{edit-page-1001.min.css → edit-page-1010.min.css} +1 -1
- css/dist/{featured-image-1001-rtl.min.css → featured-image-1010-rtl.min.css} +0 -0
- css/dist/{featured-image-1001.min.css → featured-image-1010.min.css} +0 -0
- css/dist/filter-explanation-1001-rtl.min.css +0 -1
- css/dist/filter-explanation-1001.min.css +0 -1
- css/dist/filter-explanation-1010-rtl.min.css +1 -0
- css/dist/filter-explanation-1010.min.css +1 -0
- css/dist/{inside-editor-1001-rtl.min.css → inside-editor-1010-rtl.min.css} +1 -1
- css/dist/{inside-editor-1001.min.css → inside-editor-1010.min.css} +1 -1
- css/dist/metabox-1001-rtl.min.css +0 -1
- css/dist/metabox-1001.min.css +0 -1
- css/dist/metabox-1010-rtl.min.css +1 -0
- css/dist/metabox-1010.min.css +1 -0
- css/dist/{metabox-primary-category-1001-rtl.min.css → metabox-primary-category-1010-rtl.min.css} +0 -0
- css/dist/{metabox-primary-category-1001.min.css → metabox-primary-category-1010.min.css} +0 -0
- css/dist/{search-appearance-1001-rtl.min.css → search-appearance-1010-rtl.min.css} +1 -1
- css/dist/{search-appearance-1001.min.css → search-appearance-1010.min.css} +1 -1
- css/dist/{structured-data-blocks-1001-rtl.min.css → structured-data-blocks-1010-rtl.min.css} +1 -1
- css/dist/{structured-data-blocks-1001.min.css → structured-data-blocks-1010.min.css} +1 -1
- css/dist/{toggle-switch-1001-rtl.min.css → toggle-switch-1010-rtl.min.css} +1 -1
- css/dist/{toggle-switch-1001.min.css → toggle-switch-1010.min.css} +1 -1
- css/dist/{wpseo-dismissible-1001-rtl.min.css → wpseo-dismissible-1010-rtl.min.css} +0 -0
- css/dist/{wpseo-dismissible-1001.min.css → wpseo-dismissible-1010.min.css} +0 -0
- css/dist/yoast-components-1001-rtl.min.css +0 -1
- css/dist/yoast-components-1001.min.css +0 -1
- css/dist/yoast-components-1010-rtl.min.css +1 -0
- css/dist/yoast-components-1010.min.css +1 -0
- css/dist/yoast-extensions-1001-rtl.min.css +0 -1
- css/dist/yoast-extensions-1001.min.css +0 -1
- css/dist/yoast-extensions-1010-rtl.min.css +1 -0
- css/dist/yoast-extensions-1010.min.css +1 -0
- css/dist/yst_plugin_tools-1001-rtl.min.css +0 -1
- css/dist/yst_plugin_tools-1001.min.css +0 -1
- css/dist/yst_plugin_tools-1010-rtl.min.css +1 -0
- css/dist/yst_plugin_tools-1010.min.css +1 -0
- css/dist/{yst_seo_score-1001-rtl.min.css → yst_seo_score-1010-rtl.min.css} +1 -1
- css/dist/{yst_seo_score-1001.min.css → yst_seo_score-1010.min.css} +1 -1
- {admin → deprecated/admin}/config-ui/fields/class-field-profile-url-googleplus.php +13 -6
- deprecated/class-recalibration-beta-notification.php +1 -1
- deprecated/class-recalibration-beta.php +6 -2
- deprecated/class-wpseo-option-internallinks.php +3 -1
- deprecated/class-wpseo-option-permalinks.php +3 -1
- frontend/class-breadcrumbs.php +4 -14
- frontend/class-frontend.php +5 -27
- frontend/class-json-ld.php +7 -1
- frontend/class-opengraph-image.php +0 -1
- frontend/class-twitter.php +3 -8
- frontend/class-woocommerce-shop-page.php +6 -2
- inc/class-addon-manager.php +453 -0
- inc/{class-myyoast-api-request.php → class-my-yoast-api-request.php} +98 -24
- inc/class-rewrite.php +25 -10
- inc/class-structured-data-blocks.php +1 -0
- inc/class-upgrade-history.php +134 -0
- inc/class-upgrade.php +21 -3
- inc/class-wpseo-admin-bar-menu.php +5 -2
- inc/class-wpseo-custom-fields.php +1 -0
- inc/class-wpseo-custom-taxonomies.php +1 -0
- inc/class-wpseo-image-utils.php +4 -1
- inc/class-wpseo-meta.php +51 -81
- inc/class-wpseo-primary-term.php +4 -0
- inc/class-wpseo-rank.php +3 -1
- inc/class-wpseo-replacement-variable.php +0 -1
- inc/class-wpseo-shortlinker.php +17 -30
- inc/class-wpseo-utils.php +4 -39
- inc/endpoints/class-myyoast-connect.php +140 -0
- inc/indexables/class-object-type.php +1 -0
- inc/options/class-wpseo-option-ms.php +0 -2
- inc/options/class-wpseo-option-social.php +2 -3
- inc/options/class-wpseo-option-titles.php +1 -1
- inc/options/class-wpseo-option-wpseo.php +10 -7
- inc/options/class-wpseo-option.php +4 -1
- inc/options/class-wpseo-options.php +0 -15
- inc/options/class-wpseo-taxonomy-meta.php +0 -10
- inc/sitemaps/class-post-type-sitemap-provider.php +6 -3
- inc/sitemaps/class-sitemap-cache-data.php +1 -1
- inc/sitemaps/class-sitemaps-cache-validator.php +3 -3
- inc/sitemaps/class-sitemaps-renderer.php +4 -1
- inc/sitemaps/class-sitemaps-router.php +4 -1
- inc/wpseo-functions-deprecated.php +2 -24
- inc/wpseo-functions.php +3 -9
- js/dist/analysis-1001.min.js +0 -14
admin/ajax/class-yoast-dismissable-notice.php
CHANGED
@@ -34,11 +34,15 @@ class Yoast_Dismissable_Notice_Ajax {
|
|
34 |
|
35 |
|
36 |
/**
|
37 |
-
*
|
|
|
|
|
38 |
*/
|
39 |
private $notice_name;
|
40 |
|
41 |
/**
|
|
|
|
|
42 |
* @var string
|
43 |
*/
|
44 |
private $notice_type;
|
34 |
|
35 |
|
36 |
/**
|
37 |
+
* Name of the notice that will be dismissed.
|
38 |
+
*
|
39 |
+
* @var string
|
40 |
*/
|
41 |
private $notice_name;
|
42 |
|
43 |
/**
|
44 |
+
* The type of the current notice.
|
45 |
+
*
|
46 |
* @var string
|
47 |
*/
|
48 |
private $notice_type;
|
admin/capabilities/class-abstract-capability-manager.php
CHANGED
@@ -22,7 +22,7 @@ abstract class WPSEO_Abstract_Capability_Manager implements WPSEO_Capability_Man
|
|
22 |
*
|
23 |
* @param string $capability Capability to register.
|
24 |
* @param array $roles Roles to add the capability to.
|
25 |
-
* @param bool $overwrite
|
26 |
*/
|
27 |
public function register( $capability, array $roles, $overwrite = false ) {
|
28 |
if ( $overwrite || ! isset( $this->capabilities[ $capability ] ) ) {
|
22 |
*
|
23 |
* @param string $capability Capability to register.
|
24 |
* @param array $roles Roles to add the capability to.
|
25 |
+
* @param bool $overwrite Optional. Use add or overwrite as registration method.
|
26 |
*/
|
27 |
public function register( $capability, array $roles, $overwrite = false ) {
|
28 |
if ( $overwrite || ! isset( $this->capabilities[ $capability ] ) ) {
|
admin/capabilities/class-capability-manager-integration.php
CHANGED
@@ -82,7 +82,7 @@ class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integratio
|
|
82 |
*
|
83 |
* @see URE_Capabilities_Groups_Manager::get_groups_tree()
|
84 |
*
|
85 |
-
* @param
|
86 |
*
|
87 |
* @return array Filtered list of capabilty groups.
|
88 |
*/
|
@@ -103,8 +103,8 @@ class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integratio
|
|
103 |
*
|
104 |
* @see URE_Capabilities_Groups_Manager::get_cap_groups()
|
105 |
*
|
106 |
-
* @param
|
107 |
-
* @param
|
108 |
*
|
109 |
* @return array List of filtered groups.
|
110 |
*/
|
82 |
*
|
83 |
* @see URE_Capabilities_Groups_Manager::get_groups_tree()
|
84 |
*
|
85 |
+
* @param array $groups Current groups.
|
86 |
*
|
87 |
* @return array Filtered list of capabilty groups.
|
88 |
*/
|
103 |
*
|
104 |
* @see URE_Capabilities_Groups_Manager::get_cap_groups()
|
105 |
*
|
106 |
+
* @param array $groups Current capability groups.
|
107 |
+
* @param string $cap_id Capability identifier.
|
108 |
*
|
109 |
* @return array List of filtered groups.
|
110 |
*/
|
admin/class-admin-asset-manager.php
CHANGED
@@ -23,7 +23,9 @@ class WPSEO_Admin_Asset_Manager {
|
|
23 |
const PREFIX = 'yoast-seo-';
|
24 |
|
25 |
/**
|
26 |
-
*
|
|
|
|
|
27 |
*/
|
28 |
private $prefix;
|
29 |
|
23 |
const PREFIX = 'yoast-seo-';
|
24 |
|
25 |
/**
|
26 |
+
* Prefix for naming the assets.
|
27 |
+
*
|
28 |
+
* @var string
|
29 |
*/
|
30 |
private $prefix;
|
31 |
|
admin/class-admin-init.php
CHANGED
@@ -613,30 +613,6 @@ class WPSEO_Admin_Init {
|
|
613 |
|
614 |
// WordPress hooks that have been deprecated since a Yoast SEO version.
|
615 |
$deprecated_filters = array(
|
616 |
-
'wpseo_metadesc_length' => array(
|
617 |
-
'version' => '3.0',
|
618 |
-
'alternative' => 'javascript',
|
619 |
-
),
|
620 |
-
'wpseo_metadesc_length_reason' => array(
|
621 |
-
'version' => '3.0',
|
622 |
-
'alternative' => 'javascript',
|
623 |
-
),
|
624 |
-
'wpseo_body_length_score' => array(
|
625 |
-
'version' => '3.0',
|
626 |
-
'alternative' => 'javascript',
|
627 |
-
),
|
628 |
-
'wpseo_linkdex_results' => array(
|
629 |
-
'version' => '3.0',
|
630 |
-
'alternative' => 'javascript',
|
631 |
-
),
|
632 |
-
'wpseo_snippet' => array(
|
633 |
-
'version' => '3.0',
|
634 |
-
'alternative' => 'javascript',
|
635 |
-
),
|
636 |
-
'wp_seo_get_bc_title' => array(
|
637 |
-
'version' => '5.8',
|
638 |
-
'alternative' => 'wpseo_breadcrumb_single_link_info',
|
639 |
-
),
|
640 |
'wpseo_metakey' => array(
|
641 |
'version' => '6.3',
|
642 |
'alternative' => null,
|
613 |
|
614 |
// WordPress hooks that have been deprecated since a Yoast SEO version.
|
615 |
$deprecated_filters = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
616 |
'wpseo_metakey' => array(
|
617 |
'version' => '6.3',
|
618 |
'alternative' => null,
|
admin/class-admin-recommended-replace-vars.php
CHANGED
@@ -11,7 +11,9 @@
|
|
11 |
class WPSEO_Admin_Recommended_Replace_Vars {
|
12 |
|
13 |
/**
|
14 |
-
*
|
|
|
|
|
15 |
*/
|
16 |
protected $recommended_replace_vars = array(
|
17 |
// Posts types.
|
11 |
class WPSEO_Admin_Recommended_Replace_Vars {
|
12 |
|
13 |
/**
|
14 |
+
* The recommended replacement variables.
|
15 |
+
*
|
16 |
+
* @var array
|
17 |
*/
|
18 |
protected $recommended_replace_vars = array(
|
19 |
// Posts types.
|
admin/class-admin-user-profile.php
CHANGED
@@ -28,9 +28,9 @@ class WPSEO_Admin_User_Profile {
|
|
28 |
*
|
29 |
* @since 3.1
|
30 |
*
|
31 |
-
* @param int $meta_id
|
32 |
* @param int $object_id The ID of the user.
|
33 |
-
* @param string $meta_key
|
34 |
*/
|
35 |
public function clear_author_sitemap_cache( $meta_id, $object_id, $meta_key ) {
|
36 |
if ( '_yoast_wpseo_profile_updated' === $meta_key ) {
|
28 |
*
|
29 |
* @since 3.1
|
30 |
*
|
31 |
+
* @param int $meta_id The ID of the meta option changed.
|
32 |
* @param int $object_id The ID of the user.
|
33 |
+
* @param string $meta_key The key of the meta field changed.
|
34 |
*/
|
35 |
public function clear_author_sitemap_cache( $meta_id, $object_id, $meta_key ) {
|
36 |
if ( '_yoast_wpseo_profile_updated' === $meta_key ) {
|
admin/class-admin.php
CHANGED
@@ -110,6 +110,8 @@ class WPSEO_Admin {
|
|
110 |
$integrations[] = new WPSEO_Admin_Gutenberg_Compatibility_Notification();
|
111 |
$integrations[] = new WPSEO_Expose_Shortlinks();
|
112 |
$integrations[] = new WPSEO_MyYoast_Proxy();
|
|
|
|
|
113 |
$integrations[] = $this->admin_features['google_search_console'];
|
114 |
$integrations = array_merge( $integrations, $this->initialize_seo_links(), $this->initialize_cornerstone_content() );
|
115 |
|
@@ -217,13 +219,9 @@ class WPSEO_Admin {
|
|
217 |
array_unshift( $links, $settings_link );
|
218 |
}
|
219 |
|
220 |
-
|
221 |
-
|
222 |
-
$
|
223 |
-
|
224 |
-
if ( $extension_manager->is_activated( $product_premium->get_slug() ) ) {
|
225 |
-
return $links;
|
226 |
-
}
|
227 |
}
|
228 |
|
229 |
// Add link to premium support landing page.
|
@@ -256,7 +254,7 @@ class WPSEO_Admin {
|
|
256 |
}
|
257 |
|
258 |
/**
|
259 |
-
* Filter the $contactmethods array and add Facebook,
|
260 |
*
|
261 |
* These are used with the Facebook author, rel="author" and Twitter cards implementation.
|
262 |
*
|
@@ -265,12 +263,16 @@ class WPSEO_Admin {
|
|
265 |
* @return array $contactmethods with added contactmethods.
|
266 |
*/
|
267 |
public function update_contactmethods( $contactmethods ) {
|
268 |
-
// Add Google+.
|
269 |
-
$contactmethods['googleplus'] = __( 'Google+', 'wordpress-seo' );
|
270 |
-
// Add Twitter.
|
271 |
-
$contactmethods['twitter'] = __( 'Twitter username (without @)', 'wordpress-seo' );
|
272 |
// Add Facebook.
|
273 |
$contactmethods['facebook'] = __( 'Facebook profile URL', 'wordpress-seo' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
return $contactmethods;
|
276 |
}
|
@@ -409,58 +411,6 @@ class WPSEO_Admin {
|
|
409 |
|
410 |
/* ********************* DEPRECATED METHODS ********************* */
|
411 |
|
412 |
-
/**
|
413 |
-
* Register the menu item and its sub menu's.
|
414 |
-
*
|
415 |
-
* @deprecated 5.5
|
416 |
-
* @codeCoverageIgnore
|
417 |
-
*/
|
418 |
-
public function register_settings_page() {
|
419 |
-
_deprecated_function( __METHOD__, 'WPSEO 5.5.0' );
|
420 |
-
}
|
421 |
-
|
422 |
-
/**
|
423 |
-
* Register the settings page for the Network settings.
|
424 |
-
*
|
425 |
-
* @deprecated 5.5
|
426 |
-
* @codeCoverageIgnore
|
427 |
-
*/
|
428 |
-
public function register_network_settings_page() {
|
429 |
-
_deprecated_function( __METHOD__, 'WPSEO 5.5.0' );
|
430 |
-
}
|
431 |
-
|
432 |
-
/**
|
433 |
-
* Load the form for a WPSEO admin page.
|
434 |
-
*
|
435 |
-
* @deprecated 5.5
|
436 |
-
* @codeCoverageIgnore
|
437 |
-
*/
|
438 |
-
public function load_page() {
|
439 |
-
_deprecated_function( __METHOD__, 'WPSEO 5.5.0' );
|
440 |
-
}
|
441 |
-
|
442 |
-
/**
|
443 |
-
* Loads the form for the network configuration page.
|
444 |
-
*
|
445 |
-
* @deprecated 5.5
|
446 |
-
* @codeCoverageIgnore
|
447 |
-
*/
|
448 |
-
public function network_config_page() {
|
449 |
-
_deprecated_function( __METHOD__, 'WPSEO 5.5.0' );
|
450 |
-
}
|
451 |
-
|
452 |
-
/**
|
453 |
-
* Filters all advanced settings pages from the given pages.
|
454 |
-
*
|
455 |
-
* @deprecated 5.5
|
456 |
-
* @codeCoverageIgnore
|
457 |
-
*
|
458 |
-
* @param array $pages The pages to filter.
|
459 |
-
*/
|
460 |
-
public function filter_settings_pages( array $pages ) {
|
461 |
-
_deprecated_function( __METHOD__, 'WPSEO 5.5.0' );
|
462 |
-
}
|
463 |
-
|
464 |
/**
|
465 |
* Cleans stopwords out of the slug, if the slug hasn't been set yet.
|
466 |
*
|
@@ -485,55 +435,6 @@ class WPSEO_Admin {
|
|
485 |
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
|
486 |
}
|
487 |
|
488 |
-
/**
|
489 |
-
* Adds contextual help to the titles & metas page.
|
490 |
-
*
|
491 |
-
* @deprecated 5.6.0
|
492 |
-
* @codeCoverageIgnore
|
493 |
-
*/
|
494 |
-
public function title_metas_help_tab() {
|
495 |
-
_deprecated_function( __METHOD__, '5.6.0' );
|
496 |
-
|
497 |
-
$screen = get_current_screen();
|
498 |
-
|
499 |
-
$screen->set_help_sidebar(
|
500 |
-
'
|
501 |
-
<p><strong>' . __( 'For more information:', 'wordpress-seo' ) . '</strong></p>
|
502 |
-
<p><a target="_blank" href="https://yoast.com/wordpress-seo/#titles">' . __( 'Title optimization', 'wordpress-seo' ) . '</a></p>
|
503 |
-
<p><a target="_blank" href="https://yoast.com/google-page-title/">' . __( 'Why Google won\'t display the right page title', 'wordpress-seo' ) . '</a></p>'
|
504 |
-
);
|
505 |
-
|
506 |
-
$screen->add_help_tab(
|
507 |
-
array(
|
508 |
-
'id' => 'basic-help',
|
509 |
-
'title' => __( 'Template explanation', 'wordpress-seo' ),
|
510 |
-
'content' => "\n\t\t<h2>" . __( 'Template explanation', 'wordpress-seo' ) . "</h2>\n\t\t" . '<p>' .
|
511 |
-
sprintf(
|
512 |
-
/* translators: %1$s expands to Yoast SEO. */
|
513 |
-
__( 'The title & metas settings for %1$s are made up of variables that are replaced by specific values from the page when the page is displayed. The tabs on the left explain the available variables.', 'wordpress-seo' ),
|
514 |
-
'Yoast SEO'
|
515 |
-
) .
|
516 |
-
'</p><p>' . __( 'Note that not all variables can be used in every template.', 'wordpress-seo' ) . '</p>',
|
517 |
-
)
|
518 |
-
);
|
519 |
-
|
520 |
-
$screen->add_help_tab(
|
521 |
-
array(
|
522 |
-
'id' => 'title-vars',
|
523 |
-
'title' => __( 'Basic Variables', 'wordpress-seo' ),
|
524 |
-
'content' => "\n\t\t<h2>" . __( 'Basic Variables', 'wordpress-seo' ) . "</h2>\n\t\t" . WPSEO_Replace_Vars::get_basic_help_texts(),
|
525 |
-
)
|
526 |
-
);
|
527 |
-
|
528 |
-
$screen->add_help_tab(
|
529 |
-
array(
|
530 |
-
'id' => 'title-vars-advanced',
|
531 |
-
'title' => __( 'Advanced Variables', 'wordpress-seo' ),
|
532 |
-
'content' => "\n\t\t<h2>" . __( 'Advanced Variables', 'wordpress-seo' ) . "</h2>\n\t\t" . WPSEO_Replace_Vars::get_advanced_help_texts(),
|
533 |
-
)
|
534 |
-
);
|
535 |
-
}
|
536 |
-
|
537 |
/**
|
538 |
* Initializes WHIP to show a notice for outdated PHP versions.
|
539 |
*
|
110 |
$integrations[] = new WPSEO_Admin_Gutenberg_Compatibility_Notification();
|
111 |
$integrations[] = new WPSEO_Expose_Shortlinks();
|
112 |
$integrations[] = new WPSEO_MyYoast_Proxy();
|
113 |
+
$integrations[] = new WPSEO_MyYoast_Route();
|
114 |
+
$integrations[] = new WPSEO_Addon_Manager();
|
115 |
$integrations[] = $this->admin_features['google_search_console'];
|
116 |
$integrations = array_merge( $integrations, $this->initialize_seo_links(), $this->initialize_cornerstone_content() );
|
117 |
|
219 |
array_unshift( $links, $settings_link );
|
220 |
}
|
221 |
|
222 |
+
$addon_manager = new WPSEO_Addon_Manager();
|
223 |
+
if ( $addon_manager->has_valid_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG ) && WPSEO_Utils::is_yoast_seo_premium() ) {
|
224 |
+
return $links;
|
|
|
|
|
|
|
|
|
225 |
}
|
226 |
|
227 |
// Add link to premium support landing page.
|
254 |
}
|
255 |
|
256 |
/**
|
257 |
+
* Filter the $contactmethods array and add Facebook, LinkedIn and Twitter.
|
258 |
*
|
259 |
* These are used with the Facebook author, rel="author" and Twitter cards implementation.
|
260 |
*
|
263 |
* @return array $contactmethods with added contactmethods.
|
264 |
*/
|
265 |
public function update_contactmethods( $contactmethods ) {
|
|
|
|
|
|
|
|
|
266 |
// Add Facebook.
|
267 |
$contactmethods['facebook'] = __( 'Facebook profile URL', 'wordpress-seo' );
|
268 |
+
// Add Instagram.
|
269 |
+
$contactmethods['instagram'] = __( 'Instagram profile URL', 'wordpress-seo' );
|
270 |
+
// Add LinkedIn.
|
271 |
+
$contactmethods['linkedin'] = __( 'LinkedIn profile URL', 'wordpress-seo' );
|
272 |
+
// Add Pinterest.
|
273 |
+
$contactmethods['pinterest'] = __( 'Pinterest profile URL', 'wordpress-seo' );
|
274 |
+
// Add Twitter.
|
275 |
+
$contactmethods['twitter'] = __( 'Twitter username (without @)', 'wordpress-seo' );
|
276 |
|
277 |
return $contactmethods;
|
278 |
}
|
411 |
|
412 |
/* ********************* DEPRECATED METHODS ********************* */
|
413 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
/**
|
415 |
* Cleans stopwords out of the slug, if the slug hasn't been set yet.
|
416 |
*
|
435 |
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
|
436 |
}
|
437 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
438 |
/**
|
439 |
* Initializes WHIP to show a notice for outdated PHP versions.
|
440 |
*
|
admin/class-asset.php
CHANGED
@@ -198,6 +198,9 @@ class WPSEO_Admin_Asset {
|
|
198 |
/**
|
199 |
* Returns the full URL for this asset based on the path to the plugin file.
|
200 |
*
|
|
|
|
|
|
|
201 |
* @param string $type Type of asset.
|
202 |
* @param string $plugin_file Absolute path to the plugin file.
|
203 |
*
|
198 |
/**
|
199 |
* Returns the full URL for this asset based on the path to the plugin file.
|
200 |
*
|
201 |
+
* @deprecated 6.2
|
202 |
+
* @codeCoverageIgnore
|
203 |
+
*
|
204 |
* @param string $type Type of asset.
|
205 |
* @param string $plugin_file Absolute path to the plugin file.
|
206 |
*
|
admin/class-bulk-editor-list-table.php
CHANGED
@@ -439,7 +439,10 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
|
439 |
$current_status = $this->current_status;
|
440 |
$current_order = $this->current_order;
|
441 |
|
442 |
-
|
|
|
|
|
|
|
443 |
if ( isset( $this->input_fields['type'] ) && $this->input_fields['type'] !== $this->page_type ) {
|
444 |
$request_url = remove_query_arg( 'paged', $request_url ); // Page will be set with value 1 below.
|
445 |
$request_url = remove_query_arg( 'post_type_filter', $request_url );
|
439 |
$current_status = $this->current_status;
|
440 |
$current_order = $this->current_order;
|
441 |
|
442 |
+
/*
|
443 |
+
* If current type doesn't compare with objects page_type, then we have to unset
|
444 |
+
* some vars in the requested url (which will be used for internal table urls).
|
445 |
+
*/
|
446 |
if ( isset( $this->input_fields['type'] ) && $this->input_fields['type'] !== $this->page_type ) {
|
447 |
$request_url = remove_query_arg( 'paged', $request_url ); // Page will be set with value 1 below.
|
448 |
$request_url = remove_query_arg( 'post_type_filter', $request_url );
|
admin/class-config.php
CHANGED
@@ -13,7 +13,9 @@
|
|
13 |
class WPSEO_Admin_Pages {
|
14 |
|
15 |
/**
|
16 |
-
*
|
|
|
|
|
17 |
*/
|
18 |
public $currentoption = 'wpseo';
|
19 |
|
13 |
class WPSEO_Admin_Pages {
|
14 |
|
15 |
/**
|
16 |
+
* The option in use for the current admin page.
|
17 |
+
*
|
18 |
+
* @var string
|
19 |
*/
|
20 |
public $currentoption = 'wpseo';
|
21 |
|
admin/class-expose-shortlinks.php
CHANGED
@@ -11,7 +11,9 @@
|
|
11 |
class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
|
12 |
|
13 |
/**
|
14 |
-
*
|
|
|
|
|
15 |
*/
|
16 |
private $shortlinks = array(
|
17 |
'shortlinks.focus_keyword_info' => 'https://yoa.st/focus-keyword',
|
11 |
class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
|
12 |
|
13 |
/**
|
14 |
+
* Array containing the keys and shortlinks.
|
15 |
+
*
|
16 |
+
* @var array
|
17 |
*/
|
18 |
private $shortlinks = array(
|
19 |
'shortlinks.focus_keyword_info' => 'https://yoa.st/focus-keyword',
|
admin/class-extension.php
CHANGED
@@ -10,7 +10,9 @@
|
|
10 |
*/
|
11 |
class WPSEO_Extension {
|
12 |
|
13 |
-
/**
|
|
|
|
|
14 |
protected $config = array();
|
15 |
|
16 |
/**
|
10 |
*/
|
11 |
class WPSEO_Extension {
|
12 |
|
13 |
+
/**
|
14 |
+
* @var array
|
15 |
+
*/
|
16 |
protected $config = array();
|
17 |
|
18 |
/**
|
admin/class-extensions.php
CHANGED
@@ -20,26 +20,31 @@ class WPSEO_Extensions {
|
|
20 |
'slug' => 'yoast-seo-premium',
|
21 |
'identifier' => 'wordpress-seo-premium',
|
22 |
'classname' => 'WPSEO_Premium',
|
|
|
23 |
),
|
24 |
'News SEO' => array(
|
25 |
'slug' => 'news-seo',
|
26 |
'identifier' => 'wpseo-news',
|
27 |
'classname' => 'WPSEO_News',
|
|
|
28 |
),
|
29 |
'Yoast WooCommerce SEO' => array(
|
30 |
'slug' => 'woocommerce-yoast-seo',
|
31 |
'identifier' => 'wpseo-woocommerce',
|
32 |
'classname' => 'Yoast_WooCommerce_SEO',
|
|
|
33 |
),
|
34 |
'Video SEO' => array(
|
35 |
'slug' => 'video-seo-for-wordpress',
|
36 |
'identifier' => 'wpseo-video',
|
37 |
'classname' => 'WPSEO_Video_Sitemap',
|
|
|
38 |
),
|
39 |
'Local SEO' => array(
|
40 |
'slug' => 'local-seo-for-wordpress',
|
41 |
'identifier' => 'wpseo-local',
|
42 |
'classname' => 'WPSEO_Local_Core',
|
|
|
43 |
),
|
44 |
);
|
45 |
|
@@ -60,8 +65,8 @@ class WPSEO_Extensions {
|
|
60 |
* @return bool Returns true when valid.
|
61 |
*/
|
62 |
public function is_valid( $extension ) {
|
63 |
-
$
|
64 |
-
return $
|
65 |
}
|
66 |
|
67 |
/**
|
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' => array(
|
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' => array(
|
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' => array(
|
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' => array(
|
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 |
|
65 |
* @return bool Returns true when valid.
|
66 |
*/
|
67 |
public function is_valid( $extension ) {
|
68 |
+
$addon_manager = new WPSEO_Addon_Manager();
|
69 |
+
return $addon_manager->has_valid_subscription( $this->extensions[ $extension ]['my-yoast-slug'] );
|
70 |
}
|
71 |
|
72 |
/**
|
admin/class-gutenberg-compatibility.php
CHANGED
@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
|
|
15 |
*
|
16 |
* @var string
|
17 |
*/
|
18 |
-
const CURRENT_RELEASE = '5.
|
19 |
|
20 |
/**
|
21 |
* The minimally supported version of Gutenberg by the plugin.
|
22 |
*
|
23 |
* @var string
|
24 |
*/
|
25 |
-
const MINIMUM_SUPPORTED = '5.
|
26 |
|
27 |
/**
|
28 |
* @var string
|
15 |
*
|
16 |
* @var string
|
17 |
*/
|
18 |
+
const CURRENT_RELEASE = '5.3.0';
|
19 |
|
20 |
/**
|
21 |
* The minimally supported version of Gutenberg by the plugin.
|
22 |
*
|
23 |
* @var string
|
24 |
*/
|
25 |
+
const MINIMUM_SUPPORTED = '5.3.0';
|
26 |
|
27 |
/**
|
28 |
* @var string
|
admin/class-help-center.php
CHANGED
@@ -270,17 +270,4 @@ class WPSEO_Help_Center {
|
|
270 |
'helpCenter.buttonText' => __( 'Need help?', 'wordpress-seo' ),
|
271 |
);
|
272 |
}
|
273 |
-
|
274 |
-
/* ********************* DEPRECATED METHODS ********************* */
|
275 |
-
|
276 |
-
/**
|
277 |
-
* Outputs the help center.
|
278 |
-
*
|
279 |
-
* @deprecated 5.6
|
280 |
-
* @codeCoverageIgnore
|
281 |
-
*/
|
282 |
-
public function output_help_center() {
|
283 |
-
_deprecated_function( 'WPSEO_Help_Center::output_help_center', 'WPSEO 5.6.0', 'WPSEO_Help_Center::mount()' );
|
284 |
-
$this->mount();
|
285 |
-
}
|
286 |
}
|
270 |
'helpCenter.buttonText' => __( 'Need help?', 'wordpress-seo' ),
|
271 |
);
|
272 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
}
|
admin/class-meta-columns.php
CHANGED
@@ -242,9 +242,9 @@ class WPSEO_Meta_Columns {
|
|
242 |
/**
|
243 |
* Generates an <option> element.
|
244 |
*
|
245 |
-
* @param string $value
|
246 |
-
* @param string $label
|
247 |
-
* @param string $selected
|
248 |
*
|
249 |
* @return string The generated <option> element.
|
250 |
*/
|
@@ -439,7 +439,7 @@ class WPSEO_Meta_Columns {
|
|
439 |
/**
|
440 |
* Uses the vars to create a complete filter query that can later be executed to filter out posts.
|
441 |
*
|
442 |
-
* @param array $vars
|
443 |
* @param array $filters Array containing the filters that we need to apply in the meta query.
|
444 |
*
|
445 |
* @return array Array containing the complete filter query.
|
@@ -466,7 +466,7 @@ class WPSEO_Meta_Columns {
|
|
466 |
/**
|
467 |
* Creates a Readability score filter.
|
468 |
*
|
469 |
-
* @param number $low
|
470 |
* @param number $high The higher boundary of the score.
|
471 |
*
|
472 |
* @return array The Readability Score filter.
|
@@ -485,7 +485,7 @@ class WPSEO_Meta_Columns {
|
|
485 |
/**
|
486 |
* Creates an SEO score filter.
|
487 |
*
|
488 |
-
* @param number $low
|
489 |
* @param number $high The higher boundary of the score.
|
490 |
*
|
491 |
* @return array The SEO score filter.
|
242 |
/**
|
243 |
* Generates an <option> element.
|
244 |
*
|
245 |
+
* @param string $value The option's value.
|
246 |
+
* @param string $label The option's label.
|
247 |
+
* @param string $selected HTML selected attribute for an option.
|
248 |
*
|
249 |
* @return string The generated <option> element.
|
250 |
*/
|
439 |
/**
|
440 |
* Uses the vars to create a complete filter query that can later be executed to filter out posts.
|
441 |
*
|
442 |
+
* @param array $vars Array containing the variables that will be used in the meta query.
|
443 |
* @param array $filters Array containing the filters that we need to apply in the meta query.
|
444 |
*
|
445 |
* @return array Array containing the complete filter query.
|
466 |
/**
|
467 |
* Creates a Readability score filter.
|
468 |
*
|
469 |
+
* @param number $low The lower boundary of the score.
|
470 |
* @param number $high The higher boundary of the score.
|
471 |
*
|
472 |
* @return array The Readability Score filter.
|
485 |
/**
|
486 |
* Creates an SEO score filter.
|
487 |
*
|
488 |
+
* @param number $low The lower boundary of the score.
|
489 |
* @param number $high The higher boundary of the score.
|
490 |
*
|
491 |
* @return array The SEO score filter.
|
admin/class-meta-storage.php
CHANGED
@@ -23,7 +23,7 @@ class WPSEO_Meta_Storage implements WPSEO_Installable {
|
|
23 |
protected $database_proxy;
|
24 |
|
25 |
/**
|
26 |
-
* @deprecated
|
27 |
*
|
28 |
* @var null|string
|
29 |
*/
|
23 |
protected $database_proxy;
|
24 |
|
25 |
/**
|
26 |
+
* @deprecated 7.4
|
27 |
*
|
28 |
* @var null|string
|
29 |
*/
|
admin/class-meta-table-accessible.php
CHANGED
@@ -96,19 +96,4 @@ class WPSEO_Meta_Table_Accessible {
|
|
96 |
protected static function transient_name() {
|
97 |
return 'wpseo_meta_table_inaccessible';
|
98 |
}
|
99 |
-
|
100 |
-
/* ********************* DEPRECATED METHODS ********************* */
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Checks if the table exists if not, set the transient to indicate the inaccessible table.
|
104 |
-
*
|
105 |
-
* @deprecated 6.0
|
106 |
-
* @codeCoverageIgnore
|
107 |
-
*
|
108 |
-
* @return bool True if table is accessible.
|
109 |
-
*/
|
110 |
-
public static function check_table_is_accessible() {
|
111 |
-
_deprecated_function( __FUNCTION__, '6.0', __CLASS__ . '::is_accessible' );
|
112 |
-
return self::is_accessible();
|
113 |
-
}
|
114 |
}
|
96 |
protected static function transient_name() {
|
97 |
return 'wpseo_meta_table_inaccessible';
|
98 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
admin/class-my-yoast-proxy.php
CHANGED
@@ -162,8 +162,8 @@ class WPSEO_MyYoast_Proxy implements WPSEO_WordPress_Integration {
|
|
162 |
* When the file is known it returns an array like this:
|
163 |
* <code>
|
164 |
* $array = array(
|
165 |
-
*
|
166 |
-
*
|
167 |
* )
|
168 |
* </code>
|
169 |
*
|
162 |
* When the file is known it returns an array like this:
|
163 |
* <code>
|
164 |
* $array = array(
|
165 |
+
* 'content_type' => 'the content type'
|
166 |
+
* 'url' => 'the url, possibly with the plugin version'
|
167 |
* )
|
168 |
* </code>
|
169 |
*
|
admin/class-my-yoast-route.php
ADDED
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WPSEO plugin file.
|
4 |
+
*
|
5 |
+
* @package WPSEO\Admin
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Represents the route for MyYoast.
|
10 |
+
*/
|
11 |
+
class WPSEO_MyYoast_Route implements WPSEO_WordPress_Integration {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
+
const PAGE_IDENTIFIER = 'wpseo_myyoast';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* The instance of the MyYoast client.
|
20 |
+
*
|
21 |
+
* @var WPSEO_MyYoast_Client
|
22 |
+
*/
|
23 |
+
protected $client;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* The actions that are supported.
|
27 |
+
*
|
28 |
+
* Each action should have a method named equally to the action.
|
29 |
+
*
|
30 |
+
* For example:
|
31 |
+
* The connect action is handled by a method named 'connect'.
|
32 |
+
*
|
33 |
+
* @var array
|
34 |
+
*/
|
35 |
+
protected static $allowed_actions = array( 'connect', 'authorize', 'complete' );
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Sets the hooks when the user has enough rights and is on the right page.
|
39 |
+
*
|
40 |
+
* @return void
|
41 |
+
*/
|
42 |
+
public function register_hooks() {
|
43 |
+
$route = filter_input( INPUT_GET, 'page' );
|
44 |
+
if ( ! ( $this->is_myyoast_route( $route ) && $this->can_access_route() ) ) {
|
45 |
+
return;
|
46 |
+
}
|
47 |
+
|
48 |
+
if ( ! $this->is_valid_action( $this->get_action() ) ) {
|
49 |
+
return;
|
50 |
+
}
|
51 |
+
|
52 |
+
add_action( 'admin_menu', array( $this, 'register_route' ) );
|
53 |
+
add_action( 'admin_init', array( $this, 'handle_route' ) );
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Registers the page for the MyYoast route.
|
58 |
+
*
|
59 |
+
* @codeCoverageIgnore
|
60 |
+
*
|
61 |
+
* @return void
|
62 |
+
*/
|
63 |
+
public function register_route() {
|
64 |
+
add_dashboard_page(
|
65 |
+
'', // Is empty because we don't render a page.
|
66 |
+
'', // Is empty because we don't want a menu item.
|
67 |
+
'wpseo_manage_options',
|
68 |
+
self::PAGE_IDENTIFIER
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Abstracts the action from the URL and follows the appropriate route.
|
74 |
+
*
|
75 |
+
* @return void
|
76 |
+
*/
|
77 |
+
public function handle_route() {
|
78 |
+
$action = $this->get_action();
|
79 |
+
|
80 |
+
if ( ! $this->is_valid_action( $action ) || ! method_exists( $this, $action ) ) {
|
81 |
+
return;
|
82 |
+
}
|
83 |
+
|
84 |
+
// Dynamically call the method.
|
85 |
+
$this->$action();
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Checks if the current page is the MyYoast route.
|
90 |
+
*
|
91 |
+
* @param string $route The MyYoast route.
|
92 |
+
*
|
93 |
+
* @return bool True when url is the MyYoast route.
|
94 |
+
*/
|
95 |
+
protected function is_myyoast_route( $route ) {
|
96 |
+
return ( $route === self::PAGE_IDENTIFIER );
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Compares an action to a list of allowed actions to see if it is valid.
|
101 |
+
*
|
102 |
+
* @param string $action The action to check.
|
103 |
+
*
|
104 |
+
* @return bool True if the action is valid.
|
105 |
+
*/
|
106 |
+
protected function is_valid_action( $action ) {
|
107 |
+
return in_array( $action, self::$allowed_actions, true );
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Connects to MyYoast and generates a new clientId.
|
112 |
+
*
|
113 |
+
* @return void
|
114 |
+
*/
|
115 |
+
protected function connect() {
|
116 |
+
$client_id = $this->generate_uuid();
|
117 |
+
|
118 |
+
$this->save_client_id( $client_id );
|
119 |
+
|
120 |
+
$this->redirect(
|
121 |
+
'https://my.yoast.com/connect',
|
122 |
+
array(
|
123 |
+
'url' => WPSEO_Utils::get_home_url(),
|
124 |
+
'client_id' => $client_id,
|
125 |
+
'extensions' => $this->get_extensions(),
|
126 |
+
'redirect_url' => admin_url( 'admin.php?page=' . self::PAGE_IDENTIFIER . '&action=complete' ),
|
127 |
+
'credentials_url' => rest_url( 'yoast/v1/myyoast/connect' ),
|
128 |
+
'type' => 'wordpress',
|
129 |
+
)
|
130 |
+
);
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Redirects the user to the oAuth authorization page.
|
135 |
+
*
|
136 |
+
* @return void
|
137 |
+
*/
|
138 |
+
protected function authorize() {
|
139 |
+
$client = $this->get_client();
|
140 |
+
|
141 |
+
if ( ! $client->has_configuration() ) {
|
142 |
+
return;
|
143 |
+
}
|
144 |
+
|
145 |
+
$this->redirect(
|
146 |
+
$client->get_provider()->getAuthorizationUrl()
|
147 |
+
);
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Completes the oAuth connection flow.
|
152 |
+
*
|
153 |
+
* @return void
|
154 |
+
*/
|
155 |
+
protected function complete() {
|
156 |
+
$client = $this->get_client();
|
157 |
+
|
158 |
+
if ( ! $client->has_configuration() ) {
|
159 |
+
return;
|
160 |
+
}
|
161 |
+
|
162 |
+
try {
|
163 |
+
$access_token = $client
|
164 |
+
->get_provider()
|
165 |
+
->getAccessToken(
|
166 |
+
'authorization_code',
|
167 |
+
array(
|
168 |
+
'code' => $this->get_authorization_code(),
|
169 |
+
)
|
170 |
+
);
|
171 |
+
|
172 |
+
$client->save_access_token(
|
173 |
+
$this->get_current_user_id(),
|
174 |
+
$access_token
|
175 |
+
);
|
176 |
+
}
|
177 |
+
// @codingStandardsIgnoreLine Generic.CodeAnalysis.EmptyStatement.DetectedCATCH -- There is nothing to do.
|
178 |
+
catch ( Exception $e ) {
|
179 |
+
// Do nothing.
|
180 |
+
}
|
181 |
+
|
182 |
+
$this->redirect_to_premium_page();
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Saves the client id.
|
187 |
+
*
|
188 |
+
* @codeCoverageIgnore
|
189 |
+
*
|
190 |
+
* @param string $client_id The client id to save.
|
191 |
+
*
|
192 |
+
* @return void
|
193 |
+
*/
|
194 |
+
protected function save_client_id( $client_id ) {
|
195 |
+
$this->get_client()->save_configuration(
|
196 |
+
array(
|
197 |
+
'clientId' => $client_id,
|
198 |
+
)
|
199 |
+
);
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Creates a new MyYoast Client instance.
|
204 |
+
*
|
205 |
+
* @codeCoverageIgnore
|
206 |
+
*
|
207 |
+
* @return WPSEO_MyYoast_Client Instance of the myyoast client.
|
208 |
+
*/
|
209 |
+
protected function get_client() {
|
210 |
+
if ( ! $this->client ) {
|
211 |
+
$this->client = new WPSEO_MyYoast_Client();
|
212 |
+
}
|
213 |
+
|
214 |
+
return $this->client;
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Abstracts the action from the url.
|
219 |
+
*
|
220 |
+
* @codeCoverageIgnore
|
221 |
+
*
|
222 |
+
* @return string The action from the url.
|
223 |
+
*/
|
224 |
+
protected function get_action() {
|
225 |
+
return filter_input( INPUT_GET, 'action' );
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Abstracts the authorization code from the url.
|
230 |
+
*
|
231 |
+
* @codeCoverageIgnore
|
232 |
+
*
|
233 |
+
* @return string The action from the url.
|
234 |
+
*/
|
235 |
+
protected function get_authorization_code() {
|
236 |
+
return filter_input( INPUT_GET, 'code' );
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Retrieves a list of activated extensions slugs.
|
241 |
+
*
|
242 |
+
* @codeCoverageIgnore
|
243 |
+
*
|
244 |
+
* @return array The extensions slugs.
|
245 |
+
*/
|
246 |
+
protected function get_extensions() {
|
247 |
+
$addon_manager = new WPSEO_Addon_Manager();
|
248 |
+
|
249 |
+
return array_keys( $addon_manager->get_subscriptions_for_active_addons() );
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Generates an URL-encoded query string, redirects there.
|
254 |
+
*
|
255 |
+
* @codeCoverageIgnore
|
256 |
+
*
|
257 |
+
* @param string $url The url to redirect to.
|
258 |
+
* @param array $query_args The additional arguments to build the url from.
|
259 |
+
*
|
260 |
+
* @return void
|
261 |
+
*/
|
262 |
+
protected function redirect( $url, $query_args = array() ) {
|
263 |
+
if ( ! empty( $query_args ) ) {
|
264 |
+
$url .= '?' . http_build_query( $query_args );
|
265 |
+
}
|
266 |
+
|
267 |
+
wp_redirect( $url );
|
268 |
+
exit;
|
269 |
+
}
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Checks if current user is allowed to access the route.
|
273 |
+
*
|
274 |
+
* @codeCoverageIgnore
|
275 |
+
*
|
276 |
+
* @return bool True when current user has rights to manage options.
|
277 |
+
*/
|
278 |
+
protected function can_access_route() {
|
279 |
+
return WPSEO_Utils::has_access_token_support() && current_user_can( 'wpseo_manage_options' );
|
280 |
+
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Generates an unique user id.
|
284 |
+
*
|
285 |
+
* @codeCoverageIgnore
|
286 |
+
*
|
287 |
+
* @return string The generated unique user id.
|
288 |
+
*/
|
289 |
+
protected function generate_uuid() {
|
290 |
+
return wp_generate_uuid4();
|
291 |
+
}
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Retrieves the current user id.
|
295 |
+
*
|
296 |
+
* @codeCoverageIgnore
|
297 |
+
*
|
298 |
+
* @return int The user id.
|
299 |
+
*/
|
300 |
+
protected function get_current_user_id() {
|
301 |
+
return get_current_user_id();
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* Redirects to the premium page.
|
306 |
+
*
|
307 |
+
* @codeCoverageIgnore
|
308 |
+
*
|
309 |
+
* @return void
|
310 |
+
*/
|
311 |
+
protected function redirect_to_premium_page() {
|
312 |
+
wp_safe_redirect( admin_url( 'admin.php?page=wpseo_licenses' ) );
|
313 |
+
exit;
|
314 |
+
}
|
315 |
+
}
|
admin/class-option-tabs.php
CHANGED
@@ -112,7 +112,7 @@ class WPSEO_Option_Tabs {
|
|
112 |
/**
|
113 |
* Display the tabs
|
114 |
*
|
115 |
-
* @param Yoast_Form $yform
|
116 |
*/
|
117 |
public function display( Yoast_Form $yform ) {
|
118 |
$formatter = new WPSEO_Option_Tabs_Formatter();
|
112 |
/**
|
113 |
* Display the tabs
|
114 |
*
|
115 |
+
* @param Yoast_Form $yform Yoast Form needed in the views.
|
116 |
*/
|
117 |
public function display( Yoast_Form $yform ) {
|
118 |
$formatter = new WPSEO_Option_Tabs_Formatter();
|
admin/class-paper-presenter.php
CHANGED
@@ -11,17 +11,23 @@
|
|
11 |
class WPSEO_Paper_Presenter {
|
12 |
|
13 |
/**
|
14 |
-
*
|
|
|
|
|
15 |
*/
|
16 |
private $title;
|
17 |
|
18 |
/**
|
19 |
-
*
|
|
|
|
|
20 |
*/
|
21 |
private $settings;
|
22 |
|
23 |
/**
|
24 |
-
*
|
|
|
|
|
25 |
*/
|
26 |
private $view_file;
|
27 |
|
11 |
class WPSEO_Paper_Presenter {
|
12 |
|
13 |
/**
|
14 |
+
* Title of the paper.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
*/
|
18 |
private $title;
|
19 |
|
20 |
/**
|
21 |
+
* The view variables.
|
22 |
+
*
|
23 |
+
* @var array
|
24 |
*/
|
25 |
private $settings;
|
26 |
|
27 |
/**
|
28 |
+
* The path to the view file.
|
29 |
+
*
|
30 |
+
* @var string
|
31 |
*/
|
32 |
private $view_file;
|
33 |
|
admin/class-plugin-compatibility.php
CHANGED
@@ -28,7 +28,7 @@ class WPSEO_Plugin_Compatibility {
|
|
28 |
/**
|
29 |
* WPSEO_Plugin_Compatibility constructor.
|
30 |
*
|
31 |
-
* @param string $version
|
32 |
* @param null|class $availability_checker The checker to use.
|
33 |
*/
|
34 |
public function __construct( $version, $availability_checker = null ) {
|
28 |
/**
|
29 |
* WPSEO_Plugin_Compatibility constructor.
|
30 |
*
|
31 |
+
* @param string $version The version to check against.
|
32 |
* @param null|class $availability_checker The checker to use.
|
33 |
*/
|
34 |
public function __construct( $version, $availability_checker = null ) {
|
admin/class-social-admin.php
CHANGED
@@ -192,7 +192,7 @@ class WPSEO_Social_Admin extends WPSEO_Metabox {
|
|
192 |
/**
|
193 |
* Filter over the meta boxes to save, this function adds the Social meta boxes.
|
194 |
*
|
195 |
-
* @param
|
196 |
*
|
197 |
* @return array
|
198 |
*/
|
192 |
/**
|
193 |
* Filter over the meta boxes to save, this function adds the Social meta boxes.
|
194 |
*
|
195 |
+
* @param array $field_defs Array of metaboxes to save.
|
196 |
*
|
197 |
* @return array
|
198 |
*/
|
admin/class-suggested-plugins.php
CHANGED
@@ -24,7 +24,7 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
|
|
24 |
* WPSEO_Suggested_Plugins constructor.
|
25 |
*
|
26 |
* @param WPSEO_Plugin_Availability $availability_checker The availability checker to use.
|
27 |
-
* @param Yoast_Notification_Center $notification_center
|
28 |
*/
|
29 |
public function __construct( WPSEO_Plugin_Availability $availability_checker, Yoast_Notification_Center $notification_center ) {
|
30 |
$this->availability_checker = $availability_checker;
|
@@ -73,8 +73,8 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
|
|
73 |
/**
|
74 |
* Build Yoast SEO suggested plugins notification.
|
75 |
*
|
76 |
-
* @param string $name
|
77 |
-
* @param array $plugin
|
78 |
* @param string $dependency_name The name of the dependency.
|
79 |
*
|
80 |
* @return Yoast_Notification The notification containing the suggested plugin.
|
@@ -99,7 +99,7 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
|
|
99 |
/**
|
100 |
* Creates a message to suggest the installation of a particular plugin.
|
101 |
*
|
102 |
-
* @param array $suggested_plugin
|
103 |
* @param array $third_party_plugin The third party plugin that we have a suggested plugin for.
|
104 |
*
|
105 |
* @return string The install suggested plugin message.
|
@@ -121,7 +121,7 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
|
|
121 |
/**
|
122 |
* Creates a more information link that directs the user to WordPress.org Plugin repository.
|
123 |
*
|
124 |
-
* @param string $url
|
125 |
* @param string $name The name of the plugin.
|
126 |
*
|
127 |
* @return string The more information link.
|
@@ -139,7 +139,7 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
|
|
139 |
/**
|
140 |
* Creates a message to suggest the activation of a particular plugin.
|
141 |
*
|
142 |
-
* @param array $suggested_plugin
|
143 |
* @param array $third_party_plugin The third party plugin that we have a suggested plugin for.
|
144 |
*
|
145 |
* @return string The activate suggested plugin message.
|
24 |
* WPSEO_Suggested_Plugins constructor.
|
25 |
*
|
26 |
* @param WPSEO_Plugin_Availability $availability_checker The availability checker to use.
|
27 |
+
* @param Yoast_Notification_Center $notification_center The notification center to add notifications to.
|
28 |
*/
|
29 |
public function __construct( WPSEO_Plugin_Availability $availability_checker, Yoast_Notification_Center $notification_center ) {
|
30 |
$this->availability_checker = $availability_checker;
|
73 |
/**
|
74 |
* Build Yoast SEO suggested plugins notification.
|
75 |
*
|
76 |
+
* @param string $name The plugin name to use for the unique ID.
|
77 |
+
* @param array $plugin The plugin to retrieve the data from.
|
78 |
* @param string $dependency_name The name of the dependency.
|
79 |
*
|
80 |
* @return Yoast_Notification The notification containing the suggested plugin.
|
99 |
/**
|
100 |
* Creates a message to suggest the installation of a particular plugin.
|
101 |
*
|
102 |
+
* @param array $suggested_plugin The suggested plugin.
|
103 |
* @param array $third_party_plugin The third party plugin that we have a suggested plugin for.
|
104 |
*
|
105 |
* @return string The install suggested plugin message.
|
121 |
/**
|
122 |
* Creates a more information link that directs the user to WordPress.org Plugin repository.
|
123 |
*
|
124 |
+
* @param string $url The URL to the plugin's page.
|
125 |
* @param string $name The name of the plugin.
|
126 |
*
|
127 |
* @return string The more information link.
|
139 |
/**
|
140 |
* Creates a message to suggest the activation of a particular plugin.
|
141 |
*
|
142 |
+
* @param array $suggested_plugin The suggested plugin.
|
143 |
* @param array $third_party_plugin The third party plugin that we have a suggested plugin for.
|
144 |
*
|
145 |
* @return string The activate suggested plugin message.
|
admin/class-yoast-dashboard-widget.php
CHANGED
@@ -83,19 +83,6 @@ class Yoast_Dashboard_Widget {
|
|
83 |
echo '<div id="yoast-seo-dashboard-widget"></div>';
|
84 |
}
|
85 |
|
86 |
-
/**
|
87 |
-
* Enqueues stylesheet for the dashboard if the current page is the dashboard.
|
88 |
-
*/
|
89 |
-
public function enqueue_dashboard_stylesheets() {
|
90 |
-
_deprecated_function( __METHOD__, 'WPSEO 5.5', 'This method is deprecated, please use the <code>enqueue_dashboard_assets</code> method.' );
|
91 |
-
|
92 |
-
if ( ! $this->is_dashboard_screen() ) {
|
93 |
-
return;
|
94 |
-
}
|
95 |
-
|
96 |
-
$this->asset_manager->enqueue_style( 'wp-dashboard' );
|
97 |
-
}
|
98 |
-
|
99 |
/**
|
100 |
* Enqueues assets for the dashboard if the current page is the dashboard.
|
101 |
*/
|
83 |
echo '<div id="yoast-seo-dashboard-widget"></div>';
|
84 |
}
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
/**
|
87 |
* Enqueues assets for the dashboard if the current page is the dashboard.
|
88 |
*/
|
admin/class-yoast-form.php
CHANGED
@@ -13,7 +13,9 @@
|
|
13 |
class Yoast_Form {
|
14 |
|
15 |
/**
|
16 |
-
*
|
|
|
|
|
17 |
* @since 2.0
|
18 |
*/
|
19 |
public static $instance;
|
@@ -184,15 +186,10 @@ class Yoast_Form {
|
|
184 |
* @since 2.0
|
185 |
*/
|
186 |
public function admin_sidebar() {
|
187 |
-
|
188 |
// No banners in Premium.
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
if ( $extension_manager->is_activated( $product_premium->get_slug() ) ) {
|
194 |
-
return;
|
195 |
-
}
|
196 |
}
|
197 |
|
198 |
require_once 'views/sidebar.php';
|
@@ -288,11 +285,11 @@ class Yoast_Form {
|
|
288 |
*
|
289 |
* @since 3.1
|
290 |
*
|
291 |
-
* @param string
|
292 |
-
* @param string
|
293 |
-
* @param array
|
294 |
-
* @param
|
295 |
-
* @param string
|
296 |
*/
|
297 |
public function light_switch( $var, $label, $buttons = array(), $reverse = true, $help = '' ) {
|
298 |
|
@@ -350,12 +347,13 @@ class Yoast_Form {
|
|
350 |
);
|
351 |
}
|
352 |
|
353 |
-
$defaults
|
354 |
'placeholder' => '',
|
355 |
'class' => '',
|
356 |
);
|
357 |
-
$attr
|
358 |
-
$val
|
|
|
359 |
|
360 |
$this->label(
|
361 |
$label . ':',
|
@@ -364,7 +362,7 @@ class Yoast_Form {
|
|
364 |
'class' => 'textinput',
|
365 |
)
|
366 |
);
|
367 |
-
echo '<input class="textinput ' . esc_attr( $attr['class'] ) . ' " placeholder="' . esc_attr( $attr['placeholder'] ) . '" type="text" id="', esc_attr( $var ), '" name="', esc_attr( $this->option_name ), '[', esc_attr( $var ), ']" value="', esc_attr( $val ), '"', disabled( $this->is_control_disabled( $var ), true, false ), '/>', '<br class="clear" />';
|
368 |
}
|
369 |
|
370 |
/**
|
@@ -430,8 +428,9 @@ class Yoast_Form {
|
|
430 |
* @param string $var The variable within the option to create the select for.
|
431 |
* @param string $label The label to show for the variable.
|
432 |
* @param array $select_options The select options to choose from.
|
|
|
433 |
*/
|
434 |
-
public function select( $var, $label, array $select_options ) {
|
435 |
|
436 |
if ( empty( $select_options ) ) {
|
437 |
return;
|
@@ -445,16 +444,25 @@ class Yoast_Form {
|
|
445 |
)
|
446 |
);
|
447 |
|
448 |
-
$select_name
|
449 |
-
$active_option
|
|
|
|
|
450 |
|
451 |
$select = new Yoast_Input_Select( $var, $select_name, $select_options, $active_option );
|
452 |
$select->add_attribute( 'class', 'select' );
|
453 |
if ( $this->is_control_disabled( $var ) ) {
|
454 |
$select->add_attribute( 'disabled', 'disabled' );
|
455 |
}
|
456 |
-
$select->output_html();
|
457 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
echo '<br class="clear"/>';
|
459 |
}
|
460 |
|
@@ -669,9 +677,9 @@ class Yoast_Form {
|
|
669 |
/**
|
670 |
* Creates a toggle switch to define whether an indexable should be indexed or not.
|
671 |
*
|
672 |
-
* @param string $var
|
673 |
-
* @param string $label
|
674 |
-
* @param string $help
|
675 |
*
|
676 |
* @return void
|
677 |
*/
|
@@ -696,10 +704,10 @@ class Yoast_Form {
|
|
696 |
/**
|
697 |
* Creates a toggle switch to show hide certain options.
|
698 |
*
|
699 |
-
* @param string $var
|
700 |
-
* @param string $label
|
701 |
-
* @param bool $inverse_keys
|
702 |
-
* @param string $help
|
703 |
*
|
704 |
* @return void
|
705 |
*/
|
13 |
class Yoast_Form {
|
14 |
|
15 |
/**
|
16 |
+
* Instance of this class
|
17 |
+
*
|
18 |
+
* @var object
|
19 |
* @since 2.0
|
20 |
*/
|
21 |
public static $instance;
|
186 |
* @since 2.0
|
187 |
*/
|
188 |
public function admin_sidebar() {
|
|
|
189 |
// No banners in Premium.
|
190 |
+
$addon_manager = new WPSEO_Addon_Manager();
|
191 |
+
if ( $addon_manager->has_valid_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG ) && WPSEO_Utils::is_yoast_seo_premium() ) {
|
192 |
+
return;
|
|
|
|
|
|
|
|
|
193 |
}
|
194 |
|
195 |
require_once 'views/sidebar.php';
|
285 |
*
|
286 |
* @since 3.1
|
287 |
*
|
288 |
+
* @param string $var The variable within the option to create the checkbox for.
|
289 |
+
* @param string $label The label element text for the checkbox.
|
290 |
+
* @param array $buttons Array of two visual labels for the buttons (defaults Disabled/Enabled).
|
291 |
+
* @param bool $reverse Reverse order of buttons (default true).
|
292 |
+
* @param string $help Inline Help that will be printed out before the visible toggles text.
|
293 |
*/
|
294 |
public function light_switch( $var, $label, $buttons = array(), $reverse = true, $help = '' ) {
|
295 |
|
347 |
);
|
348 |
}
|
349 |
|
350 |
+
$defaults = array(
|
351 |
'placeholder' => '',
|
352 |
'class' => '',
|
353 |
);
|
354 |
+
$attr = wp_parse_args( $attr, $defaults );
|
355 |
+
$val = isset( $this->options[ $var ] ) ? $this->options[ $var ] : '';
|
356 |
+
$autocomplete = isset( $attr['autocomplete'] ) ? ' autocomplete="' . esc_attr( $attr['autocomplete'] ) . '"' : '';
|
357 |
|
358 |
$this->label(
|
359 |
$label . ':',
|
362 |
'class' => 'textinput',
|
363 |
)
|
364 |
);
|
365 |
+
echo '<input' . $autocomplete . ' class="textinput ' . esc_attr( $attr['class'] ) . ' " placeholder="' . esc_attr( $attr['placeholder'] ) . '" type="text" id="', esc_attr( $var ), '" name="', esc_attr( $this->option_name ), '[', esc_attr( $var ), ']" value="', esc_attr( $val ), '"', disabled( $this->is_control_disabled( $var ), true, false ), '/>', '<br class="clear" />';
|
366 |
}
|
367 |
|
368 |
/**
|
428 |
* @param string $var The variable within the option to create the select for.
|
429 |
* @param string $label The label to show for the variable.
|
430 |
* @param array $select_options The select options to choose from.
|
431 |
+
* @param string $styled The select style. Use 'styled' to get a styled select. Default 'unstyled'.
|
432 |
*/
|
433 |
+
public function select( $var, $label, array $select_options, $styled = 'unstyled' ) {
|
434 |
|
435 |
if ( empty( $select_options ) ) {
|
436 |
return;
|
444 |
)
|
445 |
);
|
446 |
|
447 |
+
$select_name = esc_attr( $this->option_name ) . '[' . esc_attr( $var ) . ']';
|
448 |
+
$active_option = ( isset( $this->options[ $var ] ) ) ? $this->options[ $var ] : '';
|
449 |
+
$wrapper_start_tag = '';
|
450 |
+
$wrapper_end_tag = '';
|
451 |
|
452 |
$select = new Yoast_Input_Select( $var, $select_name, $select_options, $active_option );
|
453 |
$select->add_attribute( 'class', 'select' );
|
454 |
if ( $this->is_control_disabled( $var ) ) {
|
455 |
$select->add_attribute( 'disabled', 'disabled' );
|
456 |
}
|
|
|
457 |
|
458 |
+
if ( $styled === 'styled' ) {
|
459 |
+
$wrapper_start_tag = '<span class="yoast-styled-select">';
|
460 |
+
$wrapper_end_tag = '</span>';
|
461 |
+
}
|
462 |
+
|
463 |
+
echo $wrapper_start_tag;
|
464 |
+
$select->output_html();
|
465 |
+
echo $wrapper_end_tag;
|
466 |
echo '<br class="clear"/>';
|
467 |
}
|
468 |
|
677 |
/**
|
678 |
* Creates a toggle switch to define whether an indexable should be indexed or not.
|
679 |
*
|
680 |
+
* @param string $var The variable within the option to create the radio buttons for.
|
681 |
+
* @param string $label The visual label for the radio buttons group, used as the fieldset legend.
|
682 |
+
* @param string $help Inline Help that will be printed out before the visible toggles text.
|
683 |
*
|
684 |
* @return void
|
685 |
*/
|
704 |
/**
|
705 |
* Creates a toggle switch to show hide certain options.
|
706 |
*
|
707 |
+
* @param string $var The variable within the option to create the radio buttons for.
|
708 |
+
* @param string $label The visual label for the radio buttons group, used as the fieldset legend.
|
709 |
+
* @param bool $inverse_keys Whether or not the option keys need to be inverted to support older functions.
|
710 |
+
* @param string $help Inline Help that will be printed out before the visible toggles text.
|
711 |
*
|
712 |
* @return void
|
713 |
*/
|
admin/class-yoast-notification-center.php
CHANGED
@@ -384,7 +384,7 @@ class Yoast_Notification_Center {
|
|
384 |
* Remove notification after it has been displayed
|
385 |
*
|
386 |
* @param Yoast_Notification $notification Notification to remove.
|
387 |
-
* @param bool $resolve
|
388 |
*/
|
389 |
public function remove_notification( Yoast_Notification $notification, $resolve = true ) {
|
390 |
|
384 |
* Remove notification after it has been displayed
|
385 |
*
|
386 |
* @param Yoast_Notification $notification Notification to remove.
|
387 |
+
* @param bool $resolve Resolve as fixed.
|
388 |
*/
|
389 |
public function remove_notification( Yoast_Notification $notification, $resolve = true ) {
|
390 |
|
admin/class-yoast-notification.php
CHANGED
@@ -47,6 +47,8 @@ class Yoast_Notification {
|
|
47 |
const UPDATED = 'updated';
|
48 |
|
49 |
/**
|
|
|
|
|
50 |
* Contains optional arguments:
|
51 |
*
|
52 |
* - type: The notification type, i.e. 'updated' or 'error'
|
@@ -58,11 +60,15 @@ class Yoast_Notification {
|
|
58 |
* - capability_check: How to check capability pass: all or any.
|
59 |
* - wpseo_page_only: Only display on wpseo page or on every page.
|
60 |
*
|
61 |
-
* @var array
|
62 |
*/
|
63 |
private $options = array();
|
64 |
|
65 |
-
/**
|
|
|
|
|
|
|
|
|
66 |
private $defaults = array(
|
67 |
'type' => self::UPDATED,
|
68 |
'id' => '',
|
47 |
const UPDATED = 'updated';
|
48 |
|
49 |
/**
|
50 |
+
* Options of this Notification.
|
51 |
+
*
|
52 |
* Contains optional arguments:
|
53 |
*
|
54 |
* - type: The notification type, i.e. 'updated' or 'error'
|
60 |
* - capability_check: How to check capability pass: all or any.
|
61 |
* - wpseo_page_only: Only display on wpseo page or on every page.
|
62 |
*
|
63 |
+
* @var array
|
64 |
*/
|
65 |
private $options = array();
|
66 |
|
67 |
+
/**
|
68 |
+
* Contains default values for the optional arguments.
|
69 |
+
*
|
70 |
+
* @var array
|
71 |
+
*/
|
72 |
private $defaults = array(
|
73 |
'type' => self::UPDATED,
|
74 |
'id' => '',
|
admin/class-yoast-plugin-conflict.php
CHANGED
@@ -45,7 +45,8 @@ class Yoast_Plugin_Conflict {
|
|
45 |
/**
|
46 |
* For the use of singleton pattern. Create instance of itself and return his instance
|
47 |
*
|
48 |
-
* @param string $class_name Give the classname to initialize. If classname is
|
|
|
49 |
*
|
50 |
* @return Yoast_Plugin_Conflict
|
51 |
*/
|
45 |
/**
|
46 |
* For the use of singleton pattern. Create instance of itself and return his instance
|
47 |
*
|
48 |
+
* @param string $class_name Give the classname to initialize. If classname is
|
49 |
+
* false (empty) it will use it's own __CLASS__.
|
50 |
*
|
51 |
* @return Yoast_Plugin_Conflict
|
52 |
*/
|
admin/config-ui/class-configuration-components.php
CHANGED
@@ -30,7 +30,6 @@ class WPSEO_Configuration_Components {
|
|
30 |
public function initialize() {
|
31 |
$this->add_component( new WPSEO_Config_Component_Connect_Google_Search_Console() );
|
32 |
$this->add_component( new WPSEO_Config_Component_Mailchimp_Signup() );
|
33 |
-
$this->add_component( new WPSEO_Config_Component_Configuration_Choices() );
|
34 |
$this->add_component( new WPSEO_Config_Component_Suggestions() );
|
35 |
}
|
36 |
|
30 |
public function initialize() {
|
31 |
$this->add_component( new WPSEO_Config_Component_Connect_Google_Search_Console() );
|
32 |
$this->add_component( new WPSEO_Config_Component_Mailchimp_Signup() );
|
|
|
33 |
$this->add_component( new WPSEO_Config_Component_Suggestions() );
|
34 |
}
|
35 |
|
admin/config-ui/class-configuration-page.php
CHANGED
@@ -16,7 +16,7 @@ class WPSEO_Configuration_Page {
|
|
16 |
const PAGE_IDENTIFIER = 'wpseo_configurator';
|
17 |
|
18 |
/**
|
19 |
-
* Sets the hooks when the user has
|
20 |
*/
|
21 |
public function set_hooks() {
|
22 |
if ( ! ( $this->is_config_page() && current_user_can( WPSEO_Configuration_Endpoint::CAPABILITY_RETRIEVE ) ) ) {
|
@@ -254,22 +254,4 @@ class WPSEO_Configuration_Page {
|
|
254 |
private function remove_notification_option() {
|
255 |
WPSEO_Options::set( 'show_onboarding_notice', false );
|
256 |
}
|
257 |
-
|
258 |
-
/* ********************* DEPRECATED METHODS ********************* */
|
259 |
-
|
260 |
-
/**
|
261 |
-
* Returns the translations necessary for the configuration wizard.
|
262 |
-
*
|
263 |
-
* @deprecated 4.9
|
264 |
-
* @codeCoverageIgnore
|
265 |
-
*
|
266 |
-
* @returns array The translations for the configuration wizard.
|
267 |
-
*/
|
268 |
-
public function get_translations() {
|
269 |
-
_deprecated_function( __METHOD__, 'WPSEO 4.9', 'WPSEO_' );
|
270 |
-
|
271 |
-
$translations = new WPSEO_Configuration_Translations( WPSEO_Language_Utils::get_user_locale() );
|
272 |
-
|
273 |
-
return $translations->retrieve();
|
274 |
-
}
|
275 |
}
|
16 |
const PAGE_IDENTIFIER = 'wpseo_configurator';
|
17 |
|
18 |
/**
|
19 |
+
* Sets the hooks when the user has enough rights and is on the right page.
|
20 |
*/
|
21 |
public function set_hooks() {
|
22 |
if ( ! ( $this->is_config_page() && current_user_can( WPSEO_Configuration_Endpoint::CAPABILITY_RETRIEVE ) ) ) {
|
254 |
private function remove_notification_option() {
|
255 |
WPSEO_Options::set( 'show_onboarding_notice', false );
|
256 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
}
|
admin/config-ui/class-configuration-storage.php
CHANGED
@@ -44,7 +44,7 @@ class WPSEO_Configuration_Storage {
|
|
44 |
new WPSEO_Config_Field_Profile_URL_MySpace(),
|
45 |
new WPSEO_Config_Field_Profile_URL_Pinterest(),
|
46 |
new WPSEO_Config_Field_Profile_URL_YouTube(),
|
47 |
-
new
|
48 |
new WPSEO_Config_Field_Company_Or_Person(),
|
49 |
new WPSEO_Config_Field_Company_Name(),
|
50 |
new WPSEO_Config_Field_Company_Logo(),
|
44 |
new WPSEO_Config_Field_Profile_URL_MySpace(),
|
45 |
new WPSEO_Config_Field_Profile_URL_Pinterest(),
|
46 |
new WPSEO_Config_Field_Profile_URL_YouTube(),
|
47 |
+
new WPSEO_Config_Field_Profile_URL_Wikipedia(),
|
48 |
new WPSEO_Config_Field_Company_Or_Person(),
|
49 |
new WPSEO_Config_Field_Company_Name(),
|
50 |
new WPSEO_Config_Field_Company_Logo(),
|
admin/config-ui/class-configuration-structure.php
CHANGED
@@ -26,7 +26,6 @@ class WPSEO_Configuration_Structure {
|
|
26 |
* @var array
|
27 |
*/
|
28 |
private $fields = array(
|
29 |
-
'intro' => array( 'configurationChoices' ),
|
30 |
'environment_type' => array( 'environment_type' ),
|
31 |
'siteType' => array( 'siteType' ),
|
32 |
'publishingEntity' => array(
|
@@ -45,7 +44,7 @@ class WPSEO_Configuration_Structure {
|
|
45 |
'profileUrlMySpace',
|
46 |
'profileUrlPinterest',
|
47 |
'profileUrlYouTube',
|
48 |
-
'
|
49 |
),
|
50 |
'multipleAuthors' => array( 'multipleAuthors' ),
|
51 |
'connectGoogleSearchConsole' => array(
|
@@ -66,8 +65,6 @@ class WPSEO_Configuration_Structure {
|
|
66 |
* WPSEO_Configuration_Structure constructor.
|
67 |
*/
|
68 |
public function initialize() {
|
69 |
-
$this->add_step( 'intro', __( 'Welcome!', 'wordpress-seo' ), $this->fields['intro'], false, true );
|
70 |
-
|
71 |
$this->add_step( 'environment-type', __( 'Environment', 'wordpress-seo' ), $this->fields['environment_type'] );
|
72 |
$this->add_step( 'site-type', __( 'Site type', 'wordpress-seo' ), $this->fields['siteType'] );
|
73 |
$this->add_step(
|
26 |
* @var array
|
27 |
*/
|
28 |
private $fields = array(
|
|
|
29 |
'environment_type' => array( 'environment_type' ),
|
30 |
'siteType' => array( 'siteType' ),
|
31 |
'publishingEntity' => array(
|
44 |
'profileUrlMySpace',
|
45 |
'profileUrlPinterest',
|
46 |
'profileUrlYouTube',
|
47 |
+
'profileUrlWikipedia',
|
48 |
),
|
49 |
'multipleAuthors' => array( 'multipleAuthors' ),
|
50 |
'connectGoogleSearchConsole' => array(
|
65 |
* WPSEO_Configuration_Structure constructor.
|
66 |
*/
|
67 |
public function initialize() {
|
|
|
|
|
68 |
$this->add_step( 'environment-type', __( 'Environment', 'wordpress-seo' ), $this->fields['environment_type'] );
|
69 |
$this->add_step( 'site-type', __( 'Site type', 'wordpress-seo' ), $this->fields['siteType'] );
|
70 |
$this->add_step(
|
admin/config-ui/components/class-component-configuration-choices.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WPSEO plugin file.
|
4 |
-
*
|
5 |
-
* @package WPSEO\Admin\ConfigurationUI
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Represents the configuration choices component.
|
10 |
-
*/
|
11 |
-
class WPSEO_Config_Component_Configuration_Choices implements WPSEO_Config_Component {
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Gets the component identifier.
|
15 |
-
*
|
16 |
-
* @return string
|
17 |
-
*/
|
18 |
-
public function get_identifier() {
|
19 |
-
return 'ConfigurationChoices';
|
20 |
-
}
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Gets the field.
|
24 |
-
*
|
25 |
-
* @return WPSEO_Config_Field
|
26 |
-
*/
|
27 |
-
public function get_field() {
|
28 |
-
/*
|
29 |
-
* Set up the configuration choices.
|
30 |
-
*/
|
31 |
-
|
32 |
-
/* translators: %s expands to 'Yoast SEO'. */
|
33 |
-
$label = __( 'Please choose the %s configuration of your liking:', 'wordpress-seo' );
|
34 |
-
$label = sprintf( $label, 'Yoast SEO' );
|
35 |
-
|
36 |
-
$field = new WPSEO_Config_Field_Configuration_Choices();
|
37 |
-
$field->set_property( 'label', $label );
|
38 |
-
|
39 |
-
/* translators: %s expands to 'Yoast SEO'. */
|
40 |
-
$title = __( 'Configure %s in a few steps', 'wordpress-seo' );
|
41 |
-
$title = sprintf( $title, 'Yoast SEO' );
|
42 |
-
|
43 |
-
/*
|
44 |
-
* Create first choice field.
|
45 |
-
*/
|
46 |
-
|
47 |
-
/* translators: %1$s expands to 'Yoast SEO'. */
|
48 |
-
$intro_text = __( 'Welcome to the %1$s configuration wizard. In a few simple steps we\'ll help you configure your SEO settings to match your website\'s needs! %1$s will take care of all the technical optimizations your site needs.', 'wordpress-seo' );
|
49 |
-
$intro_text = sprintf( $intro_text, 'Yoast SEO' );
|
50 |
-
|
51 |
-
/* translators: %s expands to 'Yoast SEO'. */
|
52 |
-
$button_text = sprintf( __( 'Configure %s', 'wordpress-seo' ), 'Yoast SEO' );
|
53 |
-
$button = array(
|
54 |
-
'type' => 'primary',
|
55 |
-
'label' => $button_text,
|
56 |
-
'action' => 'nextStep',
|
57 |
-
);
|
58 |
-
|
59 |
-
$field->add_choice(
|
60 |
-
$title,
|
61 |
-
$intro_text,
|
62 |
-
$button,
|
63 |
-
plugin_dir_url( WPSEO_FILE ) . '/images/Yoast_SEO_Icon.svg'
|
64 |
-
);
|
65 |
-
|
66 |
-
/*
|
67 |
-
* Create second choice field.
|
68 |
-
*/
|
69 |
-
|
70 |
-
/* translators: %s expands to 'Yoast SEO'. */
|
71 |
-
$title = __( 'Get the most out of the %s plugin', 'wordpress-seo' );
|
72 |
-
$title = sprintf( $title, 'Yoast SEO' );
|
73 |
-
|
74 |
-
/* translators: %1$s expands to 'Yoast SEO for WordPress', %2$s to Joost de Valk. */
|
75 |
-
$plugin_training_text = __( 'If you want to take full advantage of the plugin, get our %1$s training. Get insights from renowned SEO expert %2$s and the team behind the plugin. Actionable tips that\'ll help you configure your site to perform even better in search and for your visitors. Hours of video, sliced into bite-sized clips for you to learn from!', 'wordpress-seo' );
|
76 |
-
$plugin_training_text = sprintf( $plugin_training_text, 'Yoast SEO for WordPress', 'Joost de Valk' );
|
77 |
-
|
78 |
-
/* translators: %s expands to 'Yoast SEO'. */
|
79 |
-
$button_text = sprintf( __( 'Get the %s plugin training now', 'wordpress-seo' ), 'Yoast SEO' );
|
80 |
-
$button = array(
|
81 |
-
'type' => 'secondary',
|
82 |
-
'label' => $button_text,
|
83 |
-
'action' => 'followURL',
|
84 |
-
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/2vg' ),
|
85 |
-
);
|
86 |
-
|
87 |
-
$field->add_choice(
|
88 |
-
$title,
|
89 |
-
$plugin_training_text,
|
90 |
-
$button,
|
91 |
-
plugin_dir_url( WPSEO_FILE ) . 'images/yoast_seo_for_wp_2.svg'
|
92 |
-
);
|
93 |
-
|
94 |
-
return $field;
|
95 |
-
}
|
96 |
-
|
97 |
-
/**
|
98 |
-
* Get the data for the field.
|
99 |
-
*
|
100 |
-
* @return array
|
101 |
-
*/
|
102 |
-
public function get_data() {
|
103 |
-
return array();
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Save data
|
108 |
-
*
|
109 |
-
* @param array $data Data containing changes.
|
110 |
-
*
|
111 |
-
* @return bool
|
112 |
-
*/
|
113 |
-
public function set_data( $data ) {
|
114 |
-
return true;
|
115 |
-
}
|
116 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|