Experiencing memory problems or timeouts ? Check the following:
Are your default wordpress and php memory settings up to handling all that you have added to the site?
Over time, as you add change themes, and add plugins, your wordpress setup starts needing more and more memory. Sometimes the last plugin added is the one that ‘tips it over the threshhold’. It may not be the main memory hog (or it may see below.) Please check your wordpress and php memory limits. Here are some helpful posts:
How old is your ics file and how many ‘old’ events does it have ?
If it’s a google calendar, the ics feed does not at time of writing offer a way to request future events only. This means your ics file will grow. The plugin has to parse ALL the events in the file, hold them in memory to check for a possible modifying VEVENT with a later sequence number that modifies the date. More info on google calendar ics files – and how to bulk delete old events.
In the list type settings, and as shortcode parameters, you can set the maximum number of events and the maximum number of days or months that the plugin will attempt to list. It also uses these to limit the recurring events it has to generate.
It is important to set a balance between number of days/months and number of events, particularly if you have recurring events and in particular for those people using ics files. An event, especially a recurring can be made up of multiple VEVENT definitions, additional definitions for each excluded date, or modified instance. So for each recurring event, the plugin has to
generate the possible instances, hold them all in memory
check for any modifications, exclusions etc and apply those to the instances, before it can start limiting.
Modifications of instances can change an instance date and time – pushing it out of the desired time range or WORSE, pulling an instance that is currently out of range, INTO the time range.
Try to balance the two parameters: the time period and the number of events based on your knowledge of the types of events and their frequency.
For example: If you specify 10 events and 1000 days, the recurring events have to be generated out to 1000 days and all held in memory, until all events generated and modifications applied, and then the number can be cut back to 10.
As a guideline, If you want to show 5 events and usually they’d be in the next two months, then maybe 90-120 days would be suitable.
Note also that there is a difference between how hours, days, months thresholds are treated.
hours start from current hour
days start from current day
months start from current month
So if you say months=1 and the list is running on the last few days of the month, you will not see many of ‘future’ events ie: next months day. Bette to perhaps either use: days=30 or months=2,
If you are using a google calendar ics file as event input you should be aware of the following:
At times the ics feed is slow to update – check what the actual feed contains if you think events are missing . Open the ics file in notepad, and check if your events or your changes are there. Note that an instance may have multiple VEVENTS with incremental SEQUENCE numbers later in the file.
the ics file may get rather large over time. At time of writing there is no way to get the feed to only show future events, so it will have ALL your old data. This all has ti be parsed, turned into event data and held in memeory to see if there any any modifications, or exclusions. If you don’t need the old events, try deleting them. You may need a bulk delete tool. I have used this GcalToolkit, not ideal but it does work.
On the other hand, using an amr-events feed in a google calendar:
Again google can be slow to refresh reading the feed, sometimes it will do the first one fine, then you make a change and expect google to show in instantly. It will not. Not much we can do about that.
Google calendar has always been slightly more particular about ics feeds and frustrating in the lack of information it gives if it rejects a ics url. Thanks to Toby Hage, a couple of oddities to do with blank lines in descriptions and in repeating dates (RDATES) in the ics feed were been identified. These are now resolved in version 3.11. This version is up at http://test.icalevents.com/ and all appears to be stable so far. It is available for download at http://icalevents.com/downloads/amr-events/
If any of you have any feature requests, please contact me at firstname.lastname@example.org.
Version 3.6 of amr-events is available for download.
It should be used with the free listing part: amr-ical-events-list version 4.30. Several improvements have been made in the way that event meta data, taxonomies etc were being retrieved. This has reduced the database queries made when producing an event list from events in wordpress.
If you have a fairly recent version, and your access to the automated updates from icalevents is still current, then it should appear in the normal wordpress plugin updates.
From version 3.3 on wards, amr-events now has three optional additional roles:
If you wish to keep your event creation separate from your post creation, these may be useful. If you are updating the plugin, you may find that you need to force an update of the various roles (even existing admin may need capabilties manually added). So while one hopes not, just in case: use a role manager like https://wordpress.org/plugins/members/
Are you you getting the browser messages when saving a new custom post type draft?
Firefox: “This page is asking you to confirm that you want to leave – data you have entered may not be saved.”
Internet Explorer: “Are you sure you want to leave this page”
Chrome: “The changes you have made will be lost if you navigate away from this page”
“Leave page or Stay on page” when you click save draft on a new custom post type?
You opt to leave and the post was still saved but the custom fields etc do not save. BUT then you CAN edit the post and then add in the custom fields / meta box without any further problem (what the?)
And of course admin’s have no problem!
If you are allowing your custom post type to be assigned categories and tag taxonomies like normal posts, then ANY role that is required to be able to create the custom post type while default taxonomies are supported, must also have ‘edit_posts’ capability. (Unless you have code to change the default taxonomies, but then you will be messing with the standard posts capabilities)
Arguably the wordpress default capability ‘assign_terms’ should not be mapped by default to ‘edit_posts’ as this is what is making life complicated. Possibly a contributor should have ‘assign_terms’ capability directly? Or one might say that it’s the sharing of taxonomies that is causing the complication.
I wanted a role that could create events but NOT also create posts. Similarly with editors.
Custom roles can be setup to manage custom post types (in this case events) and one can isolate these capabilities. However when one adds taxonomies (default and custom) into the mix, things get more interesting.
Default taxonomy capabilities for categories and tags
While one could overwrite these capabilities with say ‘assign_terms’=>’assign_terms’, then one would not be able to assign categories and tags to standard post types without also ensuring that the default roles were assigned the capability ‘assign_terms’. All achievable, it just seems wrong to have to mess with standard wp and risk breaking other plugins.
Registering custom taxonomy means that in this case ‘edit_events’ capability is enough to be able to assign this custom taxonomy to this single custom post type
'capabilities' => array (
'assign_terms' => 'edit_events' // strictly speaking need one for each new posttype ?
TIP: while you are testing this all out, a role manager plugin like Justin Tadlock’s members plugin is very helpful. Roles and their capabilities are saved in the database and unless you ‘remove’ the role and add it again, the capabilties will not update as you might want them to.
I was actually trying to create a custom role that can assign categories, tags and custom taxonomies to your custom post type. If you give these roles ‘manage_categories’, they’ll be able to add new categories BUT still not assign a post to existing categories. They have to have ‘edit_posts’ or obe has to override the default wp setup.
See the pluggable files in each plugin folder. Use the function there as a base for your new function. Add your function to your custom themes function.php or to your own site specific snippets plugin.
Events can be grouped by date formats or by categories, tags or custom taxonomies.
Events can be grouped by days, weeks, months and some funkier options that no one will probably ever use, but I liked the challenge! Actually I imagined one could do some seasonal styling perhaps? each grouping has it’s own css classes, and date/time format
Grouping also allows one to do timetables (grouped by day), weekly schedules, or monthly, quarterly or seasonal event views.