Support

Home Forums Event Espresso Premium Event Espresso with PHP 8.0

Event Espresso with PHP 8.0

Posted: October 23, 2022 at 9:30 pm

Viewing 8 reply threads


LT Training

October 23, 2022 at 9:30 pm

Hi,

We recieved an email about moving to PHP 8.0 for WordPress and using Event Espresso 4.10.40.p. We have set this up on a test website, and an error is stopping us. Is there a later release than 4.10.40.p?
– I couldn’t add an event to the cart as it doesn’t seem to exist.

Here is a link to the pictures of the error https://postimg.cc/gallery/3G9y3RT
Picture one is what I get when adding something to the cart. Picture 2 is the copy of the website and picture ‘2 real website’ is what we have on our website that is up for comparison.

Thanks
LT Training


Garth

  • Support Staff

October 24, 2022 at 9:28 am

Can you provide a link to the test website so we can look at it in real-time?


LT Training

October 24, 2022 at 11:24 pm

Hi Garth,

Here is the test website running php8.0 https://wordpress-529350-2947129.cloudwaysapps.com/
Here is the real website running php7.3.33 https://www.lttraining.com.au/

Thanks
LT Training


Tony

  • Support Staff

October 25, 2022 at 1:29 pm

Hi there,

Can you re-enable the Multi Event Registration add-on on the test site please, I’d like to take a look at the request/response in when adding registrations to the cart.


Garth

  • Support Staff

October 25, 2022 at 3:10 pm

Hi there,

Looking at the network requests, this is unusual:

Request URL: https://wordpress-529350-2947129.cloudwaysapps.com/wp-admin/admin-ajax.php
Request Method: POST
Status Code: 500
Remote Address: 192.46.221.126:443
Referrer Policy: strict-origin-when-cross-origin

Is cloudways blocking access to the admin-ajax.php. You’ll need to look at the error logs for more information. It may not even be an error from Event Espresso.

Or swap out define( ‘WP_DEBUG’, false ); within wp-config.php for this snippet:
https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug

Which then logs errors in /wp-content/debug.log and as thats public we can view them.


LT Training

October 26, 2022 at 10:00 pm

Hi again,

There are no issues on Cloudways. We copied this exact build to a new server (on Cloudways) with PHP 7.3 and the site worked perfectly.

Here are some notes from the developer:
Got error ‘PHP message: PHP Deprecated: Required parameter $transaction follows optional parameter $TXN_total in /public_html/wp-content/plugins/eea-promotions/EED_Promotions.module.php on line 335PHP message:

PHP Deprecated: Required parameter $args follows optional parameter $depth in
/public_html/wp-content/themes/lt-training-upgrade/inc/class-foundation-navigation.php on line 20PHP message:

PHP Deprecated: Required parameter $output follows optional parameter $depth in
/public_html/wp-content/themes/lt-training-upgrade/inc/class-foundation-navigation.php on line 20’, referer: /registration-checkout/?uts=1666773392

As you can see, there are a number of errors in this plugin that are not compatible with PHO 8.0

Would you be able to provide us with a version that is 100% compatible with PHO 8.0?

Thanks
LT


Tony

  • Support Staff

October 27, 2022 at 2:59 am

There are no issues on Cloudways. We copied this exact build to a new server (on Cloudways) with PHP 7.3 and the site worked perfectly.

PHP8 has breaking changes, it tightens up data types a lot and PHP will no longer shrug off an issue with a data type when it’s not what is ‘expected’… PHP7.3 will shrug the issue off and carry on which is likely why you are getting the above error.

‘Loose typing’ makes it easier for ‘non-developers’ or ‘new’ developers to write code because you can basically do whatever you want and PHP ignores issues with types. However, it also makes things much slower because any code you write properly to rely on specific types needs to first check you are given the correct type, tight type control means that is no longer an issue.

The error 500 Garth pointed out is a fatal error being thrown on the server, we need the error being thrown to know what the problem is, without it we can’t advise further as it could literally be anything.

We have literally thousands of hooks within Event Espresso (not including WP core hooks which also apply) and code hooking into any of the processes running on SPCO could cause that fatal. I don’t think it is an issue within EE core itself as we’d see this on every single site using PHP8.

If you check the server’s error logs at the time the request is made it should include a fatal error with details, if not, use the snippet Garth provided on the link to log the errors so we can test and view them.

As you can see, there are a number of errors in this plugin that are not compatible with PHO 8.0

You’ve included 1 deprecation notice from the Promotions add-on and 2 from your theme.

Deprecation notices are there when PHP makes a change to something which will need to fixed but it works as is, in the next version it will likely throw a fatal error which is why it needs to be fixed and why the deprecation notices is added.

So this:

Got error ‘PHP message: PHP Deprecated: Required parameter $transaction follows optional parameter $TXN_total in /public_html/wp-content/plugins/eea-promotions/EED_Promotions.module.php on line 335PHP message:

Isn’t causing the issue currently but we will get an update out for the promotions add-on to fix it.

Would you be able to provide us with a version that is 100% compatible with PHO 8.0?

Event Espresso is PHP8 compatible as is.


LT Training

November 6, 2022 at 4:47 pm

Hi,

Thank you so much for your help, the developer was able to fix it now, and it all seems to be working.

Thanks
LT


Tony

  • Support Staff

November 7, 2022 at 5:17 am

Great, I’m glad it’s now working for you.

Viewing 8 reply threads

The support post ‘Event Espresso with PHP 8.0’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso