Simple History 4.2.0 – bug fixes and Google Maps is back again

Simple History 4.2.0 has been released with mainly bug fixes and some additions. Most notable is the addition of a filter to enable the use of Google Maps again.

Support for showing user origin on Google Maps is back

In previous versions of Simple History it was possible to the location of a user on a map. This function was later removed because Google requires all API calls to provide API keys.

Now this functionally is finally back! Using a new filter called simple_history/maps_api_key your can provide your own API key that will be used for the Google Maps Static API to render a map of a user location.

Screenshot of Simple History showing recent logged events. One event has the message "Logged in" and an ip address is selected and above the ip address a google map images is shown of Stockholm, Sweden.

See filter simple_history/maps_api_key for more information and examples.

Full changelog

Notice: 4.2.1 was released shortly after this to fix an issue with PHP 8 and logging while WP-Cron was running.

Added

  • Filter simple_history/day_of_week_to_purge_db to set the day that the db should be cleared/purged on. 0 = monday, 7 = sunday. Default is 7.
  • Add class SimpleHistory so old code like SimpleHistory->get_instance() will work.
  • Add helper function camel_case_to_snake_case().
  • Automatically convert camelCase function names to snake_case function names when calling functions on the \Simple_History class. This way more old code and old examples will work. Fixes for example support thread.
  • Add Helpers::privacy_anonymize_ip().
  • Add filter simple_history/privacy/add_char_to_anonymized_ip_address to control if a char should be added to anonymized IPV4 addresses.
  • Add filter simple_history/maps_api_key to set a Google Maps API key to be used to show a Google Map of the location of a user login using the user IP address.
  • If a Google Maps API key is set then a map of a users location is shown when clicking on the IP address of a logged event. #249.

Fixed

  • Fix Undefined property warning when loading more similar events. #357
  • Include “Plugin URI” from plugin when logging single plugin installs. #323
  • Check that installed theme has a destination_name#324
  • Log correct role for user when adding a user on a subsite on a network/multisite install. #325
  • Check that required array keys exists in themeand translation loggers. Fixes support thread, issue #339.
  • Fix undefined index warning in logger when context was missing _user_id_user_email, or _user_login. Fix #367.
  • Misc code cleanup and improvements.
  • Fix spellings, as found by Typos.

Changed

  • Move function get_avatar() to helpers class.
  • Change location of filter gettext and gettext_with_context and unhook when filter is not needed any more, resulting in much fewer function calls.
  • IPV4 addresses that are anonymized get a “.x” added last instead of “.0” to make it more clear to the user that the IP address is anonymized.

Removed

  • Remove unused schedule simple_history/purge_db.
  • Remove function filter_gettext_store_latest_translations().
  • Remove support for automatically un-translating messages to the log, loggers are better and have better support for languages.