Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sitemaps (as part of a filter chain) are not rebuild sometimes #20

Open
kochtopf opened this issue Sep 13, 2018 · 6 comments
Open

sitemaps (as part of a filter chain) are not rebuild sometimes #20

kochtopf opened this issue Sep 13, 2018 · 6 comments

Comments

@kochtopf
Copy link

Hi,
This bug is somewhat related to issue#19 (plugin nginx-helper apply_filters get the urls of changed sitemaps). This is working great adding, deleting restoring new posts. It doesn't work if the post is scheduled to publish or a post is edited. Then no sitemaps urls are passed through the filter chain.
THis problem is new in v505. No such issue in v494.

@kochtopf
Copy link
Author

found an issue in nginx-purger.

@RavanH
Copy link
Owner

RavanH commented Sep 13, 2018

Hi @kochtopf thanks for reporting :)

So you identified the cause?

@kochtopf
Copy link
Author

Hi RavanH,
I looked a little bit further into this and can now say for sure that there is a problem with scheduled posts. Editing posts works fine (had a problem with that cron running with root instead of www-data).
What I have so far: nginx-helper (purger.php) runs
// Allow plugins/themes to modify/extend urls. Pass urls array in first parameter, second says if wildcards are allowed
$purge_urls = apply_filters('rt_nginx_helper_purge_urls', $purge_urls, false); //somewhere at line 850
to get back an array of urls - in the case of xml-sitemap-feed they are like /sitemap.xml, /sitemap-home.xml, /sitemap-posttype-post.yyyy.xml ... This works except for scheduled post run through through you own cron job like:
/** Disable wp-cron ind wp-config.php */
define('DISABLE_WP_CRON', true);
0,20,40 6-23 * * * www-data /usr/bin/php /srv/site/wordpress/wp-cron.php
In this situation the passed array of urls from xml-sitemap-feed is empty.

I still need to check a configuration without cron and will let you know...

@kochtopf kochtopf reopened this Sep 14, 2018
@kochtopf
Copy link
Author

ARGH I remember. I never could get wp-cron.php to work correctly with cloudflare and nginx fastcgi cache. Those schedules always ended up as "missed schedules". The other option - define( 'ALTERNATE_WP_CRON', true ); worked but did bypass nginx-helper. Thank you for reading.

@kochtopf kochtopf reopened this Sep 14, 2018
@RavanH
Copy link
Owner

RavanH commented Sep 14, 2018

/** Disable wp-cron ind wp-config.php */ define('DISABLE_WP_CRON', true); 0,20,40 6-23 * * * www-data /usr/bin/php /srv/site/wordpress/wp-cron.php In this situation the passed array of urls from xml-sitemap-feed is empty.

That is strange... Appart from the Nginx Helper purge filter, I wonder if pings are skipped then too. Will have to test.

@RavanH
Copy link
Owner

RavanH commented Dec 12, 2018

I've done some tests and as far as I can figure out, the rt_nginx_helper_purge_urls filter hook does not get called at all both on WP Cron or when calling wp-cron.php manually or by cron job. It does get called at the time when scheduling a new post, and not actually publishing it.

Feels like a bug in Nginx Helper...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants