File "3.7.php"

Full path: /home/kosmetik/public_html/wp-content/plugins/wp-rocket/inc/deprecated/3.7.php
File size: 4.87 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

defined('ABSPATH') || exit;
if (!class_exists('Minify_HTML')) {
    require_once __DIR__ . '/vendors/classes/class-minify-html.php';
}
if (!class_exists('WP_Rocket\\Subscriber\\Optimization\\Minify_HTML_Subscriber')) {
    require_once __DIR__ . '/subscriber/admin/Optimization/class-minify-html-subscriber.php';
}
class_alias('\\WP_Rocket\\Engine\\Heartbeat\\HeartbeatSubscriber', '\\WP_Rocket\\Subscriber\\Heartbeat_Subscriber');
function rocket_deactivate_inline_js_on_wp_serveur($html_options)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (isset($html_options['jsMinifier'])) {
        unset($html_options['jsMinifier']);
    }
    return $html_options;
}
function rocket_deactivate_js_minifier_with_appbanner($html_options)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (isset($html_options['jsMinifier']) && class_exists('AppBanners')) {
        unset($html_options['jsMinifier']);
    }
    return $html_options;
}
function rocket_maybe_deactivate_minify_html($old_value, $value)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if ($value !== $old_value && 'on' === $value) {
        update_rocket_option('minify_html', 0);
    }
}
function rocket_maybe_disable_minify_html()
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (is_plugin_active('autoptimize/autoptimize.php') && 'on' === get_option('autoptimize_html')) {
        return true;
    }
}
function rocket_deactivate_js_minifier_with_revslider($html_options)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (isset($html_options['jsMinifier']) && class_exists('RevSliderFront')) {
        unset($html_options['jsMinifier']);
    }
    return $html_options;
}
function rocket_disable_emoji()
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (rocket_bypass()) {
        return;
    }
    remove_action('wp_head', 'print_emoji_detection_script', 7);
    remove_action('admin_print_scripts', 'print_emoji_detection_script');
    remove_filter('the_content_feed', 'wp_staticize_emoji');
    remove_filter('comment_text_rss', 'wp_staticize_emoji');
    remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
    add_filter('emoji_svg_url', '__return_false');
}
function rocket_disable_emoji_tinymce($plugins)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (is_array($plugins)) {
        return array_diff($plugins, ['wpemoji']);
    }
    return [];
}
function rocket_disable_embeds_init()
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (rocket_bypass()) {
        return;
    }
    global $wp;
    $wp->public_query_vars = array_diff($wp->public_query_vars, ['embed']);
    add_filter('rest_endpoints', 'rocket_disable_embeds_remove_embed_endpoint');
    add_filter('oembed_response_data', 'rocket_disable_embeds_filter_oembed_response_data');
    add_filter('embed_oembed_discover', '__return_false');
    remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);
    remove_action('wp_head', 'wp_oembed_add_discovery_links');
    remove_action('wp_head', 'wp_oembed_add_host_js');
    add_filter('tiny_mce_plugins', 'rocket_disable_embeds_tiny_mce_plugin');
    add_filter('rewrite_rules_array', 'rocket_disable_embeds_rewrites');
    remove_filter('pre_oembed_result', 'wp_filter_pre_oembed_result', 10);
    add_action('enqueue_block_editor_assets', 'rocket_disable_embeds_enqueue_block_editor_assets');
    add_action('wp_default_scripts', 'rocket_disable_embeds_remove_script_dependencies');
}
function rocket_disable_embeds_tiny_mce_plugin($plugins)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    return array_diff($plugins, ['wpembed']);
}
function rocket_disable_embeds_rewrites($rules)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (empty($rules)) {
        return $rules;
    }
    foreach ($rules as $rule => $rewrite) {
        if (false !== strpos($rewrite, 'embed=true')) {
            unset($rules[$rule]);
        }
    }
    return $rules;
}
function rocket_disable_embeds_remove_embed_endpoint($endpoints)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    unset($endpoints['/oembed/1.0/embed']);
    return $endpoints;
}
function rocket_disable_embeds_filter_oembed_response_data($data)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (defined('REST_REQUEST') && REST_REQUEST) {
        return false;
    }
    return $data;
}
function rocket_disable_embeds_enqueue_block_editor_assets()
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    wp_enqueue_script('rocket-disable-embeds', WP_ROCKET_ASSETS_JS_URL . 'editor/editor.js', ['wp-edit-post', 'wp-editor', 'wp-dom'], WP_ROCKET_VERSION, true);
}
function rocket_disable_embeds_remove_script_dependencies($scripts)
{
    _deprecated_function(__FUNCTION__ . '()', '3.7');
    if (!empty($scripts->registered['wp-edit-post'])) {
        $scripts->registered['wp-edit-post']->deps = array_diff($scripts->registered['wp-edit-post']->deps, ['wp-embed']);
    }
}