Hook Highlighter

$19.95

Now with time and memory benchmarks!

Hook Highlighter provides insight into the internal program flow of WordPress when activated on any front-facing page of a website.

Display action and filter hooks, program files and backtrace information inline for the current page.

Note: This is a one-time purchase, not a subscription!

Category:

Description

Hook Highlighter provides insight into the internal program flow of WordPress when activated on any front-facing page of a website.

Display action and filter hooks, program files and backtrace information inline for the current page.

Overview

Themes, plugins and core code all utilize “hooks” to route execution to external sources, making it difficult to:

  • Follow program logic and flow;
  • Determine where components are being generated;
  • Determine where output is being modified;

Hook Highlighter help users navigate the code by:

  • Displaying “flags” representing hooks and files on the page near the point they are executed;
  • Showing files being used in the order they are called;
  • Showing action and filter hooks in the order they are called;
  • Linking to specific files in the theme and plugin editors;
  • Linking to WordPress documentation related to specific hooks and files;
  • Showing the callbacks for action and filter hooks and linking to the editor and documentation;
  • Showing backtrace information at the hook execution points

Installation

  1. Download the Hook Highlighter plugin from LilaeaMedia.com
  2. In the WordPress Admin, go to “Plugins > Add New.”
  3. Click the “Upload” link at the top of the page.
  4. Browse for the zip file, select and click “Install.”
  5. In the WordPress Admin, go to “Plugins > Installed Plugins.”
  6. Locate “Hook Highlighter” in the list and click “Activate.”

Usage

When a front-facing page is loaded by a user with Administrator “edit_theme_options” capability, a link will be present in the lower left corner labeled “HHL.”

Clicking this link reloads the page with Hook Highlighter enabled. Flags are displayed on the page near the point their corresponding hooks are executed.
For clarit, file flags are shown with cool hues and action flags are shown with warm hues.

Information corresponding to each hook is displayed at the end of the page output. Clicking an action flag scrolls the page to the corresponding information and vice versa.
This information is displayed with the following components:

  • Hook Name: Shown in bold type with color that corresponds to its type. For actions, clicking the hook name scrolls the page to the corresponding flag and vice versa.
  • Docs: Searches WordPress.org for documentation related to the hook.
  • Callbacks: Toggles a list of callback functions with the line number of the file that contain them with links to their code (plugins and themes) or documentation (WordPress). The priority and number of arguments is shown in parentheses, if present.
  • Backtrace: The chain of functions that was executed to reach the hook in question with the line number of the file that contain them with links to their code (plugins and themes) or documentation (WordPress). Backtrace information that repeats from one hook to the next is not displayed.

A series of checkbox options are also displayed at the bottom of the page allowing the user to toggle various types of output:

  • Pre Template: Displays hooks and files that occur before the main output template is rendered. (Hidden by default)
  • No Callbacks: Displays hooks that have no callbacks registered. These are hidden by default. (Hidden by default)
  • Plugin Files: Displays inline flags that link to their code in the Plugin Editor. No corresponding information is displayed at the end of the output.
  • Theme Files: Displays inline flags that link to their code in the Theme Editor. No corresponding information is displayed at the end of the output.
  • WordPress Files: Displays inline flags that link to their WordPress reference documentation in WordPress.org. No corresponding information is displayed at the end of the output.(Hidden by default)
  • Plugin Actions: Displays inline flags and corresponding information about actions called by plugins.
  • Theme Actions: Displays inline flags and corresponding information about actions called by the theme (and/or child theme).
  • WordPress Actions: Displays inline flags and corresponding information about actions called by WordPress. (Hidden by default)
  • Plugin Filters: Displays information about filters called by plugins in the information section at the end of the output. No inline flags are displayed. (Hidden by default)
  • Theme Filters: Displays information about filters called by the theme (and/or child theme) in the information section at the end of the output. No inline flags are displayed. (Hidden by default)
  • WordPress Filters: Displays information about filters called by WordPress in the information section at the end of the output. No inline flags are displayed. (Hidden by default)
  • Quit HHL: Reloads the page with Hook Highlighter disabled.

Frequently Asked Questions

Why aren’t filter hooks shown as inline flags?

Filters modify the output so displaying a flag would severely disrupt the rendered html. You can locate a filter by searching the page for the hook name near an action that fires nearby.

Why doesn’t the documentation link show relevant information about plugins or themes?

Plugins and themes may not have relevant information in the WordPress.org forums. You can use the search query on Google, Stack Overflow or other developer resources.