Ok, I think I got it – sitemap re-generates every time admin is accessed due to admin_init action – is that right @coleds ?
It should only be generating a site map first upon activation of the plug-in then upon access of the website/admin. The later only happens if under settings generate site map checkbox is checked.
This may be changed in the future.
@coleds thank you for your answer.
As i observed site map gereration is added to admin_init action
and admin_init “Fires as an admin screen or script is being initialized.” I think it means, it runs every time you enter admin section.
So that’s why fresh sitemap.xml always exists – even if i uncheck “Generate a Sitemap?” or use “Delete Sitemap” button. I think it would be cool to have sitemap.xml generation optional.
Also I have another question – do you have any plans to integrate sitemap generator with built in wordpress sitemap support (since WP 5.5)?
-
This reply was modified 5 years, 8 months ago by
jacek606.
@jacek606 You are correct. I have it set to admin_init and when the plugin was being loaded front end and backend. I’m working on disabling this and once this is done, it will generate a sitemap upon activation and then only when manually done or when a new post is created.
A fresh sitemap is always in exitance at this moment, I will rectify this soon.
I do, as well as updating the core plugin to be more object oriented.
Great! Thanks for the answer.