• Resolved Greg Marshall

    (@timeassistant)


    Hello,

    I was having issues with the automatic optimisation settings (web server would occasionally lock up during image upload)

    So my webhost advised that they can set up WP-CLI and a cron job to run EWWW however the hosts have came back to me advising of a problem with your plugin, he made some changes to your code but this was lost during plugin upgrade, can you please review and action the change he has made? the message from my web host is below:

    Fatal error: Call to a member function get_col() on a non-object in /home/{directory}/public_html/wp-content/plugins/ewww-image-optimizer/iocli.php on line 192

    “It looks like it’s an issue with this line in the script:

    else {
    // load up all the image attachments we can find
    $attachments = $wpdb->get_col( “SELECT ID FROM $wpdb->posts WHERE (post_type = ‘attachment’ OR post_type = ‘ims_image’) AND post_mime_type LIKE ‘%%image%%'” );
    }

    And it’s because $wpdb isn’t being instantiated in that function. I’ve added that to the function on line 183 now, but it might be something the developer isn’t aware of perhaps.”

    https://wordpress.org/plugins/ewww-image-optimizer/

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

    (@nosilver4u)

    Thanks for letting me know, the fix will be in the next release!

    You could also use the deferred optimization which would probably be a bit gentler on the server.

    Thread Starter Greg Marshall

    (@timeassistant)

    Hi thanks for the quick response – love it !

    I think I did try deferred optimisation but it was decided at the time that this was the best method for our set up.

    Although if you could possibly add some sort of way to schedule optimisations (like a cron) this would be great as I would love to run it around 3am or something when there is little or no site activity

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue using plugin via WP-CLI & Cron’ is closed to new replies.