Hello there @makattack,
We have done some troubleshooting and have provided a solution for you. We have added an exclude filter for the external assets that the plugin is using. The code is currently located in the wp-config file.
add_filter( 'sgo_javascript_combine_excluded_external_paths', 'exclude_cypress' );
function exclude_cypress( $paths ) {
$paths[] = 'pages.convertkit.com';
return $paths;
}
This is a hook that is excluding the external paths from the combination and now everything should be working as expected. You can move that code in the functions.php of your theme if you wish.
We had a test site tet up with the plugin and we did not experience the issue you were having, when, so keep in mind that this may be caused by another plugin or if you are using duplicate optimization features.
We always recommend not duplicating optimizations, since it may lead to unexpected and unwanted behavior.
Kind Regards,
Stoyan
Hello there Stoyan,
Thank you for such a quick reply.
I checked and I do not have another plugin for optimization just SG. So I do not think that is the problem.
Additionally, when I entered the code provided this is the error I received. Not sure what that means. Do you?
Your PHP code changes were rolled back due to an error on line 179 of file wp-content/themes/charlotte-theme/functions.php. Please fix and try saving again.
Cannot redeclare exclude_cypress() (previously declared in wp-config.php:98)
Hey there @makattack,
I meant that your theme or some of your plugins may have options for combining and minifying JS and CSS files.
You got this error because you have to first remove the code we’ve added to the wp-config and then paste it in the functions.php of your theme.
That should fix the error you are getting.
if you have any issues after that feel free to contact us again!
Kind Regards,
Stoyan
Suggestion: Check and see if your page is calling wp_footer();
Without that, the necessary javascript to reveal lazy-loaded images may not get loaded.
Suggestion for Siteground: Can you offer a way to exclude certain pages/posts (by using the slug), as well as your CSS rule? In some situations we cannot add a class to an image, so it would be helpful to exclude using the slug of a page/post.
I think the suggestion from bkproductions is a great one.