Support

Home Forums Event Espresso Premium Site-specific plugin not working since upgrade to WordPress 5.5.1

Site-specific plugin not working since upgrade to WordPress 5.5.1

Posted: September 2, 2020 at 10:59 am

Viewing 11 reply threads


codingforsail

September 2, 2020 at 10:59 am

A while ago (February) I created a site-specific plugin with your help, to alter the wording/branding of event espresso.
Last night the site upgraded itself to WordPress 5.5.1.
Today some of the changes implemented by the site-specific plugin seem to have stopped working, for example:

  • change spelling of Finalize to Finalise
  • reword the text and remove the link on the registration checkout page and replace it with a red button/white text; the rewording has happened but it’s now showing a blue button with blue text; apparently there is something similar later on in the registration process
  • Save the phone number, mobile phone number, address details, emergency contact information into the WordPress usermeta table
  • If the details above are saved, pre-fill them on reaching that page

I don’t know whether the invoice problem I raised a separate ticket about earlier is related to this.

I saw on a ticket someone else had raised that this plugin may help: https://wordpress.org/plugins/enable-jquery-migrate-helper/

Do you think it would help in this case?

Kind regards,

Anita


Tony

  • Support Staff

September 2, 2020 at 3:35 pm

Hi Anita,

The jQuery Migrate Helper helps fix issues with JavaScript where scripts on the site are using functions that have now been removed from the jQuery library, that is unlikely to fix your issues.

Can you post the content of your custom plugin to Pastebin (or somewhere else if preferred) and add the URL so I can take a look?


codingforsail

September 3, 2020 at 3:55 am

Hi Tony,

Thanks for offering to take a look. The plugin contents are here: https://pastebin.com/X7i3Uxj8

Last night, before I saw your reply, I tried the plugin and as you suggested it didn’t work. I also reverted to WordPress 5.4.2 and that didn’t work either. I tried again after I cleared the cache this morning in case it was that, but no change.

Kind regards,

Anita


Tony

  • Support Staff

September 3, 2020 at 4:02 pm

Hi Anita,

Are you sure there wasn’t another plugin, or some other code added somewhere else?

The reason I ask is the code you’ve sent me doesn’t alter anything visual other than text strings. So changing the colour of the buttons would have been done with CSS and usually not in a plugin like above.

I’ll list out what I can see that code doing:

1. It changes one of the text strings which refer to the user logging and/or registering.

2. It changes the checkout buttons to use:
‘Go to Finalise Registration step’
‘Welcome back, you can go to %1$s’
‘Login and go to %1$s step’
(Depending on the registration progress)

3. It auto-fills the Address info questions, but NOT from user meta (there’s also no ‘sync’ with user meta in that code). It’s pulling the address info from the EE_Contact previously created so you’ll only see the address details if they’ve previously been provided on EE.

4. It extends the WP User integration autofill so that it ‘remembers’ the last answer users on custom questions. Meaning if you’ve registered before and answers a custom question previously, the next time you answer that same question on say another event, if you are logged in it should be automatically prefilled.

Does it sound like those might be working above?


codingforsail

September 7, 2020 at 3:08 am

Hi Tony,
I only created that one plugin. There is no additional code in the child theme’s functions.php file. There is custom css in the child theme. For the buttons, it’s:

.event-cart-register-button,
.cart-results-register-button,
#spco-go-to-step-payment_options-submit,
#spco-go-to-step-finalize_registration-submit
{
    background-color: #c30006; /* pop colour */
    border: none;
    color: white;
 /*   padding: 15px 32px; */
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
} 

It is doing 1.
Under 2, it’s not doing the first, not sure about the others. Users are just seeing “Finalize Registration”.
3. Yes, apologies that was from memory. It’s not using usermeta directly; it’s pulling address and phone number information from WP_Members_User. The user registration asks for those fields and should be populated as the user continues with their event registration.
Custom questions should work as you say.

Kind regards,

Anita


Tony

  • Support Staff

September 8, 2020 at 5:12 am

Under 2, it’s not doing the first, not sure about the others. Users are just seeing “Finalize Registration”.

The hook to do this has been commented out, in the Pastebin it’s line 71 and 72.

#        add_filter( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 
#            array($this,'ee_spco_submit_button_text'), 10, 2 );

Remove the #s.

3. Yes, apologies that was from memory. It’s not using usermeta directly; it’s pulling address and phone number information from WP_Members_User. The user registration asks for those fields and should be populated as the user continues with their event registration.

WP_Members_User isn’t from Event Espresso and the code doing this basically removes the ‘EE’ version of the code.

All of the address details are coming from $this->user_data(); which uses WP_Members_User::user_data(); to populate $this->wpmem_fields. That is then checked before using ‘some’ of the EE snippets Josh created previously but code has been removed from those so they will never work as-is unless WP_Members_User::user_data(); has pulled the details already, meaning it looks like the problem with address fields is from WP_Members_User but that’s not from Event Espresso.


codingforsail

September 9, 2020 at 10:09 am

This reply has been marked as private.


Tony

  • Support Staff

September 9, 2020 at 10:51 am

3. It had been working. Function user_data() defined in lines 95-112 calls WP_Members_User::user_data()
Seems to be working now.

Most of the EE code around that simply can not work, the only reason it looks like it’s working is due to WP_Members_User::user_data() doing all the heavy lifting and pulling the data in.

WP_Members_User::user_data() isn’t from Event Espresso so I don’t know the is and outs of what it is doing, but if that stops pulling data in then nothing else in that function will pull it for you from EE.

I am glad it’s working now it’s just that if it fails further on then you’ll need to start looking into the above method.

Any idea what may have happened to the ticket, or to this transaction?

Do you mind if I take a look in the admin, it’s quicker to view the transactions than work through screenshots on this occasion? If that’s ok you can send details using:

https://eventespresso.com/send-login-details/


codingforsail

September 10, 2020 at 7:47 am

Thank you.
Login details created and sent.

Kind regards,

Anita


Tony

  • Support Staff

September 10, 2020 at 8:04 am

Ok, so the reason that specific transaction wasn’t working (and likely any others with the same issue) is because you’d trashed the Primary Registrant.

Event Espresso uses the primary registrant of the group to link everything together, the Invoice, Receipt, Tickets etc all use the primary registrant and them from their build out the details as needed. So whilst you can cancel the primary registrant by setting the status to cancelled, if you trash that registration you then can’t access any of the above.

I’ve restored the primary registrant for the above (REG ID 17856) and the Invoice now shows.


codingforsail

September 10, 2020 at 9:29 am

Thank you so much Tony.
Makes sense to me.
I’ll try and explain to the client!
At least in the first instance she’ll be happy that she can now send the invoice to the client.
Kind regards,
Anita


Tony

  • Support Staff

September 10, 2020 at 10:11 am

You’re most welcome.

Just a reminder than in the registration list, the primary registrant in a group is the one with the * next to their name.

Viewing 11 reply threads

The support post ‘Site-specific plugin not working since upgrade to WordPress 5.5.1’ 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