Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordpres.../admin
File: class-admin-gutenberg-compatibility-notification.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WPSEO plugin file.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WPSEO\Admin
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Handles the Gutenberg Compatibility notification showing and hiding.
[8] Fix | Delete
*/
[9] Fix | Delete
class WPSEO_Admin_Gutenberg_Compatibility_Notification implements WPSEO_WordPress_Integration {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Notification ID to use.
[13] Fix | Delete
*
[14] Fix | Delete
* @var string
[15] Fix | Delete
*/
[16] Fix | Delete
private $notification_id = 'wpseo-outdated-gutenberg-plugin';
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Instance of gutenberg compatibility checker.
[20] Fix | Delete
*
[21] Fix | Delete
* @var WPSEO_Gutenberg_Compatibility
[22] Fix | Delete
*/
[23] Fix | Delete
protected $compatibility_checker;
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* Instance of Yoast Notification Center.
[27] Fix | Delete
*
[28] Fix | Delete
* @var Yoast_Notification_Center
[29] Fix | Delete
*/
[30] Fix | Delete
protected $notification_center;
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* WPSEO_Admin_Gutenberg_Compatibility_Notification constructor.
[34] Fix | Delete
*/
[35] Fix | Delete
public function __construct() {
[36] Fix | Delete
$this->compatibility_checker = new WPSEO_Gutenberg_Compatibility();
[37] Fix | Delete
$this->notification_center = Yoast_Notification_Center::get();
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
/**
[41] Fix | Delete
* Registers all hooks to WordPress.
[42] Fix | Delete
*
[43] Fix | Delete
* @return void
[44] Fix | Delete
*/
[45] Fix | Delete
public function register_hooks() {
[46] Fix | Delete
add_action( 'admin_init', [ $this, 'manage_notification' ] );
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Manages if the notification should be shown or removed.
[51] Fix | Delete
*
[52] Fix | Delete
* @return void
[53] Fix | Delete
*/
[54] Fix | Delete
public function manage_notification() {
[55] Fix | Delete
/**
[56] Fix | Delete
* Filter: 'yoast_display_gutenberg_compat_notification' - Allows developer to disable the Gutenberg compatibility
[57] Fix | Delete
* notification.
[58] Fix | Delete
*
[59] Fix | Delete
* @param bool $display_notification
[60] Fix | Delete
*/
[61] Fix | Delete
$display_notification = apply_filters( 'yoast_display_gutenberg_compat_notification', true );
[62] Fix | Delete
[63] Fix | Delete
if (
[64] Fix | Delete
! $this->compatibility_checker->is_installed()
[65] Fix | Delete
|| $this->compatibility_checker->is_fully_compatible()
[66] Fix | Delete
|| ! $display_notification
[67] Fix | Delete
) {
[68] Fix | Delete
$this->notification_center->remove_notification_by_id( $this->notification_id );
[69] Fix | Delete
[70] Fix | Delete
return;
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
$this->add_notification();
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
/**
[77] Fix | Delete
* Adds the notification to the notificaton center.
[78] Fix | Delete
*
[79] Fix | Delete
* @return void
[80] Fix | Delete
*/
[81] Fix | Delete
protected function add_notification() {
[82] Fix | Delete
$level = $this->compatibility_checker->is_below_minimum() ? Yoast_Notification::ERROR : Yoast_Notification::WARNING;
[83] Fix | Delete
[84] Fix | Delete
$message = sprintf(
[85] Fix | Delete
/* translators: %1$s expands to Yoast SEO, %2$s expands to the installed version, %3$s expands to Gutenberg */
[86] Fix | Delete
__( '%1$s detected you are using version %2$s of %3$s, please update to the latest version to prevent compatibility issues.', 'wordpress-seo' ),
[87] Fix | Delete
'Yoast SEO',
[88] Fix | Delete
$this->compatibility_checker->get_installed_version(),
[89] Fix | Delete
'Gutenberg'
[90] Fix | Delete
);
[91] Fix | Delete
[92] Fix | Delete
$notification = new Yoast_Notification(
[93] Fix | Delete
$message,
[94] Fix | Delete
[
[95] Fix | Delete
'id' => $this->notification_id,
[96] Fix | Delete
'type' => $level,
[97] Fix | Delete
'priority' => 1,
[98] Fix | Delete
]
[99] Fix | Delete
);
[100] Fix | Delete
[101] Fix | Delete
$this->notification_center->add_notification( $notification );
[102] Fix | Delete
}
[103] Fix | Delete
}
[104] Fix | Delete
[105] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function