WordPress.org

Make WordPress Core

Opened 2 months ago

Closed 2 months ago

#53937 closed defect (bug) (wontfix)

delete the un-used function _upgrade_cron_array()

Reported by: pbearne Owned by:
Milestone: Priority: normal
Severity: normal Version: trunk
Component: Cron API Keywords: has-patch
Focuses: Cc:

Description

This function was added in 2.1.0 to modify the shape of the cron array stored in the options table _upgrade_cron_array

As we are on version 5.8 it is very unlikely that it is ever run.

So let remove it from the codebase

Change History (4)

#1 @pbearne
2 months ago

We could also drop the Version 2 test

This ticket was mentioned in PR #1593 on WordPress/wordpress-develop by pbearne.


2 months ago

  • Keywords has-patch added

Removed unused function _upgrade_cron_array()

Trac ticket: https://core.trac.wordpress.org/ticket/53937

#3 follow-up: @SergeyBiryukov
2 months ago

Thanks for the ticket!

I think we should not remove the version field from _set_cron_array() though, as that would block us from changing the option structure in the future.

We should also consider what happens with the cron option if someone does upgrade from WordPress < 2.1 to the current version, which is still a possibility, as unlikely as it may be. I see no harm in keeping the function in place if it helps avoid some obscure bugs in that scenario.

#4 in reply to: ↑ 3 @peterwilsoncc
2 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Replying to SergeyBiryukov:

I think we should not remove the version field from _set_cron_array() though, as that would block us from changing the option structure in the future.

I agree with Sergey's view here, both in terms of allow for future format changes and allowing for very old installs to update. It's also a pretty harmless function to keep around.

Ticket #34913 contains a patch that proposes upgrading the cron array format to version 3 within _upgrade_cron_array() so it may happen at some point.

I'm going to close this ticket as wontfix but thank you for taking an interest in the cron component. It's great to see it getting some attention.

Note: See TracTickets for help on using tickets.