Simple History Blog

Support for Advanced Custom Fields and lots of fixes in version 2.21

It’s been a while since the last update so this update brings quite a few things.

Support for Advanced Custom Fields

Most noteable is support for the custom fields plugin Advanced Custom Fields.

When creating and editing fields and field groups you will now get a much clearer view of what’s been changed. You can see if a user renamed a field or if the type of field was changed. Or if new fields was added. A really great update for sites where multiple developers are adding and updating fields.

In the following screenshot you can se how I made som changes to the ACF Field Group “Contact options”. First I changed the type of two fields from text to e-mail and from text to textarea. And then I notices a spelling error in the label and fixed that. Without Simple History and this new logger for Advanced Custom Fields there would be no way for anyone to know that someone made those changes!

Simple History shows that field type and field label has been changed.

Taxonomies and categories now comes with links!

A small detail but when a taxonomy or a category has been changed the name of the term and the name of the taxonomy are not linked. Makes it so much easier now to go to the changes if you need to do further changes or similar.

It looks kinda like this:

Full changelog for version 2.21

Here is the full changelog for this version.

  • Added support for Advanced Custom Fields (ACF): when a ACF Field or ACF Field Group is created or modified or deleted you will now get more details in the activity feed.
  • Changes to taxonomies/categories/tags now include a link to the modified term and to the category that the term belongs to.
    The post types in the skip_posttypes filter are now also applied to trashed and untrashed posts (not only post edits, as before).
  • Don’t log Jetpack sitemap updates. (Don’t log updates to posttypes jp_sitemap, jp_sitemap_master and jp_img_sitemap, i.e. the post types used by Jetpack’s Sitemap function.) Should fix https://wordpress.org/support/topic/jetpack-sitemap-logging/.
  • Don’t log the taxonomies post_translations or term_translations, that are used by Polylang to store translation mappings. That contained md5-hashed strings and was not of any benefit (a separate logger for Polylang will come soon anyway).
  • Fix notice in theme logger because did not check if $_POST[‘sidebar’] was set. Fixes https://github.com/bonny/WordPress-Simple-History/issues/136.
  • Fix thumbnail title missing notice in post logger.
  • Fix PHP warning when a plugin was checked by WordPress for an update, but your WordPress install did not have the plugin folder for that plugin.
  • Fix unexpected single-quotations included in file name in Internet Explorer 11 (and possibly other versions) when exporting CSV/JSON file.
  • Fix filter/search log by specific users not working. Fixes https://wordpress.org/support/topic/show-activity-from-other-authors-only/.
  • Fix a notice in SimpleOptionsLogger.
  • Better CSS styling on dashboard.
  • Add filter simple_history/post_logger/post_updated/context that can be used to modify the context added by SimplePostLogger.
  • Add filter simple_history/post_logger/post_updated/ok_to_log that can be used to skip logging a post update.
  • Add filter simple_history/categories_logger/skip_taxonomies that can be used to modify what taxonomies to skip when logging updates to taxonomy terms.

Pst! If you like Simple History it would be awesome if you could give an honest review of it.

Changes to featured image (post thumbnails) logged

Yep. Finally!

Here’s how it looks:

Screenshot showing how a post with changed featured image looks in the audit log in Simple History

Also in this version:

  • The preview image of uploaded images now uses the default WordPress image size small, instead of a custom image size. Also these mage previews are now abit smaller because many uploaded images could make the log a bit to long and not so quick to overview.
  • JavaScript library Select2 is updated to the latest version.
  • If a user is running a very old version of WordPress, that is incompatible with Simple History, a message is shown, informing the user that their WordPress is to old.
  • An error with PHP 7.1 was fixed.

WP-Optimize adds support for Simple History

WordPress plugin WP-Optimize is a great plugin that optimizes the database and tables that your WordPress installation uses.

The authors explain it as:

WP-Optimize is an effective tool for automatically cleaning your WordPress database so that it runs at maximum efficiency.

With over 600,000 installs and a 5 star medium rating I can say that I’m happy to see that they have added support for Simple History in their plugin. In the settings page there is a setting that enables logging actions you perform in WP-Optimize to Simple History.

» Read full blog post

Log when a user enters a password on a password protected page

Over at the forums on wordpress.org there was a user who asked if it was possible to log whenever a user entered the password on a password protected page.

To add this kind of log to Simple History is easy, we just need to hook onto an admin filter and do some checks. The final answer, that I also posted to the user in the forums, was this:

// Log when a user enters something into the post password form.
// Both correct and incorrect usage is logged.
add_action( 'login_form_postpass', function() {
    $postPass = isset($_POST['post_password']) ? $_POST['post_password'] : null;

    if (!$postPass) {
        return;
    }

    $urlPath = parse_url(wp_get_referer(), PHP_URL_PATH);
    $pageByPath = get_page_by_path($urlPath);

    if (!$pageByPath) {
        return;
    }

    $correctPasswordEntered = ($pageByPath->post_password === $postPass);

    if ($correctPasswordEntered) {
        apply_filters(
            'simple_history_log',
            'A user correctly entered the password for page "{page_name}"',
            array('page_name' => $pageByPath->post_title)
        );
    } else {
        apply_filters(
            'simple_history_log',
            'A user entered the wrong password for page "{page_name}"',
            array('page_name' => $pageByPath->post_title)
        );
    }
});

WP CLI command added and file edits now logged

WP CLI command to view user activity is now added to Simple History. The current support is pretty basic, but it’s a nice addition anyway I must say.

A simple wp simple-history list command will give you a listing of the latest events. You can also pass arguments count=20 to show 20 events instead of the default 10. And pass argument format=json to output the list in JSON format instead of the ASCII table.

Also in this version: theme file edits are logged, with a “quick diff” showing what’s been changed.

Support for Redirection plugin added

With over 600.000 active installs the Redirection plugin is a pretty popular WordPress plugin. So when there was a request for supporting it I agreed it would be a good idea to add support for it.

So in the latest version of Simple History there is now support for the plugin Redirection. The following things are logged:

  • Redirects created, changed, enabled or disabled
  • Groups that are created, changed, enabled or disabled
  • Global plugin settings

Here’s a screenshot of how it looks in action:

simple-history-redirection-plugin

Available updates to WordPress, plugins and themes now logged

With the latest update of Simple History the log will show the available updates to plugins, themes and WordPress core that are found.

This is a great feature to have if you for example subscribe to the history RSS feed. You no longer need to manually check the updates-page to see if there are any updates.

Here you can see how it looks when an update to WordPress is found and then the update is installed. It’s all there in the history log:

available-updates

And here’s how it can look in your RSS-reader when you get notified that WordPress has auto-updated:

updated-logged-in-rss-feed

About Simple History

Simple History is an activity feed plugin for WordPress.

Archives