GZip Compression not working

I have enabled content compression through cpanel and have a success message "Optimize Website
Website optimization preferences updated. Content compression is now enabled.
Content compression is now enabled for all content."

But hummingbird is still telling me...
Gzip is not working properly:

- Your server may not have the "deflate" module enabled (mod_deflate for Apache, ngx_http_gzip_module for NGINX).
- Contact your host. If deflate is enabled, ask why all .htaccess or nginx.conf compression rules are not being applied.
If re-checking and restarting does not resolve, please check with your host or open a support ticket with us.

So I am opening a ticket with you. mod_deflate is on the server. What should I do?

  • Jordan

    Hello Dan,

    My brother encountered the same issue and it turned out he had the wrong server type selected.

    You can find out what server type you are using with this resource

    If that doesn't fix it then enable debug log in your wp-config.php file (located in root WP folder) by replacing define('WP_DEBUG', false); with this code:

    // Enable WP_DEBUG mode
    define('WP_DEBUG', true);
    
    // Enable Debug logging to the /wp-content/debug.log file
    define('WP_DEBUG_LOG', true);
    
    // Disable display of errors and warnings
    define('WP_DEBUG_DISPLAY', false);
    @ini_set( 'display_errors', 0 );

    Once you have enabled that try and turn on gzip again so the error appears then send your debug.log over here and it should tell us what's going on.

    Thanks,
    Jordan.

    Edit: Didn't think of it at the time but if the cPanel Website optimization uses the htacess which I assume it does, it's possible it's blocking the plugin from accessing it... I'm not sure on that so don't quote me. :wink:

  • Dimitris

    Hey Dan,

    hope you're doing good today! :slight_smile:

    Additionally to whatJordan said, which are correct, please share with us your .htaccess file (just rename it to .txt. remove any sensitive information and attach it here in your next reply).

    Also, please grant support access to your website, via WPMUDEV Dashboard plugin, as shown here: https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-5
    Just let us know here in your next reply, that access has been granted, as we don't get any notifications about it.

    Finally, please keep in mind that this may be happening due to some conflict with another plugin/theme, so please consider taking a backup of all files and database and proceed with a conflict test as better illustrated in a nice flow chart here:
    https://premium.wpmudev.org/wp-content/uploads/2015/09/Support-Process-Support-Process.gif
    Concept is to deactivate all other plugins apart from WPMUDEV Dashboard and HummingBird, activate a default theme like TwentySeventeen and re-check GZIP in HummingBird.
    If this resolves the issue, activate the remaining plugins/theme, one by one, until you reproduce the error again.
    If you don't want to do that test in your live installation, then a staging site will be needed, meaning a complete and exact copy of this installation into another location/folder in the same server, using a separate database.

    Warm regards,
    Dimitris

  • Dan

    gzip compression is working now. Problem seemed to fix itself or someone logged in and fixed it as I did give access. the error log is showing this though (I don't even have recent_global_posts_feed installed anymore!

    What should I do to fix this?

    [21-May-2018 15:52:21 UTC] PHP Notice: The called constructor method for WP_Widget in widget_recent_global_posts_feed is deprecated since version 4.3.0! Use

    __construct()
    instead. in /home/qkrme/public_html/wp-includes/functions.php on line 3903
    [21-May-2018 15:52:22 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/qkrme/public_html/wp-content/plugins/wp-defender/vendor/php_codesniffer/CodeSniffer/Tokenizers/PHP.php on line 973
    [21-May-2018 15:52:32 UTC] PHP Notice: The called constructor method for WP_Widget in widget_recent_global_posts_feed is deprecated since version 4.3.0! Use
    __construct()
    instead. in /home/qkrme/public_html/wp-includes/functions.php on line 3903
    [21-May-2018 15:52:33 UTC] PHP Notice: The called constructor method for WP_Widget in widget_recent_global_posts_feed is deprecated since version 4.3.0! Use
    __construct()
    instead. in /home/qkrme/public_html/wp-includes/functions.php on line 3903
    [21-May-2018 15:52:53 UTC] PHP Notice: The called constructor method for WP_Widget in widget_recent_global_posts_feed is deprecated since version 4.3.0! Use
    __construct()
    instead. in /home/qkrme/public_html/wp-includes/functions.php on line 3903

  • Nahid

    Hey Dan !
    Hope you are having a great day!

    I'm glad that Hummingbird's Gzip Compression is working as expected now.

    Most of the error logs must have been generated from the time when Recent Global Posts Widget plugin was activated. You can safely ignore them as they are just PHP warnings (which usually doesn't cause any negative impact in the workflow of the site) and they shouldn't be generating anymore since the plugin is not activated at the moment.

    There's one inconsistent fatal error generated due to an execution exceeding PHP's memory_limit, which can be resolved in further cases by increasing it's value. This handy guide can help you increase PHP's memory_limit.

    Hope this helps. Let us know if you need any further assistance regarding this. Thanks!

    Kind regards,
    Nahid

  • Dan

    Hi,

    You say that this cannot be happening, but it is.

    Here is what I just did.
    1. Checked through the installed plugings to see yet again if recent_global_posts_feed is installed. It isn't

    2. Logged in to check plugins directory, found a recent_global_posts.php file and deleted it

    3. deleted the debub.php file

    4 Went back to plugins page and refreshed

    5. Went back to FTP, downloaded the new debug.php file that had appeared and found..

    [22-May-2018 21:59:15 UTC] PHP Notice: The called constructor method for WP_Widget in widget_recent_global_posts_feed is deprecated since version 4.3.0! Use

    __construct()
    instead. in /home/qkrme/public_html/wp-includes/functions.php on line 3903
    [22-May-2018 21:59:27 UTC] PHP Notice: The called constructor method for WP_Widget in widget_recent_global_posts_feed is deprecated since version 4.3.0! Use
    __construct()
    instead. in /home/qkrme/public_html/wp-includes/functions.php on line 3903

    I need to stop this, can't just ignore it. It's a WPMUDEV plugin causing the issue,

  • Dan

    I have found it... not sure why but this plugin was uploaded in mu plugins. Porbably a mistake a make a while ago or it may have been put there by the installer/as per instalation instructions I am not sure. Never updated though obviously.

    Anyway, it is fixed now. Thanks for your help

    /*
    Plugin Name: Recent Posts Feed Widget
    Description:
    Author: Andrew Billits (Incsub)
    Version: 2.0
    Author URI:
    */

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.