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

Fix preloading the sitemap with update from any version less than or equals 3.12.0.2 #5337

Merged
merged 4 commits into from
Aug 24, 2022

Conversation

engahmeds3ed
Copy link
Contributor

@engahmeds3ed engahmeds3ed commented Aug 24, 2022

Description

We had a problem with this condition

if ( version_compare( $new_version, '3.12.0', '>=' ) ) {

Which means that if the new version is less than 3.12 we will preload the sitemap and this will never happen.

So this PR to solve that.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Locally and fixed the fixtures

Checklist:

Please delete the options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@engahmeds3ed engahmeds3ed self-assigned this Aug 24, 2022
@engahmeds3ed engahmeds3ed requested review from CrochetFeve0251 and a team and removed request for a team and CrochetFeve0251 August 24, 2022 08:31
@engahmeds3ed
Copy link
Contributor Author

Will update the fixtures and tests and be ready for review

@engahmeds3ed engahmeds3ed marked this pull request as ready for review August 24, 2022 08:52
@engahmeds3ed engahmeds3ed requested review from CrochetFeve0251 and a team August 24, 2022 09:06
@engahmeds3ed engahmeds3ed merged commit f7bf0ae into develop Aug 24, 2022
@engahmeds3ed engahmeds3ed deleted the fix/sitemap_preload_with_update branch August 24, 2022 09:34
@jasonb4u
Copy link

jasonb4u commented Sep 3, 2022

Preload SITEMAPS has disappeared, this is where it used to be
4-09-2022 8-21-41 AM

@jasonb4u
Copy link

jasonb4u commented Sep 5, 2022

soooo where is it now ?

@piotrbak
Copy link
Contributor

piotrbak commented Sep 5, 2022

@jasonb4u Since 3.12 release we changed how we deal with the preload. We save URLs and their statuses in the database, please check our documentation:
https://docs.wp-rocket.me/article/8-preload-cache

If you have any further questions, please reach our Support Team.

@jasonb4u
Copy link

jasonb4u commented Sep 5, 2022

This is NOT allowing to select which sitemaps we want Cached. Needs option to select what we want cached

@piotrbak
Copy link
Contributor

piotrbak commented Sep 5, 2022

@jasonb4u From what I can see you were using autocompatibility with SEOPress + additional sitemap, this is how it's working now too.

Needs option to select what we want cached

This is an enhancement we're discussing about and it's possible that it'll be implemented soon. Thank you.

@jasonb4u
Copy link

jasonb4u commented Sep 6, 2022

how is it an extra enhancement when it was in v.3.11.5 and now removed, lol. I know most of my dev friends had to roll back to 3.11.5 because you remove something that needs to be there !

@piotrbak
Copy link
Contributor

piotrbak commented Sep 6, 2022

For the initial load of the sitemap, you can use the following filter:

function add_my_sitemap() {
return ['https://domain.com/my_sitemap.xml'];
}
add_filter( 'rocket_sitemap_preload_list', 'add_my_sitemap', PHP_INT_MAX );

For the overall enhancement, please follow the following issue:
#5394

Please note that we use Github for development purposes only.

@wp-media wp-media locked as resolved and limited conversation to collaborators Sep 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants