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.../public_h.../wp-conte.../plugins/wordpres.../src/presente.../admin
File: indexing-failed-notification-presenter.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Presenters\Admin;
[2] Fix | Delete
[3] Fix | Delete
use WPSEO_Addon_Manager;
[4] Fix | Delete
use Yoast\WP\SEO\Helpers\Product_Helper;
[5] Fix | Delete
use Yoast\WP\SEO\Helpers\Short_Link_Helper;
[6] Fix | Delete
use Yoast\WP\SEO\Presenters\Abstract_Presenter;
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Class Indexing_Failed_Notification_Presenter.
[10] Fix | Delete
*
[11] Fix | Delete
* @package Yoast\WP\SEO\Presenters\Notifications
[12] Fix | Delete
*/
[13] Fix | Delete
class Indexing_Failed_Notification_Presenter extends Abstract_Presenter {
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* The product helper.
[17] Fix | Delete
*
[18] Fix | Delete
* @var Product_Helper
[19] Fix | Delete
*/
[20] Fix | Delete
protected $product_helper;
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* The addon manager.
[24] Fix | Delete
*
[25] Fix | Delete
* @var WPSEO_Addon_Manager
[26] Fix | Delete
*/
[27] Fix | Delete
protected $class_addon_manager;
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* The short link helper.
[31] Fix | Delete
*
[32] Fix | Delete
* @var Short_Link_Helper
[33] Fix | Delete
*/
[34] Fix | Delete
protected $short_link_helper;
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Indexing_Failed_Notification_Presenter constructor.
[38] Fix | Delete
*
[39] Fix | Delete
* @param Product_Helper $product_helper The product helper.
[40] Fix | Delete
* @param Short_Link_Helper $short_link_helper The addon manager.
[41] Fix | Delete
* @param WPSEO_Addon_Manager $class_addon_manager The addon manager.
[42] Fix | Delete
*/
[43] Fix | Delete
public function __construct( $product_helper, $short_link_helper, $class_addon_manager ) {
[44] Fix | Delete
$this->class_addon_manager = $class_addon_manager;
[45] Fix | Delete
$this->short_link_helper = $short_link_helper;
[46] Fix | Delete
$this->product_helper = $product_helper;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Returns the notification as an HTML string.
[51] Fix | Delete
*
[52] Fix | Delete
* @return string The notification in an HTML string representation.
[53] Fix | Delete
*/
[54] Fix | Delete
public function present() {
[55] Fix | Delete
$notification_text = \sprintf(
[56] Fix | Delete
/* Translators: %1$s expands to an opening anchor tag for a link leading to the Yoast SEO tools page, %2$s expands to a closing anchor tag. */
[57] Fix | Delete
\esc_html__(
[58] Fix | Delete
'Something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please %1$sre-start the process%2$s.',
[59] Fix | Delete
'wordpress-seo'
[60] Fix | Delete
),
[61] Fix | Delete
'<a href="' . \get_admin_url( null, 'admin.php?page=wpseo_tools' ) . '">',
[62] Fix | Delete
'</a>'
[63] Fix | Delete
);
[64] Fix | Delete
[65] Fix | Delete
if ( $this->product_helper->is_premium() ) {
[66] Fix | Delete
if ( $this->has_valid_premium_subscription() ) {
[67] Fix | Delete
// Add a support message for premium customers.
[68] Fix | Delete
$notification_text .= ' ';
[69] Fix | Delete
$notification_text .= \esc_html__( 'If the problem persists, please contact support.', 'wordpress-seo' );
[70] Fix | Delete
}
[71] Fix | Delete
else {
[72] Fix | Delete
// Premium plugin with inactive addon; overwrite the entire error message.
[73] Fix | Delete
$notification_text = \sprintf(
[74] Fix | Delete
/* Translators: %1$s expands to an opening anchor tag for a link leading to the Premium installation page, %2$s expands to a closing anchor tag. */
[75] Fix | Delete
\esc_html__(
[76] Fix | Delete
'Oops, something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please make sure to activate your subscription in MyYoast by completing %1$sthese steps%2$s.',
[77] Fix | Delete
'wordpress-seo'
[78] Fix | Delete
),
[79] Fix | Delete
'<a href="' . \esc_url( $this->short_link_helper->get( 'https://yoa.st/3wv' ) ) . '">',
[80] Fix | Delete
'</a>'
[81] Fix | Delete
);
[82] Fix | Delete
}
[83] Fix | Delete
}
[84] Fix | Delete
[85] Fix | Delete
return '<p>' . $notification_text . '</p>';
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
/**
[89] Fix | Delete
* Determines if the site has a valid Premium subscription.
[90] Fix | Delete
*
[91] Fix | Delete
* @return bool
[92] Fix | Delete
*/
[93] Fix | Delete
protected function has_valid_premium_subscription() {
[94] Fix | Delete
return $this->class_addon_manager->has_valid_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG );
[95] Fix | Delete
}
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function