PHP INTL Extension should not break GiveWP
complete
Jason Adams
complete
Greetings all!
We have addressed this in the GiveWP 2.24.2 release. We introduced a new setting and wrote an article on the subject, which I encourage you to read. In short, GiveWP will work without the Intl extension, but you won't get the full benefits of what we're doing with auto-formatting for numbers and currencies moving forward.
Please update and let us know if you run into further issues!
S
Scott Lewis
A number of hosts do not enable INTL by default. Other plugins like Independent Analytics have ended up creating alternative solutions that don't depend on INTL because of this issue and to lower the volume of support requests and abandoned installs caused by this error. Glad to see Give is working on a solution to handle the situation more elegantly than the fatal error / broken UI.
You may want to chat with the Independent Analytics team to see how they handled it since it was a recent change and you might not need to reinvent the wheel if their solution was general enough to fit here.
Ben Meredith
in progress
Great news, folks. We've just tested (and are prepping for release) a solution to this issue that's not "just tell your host to update things" That walks a healthy line avoiding enabling bad behavior by web hosts while also not creating unsightly fatal errors on the site.
We also wrote a document explaining the whole thing, here: https://givewp.com/documentation/developers/currency-formatting-with-givewp/
Note that the setting pictured there is what's coming in the next release, still making its way through internal testing for release very soon (hopefully today).
Ben Meredith
closed
This is one of those issues that's a bit tricky to address, but I want to give clear reasons for why ultimately GiveWP is
not
going to be addressing it from our side. GiveWP requires the PHP INTL extension in order to function properly. In reality, we've had that requirement for a while, but when servers don't have it installed, until the most recent updates it wasn't all that noticeable.
As of the most recent releases, the INTL extension (specifically the NumberFormatter class) being absent causes things to fail more dramatically, on the back end of the site.
Your Web host should be able to install the INTL extension (and they should! it makes internationalization-related issues much easier to address, and is better for PHP as a whole)
Reach out to the your host, if you are seeing this issue.
Ben Meredith
Here's a longer version of what specifically is going wrong:
GiveWP uses the INTL extension for PHP to support automatically formatting currencies and other numbers according international conventions. It greatly simplifies our codebase to not have to "reinvent the wheel" and write our own functionality to do that formatting, since the PHP extension does it for us.
That works great, except when web hosts (for various reasons) don't have that extension installed.
Fun fact: we've required that extension for at least the last few major releases of GiveWP, but only in this one did we utilize NumberFormatter (the class that's breaking when you don't have INTL installed) in a way that makes GiveWP break in a noticeable way, on the "Donations," "Donors," and "All Forms" lists on the admin side of sites.
So now we're debating the tradeoffs of either essentially enabling web hosts to continue making internationalization difficult by building in workarounds for those who don't enable INTL (It's trivially simple for them to do so) or allowing these mild inconveniences for users who don't have INTL installed, and make the entire web better (PHP should enable internationalization by default!)
We're tracking carefully how many folks this addresses, and more importantly, if web hosts are balking at enabling that extension. Please comment here if your host refuses to enable INTL for some reason.