• Hi,

    I’ve just tried installing and activating Super Optimizer for the first time, but I wasn’t able to turn on or off any of its options.

    Here’s a few related lines I saw on my server’s error_log:

    [27-Oct-2023 21:31:15 UTC] PHP Warning:  Undefined variable $minifier in /home/macmagazine/public_html/wp-content/plugins/sg-cachepress/core/Minifier/Minifier.php on line 204
    [27-Oct-2023 21:31:15 UTC] PHP Fatal error:  Uncaught Error: Call to a member function minify() on null in /home/macmagazine/public_html/wp-content/plugins/sg-cachepress/core/Minifier/Minifier.php:204
    Stack trace:
    #0 /home/macmagazine/public_html/wp-content/plugins/sg-cachepress/core/Minifier/Minifier.php(251): SiteGround_Optimizer\Minifier\Minifier->minify_scripts_lib('WOFF', '/home/macmagazi...', '/home/macmagazi...')
    #1 /home/macmagazine/public_html/wp-content/plugins/sg-cachepress/core/Minifier/Minifier.php(330): SiteGround_Optimizer\Minifier\Minifier->check_and_create_file('/home/macmagazi...', '/home/macmagazi...')
    #2 /home/macmagazine/public_html/wp-includes/class-wp-hook.php(310): SiteGround_Optimizer\Minifier\Minifier->minify_styles('')
    #3 /home/macmagazine/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
    #4 /home/macmagazine/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #5 /home/macmagazine/public_html/wp-includes/functions.wp-styles.php(57): do_action('wp_print_styles')
    #6 /home/macmagazine/public_html/wp-includes/class-wp-hook.php(310): wp_print_styles(false)
    #7 /home/macmagazine/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
    #8 /home/macmagazine/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #9 /home/macmagazine/public_html/wp-includes/general-template.php(3053): do_action('wp_head')
    #10 /home/macmagazine/public_html/wp-content/themes/newsblock/header.php(17): wp_head()
    #11 /home/macmagazine/public_html/wp-includes/template.php(785): require_once('/home/macmagazi...')
    #12 /home/macmagazine/public_html/wp-includes/template.php(720): load_template('/home/macmagazi...', true, Array)
    #13 /home/macmagazine/public_html/wp-includes/general-template.php(48): locate_template(Array, true, true, Array)
    #14 /home/macmagazine/public_html/wp-content/plugins/canvas/page-templates/template-canvas-fullwidth.php(15): get_header()
    #15 /home/macmagazine/public_html/wp-includes/template-loader.php(106): include('/home/macmagazi...')
    #16 /home/macmagazine/public_html/wp-blog-header.php(19): require_once('/home/macmagazi...')
    #17 /home/macmagazine/public_html/index.php(17): require('/home/macmagazi...')
    #18 {main}
      thrown in /home/macmagazine/public_html/wp-content/plugins/sg-cachepress/core/Minifier/Minifier.php on line 204

    Any ideas? Cheers!

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Support Tsvetan Mitev

    (@tsvetanm)

    Hello @rfischmann,

    Such errors typically arise when there’s a conflict with other plugins or the website theme. To identify the exact plugin that’s interfering with Speed Optimizer, you’ll need to temporarily disable your other website plugins one at a time, testing the Speed Optimizer settings after each deactivation. If the error persists even after disabling all the plugins, consider switching to the default WordPress theme and testing again.

    Once you’ve identified the problematic component, please provide us with its name, and we’ll investigate this unusual behavior further.

    Best Regards,

    Tsvetan Mitev

    Thread Starter Rafael Fischmann

    (@rfischmann)

    Just tried that (disabling all plugins and switching to the default WordPress theme) and it still didn’t work.

    Is there any chance the plugin is incompatible with PHP 8.2, maybe?

    Plugin Support Plamen M

    (@plamenm)

    Hello Rafael,

    The plugin is fully compatible with PHP 8.2. We even improved its code compatibility further back in version 7.3.2, released on June 6th. The issue is most probably caused either by some cached content kept somewhere which is preventing the plugin from writing its toggled option (server, site, plugin, theme, firewall, proxy, CDN…) or some security feature, which is preventing such site modifications.

    Are you using any third party caching mechanisms, like a CDN or a Firewall / Proxy service? Try turning them temporarily off and then try turning on or off the options in the plugin.

    If your hosting has any server based caching mechanisms, try disabling these also temporarily, to see if they are preventing the plugin from writing its toggled setting properly.

    You may also want to check or flush the .opcache caching of your PHP environment.

    If you are using any manually configured or plugin enabled security in your site, which is preventing writing to the database or the site files, this may also cause the issue: too strict file or folder permissions, DISALLOW_FILE_EDIT or any options for database protection.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

    Thread Starter Rafael Fischmann

    (@rfischmann)

    Thanks for the reply, @plamenm. Unfortunately I still can’t make it work, even after:

    • I’ve switched from suphp/PHP-FPM (with OPcache) to LSAPI as our PHP handler;
    • Temporarily turned off Cloudflare by switching the cloud in the proxy setting to DNS-only;
    • Turned off Solid Security (formerly iThemes Security) feature that disables the File Editor and adds that DISALLOW_FILE_EDIT setting to wp-config.php;
    • Temporarily turned off object caching from the Redis Object Cache plugin.

    The same error I pasted above still occurs, and these is what I see when I try to turn any options on/off in the plugin: https://d.pr/i/IAonuX and https://d.pr/i/Bd0Ejb

    Don’t know what else to look into…

    Plugin Support Plamen M

    (@plamenm)

    Thank you for the update.

    With all of the above turned off, again, please:

    • Try deactivating and uninstalling the ?Speed Optimizer – The All-In-One WordPress Performance-Boosting Plugin. Then do a clean installation of the plugin (not an upgrade);
    • Then Use this W3 School tutorial to create a test php file in your site, access it through a web browser and let us know if the $_SERVER global variable is defined on your server environment:

    https://www.w3schools.com/php/php_superglobals_server.asp

    We expect your reply.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

    • This reply was modified 1 year ago by Plamen M.
    Thread Starter Rafael Fischmann

    (@rfischmann)

    It just outputted this, @plamenm:

    /test_serv.php
    macmagazine.com.br
    macmagazine.com.br

    Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0
    /test_serv.php

    Thread Starter Rafael Fischmann

    (@rfischmann)

    Oh, and this error:

    [29-Oct-2023 10:20:52 UTC] PHP Warning: Undefined array key “HTTP_REFERER” in /home/macmagazine/public_html/test_serv.php on line 8

    Plugin Support Plamen M

    (@plamenm)

    Thank you for the update. This might indeed be one of the issues. Since we are not able to reproduce the issue on our end, could you please also provide us with the HAR file from your browser’s developer console while reproducing the errors. You can read more on how to fetch the HAR file here:

    https://help.okta.com/oag/en-us/content/topics/access-gateway/troubleshooting-with-har.htm

    You can then ZIP the HAR file to a downloadable location in your site’s structure or upload it to a shared link in a Cloud storage. We will confirm it after we download the file so that you can then remove it if you want.

    We look forward to your reply.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

    Thread Starter Rafael Fischmann

    (@rfischmann)

    Of course, here you go: https://d.pr/f/ugDqKf

    Please let me know when you have downloaded it.

    Plugin Support Plamen M

    (@plamenm)

    Thank you, I downloaded the file. You may proceed with deleting it, if you want.

    Please, allow us time to review the file and discuss it further with the plugin developers. We will then update this thread with more details.

    Your patience will be appreciated.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

    Thread Starter Rafael Fischmann

    (@rfischmann)

    Of course, thanks a lot @plamenm.

    Plugin Support Plamen M

    (@plamenm)

    Rafael, I am sorry for this, the download was corrupted by the security of my browser. Could you please upload it once again.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

    Thread Starter Rafael Fischmann

    (@rfischmann)

    No worries: https://d.pr/f/2szu4t

    Plugin Support Plamen M

    (@plamenm)

    The download worked fine this time and I verified that I am able to open the archive without issues.

    You can again purge the upload link.

    Thank you for your patience and understanding.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

    Thread Starter Rafael Fischmann

    (@rfischmann)

    Done, thanks.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘PHP Fatal error related to Minifier’ is closed to new replies.