Other Information

This documentation page is currently under construction, please reach out to us if you have questions regarding custom development

Plugin Settings

MegaCal stores its settings in a set of large arrays. If you find that you need access to one or more settings in a theme or another plugin, you can get settings using the megacal_get_settings method. Using one of the options names below will return all of the settings stored there as an associative array.

megacal_options

This option holds all of the general plugin settings. If the field is present on the plugin Settings screen, it can likely be found here.

megacal_hidden_options

This option holds some internal settings, not meant to be shown to frontend users. Some API connectivity information is stored here, session authentication information, etc. If you need access to the user handle or id, for example, those would be stored here.

Debug Logging

If you encounter issues with MegaCal, it can be helpful for us to see your interactions with our API. For that reason, MegaCal logs all API requests to a log file named debug.log in the plugin root directory.

If we ask you to provide this file in a support request, you can find it located at wp-content/plugins/megabase-calendar/debug.log

The debug log clears itself on the first day of each month. It simply contains information about your API requests and information that allows us to identify those requests in our system in order to troubleshoot issues.

Caching System

Due to the fact that all API interactions incur a cost, we cache event details and other information wherever we are able. If you think you are experiencing issues with cache, we recommend flushing the Event Cache as a first step.

In most normal use cases, you shouldn’t need to know the specific details of our system to work with it. However, if you are working with our plugin in a highly customized environment, trying to build your own cache, or troubleshooting issues the below outline explains how our caching system is built.

All caches are stored as individual transients and checked before all internal API requests. In cases where the cache needs to be referenced multiple times per page load, we use wp_cache_get and wp_cache_set to reduce database lookups.

Event Cache

Includes single event details, events on the admin calendar, frontend calendar, and all event list. Also includes custom calls to megacal_get_events and megacal_get_public_events that do not use cache bypass.

In some cases, cache is stored as associative arrays with sub-keys generated by hashing the parameters passed to the request, in order to cache specific result-sets such as a certain date range, the list of past events vs upcoming events, or the list of events filtered by specific categories.

Flushed:

  • Every Hour after the most recent cache update
  • Whenever an event is saved/updated/deleted
  • Whenever an incoming event is manually approved
  • Whenever Event Cache is manually flushed

Cache Keys:

  • MEGACAL_ADMIN_CALENDAR_CACHE_KEY
  • MEGACAL_PUBLIC_CALENDAR_CACHE_KEY
  • MEGACAL_PAST_LIST_CACHE_KEY
  • MEGACAL_UPCOMING_LIST_CACHE_KEY
  • MEGACAL_EVENT_DETAIL_CACHE_KEY
  • MEGACAL_GET_EVENTS_CACHE_KEY

Hover Card Cache

Includes details for a single event, loaded when a date is hovered on the calendar

Flushed:

  • Every 3 Hours
  • Whenever an event is saved/updated/deleted
  • Whenever an incoming event is manually approved
  • Whenever Event Cache is manually flushed

Cache Keys:

  • MEGACAL_CACHED_HOVER_CARD_CACHE_KEY

Event Owner Cache

The list of owners of events on your calendar – Used in the shortcode options

Flushed:

  • Every Hour
  • Whenever an event is saved/updated/deleted
  • Whenever an incoming event is manually approved
  • Whenever Event Cache is manually flushed

Cache Keys:

  • MEGACAL_CACHED_EVENT_OWNERS_CACHE_KEY

Venue Cache

The list of venues associated with your account – Used in the create/edit event upsert modal

Flushed:

  • Every 12 Hours
  • When an event is saved/updated
  • When venue/category details are changed via the Manage screen

Cache Keys:

  • MEGACAL_CACHED_VENUES_CACHE_KEY

Category/My Category Cache

The list of all event categories and the list of event categories that you have created – Used in the create/edit event upsert modal and category filters

Flushed:

  • Every 12 Hours
  • When an event is saved/updated
  • When venue/category details are changed via the Manage screen

Cache Keys:

  • MEGACAL_CACHED_CATEGORIES_CACHE_KEY
  • MEGACAL_CACHED_MY_CATEGORIES_CACHE_KEY

Ping Response Cache

Your account information: Email, Pro Status, etc. Mainly used internally to flip some pro account language

NOTE: The data stored here only controls what you see in the plugin, attempting to manually change your pro status will result in API errors.

Flushed:

  • Every Hour
  • When you first pay for a pro account

Cache Keys:

  • MEGACAL_PING_RESPONSE_CACHE_KEY

Cache System Special Cases

Recurrence
When a recurring event is created or updated, the API sets a special event flag that tells us the current processing status.

When the create/update action occurs, we check the API every 2 minutes until the status is flagged as complete. Once flagged as complete we flush Event Cache, Hover Card Cache, and Event Owner Cache.

If the status is not flagged as complete, we give the API a one full day grace period, then we check if it’s failed. If failed, we log an error and stop checking. No cache is flushed in this case.

Deactivation

All cache is wiped on deactivation, settings are left as-is