PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.5
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | wp-seo-main.php +109 -162 18.828.5 View file →
@@ -4,11 +4,8 @@
4 4 *
5 5 * @package WPSEO\Main
6 6 */
7 7
8 -use Yoast\WP\SEO\Helpers\Options_Helper;
9 -use Yoast\WP\SEO\Integrations\Admin\Ryte_Integration;
10 -
11 8 if ( ! function_exists( 'add_filter' ) ) {
12 9 header( 'Status: 403 Forbidden' );
13 10 header( 'HTTP/1.1 403 Forbidden' );
14 11 exit();
@@ -17,9 +14,9 @@
17 14 /**
18 15 * {@internal Nobody should be able to overrule the real version number as this can cause
19 16 * serious issues with the options, so no if ( ! defined() ).}}
20 17 */
21 -define( 'WPSEO_VERSION', '18.8' );
18 +define( 'WPSEO_VERSION', '28.5' );
22 19
23 20
24 21 if ( ! defined( 'WPSEO_PATH' ) ) {
25 22 define( 'WPSEO_PATH', plugin_dir_path( WPSEO_FILE ) );
@@ -36,11 +33,11 @@
36 33 define( 'YOAST_VENDOR_NS_PREFIX', 'YoastSEO_Vendor' );
37 34 define( 'YOAST_VENDOR_DEFINE_PREFIX', 'YOASTSEO_VENDOR__' );
38 35 define( 'YOAST_VENDOR_PREFIX_DIRECTORY', 'vendor_prefixed' );
39 36
40 -define( 'YOAST_SEO_PHP_REQUIRED', '5.6' );
41 -define( 'YOAST_SEO_WP_TESTED', '5.9.3' );
42 -define( 'YOAST_SEO_WP_REQUIRED', '5.6' );
37 +define( 'YOAST_SEO_PHP_REQUIRED', '7.4' );
38 +define( 'YOAST_SEO_WP_TESTED', '7.1' );
39 +define( 'YOAST_SEO_WP_REQUIRED', '6.9' );
43 40
44 41 if ( ! defined( 'WPSEO_NAMESPACES' ) ) {
45 42 define( 'WPSEO_NAMESPACES', true );
46 43 }
@@ -57,14 +54,12 @@
57 54 */
58 55 function wpseo_auto_load( $class_name ) {
59 56 static $classes = null;
60 57
61 - if ( $classes === null ) {
62 - $classes = [
63 - 'wp_list_table' => ABSPATH . 'wp-admin/includes/class-wp-list-table.php',
64 - 'walker_category' => ABSPATH . 'wp-includes/category-template.php',
65 - ];
66 - }
58 + $classes ??= [
59 + 'wp_list_table' => ABSPATH . 'wp-admin/includes/class-wp-list-table.php',
60 + 'walker_category' => ABSPATH . 'wp-includes/category-template.php',
61 + ];
67 62
68 63 $cn = strtolower( $class_name );
69 64
70 65 if ( ! class_exists( $class_name ) && isset( $classes[ $cn ] ) ) {
@@ -82,8 +77,19 @@
82 77
83 78 return;
84 79 }
85 80
81 +/**
82 + * Include the file from the `symfony/deprecation-contracts` dependency instead of autoloading it via composer.
83 + *
84 + * We need to do that because autoloading via composer prevents the vendor-prefixing of the dependency itself.
85 + * Note that we don't expect the function to be ever called since the OAuth2 library should not provide invalid input.
86 + */
87 +$deprecation_contracts_file = WPSEO_PATH . 'vendor_prefixed/symfony/deprecation-contracts/functions.php';
88 +if ( is_readable( $deprecation_contracts_file ) ) {
89 + include $deprecation_contracts_file;
90 +}
91 +
86 92 if ( function_exists( 'spl_autoload_register' ) ) {
87 93 spl_autoload_register( 'wpseo_auto_load' );
88 94 }
89 95 require_once WPSEO_PATH . 'src/functions.php';
@@ -107,13 +113,13 @@
107 113 * As this is only loaded in development removing this action is not a concern.
108 114 *
109 115 * @return void
110 116 */
111 - static function() use ( $yoast_autoloader ) {
117 + static function () use ( $yoast_autoloader ) {
112 118 $yoast_autoloader->unregister();
113 119 $yoast_autoloader->register( true );
114 120 },
115 - 1
121 + 1,
116 122 );
117 123 }
118 124
119 125 /**
@@ -128,8 +134,10 @@
128 134 /**
129 135 * Run single site / network-wide activation of the plugin.
130 136 *
131 137 * @param bool $networkwide Whether the plugin is being activated network-wide.
138 + *
139 + * @return void
132 140 */
133 141 function wpseo_activate( $networkwide = false ) {
134 142 if ( ! is_multisite() || ! $networkwide ) {
135 143 _wpseo_activate();
@@ -146,8 +154,10 @@
146 154 /**
147 155 * Run single site / network-wide de-activation of the plugin.
148 156 *
149 157 * @param bool $networkwide Whether the plugin is being de-activated network-wide.
158 + *
159 + * @return void
150 160 */
151 161 function wpseo_deactivate( $networkwide = false ) {
152 162 if ( ! is_multisite() || ! $networkwide ) {
153 163 _wpseo_deactivate();
@@ -161,8 +171,10 @@
161 171 /**
162 172 * Run network-wide (de-)activation of the plugin.
163 173 *
164 174 * @param bool $activate True for plugin activation, false for de-activation.
175 + *
176 + * @return void
165 177 */
166 178 function wpseo_network_activate_deactivate( $activate = true ) {
167 179 global $wpdb;
168 180
@@ -185,15 +197,15 @@
185 197 }
186 198
187 199 /**
188 200 * Runs on activation of the plugin.
201 + *
202 + * @return void
189 203 */
190 204 function _wpseo_activate() {
191 205 require_once WPSEO_PATH . 'inc/wpseo-functions.php';
192 206 require_once WPSEO_PATH . 'inc/class-wpseo-installation.php';
193 207
194 - wpseo_load_textdomain(); // Make sure we have our translations available for the defaults.
195 -
196 208 new WPSEO_Installation();
197 209
198 210 WPSEO_Options::get_instance();
199 211 if ( ! is_multisite() ) {
@@ -203,24 +215,14 @@
203 215 WPSEO_Options::maybe_set_multisite_defaults( true );
204 216 }
205 217 WPSEO_Options::ensure_options_exist();
206 218
207 - if ( is_multisite() && ms_is_switched() ) {
208 - delete_option( 'rewrite_rules' );
219 + if ( ! is_multisite() || ! ms_is_switched() ) {
220 + // Constructor has side effects so this registers all hooks.
221 + $GLOBALS['wpseo_rewrite'] = new WPSEO_Rewrite();
209 222 }
210 - else {
211 - if ( WPSEO_Options::get( 'stripcategorybase' ) === true ) {
212 - // Constructor has side effects so this registers all hooks.
213 - $GLOBALS['wpseo_rewrite'] = new WPSEO_Rewrite();
214 - }
215 - add_action( 'shutdown', 'flush_rewrite_rules' );
216 - }
223 + add_action( 'shutdown', [ 'WPSEO_Utils', 'clear_rewrites' ] );
217 224
218 - // Reset tracking to be disabled by default.
219 - if ( ! YoastSEO()->helpers->product->is_premium() ) {
220 - WPSEO_Options::set( 'tracking', false );
221 - }
222 -
223 225 WPSEO_Options::set( 'indexing_reason', 'first_install' );
224 226 WPSEO_Options::set( 'first_time_install', true );
225 227 if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) {
226 228 WPSEO_Options::set( 'should_redirect_after_install_free', true );
@@ -225,11 +227,15 @@
225 227 if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) {
226 228 WPSEO_Options::set( 'should_redirect_after_install_free', true );
227 229 }
228 230 else {
229 - WPSEO_Options::set( 'activation_redirect_timestamp_free', \time() );
231 + WPSEO_Options::set( 'activation_redirect_timestamp_free', time() );
230 232 }
231 233
234 + // Reset tracking to be disabled by default.
235 + if ( ! YoastSEO()->helpers->product->is_premium() && WPSEO_Options::get( 'toggled_tracking' ) !== true ) {
236 + WPSEO_Options::set( 'tracking', false );
237 + }
232 238 do_action( 'wpseo_register_roles' );
233 239 WPSEO_Role_Manager_Factory::get()->add();
234 240
235 241 do_action( 'wpseo_register_capabilities' );
@@ -237,27 +243,20 @@
237 243
238 244 // Clear cache so the changes are obvious.
239 245 WPSEO_Utils::clear_cache();
240 246
241 - // Schedule cronjob when it doesn't exists on activation.
242 - $wpseo_ryte = YoastSEO()->classes->get( Ryte_Integration::class );
243 - $wpseo_ryte->activate_hooks();
244 -
245 247 do_action( 'wpseo_activate' );
246 248 }
247 249
248 250 /**
249 251 * On deactivation, flush the rewrite rules so XML sitemaps stop working.
252 + *
253 + * @return void
250 254 */
251 255 function _wpseo_deactivate() {
252 256 require_once WPSEO_PATH . 'inc/wpseo-functions.php';
253 257
254 - if ( is_multisite() && ms_is_switched() ) {
255 - delete_option( 'rewrite_rules' );
256 - }
257 - else {
258 - add_action( 'shutdown', 'flush_rewrite_rules' );
259 - }
258 + add_action( 'shutdown', [ 'WPSEO_Utils', 'clear_rewrites' ] );
260 259
261 260 // Register capabilities, to make sure they are cleaned up.
262 261 do_action( 'wpseo_register_roles' );
263 262 do_action( 'wpseo_register_capabilities' );
@@ -281,8 +280,10 @@
281 280 * {@internal Unfortunately will fail if the plugin is in the must-use directory.
282 281 * {@link https://core.trac.wordpress.org/ticket/24205} }}
283 282 *
284 283 * @param int|WP_Site $blog_id Blog ID.
284 + *
285 + * @return void
285 286 */
286 287 function wpseo_on_activate_blog( $blog_id ) {
287 288 if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
288 289 require_once ABSPATH . 'wp-admin/includes/plugin.php';
@@ -300,28 +301,24 @@
300 301 }
301 302
302 303 /* ***************************** PLUGIN LOADING *************************** */
303 304
305 +
304 306 /**
305 307 * Load translations.
308 + *
309 + * @deprecated 27.0
310 + * @codeCoverageIgnore
311 + *
312 + * @return void
306 313 */
307 314 function wpseo_load_textdomain() {
308 - $wpseo_path = str_replace( '\\', '/', WPSEO_PATH );
309 - $mu_path = str_replace( '\\', '/', WPMU_PLUGIN_DIR );
310 -
311 - if ( stripos( $wpseo_path, $mu_path ) !== false ) {
312 - load_muplugin_textdomain( 'wordpress-seo', dirname( WPSEO_BASENAME ) . '/languages/' );
313 - }
314 - else {
315 - load_plugin_textdomain( 'wordpress-seo', false, dirname( WPSEO_BASENAME ) . '/languages/' );
316 - }
315 + _deprecated_function( __FUNCTION__, 'Yoast SEO 27.0' );
317 316 }
318 -
319 -add_action( 'plugins_loaded', 'wpseo_load_textdomain' );
320 -
321 -
322 317 /**
323 318 * On plugins_loaded: load the minimum amount of essential files for this plugin.
319 + *
320 + * @return void
324 321 */
325 322 function wpseo_init() {
326 323 require_once WPSEO_PATH . 'inc/wpseo-functions.php';
327 324 require_once WPSEO_PATH . 'inc/wpseo-functions-deprecated.php';
@@ -329,10 +326,24 @@
329 326 // Make sure our option and meta value validation routines and default values are always registered and available.
330 327 WPSEO_Options::get_instance();
331 328 WPSEO_Meta::init();
332 329
333 - if ( version_compare( WPSEO_Options::get( 'version', 1 ), WPSEO_VERSION, '<' ) ) {
334 - if ( function_exists( 'opcache_reset' ) ) {
330 + if ( version_compare( WPSEO_Options::get( 'version', 1, [ 'wpseo' ] ), WPSEO_VERSION, '<' ) ) {
331 + // Invalidate the opcache in 50% of the cases, randomly staggered based on the site URL.
332 + // @TODO: Move the staggering logic to its own class, but only after a few releases after the complete sunset of the opcache invalidation. Make sure to document that in the future, maybe `12` should be used as modulus, so that it's easier to tinker the percentage (divisible by 2, 3, 4, 6). (see the technical choices of https://github.com/Yoast/wordpress-seo/pull/22812).
333 + $random_seed = hexdec( substr( hash( 'sha256', site_url() ), 0, 8 ) );
334 + $should_invalidate_opcache = ( $random_seed % 2 ) !== 0;
335 +
336 + /**
337 + * Filter: 'Yoast\WP\SEO\should_invalidate_opcache' - Allow developers to enable / disable
338 + * opcache invalidation upon upgrade of the Yoast SEO plugin.
339 + *
340 + * @since 26.1
341 + *
342 + * @param bool $should_invalidate Whether opcache should be invalidated.
343 + */
344 + $should_invalidate_opcache = (bool) apply_filters( 'Yoast\WP\SEO\should_invalidate_opcache', $should_invalidate_opcache );
345 + if ( $should_invalidate_opcache && function_exists( 'opcache_reset' ) ) {
335 346 // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- Prevent notices when opcache.restrict_api is set.
336 347 @opcache_reset();
337 348 }
338 349
@@ -339,13 +350,11 @@
339 350 new WPSEO_Upgrade();
340 351 // Get a cleaned up version of the $options.
341 352 }
342 353
343 - if ( WPSEO_Options::get( 'stripcategorybase' ) === true ) {
344 - $GLOBALS['wpseo_rewrite'] = new WPSEO_Rewrite();
345 - }
354 + $GLOBALS['wpseo_rewrite'] = new WPSEO_Rewrite();
346 355
347 - if ( WPSEO_Options::get( 'enable_xml_sitemap' ) === true ) {
356 + if ( WPSEO_Options::get( 'enable_xml_sitemap', null, [ 'wpseo' ] ) === true ) {
348 357 $GLOBALS['wpseo_sitemaps'] = new WPSEO_Sitemaps();
349 358 }
350 359
351 360 if ( ! wp_doing_ajax() ) {
@@ -351,11 +360,8 @@
351 360 if ( ! wp_doing_ajax() ) {
352 361 require_once WPSEO_PATH . 'inc/wpseo-non-ajax-functions.php';
353 362 }
354 363
355 - // Init it here because the filter must be present on the frontend as well or it won't work in the customizer.
356 - new WPSEO_Customizer();
357 -
358 364 $integrations = [];
359 365 $integrations[] = new WPSEO_Slug_Change_Watcher();
360 366
361 367 foreach ( $integrations as $integration ) {
@@ -364,8 +370,10 @@
364 370 }
365 371
366 372 /**
367 373 * Loads the rest api endpoints.
374 + *
375 + * @return void
368 376 */
369 377 function wpseo_init_rest_api() {
370 378 // We can't do anything when requirements are not met.
371 379 if ( ! WPSEO_Utils::is_api_available() ) {
@@ -385,74 +393,25 @@
385 393 }
386 394
387 395 /**
388 396 * Used to load the required files on the plugins_loaded hook, instead of immediately.
397 + *
398 + * @return void
389 399 */
390 400 function wpseo_admin_init() {
391 401 new WPSEO_Admin_Init();
392 402 }
393 403
394 -/**
395 - * Initialize the WP-CLI integration.
396 - *
397 - * The WP-CLI integration needs PHP 5.3 support, which should be automatically
398 - * enforced by the check for the WP_CLI constant. As WP-CLI itself only runs
399 - * on PHP 5.3+, the constant should only be set when requirements are met.
400 - */
401 -function wpseo_cli_init() {
402 - if ( YoastSEO()->helpers->product->is_premium() ) {
403 - WP_CLI::add_command(
404 - 'yoast redirect list',
405 - 'WPSEO_CLI_Redirect_List_Command',
406 - [ 'before_invoke' => 'WPSEO_CLI_Premium_Requirement::enforce' ]
407 - );
408 -
409 - WP_CLI::add_command(
410 - 'yoast redirect create',
411 - 'WPSEO_CLI_Redirect_Create_Command',
412 - [ 'before_invoke' => 'WPSEO_CLI_Premium_Requirement::enforce' ]
413 - );
414 -
415 - WP_CLI::add_command(
416 - 'yoast redirect update',
417 - 'WPSEO_CLI_Redirect_Update_Command',
418 - [ 'before_invoke' => 'WPSEO_CLI_Premium_Requirement::enforce' ]
419 - );
420 -
421 - WP_CLI::add_command(
422 - 'yoast redirect delete',
423 - 'WPSEO_CLI_Redirect_Delete_Command',
424 - [ 'before_invoke' => 'WPSEO_CLI_Premium_Requirement::enforce' ]
425 - );
426 -
427 - WP_CLI::add_command(
428 - 'yoast redirect has',
429 - 'WPSEO_CLI_Redirect_Has_Command',
430 - [ 'before_invoke' => 'WPSEO_CLI_Premium_Requirement::enforce' ]
431 - );
432 -
433 - WP_CLI::add_command(
434 - 'yoast redirect follow',
435 - 'WPSEO_CLI_Redirect_Follow_Command',
436 - [ 'before_invoke' => 'WPSEO_CLI_Premium_Requirement::enforce' ]
437 - );
438 - }
439 -}
440 -
441 404 /* ***************************** BOOTSTRAP / HOOK INTO WP *************************** */
442 405 $spl_autoload_exists = function_exists( 'spl_autoload_register' );
443 -$filter_exists = function_exists( 'filter_input' );
444 406
445 407 if ( ! $spl_autoload_exists ) {
446 408 add_action( 'admin_init', 'yoast_wpseo_missing_spl', 1 );
447 409 }
448 410
449 -if ( ! $filter_exists ) {
450 - add_action( 'admin_init', 'yoast_wpseo_missing_filter', 1 );
451 -}
452 -
453 -if ( ! wp_installing() && ( $spl_autoload_exists && $filter_exists ) ) {
411 +if ( ! wp_installing() && ( $spl_autoload_exists ) ) {
454 412 add_action( 'plugins_loaded', 'wpseo_init', 14 );
413 + add_action( 'setup_theme', [ 'Yoast_Dynamic_Rewrites', 'instance' ], 1 );
455 414 add_action( 'rest_api_init', 'wpseo_init_rest_api' );
456 415
457 416 if ( is_admin() ) {
458 417
@@ -466,10 +425,14 @@
466 425
467 426 // Plugin conflict ajax hooks.
468 427 new Yoast_Plugin_Conflict_Ajax();
469 428
470 - if ( filter_input( INPUT_POST, 'action' ) === 'inline-save' ) {
471 - add_action( 'plugins_loaded', 'wpseo_admin_init', 15 );
429 + // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: We are not processing form information but only loading the admin init class.
430 + if ( isset( $_POST['action'] ) && is_string( $_POST['action'] ) ) {
431 + // phpcs:ignore WordPress.Security.NonceVerification.Missing,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information but only loading the admin init class, We are strictly comparing only.
432 + if ( wp_unslash( $_POST['action'] ) === 'inline-save' ) {
433 + add_action( 'plugins_loaded', 'wpseo_admin_init', 15 );
434 + }
472 435 }
473 436 }
474 437 else {
475 438 add_action( 'plugins_loaded', 'wpseo_admin_init', 15 );
@@ -477,12 +440,8 @@
477 440 }
478 441
479 442 add_action( 'plugins_loaded', 'load_yoast_notifications' );
480 443
481 - if ( defined( 'WP_CLI' ) && WP_CLI ) {
482 - add_action( 'plugins_loaded', 'wpseo_cli_init', 20 );
483 - }
484 -
485 444 add_action( 'init', [ 'WPSEO_Replace_Vars', 'setup_statics_once' ] );
486 445
487 446 // Initializes the Yoast indexables for the first time.
488 447 YoastSEO();
@@ -496,17 +455,9 @@
496 455 // Activation and deactivation hook.
497 456 register_activation_hook( WPSEO_FILE, 'wpseo_activate' );
498 457 register_deactivation_hook( WPSEO_FILE, 'wpseo_deactivate' );
499 458
500 -// Wpmu_new_blog has been deprecated in 5.1 and replaced by wp_insert_site.
501 -global $wp_version;
502 -if ( version_compare( $wp_version, '5.1', '<' ) ) {
503 - add_action( 'wpmu_new_blog', 'wpseo_on_activate_blog' );
504 -}
505 -else {
506 - add_action( 'wp_initialize_site', 'wpseo_on_activate_blog', 99 );
507 -}
508 -
459 +add_action( 'wp_initialize_site', 'wpseo_on_activate_blog', 99 );
509 460 add_action( 'activate_blog', 'wpseo_on_activate_blog' );
510 461
511 462 // Registers SEO capabilities.
512 463 $wpseo_register_capabilities = new WPSEO_Register_Capabilities();
@@ -517,8 +468,10 @@
517 468 $wpseo_register_capabilities->register_hooks();
518 469
519 470 /**
520 471 * Wraps for notifications center class.
472 + *
473 + * @return void
521 474 */
522 475 function load_yoast_notifications() {
523 476 // Init Yoast_Notification_Center class.
524 477 Yoast_Notification_Center::get();
@@ -541,8 +494,10 @@
541 494 }
542 495
543 496 /**
544 497 * Returns the notice in case of missing spl extension.
498 + *
499 + * @return void
545 500 */
546 501 function yoast_wpseo_missing_spl_notice() {
547 502 $message = esc_html__( 'The Standard PHP Library (SPL) extension seem to be unavailable. Please ask your web host to enable it.', 'wordpress-seo' );
548 503 yoast_wpseo_activation_failed_notice( $message );
@@ -562,8 +517,10 @@
562 517 }
563 518
564 519 /**
565 520 * Returns the notice in case of missing Composer autoload.
521 + *
522 + * @return void
566 523 */
567 524 function yoast_wpseo_missing_autoload_notice() {
568 525 /* translators: %1$s expands to Yoast SEO, %2$s / %3$s: links to the installation manual in the Readme for the Yoast SEO code repository on GitHub */
569 526 $message = esc_html__( 'The %1$s plugin installation is incomplete. Please refer to %2$sinstallation instructions%3$s.', 'wordpress-seo' );
@@ -574,25 +531,27 @@
574 531 /**
575 532 * Throw an error if the filter extension is disabled (prevent white screens) and self-deactivate plugin.
576 533 *
577 534 * @since 2.0
535 + * @deprecated 23.3
536 + * @codeCoverageIgnore
578 537 *
579 538 * @return void
580 539 */
581 540 function yoast_wpseo_missing_filter() {
582 - if ( is_admin() ) {
583 - add_action( 'admin_notices', 'yoast_wpseo_missing_filter_notice' );
584 -
585 - yoast_wpseo_self_deactivate();
586 - }
541 + _deprecated_function( __FUNCTION__, 'Yoast SEO 23.3' );
587 542 }
588 543
589 544 /**
590 545 * Returns the notice in case of missing filter extension.
546 + *
547 + * @deprecated 23.3
548 + * @codeCoverageIgnore
549 + *
550 + * @return void
591 551 */
592 552 function yoast_wpseo_missing_filter_notice() {
593 - $message = esc_html__( 'The filter extension seem to be unavailable. Please ask your web host to enable it.', 'wordpress-seo' );
594 - yoast_wpseo_activation_failed_notice( $message );
553 + _deprecated_function( __FUNCTION__, 'Yoast SEO 23.3' );
595 554 }
596 555
597 556 /**
598 557 * Echo's the Activation failed notice with any given message.
@@ -597,16 +556,26 @@
597 556 /**
598 557 * Echo's the Activation failed notice with any given message.
599 558 *
600 559 * @param string $message Message string.
560 + *
561 + * @return void
601 562 */
602 563 function yoast_wpseo_activation_failed_notice( $message ) {
564 + $title = sprintf(
565 + /* translators: %s: Yoast SEO. */
566 + esc_html__( '%s activation failed', 'wordpress-seo' ),
567 + 'Yoast SEO',
568 + );
569 +
603 570 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This function is only called in 3 places that are safe.
604 - echo '<div class="error"><p>' . esc_html__( 'Activation failed:', 'wordpress-seo' ) . ' ' . strip_tags( $message, '<a>' ) . '</p></div>';
571 + echo '<div class="error yoast-migrated-notice"><h4 class="yoast-notice-migrated-header">' . $title . '</h4><div class="notice-yoast-content"><p>' . strip_tags( $message, '<a>' ) . '</p></div></div>';
605 572 }
606 573
607 574 /**
608 575 * The method will deactivate the plugin, but only once, done by the static $is_deactivated.
576 + *
577 + * @return void
609 578 */
610 579 function yoast_wpseo_self_deactivate() {
611 580 static $is_deactivated;
612 581
@@ -616,30 +585,8 @@
616 585 if ( isset( $_GET['activate'] ) ) {
617 586 unset( $_GET['activate'] );
618 587 }
619 588 }
620 -}
621 -
622 -/* ********************* DEPRECATED METHODS ********************* */
623 -
624 -/**
625 - * Instantiate the different social classes on the frontend.
626 - *
627 - * @deprecated 14.0
628 - * @codeCoverageIgnore
629 - */
630 -function wpseo_frontend_head_init() {
631 - _deprecated_function( __METHOD__, 'WPSEO 14.0' );
632 -}
633 -
634 -/**
635 - * Used to load the required files on the plugins_loaded hook, instead of immediately.
636 - *
637 - * @deprecated 14.0
638 - * @codeCoverageIgnore
639 - */
640 -function wpseo_frontend_init() {
641 - _deprecated_function( __METHOD__, 'WPSEO 14.0' );
642 589 }
643 590
644 591 /**
645 592 * Aliasses added in order to keep compatibility with Yoast SEO: Local.