: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Returns the notice in case of missing spl extension.
function yoast_wpseo_missing_spl_notice() {
$message = esc_html__( 'The Standard PHP Library (SPL) extension seem to be unavailable. Please ask your web host to enable it.', 'wordpress-seo' );
yoast_wpseo_activation_failed_notice( $message );
* Throw an error if the Composer autoload is missing and self-deactivate plugin.
function yoast_wpseo_missing_autoload() {
add_action( 'admin_notices', 'yoast_wpseo_missing_autoload_notice' );
yoast_wpseo_self_deactivate();
* Returns the notice in case of missing Composer autoload.
function yoast_wpseo_missing_autoload_notice() {
/* 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 */
$message = esc_html__( 'The %1$s plugin installation is incomplete. Please refer to %2$sinstallation instructions%3$s.', 'wordpress-seo' );
$message = sprintf( $message, 'Yoast SEO', '<a href="https://github.com/Yoast/wordpress-seo#installation">', '</a>' );
yoast_wpseo_activation_failed_notice( $message );
* Throw an error if the filter extension is disabled (prevent white screens) and self-deactivate plugin.
function yoast_wpseo_missing_filter() {
add_action( 'admin_notices', 'yoast_wpseo_missing_filter_notice' );
yoast_wpseo_self_deactivate();
* Returns the notice in case of missing filter extension.
function yoast_wpseo_missing_filter_notice() {
$message = esc_html__( 'The filter extension seem to be unavailable. Please ask your web host to enable it.', 'wordpress-seo' );
yoast_wpseo_activation_failed_notice( $message );
* Echo's the Activation failed notice with any given message.
* @param string $message Message string.
function yoast_wpseo_activation_failed_notice( $message ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This function is only called in 3 places that are safe.
echo '<div class="error"><p>' . esc_html__( 'Activation failed:', 'wordpress-seo' ) . ' ' . strip_tags( $message, '<a>' ) . '</p></div>';
* The method will deactivate the plugin, but only once, done by the static $is_deactivated.
function yoast_wpseo_self_deactivate() {
if ( $is_deactivated === null ) {
deactivate_plugins( WPSEO_BASENAME );
if ( isset( $_GET['activate'] ) ) {
unset( $_GET['activate'] );
* Aliasses added in order to keep compatibility with Yoast SEO: Local.
class_alias( '\Yoast\WP\SEO\Initializers\Initializer_Interface', '\Yoast\WP\SEO\WordPress\Initializer' );
class_alias( '\Yoast\WP\SEO\Loadable_Interface', '\Yoast\WP\SEO\WordPress\Loadable' );
class_alias( '\Yoast\WP\SEO\Integrations\Integration_Interface', '\Yoast\WP\SEO\WordPress\Integration' );