cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
279 stars 83 forks source link

Custom Field Thumbnails Not Caching #313

Closed h00die closed 2 years ago

h00die commented 2 years ago

Describe the bug Internal blog site, not accessible to the Internet. I have GD installed. Pick image from: Custom field, Lazy load: No, Custom field name: wpp_thumbnail, Resize image from Custom field?: Yes.

Popular Posts listing is not caching the images and serving local, instead direct linking to image in wpp_thumbnail field.

To Reproduce

  1. Create a post
  2. Set the wpp_thumbnail to an image and publish
  3. view homepage
  4. see image is not cached locally but linked to directly

Expected behavior The image is supposed to be caching locally, not direct linking.

Screenshots

Settings:

image

image

Widget:

image

Example post:

image

Image linked directly:

image

Environment:

cabrerahector commented 2 years ago

Hi @h00die,

~The https://i2.wp.com domain in the URL is not WordPress Popular Posts' doing though. Another plugin (or your hosting provider? Are you using WPP on wordpress.com?) is caching WPP's thumbnails on wp.com. Try following the troubleshooting instructions to find out if it's a plugin or your hosting provider doing this.~

Scratch that. I just woke up, must not be fully awake yet. I'll have a look and see if I can reproduce the issue.

h00die commented 2 years ago

Just for clarity, I'm self hosting. I picked that image as just a random image on the Internet that was hosted and could be accessed. I've tried images hosted on another internal server with no success as well

cabrerahector commented 2 years ago

Alright so I tried to reproduce the issue on localhost and WordPress Popular Posts (latest version) worked as expected: it generated a thumbnail from the provided URL and stored it on /wp-content/uploads/wordpress-popular-posts/.

Thumbnail Settings:

wpp--tools--thumbnail-settings

Post Edit screen:

post-edit-screen--wpp_thumbnail-custom-field

WPP block on the front-end:

wpp-widget-on-front-end

So I'm not really sure what's going on on your side.

I did my testing with the latest version of the plugin (5.4.2) and the latest WordPress release (5.8.2) but I can't say that that'll make a difference, I don't recall having changed anything custom field related between 5.3.2 (the version you have) and 5.4.2.

h00die commented 2 years ago

Seems to be working, thanks! Not exactly sure why it wasn't for me to start with

cabrerahector commented 2 years ago

A glitch in the Matrix. It happens :P

Thanks for reporting back, and have a nice week!