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

CORS not working since 1.0.3 #20

Closed
anthonymf opened this issue Aug 9, 2023 · 6 comments
Closed

CORS not working since 1.0.3 #20

anthonymf opened this issue Aug 9, 2023 · 6 comments

Comments

@anthonymf
Copy link

I noticed the CoCart CORS plugin isn't working since 1.0.3.

The CORS headers are no longer present it's as if this extension isn't installed.

The behavior I observe is that the CORS extension isn't activated - the cocart_init action doesn't call \CoCart\Cors\Plugin::init();.

CoCart version 3.9.0
PHP 8.1

@seb86
Copy link
Member

seb86 commented Aug 9, 2023

If you changed cocart_init to plugins_loaded instead, can you tell me if that works for you?

I suspect it's a load issue and didn't consider it when releasing. The main CoCart plugin name has changed in v4 so WordPress is loading the plugin before hand.

@anthonymf
Copy link
Author

@seb86 I will try your suggestion and report back 👍

@anthonymf
Copy link
Author

@seb86 I can confirm that if I change this line https://github.com/co-cart/cocart-cors/blob/fa5cfcb/cocart-cors.php#L41 to use plugins-loaded instead of cocart_init then it works fine.

@anthonymf
Copy link
Author

@seb86 I don't understand this issue enough to know but would it help if I made a PR to do this? Or are there wider implications? Or you have another plan?

@seb86
Copy link
Member

seb86 commented Nov 6, 2023

@seb86 I don't understand this issue enough to know but would it help if I made a PR to do this? Or are there wider implications? Or you have another plan?

Sorry for the delay. Life stuff happened. Will have this issue resolved this week.

@seb86
Copy link
Member

seb86 commented Nov 6, 2023

Released

@seb86 seb86 closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants