WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 4 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:

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 (1)

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

Download all attachments as: .zip

Change History (12)

comment:1 rob1n7 years ago

  • Milestone changed from 2.4 to 2.3

Seems like a good use of WP-Cron.

comment:2 Otto427 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.

Otto427 years ago

Makes update links functionality into a wp-cron job.

comment:3 markjaquith7 years ago

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

comment:4 Otto427 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.

comment:5 markjaquith7 years ago

  • Keywords needs-testing added

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

comment:6 Otto427 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.

comment:7 Nazgul7 years ago

  • Milestone changed from 2.3 to 2.4 (next)

comment:8 ffemtcj6 years ago

  • Milestone changed from 2.5 to 2.6

comment:9 Otto426 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.

comment:10 Denis-de-Bernardy5 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...

comment:11 dd324 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.