Hi @gb24, an update to the Sqaure SDK was made in version 4.2.0 which seems to have fixed this issue.
However, it will be best to confirm with your host whether PHP comments are enabled/disabled in the php.ini
file. This is because JsonMapper relies on comments to function.
Please do let us know their reply and we will be happy to pass it on to the development team.
Thread Starter
gb24
(@gb24)
Hi @imodouglas , PHP comments are disabled in the Kinsta php.ini file.
Attempting to activate the Square plugin gives the error:
All features in Square for WooCommerce have been disabled due to unsupported settings:
• Invalid OPcache config: Please ensure the save_comments
PHP option is enabled. You may need to contact your hosting provider to change caching options.
Kinsta will not change the PHP.INI save_comments setting. In addition, per the original support issue I referenced, Kinsta says:
“We will be unable to allow the reading the /etc/php/8.0/fpm/php.ini file, I am afraid. In that case I would advise you to contact the plugin developers and report that we can’t support apimatic/jsonmapper.”
https://wordpress.org/support/topic/square-plugin-doesnt-work-on-kinsta-hosting/
The original support issue mentioned:
I understand that the issue is still not fixed. That’s currently a limitation for our Square extension, so we created an internal issue to find alternatives to jsonmapper
.
Any progress on “alternatives to jsonmapper”?
Thank you.
Hi @gb24, it seems there is some misunderstanding around JsonMapper, php.ini
and the opcache.save_comments
config. The following info from the team should clarify:
This is what the dependency looks like:
WooCommerce Square > Square SDK > JsonMapper > php.ini > opcache.save_comments
“But the JsonMapper issue was fixed? Why is it happening again?”
Previously when opcache.save_comments
was disabled, there was a fatal error that was thrown by JsonMapper, which was visible upon the activation of the Woo Square plugin.
This fatal error was later fixed and handled within JsonMapper, so that hosting providers that have opcache.save_comments
disabled or if the access to php.ini
was blocked, the fatal error could be gracefully handled.
In Summary:
- The Square SDK is built using JsonMapper.
- JsonMapper still strictly relies on the access to the
php.ini
file.
- JsonMapper still strictly relies on the value of the
opcache.save_comments
configuration.
Conclusion :
Woo Square will not work if:
opcache.save_comments
is disabled by hosting providers
- Hosting providers prevent from accessing the
php.ini
file.
JsonMapper is a dependency of the Square SDK which the Woo Square plugin uses. Even if there were an alternative, we doubt if we could do anything about it from Woo Square.
I hope this helps clarify thing. Please let us know if you need further assistance.
Thread Starter
gb24
(@gb24)
@imodouglas, thank you for the detailed explanation.
It appears, then, that the WooCommerce Square plugin just can’t be used on Kinsta.
I will move on to looking for another payments plugin for Woo.
Thank you.
Hi @gb24,
I totally understand that this is not the response you were looking for. If you are looking for another payment method that allows in-person payment, I recommend using WooPayments which works with Woo In-Person Payments.
It is important to note that Woo In-Person Payments is only available for stores based in the U.S., Canada, or the U.K.