[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog
You are here: Home / WordPress plugins from oik-plugins / FREE oik plugins / oik-bwtrace – debug trace for WordPress / Settings > oik action options / Action options – options / Count action hooks and filters

Count action hooks and filters

Select the Count action hooks and filters check box when you want to discover all the action hooks and filters that are invoked.

When tracing is active then at shutdown a number of trace records are written summarising the action hooks and filters that have been invoked.

Information traced

wp_actions shows the contents of global $wp_actions formatted as hook shortcodes
bw_action_counts shows the oik-bwtrace global $bw_action_counts formatted as shortcodes
most used bw_action_counts array sorted by invocation count descending
by hook name bw_action_counts array sorted by hook name ascending
unique hooks Count of the number of unique hooks invoked
total hooks Count of the total number of action/filter hooks invoked
bw_action_counts_tree view of the counts taking into account nested actions and filters

Hook shortcode parameters

The hook shortcode takes 5 positional parameters:

  1. Hook name(s)
  2. Hook type: action or filter
  3. Number of args passed
  4. Number of invocations
  5. Attached hook function count

To find which functions are attached use Trace attached hooks functions.

Example wp_actions

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-action-counts.php(205:0)
bw_trace_create_hook_links(1) 39 2 2019-12-04T17:50:01+00:00 0.311519 0.011168 
cf=shutdown 12898 52 3912 6291456/6291456 256M F=601 hook_links 
<h3>wp_actions</h3>
[hook mu_plugin_loaded action 1 3 0]
[hook muplugins_loaded action 0 1 1]
[hook registered_taxonomy action 3 26 3]
[hook registered_post_type action 2 41 3]
[hook plugin_loaded action 1 37 0]
[hook load_textdomain action 2 20 0]
[hook plugins_loaded action 0 1 17]
...
[hook shutdown action 0 1 5]

The wp_actions array may include some actions invoked before action counting was initiated.
See Must-Use and Drop-In logic.

Example bw_action_counts

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-action-counts.php(205:0)
bw_trace_create_hook_links(2) 40 2 2019-12-04T17:50:01+00:00 0.314809 0.003290 
cf=shutdown 12898 52 3912 6291456/6291456 256M F=601 hook_links 
<h3>bw_action_counts</h3>
[hook pre_determine_locale filter 1 19 0]
[hook pre_option_WPLANG filter 3 1 0]
[hook alloptions filter 1 790 0]
[hook option_WPLANG filter 2 1 0]
[hook locale filter 1 41 1]
[hook determine_locale filter 1 19 0]
[hook gettext filter 3 4834 0]
...
[hook shutdown action 0 1 5]

Example most used

The most used list only shows the hooks that are implemented. In this example we don’t see gettext. The filter is applied many times but there aren’t any attached filter functions.

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-action-counts.php(205:0)
bw_trace_create_hook_links(3) 41 2 2019-12-04T17:50:01+00:00 0.315855 0.001046 
cf=shutdown 12898 52 3912 6291456/6291456 256M F=601 hook_links 
<h3>most used</h3>
[hook option_siteurl filter 2 111 1]
[hook option_home filter 2 75 1]
[hook map_meta_cap filter 4 62 3]
[hook user_has_cap filter 4 62 7]
[hook query filter 1 51 1]
[hook get_user_metadata filter 4 48 1]
[hook pre_render_block filter 2 47 1]
...
[hook shutdown action 0 1 5]

Example by hook name

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-action-counts.php(205:0) 
bw_trace_create_hook_links(4) 42 2 2019-12-04T17:50:01+00:00 0.316775 0.000920 
cf=shutdown 12898 52 3912 6291456/6291456 256M F=601 hook_links 
<h3>by hook name</h3>
[hook _get_page_link filter 2 10 0]
[hook add_admin_bar_menus action 0 1 0]
[hook add_extra_wpseo_meta_fields filter 1 1 0]
[hook admin_bar_init action 0 1 0]
[hook admin_bar_menu action 1 1 18]
[hook admin_url filter 3 66 0]
[hook after_setup_theme action 0 1 4]
[hook alloptions filter 1 790 0]
...
[hook yoast_seo_development_mode filter 1 1 0]

Example count hooks

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-action-counts.php(162:0)
bw_trace_count_report(1) 43 2 2019-12-04T17:50:01+00:00 0.317042 0.000267 
cf=shutdown 12898 52 3912 6291456/6291456 256M F=601 
count hooks 753

Example total hooks

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-action-counts.php(163:0) 
bw_trace_count_report(2) 44 2 2019-12-04T17:50:01+00:00 0.317178 0.000136 cf=shutdown 12898 52 3912 6291456/6291456 256M F=601 
total hooks 12895

Example bw_action_counts_tree

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-action-counts.php(205:0) 
bw_trace_create_hook_links(5) 45 2 2019-12-04T17:50:01+00:00 0.318589 0.001411 
cf=shutdown 12898 52 3912 6291456/6291456 256M F=601 hook_links 
<h3>bw_action_counts_tree</h3>
[hook pre_determine_locale filter 1 5 0]
[hook pre_option_WPLANG filter 3 1 0]
[hook alloptions filter 1 248 0]
...
[hook plugins_loaded action 0 1 17]
[hook plugins_loaded;load_default_widgets filter 1 1 0]
...
[hook wp_footer;wp_after_admin_bar_render action 0 1 0]
[hook shutdown action 0 1 5]

Published: August 25, 2015 | Last updated: December 1, 2020

Information

Component:
  • oik-bwtrace – debug trace for WordPress
Letters: C

Recent plugin updates

oik-themes v1.4.0 

Update to oik-themes v1.4.0 to support Full Site Editing (FSE) themes. FSE themes, which are currently experimental, deliver block based templates and template parts.

 ...
oik-clone v2.0.1 oik-clone v2.0.1 contains a fix for a 500 internal server error being produced when cloning content with certain taxonomy terms. ...
SB Chart block v0.1.1 

Update to SB Chart block v0.1.1 for improved enqueing of the chart.js Javascript and better colours in the Gutenberg palette.

 ...
Slog v1.3.1 

Update to Slog v1.3.1 for a new Driver tab and improved display of charts grouping Elapsed times.

 ...
SB-Chart-Block v0.0.8 SB-Chart-Block v0.0.8, a WordPress single block plugin, supports 4 different chart types; Line, Bar, Horizontal bar and Pie. ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: [email protected]

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2021. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins