<?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/"
	>

<channel>
	<title>WPStorm &#187; Plugin</title>
	<atom:link href="http://wpstorm.net/tag/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpstorm.net</link>
	<description>Coding, Wordpress and Plugin Development</description>
	<lastBuildDate>Mon, 30 Jan 2012 00:25:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PayPal Donations Review</title>
		<link>http://wpstorm.net/2011/04/paypal-donations-review/</link>
		<comments>http://wpstorm.net/2011/04/paypal-donations-review/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 09:07:42 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[PayPal]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=369</guid>
		<description><![CDATA[Joost de Valk have written a great review of the PayPal Donations plugin for WordPress. It was really nice to see such a positive review from one of the more experienced WordPress developers.]]></description>
			<content:encoded><![CDATA[<p>Joost de Valk have written a great review of the PayPal Donations plugin for WordPress. It was really nice to see such a positive review from one of the more experienced WordPress developers. Awesome! <img src='http://wpstorm.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Check out Yoast&#8217;s <a title="PayPal Donations Review" href="http://yoast.com/wp-plugin-review/paypal-donations/">PayPal Donations Review</a> »</p>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2011/04/paypal-donations-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PayPal Donations WordPress Widget</title>
		<link>http://wpstorm.net/2009/06/paypal-donation-wordpress-widget/</link>
		<comments>http://wpstorm.net/2009/06/paypal-donation-wordpress-widget/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 18:56:18 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=279</guid>
		<description><![CDATA[I just released a new version of PayPal Donations, version 1.2. New in this version is the inclusion of a sidebar Widget for the PayPal button. I&#8217;m using the new WordPress 2.8 API for the Widget, so it&#8217;s only available if you run the plugin on WordPress 2.8 or newer. In the widget admin you ...]]></description>
			<content:encoded><![CDATA[<div id="attachment_280" class="wp-caption alignright" style="width: 160px"><a href="http://wpstorm.net/files/2009/06/paypal-donations-widget-screenshot-1.2.jpg"><img class="size-thumbnail wp-image-280" title="PayPal Donation Widget" src="http://wpstorm.net/files/2009/06/paypal-donations-widget-screenshot-1.2-150x150.jpg" alt="PayPal Donation Widget Setup" width="150" height="150" /></a><p class="wp-caption-text">PayPal Widget Setup</p></div>
<p>I just released a new version of <a title="PayPal Donation for WordPress" href="http://wpstorm.net/wordpress-plugins/paypal-donations/">PayPal Donations</a>, version 1.2.</p>
<p>New in this version is the inclusion of a sidebar Widget for the PayPal button. I&#8217;m using the new WordPress 2.8 API for the Widget, so it&#8217;s only available if you run the plugin on WordPress 2.8 or newer.</p>
<p>In the widget admin you can specify a descriptive text as well as overrides for Purpose and Reference if you wish.</p>
<p>Enjoy and cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2009/06/paypal-donation-wordpress-widget/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Optimize and style Contact Form 7 for WordPress</title>
		<link>http://wpstorm.net/2009/06/optimize-style-contact-form-7-wordpress/</link>
		<comments>http://wpstorm.net/2009/06/optimize-style-contact-form-7-wordpress/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 12:52:04 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Contact]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Tweak]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=244</guid>
		<description><![CDATA[One of my favorite WordPress plugins is Contact Form 7 which I use on several of my WordPress based sites. Even though it&#8217;s highly customizable and configurable I have a few gripes with some hard coded functions in it. You can always edit the plugin file, which I did at first, but then you have ...]]></description>
			<content:encoded><![CDATA[<p>One of my favorite WordPress plugins is <a title="Contact Form for WordPress" href="http://ideasilo.wordpress.com/2007/04/30/contact-form-7/">Contact Form 7</a> which I use on several of my WordPress based sites. Even though it&#8217;s highly customizable and configurable I have a few gripes with some hard coded functions in it. You can always edit the plugin file, which I did at first, but then you have to reapply your edits every time the plugin gets updated, which can be cumbersome as this plugin gets updated quite often. So instead of keep editing the plugin file on every update I created some overrides instead.</p>
<h3>The Issues</h3>
<ul>
<li>The url to the AJAX loader symbol is hardcoded into the plugin, so if you don&#8217;t use a white background in your theme the loading symbol looks quite ugly. If you replace the default icon with your own it gets overwritten on each plugin update.</li>
<li>The javascripts for the plugin gets loaded on every single page of the site no matter if the plugin is used or not on that page, which adds unnecessary loading time where it&#8217;s not needed.</li>
<li>The path to the stylesheet for the validation and submit messages is also hardcoded into the plugin, and if you edit the stylesheet to fit your theme, the edits gets lost on each update, and you have to reupload your custom stylesheet for the plugin.</li>
</ul>
<h3>The Solutions</h3>
<p>So to not have to edit the plugin file, I added a few overrides in my theme&#8217;s functions.php file instead to change the behaviour of the plugin where needed.</p>
<p>Let&#8217;s start by taking care of the AJAX loading symbol. To change the path to the gif file I use a regular expression to update the url.</p>
<pre class="brush: php; title: ; notranslate">// Change the URL to the ajax-loader image
function change_wpcf7_ajax_loader($content) {
	if ( is_page('contact') ) {
		$string = $content;
		$pattern = '/(&lt;img class=&quot;ajax-loader&quot; style=&quot;visibility: hidden;&quot; alt=&quot;ajax loader&quot; src=&quot;)(.*)(&quot; \/&gt;)/i';
		$replacement = &quot;$1&quot;.get_template_directory_uri().&quot;/images/ajax-loader.gif$3&quot;;
		$content =  preg_replace($pattern, $replacement, $string);
	}
	return $content;
}
add_filter( 'the_content', 'change_wpcf7_ajax_loader', 100 );</pre>
<p>This function filters the content, tracks down the AJAX loader tag and replaces the URL with a path to the current {theme folder}/images/ajax-loader.gif. So you can have your own custom AJAX loader stored in your theme folder instead, untouched on each plugin update. I added the if( is_page(contact) ) {} to the function to make sure the filter only runs on pages where needed, to not waste CPU cycles on pages where the plugin is not used. Contact is the name of the page where I use the form, change it to the name, or names of pages where you use the plugin.</p>
<p>Okay, now let&#8217;s see take care of the script loading on each page of the site.</p>
<pre class="brush: php; title: ; notranslate">// Add the Contact Form 7 scripts on selected pages
function add_wpcf7_scripts() {
	if ( is_page('contact') )
		wpcf7_enqueue_scripts();
}
if ( ! is_admin() &amp;&amp; WPCF7_LOAD_JS )
	remove_action( 'init', 'wpcf7_enqueue_scripts' );
add_action( 'wp', 'add_wpcf7_scripts' );</pre>
<p>This function removes the call to add the Contact Form 7 scripts on every page, and then adds back the call where needed, in my case I add them back at the page called contact, but change that to whatever works for you.</p>
<p>And finally, let&#8217;s deal with the stylesheet.</p>
<pre class="brush: php; title: ; notranslate">function remove_wpcf7_stylesheet() {
	remove_action( 'wp_head', 'wpcf7_wp_head' );
}
add_action( 'init' , 'remove_wpcf7_stylesheet' );</pre>
<p>Here I actually remove the call to the stylesheet completely. As I have made my own style that fits my theme, I don&#8217;t use the default stylings. If you use the default stylings but just want it to load where needed, you could use an is_page condition like on the loading of the scripts. I could have put the Contact Form 7 Stylesheet in the theme folder using the same technique as on the AJAX loader to leave it untouched on a plugin update, but as I like to keep the calls to external files to a minimum to have the site load as fast as possible, I just put the WPCF7 CSS styles directly in my default style.css of my theme instead and got rid of the plugin stylesheet loading.</p>
<h3>The Final Code</h3>
<p>And here is what the final code looks like, ready to get pasted into the functions.php file in the theme you are using.</p>
<pre class="brush: php; title: ; notranslate">/**
 * Functions:	Optimize and style Contact Form 7 - WPCF7
 *
 */
// Remove the default Contact Form 7 Stylesheet
function remove_wpcf7_stylesheet() {
	remove_action( 'wp_head', 'wpcf7_wp_head' );
}

// Add the Contact Form 7 scripts on selected pages
function add_wpcf7_scripts() {
	if ( is_page('contact') )
		wpcf7_enqueue_scripts();
}

// Change the URL to the ajax-loader image
function change_wpcf7_ajax_loader($content) {
	if ( is_page('contact') ) {
		$string = $content;
		$pattern = '/(&lt;img class=&quot;ajax-loader&quot; style=&quot;visibility: hidden;&quot; alt=&quot;ajax loader&quot; src=&quot;)(.*)(&quot; \/&gt;)/i';
		$replacement = &quot;$1&quot;.get_template_directory_uri().&quot;/images/ajax-loader.gif$3&quot;;
		$content =  preg_replace($pattern, $replacement, $string);
	}
	return $content;
}

// If the Contact Form 7 Exists, do the tweaks
if ( function_exists('wpcf7_contact_form') ) {
	if ( ! is_admin() &amp;&amp; WPCF7_LOAD_JS )
		remove_action( 'init', 'wpcf7_enqueue_scripts' );

	add_action( 'wp', 'add_wpcf7_scripts' );
	add_action( 'init' , 'remove_wpcf7_stylesheet' );
	add_filter( 'the_content', 'change_wpcf7_ajax_loader', 100 );
}</pre>
<p>This tweak was published when Contact Form 7 was at version 1.10, and should continue to work just fine as long as no major changes is made to the inner workings of the plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2009/06/optimize-style-contact-form-7-wordpress/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>PayPal Donations version 1.1</title>
		<link>http://wpstorm.net/2009/05/paypal-donations-wordpress-v11/</link>
		<comments>http://wpstorm.net/2009/05/paypal-donations-wordpress-v11/#comments</comments>
		<pubDate>Sat, 23 May 2009 10:01:07 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=216</guid>
		<description><![CDATA[I just updated PayPal Donations for WordPress to version 1.1 and it&#8217;s now available for download from the WordPress plugin repository and through the automatic update system. New in version 1.1 Added an option to select the currency to make the donations in. Changed the default button in a new install from a custom button ...]]></description>
			<content:encoded><![CDATA[<p>I just updated <a title="PayPal Donations for WordPress" href="http://wpstorm.net/wordpress-plugins/paypal-donations/">PayPal Donations</a> for WordPress to version 1.1 and it&#8217;s now available for download from the WordPress plugin repository and through the automatic update system.</p>
<h3>New in version 1.1</h3>
<ul>
<li>Added an option to select the currency to make the donations in.</li>
<li>Changed the default button in a new install from a custom button to the large button.</li>
</ul>
<p>Enjoy and cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2009/05/paypal-donations-wordpress-v11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PayPal Donations for WordPress</title>
		<link>http://wpstorm.net/2009/05/paypal-donation-button-wordpress/</link>
		<comments>http://wpstorm.net/2009/05/paypal-donation-button-wordpress/#comments</comments>
		<pubDate>Sat, 09 May 2009 00:39:36 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=196</guid>
		<description><![CDATA[I just released my second WordPress plugin &#8211; PayPal Donations. This plugin let&#8217;s you in a simple and straightforward way add a PayPal donation button to posts and pages on your site with a shortcode. The plugin comes with a few options, like selecting what button to display and a few other useful, optional, settings. ...]]></description>
			<content:encoded><![CDATA[<p>I just released my second WordPress plugin &#8211; <a title="PayPal Donation Plugin for WordPress" href="http://wpstorm.net/wordpress-plugins/paypal-donations/">PayPal Donations</a>. This plugin let&#8217;s you in a simple and straightforward way add a PayPal donation button to posts and pages on your site with a shortcode.</p>
<p>The plugin comes with a few options, like selecting what button to display and a few other useful, optional, settings.</p>
<p>And of course it generates valid XHTML code (which I noted a few other donation plugins don&#8217;t).</p>
<p>I have a few more things planned for this guy, which will come in future updates, but this release gets all the basic parts of the the job done when you need a donation button for your causes or free stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2009/05/paypal-donation-button-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix Symmetry for LightWave 3D</title>
		<link>http://wpstorm.net/2009/04/fix-symmetry-lightwave-3d-lscript-c/</link>
		<comments>http://wpstorm.net/2009/04/fix-symmetry-lightwave-3d-lscript-c/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 20:29:23 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[LightWave 3D]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=114</guid>
		<description><![CDATA[Just a quick heads up. If time allows I have planned to rewrite my Fix Symmetry plugin for LightWave 3D from LScript to a compiled C plugin in 32 and 64 bits versions. I have a few other things planned this weekend as well to complete, but if I get around doing this, I&#8217;ll post ...]]></description>
			<content:encoded><![CDATA[<p>Just a quick heads up.</p>
<p>If time allows I have planned to rewrite my <a title="Fix Symmetry for LightWave 3D" href="http://www.artstorm.net/journal/2008/09/fix-symmetry-lightwave-3d/">Fix Symmetry</a> plugin for LightWave 3D from LScript to a compiled C plugin in 32 and 64 bits versions. I have a few other things planned this weekend as well to complete, but if I get around doing this, I&#8217;ll post an article about some useful techniques when working with LightWave plugin development.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2009/04/fix-symmetry-lightwave-3d-lscript-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Post Snippets Version 1.4</title>
		<link>http://wpstorm.net/2009/04/post-snippets-version-14/</link>
		<comments>http://wpstorm.net/2009/04/post-snippets-version-14/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 12:43:16 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=100</guid>
		<description><![CDATA[I&#8217;m on a roll, and just updated Post Snippets to version 1.4. New in this version is that you can create your own WordPress shortcodes with your snippets as well as making the quicktags optional. Changelog for version 1.4: Added a checkbox for Shortcodes (SC) in the admin panel. When checking this one a dynamic ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m on a roll, and just updated <a title="Post Snippets WordPress Plugin" href="http://wpstorm.net/wordpress-plugins/post-snippets/">Post Snippets</a> to version 1.4.</p>
<p>New in this version is that you can create your own WordPress shortcodes with your snippets as well as making the quicktags optional.</p>
<h3>Changelog for version 1.4:</h3>
<ul>
<li>Added a checkbox for Shortcodes (SC) in the admin panel. When checking this one a dynamic shortcode will be generated and inserted instead of the snippet, which allows snippets to be updated later on for all posts it&#8217;s been inserted into when using this option.</li>
<li>Added a checkbox for Quicktags (QT) in the admin panel, so Quicktags are optional. Speeds up loading of the post editor if you don&#8217;t need the quicktag support, and only use the visual editor. Defaults to off.</li>
</ul>
<p>I have a few things that I&#8217;ll polish with the new shortcode function, like adding default variable settings and a few other things. So there will be another update not to far away, and then I think this plugin is pretty feature complete of what I wanted to do with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2009/04/post-snippets-version-14/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Post Snippets Version 1.3.5</title>
		<link>http://wpstorm.net/2009/04/post-snippets-version-135/</link>
		<comments>http://wpstorm.net/2009/04/post-snippets-version-135/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 00:34:29 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=96</guid>
		<description><![CDATA[Just a heads up that I just updated Post Snippets for WordPress to version 1.3.5 with a few minor fixes.]]></description>
			<content:encoded><![CDATA[<p>Just a heads up that I just updated <a title="Post Snippets Plugin for WordPress" href="http://wpstorm.net/wordpress-plugins/post-snippets/">Post Snippets for WordPress</a> to version 1.3.5 with a few minor fixes.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2009/04/post-snippets-version-135/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Post Snippets version 1.3</title>
		<link>http://wpstorm.net/2009/04/post-snippets-version-13/</link>
		<comments>http://wpstorm.net/2009/04/post-snippets-version-13/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 00:02:53 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=87</guid>
		<description><![CDATA[I just updated Post Snippets for WordPress to version 1.3. A few minor changes in this update: Fixed a problem with the regular expressions that prohibited variables consisting of just a single number to work. (Thanks to Javier for the report) Updated the Help info in the admin page to take less space. Included a ...]]></description>
			<content:encoded><![CDATA[<p>I just updated <a title="Post Snippets Plugin for WordPress" href="http://wpstorm.net/wordpress-plugins/post-snippets/">Post Snippets for WordPress</a> to version 1.3. A few minor changes in this update:</p>
<ul>
<li>Fixed a problem with the regular expressions that prohibited variables consisting of just a single number to work. (Thanks to <a title="EspacioRed" href="http://www.espaciored.net/">Javier</a> for the report)</li>
<li>Updated the Help info in the admin page to take less space.</li>
<li>Included a check so the plugin only runs in WP 2.7 or newer.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2009/04/post-snippets-version-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Post Snippets version 1.2</title>
		<link>http://wpstorm.net/2009/04/post-snippets-version-12/</link>
		<comments>http://wpstorm.net/2009/04/post-snippets-version-12/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 11:28:32 +0000</pubDate>
		<dc:creator>Lotta</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://wpstorm.net/?p=80</guid>
		<description><![CDATA[My WordPress plugin Post Snippets where just released in version 1.2. New in this version is that I added support for Quicktags so the snippets are available if you use the editor in HTML mode and not only in the Visual mode.]]></description>
			<content:encoded><![CDATA[<p>My WordPress plugin <a title="Post Snippets Plugin for WordPress" href="http://wpstorm.net/wordpress-plugins/post-snippets/">Post Snippets</a> where just released in version 1.2.</p>
<p>New in this version is that I added support for Quicktags so the snippets are available if you use the editor in HTML mode and not only in the Visual mode.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpstorm.net/2009/04/post-snippets-version-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

