• Resolved luisimpulsum

    (@luisimpulsum)


    We have a problem with the integration between the plugins WP-Spamshield and Autoptimize. The related documentation explains a couple of ways to operate WP-Spamshield with Autoptimize, which are as follows:

    1.To force javascript to be in the header for Autoptimize. This method, however, is not valid for this website because of the upload speed requirements (80%). To reach GTmetrix and Google PageSpeed valid scores, javascript has to be set in the footer, or as a defer or async (which for practical purposes is like putting it in the footer).

    2.Forcing the WP-Spamshield compatibility mode and configuring the settings in the Autoptimize plugin not to include WP-Spamshield jquery and wp-scripts for its optimization. With this method, it should theoretically work, but it doesn’t. Anyhow, it would not be a valid method neither, because there would be a couple of scripts in the header, which would cause a low score on GTmetrix and Google PageSpeed.

    We have been testing different ways of minification and optimization, and in all cases we’ve gotten the same result: when a Contact-Form7 form is sent, WP-Spamshield should inject a couple of extra fields in the POST that is made to the server, but it doesn’t. The only way is deactivating the javascript minification.

    Any help about this issue will be welcome.
    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • @luisimpulsum

    Actual site load time is normally more important that GTmetrix and Google PageSpeed scores.

    Option 1 should work fine.

    Plugin Contributor redsand

    (@redsand)

    @luisimpulsum,

    I’ll be happy to address your questions.

    Before I get too far into this, I’ll just take a second to point out that the WP-SpamShield Support page is our main support venue for this plugin, not the forums here, so if you need further help after this, please head on over there. We’ve also put together some informative resources for plugin users, such as the plugin documentation, the FAQs, and Troubleshooting Guide, so I encourage you to make full use of those.

    Please see two FAQs that address these issues:

    Thanks @lukecavanagh for your comment – you are 100% correct…the actual site load time is far more important than the scores.

    @luisimpulsum:

    The scores are there to be an indicator to help people improve the load time. The goal of speed optimization for a site is not to get a high GTmetrix, PageSpeed, or YSlow score, but to get a fast-loading site.

    We’ve been in touch with Frank – the author of Autoptimize – to build compatibility between the two plugins. We’ve discussed some of the issued you’re bringing up here, and have come up with ways to have the two plugins work well together. We agreed on some compromises that aren’t going to negatively affect a site’s load time. I’m sure there are further ways that we can make improvements, but anything we come up with from here on out isn’t going to make or break your site speed.

    This method, however, is not valid for this website because of the upload speed requirements (80%).

    You’re stating this as if it’s a generally accepted fact, and that simply isn’t true.

    It is a misconception that moving JavaScript to the footer will automatically speed up your site, just as it is a misconception that having JavaScript in the header will automatically slow your site down. Optimizing a site requires a fine-grain approach.

    We do speed-optimization for clients day in and day out, so this is something we’re quite familiar with. We have developed our own JS/CSS minification plugin, RS Head Cleaner Plus, and you are welcome to try it out. It is built for brute speed, whereas Autoptimize is designed for maximum compatibility – each has their strengths and some different approaches to optimization. We recommend both to people depending on their needs.

    There are some situations where you will need to ignore advice given by automated evaluation systems such as PageSpeed and YSlow. They are giving you a list of things that typically slow down a site. You need to remember that this is general advice and not every item will be applicable to every site. There are a number of speed issues that automated evaluations like these cannot properly address. You can follow all their advice and still have a slow site if you have other undiagnosed issues on your site, yet they will give you a high score. Conversely, you can ignore some of their advice and improve your actual speed more than if you follow it exactly. Optimizing a site for speed requires knowing when each item is applicable, along with a little common sense.

    Anyhow, it would not be a valid method neither, because there would be a couple of scripts in the header, which would cause a low score on GTmetrix and Google PageSpeed.

    Again, I think you have a misconception here.

    jQuery scripts generally need to stay in the header of a site for maximum compatibility, especially with WordPress. Other scripts may be moved to the footer. (Caveat: If you move a script to the footer, you need to test and make sure it doesn’t break any functionality.)

    I could discuss this topic all day, but unfortunately I can’t do that. I will offer a few quick points to consider. You can still have a blazing fast site with jQuery or other JavaScripts in the header. We’ve got sites loading .6 seconds with jQuery in the header.

    Each of these make more of a difference to site speed than whether JavaScript is in the header or footer:

    • It is far more important to concatenate scripts (combine them) and reduce the number of scripts and stylesheets loaded, than whether they are in the header or the footer.
    • It is also far more important to minify scripts and CSS, and serve gzipped files.
    • You can speed up the load time of scripts by using a CDN, and there are even CDNs that host the most popular JavaScript libraries, that you can use for free. If you even just do this, it makes a big difference.
    • Using a caching plugin and configuring your server to properly leverage browser caching.
    • Optimizing your image file sizes, and serving images from a CDN. Again there are free CDNs specifically for images.
    • One item that doesn’t get talked about enough – optimizing your database. A lot of sites run much slower than they need to because of a bloated database. Make sure your database is being regularly maintained (optimized, repaired, etc) and that you don’t have any extra bloat from old plugins, themes, etc.

    I hope this information helps. If you have any further questions please check out the plugin documentation and submit a support request.

    – Scott

    • This reply was modified 7 years, 6 months ago by redsand.
    • This reply was modified 7 years, 6 months ago by redsand.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP-Spamshield and Autoptimize integration’ is closed to new replies.