Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/verifica...
File: blog-verification-tools.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Handles site verification services.
[2] Fix | Delete
*
[3] Fix | Delete
* @package jetpack
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[7] Fix | Delete
exit( 0 );
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Return an array of supported verification services.
[12] Fix | Delete
* Add new services to this function.
[13] Fix | Delete
*
[14] Fix | Delete
* @return array - an array of supported services.
[15] Fix | Delete
*/
[16] Fix | Delete
function jetpack_verification_services() {
[17] Fix | Delete
return array(
[18] Fix | Delete
'google' => array(
[19] Fix | Delete
'name' => 'Google Search Console',
[20] Fix | Delete
'key' => 'google-site-verification',
[21] Fix | Delete
'format' => 'dBw5CvburAxi537Rp9qi5uG2174Vb6JwHwIRwPSLIK8',
[22] Fix | Delete
'url' => 'https://www.google.com/webmasters/tools/',
[23] Fix | Delete
),
[24] Fix | Delete
'bing' => array(
[25] Fix | Delete
'name' => 'Bing Webmaster Center',
[26] Fix | Delete
'key' => 'msvalidate.01',
[27] Fix | Delete
'format' => '12C1203B5086AECE94EB3A3D9830B2E',
[28] Fix | Delete
'url' => 'https://www.bing.com/toolbox/webmaster/',
[29] Fix | Delete
),
[30] Fix | Delete
'pinterest' => array(
[31] Fix | Delete
'name' => 'Pinterest Site Verification',
[32] Fix | Delete
'key' => 'p:domain_verify',
[33] Fix | Delete
'format' => 'f100679e6048d45e4a0b0b92dce1efce',
[34] Fix | Delete
'url' => 'https://pinterest.com/website/verify/',
[35] Fix | Delete
),
[36] Fix | Delete
'yandex' => array(
[37] Fix | Delete
'name' => 'Yandex.Webmaster',
[38] Fix | Delete
'key' => 'yandex-verification',
[39] Fix | Delete
'format' => '44d68e1216009f40',
[40] Fix | Delete
'url' => 'https://webmaster.yandex.com/sites/',
[41] Fix | Delete
),
[42] Fix | Delete
'facebook' => array(
[43] Fix | Delete
'name' => 'Facebook Domain Verification',
[44] Fix | Delete
'key' => 'facebook-domain-verification',
[45] Fix | Delete
'format' => 'rvv8b23jxlp1lq41I9rwsvpzncy1fd',
[46] Fix | Delete
'url' => 'https://business.facebook.com/settings/',
[47] Fix | Delete
),
[48] Fix | Delete
);
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Register Jetpack verification settings.
[53] Fix | Delete
*/
[54] Fix | Delete
function jetpack_verification_options_init() {
[55] Fix | Delete
register_setting(
[56] Fix | Delete
'verification_services_codes_fields',
[57] Fix | Delete
'verification_services_codes',
[58] Fix | Delete
array( 'sanitize_callback' => 'jetpack_verification_validate' )
[59] Fix | Delete
);
[60] Fix | Delete
}
[61] Fix | Delete
add_action( 'admin_init', 'jetpack_verification_options_init' );
[62] Fix | Delete
add_action( 'rest_api_init', 'jetpack_verification_options_init' );
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* Print the site verification meta in the page head.
[66] Fix | Delete
*/
[67] Fix | Delete
function jetpack_verification_print_meta() {
[68] Fix | Delete
$verification_services_codes = Jetpack_Options::get_option_and_ensure_autoload( 'verification_services_codes', '0' );
[69] Fix | Delete
if ( is_array( $verification_services_codes ) ) {
[70] Fix | Delete
$ver_output = "<!-- Jetpack Site Verification Tags -->\n";
[71] Fix | Delete
foreach ( jetpack_verification_services() as $name => $service ) {
[72] Fix | Delete
if ( is_array( $service ) && ! empty( $verification_services_codes[ "$name" ] ) ) {
[73] Fix | Delete
if ( preg_match( '#^<meta name="([a-z0-9_\-.:]+)?" content="([a-z0-9_-]+)?" />$#i', $verification_services_codes[ "$name" ], $matches ) ) {
[74] Fix | Delete
$verification_code = $matches[2];
[75] Fix | Delete
} else {
[76] Fix | Delete
$verification_code = $verification_services_codes[ "$name" ];
[77] Fix | Delete
}
[78] Fix | Delete
$ver_tag = sprintf( '<meta name="%s" content="%s" />', esc_attr( $service['key'] ), esc_attr( $verification_code ) );
[79] Fix | Delete
/**
[80] Fix | Delete
* Filter the meta tag template used for all verification tools.
[81] Fix | Delete
*
[82] Fix | Delete
* @module verification-tools
[83] Fix | Delete
*
[84] Fix | Delete
* @since 3.0.0
[85] Fix | Delete
*
[86] Fix | Delete
* @param string $ver_tag Verification Tool meta tag.
[87] Fix | Delete
*/
[88] Fix | Delete
$ver_output .= apply_filters( 'jetpack_site_verification_output', $ver_tag );
[89] Fix | Delete
$ver_output .= "\n";
[90] Fix | Delete
}
[91] Fix | Delete
}
[92] Fix | Delete
echo $ver_output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[93] Fix | Delete
}
[94] Fix | Delete
}
[95] Fix | Delete
add_action( 'wp_head', 'jetpack_verification_print_meta', 1 );
[96] Fix | Delete
[97] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function