Make WordPress Core

Opened 14 years ago

Closed 12 years ago

#4230 closed enhancement (wontfix)

Change update-links to be wp-cron compatible

Reported by: Otto42 Owned by:
Milestone: Priority: low
Severity: normal Version:
Component: Cron API Keywords: needs-patch
Focuses: Cc:


update-links.php is a file that does little other than to update the links link_updated times using pingomatic when it's called. However, there's nothing in Wordpress to run it at all. The trigger has to be external.

With the addition of wp-cron to the 2.1 line, the update-links.php file should be wrapped in a function with an action hook and included into the main source, so that wp-cron can trigger it on some basis.

Further suggestion: Rig the "track link update times" checkbox on Options->Misc to activate and deactivate this wp-cron job as needed. The checking timer can be set to, say, 1-2 hours or so. Add a filter to the timer so that it can be easily modified if needed. Or make it an option or something.

Attachments (1)

4230.diff (3.6 KB) - added by Otto42 14 years ago.
Makes update links functionality into a wp-cron job.

Download all attachments as: .zip

Change History (12)

#1 @rob1n
14 years ago

  • Milestone changed from 2.4 to 2.3

Seems like a good use of WP-Cron.

#2 @Otto42
14 years ago

  • Keywords has-patch added

Added patch to move update links into a cron job. Features of this patch:

  • Adds two new functions. One does the updating of the links, the other manages the wp-cron scheduling based on the enabling/disabling of the links update option.
  • Scheduling frequency is filtered for easy plugin changing (defaults to daily).
  • Both new functions are pluggable, in case a plugin wants to change how the updating or scheduling works entirely.

14 years ago

Makes update links functionality into a wp-cron job.

#3 @markjaquith
14 years ago

What is your plan for update-links.php ? Update it to use this function? Delete it altogether?

#4 @Otto42
14 years ago

Delete it altogether. The only reason to have it separate is so it can be executed separately as a cron job. With wp-cron doing it, there's no reason to have it at all. And with the function being pluggable, plugins can replace it if they like.

#5 @markjaquith
14 years ago

  • Keywords needs-testing added

Sounds fine. This should be good to go in after a little testing.

#6 @Otto42
14 years ago

Sounds good. Word of warning to the testers: I've never gotten the pingomatic call to actually work. I think this is a problem with pingomatic. But, since this is the current code, it's what I used for this patch.

The patch in ticket #4231 also has this code change, but also changes the update_links code to use RSS feeds to get the last updated time instead. That code actually works because it doesn't rely on pingomatic.

#7 @Nazgul
14 years ago

  • Milestone changed from 2.3 to 2.4 (next)

#8 @ffemtcj
14 years ago

  • Milestone changed from 2.5 to 2.6

#9 @Otto42
13 years ago

Any traction on this? I really want something like this put into the core code. The patch may need to be refreshed at this point.

#10 @Denis-de-Bernardy
12 years ago

  • Component changed from Optimization to Cron
  • Keywords needs-patch added; has-patch needs-testing removed
  • Milestone changed from 2.9 to Future Release

not even sure this is still current...

#11 @dd32
12 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I've removed the Link update checking from core. This is better left for plugin material. See #12437

Note: See TracTickets for help on using tickets.