{"id":51288,"date":"2016-10-04T06:08:05","date_gmt":"2016-10-04T06:08:05","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-log-action\/"},"modified":"2025-05-06T21:22:04","modified_gmt":"2025-05-06T21:22:04","slug":"wp-log-action","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/wp-log-action\/","author":9994042,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.54","stable_tag":"0.54","tested":"6.8.5","requires":"5.3","requires_php":"","requires_plugins":null,"header_name":"WP Log Action","header_author":"Webhead LLC","header_description":"","assets_banners_color":"","last_updated":"2025-05-06 21:22:04","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/webheadcoder.com\/donate-wp-log-action","header_plugin_uri":"","header_author_uri":"http:\/\/webheadcoder.com","rating":5,"author_block_rating":0,"active_installs":30,"downloads":4635,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","changelog"],"tags":{"0.1":{"tag":"0.1","author":"webheadllc","date":"2016-10-04 06:09:01"},"0.2":{"tag":"0.2","author":"webheadllc","date":"2016-10-14 00:49:41"},"0.21":{"tag":"0.21","author":"webheadllc","date":"2016-10-19 21:01:27"},"0.22":{"tag":"0.22","author":"webheadllc","date":"2017-12-09 01:26:10"},"0.3":{"tag":"0.3","author":"webheadllc","date":"2018-03-13 21:15:01"},"0.31":{"tag":"0.31","author":"webheadllc","date":"2018-03-16 19:16:45"},"0.32":{"tag":"0.32","author":"webheadllc","date":"2018-03-19 09:04:15"},"0.33":{"tag":"0.33","author":"webheadllc","date":"2018-05-14 06:16:01"},"0.34":{"tag":"0.34","author":"webheadllc","date":"2019-01-16 02:35:57"},"0.4":{"tag":"0.4","author":"webheadllc","date":"2019-03-29 19:53:01"},"0.40":{"tag":"0.40","author":"webheadllc","date":"2021-04-05 17:46:43"},"0.50":{"tag":"0.50","author":"webheadllc","date":"2022-06-03 00:55:49"},"0.51":{"tag":"0.51","author":"webheadllc","date":"2023-11-09 18:04:19"},"0.52":{"tag":"0.52","author":"webheadllc","date":"2024-12-06 07:04:07"},"0.53":{"tag":"0.53","author":"webheadllc","date":"2024-12-06 07:22:04"},"0.54":{"tag":"0.54","author":"webheadllc","date":"2025-05-06 21:22:04"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1","0.2","0.21","0.22","0.3","0.31","0.32","0.33","0.34","0.4","0.40","0.50","0.51","0.52","0.53","0.54"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2505,94,1340,908,2708],"plugin_category":[52,59],"plugin_contributors":[79661],"plugin_business_model":[],"class_list":["post-51288","plugin","type-plugin","status-publish","hentry","plugin_tags-activity","plugin_tags-debug","plugin_tags-developer-tool","plugin_tags-log","plugin_tags-warning","plugin_category-performance","plugin_category-utilities-and-tools","plugin_contributors-webheadllc","plugin_committers-webheadllc"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-log-action.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin uses hooks in the opposite way most plugins do.  You add <code>do_action<\/code> where you want to do some logging and this plugin will save it to the database only when active.<\/p>\n\n<h4>Log Activity<\/h4>\n\n<p>This plugin now logs plugin activity (when activated, deactivated, deleted, updated, installed), when wordpress is updated, and when functions are used wrong or deprecated.<\/p>\n\n<p>Example:<\/p>\n\n<pre><code>do_action( 'wp_log_info', 'So far ok', 'Details of what is ok.' );\nif ( $something_bad_happened ) {\n    do_action( 'wp_log_error', 'This Happened!', 'Details of what happened.' );\n    ...\n}\n<\/code><\/pre>\n\n<p>See Tools-&gt;Logs to view, delete, and export the logs on the admin side.  Only users with the manage_options capability will have access.<\/p>\n\n<p>This plugin automatically logs deprecated and doing_it_wrong errors.  The rest is what you add to your code.<\/p>\n\n<p>You can log what functions will be run for a specific action or filter.  For example if you want to see what runs in the 'init' hook:<\/p>\n\n<pre><code>function check_init_hook() {\n    do_action( 'wp_log_debug_hook', 'init' );\n}\nadd_filter( 'init', 'check_init_hook', 0 );\n<\/code><\/pre>\n\n<p>The following are the different levels of logging to add to your code.  You can use any level how you see fit, the descriptions of each level are just guidelines.<\/p>\n\n<h4>Emergency<\/h4>\n\n<p>System is unusable\n    do_action( 'wp_log_emergency', $label, $message );<\/p>\n\n<h4>Alert<\/h4>\n\n<p>Action must be taken immediately.\n    do_action( 'wp_log_alert', $label, $message );<\/p>\n\n<h4>Critical<\/h4>\n\n<p>Critical conditions.\n    do_action( 'wp_log_critical', $label, $message );<\/p>\n\n<h4>Error<\/h4>\n\n<p>Runtime errors that do not require immediate action but should typically be logged and monitored.\n    do_action( 'wp_log_error', $label, $message );<\/p>\n\n<h4>Warning<\/h4>\n\n<p>Exceptional occurrences that are not errors.\n    do_action( 'wp_log_warning', $label, $message );<\/p>\n\n<h4>Notice<\/h4>\n\n<p>Normal but significant events.\n    do_action( 'wp_log_notice', $label, $message );<\/p>\n\n<h4>Info<\/h4>\n\n<p>Interesting events.\n    do_action( 'wp_log_info', $label, $message );<\/p>\n\n<h4>Debug<\/h4>\n\n<p>Detailed debug information.\n    do_action( 'wp_log_debug', $label, $message );<\/p>\n\n<!--section=changelog-->\n<h4>0.54<\/h4>\n\n<p>Fixed cron job not running.\nUpdated delete function.<\/p>\n\n<h4>0.53<\/h4>\n\n<p>Security enhancements.<\/p>\n\n<h4>0.51<\/h4>\n\n<p>Fixed timezone error.<br \/>\nFixed PHP warnings.<\/p>\n\n<h4>0.50<\/h4>\n\n<p>Added automatic deleting of logs based on options.<br \/>\nBy default, logs will be deleted 12 months after its created.  Existing users need to re-save their settings or reactivate the plugin.<\/p>\n\n<h4>0.40<\/h4>\n\n<p>Added logging when plugin and core are updated.<\/p>\n\n<h4>0.34<\/h4>\n\n<p>Fixed silly microsoft bug by making the ID column name lower case in export.  Thanks to @clratliff for letting me know!<\/p>\n\n<h4>0.33<\/h4>\n\n<p>Fixed exporting of logs.<\/p>\n\n<h4>0.32<\/h4>\n\n<p>Updated delete to use POST instead of GET.<br \/>\nFixed pages displaying all rows instead of just 25 rows.<\/p>\n\n<h4>0.31<\/h4>\n\n<p>Fixed search losing parameters when going to the next page on view log screen.<\/p>\n\n<h4>0.3<\/h4>\n\n<p>Added Export Results option in Bulk Actions.<\/p>\n\n<h4>0.22<\/h4>\n\n<p>Fix option name not defined.<\/p>\n\n<h4>0.21<\/h4>\n\n<p>Fix css and js not loading.<br \/>\nAdd options page.<\/p>\n\n<h4>0.2<\/h4>\n\n<p>Change default order of table to descending.<br \/>\nPrint arrays so it's readable even though it's ugly.<br \/>\nUpdate readme.<\/p>\n\n<h4>0.1<\/h4>\n\n<p>Initial release.<\/p>","raw_excerpt":"Add error or debug logging in your code and leave it there.  Logs will only be recorded with this plugin, otherwise will be ignored.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/51288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=51288"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/webheadllc"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=51288"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=51288"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=51288"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=51288"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=51288"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=51288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}