<?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>RuslanY Blog &#187; WordPress</title>
	<atom:link href="http://ruslany.net/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://ruslany.net</link>
	<description>IIS, FastCGI, PHP and other interesting stuff</description>
	<lastBuildDate>Fri, 30 Jul 2010 23:07:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Install PHP applications with WebMatrix</title>
		<link>http://ruslany.net/2010/07/install-php-applications-with-webmatrix/</link>
		<comments>http://ruslany.net/2010/07/install-php-applications-with-webmatrix/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 20:45:10 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WebMatrix]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=791</guid>
		<description><![CDATA[Microsoft has recently launched a beta release of a new project called WebMatrix. This is a complete web development stack that can be used to start developing and deploying web sites. One thing that may be not so obvious from all the existing announcements is the fact that WebMatrix has full support for installing, running and [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft has recently launched a beta release of a new project called <a href="http://www.microsoft.com/web/webmatrix/">WebMatrix</a>. This is a complete web development stack that can be used to start developing and deploying web sites. One thing that may be not so obvious from all the existing announcements is the fact that WebMatrix has full support for installing, running and publishing PHP applications.</p>
<p>Here are the examples of how WebMatrix can be used to create and publish a PHP web site (using WordPress as a showcase).<span id="more-791"></span></p>
<h3>Installing a PHP application</h3>
<p>After installing and launching WebMatrix select “Site from Web Gallery” option and then pick WordPress:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix3.png"><img class="alignnone size-medium wp-image-796 screenshot" title="Select a PHP application in Web Gallery" src="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix3-400x285.png" alt="" width="400" height="285" /></a></p>
<p>Follow the installation steps as described in <a href="http://learn.iis.net/page.aspx/863/download-and-install-a-php-application/">Download and Install a PHP application</a>. As you proceed you will notice that WebMatrix downloads and installs the necessary components for running WordPress – the latest version of PHP 5.2 and MySQL. At the end of the installation process you will get a working instance of WordPress, that you can configure and customize further:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix9.png"><img class="alignnone size-medium wp-image-797 screenshot" title="WordPress in Web Browser" src="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix9-400x316.png" alt="" width="400" height="316" /></a></p>
<p>Notice the port number used in the URL. This is not the standard port 80 used by default in IIS. The site is not running on IIS that is included with operating system. Instead WebMatrix installs and uses <a href="http://blogs.iis.net/vaidyg/archive/2010/07/06/introducing-iis-developer-express.aspx">IIS Developer Express</a>, which is a developer-focused version of IIS that runs on all versions of Windows, starting from Windows XP. This is actually very cool because now it is possible to get the latest and greatest IIS features on Windows XP instead of using the good old IIS 5.1 as development web server <img src='http://ruslany.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . But even if you already have Windows 7, you may still want to use IIS Developer Express, because with that you do not need to enable real IIS Web Server included with OS on your development machine.</p>
<p>Even though IIS Developer Express is a lightweight development server it comes with everything needed to run PHP applications, including the latest version of FastCGI module and URL Rewrite 2.0. This means that after you install WordPress with WebMatrix you can enable WordPress’ pretty permalinks by following the instructions at <a href="http://ruslany.net/2009/05/iis-7-url-rewrite-module-support-in-wordpress-28/">IIS URL Rewrite Module support in WordPress</a>.</p>
<blockquote><p><strong>Note</strong>: By default WebMatrix and IIS Developer Express are not configured to run PHP even if PHP is already installed on the machine. To work this around  install any PHP application via WebMatrix UI. This way WebMatrix will configure IIS Developer Express to handle PHP requests. This is something that will be fixed in future releases of WebMatrix.</p></blockquote>
<h3>Modifying a PHP application</h3>
<p>After the WordPress is installed there are several things you can do with it from within WebMatrix. For example you can edit the theme files by using the built-in editor:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix12.png"><img class="alignnone size-medium wp-image-798 screenshot" title="Modify the WordPress theme file" src="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix12-400x344.png" alt="" width="400" height="344" /></a></p>
<p>You can check what kind of HTTP requests are made by Web Browser to load a typical WordPress page:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix13.png"><img class="alignnone size-medium wp-image-799 screenshot" title="Check HTTP Requests" src="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix13-400x260.png" alt="" width="400" height="260" /></a></p>
<p>(Learn more about this feature at <a href="http://learn.iis.net/page.aspx/867/analyze-your-website/">Using WebMatrix Beta: Analyze Your WebSite</a>)</p>
<p>Also, you can check the WordPress database content by using the WebMatrix Database Manager:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix15.png"><img class="alignnone size-medium wp-image-803 screenshot" title="Check WordPress Database Content" src="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix15-400x262.png" alt="" width="400" height="262" /></a></p>
<p>And, finally, you can run the search engine optimization analysis and fix any SEO violations found within the application:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix14.png"><img class="alignnone size-medium wp-image-800 screenshot" title="Search Engine Optimization" src="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix14-400x242.png" alt="" width="400" height="242" /></a></p>
<p>(Learn more about this feature at <a href="http://learn.iis.net/page.aspx/866/make-your-website-seo-friendly/">Using WebMatrix Beta: Make your Website SEO Friendly</a>)</p>
<h3>Publishing a PHP application</h3>
<p>The last step is the publishing of the web application on a live web server. WebMatrix can publish the content to a web server by using various protocols: FTP, FTP/SSL and WebDeploy (note that FTP protocols cannot be used to publish MySQL database). You can pick a hosting provider from the list offered by WebMatrix or you if you know the publishing settings from your hosting provider you can manually enter them in WebMatrix.</p>
<p><a href="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix17.png"><img class="alignnone size-medium wp-image-807 screenshot" title="Publish to a hosting web site" src="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix17-400x307.png" alt="" width="400" height="307" /></a></p>
<p>When you publish the content the WebMatrix will show you the list of files and the database that will be uploaded to the server. Note also that during publishing the WebMatrix will replace the current database connection settings in <strong>wp-config.php</strong>file with the connection settings used on a hosting web server. WebMatrix will extract that information from the connection string that you specify in publishing settings:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix18.png"><img class="alignnone size-medium wp-image-808 screenshot" title="WebMatrix18" src="http://ruslany.net/wp-content/uploads/2010/07/WebMatrix18-400x307.png" alt="" width="400" height="307" /></a></p>
<p>(Learn more about publishng web sites at <a href="http://learn.iis.net/page.aspx/871/publish-your-website/">Using WebMatrix Beta: Publish Your WebSite</a>)</p>
<h3>Feedback and suggestions</h3>
<p>The WebMatrix is a beta release and the WebMatrix team is open to any constructive feedback on how to improve the product. Do you have any suggestions or have you run into any problems when using WebMatrix? What PHP related features would you like to see in this product? Please let the team know by starting the thread on <a href="http://forums.iis.net/1166.aspx">WebMatrix forum</a> or by leaving a comment here.</p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2010/07/install-php-applications-with-webmatrix/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Make WordPress faster on IIS with WinCache 1.1</title>
		<link>http://ruslany.net/2010/03/make-wordpress-faster-on-iis-with-wincache-1-1/</link>
		<comments>http://ruslany.net/2010/03/make-wordpress-faster-on-iis-with-wincache-1-1/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 00:12:42 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WinCache]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=673</guid>
		<description><![CDATA[This post explains how to improve performance of WordPress on Windows by using the WinCache Extension 1.1 – Beta for PHP. You probably already know that just by enabling the WinCache extension and without any code changes it is possible to get a significant increase in WordPress performance – this is described in details in [...]]]></description>
			<content:encoded><![CDATA[<p>This post explains how to improve performance of WordPress on Windows by using the WinCache Extension 1.1 – Beta for PHP. You probably already know that just by enabling the WinCache extension and without any code changes it is possible to get a significant increase in WordPress performance – this is described in details in <a href="http://techportal.ibuildings.com/2009/11/19/php-on-windows-the-wincache-1-0-benchmark/">PHP on Windows: The WinCache 1.0 Benchmark</a>. But this can be taken even further by using the <a href="http://www.php.net/manual/en/ref.wincache.php">user cache API’s</a> available in WinCache 1.1 release.<span id="more-673"></span></p>
<p>To configure WordPress to use WinCache user cache API’s copy the following code and put it in the file named <strong>object-cache.php</strong> located at the <strong>/wp-content/</strong> directory of your WordPress site. Note that this code was copied from <a href="http://txfx.net/files/wordpress/apc-object-cache.phps">here</a> and the only change was to replace all the APC cache function with corresponding WinCache functions.</p>
<pre name="code" class="php">
&lt;?php

/*
Name: WinCache Cache
Description: WinCache backend for the WP Object Cache.
Version: 0.1
URI: http://ruslany.net/
Author: Ruslan Yakushev

Install this file to wp-content/object-cache.php

Big thanks to Mark Jaquith (http://markjaquith.wordpress.com/)
whose apc-object-cache.php was used as a basis for this code.
*/

// gracefully revert to default cache if WinCache is not installed
if ( !extension_loaded(&#039;wincache&#039;) ||
      !function_exists(&#039;wincache_ucache_get&#039;) ||
      strcmp(ini_get(&#039;wincache.ucenabled&#039;), &quot;1&quot;) )  {
 include_once(ABSPATH . WPINC . &#039;/cache.php&#039;);
} else {

function wp_cache_add($key, $data, $flag = &#039;&#039;, $expire = 0) {
  global $wp_object_cache;
  return $wp_object_cache-&gt;add($key, $data, $flag, $expire);
}

function wp_cache_close() {
  return true;
}

function wp_cache_delete($id, $flag = &#039;&#039;) {
  global $wp_object_cache;
  return $wp_object_cache-&gt;delete($id, $flag);
}

function wp_cache_flush() {
  global $wp_object_cache;

  return $wp_object_cache-&gt;flush();
}

function wp_cache_get($id, $flag = &#039;&#039;) {
  global $wp_object_cache;
  return $wp_object_cache-&gt;get($id, $flag);
}

function wp_cache_init() {
  global $wp_object_cache;
  $wp_object_cache = new WP_Object_Cache();
}

function wp_cache_replace($key, $data, $flag = &#039;&#039;, $expire = 0) {
  global $wp_object_cache;
  return $wp_object_cache-&gt;replace($key, $data, $flag, $expire);
}

function wp_cache_set($key, $data, $flag = &#039;&#039;, $expire = 0) {
  global $wp_object_cache;
  return $wp_object_cache-&gt;set($key, $data, $flag, $expire);
}

class WP_Object_Cache {
  var $global_groups = array (&#039;users&#039;, &#039;userlogins&#039;, &#039;usermeta&#039;);
  var $cache = array ();

  function add($id, $data, $group = &#039;default&#039;, $expire = 0) {
    return $this-&gt;set($id, $data, $group, $expire);
  }

  function delete($id, $group = &#039;default&#039;) {
    $key = $this-&gt;key($id, $group);
    $result = wincache_ucache_delete($key);
    if ( false !== $result )
      unset($this-&gt;cache[$key]);
    return $result;
  }

  function flush() {
    wincache_ucache_clear();
    return true;
  }

  function get($id, $group = &#039;default&#039;) {
    $key = $this-&gt;key($id, $group);
     if ( isset($this-&gt;cache[$key]) )
      $value = $this-&gt;cache[$key];
    else
      $value = wincache_ucache_get($key);
    /* echo &quot;Cache key: $key&lt;br/&gt;&quot;;
    echo &#039;Cache value:&lt;br/&gt;&#039;;
    var_dump($value);
    echo &#039;&lt;br/&gt;&#039;; */
    if ( NULL === $value )
      $value = false;
    $this-&gt;cache[$key] = $value;
    return $value;
  }

  function key($key, $group) {
    global $blog_id;
    if ( empty($group) )
      $group = &#039;default&#039;;
    if (false !== array_search($group, $this-&gt;global_groups))
      $prefix = &#039;&#039;;
    else
      $prefix = $blog_id . &#039;:&#039;;
    return md5(ABSPATH . &quot;$prefix$group:$key&quot;);
  }

  function replace($id, $data, $group = &#039;default&#039;, $expire = 0) {
    return $this-&gt;set($id, $data, $group, $expire);
  }

  function set($id, $data, $group = &#039;default&#039;, $expire = 0) {
    $key = $this-&gt;key($id, $group);
    $result = wincache_ucache_set($key, $data, $expire);
    if ( false !== $result )
      $this-&gt;cache[$key] = $data;
    return $result;
  }

  function stats() {
    $wincache_info = wincache_ucache_info();
    echo &quot;&lt;p&gt;\n&quot;;
    echo &quot;&lt;strong&gt;Cache Hits:&lt;/strong&gt; {$wincache_info[&#039;total_hit_count&#039;]}&lt;br/&gt;\n&quot;;
    echo &quot;&lt;strong&gt;Cache Misses:&lt;/strong&gt; {$wincache_info[&#039;total_miss_count&#039;]}&lt;br/&gt;\n&quot;;
    echo &quot;&lt;/p&gt;\n&quot;;
    if ( ! empty($this-&gt;cache) ) {
      echo &quot;&lt;pre&gt;\n&quot;;
      print_r($this-&gt;cache);
      echo &quot;&lt;/pre&gt;\n&quot;;
    }
  }

  function WP_Object_Cache() {
   // Nothing here
  }
 }
}
?&gt;
</pre>
<p>You can also download the code by using the link below:</p>
<p><a href="http://ruslany.net/download/object-cache.zip" title="Version 0.1 downloaded 181 times" >Object Cache for WordPress</a></p>
<p>Make sure that the code is saved in a file called <strong>object-cache.php</strong> inside of the <strong>/wp-content/</strong> directory.</p>
<p>That should be all you need to do. To verify that the WordPress is actually using the object cache use the <a href="http://www.php.net/manual/en/wincache.stats.php">WinCache Statistics Script</a> and check the “<strong>User and Session Cache</strong>” page:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2010/03/WinCache_UserCache.png"><img class="alignnone size-medium wp-image-680 screenshot" title="WinCache-UserCache" src="http://ruslany.net/wp-content/uploads/2010/03/WinCache_UserCache-500x390.png" alt="" width="500" height="390" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2010/03/make-wordpress-faster-on-iis-with-wincache-1-1/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>New release of Silverlight Player for WordPress</title>
		<link>http://ruslany.net/2009/08/new-release-of-silverlight-player-for-wordpress/</link>
		<comments>http://ruslany.net/2009/08/new-release-of-silverlight-player-for-wordpress/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 22:11:56 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=501</guid>
		<description><![CDATA[Today I have published a new release of the WP Silverlight Media Player plugin for WordPress. In addition to a few important improvements and optimizations, it contains a new feature that allows to track the number of times the video files have been watched and how many of those have been watched until the end. [...]]]></description>
			<content:encoded><![CDATA[<p>Today I have published a new release of the <a title="Silverlight Media Player plugin" href="http://ruslany.net/wp-media-player/">WP Silverlight Media Player plugin</a> for WordPress. In addition to a few important improvements and optimizations, it contains a new feature that allows to track the number of times the video files have been watched and how many of those have been watched until the end.</p>
<p>Once you install or upgrade to this version of the plugin you should see a new menu group in the WordPress Dashboard:<span id="more-501"></span></p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/08/MediaPlayerMenu.png"><img class="alignnone size-full wp-image-502 screenshot" title="Media Player Menu Group" src="http://ruslany.net/wp-content/uploads/2009/08/MediaPlayerMenu.png" alt="Media Player Menu Group" width="174" height="182" /></a></p>
<p>From that menu you can get to the Statistics page where you can see how many times your site visitors watched your video files:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/08/MediaPlayerStats.png"><img class="alignnone size-medium wp-image-503 screenshot" title="Media Player Statistics Page" src="http://ruslany.net/wp-content/uploads/2009/08/MediaPlayerStats-500x212.png" alt="Media Player Statistics Page" width="500" height="212" /></a></p>
<p>The implementation idea for the statistics page was re-used from the <a title="WP-Postratings plugin for WordPress" href="http://wordpress.org/extend/plugins/wp-postratings/" target="_blank">WP-Postratings</a>, which is a very popular plugin written by Lester &#8216;GaMerZ&#8217; Chan.</p>
<p>Other improvements in this version include:</p>
<ul>
<li>Minified JavaScript files for the player, which will help reduce the download time;</li>
<li>Fixed incompatibility bug with NextGen Gallery plugin;</li>
<li>Complete localization support and translation into Russian (ru_RU).</li>
</ul>
<p>Download the latest version of the plugin from the <a title="WP Silverlight Media Player" href="http://wordpress.org/extend/plugins/wp-media-player/" target="_blank">plugin page</a> at WordPress plugin directory. To get more information about the plugin refer to the following resources:</p>
<ul>
<li><a title="WP Media Player usage instructions" href="http://ruslany.net/wp-media-player/">Usage instructions</a></li>
<li><a title="Video Content Encoding with Windows Media Encoder" href="http://ruslany.net/wp-media-player/video-encoding/">How to encode video content for the WP Media Player</a></li>
<li><a title="Changelog" href="http://ruslany.net/wp-media-player/changelog/">Changelog</a></li>
<li><a title="WP Media Player Download Statistics" href="http://wordpress.org/extend/plugins/wp-media-player/stats/" target="_blank">Download statistics</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2009/08/new-release-of-silverlight-player-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Upgrade to WordPress 2.8 and PHP 5.3 on IIS 7</title>
		<link>http://ruslany.net/2009/06/upgrade-to-wordpress-2-8-and-php-5-3-on-iis-7/</link>
		<comments>http://ruslany.net/2009/06/upgrade-to-wordpress-2-8-and-php-5-3-on-iis-7/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 06:46:56 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[URLRewrite]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=410</guid>
		<description><![CDATA[Today I have upgraded my blog to the recently released WordPress 2.8 and to PHP 5.3 RC3 (VC9 Non Thread Safe build). If you are running WordPress (or any other PHP application) on IIS 7, then there are several reasons why it may be beneficial for you to upgrade: PHP 5.3 has a number of [...]]]></description>
			<content:encoded><![CDATA[<p>Today I have upgraded my blog to the recently released <a href="http://wordpress.org/download/" target="_blank">WordPress 2.8</a> and to <a href="http://windows.php.net/qa/" target="_blank">PHP 5.3 RC3</a> (VC9 Non Thread Safe build). If you are running WordPress (or any other PHP application) on IIS 7, then there are several reasons why it may be beneficial for you to upgrade:</p>
<ul>
<li>PHP 5.3 has a number of <a href="http://blogs.iis.net/mailant/archive/2009/05/18/contributions-to-the-php-engine.aspx" target="_blank">Windows-specific bug fixes and improvements</a> that address stability and functionality problems which existed before when running PHP on Windows. For detailed list of all the changes and fixes, refer to the news.txt file included within the PHP zip file.</li>
<li>PHP 5.3 has been compiled with the latest version of C compiler (VC9), which makes it run faster on Windows than any previous versions of PHP (which were compiled with VC6).</li>
<li>WordPress 2.8 has built-in support for <a href="http://www.iis.net/extensions/URLRewrite" target="_blank">IIS 7 URL Rewrite Module</a>. Refer to <a href="http://ruslany.net/2009/05/iis-7-url-rewrite-module-support-in-wordpress-28/" target="_blank">IIS 7 URL Rewrite Module support in WordPress 2.8</a> for more details.</li>
</ul>
<p>Overall, the upgrade went pretty smoothly and the only thing that was different from the usual process of <a href="http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/" target="_blank">setting up PHP on Windows</a> was the <strong><a href="http://us.php.net/manual/en/timezones.php" target="_blank">date.timezone</a></strong> setting in php.ini file. Starting with PHP 5.3, this setting must be explicitly set, e.g.:</p>
<pre name="code" class="dos">
date.timezone = America/Los_Angeles
</pre>
<p>After this successful upgrade I guess it is time now “<a href="http://codex.wordpress.org/Upgrading_WordPress#Step_3:_Do_something_nice_for_yourself" target="_blank">to reward myself</a> by reading that book or an article that I’ve been putting off, or simply sitting back for a few moments and let the world pass me by”.</p>
<p>Have you tried upgrading to PHP 5.3 on IIS recently? What was your experience?</p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2009/06/upgrade-to-wordpress-2-8-and-php-5-3-on-iis-7/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>IIS 7 URL Rewrite Module support in WordPress 2.8</title>
		<link>http://ruslany.net/2009/05/iis-7-url-rewrite-module-support-in-wordpress-28/</link>
		<comments>http://ruslany.net/2009/05/iis-7-url-rewrite-module-support-in-wordpress-28/#comments</comments>
		<pubDate>Sat, 16 May 2009 07:41:05 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[URLRewrite]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=393</guid>
		<description><![CDATA[I am pleased to let everyone know that WordPress development community has added a built-in support for IIS 7 URL Rewrite Module in the upcoming WordPress 2.8 release. Starting with version 2.8 the Permalink Settings page will allow you to easily configure “Pretty Permalinks” URL structure when WordPress is running on IIS 7 with URL Rewrite Module v1.1 installed. [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to let everyone know that WordPress development community has added a built-in support for <a title="URL Rewrite Module 1.1 for IIS 7" href="http://www.iis.net/extensions/URLRewrite" target="_blank">IIS 7 URL Rewrite Module</a> in the upcoming WordPress 2.8 release. Starting with version 2.8 the Permalink Settings page will allow you to easily configure “<a title="WordPress Pretty Permalinks" href="http://codex.wordpress.org/Using_Permalinks" target="_blank">Pretty Permalinks</a>” URL structure when WordPress is running on IIS 7 with URL Rewrite Module v1.1 installed.</p>
<p>Here is how the process of updating Permalinks structure will look like in WordPress 2.8 on IIS 7: <span id="more-393"></span></p>
<ol>
<li>Go to Settings –&gt; Permalinks page and choose the permalink structure that you prefer:<br />
<a href="http://ruslany.net/wp-content/uploads/2009/05/wp-permalinks-patch.png"><img class="alignnone size-medium wp-image-394 screenshot" title="Permalink Settings page with Pretty Permalinks" src="http://ruslany.net/wp-content/uploads/2009/05/wp-permalinks-patch-500x495.png" alt="Permalink Settings page with Pretty Permalinks" width="500" height="495" /></a></li>
<li>After clicking on “Save Changes” button the generated rewrite rule will be displayed with the instructions on how to update the web.config file manually:<br />
<a href="http://ruslany.net/wp-content/uploads/2009/05/wp-permalinks-patch1.png"><img class="alignnone size-medium wp-image-395 screenshot" title="Permalink Settings Page with rewrite rule example" src="http://ruslany.net/wp-content/uploads/2009/05/wp-permalinks-patch1-500x446.png" alt="Permalink Settings Page with rewrite rule example" width="500" height="446" /></a></li>
<li>Now you can copy the the given XML and put it into the web.config file inside of /&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt; element and that’s it!</li>
<li><strong>Alternatively </strong>– instead of manually editing the web.config file you can have WordPress to update it automatically for you. To do that, temporarily grant WordPress write access to web.config file and click on “Save Changes” again. WordPress will add its rewrite rule into the proper location inside of the web.config file. <strong>Do not forget</strong> to revert the write permission on web.config file after the rule has been saved.</li>
</ol>
<p>If you want to try this functionality, as well as all the other new features in the upcoming WordPress 2.8 release, you can <a title="Download the latest nightly build of WordPress" href="http://wordpress.org/nightly-builds/wordpress-latest.zip" target="_self">download the latest nightly build</a>. Also, pretty soon the 2.8 beta will be available.</p>
<p>Thanks to the WordPress development community for adding this functionality! Specifically, big thanks to <a title="peaceable_whale blog" href="https://peaceable-whale.pip.verisignlabs.com/" target="_blank">peaceablewhale</a>, <a title="Denis-de-Bernardy on Twitter" href="http://twitter.com/ddebernardy/" target="_blank">Denis-de-Bernardy</a>, <a title="hakre on WordPress codex" href="http://codex.wordpress.org/User:Hakre" target="_blank">hakre</a>, <a title="sivel.net blog" href="http://sivel.net/" target="_blank">sivel</a> and <a title="boren.nu blog" href="http://boren.nu/" target="_blank">ryan</a> for directly working on the <a title="WordPress ticket" href="http://core.trac.wordpress.org/ticket/8974" target="_blank">patch </a>and contributing to it in many different ways: testing, code reviewing, cleaning up the code and checking it in.</p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2009/05/iis-7-url-rewrite-module-support-in-wordpress-28/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Silverlight Media Player for WordPress – Update</title>
		<link>http://ruslany.net/2009/04/silverlight-media-player-for-wordpress-update/</link>
		<comments>http://ruslany.net/2009/04/silverlight-media-player-for-wordpress-update/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 06:33:14 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=367</guid>
		<description><![CDATA[Since the Silverlight Media Player plugin for WordPress was published in January 2009, it has been downloaded more than 900 times. It is being used in many web sites all over the world – here are just a couple of examples: Tribord Amure par Matthieu and Os Taekwon-do Klubb. Today, a new update of the [...]]]></description>
			<content:encoded><![CDATA[<p>Since the <a title="Silverlight Media Player plugin" href="http://wordpress.org/extend/plugins/wp-media-player/" target="_blank">Silverlight Media Player plugin</a> for WordPress was published in January 2009, it has been downloaded more than <a title="Download statistics" href="http://wordpress.org/extend/plugins/wp-media-player/stats/" target="_blank">900 times</a>. It is being used in many web sites all over the world – here are just a couple of examples: <a title="Tribord Amure par Matthieu" href="http://www.tribormat.fr/post/2009/02/03/lvps-shosholoza-pulverise-alinghi/" target="_blank">Tribord Amure par Matthieu</a> and <a title="Os Taekwon-do Klubb" href="http://ostkd-klubb.com/?page_id=87" target="_blank">Os Taekwon-do Klubb</a>. Today, a new update of the plugin has been released. This update makes it even easier to add video content to your blog posts and pages.<span id="more-367"></span></p>
<p>Download the latest version of the plugin from here: <a href="http://ruslany.net/download/wp-media-player.0.8.zip" title="Version 0.8 downloaded 2058 times" >WP Media Player</a>.</p>
<p>The biggest improvement in this version of the plugin is the addition of the user interface for uploading video content and for insertion of the media player into blog posts and pages. Here is how it looks like.</p>
<p>Add a media player to a blog post or a page by clicking on the “Silverlight Video” button:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/04/wpmp_addvideo.png"><img class="alignnone size-full wp-image-351" style="border: 0px;" title="Add Silverlight Video" src="http://ruslany.net/wp-content/uploads/2009/04/wpmp_addvideo.png" alt="Add Silverlight Video" width="492" height="198" /></a></p>
<p>Upload a new video file or specify a URL of the video content:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/04/wpmp_upload.png"><img class="alignnone size-medium wp-image-346" style="border: 0px;" title="Upload media file" src="http://ruslany.net/wp-content/uploads/2009/04/wpmp_upload-499x306.png" alt="Upload media file" width="499" height="306" /></a></p>
<p>Or choose a video file from WordPress media library:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/04/wpmp_library.png"><img class="alignnone size-medium wp-image-369" style="border: 0px;" title="Choose from Media Library" src="http://ruslany.net/wp-content/uploads/2009/04/wpmp_library-500x305.png" alt="Choose from Media Library" width="500" height="305" /></a> </p>
<p>After video content has been chosen, modify media player parameters, if necessary, and then insert the media player into the post:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/04/wpmp_insertvideo.png"><img class="alignnone size-medium wp-image-345" style="border: 0px;" title="Insert Video" src="http://ruslany.net/wp-content/uploads/2009/04/wpmp_insertvideo-500x315.png" alt="Insert Video" width="500" height="315" /></a></p>
<p>More information about the plugin can be found at <a title="WP Media Player - homepage" href="http://ruslany.net/wp-media-player/" target="_self">the plugin homepage</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2009/04/silverlight-media-player-for-wordpress-update/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to secure WordPress admin directory on IIS 7.0</title>
		<link>http://ruslany.net/2009/02/how-to-secure-wordpress-admin-directory-on-iis-70/</link>
		<comments>http://ruslany.net/2009/02/how-to-secure-wordpress-admin-directory-on-iis-70/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 01:00:36 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=199</guid>
		<description><![CDATA[Recently I was told about Smashing Magazine, which turned out to be a pretty useful site. It is targeted for web developers and web designers and it contains tons of information, tools and freebies for web developers. One of the article on that site was about 10 Steps To Protect The Admin Area in WordPress. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was told about <a href="http://www.smashingmagazine.com/">Smashing Magazine</a>, which turned out to be a pretty useful site. It is targeted for web developers and web designers and it contains tons of information, tools and freebies for web developers. One of the article on that site was about <strong>10 Steps To Protect The Admin Area in WordPress</strong>. In that article step #7 described how to use web server’s built-in authentication to provide an extra protection layer for wp-admin directory, where all WordPress admin scripts are located. The article described how to do that in Apache by using .htaccess file. In this post I will explain how to protect WordPress wp-admin directory on IIS 7.0 by using IIS built-in Forms Authentication.<span id="more-199"></span></p>
<h3>Prerequisites</h3>
<p>First thing to make sure is to confirm that IIS Forms authentication and URL authorization modules are installed and enabled on your IIS server. To quickly check that, open an elevated command prompt and run the following commands:</p>
<pre name="code" class="dos">
C:\Windows\System32\inetsrv&gt;appcmd list modules | find &quot;FormsAuthentication&quot;
MODULE &quot;FormsAuthentication&quot; ( type: System.Web.Security.FormsAuthenticationModule,preCondition: )

C:\Windows\System32\inetsrv&gt;appcmd list modules | find &quot;UrlAuthorization&quot;
MODULE &quot;UrlAuthorization&quot; ( type: System.Web.Security.UrlAuthorizationModule, preCondition: managedHandler )
MODULE &quot;UrlAuthorizationModule&quot; ( native, preCondition: )
</pre>
<p>If the output from the commands look similar to above then the necessary modules are installed.</p>
<p>Another thing to ensure is that the WordPress site is hosted in an Application Pool with Integrated Managed Pipeline Mode. To check that run the following command from elevated command prompt (replace &#8220;DefaultAppPool&#8221; with the name of your AppPool if necessary):</p>
<pre name="code" class="dos">
C:\Windows\System32\inetsrv&gt;appcmd list apppools | find &quot;DefaultAppPool&quot;
APPPOOL &quot;DefaultAppPool&quot; (MgdVersion: v2.0,MgdMode: Integrated,state: Started)
</pre>
<p>The output should contain <strong>MgdMode:Integrated</strong>.</p>
<h3>Configuration steps</h3>
<p>Download the zip file below:</p>
<p><a href="http://ruslany.net/download/FormsAuthForWordPress.zip" title="Version 1.0 downloaded 286 times" >IIS Forms Authentication for WordPress (4.1 KB)</a></p>
<p>Extract the two folders &#8211; App_Code and App_Data – into the root folder or your WordPress web site. For example if your WordPress files are located in folder C:\inetpub\wwwroot, then there should be two new files present at the following paths:</p>
<pre name="code" class="dos">
C:\inetpub\wwwroot\App_Code\CustomProvider.cs
C:\inetpub\wwwroot\App_Data\Users.xml
</pre>
<p>The CustomProvider.cs file contains an implementation of membership provider for IIS that uses Users.xml file as a storage for usernames and passwords. To learn more about providers refer to the <a href="http://msdn.microsoft.com/en-us/library/aa479031.aspx">Membership Providers</a> article. The code for CustomProvider.cs was literally copied from that article.</p>
<p>The Users.xml file is a simple credentials storage. Its content looks like below:</p>
<pre name="code" class="xml">
&lt;Users&gt;
  &lt;User&gt;
    &lt;UserName&gt;your_username_here&lt;/UserName&gt;
    &lt;Password&gt;your_password_here&lt;/Password&gt;
    &lt;EMail&gt;user@ruslany.net&lt;/EMail&gt;
  &lt;/User&gt;
&lt;/Users&gt;
</pre>
<blockquote><p><strong>Note</strong> that it is important that this file is located in App_Data directory, because this directory, as well as App_Code, is protected by IIS Request Filtering module, which prevents anyone from requesting any files from these folders.</p>
<p>Also it is important to pick a user name and a password different from the ones that are used for the WordPress authentication.</p></blockquote>
<p>Also extract the Login.aspx file into the root folder of the web site, e.g.:</p>
<pre name="code" class="dos">
C:\inetpub\wwwroot\Login.aspx
</pre>
<p>Now you need to register this custom membership provider and enable Forms authentication. To do that add the following XML configuration element into the &lt;configuration&gt; element inside of the web.config file, located at the root folder of your WordPress site:</p>
<pre name="code" class="xml">
&lt;system.web&gt;
  &lt;authentication mode=&quot;Forms&quot; /&gt;
  &lt;membership defaultProvider=&quot;AspNetReadOnlyXmlMembershipProvider&quot;&gt;
    &lt;providers&gt;
       &lt;add name=&quot;AspNetReadOnlyXmlMembershipProvider&quot;
                type=&quot;ReadOnlyXmlMembershipProvider&quot;
                description=&quot;Read-only XML membership provider&quot;
                xmlFileName=&quot;~/App_Data/Users.xml&quot; /&gt;
    &lt;/providers&gt;
  &lt;/membership&gt;
&lt;/system.web&gt;
</pre>
<p>With the custom provider registered and configured, it is time to configure IIS to protect wp-admin folder with extra authentication that uses this custom provider. To do that add the following XML configuration fragment into the &lt;configuration&gt; element inside of the web.config file, located at the root folder of the WordPress site:</p>
<pre name="code" class="xml">
&lt;!-- Deny access to wp-admin for anonymous users --&gt;
&lt;location path=&quot;wp-admin&quot;&gt;
  &lt;system.webServer&gt;
      &lt;security&gt;
          &lt;authorization&gt;
              &lt;add accessType=&quot;Deny&quot; users=&quot;?&quot; /&gt;
          &lt;/authorization&gt;
      &lt;/security&gt;
  &lt;/system.webServer&gt;
&lt;/location&gt;
&lt;!-- Allow access to wp-admin/css folder for anonymous users --&gt;
&lt;!-- this is needed in order for WordPress login page to display correctly --&gt;
&lt;location path=&quot;wp-admin/css&quot;&gt;
  &lt;system.webServer&gt;
    &lt;security&gt;
      &lt;authorization&gt;
        &lt;remove users=&quot;?&quot; roles=&quot;&quot; verbs=&quot;&quot; /&gt;
      &lt;/authorization&gt;
    &lt;/security&gt;
  &lt;/system.webServer&gt;
&lt;/location&gt;
&lt;!-- Allow access to wp-admin/images folder for anonymous users --&gt;
&lt;!-- this is needed in order for WordPress login page to display correctly --&gt;
&lt;location path=&quot;wp-admin/images&quot;&gt;
  &lt;system.webServer&gt;
    &lt;security&gt;
      &lt;authorization&gt;
        &lt;remove users=&quot;?&quot; roles=&quot;&quot; verbs=&quot;&quot; /&gt;
      &lt;/authorization&gt;
    &lt;/security&gt;
  &lt;/system.webServer&gt;
&lt;/location&gt;
</pre>
<p>Last thing you will need to do is to configure IIS modules that are used for Forms Authentication and for URL authorization to run for all kinds of requests. Both those modules are Managed modules (that is they are implemented using .NET Framework) and by default they are configured to run only for requests that are made for ASP.NET content. In order for them to work with PHP content then need to be configured to run for all requests. This can be done by using the following configuration section. Add it inside of &lt;configuration&gt;/&lt;system.webServer&gt; element:</p>
<pre name="code" class="xml">
&lt;modules&gt;
    &lt;remove name=&quot;UrlAuthorization&quot; /&gt;
    &lt;remove name=&quot;FormsAuthentication&quot; /&gt;
    &lt;remove name=&quot;DefaultAuthentication&quot; /&gt;
    &lt;add name=&quot;DefaultAuthentication&quot;
               type=&quot;System.Web.Security.DefaultAuthenticationModule&quot; preCondition=&quot;&quot; /&gt;
    &lt;add name=&quot;FormsAuthentication&quot;
               type=&quot;System.Web.Security.FormsAuthenticationModule&quot; preCondition=&quot;&quot; /&gt;
    &lt;add name=&quot;UrlAuthorization&quot;
               type=&quot;System.Web.Security.UrlAuthorizationModule&quot; preCondition=&quot;&quot; /&gt;
&lt;/modules&gt;
</pre>
<p>At this point the WordPress wp-admin directory is protected by IIS Forms Authentication in addition to the standard WordPress authentication. Update the users.xml file with the username and password of your choice and then try to request <strong>http://localhost/wp-admin/.</strong> The IIS Forms Authentication logon page will be shown first:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/02/formsauthpage.png"><img style="display: inline; border-width: 0px;" title="FormsAuthPage" src="http://ruslany.net/wp-content/uploads/2009/02/formsauthpage-thumb.png" border="0" alt="FormsAuthPage" width="504" height="330" /></a></p>
<p>Once you provided the user name and password as specified in users.xml file, the standard WordPress login page will be shown next. In that page you can provide your WordPress logon credentials:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/02/wordpressauth.png"><img style="display: inline; border-width: 0px;" title="WordPressAuth" src="http://ruslany.net/wp-content/uploads/2009/02/wordpressauth-thumb.png" border="0" alt="WordPressAuth" width="488" height="379" /></a></p>
<p>Now the entire content of the wp-admin directory is protected by two different authentication mechanisms, which makes it harder for anyone to hack into it. And the nice thing about this configuration is that it can be done even if your site is hosted on a shared server. All that is necessary is to have ASP.NET and IIS URL authorization enabled on a shared server by a shared hosting provider.</p>
<p>Download all the necessary files as well as an example of web.config file from the link below.</p>
<p><a href="http://ruslany.net/download/FormsAuthForWordPress.zip" title="Version 1.0 downloaded 286 times" >IIS Forms Authentication for WordPress (4.1 KB)</a></p>
<p>Also check out how this protection actually works by trying to navigate to http://ruslany.net/wp-admin/.</p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2009/02/how-to-secure-wordpress-admin-directory-on-iis-70/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Silverlight Media Player plugin for WordPress</title>
		<link>http://ruslany.net/2009/01/silverlight-media-player-plugin-for-wordpress/</link>
		<comments>http://ruslany.net/2009/01/silverlight-media-player-plugin-for-wordpress/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 00:07:15 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=154</guid>
		<description><![CDATA[At some point I wanted to integrate a Silverlight based player into my blog, so I was looking for a WordPress plugin that would do that. However, I could not find any that was easy enough to use. So I decided to write one myself for self-educational purposes. This post describes and demonstrates the plugin [...]]]></description>
			<content:encoded><![CDATA[<p>At some point I wanted to integrate a Silverlight based player into my blog, so I was looking for a WordPress plugin that would do that. However, I could not find any that was easy enough to use. So I decided to write one myself for self-educational purposes. This post describes and demonstrates the plugin that I wrote and explains how to use it to add Silverlight-based media players to blog posts and pages of a WordPress powered blog.<span id="more-154"></span></p>
<h3>Description and Features</h3>
<p>The plugin has the following features:</p>
<ul>
<li>Default player configuration settings, such as size, thumbnail, auto load and auto play.</li>
<li>Per-instance player configuration settings that can be used to customize each individual player within or across blog posts.</li>
<li>Unlimited number of players within the same blog post or page.</li>
<li>Option to not load players on the home page of the blog. This helps to reduce the amount of content to download for visitors who do not want to watch a video.</li>
<li>6 player styles</li>
</ul>
<p>Here is an example of how the media player plugin works:</p>
<p><a href="http://ruslany.net/2009/01/silverlight-media-player-plugin-for-wordpress/#mediaPlayer_154_0">Play Video</a></p>
<p>(the video may play with interruptions &#8211; my server&#8217;s internet connection is pretty slow)</p>
<h3>Download and Install</h3>
<p>Download the plugin from here:</p>
<p><a href="http://ruslany.net/download/wp-media-player.0.8.zip" title="Version 0.8 downloaded 2058 times" >WP Media Player</a></p>
<p>The plugin has been tested on WordPress versions from 2.5 up to 2.7.  Once you downloaded the plugin files follow these steps to install and configure it:</p>
<p><strong>Step 1</strong>: Upload <strong>wp-media-player</strong> directory (including all files and directories withing) to the /wp-content/plugins/ directory. Make sure that the path to the main plugin php file is /wp-content/plugins/wp-media-player/wp-media-player.php. If path does not look like this then plugin may not show up in the WordPress plugins page.</p>
<p><strong>Step 2</strong>: Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress.</p>
<p><strong>Step 3</strong>: Visit the plugin settings options (Options – WP Media Player) for WordPress 2.3.x, (Settings – WP Media Player) for WordPress 2.5.x-2.7</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/01/wordpressadmin.png"><img class="alignnone size-medium wp-image-155" style="border: 0px;" title="wordpressadmin" src="http://ruslany.net/wp-content/uploads/2009/01/wordpressadmin-471x500.png" alt="" width="471" height="500" /></a></p>
<h3>Usage walkthrough</h3>
<p>To add a player to a blog post or a page, follow these steps:</p>
<p><strong>Step 1</strong>: Encode the video to a Windows Media Video (WMV) format by using <a href="http://www.microsoft.com/Expression/try-it/default.aspx">Microsoft Expression Encoder</a> or <a href="http://www.microsoft.com/windows/windowsmedia/forpros/encoder/default.mspx">Windows Media Encoder</a>. If you use Windows Media Encoder then follow <a href="http://msdn.microsoft.com/en-us/library/bb851602.aspx" target="_blank">these instructions</a> to properly encode the video content for Silverlight.</p>
<p><strong>Step 2</strong>: Upload the video to WordPress either via FTP or by clicking on “Add Video” in the post editing page:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/01/addvideo1.png"><img class="alignnone size-medium wp-image-156" style="border: 0px;" title="addvideo1" src="http://ruslany.net/wp-content/uploads/2009/01/addvideo1-500x428.png" alt="" width="500" height="428" /></a></p>
<p>When uploading the video, take a note of the absolute URL path where the video file has been placed to. <strong>Do not click on “Insert into Post” button</strong>!</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/01/addvideo2.png"><img class="alignnone size-medium wp-image-157" style="border: 0px;" title="addvideo2" src="http://ruslany.net/wp-content/uploads/2009/01/addvideo2-493x499.png" alt="" width="493" height="499" /></a></p>
<p><strong>Step 3</strong>: Place the following tag inside of the blog post content where you want the video player to appear:</p>
<pre name="code" class="cpp">
[mediaplayer src=”/absolute/url/path/to/video/file.wmv”]
</pre>
<h3>Usage examples</h3>
<p>To use a custom placeholder image instead of the default one use the “thumb” parameter, e.g.:</p>
<pre name="code" class="cpp">
[mediaplayer src=”/absolute/url/path/to/video/file.wmv”
thumb=”/absolute/url/path/to/thumb/file.jpg”]
</pre>
<p>To specify player’s width and height, use the “width” and “height” parameters, e.g.:</p>
<pre name="code" class="cpp">
[mediaplayer src=”/absolute/url/path/to/video/file.wmv” width=320 height=240]
</pre>
<p>To change auto load and auto play settings use “autoLoad” and “autoPlay” parameters, e.g.:</p>
<pre name="code" class="cpp">
[mediaplayer src=”/absolute/url/path/to/video/file.wmv” autoLoad=1 autoPlay=0]
</pre>
<p>Please try it out on your WordPress installation and let me know if you find any bugs or if you have any suggestions.</p>
<p><a href="http://ruslany.net/download/wp-media-player.0.8.zip" title="Version 0.8 downloaded 2058 times" >WP Media Player</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2009/01/silverlight-media-player-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>Speed up WordPress on IIS 7.0</title>
		<link>http://ruslany.net/2008/12/speed-up-wordpress-on-iis-70/</link>
		<comments>http://ruslany.net/2008/12/speed-up-wordpress-on-iis-70/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 01:46:39 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=136</guid>
		<description><![CDATA[This post has been updated to ensure that instructions are correct for the latest versions of the WP Super Cache plugin and IIS URL Rewrite  Module. The performance of WordPress may be sufficient for an average blog that gets a few page hits per minute. However, if your blog post suddenly shows up on digg.com or [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><a href="http://ruslany.net/wp-content/uploads/2008/12/wp_super_cache.png"></a>This post has been updated to ensure that instructions are correct for the latest versions of the WP Super Cache plugin and IIS URL Rewrite  Module.</p></blockquote>
<p>The performance of WordPress may be sufficient for an average blog that gets a few page hits per minute. However, if your blog post suddenly shows up on digg.com or any other social networking site, it may become challenging for server to handle such huge spike in traffic. A few options exist to help server to cope with flood of requests:</p>
<ul>
<li>IIS Output Caching</li>
<li>WP Cache plugin for WordPress</li>
<li>WP Super Cache plugin for WordPress</li>
</ul>
<p>In this post I will explain the benefits and drawbacks of each option and walk through the steps for configuring IIS and WordPress to use those options.<span id="more-136"></span></p>
<h3>Prerequisites</h3>
<p>Before performing the configuration steps described in this post, it is necessary to complete the following prerequisites:</p>
<ol>
<li>Install WordPress (Follow the instructions in <a title="Install WordPress" href="http://learn.iis.net/page.aspx/280/wordpress-on-iis/">this article</a> or use the instructions from the official <a title="Install WordPress" href="http://codex.wordpress.org/Installing_WordPress">WordPress site</a>).</li>
<li>Install <a href="http://www.iis.net/extensions/URLRewrite">Microsoft URL Rewrite Module 1.1 for IIS 7</a></li>
<li>Enable “Pretty Permalinks” in WordPress by following steps described in <a href="http://learn.iis.net/page.aspx/466/enabling-pretty-permalinks-in-wordpress/">this article</a>.</li>
</ol>
<h3>IIS Output Caching</h3>
<p>IIS 7.0 has a very powerful output caching infrastructure, which can cache response data in kernel-mode (http.sys) and in user-mode memory space (IIS worker process). The Output Caching can be used with static web resources as well as with semi-dynamic web applications, where the content is generated dynamically, but is not likely to change from request to request. A blog engine is a perfect example of semi-dynamic web application.</p>
<p>To enable IIS Output Caching for WordPress you can use IIS Manager UI:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2008/12/editcacherule.png"><img style="display: inline; border-width: 0px;" title="EditCacheRule" src="http://ruslany.net/wp-content/uploads/2008/12/editcacherule-thumb.png" border="0" alt="EditCacheRule" width="478" height="379" /></a></p>
<p>Or add this configuration section into the web.config file located at the root folder of the WordPress site:</p>
<pre name="code" class="xml">
&lt;caching&gt;
  &lt;profiles&gt;
    &lt;add extension=&quot;*&quot; policy=&quot;CacheForTimePeriod&quot;
      kernelCachePolicy=&quot;CacheForTimePeriod&quot;
      duration=&quot;00:00:30&quot; /&gt;
  &lt;/profiles&gt;
&lt;/caching&gt;
</pre>
<p>With this configuration IIS will cache the response generated by WordPress in memory for 30 seconds, thus avoiding heavy script processing and database I/O for all subsequent requests. This would increase the throughput significantly – for example on my Virtual PC the WordPress throughput grew from <strong>10</strong> requests per seconds to more than <strong>2500</strong> requests per seconds after enabling Output Caching.</p>
<p>However, there are certain drawbacks from using Output Caching. Some of the dynamic blog features are lost when cached page is served instead of a page generated by WordPress. For example, when a visitor submits a comment for a blog post there will be no confirmation message shown to indicate that the comment has been submitted. This is because the page shown to the user after comment submission is served from cache. This may cause visitor to submit same comment several times. This problem can be somewhat mitigated by reducing the cache timeout, but there is still a chance that stale page may be served to a visitor after comment submission. To reliable prevent this from happening a more customized solution for WordPress is necessary, which is a WP Super Cache plugin.</p>
<h3>WP Cache and WP Super Cache</h3>
<p><a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache</a> is a very popular plugin that generates temporary static html pages from dynamic WordPress blog. After a html file is generated the server will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP script. Since this is a WordPress-customized solution, it is able to smartly handle such situations such submission of comments or serving pages to logged on users. Specifically, the plug in will serve static html pages only to:</p>
<ol>
<li>Users who are not logged in</li>
<li>Users who have not left a comment</li>
<li>Or users who have not viewed a password protected post.</li>
</ol>
<p>Typically 99% of the visitors do not do any of the above actions, so the static html pages will be served most of the time, thus increasing server throughput significantly.</p>
<p>WP Super Cache plugin has two modes of operation: WP-Cache and WP-SuperCache. With WP-Cache the static files are still generated but every request will require loading of PHP engine to serve those files. WP-SuperCache relies on URL rewriting to bypass PHP altogether when serving cached static files.</p>
<p>To configure WP Super Cache on IIS 7.0 follow these steps:</p>
<p><strong>Step 0</strong>: Make sure that wp-content folder is writable by web server</p>
<p><strong>Step 1</strong>: <a href="http://wordpress.org/extend/plugins/wp-super-cache/">Download</a> the WP Super Cache plugin and unpack it into the WordPress plugins folder “wp-content\plugins”. This will create “wp-content\plugins\wp-super-cache” folder.</p>
<p><strong>Step 2</strong>: Copy the file “wp-content\plugins\wp-super-cache\wp-cache-phase1.php” to “wp-content\advanced-cache.php”</p>
<p><strong>Step 3</strong>: Add the following rewrite rule to the web.config file located at the root folder of WordPress site. Make sure that the “WP Super Cache” rule is before the WordPress rule for pretty permalinks. Typically the &lt;rewrite&gt; section will look as below</p>
<pre name="code" class="xml">
&lt;rewrite&gt;
&lt;rules&gt;
  &lt;rule name=&quot;wp super cache&quot; stopProcessing=&quot;true&quot;&gt;
    &lt;match url=&quot;(.*)&quot; /&gt;
      &lt;conditions logicalGrouping=&quot;MatchAll&quot;&gt;
        &lt;add input=&quot;{REQUEST_METHOD}&quot; pattern=&quot;^POST$&quot; negate=&quot;true&quot; /&gt;
        &lt;add input=&quot;{QUERY_STRING}&quot; pattern=&quot;.*=.*&quot; negate=&quot;true&quot; /&gt;
        &lt;add input=&quot;{QUERY_STRING}&quot; pattern=&quot;.*attachment_id=.*&quot; negate=&quot;true&quot; /&gt;
        &lt;add input=&quot;{HTTP_COOKIE}&quot; pattern=&quot;^.*(comment_author_|wordpress|wp-postpass_).*$&quot; negate=&quot;true&quot; /&gt;
        &lt;add input=&quot;{HTTP_USER_AGENT}&quot; pattern=&quot;^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).*&quot; negate=&quot;true&quot; /&gt;
         &lt;add input=&quot;{DOCUMENT_ROOT}/wp-content/cache/supercache/{HTTP_HOST}/{R:1}index.html&quot;
                                    matchType=&quot;IsFile&quot; /&gt;
      &lt;/conditions&gt;
      &lt;action type=&quot;Rewrite&quot; url=&quot;wp-content/cache/supercache/{HTTP_HOST}/{R:1}index.html&quot; /&gt;
  &lt;/rule&gt;

  &lt;rule name=&quot;WordPress Pretty Permalinks&quot; patternSyntax=&quot;Wildcard&quot;&gt;
    &lt;match url=&quot;*&quot; /&gt;
    &lt;conditions&gt;
      &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsFile&quot; negate=&quot;true&quot; /&gt;
      &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsDirectory&quot; negate=&quot;true&quot; /&gt;
    &lt;/conditions&gt;
    &lt;action type=&quot;Rewrite&quot; url=&quot;index.php&quot; /&gt;
  &lt;/rule&gt;
&lt;/rules&gt;
&lt;/rewrite&gt;
</pre>
<p><strong>Step 4</strong>: Add the following line into the wp-config.php file above the &#8220;require_once(ABSPATH.&#8217;wp-settings.php&#8217;);&#8221; line:</p>
<pre name="code" class="php">
define( &#039;WP_CACHE&#039;, true );
</pre>
<p><strong>Step 5</strong>: Login to WordPress and activate the plugin by going to “Plugins” tab. Then go to “Settings” tab and click on “WP Super Cache”. If everything was configured correctly you should see the plugin’s configuration page.</p>
<p><a href="http://ruslany.net/wp-content/uploads/2008/12/wp_super_cache.png"><img class="alignnone size-medium wp-image-671 screenshot" title="WP Super Cache " src="http://ruslany.net/wp-content/uploads/2008/12/wp_super_cache-500x415.png" alt="" width="500" height="415" /></a></p>
<p><a href="http://ruslany.net/wp-content/uploads/2008/12/wpsupercache.png"></a></p>
<p><strong>Step 6</strong>: Go to “wp-content\cache” folder, which should have been created when plugin was activated. Create a new web.config file there, open it and paste the following content inside:</p>
<pre name="code" class="xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;configuration&gt;
  &lt;system.webServer&gt;
    &lt;httpProtocol&gt;
      &lt;customHeaders&gt;
        &lt;add name=&quot;Cache-Control&quot; value=&quot;max-age=300, must-revalidate&quot; /&gt;
      &lt;/customHeaders&gt;
    &lt;/httpProtocol&gt;
  &lt;/system.webServer&gt;
&lt;/configuration&gt;
</pre>
<p>This configures IIS to send Cache-Control response header for any of the cached html pages. That header will force the browser to expire the locally cached response after 5 minutes.</p>
<p>To check that the WP Super Cache actually works, set its status to ON in the plugin configuration page, then clear all the browser cookies and make a request to the blog page. Alternatively you can use <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=b134a806-d50e-4664-8348-da5c17129210&amp;displaylang=en">WFetch</a> to make a request. If WP Super Cache works then when you make a request to <strong>http://wordpress/2008/04/hello-world/</strong>, the response will be cached as a static file in \wp-content\cache\supercache\wordpress\2008\04\hello-world\index.html. When next time you request the same page, the rewrite rule “WP Super Cache” will rewrite the URL to the “wp-content\cache\supercache” folder, thus IIS will serve static html file without even invoking PHP engine.</p>
<h3>Conclusion</h3>
<p>Here is the comparison of server throughput in requests per second with three output caching solutions for WordPress when requesting <strong>http://wordpress/2008/04/hello-world</strong>:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2008/12/perfresults.png"><img style="display: inline; border-width: 0px;" title="PerfResults" src="http://ruslany.net/wp-content/uploads/2008/12/perfresults-thumb.png" border="0" alt="PerfResults" width="420" height="379" /></a></p>
<p>The performance of WP Super Cache is comparable with performance of IIS Output Caching because with WP Super Cache IIS is just serving static files, which is what IIS is very good at.</p>
<p>So, when to use which option? Here are the pros and cons of each caching solution:</p>
<table border="0">
<tbody>
<tr>
<th valign="top"> </th>
<th valign="top">Pros</th>
<th valign="top">Cons</th>
</tr>
<tr>
<td valign="top">IIS Output Caching</td>
<td valign="top">
<ul>
<li>Very easy to configure</li>
<li>Significantly improves site throughput</li>
</ul>
</td>
<td valign="top">
<ul>
<li>May prevent confirmation message from showing up when submitting comments</li>
</ul>
</td>
</tr>
<tr>
<td valign="top">WP-Cache</td>
<td valign="top">
<ul>
<li>Works without URL rewriting</li>
<li>Correctly handles comments submissions and other visitors&#8217; actions</li>
</ul>
</td>
<td valign="top">
<ul>
<li>Not that significant performance gain comparing to other options</li>
</ul>
</td>
</tr>
<tr>
<td valign="top">WP-SuperCache</td>
<td valign="top">
<ul>
<li>Significantly improves site throughput</li>
<li>Correctly handles comments submissions and other visitors’ actions</li>
</ul>
</td>
<td valign="top">
<ul>
<li>More complex to setup and configure comparing to other options</li>
</ul>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2008/12/speed-up-wordpress-on-iis-70/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Enable custom errors in WordPress on IIS 7.0</title>
		<link>http://ruslany.net/2008/12/enable-custom-errors-in-wordpress-on-iis-70/</link>
		<comments>http://ruslany.net/2008/12/enable-custom-errors-in-wordpress-on-iis-70/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 17:05:29 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=117</guid>
		<description><![CDATA[The information in this post is not applicable anymore because the update that fixes the custom errors problem in IIS 7.0 FastCGI module has been made available . Read the release announcement to get more details about the update. Recently, I found out that my WordPress powered blog did not correctly handle 404 &#8211; File Not Found [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>The information in this post is not applicable anymore because the update that fixes the custom errors problem in IIS 7.0 FastCGI module has been made available . Read the <a href="http://ruslany.net/2010/03/important-update-for-iis-7-0-fastcgi-module/">release announcement</a> to get more details about the update.</p></blockquote>
<p>Recently, I found out that my WordPress powered blog did not correctly handle 404 &#8211; File Not Found errors. When a request was made to a non-existent page, then instead of getting nice WordPress based error page, visitors used to get a generic IIS 7.0 404 error page. Somehow, I have missed that part of the configuration when I set up WordPress initially. The fix for that turned out to be very simple, but since it seems to be a very common configuration task when hosting WordPress on IIS 7.0, I decided to explain the necessary configuration steps.</p>
<p><span id="more-117"></span>By default IIS is configured to return detailed error messages for local requests and custom error messages for remote requests. So when request is made to <strong>http://ruslany.net/boguspage</strong>, the server returns this:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2008/12/custom404.png"><img class="alignnone size-medium wp-image-123" style="border: 0pt none;" title="custom404" src="http://ruslany.net/wp-content/uploads/2008/12/custom404-500x382.png" alt="" width="500" height="382" /></a></p>
<p>This is a custom IIS error page. Typically, this is not the kind of response you would want your blog visitors to see. Instead, it would be nice to return an error page generated by WordPress. Almost all WordPress themes have a template for the 404 error called <strong>404.php</strong>. This template tells WordPress how to generate an error page, that should be returned when URL is not found on the server. To return that page instead of the generic IIS page do the following:</p>
<ol>
<li>In IIS Manager open the &#8220;Error Pages&#8221; feature UI for your web site</li>
<li>Select the status code 404 from the list view and click &#8220;Edit&#8221; action</li>
<li>In the &#8220;Edit Custom Error Page&#8217; dialog choose an option &#8220;Execute a URL on this site&#8221;</li>
<li>Enter the URL as &#8220;<strong>/index.php?error=404</strong>&#8220;</li>
</ol>
<p>Here is how the IIS Manager UI will look like:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2008/12/editcustomerrorpage.png"><img class="alignnone size-medium wp-image-124" style="border: 0pt none;" title="editcustomerrorpage" src="http://ruslany.net/wp-content/uploads/2008/12/editcustomerrorpage-499x401.png" alt="" width="499" height="401" /></a></p>
<p>Alternatively, you can add the following configuration section into the &lt;system.webServer&gt; section of web.config file located at the root folder of your web site:</p>
<pre name="code" class="xml">
&lt;httpErrors&gt;
  &lt;remove statusCode=&quot;404&quot; subStatusCode=&quot;-1&quot; /&gt;
  &lt;error statusCode=&quot;404&quot; prefixLanguageFilePath=&quot;&quot;
path=&quot;/index.php?error=404&quot;
responseMode=&quot;ExecuteURL&quot; /&gt;
&lt;/httpErrors&gt;
</pre>
<p>Note, that by default the IIS &#8220;Error Pages&#8221; feature is not delegated for being configured via web.config file. This means that if you use shared hosting, you can add &lt;httpErrors&gt; section to web.config file only if hosting provider has delegated the &#8220;Error Pages&#8221; feature.</p>
<p>Once the configuration change has been made, any request to a non-existent URL will result in the standard WordPress error response:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2008/12/custom404wp.png"><img class="alignnone size-medium wp-image-125" style="border: 0pt none;" title="custom404wp" src="http://ruslany.net/wp-content/uploads/2008/12/custom404wp-500x382.png" alt="" width="500" height="382" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2008/12/enable-custom-errors-in-wordpress-on-iis-70/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
