• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

QUESTION About If first image is HTML code

hdghule

New member
Messages
3
Likes
0
Points
1
#1
Hello sir,

This is harshad ghule from india. I need to buy Auto Featured Image (Auto Post Thumbnail) plugin but before that i want to know that . my website is amazon affiliate website and amazon do not provide imges to the affiliate instaed they provide HTML code for the image and that we need to paste in our post. If my first image is in form of html code then can it automatically set as the first image.
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello.

Send us an example of the HTML code of the post/page so that I can answer your question.
 

hdghule

New member
Messages
3
Likes
0
Points
1
#3
Hey following is the html code


<a href="https://www.amazon.com/dp/B00CHQ8TO...e9420ebd7de3dfe938d6a79698a142&language=en_US" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00CHQ8TOO&Format=_SL250_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=giftforkids04-20&language=en_US" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=giftforkids04-20&language=en_US&l=li3&o=1&a=B00CHQ8TOO" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#4
Currently, the plugin does not support such images.
 
Messages
3
Likes
0
Points
0
#6
Ah. I also came across this issue and wanted to ask a new question, but it seems that it's not really a "problem" but rather a lack of functionality.

While @hdghule's use case might be a bit strange or unusual, in my case, I'm generating images automatically for RSS feeds coming from Blogger (among other platforms — but Blogger is a good example). As mentioned by @Temyk, the plugin doesn't deal with such images, but, interestingly enough, when manually adding a new image, and looking at the popup that shows all images detected on that page, those images from Blogger do appear perfectly!

In other words: it's obvious that APT can display those images, it just doesn't seem to be able to process them in some form, and therefore this process fails. Unfortunately, even though I have text-based image generation active as a fallback, in these cases, APT does not use it. Instead, it seems to attempt to use the image — since it is an image, after all! — but somehow fails its processing, and probably gives an internal error of some sort (not even with WP_DEBUG set to true anything is shown, so this is just a conjecture) which prevents further processing; that article will remain "forever" with a No image setting, unless, of course, I download the image from Blogger and upload it on WordPress manually — thus defeating the purpose of having an Auto Post Thumbnail plugin ;)

Note that this doesn't happen only with Blogger (or @hdghule's example). The same happens very often with all sorts of external images stored on CDNs — notably, Automattic's own CDN, Site Accelerator/Photon (or whatever they call it these days). The observed behaviour is the same: the image never shows up as being automatically generated, but APT doesn't fall back to a text-generated image, either.

Running the auto-generate option manually doesn't help, either; the result is precisely the same.

Sometimes (very rarely, and in difficult-to-reproduce situations), it is possible to get a "semi-automatic" generation. This works in the following way: on the Posts list, at the top, filter it for With Image (this is counter-intuitive, I know), and check all boxes for posts that show No Image. Then go to the Bulk actions operations dropdown and select Generate featured image. Again, as said: I don't have any idea why this works, and with which types/kinds it works, but at least it's faster than going through each image individually, clicking on No Image, and manually selecting a (valid) image...

There is a catch, though. Unlike the Generate images tab from the settings, which is specially programmed to deal with long processing times and will not timeout, the same is not the case with the method described above, since it goes through the built-in WordPress mechanisms — which are subject to timeouts! As such, depending on the speed and processing power of your server, and on the timeout settings, you might only be able to generate a few dozen images on each run. It's not as if you can display, say, 200 posts at a time, check them all, and hope that APT will generate all the images! That won't work at all. But I often manage to get, say, 20 autogenerated images at a time, before the timeout inevitably occurs — which is, in any case, much faster than doing it manually, one by one. And, as said, this will not work with all images, but it seems to be rather more successful than the other built-in mechanisms...

Perhaps there is a clue here for the plugin developers to figure out why APT does seem to hiccup with images stored on CDNs but not when it's called from the Bulk actions?... clearly, something is done differently in each of those cases, and knowing where it seems to be done correctly (at least, for most cases!) might help to get it working on the other places as well.

_______________

(Note: I'm a lifetime premium user, and never regretted my choice of this amazing plugin!)