Title: PHP Error w/ Cron
Last modified: March 30, 2020

---

# PHP Error w/ Cron

 *  [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/php-error-w-cron/)
 * Any chance you can help me debug a PHP error your plugin is throwing? It seems
   to be related to cron jobs that are running.
 * `PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function 
   FlorianBrinkmann\\LazyLoadResponsiveImages\\Plugin::filter_markup(), 0 passed
   in /nas/content/live/hostwp/wp-includes/class-wp-hook.php on line 288 and exactly
   1 expected in /nas/content/live/hostwp/wp-content/plugins/lazy-loading-responsive-
   images/src/Plugin.php:186\nStack trace:\n#0 /nas/content/live/hostwp/wp-includes/
   class-wp-hook.php(288): FlorianBrinkmann\\LazyLoadResponsiveImages\\Plugin->filter_markup()\
   n#1 /nas/content/live/hostwp/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters('',
   Array)\n#2 /nas/content/live/hostwp/wp-includes/plugin.php(544): WP_Hook->do_action(
   Array)\n#3 /nas/content/live/hostwp/wp-cron.php(138): do_action_ref_array('',
   Array)\n#4 {main}\n thrown in /nas/content/live/hostwp/wp-content/plugins/lazy-
   loading-responsive-images/src/Plugin.php on line 186, referer: https://www.sitename.
   com/wp-cron.php?doing_wp_cron=1585583195.0062720775604248046875`
 * I like your minimizer more than others, so I would like to keep using it!

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

 *  Plugin Author [Florian Brinkmann](https://wordpress.org/support/users/florianbrinkmann/)
 * (@florianbrinkmann)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12603022)
 * Hi [@rexsorgatz](https://wordpress.org/support/users/rexsorgatz/),
 * hm, are you calling the `filter_markup()` method manually somewhere? And would
   it be possible for you to check if the error also happens when you disable the
   other plugins and switch to a default theme?
 * Best,
    Florian
 *  Thread Starter [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12603128)
 * Nope, the only thing using `filter_markup()` is your plugin.
 *  Plugin Author [Florian Brinkmann](https://wordpress.org/support/users/florianbrinkmann/)
 * (@florianbrinkmann)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12604750)
 * Okay, and what about that?
 * > And would it be possible for you to check if the error also happens when you
   disable the other plugins and switch to a default theme?
 *  Thread Starter [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12604814)
 * Sorry, I have been trying to find a way to test it. It’s a large site, so I can’t
   just turn everything off…
 * On my dev environment (which is an exact mirror of production), I am unable to
   reproduce the error. So I think it requires some amount of traffic… which, well,
   I don’t have on my dev environment.
 * The referrer intrigues me. `wp-cron.php?doing_wp_cron=` I do have a couple things
   running cron jobs. Both of those are backend utilities, which never hit pages,
   so I don’t see why that would have anything to do with you.
 * The error is fairly random. A few every hour, on a site that gets 50K views in
   that time. So it’s not like a dealbreaker. Just thought you might have an idea…
 *  Plugin Author [Florian Brinkmann](https://wordpress.org/support/users/florianbrinkmann/)
 * (@florianbrinkmann)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12604877)
 * Ah okay, no problem.
 * > On my dev environment (which is an exact mirror of production), I am unable
   > to reproduce the error. So I think it requires some amount of traffic… which,
   > well, I don’t have on my dev environment.
 * Okay, that’s tricky. Do the cron actions run on the same intervals and the same
   time? Or can you find out which action it is by comparing the error log time 
   with the start time of the actions?
 * > The error is fairly random. A few every hour, on a site that gets 50K views
   > in that time. So it’s not like a dealbreaker. Just thought you might have an
   > idea…
 * No, unfortunately not, sorry.
 *  Thread Starter [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12679168)
 * Hi, I have an update….
 * This error is still firing, but with more frequency. On a development environment,
   I have been able to isolate the plugin that, when disabled, stops your plugin
   from throwing the error. It’s this one:
 * [https://wordpress.org/plugins/content-cards/](https://wordpress.org/plugins/content-cards/)
 * It’s old, but works well for my purposes. It essentially runs a cron job that
   pulls in OpenGraph data on external & internal links.
 * If you have thoughts on how to address the problem, please let me know.
 *  Plugin Author [Florian Brinkmann](https://wordpress.org/support/users/florianbrinkmann/)
 * (@florianbrinkmann)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12717916)
 * Hey [@rexsorgatz](https://wordpress.org/support/users/rexsorgatz/),
 * thanks for the investigation! I will install the plugin and try to reproduce 
   the problem. I will keep you posted.
 * Best,
    Florian
 *  Plugin Author [Florian Brinkmann](https://wordpress.org/support/users/florianbrinkmann/)
 * (@florianbrinkmann)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12733168)
 * Hey,
 * I installed the plugin and ran the cron event a few times, but nothing in the
   error log. Does it also throw the error on the dev environment when only the 
   Content Cards plugin and Lazy Loader is active, so that maybe another plugin 
   has something to do with it?
 * Best,
    Florian
 *  Thread Starter [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12733735)
 * Yeah, it’s just those two in conjunction with each other.
 * I get ~12 errors/day, on a site that has ~600,000 views/day. So it’s not catastrophic…
   I just wish there was a solution, cuz I hate seeing it in my error logs. 🙂
 *  Plugin Author [Florian Brinkmann](https://wordpress.org/support/users/florianbrinkmann/)
 * (@florianbrinkmann)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12735879)
 * Yes, I totally understand that.
 * Which Lazy Loader settings do you use? Maybe I missed something there.
 *  Thread Starter [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12738949)
 * The options I have checked are:
    + Enable lazy loading for iframes + Include 
   lazysizes aspectratio plugin + Display a loading spinner
 *  Plugin Author [Florian Brinkmann](https://wordpress.org/support/users/florianbrinkmann/)
 * (@florianbrinkmann)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12741638)
 * Okay, thanks. That did not change anything on my site, unfortunately… What I 
   could do is add an empty default value to the `filter_markup` parameter, so that
   it would not throw an error when called without a param.
 * I hesitate a bit to include such a »fix«, but I think I will not be able to reproduce
   the issue to find the true cause, so I created a pre-release on GitHub ([https://github.com/florianbrinkmann/lazy-loading-responsive-images/releases/tag/v6.0.1-alpha.2](https://github.com/florianbrinkmann/lazy-loading-responsive-images/releases/tag/v6.0.1-alpha.2)),
   could you check if that fixes the issue? It is the lazy-loading-responsive-images.
   zip.
 * Best,
    Florian
 *  Thread Starter [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12746797)
 * And the verdict is….
 * SUCCESS.
 * It hasn’t thrown an error since installing the patch, 16 hours ago.
 *  Plugin Author [Florian Brinkmann](https://wordpress.org/support/users/florianbrinkmann/)
 * (@florianbrinkmann)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12746848)
 * Great, thanks for testing! I am currently waiting for feedback on another issue,
   after that I will release an official version with the fix.

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

The topic ‘PHP Error w/ Cron’ is closed to new replies.

 * ![](https://ps.w.org/lazy-loading-responsive-images/assets/icon-256x256.png?rev
   =1305473)
 * [Lazy Loader](https://wordpress.org/plugins/lazy-loading-responsive-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lazy-loading-responsive-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lazy-loading-responsive-images/)
 * [Active Topics](https://wordpress.org/support/plugin/lazy-loading-responsive-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lazy-loading-responsive-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lazy-loading-responsive-images/reviews/)

 * 14 replies
 * 2 participants
 * Last reply from: [Florian Brinkmann](https://wordpress.org/support/users/florianbrinkmann/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/php-error-w-cron/#post-12746848)
 * Status: not resolved