Disappointing support and unresolved PHP compatibility bug
-
I am extremely disappointed with the current state of support. I reported a clear bug in the SG Optimizer plugin (sg-cachepress) related to PHP 8.x compatibility. Specifically, the Minifier.php file (line 309) triggers a “strpos(): Passing null to parameter #2” error because it lacks proper sanity checks.
Despite providing the full stack trace and identifying the exact line of code causing the issue, the support agent was completely unhelpful and dismissed my report without investigation. It’s frustrating when a customer does the debugging for you and is still brushed off. SiteGround used to have top-tier support; now it feels like they just want to close tickets as fast as possible. Fix your code.
UPDATE: Confirmed bug in Minifier.php & incompetent support
I’m updating my previous review with technical proof. After being told by support to “change my theme” (a custom theme that cost months of work), I did their job for them and found the bug in their own code.
In sg-cachepress/core/Minifier/Minifier.php at line 309, the plugin calls strpos() without validating the input. In PHP 8.1+, passing null to strpos triggers a deprecation/fatal error.
The developers tried to hide the issue using the @ (error suppression operator) before strpos. This is bad practice and doesn’t stop the error in modern PHP versions.
The crash is triggered by the WordPress Core handle wp-img-auto-sizes-contain. This is NOT a theme issue; it’s a native WordPress handle introduced in version 6.4. The plugin fails because it expects every handle to have a valid src URL, which is not always the case in WP Core.
The Fix (for the devs): Before line 309, add a null check for the host:
$style_host = wp_parse_url( $wp_styles->registered[ $handle ]->src, PHP_URL_HOST );
if ( null === $style_host ) continue;Workaround for other users (Update-proof): If your logs are being flooded with this PHP deprecation warning and you don’t want to touch the plugin’s core files, add this filter to your theme’s functions.php. It bypasses the bug by excluding the problematic WordPress core handle from minification:
add_filter( ‘sgo_css_minify_exclude’, function( $exclude_list ) {
$exclude_list[] = ‘wp-img-auto-sizes-contain’;
return $exclude_list;
});I hope this helps the community more than the official support helped me. Suggesting to ‘change the theme’ for a core PHP compatibility issue is not support, it’s a joke.
You must be logged in to reply to this review.