cocart-headless / cocart-cors

Enables support for CORS to allow CoCart to work across multiple domains.
https://wordpress.org/plugins/cocart-cors/
Other
3 stars 0 forks source link

CORS not working since 1.0.3 #20

Closed anthonymf closed 11 months ago

anthonymf commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@seb86 I will try your suggestion and report back 👍

anthonymf commented 1 year ago

@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 commented 11 months ago

@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 commented 11 months ago

@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 commented 11 months ago

Released