WordPress.org

Ready to get started?Download WordPress

Forums

amr ical events lists
amr-rrule.php taking too long, w (12 posts)

  1. UULosAlamos Webmaster
    Member
    Posted 2 years ago #

    New thing popped up this January. My postmaster has a limit of 30 seconds for a script or it cancels it. The problem is that the script appears to just keep running and eventually overloads the server's RAM and crashes the system. The offending script is amr-ical-events-list/includes/amr-rrule.php

    We get various points within the script that causes the problem. Line 761, 52, 51, 964, 1028, and 55 have been identified. I am using PHP 5.2.17.

    Also, I recently I can no longer put a URL in the widget's "Calendar URL" as it now shows up as the HTML itself in the widget on my page.

    http://wordpress.org/extend/plugins/amr-ical-events-list/

  2. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    Hi UULosAlamos Webmaster,

    what are your parameters for max days and events ? Try making lower.

    since recurring events can recur like 'forever', the rrule logic needs some constraints when it generates the individual events for the rrule. If these constraints are too high, it will generate a LOT of instances of each event before being able to constrain again

    Also if the ics file has a lot of 'old' events that recur, the plugin still have to evaluate then in case a generated recurrence falls within the time frames.

    If this is your site http://www.uulosalamos.org, i've grabbed the ics url for testing here:
    http://test.icalevents.com/calendar-of-all-events/uulosalamos/
    and it is fine there.

    Re thecalendar url - sounds like this problem - see quick fix (new in more recent wp theme upgrades):
    http://wordpress.org/support/topic/plugin-amr-events-lists-and-calendars-aka-amr-ical-events-list-widget-title-not-showing-correct-hyperlink?replies=2

  3. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    Hi - another thought - the whole wp website contributes to the php runtime - I see the events widget is the last in the sidebar, so it may well be that the site simply hits the limit by the time it gets there.

    I am adding some time debugging to the next version so we can tell approx where the problem lies.

    From my site, your ics file only takes a couple of seconds - worst case is when it has to refresh the ics file 1.9 sec, the rest is less than a second.

    There are 6000 data lines in the file and about 370 events only some of which recur.

  4. uulosalamos
    Member
    Posted 2 years ago #

    My number of events was 30 and days is 45. For the widget, I reduced to 10 events but the short code in the widget says 7 days. The calendar I am pulling has highlighted events and holidays, so there shouldn't be that many events. My hostmaster cited the rrule file specifically as the culprit, but he could be wrong. The calendar does come up quickly.

  5. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    Hi

    as said I'n not convinced the problem is due to the plugin but will be interesting if you can load next version when it goes up (with some timedebugging options)

    Note (in case you missed the last line above) your events ics file (if that is the one) is large (6000 lines and 390 events). The plugin has to parse them all to figure out if they are relevant). I imagine many may be old? Maybe if you did a cleanup of old events?

    I don't think google has a way to tell it to issue 'future' events only, not history.

    (My amr-events plugin for example has a way to clean up old events - one can say for eg: keep last two months only etc. )

  6. uulosalamos
    Member
    Posted 2 years ago #

    I did go through and remove a lot of old events from the calendar that the plugin uses the most. Will see if that helps. We use google for our calendar, and there isn't an easy way to clean those up.

  7. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    In the latest version, if you add ?debugtime&refresh

    (add a refresh to force a test the fetch of the file)
    like this
    http://test.icalevents.com/calendar-of-all-events/uulosalamos/?debugtime&refresh

    then it will start tracking time 'after plugins loaded'.

    Then there will be a bunch of "Since start lines.. and since last lines"

    The first "since last" will give you runtime BEFORE the events shortcode/widget starts, but after plugins loaded (so not really total runtime, but will give an idea)
    The next lines will give you an idea of runtime of each step of the process.

    Let me know when you have upgraded and how it goes ... I'd like to know how 'bad' the time is before it even gets to the plugin.

    As you can see on my test site, with your url and default theme, it is not bad.

  8. uulosalamos
    Member
    Posted 2 years ago #

    Couldn't download the newest version. Get:

    An error occurred while updating amr events calendar or lists with ical files: The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure.

  9. uulosalamos
    Member
    Posted 2 years ago #

    Sorry, when I tried again, it installed OK.

  10. uulosalamos
    Member
    Posted 2 years ago #

    When I run it on the main page with just the widget, I get:

    Since start 0.5713 seconds. Since last:0.5713 seconds. In "Before Process ical url"
    Since start 0.5714 seconds. Since last:0.0001 seconds. In "We are going to refresh next"
    Since start 1.1208 seconds. Since last:0.5494 seconds. In "Before parse ical url"
    Since start 1.1383 seconds. Since last:0.0175 seconds. In "Before Process ical url"
    Since start 1.1384 seconds. Since last:0.0001 seconds. In "We are going to refresh next"
    Since start 1.2631 seconds. Since last:0.1247 seconds. In "Before parse ical url"
    Since start 1.2815 seconds. Since last:0.0184 seconds. In "Before process"
    Since start 1.2931 seconds. Since last:0.0116 seconds. In "Before constrain"
    Since start 1.2938 seconds. Since last:0.0007 seconds. In "Before listing"
    Since start 1.2968 seconds. Since last:0.0031 seconds. In "After generating listing"

    Running on a page with the calendar in the main part:
    Since start 0.1370 seconds. Since last:0.1370 seconds. In "Before Process ical url"
    Since start 0.1371 seconds. Since last:0.0001 seconds. In "We are going to refresh next"
    Since start 0.7775 seconds. Since last:0.6404 seconds. In "Before parse ical url"
    Since start 0.7937 seconds. Since last:0.0162 seconds. In "Before Process ical url"
    Since start 0.7937 seconds. Since last:0.0001 seconds. In "We are going to refresh next"
    Since start 0.8982 seconds. Since last:0.1044 seconds. In "Before parse ical url"
    Since start 0.9190 seconds. Since last:0.0209 seconds. In "Before process"
    Since start 0.9318 seconds. Since last:0.0128 seconds. In "Before constrain"
    Since start 0.9324 seconds. Since last:0.0007 seconds. In "Before listing"
    Since start 0.9378 seconds. Since last:0.0053 seconds. In "After generating listing"

    Looks much better. Removing the old events must have helped. I do have a page or so where our office administrator pulls the entire weekly calendar from google. There are a lot of repeating events historically. That could also cause a problem. I will see about removing old events.

    Thanks for your help.

  11. uulosalamos
    Member
    Posted 2 years ago #

    Too bad about not allowing the title to be a URL. I liked allowing people to click on the title in the widget to go to the main calendar or events page. Any way to put a link or something at the top of the widget to go to the page specified?

  12. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    re widget title - will be a way but will mean extra text somewhere - I had been aiming for as 'clean' a look as possible, but in retrospect a wdiget title link would probably make the title look different from other widgets due to css impact.

    will put it on list, working on a few other features ahead of that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic