WordPress.org

Plugin Directory

Plainview Activity Monitor

Plugin for PHP v5.4+ that monitors WordPress actions for user activity on a blog or network.

Plugin for PHP v5.4+ that monitors WordPress actions for user activity on a blog or network.

Currently monitored actions:

  • activated_plugin
  • admin_head for views in the admin interface
  • created_term
  • deactivated_plugin
  • delete_comment
  • delete_post
  • delete_term
  • delete_user
  • draft_to_publish
  • edit_term / edited_term
  • password_reset
  • post_password
  • profile_update
  • publish_to_publish
  • publish_to_trash
  • retrieve_password
  • switch_theme
  • trash_to_publish
  • updated_core
  • updated_plugin
  • updated_theme
  • user_register
  • wp_head for views on the front-end
  • wp_login
  • wp_login_failed
  • wp_logout
  • wp_set_comment_status and each status separately
  • wpmu_delete_user

The logged information consists of:

  • A description of what was logged
  • Blog
  • Timestamp
  • Hook that was triggered
  • User ID

The activities can then be shown in global table showing activities on the whole network, or locally for just the blog you are currently viewing.

The activites can also be filtered so that only specific blogs / hooks / IPs / users are displayed.

git

The Activity Monitor has a bitbucket.

Security tips

There are several ways for people to break in to your WordPress installation, or cause trouble by DDOS. Here are some tips on how to use the Activity Monitor and its plugins to help detect problems:

  • Get a DDOS protection service with an API. There is a plugin to ban IPs via CloudFlare (Send To CloudFlare). Other APIs could be supported as the need arises.
  • If you have another DDOS service, write a script that can ban visitors by IP. Use this script with the Send To Exec plugin.
  • If you can't ban users using a script, at least set up the Send To E-mail plugin to inform you of suspicious activity.
  • Use the Bruteforce Detect plugin to detect when an IP or IPs are trying to guess the admin's password. Ban the IPs automatically using Send To Exec.
  • Do not use admin as the username for your administrator account. Instead, use some else and add the admin username to the list of banned usernames in the Login Failed Username plugin. Ban the IPs that cause the plugin to react.

(The above plugins are available in the Plugin Pack, that will be released in the next few months. Please contact the author for more info.)

Custom hooks

If you are a plugin developer and wish to log your custom hooks, build a plugin that extends an Activity Monitor hook!

Step 1: Create a custom hook. See any of the hooks in the include/hooks directory for examples.

Step 2: In your constructor, hook into the plainview_activity_monitor_loaded action.

add_action( 'plainview_activity_monitor_loaded', 'load_my_hooks' );

Step 3: Load your hooks.

Now is a good time to require_once() your class files. Trying to load them before the Activity Monitor loads will result in your hook class not find the parent hook class.

public function load_my_hooks( $action )
{
    require_once( __DIR__ . '/my_example_hook1.php' );
    $class = __NAMESPACE__ . '\\hooks\\my_example_hook1';
    $hook = new $class;

    require_once( __DIR__ . '/my_example_hook1.php' );
    $class = __NAMESPACE__ . '\\hooks\\my_example_hook2';
    $hook = new $class;
}

Step 4: Hook into plainview_activity_monitor_manifest_hooks and then register your hook.

This will tell Activity Monitor (and other plugins) which action hooks you offer.

add_action( 'plainview_activity_monitor_manifest_hooks', 'my_example_manifest_hooks' );

function my_example_manifest_hooks( $action )
{
    $hook = new my_example_hook();
    $my_example_hook->register_with( $action->hooks );
}

Done!

Flesh out the log() or log_post() method in your hook class with something and then wait for the hook to be called.

Requires: 3.9 or higher
Compatible up to: 4.4.2
Last Updated: 4 days ago
Active Installs: 1,000+

Ratings

3.6 out of 5 stars

Support

1 of 4 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0
100,1,1
100,1,1 100,2,2 100,1,1
100,1,1 100,1,1
100,2,2
0,1,0
100,1,1
100,1,1