<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>scompt.com &#187; graphs</title>
	<atom:link href="http://scompt.com/blog/archives/tag/graphs/feed/" rel="self" type="application/rss+xml" />
	<link>http://scompt.com</link>
	<description>The website of Edward Dale</description>
	<lastBuildDate>Sun, 04 Sep 2011 15:54:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>The most popular WordPress actions and filters</title>
		<link>http://scompt.com/blog/archives/2009/01/18/the-most-popular-wordpress-actions-and-filters</link>
		<comments>http://scompt.com/blog/archives/2009/01/18/the-most-popular-wordpress-actions-and-filters#comments</comments>
		<pubDate>Sun, 18 Jan 2009 21:32:59 +0000</pubDate>
		<dc:creator>Edward Dale</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://scompt.com/?p=250</guid>
		<description><![CDATA[WordPress has an amazing plugin system that has allowed thousands of plugins to be created. At the heart of the plugin system are actions and filters that allow developers to hook into the WordPress internals and tweak things. There are hundreds of actions and filters, many of which are described on the codex, and developers [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress has an amazing plugin system that has allowed <a href="http://wordpress.org/extend/plugins/">thousands of plugins</a> to be created.  At the heart of the plugin system are actions and filters that allow developers to hook into the WordPress internals and tweak things.  There are hundreds of <a href="http://codex.wordpress.org/Plugin_API/Action_Reference">actions</a> and <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">filters</a>, many of which are described on the codex, and developers can create their own as well.  I was curious which ones were most used by plugin developers so I parsed the WordPress <a href="http://svn.wp-plugins.org">plugin database</a> and ended up with the graphs and analysis below.</p>
<p><span id="more-250"></span></p>
<h2>Top 20 WordPress actions</h2>
<a href="http://scompt.com/wordpress/wp-content/uploads/2009/01/top_actions.png"><img src="http://scompt.com/wordpress/wp-content/uploads/2009/01/top_actions-300x200.png" alt="" title="Most popular WordPress actions" width="300" height="200" class="aligncenter size-medium wp-image-251" /></a>
<p style="clear:both">
As is clear from the graph, the most popular WordPress action is <code>admin_menu</code>.  This makes sense, as one of the first things a plugin developer might want to do is have their plugin show up in the WordPress backend.  Not surprisingly, many of the other top 20 actions are used just to get the plugin up and running: <code>init</code>, <code>plugins_loaded</code>, <code>activate_</code>, <code>deactivate_</code>, etc.  The other well-represented group of actions are those dealing with the post life-cycle: <code>save_post</code>,<code>publish_post</code>,  <code>edit_post</code>, <code>delete_post</code>.</p>
<p>In total, there were 659 unique actions used 12373 times.  The graph above represents about 72% of the actions.</p>
<h2>Top 20 WordPress filters</h2>
<p><a href="http://scompt.com/wordpress/wp-content/uploads/2009/01/top_filters.png"><img src="http://scompt.com/wordpress/wp-content/uploads/2009/01/top_filters-300x200.png" alt="" title="Most popular WordPress filters" width="300" height="200" class="alignnone size-medium wp-image-252" /></a></p>
<p style="clear:both">
The shape of the top 20 filters graph is a bit different.  <code>the_content</code> is the clear favorite of plugin developers, along with a couple other content filters: <code>the_excerpt</code>, <code>the_content_rss</code>, <code>the_excerpt_rss</code>.  The query filters are also well-represented: <code>posts_where</code>, <code>query_vars</code>, <code>wp</code>, <code>posts_join</code>.  The filter graph drops off pretty quickly so that most of the filters are used a maximum of 20 times.</p>
<p>In total, there were 512 unique filters used 5071 times.  The above graph represents about 55% of the filters.</p>
<h2>Method</h2>
<p>I&#8217;ll post more about my method in the future.  The numbers and graphs should be current as of SVN revision #85627 on 1/10/2009.  A number of errors were encountered along the way and some corners were cut, so the numbers aren&#8217;t perfect.</p>
]]></content:encoded>
			<wfw:commentRss>http://scompt.com/blog/archives/2009/01/18/the-most-popular-wordpress-actions-and-filters/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

