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/conditio...
File: yoast-admin-and-dashboard-conditional.php
<?php // phpcs:ignore Yoast.Files.FileName.InvalidClassFileName -- Reason: this explicitly concerns the Yoast admin and dashboard.
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Conditionals;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Conditional that is only met when in the admin dashboard, update or Yoast SEO pages.
[5] Fix | Delete
*/
[6] Fix | Delete
class Yoast_Admin_And_Dashboard_Conditional implements Conditional {
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Returns `true` when on the admin dashboard, update or Yoast SEO pages.
[10] Fix | Delete
*
[11] Fix | Delete
* @return bool `true` when on the admin dashboard, update or Yoast SEO pages.
[12] Fix | Delete
*/
[13] Fix | Delete
public function is_met() {
[14] Fix | Delete
global $pagenow;
[15] Fix | Delete
[16] Fix | Delete
// Bail out early if we're not on the front-end.
[17] Fix | Delete
if ( ! \is_admin() ) {
[18] Fix | Delete
return false;
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
// Do not output on plugin / theme upgrade pages or when WordPress is upgrading.
[22] Fix | Delete
if ( ( \defined( 'IFRAME_REQUEST' ) && \IFRAME_REQUEST ) || $this->on_upgrade_page() || \wp_installing() ) {
[23] Fix | Delete
return false;
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
if ( $pagenow === 'admin.php' && isset( $_GET['page'] ) && \strpos( $_GET['page'], 'wpseo' ) === 0 ) {
[27] Fix | Delete
return true;
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
$target_pages = [
[31] Fix | Delete
'index.php',
[32] Fix | Delete
'plugins.php',
[33] Fix | Delete
'update-core.php',
[34] Fix | Delete
'options-permalink.php',
[35] Fix | Delete
];
[36] Fix | Delete
[37] Fix | Delete
return \in_array( $pagenow, $target_pages, true );
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
/**
[41] Fix | Delete
* Checks if we are on a theme or plugin upgrade page.
[42] Fix | Delete
*
[43] Fix | Delete
* @return bool Whether we are on a theme or plugin upgrade page.
[44] Fix | Delete
*/
[45] Fix | Delete
private function on_upgrade_page() {
[46] Fix | Delete
/*
[47] Fix | Delete
* IFRAME_REQUEST is not defined on these pages,
[48] Fix | Delete
* though these action pages do show when upgrading themes or plugins.
[49] Fix | Delete
*/
[50] Fix | Delete
$actions = [ 'do-theme-upgrade', 'do-plugin-upgrade', 'do-core-upgrade', 'do-core-reinstall' ];
[51] Fix | Delete
return isset( $_GET['action'] ) && \in_array( $_GET['action'], $actions, true );
[52] Fix | Delete
}
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function