Method |
Description |
|
__construct ( ) |
|
|
addWelcomeLogMessage ( ) |
Greet users to version 2!
Is only called after database has been upgraded, so only on first install (or upgrade). |
|
add_admin_bar_menu_item ( $wp_admin_bar ) |
Adds a "View history" item/shortcut to the admin bar |
|
add_admin_bar_network_menu_item ( $wp_admin_bar ) |
Adds a "View history" item/shortcut to the network admin, on blogs where Simple History is installed |
|
add_admin_pages ( ) |
Add pages (history page and settings page) |
|
add_dashboard_widget ( ) |
Maybe add a dashboard widget,
requires current user to have view history capability
and a setting to show dashboard to be set |
|
add_default_settings_tabs ( ) |
Adds default tabs to settings |
|
add_js_templates ( $hook ) |
Output JS templated into footer |
|
add_settings ( ) |
*
Add setting sections and settings for the settings page
Also maybe save some settings before outputing them |
|
api ( ) |
Base url is:
wp-admin/admin-ajax.php?action=simple_history_api |
|
check_for_upgrade ( ) |
Check if plugin version have changed, i.e. has been upgraded
If upgrade is detected then maybe modify database and so on for that version |
|
clear_log ( ) |
Removes all items from the log |
|
dashboard_widget_output ( ) |
Output html for the dashboard widget |
|
does_database_have_data ( ) : boolean |
Check if the database has data/rows |
|
ends_with ( string $haystack, string $needle ) |
Returns true if $haystack ends with $needle |
|
enqueue_admin_scripts ( $hook ) |
Enqueue styles and scripts for Simple History but only to our own pages. |
|
filter_gettext ( $translated_text, $untranslated_text, $domain ) |
During the load of info for a logger we want to get a reference
to the untranslated text too, because that's the version we want to store
in the database. |
|
filter_gettext_storeLatestTranslations ( $translation, $text, $domain ) |
|
|
filter_gettext_with_context ( $translated_text, $untranslated_text, $context, $domain ) |
Store messages with context |
|
filter_option_page_capability ( $capability ) |
|
|
getInstantiatedDropins ( ) |
|
|
getInstantiatedLoggerBySlug ( $slug = "" ) |
|
|
getInstantiatedLoggers ( ) |
|
|
getLogLevelTranslated ( string $loglevel ) : string |
Return translated loglevel |
|
getLogRowDetailsOutput ( $row ) |
|
|
getLogRowHTMLOutput ( array $oneLogRow, $args ) : string |
Returns the HTML output for a log row, to be used in the GUI/Activity Feed |
|
getLogRowHeaderOutput ( array $row ) : string |
Return header output for a log row
Uses the getLogRowHeaderOutput of the logger that logged the row
with fallback to SimpleLogger if logger is not available |
|
getLogRowPlainTextOutput ( array $row ) : string |
Return plain text output for a log row
Uses the getLogRowPlainTextOutput of the logger that logged the row
with fallback to SimpleLogger if logger is not available |
|
getLoggersThatUserCanRead ( integer $user_id = "", string $format = "array" ) : array |
Check which loggers a user has the right to read and return an array
with all loggers they are allowed to read |
|
getSettingsTabs ( ) |
|
|
get_avatar ( string $email, integer $size = '96', string $default = '', string $alt = false ) : string |
Retrieve the avatar for a user who provided a user ID or email address. |
|
get_cache_incrementor ( $refresh = false ) : string |
https://www.tollmanz.com/invalidation-schemes/ |
|
get_clear_history_interval ( ) : integer |
How old log entried are allowed to be. |
|
get_instance ( ) : SimpleHistory |
Get singleton intance |
|
get_num_events_last_n_days ( $period_days = 28 ) |
Number of rows the last n days |
|
get_num_events_per_day_last_n_days ( $period_days = 28 ) |
get_num_events_last_n_days |
|
get_pager_size ( ) : integer |
Gets the pager size,
i.e. the number of items to show on each page in the history |
|
get_pager_size_dashboard ( ) : integer |
Gets the pager size,
i.e. the number of items to show on each page in the history |
|
get_unique_events_for_days ( $days = 7 ) |
Number of unique events the last n days |
|
get_view_history_capability ( ) : string |
Return capability required to view history = for who will the History page be added |
|
get_view_settings_capability ( ) : string |
Return capability required to view settings |
|
history_page_output ( ) |
Output for page with the history |
|
init ( ) |
|
|
is_on_our_own_pages ( $hook = "" ) |
|
|
json_encode ( $value ) |
Works like json_encode, but adds JSON_PRETTY_PRINT if the current php version supports it
i.e. PHP is 5.4.0 or greated |
|
load_dropins ( ) |
Load built in dropins from all files in /dropins
and instantiates them |
|
load_loggers ( ) |
Load built in loggers from all files in /loggers
and instantiates them |
|
load_plugin_textdomain ( ) |
Load language files. |
|
maybe_purge_db ( ) |
Runs the purge_db() method sometimes
We don't want to call it each time because it performs SQL queries |
|
onAdminFooter ( ) |
|
|
onAdminHead ( ) |
|
|
on_filter_simple_history_log ( $message = null, array $context = null, string $level = "info" ) |
Log a message |
|
output_quick_stats ( ) |
Quick stats above the log
Uses filter "simple_history/history_page/before_gui" to output its contents |
|
plugin_action_links ( $actions, $b, $c, $d ) |
Show a link to our settings page on the Plugins -> Installed Plugins screen |
|
purge_db ( ) |
Removes old entries from the db |
|
registerSettingsTab ( $arr_tab_settings ) |
|
|
register_dropin ( $dropinClassName ) |
Register an external dropin so Simple History knows about it. |
|
register_logger ( $loggerClassName ) |
Register an external logger so Simple History knows about it. |
|
setting_show_as_page ( ) : boolean |
Should simple history be shown as a page
Defaults to true |
|
setting_show_on_dashboard ( ) : boolean |
Get setting if plugin should be visible on dasboard. |
|
settings_field_clear_log ( ) |
Settings section to clear database |
|
settings_field_number_of_items ( ) |
Settings field for how many rows/items to show in log on the log page |
|
settings_field_number_of_items_dashboard ( ) |
Settings field for how many rows/items to show in log on the dashboard |
|
settings_field_where_to_show ( ) |
Settings field for where to show the log, page or dashboard |
|
settings_output_general ( ) |
|
|
settings_output_log ( ) |
|
|
settings_output_styles_example ( ) |
|
|
settings_page_output ( ) |
Output HTML for the settings page
Called from add_options_page |
|
settings_section_output ( ) |
Content for section intro. Leave it be, even if empty. |
|
setup_cron ( ) |
|
|
setup_variables ( ) |
Setup variables and things |
|
testlog_old ( ) |
|
|