• Resolved makattack

    (@makattack)


    I’m having some problems with the SG optimizer. It is not loading images for my convertkit landing pages via the convertkit plugin.

    https://www.makedaandrews.com/nmsk/

    I reached out to convertkit and they were able to determine that it was the SG optimizer causing the problem.

    When I disabled the plugin the landing page image appeared but when I enabled it, it disappeared.

    I also disabled lazy loading (as I saw that as a solution in previous threads) but it still has not worked.

    Image is not visible when sg optimizer is activated.

    I’m at a loss as to what do next. Any suggestions? How do I get the image to appear as it should on the landing page?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    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

    Thread Starter makattack

    (@makattack)

    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)

    Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    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.

    Thread Starter makattack

    (@makattack)

    I think the suggestion from bkproductions is a great one.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Image loading problems’ is closed to new replies.