• Resolved bjsmith3

    (@bjsmith3)


    I had been banging my head as to why some of my images would cache fine while others would not. I found that the broken image URLs contained spaces and that two steps were needed to make sure the image cache handled them correctly.

    In wpomatic.php go to line 709 and use this code instead:

    foreach($urls as $url)
            {
              $url = str_replace(" ","%20",$url); // change spaces to %20 so the image cache doesn't fail
              $newurl = $this->cacheRemoteImage($url);
              if($newurl) {
              $url = str_replace("%20"," ",$url); // change %20 back to spaces now because $content has spaces
                $content = str_replace($url, $newurl, $content);
              }
            }

    Basically, this is a quick hack that will encode spaces to %20 first, which allows the cache to complete successfully. Then prior to updating our post with the cached image we convert the search string back to spaces (because $content needs spaces in it)

    Hope this helps resolve problems for a few of you. And I really hope they release the new version soon … I’ve been refreshing the wpomatic twitter status about every 10 minutes for the last week.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP-o-Matic] Image Caching Fix’ is closed to new replies.