Okay
  Public Ticket #2829687
Increasing performance on event page
Closed

Comments

  •  1
    Ian Bowden started the conversation

    I have implemented the events part of Amelia on the website of a client at the cited website page and am using the [ameliaevents type=calendar] shortcode to display a calendar of events.

    My client's business has exploded post-pandemic and they've had to implement this booking system to limit the number of people using their park at one time. Many people are using the website and Amelia to book two-hour events. Unfortunately, many customers are getting an error when trying to access this page - it shows it as busy or not accessible - and I'm thinking that's occurring because of the strain it puts on the web server when having to load all of the many events.

    Unfortunately, Amelia seems to load events from past dates as well, adding to the load. Why would someone want to view a past event that is no longer able to be booked?! Is there any way I can delete these from the database so they don't even show up any more?

    I've experimented with the [ameliaevents event=1 recurring=1] shortcode, but that's not very helpful because Amelia doesn't currently support daily recurring events (arrgh!) and I've had to set things up as weekly recurring. So, when using a shortcode like that I can only display, for example, a list of the the first events on Tuesdays for the next few weeks.

    I'm thinking that I might be able to do this through the use of tags and the [ameliaevents tag='name'] shortcode. However, I cannot add a tag! See my screen video: https://storyxpress.co/video/krb9di1djqb1l0jg6  Were I able to do this, I could, for example, put the tag 'w1' (for week one) in all of a single week's events and only display a list of those. However, I need to actually be able to create a tag for this to use!

    Any further help or ideas with proposing a different way to handle this would be greatly appreciated.

  • [deleted] replied

    Hi, Ian,

    Thank you for choosing Amelia.

    Actually, lots of users want to display past Events (I can't tell you why exactly since I never asked this question, most probably they want their Customers to know about Events dynamics, but it's just my guess).

    You can try to add this JS  to the booking page in order to hide past Events:

    window.ameliaBooking = {
        pastEventsDays: 10,
        cabinet: {
            pastDays: 0,
            futureDays: 10,
            disableAuthorizationHeader: false
        }
    }

    In this script, you can set pastDays and futureDays to any number of days that you'd like to be displayed in the past and in the future respectively.

    If you need help with adding custom JS to the page, please take a look at this article.

    Also, could you please clarify which Amelia version you currently have? Since we added a fix for loading speed to version 4.0.0. 

    Looking forward to hearing from you. 

  •  1
    Ian Bowden replied

    Liza,

    Thank you very much for this information and advice. I haven't yet updated to v4 of Amelia and look forward to performance increases when I do that sometime in the next few days.

    I will also be trying out your JS to not show past and/or future date spans. I'm not a coder, but can typically figure out logically what's happening and know what parameters to change to get the desired results. Unfortunately, you didn't provide any more detailed information, leaving me to the following questions:

    1. It's pretty obvious to me that futureDays (currently being 10) pertains to days in the future that I want to limit the display of. What's not so obvious is which parameter pertains to past days. Is it pastEventsDays (currently 10) or pastDays (currently zero) that holds the setting? And what's the other setting for?

    2. Whatever the past days setting is, could I put a very big (e.g. 500) number there to ensure that no past events were ever displayed?


  • [deleted] replied

    Ian,

    Thank you for the clarification.

    The thing is, we have a bug related to the outdated Guzzle version that we used in our update. Our developers added a fix, so if you update Amelia, you can either wait until the next update which will include the fix (it will take approximately 6-8 weeks), or let us know and we will send you the file with the fix, so you will be able to update Amelia manually now.

    1. I'm afraid, I cannot explain the script's logic, however, if you set pastDays to 0, no past events will be shown.

    2. It's supposed to work the other way around: by setting this parameter to 0, you will be able to block past Events from displaying (if I understood your question correctly).

    Best Regards. 

  •  1
    Ian Bowden replied

    Liza,

    I'm clear on configuring the JS code properly, but am not understanding what the point of your second paragraph (beginning with "The thing is...")! You seem to be telling me that there might be a problem with the update to v4 or something. You also offer to send me an update file. I don't follow any of this! Please clarify.

  • [deleted] replied

    Ian,

    Sorry for that. 

    Yes, what I'm trying to say is v4.0.0 and v4.0.1 are optimized (so, the performance was increased), however, they have a bug.

    Therefore, I would definitely recommend you update Amelia to the most recent version 4.0.1 but do it manually through FTP with a debugged file (if you update Amelia on the WP Plugins page, you will have the version with the bug, which might cause some issues). If this option is suitable for you, I will send you the debugged file and a step-by-step guide on how to update Amelia through FTP. 

    Otherwise, if you don't want to update the plugin manually through FTP, it's better to wait until we release the next update (which will have the fix in it), and then update Amelia on the WP Plugins page.

    Hope now my explanation is more clear. 

    Best Regards. 

  •  1
    Ian Bowden replied

    Yes, that's much clearer, Liza!

    Please send me the FTP link and instructions. I have no fears about installing the update manually to ensure I get as bug-free a version as possible.

    Thanks for all of your help with this!

  • [deleted] replied

    Ian,

    Sure!

    First, please check if the option Delete plugin tables is disabled in Amelia -> Settings -> Activation (it is disabled by default, but just in case).

     And then follow the steps below:

    1) Download the attached zip folder

    2) Use FTP to open /yourwordpressfolder/wp-content/plugins

    3) Delete existing ameliabooking folder

    4) Upload previously downloaded ameliabooking folder through FTP to plugins folder (unzip it)

    5) Go to WP-admin panel, open Plugins section

    6) Deactivate Amelia Plugin, and then activate it again

    7) Clear site and browser cache

    And that's it. 

  •  1
    Ian Bowden replied

    I have successfully updated Amelia manually.

    However, I cannot get the provided JS to function as expected. I have used it as per your indicated instructions in the Insert Headers and Footers pluginf6e4txc.pngI

    I have also tried it with script tags - <script> and </script> before and after the code.

    I have also tried it both ways within Elementor's 'Add Custom Code' function and within the 'Code Snippets' plugin and the page that holds the calendar remains the same, showing unlimited event dates before and after today.

  • [deleted] replied

    Ian,

    Let me reach out to our developers since we didn't test this script with the updated version.

    I will get back to you once I receive their response.


  • [deleted] replied

    Ian,

    Please try to add this CSS instead:

    .am-event.closed {
    display: none !important;
    }

    I just tested it and it worked on my demo site.

    This CSS hides closed Events, so basically it hides past Events as well.

    If you need help with adding custom CSS to the page, please take a look at this article.

    Looking forward to hearing from you. 

  •  1
    Ian Bowden replied

    Liza,

    Oh my, I can't even get this simple CSS to work properly!

    I have put it into the theme customizer:

    pYY9lr7.png

    and I have put it directly into its shortcode container via Elementor:

    EkT4w0A.png

    and if you go to the page at https://funsplashsportspark.ca/tickets/ you'll see it's still showing past dates in the calendar. Sigh.

  • [deleted] replied

    Ian,

    Nono, you did everything correctly.

    The problem is, this CSS can work only on the List view due to the Calendar view configuration (it has a more complicated structure and simple CSS can't be applied to it). Sorry for not mentioning it before. 

    And regarding the tags: could you please provide us with a temporary WP Admin login, so we will be able to look into the issue from the inside? It will be better if you create a new Admin user for us. You can use my email address [email protected] in case you need it.

    You can post access credentials as a private reply to this ticket.

    Looking forward to hearing from you. 

  •   Ian Bowden replied privately
  •   [deleted] replied privately
  •  1
    Ian Bowden replied

    Liza,

    Now that I've got that email delivery issue figured out, I had time to go back to this one!

    My client likes the calendar view for events, so we'll keep away from list view unless it's the only way to make any of this work.

    I was able, in incognito mode, to login with the credentials I provided to you and successfully add a tag to an event - so you were correct in determining that it's an issue related to me not having a customer or employee email in Amelia. Therefore, please provide me with instructions on how to fix this "mixed permissions" issue. (I always thought a mixed permission issue was when the father of a girl I liked thought it was okay for me to ask her out on a date, but her mother didn't!)

  • [deleted] replied

    Ian,

    AHAHA you literally made my day.

    So, what you can do to fix that:

    1. Please check in your Customers/Employees list if there is a Customer/Employee with your WP Admin's email address. If so, delete this Customer or Employee and check if you can add tags again.

    2. If this doesn't help, please access your database, the wp_amelia_users table (it can have another prefix rather than wp_ depending on your database), and edit your current Admin user - delete any additional roles, leaving only the Admin one. Or simply create a new Admin user with an email address that wasn't used in Amelia before.

    The thing is, Admin email always should be unique, that's why it's better to avoid booking events on the front-end being logged in as Admin or accessing the Customer/Employee paned under Admin user since Amelia can assign other roles to your Admin user (that's what we call "mixed permissions" here).

    Looking forward to hearing from you.