Simple:Press Documentation

Plugin: Event Logger

Plugin Description

Plugin: Event Logger (Logger) – This Simple:Press plugin allows for logging key forum events and/or any standard WordPress hook to the database table for review by the forum admin.

Plugin Features

Installing this Simple:Press plugin adds:

  • A new “Event Logger” section in the Plugin Management panel under the Admin menu path Forum – Plugins – Available Plugins. From this panel the Simple:Press “Event Logger” plugin can be activated, or deleted by the admin.

Activating this plugin provides:

  • A change to the new “Event Logger” section in the Plugin Management panel under the Admin menu path Forum – Plugins – Available Plugins so the Simple:Press “Event Logger” plugin can be deactivated, uninstalled, and have it Options set.
  • A new “Event Logger – Options” admin screen with data entry boxes or check boxes where Options, Core Events Being Logged, Add Action Log, and Actions Being Logged can be set up. The “Help” links should be used for assistance in setting up the options.
  • A new “Event Logger” menu entry under the Admin Forum menu with sub-menu entries “Options” linked to the new “Event Logger – Options” screen, and “View Log” where the list of logged events can be viewed.
  • A new “Event Log – Event Log” admin screen for viewing the list of events/actions logged along with information about the logged items.

There are no new permissions added to the permission sets due to this plugin.

Plugin Requirements

Simple:Press version 5.5.7 and above is required.

The Simple:Press plugin must be installed, activated, and its options set before it is operational.

As part of the installation, a “Event Logger” section is added to the Plugin Management panel under the admin menu Forum – Plugins – Available Plugins. From this panel the Event Logger (Logger) plugin can be activated, deactivated, uninstalled, deleted, or its options set up using its “Activate/Delete” and “Deactivate/Uninstall/Options” selections.

The plugin does not have template tags incorporated into current themes so developing a Custom or Child Theme to accommodate any desired template tag changes is not needed before installing this plugin. Information on Child Themes is located on our Creating a Child Theme page. Information on creating and installing themes is located on our Creating a Custom Theme page.

Plugin Installation and Activation

Please see Using Plugins on how to obtain and install the Simple:Press Event Logger (Logger) plugin.

As mentioned there the default location for Simple:Press plugin folders is …/wp-content/sp-resources/forum-plugins. If this path is changed, it is important to note that the plugin’s folder and its content need to reside in the forum plugins folder wherever it has been moved and however it has been renamed. See Storage Locations for more information.

Activation is accomplished from the Admin Dashboard panel menu by selecting “Forum” and then “Plugins” from the drop down Forum Admin menu. On the Simple:Press Administration panel select the “Event Logger” plugin on the “Plugin Management” panel and click on “Activate”. The “Activate/Delete” label changes to “Deactivate/Uninstall/Options”. To deactivate the plugin, click on “Deactivate”. The “Deactivate/Uninstall/Options” label changes to “Activate/Delete”.

Plugin Administrative Options

After activation, a) on the aforementioned “Available Plugins” page and “Plugin Management” panel, click “Options” on the “Event Logger” plugin section or b) under the “Event Logger” entry on the forum menu on the left side forum admin page click the “Options” sub-menu item to get the Event Logger – Options panel with “Options”, “Core Events Being Logged”, “Add Action Log”, and “Actions Being Logged” sections.

  • Selecting “Options”
    • In this section, one can choose how many entries to store in the database.
    • In the “Options” section, in the data input box to the right of the text “How many entries to store in DB (0 = no limit), insert the number of entries to be stored. Note: inserting ‘0” results in no limit, but could result in a large database table.
    • Click on the “Update” button to save the setting if no other changes are to be made in the other sections of the panel. Otherwise, wait to click the “Update” button until all desired changes have been made.
  • Selecting “Core Events Being Logged” Options
    • In this section, one can choose the standard, core events to be logged into the database table.
    • In the “Core Events Being Logged” section, click on the check box to the left of an option to select the option. A “check mark” inside the box indicates it is selected. Deselect an option by clicking the box containing a “check mark”. The check box indicates it is deselected by not containing a “check mark”.
    • “Core Events Being Logged” selections are:
      • Post edited
      • Topic edited
      • Post deleted
      • Topic deleted
      • Post moved
      • Topic moved
      • Post Approved
      • Post Unapproved
      • Post Reassigned
      • Post Created
    • Click on the “Update” button to save the setting if no other changes are to be made in the other sections of the panel. Otherwise, wait to click the “Update” button until all desired changes have been made.
  • Selecting “Add Action Log” Options
    • In this section, one can choose choose to log any valid WordPress action. This could be a core action or an action added by a wp theme or plugin. Optionally, a callback can be added to this action logging. This callback is a function the forum admin would provide that gets called when the action is logged.
    • In the “Add Action Log” section,
      • In the data input box to the right of the text “Name of the action to log:”, insert the name of the action to log. An example is admin_init.
      • In the data input box to the right of the text “Optional callback on action execution:”, insert the name of the callback function be called upon the execution of the action.
      • In the data input box to the right of the text “Action priority”, insert the action priority value to associate with the action.
    • Click on the “Update” button to save the setting if no other changes are to be made in the other sections of the panel. Otherwise, wait to click the “Update” button until all desired changes have been made.
  • “Actions Being Logged” section – Viewing or Deleting Actions
    • In this section, one can see the list of actions being logged (for example, admin_init, if it had been input in the “Add Action Log” section) and can delete actions being logged.
    • Each action being logged shows up in a list with the Action Name, any Callback, its Priority, and an icon under the Delete column used to delete the action.
    • To delete an action being logged, click on the icon under the Delete column in the row for the existing action to be deleted. The listing for that action disappears when it has been deleted.
    • The deleted action can be added back by inputting it again in the “Add Action Log” section.
    • If no actions are being logged, the text “No actions being logged” is displayed.

There are no new permissions associated with this Simple:Press plugin that need to be set.

Plugin Language Translation

A plugin’s message strings can be translated from English to other languages and then the translation displayed if language translation files are available. Some plugins may not have such files.

Information regarding downloading language files, “mo’ language file placement, and translation (language localization) is found at Localization.

More information is available regarding translation files at Simple:Press Translations. On the base page, select the “Getting Started Guide” link for basics about it’s use. On that page, select the “register a username here” link to obtain a password to the site. Use the “Contact Form” link to request the desired language if it is not currently available. The “Contact Form” link may also be used to volunteer to be a validator for a translation project.

The Event Logger (Logger) plugin’s available language translation files with translation statistics, and message translations can be viewed at Event Logger (Logger) Translations. Select the Version link to see the languages available. Select the link for the desired language to see forum messages and their available translations. If available, export the file for the selected language to its proper forum language sub-folder as a “mo” file using the export link at the bottom of the page displaying the actual message translations for the language selected.

The default location for Simple:Press plugin language files is …/wp-content/sp-resources/forum-language/sp-plugins. If this path is changed, it is important to note that the plugin’s language file needs to reside in the language sub-folder for sp plugins wherever it has been moved and however it has been renamed. See Storage Locations for more information.

Plugin Usage

Forum users do not have the ability to view the action log nor to change which activities are logged.

Admins can observe the logged activities and can clear the event/action log.

  • Viewing Event Log or Clearing the Event/Action Log
    • After activation and set up of this plugin, under the “Event Logger” entry on the forum menu on the left side forum admin page click the “View Log” sub-menu item to view the Event Log – Event Log panel.
    • The Event Log lists the number of log entries, and has a listing of each event/action logged. For each logged item, the Log ID, Type of Event/Action, the Date, and Data detailing the logged activity are shown.
    • To remove the current list of events/actions from the log:
      • Note: This is a non-reversal action
      • Click on the “Clear event/action log” button(s) to clear the listing.
      • The previously logged events/actions are removed, and the text “There are no events/hooks currently logged in the database” appears.
      • The log will begin populating when new selected events/actions occur.

Plugin Special Notes

None

Template Tags Used in the Plugin

There are no Template Tags available for this plugin that allows the admin to further customize it’s usage or otherwise customize the website.

Actions and Hooks Used in the Plugin

There are no Actions and Hooks available in Template Tags for this plugin.

There are other Actions and Hooks available for this plugin.

Used in file sp-logger-admin-options.php

  • do_action(‘sph_logger_admin_left_panel’) – Hook fired after the Forum Admin Event Logger Options left panel has been displayed.
  • do_action(‘sph_logger_admin_right_panel’) – Hook fired after the Forum Admin Event Logger Options right panel has been displayed.

Plugin and Template Tag Changelog

Since Simple:Press version 5.5.1.

Codex page sync’d to code version 5.5.3.

More Topics In SimplePress: Plugins


Copyright © 2006-2019 Simple:Press. All Rights Reserved.