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/clone/wp-conte.../plugins/wordpres.../admin
File: class-premium-upsell-admin-block.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
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Class WPSEO_Premium_Upsell_Admin_Block
[10] Fix | Delete
*/
[11] Fix | Delete
class WPSEO_Premium_Upsell_Admin_Block {
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Hook to display the block on.
[15] Fix | Delete
*
[16] Fix | Delete
* @var string
[17] Fix | Delete
*/
[18] Fix | Delete
protected $hook;
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* Identifier to use in the dismissal functionality.
[22] Fix | Delete
*
[23] Fix | Delete
* @var string
[24] Fix | Delete
*/
[25] Fix | Delete
protected $identifier = 'premium_upsell';
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* Registers which hook the block will be displayed on.
[29] Fix | Delete
*
[30] Fix | Delete
* @param string $hook Hook to display the block on.
[31] Fix | Delete
*/
[32] Fix | Delete
public function __construct( $hook ) {
[33] Fix | Delete
$this->hook = $hook;
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Registers WordPress hooks.
[38] Fix | Delete
*
[39] Fix | Delete
* @return void
[40] Fix | Delete
*/
[41] Fix | Delete
public function register_hooks() {
[42] Fix | Delete
add_action( $this->hook, [ $this, 'render' ] );
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
/**
[46] Fix | Delete
* Renders the upsell block.
[47] Fix | Delete
*
[48] Fix | Delete
* @return void
[49] Fix | Delete
*/
[50] Fix | Delete
public function render() {
[51] Fix | Delete
$url = WPSEO_Shortlinker::get( 'https://yoa.st/17h' );
[52] Fix | Delete
[53] Fix | Delete
$arguments = [
[54] Fix | Delete
sprintf(
[55] Fix | Delete
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
[56] Fix | Delete
esc_html__( '%1$sAI%2$s: Better SEO titles and meta descriptions, faster.', 'wordpress-seo' ),
[57] Fix | Delete
'<strong>',
[58] Fix | Delete
'</strong>'
[59] Fix | Delete
),
[60] Fix | Delete
sprintf(
[61] Fix | Delete
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
[62] Fix | Delete
esc_html__( '%1$sMultiple keywords%2$s: Rank higher for more searches.', 'wordpress-seo' ),
[63] Fix | Delete
'<strong>',
[64] Fix | Delete
'</strong>'
[65] Fix | Delete
),
[66] Fix | Delete
sprintf(
[67] Fix | Delete
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
[68] Fix | Delete
esc_html__( '%1$sSuper fast%2$s internal linking suggestions.', 'wordpress-seo' ),
[69] Fix | Delete
'<strong>',
[70] Fix | Delete
'</strong>'
[71] Fix | Delete
),
[72] Fix | Delete
sprintf(
[73] Fix | Delete
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
[74] Fix | Delete
esc_html__( '%1$sNo more broken links%2$s: Automatic redirect manager.', 'wordpress-seo' ),
[75] Fix | Delete
'<strong>',
[76] Fix | Delete
'</strong>'
[77] Fix | Delete
),
[78] Fix | Delete
sprintf(
[79] Fix | Delete
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
[80] Fix | Delete
esc_html__( '%1$sAppealing social previews%2$s people actually want to click on.', 'wordpress-seo' ),
[81] Fix | Delete
'<strong>',
[82] Fix | Delete
'</strong>'
[83] Fix | Delete
),
[84] Fix | Delete
sprintf(
[85] Fix | Delete
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
[86] Fix | Delete
esc_html__( '%1$s24/7 support%2$s: Also on evenings and weekends.', 'wordpress-seo' ),
[87] Fix | Delete
'<strong>',
[88] Fix | Delete
'</strong>'
[89] Fix | Delete
),
[90] Fix | Delete
'<strong>' . esc_html__( 'No ads!', 'wordpress-seo' ) . '</strong>',
[91] Fix | Delete
];
[92] Fix | Delete
[93] Fix | Delete
$arguments_html = implode( '', array_map( [ $this, 'get_argument_html' ], $arguments ) );
[94] Fix | Delete
[95] Fix | Delete
$class = $this->get_html_class();
[96] Fix | Delete
[97] Fix | Delete
/* translators: %s expands to Yoast SEO Premium */
[98] Fix | Delete
$button_text = YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ? esc_html__( 'Claim your 30% off now!', 'wordpress-seo' ) : sprintf( esc_html__( 'Explore %s now!', 'wordpress-seo' ), 'Yoast SEO Premium' );
[99] Fix | Delete
/* translators: Hidden accessibility text. */
[100] Fix | Delete
$button_text .= '<span class="screen-reader-text">' . esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>'
[101] Fix | Delete
. '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';
[102] Fix | Delete
[103] Fix | Delete
$upgrade_button = sprintf(
[104] Fix | Delete
'<a id="%1$s" class="yoast-button-upsell" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" href="%2$s" target="_blank">%3$s</a>',
[105] Fix | Delete
esc_attr( 'wpseo-' . $this->identifier . '-popup-button' ),
[106] Fix | Delete
esc_url( $url ),
[107] Fix | Delete
$button_text
[108] Fix | Delete
);
[109] Fix | Delete
[110] Fix | Delete
echo '<div class="' . esc_attr( $class ) . '">';
[111] Fix | Delete
[112] Fix | Delete
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
[113] Fix | Delete
$bf_label = esc_html__( 'BLACK FRIDAY', 'wordpress-seo' );
[114] Fix | Delete
$sale_label = esc_html__( '30% OFF', 'wordpress-seo' );
[115] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped above.
[116] Fix | Delete
echo "<div class='black-friday-container'><span>$bf_label</span> <span style='margin-left: auto;'>$sale_label</span> </div>";
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
echo '<div class="' . esc_attr( $class . '--container' ) . '">';
[120] Fix | Delete
echo '<h2 class="' . esc_attr( $class . '--header' ) . '">'
[121] Fix | Delete
. sprintf(
[122] Fix | Delete
/* translators: %s expands to Yoast SEO Premium */
[123] Fix | Delete
esc_html__( 'Upgrade to %s', 'wordpress-seo' ),
[124] Fix | Delete
'Yoast SEO Premium'
[125] Fix | Delete
)
[126] Fix | Delete
. '</h2>';
[127] Fix | Delete
[128] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Correctly escaped in $this->get_argument_html() method.
[129] Fix | Delete
echo '<ul class="' . esc_attr( $class . '--motivation' ) . '">' . $arguments_html . '</ul>';
[130] Fix | Delete
[131] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Correctly escaped in $upgrade_button and $button_text above.
[132] Fix | Delete
echo '<p>' . $upgrade_button . '</p>';
[133] Fix | Delete
echo '</div>';
[134] Fix | Delete
[135] Fix | Delete
echo '</div>';
[136] Fix | Delete
}
[137] Fix | Delete
[138] Fix | Delete
/**
[139] Fix | Delete
* Formats the argument to a HTML list item.
[140] Fix | Delete
*
[141] Fix | Delete
* @param string $argument The argument to format.
[142] Fix | Delete
*
[143] Fix | Delete
* @return string Formatted argument in HTML.
[144] Fix | Delete
*/
[145] Fix | Delete
protected function get_argument_html( $argument ) {
[146] Fix | Delete
$class = $this->get_html_class();
[147] Fix | Delete
[148] Fix | Delete
return sprintf(
[149] Fix | Delete
'<li><div class="%1$s">%2$s</div></li>',
[150] Fix | Delete
esc_attr( $class . '--argument' ),
[151] Fix | Delete
$argument
[152] Fix | Delete
);
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
/**
[156] Fix | Delete
* Returns the HTML base class to use.
[157] Fix | Delete
*
[158] Fix | Delete
* @return string The HTML base class.
[159] Fix | Delete
*/
[160] Fix | Delete
protected function get_html_class() {
[161] Fix | Delete
return 'yoast_' . $this->identifier;
[162] Fix | Delete
}
[163] Fix | Delete
}
[164] Fix | Delete
[165] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function