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-schema-person-upgrade-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
* Notifies the user to update the Search Appearance settings when the site is set to represent a Person,
[8] Fix | Delete
* but no person (name) has been chosen.
[9] Fix | Delete
*/
[10] Fix | Delete
class WPSEO_Schema_Person_Upgrade_Notification implements WPSEO_WordPress_Integration {
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Registers all hooks to WordPress
[14] Fix | Delete
*
[15] Fix | Delete
* @return void
[16] Fix | Delete
*/
[17] Fix | Delete
public function register_hooks() {
[18] Fix | Delete
add_action( 'admin_init', [ $this, 'handle_notification' ] );
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Handles if the notification should be added or removed.
[23] Fix | Delete
*
[24] Fix | Delete
* @return void
[25] Fix | Delete
*/
[26] Fix | Delete
public function handle_notification() {
[27] Fix | Delete
$company_or_person_user_id = WPSEO_Options::get( 'company_or_person_user_id', false );
[28] Fix | Delete
if ( WPSEO_Options::get( 'company_or_person' ) === 'person' && empty( $company_or_person_user_id ) ) {
[29] Fix | Delete
$this->add_notification();
[30] Fix | Delete
return;
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
$this->remove_notification();
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Adds a notification to the notification center.
[38] Fix | Delete
*
[39] Fix | Delete
* @return void
[40] Fix | Delete
*/
[41] Fix | Delete
protected function add_notification() {
[42] Fix | Delete
$notification_center = Yoast_Notification_Center::get();
[43] Fix | Delete
$notification_center->add_notification( $this->get_notification() );
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
/**
[47] Fix | Delete
* Removes a notification to the notification center.
[48] Fix | Delete
*
[49] Fix | Delete
* @return void
[50] Fix | Delete
*/
[51] Fix | Delete
protected function remove_notification() {
[52] Fix | Delete
$notification_center = Yoast_Notification_Center::get();
[53] Fix | Delete
$notification_center->remove_notification( $this->get_notification() );
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* Gets the notification object.
[58] Fix | Delete
*
[59] Fix | Delete
* @return Yoast_Notification
[60] Fix | Delete
*/
[61] Fix | Delete
protected function get_notification() {
[62] Fix | Delete
$message = sprintf(
[63] Fix | Delete
/* translators: %1$s is a link start tag to the Search Appearance settings, %2$s is the link closing tag. */
[64] Fix | Delete
__( 'You have previously set your site to represent a person. We’ve improved our functionality around Schema and the Knowledge Graph, so you should go in and %1$scomplete those settings%2$s.', 'wordpress-seo' ),
[65] Fix | Delete
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_page_settings#/site-representation' ) ) . '">',
[66] Fix | Delete
'</a>'
[67] Fix | Delete
);
[68] Fix | Delete
[69] Fix | Delete
$notification = new Yoast_Notification(
[70] Fix | Delete
$message,
[71] Fix | Delete
[
[72] Fix | Delete
'type' => Yoast_Notification::WARNING,
[73] Fix | Delete
'id' => 'wpseo-schema-person-upgrade',
[74] Fix | Delete
'capabilities' => 'wpseo_manage_options',
[75] Fix | Delete
'priority' => 0.8,
[76] Fix | Delete
]
[77] Fix | Delete
);
[78] Fix | Delete
[79] Fix | Delete
return $notification;
[80] Fix | Delete
}
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function