• Resolved Patrick_D1985

    (@patrick_d1985)


    Hi there Shortpixel/Enable Media Replace team,

    I am reaching out on behalf of one of our clients which uses Enable Media Replace. Sadly I did not see any way of getting in touch with you regarding Enable Media Replace in the Shortpixel knowledgebase (https://shortpixel.com/knowledge-base/category/308-enable-media-replace)

    So I will have to use the WordPress Plugin directory to do so. Which means I can not share all details to security restrains of course.
    If you for instance need the system status report, access to the website, or more information feel free to let me know, and provide me with an address I can send such information to.

    Situation

    A website/webshop which consists out of various custom post types and taxonomies. The setup for some parts could be considered a bit exotic but that should not really matter viewing this form the Enable Media Replace perspective.

    The website consisting of 37K+ posts according to the database (this of course includes revisions etc)

    We make use of both Elementor and JetEngine to setup the content/pages etc. Noting this because of revisions and they way data is stored.
    In caching regard we are using both Cloudflare and WP-Rocket.

    We have two primary issues;

    1] Once Media Replace is run it we see that for instance /wp-content/uploads/elementor/css gets wiped.

    It also used to wipe Wp-Rocket fully, but after talking with the customer we have made it so that that can only be done manually as the customer will use Enable Media Replace as much as they need and then manually clear and preload the cache.

    This cuts down on the entire cache being cleared multiple and multiple times. But the Elementor files in /wp-content/uploads/elementor/css still get wiped. Which will result in WPRocket cache existing, with reference to Elementor CSS files which have been wiped. Resulting in partially loading pages.

    Clearing the WP-Rocket cache will resolve that of course.
    But is there a way we can prevent Enable Media Replace from clearing those files? We have asked Elementor about this but they have referred us to you as Enable Media Replace triggers the action according to them.

    2] But also when the customer uses Enable Media Replace on the install the server seems to spike and PHP-FPM processes get spawned and spawned until the server more or less has a full php-fpm pool of those processes.

    In such cases the server host has to kill the services to make things reachable again. Which in itself will resolve the issue for the time being but is band-aid and not a solution to an underlying issue.
    We have investigated the behavior (by using the wonderful Simple History) for a while and have pinpointed it to being related to Enable Media Replace.

    In a week where the customer did not do these actions, such issues where not present. When the customer started doing multiple replaces … it went the route as described above.
    So it is tying into that specific action.

    How Enable Media Replace is being used

    The customer uses the option to “Replace the file, use the new file name, and update all links”. Which we know is pretty demanding but even with this amount of posts and with these server specifiations should not produce the issue mentioned in 2]

    Server details

    As we know the action is somewhat intensive we have some specs to share. The server on which this runs is a beast specs-wise;
    CPU: AMD EPYC 7313P 16-Core Processor (32 core(s))
    RAM: 128GB (Dont know the specific type but that should not really matter)
    The PHP-FPM pool has already been set to 200 childeren which really should not be an issue.
    Also MariaDB shoudl have sufficient free RAM to handle the action.

    Can you help us resolve the mentioned issues?
    As mentioned if you need any additional information from our end feel free to let me know or reach out on [email protected]

    Thanks in advance for looking into this!

    Best regards,
    Patrick Dankers
    on behalf of J. Ottenheijm.com

    • This topic was modified 3 years ago by Patrick_D1985. Reason: formatting issues
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Patrick,

    Since this is a free plugin, per WordPress guidelines we are not allowed to request any details from you through other channels, but I’m letting you know that you can easily contact our ShortPixel team via our contact form in our website.

    First things first, could you send us the following information?

    • Screenshots or a screen recording that show the issue in action. If possible, please include relevant links as well.
    • Your site information. Please navigate to Tools > Site Health > Info, click on the “Copy site info to clipboard” button and paste the information in your reply.

    Afterwards, could you please confirm that both issues happen when only Enable Media Replace is active and all other plugins are deactivated? Of course, in issue #1, you can leave Elementor active.

    Thank you,

    Thread Starter Patrick_D1985

    (@patrick_d1985)

    Hi sixaxis,

    Will do. We will reach out through the Shortpixel contact form with all the possible info. As this is a production website we will test the mentioned on a staging environment and get back to you.

    Hope you can look into this and get back to us.

    Best regards,
    Patrick Dankers
    on behalf of J. Ottenheijm.com

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hello Patrick,

    Regarding the first point – Elementor cache – the purge of CSS files is indeed triggered by our plugin (similar to WP Rocket cache purge) because otherwise the replacements made by the plugin might not be visible on pages where the images were set as backgrounds by Elementor and delivered from the CSS files, especially if the file name changes. This is the place in the plugin code where this operation is performed. You can of course use remove_action to remove this from your code, and then make sure to manually clear all caches after each replacement.

    On the second point, to fully replace an image within a website, the plugin performs a fairly complex DB query. Again, this happens if you use the “Replace the file, use the new file name, and update all links” option, because if the filename stays the same, these heavy queries aren’t needed. Unfortunately, this can lead to a heavy load on the MySQL part, especially for a DB with the sizes we saw in your information (700 MB for the posts table and over 1 GB for the postmeta table). The solution here lies mainly in optimizing the database (by removing unneeded data, especially from the postmeta table, which can get bloated very easily and quickly, but also from the posts table if possible), as well as other practices that should be discussed with a MySQL expert. We’re open to suggestions on how to improve these replacements, but ultimately the Enable Media Replace plugin needs to find all occurrences of the replaced image in database and update them with the new image details.

    I hope that helps, and if you have any questions, let us know.

    Have a nice Sunday!

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

The topic ‘Server issues + removing Elementor css’ is closed to new replies.