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.../src/deprecat.../frontend
File: frontend.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Backwards compatibility class for WPSEO_Frontend.
[2] Fix | Delete
*
[3] Fix | Delete
* @package Yoast\YoastSEO\Backwards_Compatibility
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
[7] Fix | Delete
use Yoast\WP\SEO\Presenters\Canonical_Presenter;
[8] Fix | Delete
use Yoast\WP\SEO\Presenters\Meta_Description_Presenter;
[9] Fix | Delete
use Yoast\WP\SEO\Presenters\Rel_Next_Presenter;
[10] Fix | Delete
use Yoast\WP\SEO\Presenters\Rel_Prev_Presenter;
[11] Fix | Delete
use Yoast\WP\SEO\Presenters\Robots_Presenter;
[12] Fix | Delete
use Yoast\WP\SEO\Surfaces\Helpers_Surface;
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* Class WPSEO_Frontend
[16] Fix | Delete
*
[17] Fix | Delete
* @codeCoverageIgnore Because of deprecation.
[18] Fix | Delete
*/
[19] Fix | Delete
class WPSEO_Frontend {
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Instance of this class.
[23] Fix | Delete
*
[24] Fix | Delete
* @var WPSEO_Frontend
[25] Fix | Delete
*/
[26] Fix | Delete
public static $instance;
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* The memoizer for the meta tags context.
[30] Fix | Delete
*
[31] Fix | Delete
* @var Meta_Tags_Context_Memoizer
[32] Fix | Delete
*/
[33] Fix | Delete
private $context_memoizer;
[34] Fix | Delete
[35] Fix | Delete
/**
[36] Fix | Delete
* The WPSEO Replace Vars object.
[37] Fix | Delete
*
[38] Fix | Delete
* @var WPSEO_Replace_Vars
[39] Fix | Delete
*/
[40] Fix | Delete
private $replace_vars;
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* The helpers surface.
[44] Fix | Delete
*
[45] Fix | Delete
* @var Helpers_Surface
[46] Fix | Delete
*/
[47] Fix | Delete
private $helpers;
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* WPSEO_Frontend constructor.
[51] Fix | Delete
*/
[52] Fix | Delete
public function __construct() {
[53] Fix | Delete
$this->context_memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
[54] Fix | Delete
$this->replace_vars = YoastSEO()->classes->get( WPSEO_Replace_Vars::class );
[55] Fix | Delete
$this->helpers = YoastSEO()->classes->get( Helpers_Surface::class );
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
/**
[59] Fix | Delete
* Catches call to methods that don't exist and might deprecated.
[60] Fix | Delete
*
[61] Fix | Delete
* @param string $method The called method.
[62] Fix | Delete
* @param array $arguments The given arguments.
[63] Fix | Delete
*
[64] Fix | Delete
* @return mixed
[65] Fix | Delete
*/
[66] Fix | Delete
public function __call( $method, $arguments ) {
[67] Fix | Delete
_deprecated_function( $method, 'Yoast SEO 14.0' );
[68] Fix | Delete
[69] Fix | Delete
$title_methods = [
[70] Fix | Delete
'title',
[71] Fix | Delete
'fix_woo_title',
[72] Fix | Delete
'get_content_title',
[73] Fix | Delete
'get_seo_title',
[74] Fix | Delete
'get_taxonomy_title',
[75] Fix | Delete
'get_author_title',
[76] Fix | Delete
'get_title_from_options',
[77] Fix | Delete
'get_default_title',
[78] Fix | Delete
'force_wp_title',
[79] Fix | Delete
];
[80] Fix | Delete
if ( in_array( $method, $title_methods, true ) ) {
[81] Fix | Delete
return $this->get_title();
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
return null;
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
/**
[88] Fix | Delete
* Retrieves an instance of the class.
[89] Fix | Delete
*
[90] Fix | Delete
* @return static The instance.
[91] Fix | Delete
*/
[92] Fix | Delete
public static function get_instance() {
[93] Fix | Delete
if ( is_null( self::$instance ) ) {
[94] Fix | Delete
self::$instance = new self();
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
return self::$instance;
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
/**
[101] Fix | Delete
* Outputs the canonical value.
[102] Fix | Delete
*
[103] Fix | Delete
* @param bool $echo Whether or not to output the canonical element.
[104] Fix | Delete
* @param bool $un_paged Whether or not to return the canonical with or without pagination added to the URL.
[105] Fix | Delete
* @param bool $no_override Whether or not to return a manually overridden canonical.
[106] Fix | Delete
*
[107] Fix | Delete
* @return string|void
[108] Fix | Delete
*/
[109] Fix | Delete
public function canonical( $echo = true, $un_paged = false, $no_override = false ) {
[110] Fix | Delete
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
[111] Fix | Delete
[112] Fix | Delete
$presentation = $this->get_current_page_presentation();
[113] Fix | Delete
$presenter = new Canonical_Presenter();
[114] Fix | Delete
[115] Fix | Delete
/** This filter is documented in src/integrations/front-end-integration.php */
[116] Fix | Delete
$presenter->presentation = $presentation;
[117] Fix | Delete
$presenter->helpers = $this->helpers;
[118] Fix | Delete
$presenter->replace_vars = $this->replace_vars;
[119] Fix | Delete
[120] Fix | Delete
if ( ! $echo ) {
[121] Fix | Delete
return $presenter->get();
[122] Fix | Delete
}
[123] Fix | Delete
[124] Fix | Delete
echo $presenter->present();
[125] Fix | Delete
}
[126] Fix | Delete
[127] Fix | Delete
/**
[128] Fix | Delete
* Retrieves the meta robots value.
[129] Fix | Delete
*
[130] Fix | Delete
* @return string
[131] Fix | Delete
*/
[132] Fix | Delete
public function get_robots() {
[133] Fix | Delete
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
[134] Fix | Delete
[135] Fix | Delete
$presentation = $this->get_current_page_presentation();
[136] Fix | Delete
return $presentation->robots;
[137] Fix | Delete
}
[138] Fix | Delete
[139] Fix | Delete
/**
[140] Fix | Delete
* Outputs the meta robots value.
[141] Fix | Delete
*
[142] Fix | Delete
* @return void
[143] Fix | Delete
*/
[144] Fix | Delete
public function robots() {
[145] Fix | Delete
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
[146] Fix | Delete
[147] Fix | Delete
$presentation = $this->get_current_page_presentation();
[148] Fix | Delete
$presenter = new Robots_Presenter();
[149] Fix | Delete
$presenter->presentation = $presentation;
[150] Fix | Delete
$presenter->helpers = $this->helpers;
[151] Fix | Delete
$presenter->replace_vars = $this->replace_vars;
[152] Fix | Delete
echo $presenter->present();
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
/**
[156] Fix | Delete
* Determine $robots values for a single post.
[157] Fix | Delete
*
[158] Fix | Delete
* @param array $robots Robots data array.
[159] Fix | Delete
* @param int $post_id The post ID for which to determine the $robots values, defaults to current post.
[160] Fix | Delete
*
[161] Fix | Delete
* @return array
[162] Fix | Delete
*/
[163] Fix | Delete
public function robots_for_single_post( $robots, $post_id = 0 ) {
[164] Fix | Delete
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
[165] Fix | Delete
[166] Fix | Delete
$presentation = $this->get_current_page_presentation();
[167] Fix | Delete
[168] Fix | Delete
return $presentation->robots;
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
/**
[172] Fix | Delete
* Used for static home and posts pages as well as singular titles.
[173] Fix | Delete
*
[174] Fix | Delete
* @param object|null $object If filled, object to get the title for.
[175] Fix | Delete
*
[176] Fix | Delete
* @return string The content title.
[177] Fix | Delete
*/
[178] Fix | Delete
private function get_title( $object = null ) {
[179] Fix | Delete
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
[180] Fix | Delete
[181] Fix | Delete
$presentation = $this->get_current_page_presentation();
[182] Fix | Delete
$title = $presentation->title;
[183] Fix | Delete
[184] Fix | Delete
return $this->replace_vars->replace( $title, $presentation->source );
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
/**
[188] Fix | Delete
* This function adds paging details to the title.
[189] Fix | Delete
*
[190] Fix | Delete
* @param string $sep Separator used in the title.
[191] Fix | Delete
* @param string $seplocation Whether the separator should be left or right.
[192] Fix | Delete
* @param string $title The title to append the paging info to.
[193] Fix | Delete
*
[194] Fix | Delete
* @return string
[195] Fix | Delete
*/
[196] Fix | Delete
public function add_paging_to_title( $sep, $seplocation, $title ) {
[197] Fix | Delete
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
[198] Fix | Delete
[199] Fix | Delete
return $title;
[200] Fix | Delete
}
[201] Fix | Delete
[202] Fix | Delete
/**
[203] Fix | Delete
* Add part to title, while ensuring that the $seplocation variable is respected.
[204] Fix | Delete
*
[205] Fix | Delete
* @param string $sep Separator used in the title.
[206] Fix | Delete
* @param string $seplocation Whether the separator should be left or right.
[207] Fix | Delete
* @param string $title The title to append the title_part to.
[208] Fix | Delete
* @param string $title_part The part to append to the title.
[209] Fix | Delete
*
[210] Fix | Delete
* @return string
[211] Fix | Delete
*/
[212] Fix | Delete
public function add_to_title( $sep, $seplocation, $title, $title_part ) {
[213] Fix | Delete
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
[214] Fix | Delete
[215] Fix | Delete
if ( $seplocation === 'right' ) {
[216] Fix | Delete
return $title . $sep . $title_part;
[217] Fix | Delete
}
[218] Fix | Delete
[219] Fix | Delete
return $title_part . $sep . $title;
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
/**
[223] Fix | Delete
* Adds 'prev' and 'next' links to archives.
[224] Fix | Delete
*
[225] Fix | Delete
* @link http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html
[226] Fix | Delete
*
[227] Fix | Delete
* @return void
[228] Fix | Delete
*/
[229] Fix | Delete
public function adjacent_rel_links() {
[230] Fix | Delete
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
[231] Fix | Delete
[232] Fix | Delete
$presentation = $this->get_current_page_presentation();
[233] Fix | Delete
[234] Fix | Delete
$rel_prev_presenter = new Rel_Prev_Presenter();
[235] Fix | Delete
$rel_prev_presenter->presentation = $presentation;
[236] Fix | Delete
$rel_prev_presenter->helpers = $this->helpers;
[237] Fix | Delete
$rel_prev_presenter->replace_vars = $this->replace_vars;
[238] Fix | Delete
echo $rel_prev_presenter->present();
[239] Fix | Delete
[240] Fix | Delete
$rel_next_presenter = new Rel_Next_Presenter();
[241] Fix | Delete
$rel_next_presenter->presentation = $presentation;
[242] Fix | Delete
$rel_next_presenter->helpers = $this->helpers;
[243] Fix | Delete
$rel_next_presenter->replace_vars = $this->replace_vars;
[244] Fix | Delete
echo $rel_next_presenter->present();
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
/**
[248] Fix | Delete
* Outputs the meta description element or returns the description text.
[249] Fix | Delete
*
[250] Fix | Delete
* @param bool $echo Echo or return output flag.
[251] Fix | Delete
*
[252] Fix | Delete
* @return string
[253] Fix | Delete
*/
[254] Fix | Delete
public function metadesc( $echo = true ) {
[255] Fix | Delete
_deprecated_function( __METHOD__, 'Yoast SEO 14.0' );
[256] Fix | Delete
[257] Fix | Delete
$presentation = $this->get_current_page_presentation();
[258] Fix | Delete
$presenter = new Meta_Description_Presenter();
[259] Fix | Delete
$presenter->presentation = $presentation;
[260] Fix | Delete
$presenter->helpers = $this->helpers;
[261] Fix | Delete
$presenter->replace_vars = $this->replace_vars;
[262] Fix | Delete
[263] Fix | Delete
if ( ! $echo ) {
[264] Fix | Delete
return $presenter->get();
[265] Fix | Delete
}
[266] Fix | Delete
$presenter->present();
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
/**
[270] Fix | Delete
* Returns the current page presentation.
[271] Fix | Delete
*
[272] Fix | Delete
* @return Indexable_Presentation The current page presentation.
[273] Fix | Delete
*/
[274] Fix | Delete
private function get_current_page_presentation() {
[275] Fix | Delete
$context = $this->context_memoizer->for_current_page();
[276] Fix | Delete
[277] Fix | Delete
/** This filter is documented in src/integrations/front-end-integration.php */
[278] Fix | Delete
return apply_filters( 'wpseo_frontend_presentation', $context->presentation, $context );
[279] Fix | Delete
}
[280] Fix | Delete
}
[281] Fix | Delete
[282] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function