tomusborne / wp-show-posts

Other
14 stars 11 forks source link

Image Resizer Fails in Some WPML Configurations #20

Open VR51 opened 6 years ago

VR51 commented 6 years ago

I have a WPML site that uses domain mapping. The Spanish and English versions of the site have different root domain names. Domain mapping is provided through a WPML feature that allows different domains to be used for different sites as opposed to the standard set up of different directories, subdomains or query strings for each site.

The root site is Spanish. The secondary site is English.

Images are not created for the English site. It appears the image resizer is not able to ascertain the URL of feature images because the domain name of the English site is not the same as the domain name of the Spanish site.

The error log shows:

WPSP_Resize.process() error: Image must be local

Proposed Fix

At the bottom of file wp-show-posts/inc/image-resizer.php there is a function called WPSP_Resize(). This has a WPML fix in it. Removing that WPML fix solves the problem.

I have used WP Show Posts with other WPML sites that do not use domain mapping. This issue does not exists in these sites.

I don't know the consequences of removing the WPML fix but I do know the site shows no problems so far.

VR51 commented 1 year ago

This issue still exists. The same issue existed in GeneratePress until GPP 1.5. See here https://generatepress.com/forums/topic/gp-and-wpml-multi-domain-gp-resize-not-working-as-expected/

@tomusborne