Skip to content

Commit 12d81ce

Browse files
committed
Merge branch 'feature/should-haves-for-inclusive-language' of github.com:Yoast/wordpress-seo into PC-965-yoast-markers-break-html-of-content
2 parents deef450 + b9a587f commit 12d81ce

292 files changed

Lines changed: 8055 additions & 7646 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ Another JavaScript alternative is `grunt webpack:watch`, this command will keep
6565

6666
This repository uses [the Yoast grunt tasks plugin](https://github.com/Yoast/plugin-grunt-tasks).
6767

68+
## Testing packages
69+
70+
To run tests for js packages, run the following command from `packages/js` folder:
71+
```bash
72+
yarn test
73+
```
6874
## Support
6975

7076
This is a developer's portal for Yoast SEO and should not be used for support. Please visit the

admin/ajax.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -317,20 +317,3 @@ function wpseo_register_ajax_integrations() {
317317
new WPSEO_Shortcode_Filter();
318318

319319
new WPSEO_Taxonomy_Columns();
320-
321-
/* ********************* DEPRECATED FUNCTIONS ********************* */
322-
323-
/**
324-
* Hides the default tagline notice for a specific user.
325-
*
326-
* @deprecated 13.2
327-
* @codeCoverageIgnore
328-
*/
329-
function wpseo_dismiss_tagline_notice() {
330-
if ( ! current_user_can( 'manage_options' ) ) {
331-
die( '-1' );
332-
}
333-
334-
_deprecated_function( __FUNCTION__, 'WPSEO 13.2', 'This method is deprecated.' );
335-
wpseo_ajax_json_echo_die( '' );
336-
}

admin/class-admin-init.php

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -320,68 +320,4 @@ public function add_publish_box_section( $post ) {
320320
do_action( 'wpseo_publishbox_misc_actions', $post );
321321
}
322322
}
323-
324-
/* ********************* DEPRECATED METHODS ********************* */
325-
326-
/**
327-
* Notify about the default tagline if the user hasn't changed it.
328-
*
329-
* @deprecated 13.2
330-
* @codeCoverageIgnore
331-
*/
332-
public function tagline_notice() {
333-
_deprecated_function( __METHOD__, 'WPSEO 13.2' );
334-
}
335-
336-
/**
337-
* Returns whether or not the site has the default tagline.
338-
*
339-
* @deprecated 13.2
340-
* @codeCoverageIgnore
341-
*
342-
* @return bool
343-
*/
344-
public function has_default_tagline() {
345-
_deprecated_function( __METHOD__, 'WPSEO 13.2' );
346-
347-
$blog_description = get_bloginfo( 'description' );
348-
$default_blog_description = 'Just another WordPress site';
349-
350-
// We are using the WordPress internal translation.
351-
$translated_blog_description = __( 'Just another WordPress site', 'default' );
352-
353-
return $translated_blog_description === $blog_description || $default_blog_description === $blog_description;
354-
}
355-
356-
/**
357-
* Shows an alert when the permalink doesn't contain %postname%.
358-
*
359-
* @deprecated 13.2
360-
* @codeCoverageIgnore
361-
*/
362-
public function permalink_notice() {
363-
_deprecated_function( __METHOD__, 'WPSEO 13.2' );
364-
}
365-
366-
/**
367-
* Add an alert if the blog is not publicly visible.
368-
*
369-
* @deprecated 14.1
370-
* @codeCoverageIgnore
371-
*/
372-
public function blog_public_notice() {
373-
_deprecated_function( __METHOD__, 'WPSEO 14.1' );
374-
}
375-
376-
/**
377-
* Handles the notifiers for the dashboard page.
378-
*
379-
* @deprecated 14.1
380-
* @codeCoverageIgnore
381-
*
382-
* @return void
383-
*/
384-
public function handle_notifications() {
385-
_deprecated_function( __METHOD__, 'WPSEO 14.1' );
386-
}
387323
}

admin/class-admin-user-profile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function process_user_option_update( $user_id ) {
7474
update_user_meta( $user_id, 'wpseo_noindex_author', $this->filter_input_post( 'wpseo_noindex_author' ) );
7575
update_user_meta( $user_id, 'wpseo_content_analysis_disable', $this->filter_input_post( 'wpseo_content_analysis_disable' ) );
7676
update_user_meta( $user_id, 'wpseo_keyword_analysis_disable', $this->filter_input_post( 'wpseo_keyword_analysis_disable' ) );
77+
update_user_meta( $user_id, 'wpseo_inclusive_language_analysis_disable', $this->filter_input_post( 'wpseo_inclusive_language_analysis_disable' ) );
7778
}
7879

7980
/**

admin/class-expose-shortlinks.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
2828
'shortlinks.nofollow_sponsored' => 'https://yoa.st/nofollow-sponsored',
2929
'shortlinks.snippet_preview_info' => 'https://yoa.st/snippet-preview',
3030
'shortlinks.cornerstone_content_info' => 'https://yoa.st/1i9',
31-
'shortlinks.upsell.social_previews' => 'https://yoa.st/social-preview-cta',
31+
'shortlinks.upsell.social_preview.facebook' => 'https://yoa.st/social-preview-facebook',
32+
'shortlinks.upsell.social_preview.twitter' => 'https://yoa.st/social-preview-twitter',
3233
'shortlinks.upsell.sidebar.news' => 'https://yoa.st/get-news-sidebar',
3334
'shortlinks.upsell.sidebar.focus_keyword_synonyms_link' => 'https://yoa.st/textlink-synonyms-popup-sidebar',
3435
'shortlinks.upsell.sidebar.focus_keyword_synonyms_button' => 'https://yoa.st/keyword-synonyms-popup-sidebar',
@@ -52,6 +53,7 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
5253
'shortlinks.upsell.metabox.word_complexity' => 'https://yoa.st/word-complexity-metabox',
5354
'shortlinks.upsell.gsc.create_redirect_button' => 'https://yoa.st/redirects',
5455
'shortlinks.readability_analysis_info' => 'https://yoa.st/readability-analysis',
56+
'shortlinks.inclusive_language_analysis_info' => 'https://yoa.st/inclusive-language-analysis',
5557
'shortlinks.activate_premium_info' => 'https://yoa.st/activate-subscription',
5658
'shortlinks.upsell.sidebar.morphology_upsell_metabox' => 'https://yoa.st/morphology-upsell-metabox',
5759
'shortlinks.upsell.sidebar.morphology_upsell_sidebar' => 'https://yoa.st/morphology-upsell-sidebar',

admin/class-gutenberg-compatibility.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
1515
*
1616
* @var string
1717
*/
18-
const CURRENT_RELEASE = '14.5.0';
18+
const CURRENT_RELEASE = '14.6.1';
1919

2020
/**
2121
* The minimally supported version of Gutenberg by the plugin.
2222
*
2323
* @var string
2424
*/
25-
const MINIMUM_SUPPORTED = '14.5.0';
25+
const MINIMUM_SUPPORTED = '14.6.1';
2626

2727
/**
2828
* Holds the current version.

admin/class-meta-columns.php

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ protected function get_keyword_filter( $keyword_filter ) {
356356
*
357357
* @param mixed $filter The filter to check against.
358358
*
359-
* @return bool Whether or not the filter is considered valid.
359+
* @return bool Whether the filter is considered valid.
360360
*/
361361
protected function is_valid_filter( $filter ) {
362362
return ! empty( $filter ) && is_string( $filter );
@@ -453,37 +453,57 @@ protected function determine_score_filters( $score_filters ) {
453453
/**
454454
* Retrieves the post type from the $_GET variable.
455455
*
456-
* @return string The current post type.
456+
* @return string|null The sanitized current post type or null when the variable is not set in $_GET.
457457
*/
458458
public function get_current_post_type() {
459-
return filter_input( INPUT_GET, 'post_type' );
459+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
460+
if ( isset( $_GET['post_type'] ) && is_string( $_GET['post_type'] ) ) {
461+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
462+
return sanitize_text_field( wp_unslash( $_GET['post_type'] ) );
463+
}
464+
return null;
460465
}
461466

462467
/**
463468
* Retrieves the SEO filter from the $_GET variable.
464469
*
465-
* @return string The current post type.
470+
* @return string|null The sanitized seo filter or null when the variable is not set in $_GET.
466471
*/
467472
public function get_current_seo_filter() {
468-
return filter_input( INPUT_GET, 'seo_filter' );
473+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
474+
if ( isset( $_GET['seo_filter'] ) && is_string( $_GET['seo_filter'] ) ) {
475+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
476+
return sanitize_text_field( wp_unslash( $_GET['seo_filter'] ) );
477+
}
478+
return null;
469479
}
470480

471481
/**
472482
* Retrieves the Readability filter from the $_GET variable.
473483
*
474-
* @return string The current post type.
484+
* @return string|null The sanitized readability filter or null when the variable is not set in $_GET.
475485
*/
476486
public function get_current_readability_filter() {
477-
return filter_input( INPUT_GET, 'readability_filter' );
487+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
488+
if ( isset( $_GET['readability_filter'] ) && is_string( $_GET['readability_filter'] ) ) {
489+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
490+
return sanitize_text_field( wp_unslash( $_GET['readability_filter'] ) );
491+
}
492+
return null;
478493
}
479494

480495
/**
481496
* Retrieves the keyword filter from the $_GET variable.
482497
*
483-
* @return string The current post type.
498+
* @return string|null The sanitized seo keyword filter or null when the variable is not set in $_GET.
484499
*/
485500
public function get_current_keyword_filter() {
486-
return filter_input( INPUT_GET, 'seo_kw_filter' );
501+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
502+
if ( isset( $_GET['seo_kw_filter'] ) && is_string( $_GET['seo_kw_filter'] ) ) {
503+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
504+
return sanitize_text_field( wp_unslash( $_GET['seo_kw_filter'] ) );
505+
}
506+
return null;
487507
}
488508

489509
/**
@@ -720,7 +740,7 @@ private function set_post_type_hooks() {
720740
* @return bool Whether or not the meta box (and associated columns etc) should be hidden.
721741
*/
722742
private function display_metabox( $post_type = null ) {
723-
$current_post_type = sanitize_text_field( $this->get_current_post_type() );
743+
$current_post_type = $this->get_current_post_type();
724744

725745
if ( ! isset( $post_type ) && ! empty( $current_post_type ) ) {
726746
$post_type = $current_post_type;

admin/class-yoast-notifications.php

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,6 @@ public function enqueue_assets() {
108108
}
109109
}
110110

111-
/**
112-
* Deprecated: Handle ajax request to dismiss a alert.
113-
* Renamed to ajax_dismiss_notification
114-
*
115-
* @deprecated 14.0
116-
*
117-
* @codeCoverageIgnore
118-
*/
119-
public function ajax_dismiss_alert() {
120-
_deprecated_function( __METHOD__, 'WPSEO 14.0' );
121-
}
122-
123111
/**
124112
* Handle ajax request to dismiss a notification.
125113
*/
@@ -136,19 +124,6 @@ public function ajax_dismiss_notification() {
136124
wp_die();
137125
}
138126

139-
/**
140-
* Deprecated: Handle ajax request to restore a notification.
141-
* Renamed to ajax_restore_notification
142-
*
143-
* @deprecated 14.0
144-
* @codeCoverageIgnore
145-
*
146-
* @return void
147-
*/
148-
public function ajax_restore_alert() {
149-
_deprecated_function( __METHOD__, 'WPSEO 14.0' );
150-
}
151-
152127
/**
153128
* Handle ajax request to restore a notification.
154129
*/
@@ -277,20 +252,6 @@ public static function get_template_variables() {
277252
];
278253
}
279254

280-
/**
281-
* Deprecated: Get the number of active notifications.
282-
* Renamed to get_active_notification_count
283-
*
284-
* @deprecated 14.0
285-
* @codeCoverageIgnore
286-
*
287-
* @return int
288-
*/
289-
public function get_active_alert_count() {
290-
_deprecated_function( __METHOD__, 'WPSEO 14.0' );
291-
return 0;
292-
}
293-
294255
/**
295256
* Get the number of active notifications.
296257
*
@@ -301,20 +262,6 @@ public static function get_active_notification_count() {
301262
return ( count( self::$active_errors ) + count( self::$active_warnings ) );
302263
}
303264

304-
/**
305-
* Deprecated: Filter out any non-errors. Renamed to filter_error_notifications
306-
*
307-
* @deprecated 14.0
308-
* @codeCoverageIgnore
309-
*
310-
* @param Yoast_Notification $notification Notification to test.
311-
* @return bool
312-
*/
313-
public function filter_error_alerts( Yoast_Notification $notification ) {
314-
_deprecated_function( __METHOD__, 'WPSEO 14.0' );
315-
return false;
316-
}
317-
318265
/**
319266
* Filter out any non-errors.
320267
*
@@ -327,20 +274,6 @@ private static function filter_error_notifications( Yoast_Notification $notifica
327274
return $notification->get_type() === 'error';
328275
}
329276

330-
/**
331-
* Deprecated: Filter out any non-warnings. Renamed to filter_warning_notifications
332-
*
333-
* @deprecated 14.0
334-
* @codeCoverageIgnore
335-
*
336-
* @param Yoast_Notification $notification Notification to test.
337-
* @return bool
338-
*/
339-
public function filter_warning_alerts( Yoast_Notification $notification ) {
340-
_deprecated_function( __METHOD__, 'WPSEO 14.0' );
341-
return false;
342-
}
343-
344277
/**
345278
* Filter out any non-warnings.
346279
*
@@ -353,20 +286,6 @@ private static function filter_warning_notifications( Yoast_Notification $notifi
353286
return $notification->get_type() !== 'error';
354287
}
355288

356-
/**
357-
* Deprecated: Filter out any dismissed notifications. Renamed to filter_dismissed_alerts.
358-
*
359-
* @deprecated 14.0
360-
* @codeCoverageIgnore
361-
*
362-
* @param Yoast_Notification $notification Notification to test.
363-
* @return bool
364-
*/
365-
public function filter_dismissed_alerts( Yoast_Notification $notification ) {
366-
_deprecated_function( __METHOD__, 'WPSEO 14.0' );
367-
return false;
368-
}
369-
370289
/**
371290
* Filter out any dismissed notifications.
372291
*

admin/class-yoast-plugin-conflict.php

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -111,41 +111,6 @@ public function check_for_conflicts( $plugin_section ) {
111111
return false;
112112
}
113113

114-
/**
115-
* Getting all the conflicting plugins and return them as a string.
116-
*
117-
* This method will loop through all conflicting plugins to get the details of each plugin. The plugin name
118-
* will be taken from the details to parse a comma separated string, which can be use for by example a notice
119-
*
120-
* @deprecated 17.7 This method is unused and will be removed in the future
121-
* @codeCoverageIgnore
122-
*
123-
* @param string $plugin_section Plugin conflict type (such as Open Graph or sitemap).
124-
*
125-
* @return string
126-
*/
127-
public function get_conflicting_plugins_as_string( $plugin_section ) {
128-
if ( ! \function_exists( 'get_plugin_data' ) ) {
129-
require_once ABSPATH . 'wp-admin/includes/plugin.php';
130-
}
131-
132-
// Getting the active plugins by given section.
133-
$plugins = $this->active_conflicting_plugins[ $plugin_section ];
134-
135-
$plugin_names = [];
136-
foreach ( $plugins as $plugin ) {
137-
$name = $this->get_plugin_name( $plugin );
138-
if ( ! empty( $name ) ) {
139-
$plugin_names[] = '<em>' . $name . '</em>';
140-
}
141-
}
142-
unset( $plugins, $plugin );
143-
144-
if ( ! empty( $plugin_names ) ) {
145-
return \implode( ' &amp; ', $plugin_names );
146-
}
147-
}
148-
149114
/**
150115
* Checks for given $plugin_sections for conflicts.
151116
*

0 commit comments

Comments
 (0)