liedekef / events-made-easy

The wordpress/classicpress plugin events-made-easy to manage events, memberships and more.
https://www.e-dynamics.be/wordpress
GNU General Public License v2.0
26 stars 5 forks source link

Event page hangs if selecting Single Event Format in Single Event Title dropdown #394

Closed TimB111 closed 10 months ago

TimB111 commented 10 months ago

Describe the bug When creating a new event, in the Single Event title dropdown, if you accidentally select an event template with single event format information then the event page times out.

At one point it gave this error: Parse error: syntax error, unexpected ':', expecting ')' in /home/mysite/public_html/website.com/w/wp-content/plugins/events-made-easy/eme-filters.php on line 231 There has been a critical error on this website.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Events > Add Event'
  2. Set 'Single Event Title' to a template containing single event format code.
  3. Click on 'Save'
  4. View the event
  5. See error (page times out)

Expected behavior It would be helpful if EME could catch the error and identify exactly where the problem comes from. I.e. it would be helpful to say that the selected template won't work for whatever reason.

Version info PHP version: PHP 8.0 EME version: Version 2.4.20

liedekef commented 10 months ago

The syntax error is not corresponding with the code, so that can't be related to version 2.4.20 The rest: can you provide the template causing issues? I tried with #_EVENTNAME in a template and that works fine for a basic event test

TimB111 commented 10 months ago

Apologies, I updated EME last night when troubleshooting the error so the version was probably incorrect.

With the latest version I still get a "Service Unavailable" error if using a single event format template in the Single Event Title dropdown. I've narrowed it down to having 2 custom shortcodes in the single event format template.

Contact us by [sc name="whatsapp-icon"][/sc] or [sc name="email-icon"][/sc].

These shortcodes are created using the plugin Shortcoder and I've defined them to insert an icon and link. Strange thing is it works fine if the single event format template contains one shortcode or the other, but fails when both are there. And it works when the template is used in the Single Event dropdown but the page fails to load when used in the Single Event Title dropdown.

liedekef commented 10 months ago

The way you describe it, the "Service Unavailable" seems to point to an infinite recursion taking place. I've installed the plugin, but don't know your definition. Feel free to go to Tools -> Export and export the shortcoder-stuff and send it to me via mail

TimB111 commented 10 months ago

Thanks, I've emailed the shortcodes to you.

liedekef commented 10 months ago

Seems to be a bug in the shortcoder plugin. If I create the 2 shortcodes manually in functions.php , it works fine ... So you should talk to the plugin owner of that plugin.

TimB111 commented 10 months ago

Ok I'll speak with the developer of that plugin, thanks

liedekef commented 10 months ago

it has something to do with the call to do_shortcode on that text. It seems it can cause a loop (and the loop actually happens in do_shortcode, not in EME), but I don't know why ... it doesn't cause a loop when in the event body nor when I create 2 shortcodes (via functions.php in the theme) and use those in the title.

liedekef commented 10 months ago

Btw, I use a plugin called "Code Snippets", maybe that works better ... You can add filters and shortcodes with that.

TimB111 commented 10 months ago

Thank you, I've asked the developer of the Shortcoder plugin about this.

And thanks for the tip, I'll give Code Snippets a try.

liedekef commented 10 months ago

I found something for Shortcoder, see my comment https://wordpress.org/support/topic/page-timing-out-when-2-shortcodes-are-used/#post-17295470

liedekef commented 10 months ago

I've implemented a workaround for shortcoder (and other plugins that might behave like this). The current dev-version should work fine.

TimB111 commented 10 months ago

That's great, thank you!