Support » Plugin: Easy Instagram » Cached images not rendering

  • Resolved roddyguy


    If I inspect the broken image link I see that it is trying to display “ig_cache_key=MTE4MzQ1ODYxNjAwMzgzMTMyMQ%3D%3D_standard_resolution-65×65.2”
    With a “2” as an extension instead of “jpg”. When I go and look at the cache folder, most files files are the same format, except there is one JPG version of each pic -> (I.E. wp-content/plugins/easy-instagram/cache/ig_cache_key=MTE3NzEwNzg3MzIzMTU3ODE3Mw%3D%3D_standard_resolution-65×65.jpg)

    Though, all other sizes edn with “.2” and my thumbnails are all broken links.

    Any ideas? Are these files caching wrongly? I have updated to the most recent version.

Viewing 8 replies - 1 through 8 (of 8 total)
  • I am having the exact same issue, and it started occurring sometime last week. Was reported *before* I upgraded to the latest version, leading me to believe that the root cause might not be in the plugin per se.

    Deleting the files and refreshing doesn’t help. The actual image (the .jpg one) works fine. the .2 files also work fine if renamed to have the .jpg extension. They are not corrupted.

    My site: (widget in the sidebar).
    Requesting the files directly via http results in a 404 error.

    There are two %3D (=) entities in the filenames. If I rename files to remove those, they can be served again. Compare (both files are on the server):
    (can’t be served)
    (can be served)

    I have wondered if my hosting provider has upgraded apache, php, regular expressions libraries or some such, but the more I think about it, I think it may be a change in how Instagram names their image assets, that is incompatible with the cache code for this plugin. In particular the regular expression in the save_remote_image() method.

    The asset urls currently in use look like

    I managed to get it working here by changing how file names are built in the cache function, save_remote_image in the file class-easy-instagram-cache.php.

    I replaced the regular expression matching at the top of the function with

    $filename = '';
    $remote_name = parse_url($remote_image_url, PHP_URL_PATH);
    $filename  .= $id . str_replace('/', '-', $remote_name);

    And that does the trick for now. Hopefully that can be helpful.

    Same errors about the cache today. Not showing my thumbnails at all.

    johnnycastrup’s answers solved my issues perfectly, though I added in an if statement to mirror what was already there, though I’m not certain it’s necessary.

    $filename = '';
    $remote_name = parse_url($remote_image_url, PHP_URL_PATH);
    if ($remote_name) {
    	$filename  .= $id . str_replace('/', '-', $remote_name);
    } else {
    	return null;

    Thanks friend!

    Hopefully the plugin author will fix this and release an updated version so we don’t have to keep using this (awesome) hack.

    That did the trick. Nice job Johnny! Thanks for contributing Kenny! Hopefully the plugin developer will take notice.

    Hi there, I am experiencing the exact same problem with my Easy Instagram Feed. Please can you explain how, and where I make those changes. Thank you in advance

    Hi L12A.

    It’s right at the top of the function save_remote_image in the file /wp-content/plugins/easy-instagram/include/class-easy-instagram-cache.php around line 337.

    I hope that helps.

    Thank you johnnycastrup and Kenny!! Solved the caching problem.

    Plugin Author VeloMedia


    johnnycastrup, Kenny, thank you both for solving this, your fix was added in version 3.2 of the plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Cached images not rendering’ is closed to new replies.