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

Closes #5729 Refactor Cloudflare implementation #5884

Merged
merged 159 commits into from
Jun 12, 2023

Conversation

remyperona
Copy link
Contributor

Description

Refactor Cloudflare implementation

Fixes #5729

Type of change

  • Enhancement (non-breaking change which improves an existing functionality)

Checklist:

  • 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
  • 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

@remyperona
Copy link
Contributor Author

I found one case where the transient was incorrectly set early, I pushed a commit to fix this

@Mai-Saad
Copy link
Contributor

@Tabrisrp We still have a problem on newlabs as follows now

  • while caching everything off => an error is there WP Rocket: Missing Cloudflare Zone ID. Read the [documentation](https://docs.wp-rocket.me/article/18-using-wp-rocket-with-cloudflare/?utm_source=wp_plugin&utm_medium=wp_rocket#add-on) for further guidance.
  • while caching everything on (excluding admin) => notice confirms changes at CF not displayed and changes not applied
    Please feel free to check it on newlabs (currently cache everything is off at CF) 🙏

@remyperona
Copy link
Contributor Author

What are the steps for this case?

@Mai-Saad
Copy link
Contributor

Mai-Saad commented Jun 6, 2023

@CrochetFeve0251 Thanks for the update. The latest scenario is fixed, however, can see the following issues (working fine on trunk)
Scenario1:
1- Clear transients then fresh install and activation of wpr
2- Enable CF Addon and add valid keys along with enabling optimal settings in the same time then save => Error will be displayed while it shouldn't.
Scenario2:
1- Fresh install and activation of WPR
2- Enable CF and add valid keys
3- edit the public key and add some char then save => no error displayed
Can you please check this? 🙏

@vmanthos
Copy link
Contributor

vmanthos commented Jun 8, 2023

@CrochetFeve0251 Thank you for the update.

The scenario where saving the correct credentials after a fresh installation was causing an error is fixed. 🎉

However, both of the scenarios described by Mai in the previous comment are still there.

For the second one, the following notice is displayed:

Cloudflare cache level error: Incorrect Cloudflare Zone ID. Read the [documentation](https://docs.wp-rocket.me/article/18-using-wp-rocket-with-cloudflare/?utm_source=wp_plugin&utm_medium=wp_rocket#add-on) for further guidance.
Cloudflare minification error: Incorrect Cloudflare Zone ID. Read the [documentation](https://docs.wp-rocket.me/article/18-using-wp-rocket-with-cloudflare/?utm_source=wp_plugin&utm_medium=wp_rocket#add-on) for further guidance.
Cloudflare rocket loader error: Incorrect Cloudflare Zone ID. Read the [documentation](https://docs.wp-rocket.me/article/18-using-wp-rocket-with-cloudflare/?utm_source=wp_plugin&utm_medium=wp_rocket#add-on) for further guidance.
Cloudflare browser cache error: Incorrect Cloudflare Zone ID. Read the [documentation](https://docs.wp-rocket.me/article/18-using-wp-rocket-with-cloudflare/?utm_source=wp_plugin&utm_medium=wp_rocket#add-on) for further guidance.

Can you please look into these? 🙏

@piotrbak
Copy link
Contributor

piotrbak commented Jun 9, 2023

@vmanthos @Mai-Saad I'm not able to reproduce both scenarios :/

@piotrbak
Copy link
Contributor

piotrbak commented Jun 9, 2023

I can see the following edge case, which is not blocking. The same error as @vmanthos shared is displayed. Steps to reproduce:

  1. Enable WP Rocket plugin and add correct CF credentials
  2. Change credentials to the wrong ones and save settings - error is displayed about wrong credentials
  3. Add back the correct credentials and save settings in the same step - error is displayed, the same as Vasilis mentioned

@vmanthos
Copy link
Contributor

@piotrbak I checked the PR with the latest commits, and I can't reproduce scenario 2 but I can consistently do that for scenario 1.

Screencast in Slack Convo (non-public link).

@remyperona remyperona added this pull request to the merge queue Jun 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jun 12, 2023
@remyperona remyperona added this pull request to the merge queue Jun 12, 2023
Merged via the queue into develop with commit 73ab0c3 Jun 12, 2023
@remyperona remyperona deleted the enhancement/update-cloudflare branch June 12, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: cloudflare type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Cloudflare code to the latest library
5 participants