PHP Class SimplePluginLogger

Inheritance: extends SimpleLogger
Datei anzeigen Open project: bonny/wordpress-simple-history

Public Properties

Property Type Description
$slug The logger slug. Defaulting to the class name is nice and logical I think

Public Methods

Method Description
ajax_GetGitHubPluginInfo ( ) Show readme from github in a modal win
check_filterless_things ( )
getInfo ( ) : array Get array with information about this logger
getLogRowDetailsOutput ( $row ) Get output for detailed log section
loaded ( )
on_action_delete_selected ( ) * When a plugin has been deleted there is no way for us to get the real name of the plugin, only the dir and main index file.
on_activated_plugin ( $plugin_name, $network_wide ) Plugin is activated plugin_name is like admin-menu-tree-page-view/index.php
on_deactivated_plugin ( $plugin_name ) Plugin is deactivated plugin_name is like admin-menu-tree-page-view/index.php
on_gettext ( $translation, $text, $domain ) There is no way to ue a filter and detect a plugin that is disabled because it can't be found or similar error.
on_setted_transient_for_remove_files ( $transient = "", $value = "" ) Detect plugin being deleted When WP is done deleting a plugin it sets a transient called plugins_delete_result: set_transient('plugins_delete_result_' . $user_ID, $delete_result);
on_upgrader_process_complete ( $plugin_upgrader_instance, $arr_data ) Called when plugins is updated or installed Called from class-wp-upgrader.php
remove_saved_versions ( ) when plugin updates are done wp_clean_plugins_cache() is called, which in its turn run: delete_site_transient( 'update_plugins' ); do_action( 'delete_site_transient_' . $transient, $transient ); delete_site_transient_update_plugins
save_versions_before_update ( $bool = null, $hook_extra = null ) Saves info about all installed plugins to an option.

Method Details

ajax_GetGitHubPluginInfo() public method

Show readme from github in a modal win

check_filterless_things() public method

getInfo() public method

Get array with information about this logger
public getInfo ( ) : array
return array

getLogRowDetailsOutput() public method

Get output for detailed log section
public getLogRowDetailsOutput ( $row )

loaded() public method

public loaded ( )

on_action_delete_selected() public method

So before a plugin is deleted we save all needed info in a transient

on_activated_plugin() public method

Plugin is activated plugin_name is like admin-menu-tree-page-view/index.php
public on_activated_plugin ( $plugin_name, $network_wide )

on_deactivated_plugin() public method

Plugin is deactivated plugin_name is like admin-menu-tree-page-view/index.php
public on_deactivated_plugin ( $plugin_name )

on_gettext() public method

we hook into gettext and look for the usage of the error that is returned when this happens.
public on_gettext ( $translation, $text, $domain )

on_setted_transient_for_remove_files() public method

We detect when that transient is set and then we have all info needed to log the plugin delete
public on_setted_transient_for_remove_files ( $transient = "", $value = "" )

on_upgrader_process_complete() public method

Called when plugins is updated or installed Called from class-wp-upgrader.php
public on_upgrader_process_complete ( $plugin_upgrader_instance, $arr_data )

remove_saved_versions() public method

when plugin updates are done wp_clean_plugins_cache() is called, which in its turn run: delete_site_transient( 'update_plugins' ); do_action( 'delete_site_transient_' . $transient, $transient ); delete_site_transient_update_plugins

save_versions_before_update() public method

When we are done logging then we remove the option.
public save_versions_before_update ( $bool = null, $hook_extra = null )

Property Details

$slug public_oe property

The logger slug. Defaulting to the class name is nice and logical I think
public $slug