johngodley / redirection

Manage all your WordPress 301 redirects and monitor 404 errors
https://redirection.me
GNU General Public License v3.0
552 stars 138 forks source link

Redirection monitor not active during wp-cron #3126

Open christiaanstijnen opened 2 years ago

christiaanstijnen commented 2 years ago

Feature request: Make redirection monitor active during a wp-cron

Summary

Short: We are planning post revisions in the future. These post revisions can also include slug changes. These slug changes are not monitored en therefore no redirections are created.

Long: We are using Yoast duplicate post to plan revisions in the future. So we can release schedule post updates. Changing slug is not a default feature in Yoast duplicate post but we filtered this functionality in. When testing this new feature we noticed that Redirection was not picking up the new slug and not creating any redirects in this case. I found that the redirect monitor class was initialized via: add_action( 'rest_api_init', 'red_start_rest' ); The rest_api_init hook is not triggered during a regular wp-cron. I created a prototype where I call the 'red_start_rest' function during my cron action. This is working but is not the way to go, I think the way to go is to make this work from the plugin code. Also my way is triggering warnings.

Actual Behavior

Please make the redirection monitor class active during a wp-cron, it 's not right now.

Environment

WP 5.8.1 / 5.8.2 Redirection 5.1.3 Latest chrome

christiaanstijnen commented 2 years ago

Is there any chance there is going to be a response to this ticket? If this is not anything you want to do I also would like to hear that because then I will look for another solution.

If the ticket is not clear please let me know so I can explain more or better.

Thanks!

johngodley commented 2 years ago

The ticket is still open and will be looked at when there is time.