Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#22268 closed defect (bug) (invalid)

PHP Notice: Undefined index: every12hours in /var/www/wp3/wp-includes/cron.php on line 103

Reported by: volomike's profile volomike Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.4.2
Component: Cron API Keywords:
Focuses: Cc:

Description

While using wp_schedule_event(time(),'hourly','myevent') and hooking back to a custom event that calls my function callback, and refreshing one of my admin pages for a plugin I'm coding, the Apache log is filling with the undefined index regarding 'every12hours' in cron.php on line 103. This might mean, and I'm not certain yet -- that 3.4.2 doesn't have a working wp-cron for 'hourly' like it is supposed to have? Please double check that.

Note that I caught this because I have error_reporting(E_ALL) specified.

The line in question (103) is in the wp_reschedule_event() function and the line reads like so:

$interval = $schedules[$recurrence]['interval'];

Change History (5)

#1 @knutsp
13 years ago

  • Cc knut@… added

Have you had a plugin that added 'twicedaily' as an interval, and then added an event with that interval? Such plugins doesn't always include a deactivation hook that removes such custom schedules.

#2 follow-up: @SergeyBiryukov
13 years ago

  • Keywords reporter-feedback added

'every12hours' schedule is added by a custom PluginUpdateChecker class which is used by several plugins:

and probably others outside of the WP.org repository.

I guess you had a plugin using that class installed at some point.

#3 in reply to: ↑ 2 @volomike
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Replying to SergeyBiryukov:

'every12hours' schedule is added by a custom PluginUpdateChecker class which is used by several plugins:

and probably others outside of the WP.org repository.

I guess you had a plugin using that class installed at some point.

Yes! Thanks for finding this! That's exactly the case. Wow, surprised you noticed that.

Anyway, I remedied the bug by adding a filter so that I could add every12hours in just in case, and set the interval to 43200 (60*60*12). I did it with this technique: http://shinephp.com/start-scheduled-task-with-wp-cron-more-often/

#4 @SergeyBiryukov
13 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution changed from fixed to invalid
Note: See TracTickets for help on using tickets.