Undefined variable: is_cron in ProcessController.php
-
PHP Notice: Undefined variable: is_cron in /home/customer/www/mysite.com/public_html/wp-content/plugins/resmushit-image-optimizer/classes/Controller/ProcessController.php on line 42
-
Hi Valdinia,
Thank you for your message. We’re sorry to hear about this problem. ??
In order to help you troubleshoot this, it would be helpful if you could provide us with some additional information, including:
- Screenshots?or a?screen recording showing 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.
- Screenshots of your reSmush.it plugin?settings.
- Finally, when exactly is that message showing up? What action do you need to do to reproduce the issue?
We look forward to working with you to resolve this.
Thank you!
I’m getting the same error, filling up my debug log fast, after updating to 1.0.0.
[27-Feb-2024 14:39:28 UTC] PHP Warning: Undefined variable $is_cron in /home/plugs/webapps/wp-content/plugins/resmushit-image-optimizer/classes/Controller/ProcessController.php on line 42
wildewebmarketing, I am unable to reproduce it on my test site. Could you please take a moment and send us some additional information?:
- Screenshots or a screen recording showing 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.
- Screenshots of your reSmush.it plugin settings.
- Finally, when exactly is that message showing up? What action do you need to do to reproduce the issue?
Thank you!
I gave you the exact error, which is multiplied repeatedly all day long in the debug log, every page view. I have multiple sites, the error is occurring on 75% of them. I tried to find a conflict, but even with all plugins disabled, the error persists. No theme similarities. I’m not comfortable posting the site info here. I can email it if you need it. Settings are simple (90 quality, deactivate backup, activate statistics).
In addition, as it’s an undefined variable, using constants fixes the issue, but I’d like to avoid having to change the code every time:
//Automatically optimize images if option is checked
if(get_option(‘resmushit_on_upload’) OR ( isset($_POST[‘action’]) AND ($_POST[‘action’] === “resmushit_bulk_process_image” OR $_POST[‘action’] === “resmushit_optimize_single_attachment” )) OR (defined( ‘WP_CLI’ ) && WP_CLI ) OR (defined(‘DOING_CRON’) && DOING_CRON) )
{
Log::addTemp(‘Gen Attachment metadta filter set’);
add_filter(‘wp_generate_attachment_metadata’, array($this,’process_images’) );
}
}Hello wildewebmarketing,
As mentioned before, we can not reproduce the problem, so unfortunately the exact error is not that useful and we need more information. Could you please send an email to [email protected] with all the information we have requested so that we can help you further?
Thank you!
I have the exact same problem that – even in my case – is constantly filling up the php_error_log going for disk space unnecessarily.
I try to answer the questions about the need for information:
- Screenshots?or a?screen recording showing the issue in action. If possible, please include?relevant links?as well.
There is no screenshot. The problem is detected by going to look at the PHP-related error log, it gets bigger and bigger and never stops getting bigger (fortunately the log rotate then intervenes to trim, compact and set aside the history unnecessarily overrun by this warning). - 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.
https://privatebin.cerbero.cc/?2df0ca0e4ccde26c#12nmhBB1pG4AWenfEJD2kDHUfS5BTPv4v5KTuEEhfoz5 (password: resmush, content expires in one week) - Screenshots of your reSmush.it plugin?settings.
- Finally, when exactly is that message showing up? What action do you need to do to reproduce the issue?
It has been happening since you updated the plugin to the latest version available (February 23, 2024).
Hello and thanks for reporting this!
Can you please test with the version below by installing it on top of version 1.0.0 and let us know if you still get your logs filled up with that PHP Notice?
https://shortpixel.com/downloads/resmushit-image-optimizer-1.0.1-DEV01.zip
Thanks, I look forward to getting your feedback!
Installed around 16:50 UTC+1, till now I am not detecting any additional warnings in the log file. Bingo! ??
Same issue on all my sites with version 1.0.0, let me know when a fix is available.
Hello everyone,
Version 1.0.1 containing the fix for this issue has just been released.
Thanks for your patience with this!
- The topic ‘Undefined variable: is_cron in ProcessController.php’ is closed to new replies.