Hook-logger-plugin - Debug WordPress action / filter hooks.

Overview

hook-logger-plugin

Easily debug WordPress action / filter hooks, finding where actions are called from and understanding the flow of execution.

This plugin does nothing on its own and requires the user to add additional code elsewhere.

the easist way to generate output is...

$logger = new Hook_Logger_Plugin();
$logger->log_to_file = true;

This will create a new .log file for each and every request. By default logging to file does not happen.

Additional Config

The most common usage is supplying include or exclude strings / regex.

When a string is passed it will match against the start of the action. eg, option will match option_test but not test_option. When a regex is passed it must start with /. eg /mail/ will match wp_mail and sanitize_email

$logger = new Hook_Logger_Plugin();
$logger->include = ['mail'];

or

$logger = new Hook_Logger_Plugin();
$logger->exclude[] = '/plugin/';

Note: by default there are a number of helpful exclusions pre-loaded.

Sample log file

Date: Sun, 19 Dec 2021 23:32:11 +0000
URL: /wp-admin/edit.php
Method: URL: GET
POST:
array (
)

2021-12-19 23:32:11.446 plugin_loaded /var/www/wp-settings.php:418
2021-12-19 23:32:11.447 plugin_loaded /var/www/wp-settings.php:418
2021-12-19 23:32:11.448 pre_transient_jetpack_autoloader_plugin_paths /var/www/wp-includes/option.php:831
2021-12-19 23:32:11.448 transient_jetpack_autoloader_plugin_paths /var/www/wp-includes/option.php:871
2021-12-19 23:32:11.448 upload_dir /var/www/wp-includes/functions.php:2323
2021-12-19 23:32:11.449 woocommerce_helper_api_base /var/www/wp-content/plugins/woocommerce/includes/admin/helper/class-wc-helper-api.php:33
2021-12-19 23:32:11.449 woocommerce_helper_loaded /var/www/wp-content/plugins/woocommerce/includes/admin/helper/class-wc-helper.php:49
2021-12-19 23:32:11.449 template /var/www/wp-includes/theme.php:315
2021-12-19 23:32:11.450 woocommerce_data_stores /var/www/wp-content/plugins/woocommerce/includes/class-wc-data-store.php:82
2021-12-19 23:32:11.450 woocommerce_customer-download_data_store /var/www/wp-content/plugins/woocommerce/includes/class-wc-data-store.php:92
2021-12-19 23:32:11.450 plugin_loaded /var/www/wp-settings.php:418
2021-12-19 23:32:11.450 set_url_scheme /var/www/wp-includes/link-template.php:3803
You might also like...
Add a logger to your Kirby3 website
Add a logger to your Kirby3 website

A Website logger for Kirby3 Commercial Usage This plugin is free but if you use it in a commercial project please consider to buy me a 🍺 Installation

Magento 2 Email Catcher or Email Logger Module. Available At Packagist.

Magento 2 Module Experius email catcher / - logger ``experius/module-emailcatcher`` Main Functionalities Installation Versions Enable email catcher C

Api.video-wordpress-plugin - The official api.video plugin for WordPress
Api.video-wordpress-plugin - The official api.video plugin for WordPress

api.video WordPress Plugin api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managin

A powerful debug and profilers tool for the Phalcon Framework
A powerful debug and profilers tool for the Phalcon Framework

Phalcon Debugbar Integrates PHP Debug Bar with Phalcon Framework. δΈ­ζ–‡θ―΄ζ˜Ž Features Normal request capturing Ajax request capturing Redirect request chain

Debug with Ray to fix problems faster
Debug with Ray to fix problems faster

Debug with Ray to fix problems faster This package can be installed in any PHP application to send messages to the Ray app. The desktop app: can be us

Xr - Lightweight debug server utility built on ReactPHP.
Xr - Lightweight debug server utility built on ReactPHP.

XR πŸ”” Subscribe to the newsletter to don't miss any update regarding Chevere. XR is a dump server utility built on top of ReactPHP. Features ✨ Dump si

Magento 2 Debug Helper Module for easy debugging with Xdebug and PHPStorm or any other IDE

Magento 2 Debug Helper Information and Usage Magento 2 Debug Helper Module usage with PHPStorm and Xdebug Installation To install the Magento 2 Debug

Frog - A new way to debug in PHP

Frog - A new way to debug in PHP There are situations where you want to show information of variables in PHP. While print_r, var_dump and var_export a

Owner
bruce aldridge
bruce aldridge
Some useful hooks desigend by DMIT for WHMCS

whmcs-hooks Some useful hooks desigend by DMIT for WHMCS CancelSubscription.php Cancel Subscriptions (like PayPal) when perform refund/cancel/change g

DMIT, Inc. 6 Dec 14, 2022
Easily manage git hooks in your composer config

composer-git-hooks Manage git hooks easily in your composer configuration. This command line tool makes it easy to implement a consistent project-wide

Ezinwa Okpoechi 985 Jan 3, 2023
Very flexible git hook manager for php developers

CaptainHook CaptainHook is an easy to use and very flexible git hook library for php developers. It enables you to configure your git hook actions in

CaptainHook 812 Dec 30, 2022
Install an execute script of specify quality tools to your git pre-commit hook, and it executes only for changed files

Quality Hook Installer Install an execute script of specify quality tools to your git pre-commit hook, and it executes only for changed files Install

Kay W. 2 Dec 15, 2022
Creating data transfer objects with the power of php objects. No php attributes, no reflection api, and no other under the hook work.

Super Simple DTO Creating data transfer objects with the power of php objects. No php attributes, no reflection api, and no other under the hook work.

Mohammed Manssour 8 Jun 8, 2023
An actual logger for WordPress.

Wp-logger An actual logger for WordPress. This plugin does two things. It piggybacks on the internal php logger (via set_error_handler) and it creates

Jitesoft 2 Aug 15, 2022
Extends the Debug Bar plugin for the Sophi.io Site Automation service.

Debug Bar for Sophi Extends the Debug Bar plugin for the Sophi.io Site Automation service. Requirements PHP 7.4+ WordPress 5.6+ Sophi 1.1.0+ Debug Bar

10up 2 Jun 22, 2022
The best profanity filter for chat with api for plugin developers!

xqwtxon/ProfanityFilter is moving on ReinfyTeam/ProfanityFilter ProfanityFilter ?? A best profanity filter for pocketmine. Controls hate speech and bl

Ace Sobremont 4 Jul 11, 2022
GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

Shivam Mathur 2.4k Jan 6, 2023
β†ͺοΈπŸ”” Send notification action for Nextcloud Flow

Nextcloud Flow Notifications ?? Notification action for Nextcloud Flow ?? Configure your flow ?? Receive notifications ?? Development setup ☁ Clone th

Nextcloud 13 Dec 2, 2022