[wp-trac] [WordPress Trac] #56490: wp-cron.php using count() on null

WordPress Trac noreply at wordpress.org
Thu Sep 1 18:08:20 UTC 2022


#56490: wp-cron.php using count() on null
--------------------------+------------------------------
 Reporter:  Bishoy.A      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cron API      |     Version:  6.0.2
 Severity:  normal        |  Resolution:
 Keywords:  php8          |     Focuses:
--------------------------+------------------------------

Comment (by Bishoy.A):

 Replying to [comment:3 SergeyBiryukov]:
 > Hi there, welcome to WordPess Trac! Thanks for the ticket.
 >
 > I have to admit I'm not sure where the `null` value for `$args` is
 coming from. Looking at [source:tags/6.0.1/src/wp-includes/cron.php#L228
 wp_schedule_event()], which is used for the
 `wp_privacy_delete_old_export_files` hook, the default value for the
 `$args` parameter is an empty array, not `null`.
 >
 > I've also been using WordPress on PHP 8.x for almost two years, but have
 never encountered this issue yet, so the steps to reproduce it on a clean
 install would be helpful here.
 >
 > Could it be that some plugin used the `schedule_event` hook before being
 disabled, and has somehow reset the `args` parameter to `null`, which is
 now saved to the cron array even after the plugin is disabled?

 Hi Sergey, thank you for checking!

 I'm also running other installations on PHP 8.0 without this particular
 issue, but this one, this issue is always happening every minute. I
 checked with my hosting provider as well as wp-crontrol plugin, and I was
 able to confirm that the only hook firing every minute is
 "action_scheduler_run_queue".

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56490#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list