Ticket #4230 (new enhancement)

Opened 2 years ago

Last modified 6 months ago

Change update-links to be wp-cron compatible

Reported by: Otto42 Assigned to: anonymous
Priority: low Milestone: 2.9
Component: Optimization Version:
Severity: normal Keywords: has-patch needs-testing
Cc:

Description

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

4230.diff (3.6 kB) - added by Otto42 on 07/25/07 15:02:19.
Makes update links functionality into a wp-cron job.

Change History

05/08/07 15:56:11 changed by rob1n

  • milestone changed from 2.4 to 2.3.

Seems like a good use of WP-Cron.

07/25/07 14:57:46 changed by Otto42

  • keywords set to has-patch.

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.

07/25/07 15:02:19 changed by Otto42

  • attachment 4230.diff added.

Makes update links functionality into a wp-cron job.

08/04/07 16:22:50 changed by markjaquith

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

08/05/07 15:14:08 changed by Otto42

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.

08/05/07 18:11:49 changed by markjaquith

  • keywords changed from has-patch to has-patch needs-testing.

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

08/06/07 00:32:35 changed by Otto42

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.

09/06/07 23:40:07 changed by Nazgul

  • milestone changed from 2.3 to 2.4 (next).

03/19/08 03:38:48 changed by ffemtcj

  • milestone changed from 2.5 to 2.6.

06/09/08 17:27:37 changed by Otto42

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.