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.../admin
File: class-yoast-columns.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
* Represents the yoast columns.
[8] Fix | Delete
*/
[9] Fix | Delete
class WPSEO_Yoast_Columns implements WPSEO_WordPress_Integration {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Registers all hooks to WordPress.
[13] Fix | Delete
*
[14] Fix | Delete
* @return void
[15] Fix | Delete
*/
[16] Fix | Delete
public function register_hooks() {
[17] Fix | Delete
add_action( 'load-edit.php', [ $this, 'add_help_tab' ] );
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* Adds the help tab to the help center for current screen.
[22] Fix | Delete
*
[23] Fix | Delete
* @return void
[24] Fix | Delete
*/
[25] Fix | Delete
public function add_help_tab() {
[26] Fix | Delete
$link_columns_present = $this->display_links();
[27] Fix | Delete
$meta_columns_present = $this->display_meta_columns();
[28] Fix | Delete
if ( ! ( $link_columns_present || $meta_columns_present ) ) {
[29] Fix | Delete
return;
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
$help_tab_content = sprintf(
[33] Fix | Delete
/* translators: %1$s: Yoast SEO */
[34] Fix | Delete
__( '%1$s adds several columns to this page.', 'wordpress-seo' ),
[35] Fix | Delete
'Yoast SEO'
[36] Fix | Delete
);
[37] Fix | Delete
[38] Fix | Delete
if ( $meta_columns_present ) {
[39] Fix | Delete
$help_tab_content .= ' ' . sprintf(
[40] Fix | Delete
/* translators: %1$s: Link to article about content analysis, %2$s: Anchor closing */
[41] Fix | Delete
__( 'We\'ve written an article about %1$show to use the SEO score and Readability score%2$s.', 'wordpress-seo' ),
[42] Fix | Delete
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/16p' ) . '">',
[43] Fix | Delete
'</a>'
[44] Fix | Delete
);
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
if ( $link_columns_present ) {
[48] Fix | Delete
$help_tab_content .= ' ' . sprintf(
[49] Fix | Delete
/* translators: %1$s: Link to article about text links, %2$s: Anchor closing tag, %3$s: Emphasis open tag, %4$s: Emphasis close tag */
[50] Fix | Delete
__( 'The links columns show the number of articles on this site linking %3$sto%4$s this article and the number of URLs linked %3$sfrom%4$s this article. Learn more about %1$show to use these features to improve your internal linking%2$s, which greatly enhances your SEO.', 'wordpress-seo' ),
[51] Fix | Delete
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/16p' ) . '">',
[52] Fix | Delete
'</a>',
[53] Fix | Delete
'<em>',
[54] Fix | Delete
'</em>'
[55] Fix | Delete
);
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
$screen = get_current_screen();
[59] Fix | Delete
$screen->add_help_tab(
[60] Fix | Delete
[
[61] Fix | Delete
/* translators: %s expands to Yoast */
[62] Fix | Delete
'title' => sprintf( __( '%s Columns', 'wordpress-seo' ), 'Yoast' ),
[63] Fix | Delete
'id' => 'yst-columns',
[64] Fix | Delete
'content' => '<p>' . $help_tab_content . '</p>',
[65] Fix | Delete
'priority' => 15,
[66] Fix | Delete
]
[67] Fix | Delete
);
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
/**
[71] Fix | Delete
* Retrieves the post type from the $_GET variable.
[72] Fix | Delete
*
[73] Fix | Delete
* @return string The current post type.
[74] Fix | Delete
*/
[75] Fix | Delete
private function get_current_post_type() {
[76] Fix | Delete
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
[77] Fix | Delete
if ( isset( $_GET['post_type'] ) && is_string( $_GET['post_type'] ) ) {
[78] Fix | Delete
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
[79] Fix | Delete
return sanitize_text_field( wp_unslash( $_GET['post_type'] ) );
[80] Fix | Delete
}
[81] Fix | Delete
return '';
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
/**
[85] Fix | Delete
* Whether we are showing link columns on this overview page.
[86] Fix | Delete
* This depends on the post being accessible or not.
[87] Fix | Delete
*
[88] Fix | Delete
* @return bool Whether the linking columns are shown
[89] Fix | Delete
*/
[90] Fix | Delete
private function display_links() {
[91] Fix | Delete
$current_post_type = $this->get_current_post_type();
[92] Fix | Delete
[93] Fix | Delete
if ( empty( $current_post_type ) ) {
[94] Fix | Delete
return false;
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
return WPSEO_Post_Type::is_post_type_accessible( $current_post_type );
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
/**
[101] Fix | Delete
* Wraps the WPSEO_Metabox check to determine whether the metabox should be displayed either by
[102] Fix | Delete
* choice of the admin or because the post type is not a public post type.
[103] Fix | Delete
*
[104] Fix | Delete
* @return bool Whether the meta box (and associated columns etc) should be hidden.
[105] Fix | Delete
*/
[106] Fix | Delete
private function display_meta_columns() {
[107] Fix | Delete
$current_post_type = $this->get_current_post_type();
[108] Fix | Delete
[109] Fix | Delete
if ( empty( $current_post_type ) ) {
[110] Fix | Delete
return false;
[111] Fix | Delete
}
[112] Fix | Delete
[113] Fix | Delete
return WPSEO_Utils::is_metabox_active( $current_post_type, 'post_type' );
[114] Fix | Delete
}
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function