• Resolved veke

    (@veke)


    Hello Shane,

    thank you for your plugin. I’m the owner of a very big wordpress website running wordpress. I’ve more than 170k images in it and i’d like to optimize them all.

    Problem 1 is: 170k images REQUIRES A HUGE AMOUNT OF TIME. (I’m ok with it)
    Problem 2: Web nodes are running wp-content/ inside an NFS mount point. This means that the image loading/writing from within a web node requires a lot of extra time.

    What i’m looking is understand if I may be able to run them from the NFS Master using wp-cli or shell commands.

    https://www.ads-software.com/plugins/ewww-image-optimizer/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    There is not currently a way to run the bulk process via wp-cli or shell that I’m aware of. It is something I’ve contemplated for a long time, but just haven’t had the time to implement it.

    The bulk process originally ran in one continuous process that probably would have been suitable for wp-cli, but I rewrote it a long time ago to solve issues with timeouts and such. That means it is now js-driven on the client-side, so not really any way to launch it outside of a js-enabled browser.

    Thread Starter veke

    (@veke)

    Is it possible then to have, given the plugin configuration, the list of commands with parameters that are going to be launched?

    Plugin Author nosilver4u

    (@nosilver4u)

    The chain goes something like this:

    1. ewww_image_optimizer_bulk_script() is called, which gets all the attachment id’s from the media library, and puts the array into two places (just realizing there might be some redundancy here): an option named ewww_image_optimizer_bulk_attachments and a javascript variable – ewww_vars.attachments

    2. the javascript submits one attachment id from the list in ewww_vars.attachments, along with a nonce value to ewww_image_optimizer_bulk_loop()

    3. That function retrieves the attachment metadata, sends it through ewww_image_optimizer_resize_from_meta_data(), displays the results, and sends the metadata back to the database.

    4. ewww_image_optimizer_resize_from_meta_data() parses the metadata, finds the file paths, and then calls the core ewww_image_optimizer() function on each image, and everything kind of trickles back up to the javascript which then outputs the results in html form.

    Since this is a project I’ve pondered for a long time, I think I’m going to attempt to see what I can do to build a function that would be callable from wp-cli. I think most of the framework is there, it just needs some tweaking to make the functions dual-purpose: callable from a javascript POST request AND from another function within the plugin.

    Might even go back and look at the original bulk code to see if any of that is usable.

    Plugin Author nosilver4u

    (@nosilver4u)

    This is coming very soon to dev, hopefully by the end of the day I’ll be able to check-in the updates.

    Plugin Author nosilver4u

    (@nosilver4u)

    Thread Starter veke

    (@veke)

    Hello. I dont sede anything in The changelog.

    Plugin Author nosilver4u

    (@nosilver4u)

    it won’t show in the changelog, since that only gets updated for new versions, this is still in dev, which is why I posted the link for you on that. I’ll probably release it Monday or Tuesday after I’ve let it incubate for a few days.

    Thread Starter veke

    (@veke)

    Uuh OK. I cant try it till next week i LL let you know asap. Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Launch it from shell or wp-cli’ is closed to new replies.