On the website (as in the old code and the new) at the bottom, in the footer, are counters Metrics and LiveInternet.
The new code was launched on the website on the New 2019.
As a result, the download speed increased, Speed test Google showed excellent optimization results. Externally, on all browsers and gadgets too, everything looks and works great. But, oddly enough, Yandex.The metric immediately showed deterioration in two indicators of a site:
1. Attendance in the Metric has dropped against LiveInternet 50-100 people a day. Early Metrics showed a relatively attendance of more than Li about the same 50-100 people a day. And considering that the Metric can "see" even those visitors who "does not see" Li (for example, those who are turned off at the JS), then the Metric needs to show more than Li.
2. Refusals have increased. With the old code the failure was at the level of 7-8%, with the new code failures stable steel 9.5-10.5 per cent.
What could be the reason of such "miracles"?
What was done:
1 - Deleted all (except SEO and CKeditor) plug-ins and has prescribed the proper functions.
2 - On the left only the code (HTML, CSS, JS) for the page, nothing more on the page doesn't load, no hidden elements.
3 - turned Off some functionality of WordPress:
// Disable the REST API itself
// Disable the filters in REST API
remove_action( 'xmlrpc_rsd_apis', 'rest_output_rsd' );
remove_action( 'wp_head', 'rest_output_link_wp_head', 10, 0 );
remove_action( 'template_redirect', 'rest_output_link_header', 11, 0 );
remove_action( 'auth_cookie_malformed', 'rest_cookie_collect_status' );
remove_action( 'auth_cookie_expired', 'rest_cookie_collect_status' );
remove_action( 'auth_cookie_bad_username', 'rest_cookie_collect_status' );
remove_action( 'auth_cookie_bad_hash', 'rest_cookie_collect_status' );
remove_action( 'auth_cookie_valid', 'rest_cookie_collect_status' );
remove_filter( 'rest_authentication_errors', 'rest_cookie_check_errors', 100 );
// Disable events REST API
remove_action( 'init', 'rest_api_init' );
remove_action( 'rest_api_init', 'rest_api_default_filters', 10, 1 );
remove_action( 'parse_request', 'rest_api_loaded' );
// Embeds the associated REST API
remove_action( 'rest_api_init', 'wp_oembed_register_route' );
remove_filter( 'rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4 );
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
// pasting from other sites
remove_action( 'wp_head', 'wp_oembed_add_host_js' );