<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Cleaning up after the WordPress widget party</title>
	<atom:link href="http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/</link>
	<description>Hacking WordPress. Keeping the bits together.</description>
	<lastBuildDate>Wed, 23 Dec 2009 20:12:27 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: the Mittineague Blog &#187; Blog Archive &#187; Understanding Clean Options</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-1228</link>
		<dc:creator>the Mittineague Blog &#187; Blog Archive &#187; Understanding Clean Options</dc:creator>
		<pubDate>Thu, 20 Sep 2007 21:50:35 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-1228</guid>
		<description>[...] regular expression match all the possible variations in syntax? As Leonid Mamchenkov posted on the WordPress Bits blog , the plugin will not find occurrences of options where the option name is a constant or a [...]</description>
		<content:encoded><![CDATA[<p>[...] regular expression match all the possible variations in syntax? As Leonid Mamchenkov posted on the WordPress Bits blog , the plugin will not find occurrences of options where the option name is a constant or a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonid Mamchenkov</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-464</link>
		<dc:creator>Leonid Mamchenkov</dc:creator>
		<pubDate>Tue, 14 Aug 2007 21:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-464</guid>
		<description>Matthew,

only you can decide how many is too many. If your site does everything you want it to do, if the response times are OK with you, if it doesn&#039;t fry the hardware every other weekend, if your bandwidth consumption is within your budgets, if ... you get the idea. :)

P.S.: good job with the theme there</description>
		<content:encoded><![CDATA[<p>Matthew,</p>
<p>only you can decide how many is too many. If your site does everything you want it to do, if the response times are OK with you, if it doesn&#8217;t fry the hardware every other weekend, if your bandwidth consumption is within your budgets, if &#8230; you get the idea. :)</p>
<p>P.S.: good job with the theme there</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Smith</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-463</link>
		<dc:creator>Matthew Smith</dc:creator>
		<pubDate>Tue, 14 Aug 2007 21:18:34 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-463</guid>
		<description>Awesome! I&#039;m glad to hear about that, because I&#039;d love to optimize my site as much as possible. As for the widget cleanup, I&#039;ll implement something and let you know - I just finished up and installed my new theme on my site, so I need to add the cleanup ability in order to create a neat, self-contained theme+widgets+options (no theme options yet, but I&#039;m sure I&#039;ll add them later) that behaves nicely. As for performance, not only am I curious about the file open/close issue, but I am interested in the effect that plugins have on site performance. I am sure that less = better, but I wonder how many is too many.</description>
		<content:encoded><![CDATA[<p>Awesome! I&#8217;m glad to hear about that, because I&#8217;d love to optimize my site as much as possible. As for the widget cleanup, I&#8217;ll implement something and let you know &#8211; I just finished up and installed my new theme on my site, so I need to add the cleanup ability in order to create a neat, self-contained theme+widgets+options (no theme options yet, but I&#8217;m sure I&#8217;ll add them later) that behaves nicely. As for performance, not only am I curious about the file open/close issue, but I am interested in the effect that plugins have on site performance. I am sure that less = better, but I wonder how many is too many.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonid Mamchenkov</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-439</link>
		<dc:creator>Leonid Mamchenkov</dc:creator>
		<pubDate>Tue, 14 Aug 2007 14:41:19 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-439</guid>
		<description>Matthew,

Yes, there is a way to do things on theme switch.  The way it works is like this (from &lt;em&gt;wp-admin/themes.php&lt;/em&gt; file):

1. User clicks on activation of new theme in the admin interface.
2. Option &#039;template&#039; is updated with the new value (if set in the URL)
3. Option &#039;stylesheet&#039; is updated with the new value (if set in the URL)
4. Action &#039;switch_theme&#039; is called with parameter of current theme (retun value of get_current_theme() function which is defined in wp-includes/theme.php).

So you can hook to &#039;switch_theme&#039; action and check if the name of the supplied theme  is NOT the same as your theme, then do the clean-up stuff.


Performance issue is a whole topic on its own.  There are many variables.  Even the question that you mention depends on the way you have things set up.  Opening and reading one file is faster than many files.  But many files can be conditioned and open/read only when needed.  And stuff like that...


I hope we&#039;ll touch WordPress optimization in some of the upcoming posts, even though I haven&#039;t done much of it myself (but there is a guy now interested to do guest blogging on WordPress Bits about this subject).</description>
		<content:encoded><![CDATA[<p>Matthew,</p>
<p>Yes, there is a way to do things on theme switch.  The way it works is like this (from <em>wp-admin/themes.php</em> file):</p>
<p>1. User clicks on activation of new theme in the admin interface.<br />
2. Option &#8216;template&#8217; is updated with the new value (if set in the URL)<br />
3. Option &#8217;stylesheet&#8217; is updated with the new value (if set in the URL)<br />
4. Action &#8217;switch_theme&#8217; is called with parameter of current theme (retun value of get_current_theme() function which is defined in wp-includes/theme.php).</p>
<p>So you can hook to &#8217;switch_theme&#8217; action and check if the name of the supplied theme  is NOT the same as your theme, then do the clean-up stuff.</p>
<p>Performance issue is a whole topic on its own.  There are many variables.  Even the question that you mention depends on the way you have things set up.  Opening and reading one file is faster than many files.  But many files can be conditioned and open/read only when needed.  And stuff like that&#8230;</p>
<p>I hope we&#8217;ll touch WordPress optimization in some of the upcoming posts, even though I haven&#8217;t done much of it myself (but there is a guy now interested to do guest blogging on WordPress Bits about this subject).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Smith</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-435</link>
		<dc:creator>Matthew Smith</dc:creator>
		<pubDate>Tue, 14 Aug 2007 13:09:15 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-435</guid>
		<description>Thanks for the reply! 

Because I am currently focusing on theme design (and haven&#039;t moved to plugins or more in-depth core tinkering), I wonder if there is a way to hook the function that changes themes (once again, I don&#039;t have time to look right now). If so, when your theme is deactivated you could have a &quot;cleanup&quot; function that removes all preferences related to your widgets and theme (for more advanced themes).

Another interesting point was brought up on the performance side of things; I need to do a more indepth study of the performance effect of widgets, plugins, and other files. For instance, is it faster to place all your widget code in a single file (functions.php) or is it faster to uses include() statements to pull in the the widgets (because of overhead involved in opening files, etc)?

I have really enjoyed your articles and they definitely make it a bit easier to jump into wp hacking (especially since I have more knowledge of C and java than php and mysql).</description>
		<content:encoded><![CDATA[<p>Thanks for the reply! </p>
<p>Because I am currently focusing on theme design (and haven&#8217;t moved to plugins or more in-depth core tinkering), I wonder if there is a way to hook the function that changes themes (once again, I don&#8217;t have time to look right now). If so, when your theme is deactivated you could have a &#8220;cleanup&#8221; function that removes all preferences related to your widgets and theme (for more advanced themes).</p>
<p>Another interesting point was brought up on the performance side of things; I need to do a more indepth study of the performance effect of widgets, plugins, and other files. For instance, is it faster to place all your widget code in a single file (functions.php) or is it faster to uses include() statements to pull in the the widgets (because of overhead involved in opening files, etc)?</p>
<p>I have really enjoyed your articles and they definitely make it a bit easier to jump into wp hacking (especially since I have more knowledge of C and java than php and mysql).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonid Mamchenkov</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-400</link>
		<dc:creator>Leonid Mamchenkov</dc:creator>
		<pubDate>Sun, 12 Aug 2007 17:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-400</guid>
		<description>Trevor/Zedlander,

Thanks for the link. Yeah, the tool looks like the best shot possible without WordPress actually registering plugin options.

Here are a couple of scenarios that would be almost impossible to catch with a plugin like this:

&lt;b&gt;Scenario 1&lt;/b&gt; (option name is a constant):

&lt;code&gt;
define(OPTION_NAME,&#039;my_ugly_option&#039;);
add_option(OPTION_NAME, &#039;test value&#039;, &#039;test description&#039;);
&lt;/code&gt;


&lt;b&gt;Scenario 2&lt;/b&gt; (option name is a dynamically built variable):

&lt;code&gt;
$option_name_prefix = &#039;my_ugly_&#039;;
$option_name_test = &#039;test&#039;;
$full_option_name = $option_name_prefix . $option_name_test;
add_option($full_option_name,&#039;test&#039;,&#039;test description);
&lt;/code&gt;


However, the plugin might still be useful for catching most of the stuff out there.  I see the examples are all about RSS feeds saved in the options table - it makes a lot of sense to clear those out, as they tend to grow easily.</description>
		<content:encoded><![CDATA[<p>Trevor/Zedlander,</p>
<p>Thanks for the link. Yeah, the tool looks like the best shot possible without WordPress actually registering plugin options.</p>
<p>Here are a couple of scenarios that would be almost impossible to catch with a plugin like this:</p>
<p><b>Scenario 1</b> (option name is a constant):</p>
<p><code><br />
define(OPTION_NAME,'my_ugly_option');<br />
add_option(OPTION_NAME, 'test value', 'test description');<br />
</code></p>
<p><b>Scenario 2</b> (option name is a dynamically built variable):</p>
<p><code><br />
$option_name_prefix = 'my_ugly_';<br />
$option_name_test = 'test';<br />
$full_option_name = $option_name_prefix . $option_name_test;<br />
add_option($full_option_name,'test','test description);<br />
</code></p>
<p>However, the plugin might still be useful for catching most of the stuff out there.  I see the examples are all about RSS feeds saved in the options table &#8211; it makes a lot of sense to clear those out, as they tend to grow easily.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-398</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Sun, 12 Aug 2007 16:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-398</guid>
		<description>(I am Zedlander, btw)
I think this tool is the best solution:
http://www.mittineague.com/dev/co.php
A user can then choose to remove options from plugins which they no longer need.</description>
		<content:encoded><![CDATA[<p>(I am Zedlander, btw)<br />
I think this tool is the best solution:<br />
<a href="http://www.mittineague.com/dev/co.php" rel="nofollow">http://www.mittineague.com/dev/co.php</a><br />
A user can then choose to remove options from plugins which they no longer need.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonid Mamchenkov</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-386</link>
		<dc:creator>Leonid Mamchenkov</dc:creator>
		<pubDate>Sun, 12 Aug 2007 08:52:50 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-386</guid>
		<description>Arpit Jacob,

you can cleanup your options table using any SQL administration tool (PHPMyAdmin, for example).  Make sure to saave the table as it is before you do any changes, so that you can restore and try again, if something goes wrong. ;)</description>
		<content:encoded><![CDATA[<p>Arpit Jacob,</p>
<p>you can cleanup your options table using any SQL administration tool (PHPMyAdmin, for example).  Make sure to saave the table as it is before you do any changes, so that you can restore and try again, if something goes wrong. ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arpit Jacob</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-383</link>
		<dc:creator>Arpit Jacob</dc:creator>
		<pubDate>Sun, 12 Aug 2007 07:54:30 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-383</guid>
		<description>@zedlander  when leo showed me the wordpress options trick to show all the available options I saw a number of options which were not supposed to be there since they belonged to some old plugins that I had tried out before. Kind makes me wonder is there a way to clean up my wordpress database. also does this effect my wordpress DB in anyway. I guess the best option would be a complete reinstall :(</description>
		<content:encoded><![CDATA[<p>@zedlander  when leo showed me the wordpress options trick to show all the available options I saw a number of options which were not supposed to be there since they belonged to some old plugins that I had tried out before. Kind makes me wonder is there a way to clean up my wordpress database. also does this effect my wordpress DB in anyway. I guess the best option would be a complete reinstall :(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Top English WP Blogs &#171; KHỦNG LONG IT</title>
		<link>http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-374</link>
		<dc:creator>Top English WP Blogs &#171; KHỦNG LONG IT</dc:creator>
		<pubDate>Sun, 12 Aug 2007 00:09:26 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/11/cleaning-up-after-the-wordpress-widget-party/#comment-374</guid>
		<description>[...]  Cleaning up after the WordPress widget party In one of the recent posts - “Advanced Widgets. Widgets with controls.” - we saw how to create WordPress [&#8230;] [...]</description>
		<content:encoded><![CDATA[<p>[...]  Cleaning up after the WordPress widget party In one of the recent posts &#8211; “Advanced Widgets. Widgets with controls.” &#8211; we saw how to create WordPress [&#8230;] [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
