Support » Plugin: Mistape » Mistape is incompatible with the official AMP plugin for WordPress

  • Mistape outputs some additional unstyled HTML code (the report form) at the end of the document. Probably because css/js is not fully loaded.

    The plugin or any output should be probably disabled at amp pages.

    Currently, we use the following code to fix this issue:

    /**
     * Disables Mistape plugin on amp pages
     */
    function ap_deco_mistape_amp_disable()
    {
    
        if (!function_exists('ap_is_amp') || !ap_is_amp() || !class_exists('Deco_Mistape')) {
            return;
        }
        $mistape = Deco_Mistape::get_instance();
    
        remove_filter('the_content', array($mistape, 'append_caption_to_content'), 1);
        remove_action('wp_footer', array($mistape, 'insert_dialog'), 1000);
        remove_action('wp_enqueue_scripts', array($mistape, 'front_load_scripts_styles'));
        remove_action('wp_print_styles', array($mistape, 'custom_styles'), 10);
    }
    
    add_action('wp', 'ap_deco_mistape_amp_disable', 11);

    but it will be nice to have this fixed in the core.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Mistape is incompatible with the official AMP plugin for WordPress’ is closed to new replies.