{"id":393401,"date":"2026-10-27T04:31:00","date_gmt":"2026-10-27T04:31:00","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/hooktrail\/"},"modified":"2026-10-27T04:30:32","modified_gmt":"2026-10-27T04:30:32","slug":"hooktrail","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/hooktrail\/","author":23584890,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"7.1.4","requires":"5.8","requires_php":"7.4","requires_plugins":null,"header_name":"Hooktrail","header_author":"Anu","header_description":"See every action and filter that fired on the current page, which plugin or theme is behind each callback, how long each hook took, what each filter callback changed, and the queries and PHP warnings each plugin caused.","assets_banners_color":"","last_updated":"2026-10-27 04:30:32","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/anu771063.github.io\/portfolio","rating":0,"author_block_rating":0,"active_installs":0,"downloads":48,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"anu771063","date":"2026-10-27 04:30:32","revision":3767727}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3767792,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3767792,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[94,2275,2755,4073,247],"plugin_category":[54,59],"plugin_contributors":[286537],"plugin_business_model":[],"class_list":["post-393401","plugin","type-plugin","status-publish","hentry","plugin_tags-debug","plugin_tags-developer","plugin_tags-filters","plugin_tags-hooks","plugin_tags-performance","plugin_category-security-and-spam-protection","plugin_category-utilities-and-tools","plugin_contributors-anu771063","plugin_committers-anu771063"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/hooktrail\/assets\/icon-128x128.png?rev=3767792","icon_2x":"https:\/\/ps.w.org\/hooktrail\/assets\/icon-256x256.png?rev=3767792","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>When something on a WordPress site behaves strangely, the question is usually \"which plugin is doing this?\". Hooktrail answers it for any page you open.<\/p>\n\n<p>Switch it on for yourself, open a page, and choose <strong>Hooktrail<\/strong> in the admin bar. A panel opens at the bottom of the page.<\/p>\n\n<h4>Timeline<\/h4>\n\n<p>Every action and filter that fired, in order, grouped under WordPress's loading stages. Each row shows when the hook first fired, how many times it ran, how long its first run took, and coloured tags for every plugin or theme with a callback on it. Click a row to see each callback, its priority and the exact file and line where it is defined.<\/p>\n\n<h4>Flame<\/h4>\n\n<p>A chart of hook run times: each bar is a hook's first run, hooks fired inside it sit below it, and the slowest hooks are listed at the top. Click any bar to jump to that hook.<\/p>\n\n<h4>By plugin and Shared hooks<\/h4>\n\n<p>Every plugin, theme and WordPress core with the hooks it used on this page, and the hooks where more than one plugin or theme attaches a callback, listed in the order they run.<\/p>\n\n<h4>Trace<\/h4>\n\n<p>Pick a filter such as <code>the_content<\/code> or <code>document_title_parts<\/code>, reload, and see its value before and after every single callback, with the changed text highlighted. You see exactly which plugin changed what.<\/p>\n\n<h4>Queries<\/h4>\n\n<p>Every database query, with the hook that was running and the plugin or theme file, line and function that made it. Queries are totalled per plugin and repeated queries are grouped.<\/p>\n\n<h4>Assets<\/h4>\n\n<p>The theme template used for the page, the theme files loaded, and every script and stylesheet printed, with its size and the plugin, theme or external host that added it.<\/p>\n\n<h4>Issues<\/h4>\n\n<p>A short list of things worth a closer look: PHP warnings and notices with the plugin and hook that caused them, plugins on the same filter at the same priority, callbacks at extreme priorities, callbacks removed while the page loaded, repeated queries and slow hooks.<\/p>\n\n<h4>Not fired<\/h4>\n\n<p>Callbacks registered on hooks that did not run on this page, grouped by plugin.<\/p>\n\n<h4>Background<\/h4>\n\n<p>AJAX and REST API requests you made while recording (for example saves in the block editor), which never show a page of their own. Open any of them to see its full map.<\/p>\n\n<h4>Compare<\/h4>\n\n<p>Load two saved maps (for example before and after activating or updating a plugin) and see hooks, callbacks, priorities and assets that changed.<\/p>\n\n<h4>Also<\/h4>\n\n<ul>\n<li>Search across hooks, callbacks, files and queries.<\/li>\n<li>Copy a plain-text summary of the page for a support ticket, or export the full map as JSON.<\/li>\n<li>Translation, escaping, option, URL and query hooks, which fire hundreds of times per page, are hidden until you ask for them.<\/li>\n<li><strong>Plugin hook reference<\/strong> under Tools &gt; Hooktrail: lists the actions and filters any installed plugin offers to other developers, read from its code (nothing is run), with a Markdown download.<\/li>\n<\/ul>\n\n<h4>WP-CLI<\/h4>\n\n<ul>\n<li><code>wp hooktrail record &lt;url&gt; [--output=&lt;file&gt;]<\/code> records a page on this site as a logged-out visitor sees it.<\/li>\n<li><code>wp hooktrail compare &lt;a.json&gt; &lt;b.json&gt; [--fail-on-change]<\/code> compares two maps; with <code>--fail-on-change<\/code> it exits with status 1 when they differ, for deploy checks.<\/li>\n<li><code>wp hooktrail hooks &lt;plugin-folder&gt; [--format=table|json|csv|markdown]<\/code> lists the hooks a plugin offers.<\/li>\n<\/ul>\n\n<h4>Safe to leave installed<\/h4>\n\n<ul>\n<li>Recording only runs for administrators who switch it on for themselves, and only in their own browser. Visitors are never recorded and see nothing.<\/li>\n<li>WP-CLI recording works only with a single-use token that can only be created from the command line, and records the page as a logged-out visitor.<\/li>\n<li>Page maps live only in the page you are viewing. Background-request maps are kept for 30 minutes for your account only. Nothing else is stored.<\/li>\n<li>No external services, no tracking.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Install and activate the plugin.<\/li>\n<li>Go to <strong>Tools &gt; Hooktrail<\/strong> and click <strong>Turn recording on<\/strong>, or click <strong>Hooktrail: off<\/strong> in the admin bar.<\/li>\n<li>Open any page and click <strong>Hooktrail<\/strong> in the admin bar (or the Hooktrail button in the bottom corner).<\/li>\n<li>Turn recording off again when you are finished.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20it%20slow%20my%20site%20down%3F\"><h3>Does it slow my site down?<\/h3><\/dt>\n<dd><p>Only for you, and only while recording is on. Hooktrail listens to every hook, query and PHP warning during your page views, which adds some time to each of your requests. Visitors and other users are not affected.<\/p><\/dd>\n<dt id=\"why%20are%20some%20early%20hooks%20missing%3F\"><h3>Why are some early hooks missing?<\/h3><\/dt>\n<dd><p>Recording starts when Hooktrail itself loads. Hooks, queries and warnings from before that, such as while must-use plugins and earlier plugins load, are not included. Callbacks those plugins add to later hooks are still shown. Filters that run before <code>init<\/code> cannot be traced.<\/p><\/dd>\n<dt id=\"how%20does%20it%20know%20which%20plugin%20a%20callback%2C%20query%20or%20warning%20belongs%20to%3F\"><h3>How does it know which plugin a callback, query or warning belongs to?<\/h3><\/dt>\n<dd><p>Callbacks: PHP Reflection gives the file and line where each callback is defined. Queries and warnings: the call stack shows the plugin or theme file that made the call. Files are matched against the plugins folder, the must-use plugins folder, the active theme and WordPress core.<\/p><\/dd>\n<dt id=\"how%20are%20hook%20durations%20measured%3F\"><h3>How are hook durations measured?<\/h3><\/dt>\n<dd><p>When a hook first runs, Hooktrail adds a callback at the very last priority, so it runs after every other callback on that hook and records the elapsed time. The time includes everything that ran inside the hook. The extra callback removes itself straight away.<\/p><\/dd>\n<dt id=\"does%20tracing%20a%20filter%20change%20my%20site%3F\"><h3>Does tracing a filter change my site?<\/h3><\/dt>\n<dd><p>No. While tracing, each callback on that filter is wrapped so its input and output can be recorded; the wrapped callback receives the same arguments and its result is passed on unchanged. Only filters you choose are traced, only for your account, and only while recording is on.<\/p><\/dd>\n<dt id=\"is%20it%20safe%20to%20share%20an%20exported%20map%3F\"><h3>Is it safe to share an exported map?<\/h3><\/dt>\n<dd><p>Exports can contain database queries, which may include data such as email addresses or user names. Check an export before sharing it outside your team.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First release.<\/li>\n<\/ul>","raw_excerpt":"See every hook that ran on a page, which plugin is behind it, how long it took, what it changed, and the queries and PHP warnings each plugin caused.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/393401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=393401"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/anu771063"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=393401"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=393401"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=393401"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=393401"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=393401"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=393401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}