• Resolved karenratte

    (@karenratte)


    I am using a plugin Mappress Pro, which uses Mappress.min.js and maps.googleapis.co
    I am also using another plugin USE GOOGLE LIBRARIES. Now, I am asked by the dev if you include google APIS which are already minified or if you include js that is already minified? I am using your beta version off your website. it looks like it will be a real winner if I can get this resolved. Thanks!

    https://www.ads-software.com/plugins/bwp-minify/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter karenratte

    (@karenratte)

    My apologies. I cleared my cache and reloaded the script and the new beta indicates that it is ignoring all the right scripts! This is Great! I hope to see great speed increases!

    How are you specifying the MapPress script to ignore? I have tried the following, to no avail

    mappress.min.js
    /wp-content/plugins/mappress-google-maps-for-wordpress/js/mappress.min.js
    wp-content/plugins/mappress-google-maps-for-wordpress/js/mappress.min.js
    https://mydomain.com…../wp-content/plugins/mappress-google-maps-for-wordpress/js/mappress.min.js

    Plugin Author Khang Minh

    (@oddoneout)

    @aleceiffel are you using version 1.2.3 of the plugin or 1.3.0RC2 from here: https://betterwp.net/332-bwp-minify-1-3-0-rc1-is-available/ ?

    I’m on version 1.2.3 but I will now try the RC, thx

    oky, using the RC and still seeing

    Uncaught ReferenceError: mapp is not defined

    Thread Starter karenratte

    (@karenratte)

    Are you using the Managed EnQueued Files tab to ignore minification of scripts?

    Yep, here are the items in my ignore list:

    wp-content/plugins/mappress-google-maps-for-wordpress/js/mappress.min.js
    mappress
    mappress-gmaps

    Plugin Author Khang Minh

    (@oddoneout)

    This is an incompatibility issue between Mappress and BWP Minify. Mappress seems to print its JS directly to footer before BWP Minify, without using document.ready method, so ignoring those scripts won’t work.

    It is possible to add support for Mappress in BWP Minify, but that is just hackish. The best way to do this is to have Mappress print js at priority 12 instead of 10 currently (found on mappress-google-maps-for-wordpress/mappress.php:87).

    Would you mind contacting its author to recommend a patch?

    For now you can replace that line in mappress.php with:

    add_action( ‘wp_print_footer_scripts’, array(&$this, ‘print_maps’), 12);

    and it should work without ignoring anything.

    Thread Starter karenratte

    (@karenratte)

    from the Mappress dev.
    MapPress queues its scripts using wp_enqueue_script(). In the page footer, the scripts are output by WordPress. Then, a ‘dynamic’ script is output to display each map. The sequence for action wp_print_footer_scripts is:
    1. WordPress function ‘_wp_footer_scripts’ is called to output all queued scripts
    2. MapPress outputs its dynamic scripts

    BWP seems to output the queued scripts after step 2, so the maps don’t display.

    I think the best solution would probably be to have BWP maintain the normal output sequence. I did try changing the MapPress action priority, but that had no effect. However, there’s an easier workaround: just set the option ‘load maps last’ on the MapPress settings screen. That will delay map display until the entire page is loaded – it’s slightly slower but it should work even if the scripts are output in a reverse order.

    Plugin Author Khang Minh

    (@oddoneout)

    Native support for Mappress has been added to final version of 1.3.0, but it’s a little hackish.

    The best fix would be changing priority as stated in my previous reply (not sure why it doesn’t work for you) OR using jQuery document ready method to wrap Mappress JS.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Breaks mappress plugin’ is closed to new replies.