• Frederic

    (@frederichesse)


    Hello,

    is this plugin compatible with the multilingual plugin “WPML”?

    In our environment, the plugin seems to work in principle. However, the internal image urls are only replaced in the main language “English”. The internal urls are still used in the other languages.

    Note: The “Parse page for images” setting does not solve the problem.

    Is there anything to consider with this setup? Or is there a known workaround for this problem?

    Many thanks for any help in advance.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Anton Vanyukov

    (@vanyukov)

    Hi @frederichesse,

    Yes, there is an integration that fixes WPML issues, previously reported by other users. However, if there’s something that is not working for you, I can definitely have a look. Could you please let me know how you have WPML set up? Is WPML set to duplicate attachments? Which version are you using?

    Best regards,
    Anton

    Thread Starter Frederic

    (@frederichesse)

    Hi @vanyukov

    thanks for your quick response and sorry for my relatively late reply. We have tried to debug the problem a bit further on our side to describe the problem better.

    Yes, there is an integration that fixes WPML issues, previously reported by other users.

    Can this information be found somewhere? We didn’t find any other support thread on this topic, at least not right away. But we probably just overlooked it.

    Which version are you using?

    The following WPML plugins are installed and activated:

    • WPML Multilingual CMS: 4.6.9
    • WPML SEO: 2.1.0
    • WPML String Translation: 3.2.9

    The following WPML plugin is installed but deactivated. This plugin was already deactivated when we took over the project. We cannot say whether this plugin was once used or not:

    • WPML Media: 2.7.3

    Is WPML set to duplicate attachments?

    I’m not 100% familiar with WPML, but I think it’s about the following configuration, right?

    Media Translation:
    [X]Set language information for existing media
    [X]Translate existing media in all languages
    [X] Duplicate existing media for translated content
    [X] Duplicate the featured images for translated content

    How to handle media for new content:
    [X] When uploading media to the Media library, make it available in all languages
    [X] Duplicate media attachments for translations
    [X] Duplicate featured images for translations

    If I understand this correctly, then WPML is set to duplicate attachments.

    —–

    To better understand the problem, we have now tried the following. We have uploaded two images each via the English and German media library. Then we created a new test page for English and German, where we added these images. We noticed the following behaviour. The image url’s of the images that were uploaded in the English media library were replaced correctly on the English page and the image url’s that were uploaded in the German media library were replaced correctly on the German page. This means that the internal url is only replaced if the image was uploaded in the language-specific media library.

    On the other hand, if we duplicate the English page into another language, the same images are still output correctly in the other language with the external cloudflare url.
    During this test, we noticed that WPML uses a different “wp-image-id” for the same images in each language version.

    Example:
    An image that was uploaded in the English media library uses the ID “wp-image-70551” on English pages. The same image uses the ID “wp-image-70553” on the German pages. Technically, however, it is the same image on the server.

    This means that the replacement is controlled via the “wp-image-id”. However, images are only replaced if the ID is used from the language where the image was uploaded.

    Now the question is how we can work around the problem. In theory, we could now go through all pages and manually replace the “wp-image-id” of the images on all pages with the original upload ID. This would solve the problem, but is unfortunately not realistic as this project already has a large number of pages, languages and images. In addition, we do not know in which language the images were uploaded. And we assume that the images were uploaded in different languages.

    Is there already a known technical workaround for this problem, where the pages do not have to be edited or the images do not have to be re-uploaded?

    Can the plugin be updated so that the “wp-image-id” of the other languages is also exchanged correctly? Or that the URL replacement is not only done via the “wp-image-id” but via the path of the image itself?

    Perhaps we are also overlooking something on our site.
    And again many thanks for any help in advance.

    Plugin Author Anton Vanyukov

    (@vanyukov)

    Hi @frederichesse,

    I don’t remember exactly where the WPML issue originated, but the integration is inside the app/integrations/class-wpml.php in the plugin folder.

    Basically, the idea was that when WPML was detected, the plugin would attempt to use the original image and ignore all other images. I think, the issue now is that the Cloudflare Images hash is saved only for the main image, and when the second image is found, the plugin is not able to find the hash and replace the image.

    Unfortunately, I don’t have a copy of WPML. If you can send me your version to run some tests, please reach out to me via the contact form here: https://vcore.au/contact-us/ and I should be able to fix this.

    Best regards,
    Anton

    Thread Starter Frederic

    (@frederichesse)

    Hi @vanyukov

    we have sent you a download link for the plugin via the form.

    Best regards,
    Frederic

    Thread Starter Frederic

    (@frederichesse)

    Hello @vanyukov

    We already sent this feedback to you by email on 18 March. We will post the current status here in this thread. Maybe someone else has the same problem and can add some feedback.

    We have seen that a release version 1.9 with a first bugfix has already gone live. We have tested the fix in the 1.8.1-beta.2 release you provided and in the official 1.9 version.

    1. In the beta version there was a problem with the single upload/remove feature. It seems to be fixed in the current version of the plugin. 

    2. Unfortunately, the bugfix doesn’t seem to be working 100% yet. Images uploaded to the media library in the main language (English) are now displayed correctly in all languages via the Cloudflare url. Images uploaded to the other language versions (not main language) are output in their own language with internal url and in the other languages correctly with Cloudflare URl. (The bug is still present in the current 1.9 version).

    Example:
    – Images that was uploaded in the main English media-library -> Image is output correctly in all languages with Cloudflare URL.
    – Images that was uploaded in the German media-library -> is output in the German language with an internal URL, but displayed correctly in the English, Spanish and other language versions with a Cloudflare URL.
    – Images that was uploaded in the Spanish media-library -> is output in the Spanish language with an internal URL, but is displayed correctly with a Cloudflare URL in the English, German and other language versions.

    3. Since we do not know whether the bug with the missing responsive versions is a problem with WPML at all and we cannot reproduce the error specifically, it does not make much sense to continue to list the bug here. We would create a new thread for this problem.

    Could you take another look at the existing problem? (2.) And again many thanks for any help in advance.

    Best regards,
    Frederic

    Plugin Author Anton Vanyukov

    (@vanyukov)

    Hi @frederichesse,

    Have you tried reseting the ignored images? If this doesn’t help, you might need to manually run a query to remove all the skip image meta values from the database. Something like this:

    DELETE FROM wp_postmeta WHERE meta_key = '_cloudflare_image_skip'

    Please make sure you have a copy of the database before running any SQL queries directly.

    Best regards,
    Anton

    Thread Starter Frederic

    (@frederichesse)

    hello @vanyukov

    We haven’t tried that until now. We have now reset the “skip image meta values” once via the backend and also checked the database to see if there are still entries hidden somewhere. Unfortunately, this has not fixed the problem. The problem still persists. As further info we have removed all images from Cloudflare after each update of the plugin and offloaded the images again.

    The 1.9 version has already changed the behavior of the output. We assume that something is still not quite right here.

    In the 1.8 version the following behavior was given:

    • Images that were uploaded in the English (main language) media library were output correctly in the frontend in their own language (English) with the cloudflare url and in the other languages (German, Spanish, French) with an internal url.
    • Images uploaded in the German (secondary language) media library were output correctly in the frontend in their own language (German) with the cloudflare url and in the other languages (English, Spanish, French) with an internal url.
    • Images uploaded in the French (secondary language) media library were output correctly in the frontend in their own language (French) with the cloudflare url and in the other languages (English, Spanish, French) with an internal url.
    • etc.

    In the 1.9 version the following behavior is now given:

    • Images uploaded in the English (main language) media library are displayed correctly in the frontend in all languages with the cloudflare url.
    • Images uploaded in the German (secondary language) media library are displayed in their own language (German) in the frontend with an internal url and are displayed correctly in the other languages (English, Spanish, French) with the cloudflare url.
    • Images uploaded in the French (secondary language) media library are displayed in the frontend in your own language (French) with the internal url and are correctly displayed in the other languages (English, Spanish, German) with the cloudflare url.
    • etc.

    We assume that with 1.8 the url was replaced in the frontend if the language is the same as the language in which the image was uploaded. But now the behavior is slightly different. In 1.9 it seems to work correctly for the main language, but for the secondary languages the image is only displayed correctly if the language is not the same as the language in which the image was uploaded.

    Or does this behavior only occur in our environment?

    Best regards,
    Frederic

    Plugin Author Anton Vanyukov

    (@vanyukov)

    Hi @frederichesse,

    Thank you for the detailed response. I am looking over this and seeing if I might have missed something.

    Best regards,
    Anton

    Plugin Author Anton Vanyukov

    (@vanyukov)

    Hi @frederichesse

    Could you please try this version?

    https://github.com/av3nger/cf-images/releases/tag/1.9.1-beta.1

    Best regards,
    Anton

    Thread Starter Frederic

    (@frederichesse)

    Hello @vanyukov,

    first of all, I would like to apologize for my very late reply. I was out of the office last week and was only able to look at the new version today.

    Thank you for taking another look at the problem. The new version 1.9.1-beta.1 seems to have fixed the problem. At least I did not notice any problems during the first test. The images are now displayed correctly in all languages in the frontend with the Cloudflare url.

    We will look at this in detail again in the next few days, but I would say that the ticket can be closed with the new version of the plugin.

    Thank you once again for taking the time to help us with this problem.

    Best regards,
    Frederic

    Plugin Author Anton Vanyukov

    (@vanyukov)

    @frederichesse, awesome! I’ll mark this as resolved. If there’s any issues remaining, please feel free to reopen or create a new thread.

    Best regards,
    Anton

    Thread Starter Frederic

    (@frederichesse)

    Hello @vanyukov,

    I am reopening the ticket with the following short question. The bulk offload does not work in 1.9.1-beta.1. Only the last image added in the backend is uploaded to Cloudflare. And that with approx. 1600 copies. In the previous beta branch there were also problems with the offload, which were no longer present in the release version. And since this could be a branch-specific bug, we wanted to ask when the next release version will be available?

    Then we would test the problem again in the realease version and create a new ticket if the problem with the offload is still present.

    Best regards,
    Frederic

    Plugin Author Anton Vanyukov

    (@vanyukov)

    Hi @frederichesse,

    There are no new changes with bulk actions on 1.9.1. Are you sure the other images are not offloaded? Could you please check on Cloudflare directly?

    Best regards,
    Anton

    Thread Starter Frederic

    (@frederichesse)

    Hello @vanyukov ,
    unfortunately I didn’t get around to replying here earlier.

    We have now offloaded the 2000 images using the single-offload method. This method works without any problems.

    But to explain the problem with the Bulk Upload in more detail. Images are being offloaded to Cloudflare. But only the last uploaded image in the media library is offloaded. Below are two screenshots that illustrate the problem. In the image you can see that the same image is being offloaded over and over again. We then let it run even longer, even after 100 images the same image is offloaded.

    https://ibb.co/4KyYxJ6
    https://ibb.co/nBrQqD2

    Best regards,
    Frederic

    • This reply was modified 2 years, 1 month ago by Frederic.
    • This reply was modified 2 years, 1 month ago by Frederic.
    Plugin Author Anton Vanyukov

    (@vanyukov)

    @frederichesse,

    I was able to replicate… I’ll need to figure out a way to do this correctly. WPML treats uploaded images differently, depending on which language you upload them from. If I use the native WPML functions to distinguish between images – that fixes the front-end issues, but, as it turns out, it also prevents the use of WP_Query for bulk operations. Because now the query becomes too complex to filter out already uploaded images. I’ll need a bit more time on this.

    Best regards,
    Anton

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘WPML compatibility’ is closed to new replies.