<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>
      Comments on: htmltidy for WordPress
    </title>
    <link />
    <title>
      By: Benjamin Wittorf
    </title>
    <link />
    <title>
      By: Rahim Sonawalla
    </title>
    <link />
    <title>
      By: Benjamin Wittorf
    </title>
    <link />
    <title>
      By: Moltar
    </title>
    <link />
    <title>
      By: Benjamin Wittorf
    </title>
    <link />
    <title>
      By: Jonathan
    </title>
    <link />
    <title>
      By: Benjamin Wittorf
    </title>
    <link />
    <title>
      By: RockyMtnHi
    </title>
    <link />
    <title>
      By: Erik Poehler
    </title>
    <link />
    <title>
      By: Benjamin Wittorf
    </title>
    <link />
  </head>
  <body>
    http://benjamin.wittorf.me Ein weiteres tolles WordPress-Blog Sat, 30 Jan 2010 12:49:52 +0000 http://wordpress.org/?v=2.9.2 hourly 1 http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-16 Benjamin Wittorf Wed, 06 Jan 2010 20:14:59 +0000 http://benjamin.wittorf.me/?page_id=31#comment-16 Hey Rahim, thanks for your kind words – and your fix! As I didn’t run into that problem, I wasn’t aware of it. I already commited a fixed version with kudos to you. Thank you! 
    <![CDATA[<p>Hey Rahim, thanks for your kind words – and your fix! As I didn’t run into that problem, I wasn’t aware of it. I already commited a fixed version with kudos to you.</p>
    <p>Thank you!</p>
    ]]>
     http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-15 Rahim Sonawalla Wed, 06 Jan 2010 20:14:33 +0000 http://benjamin.wittorf.me/?page_id=31#comment-15 Thanks for the fantastic plugin, it's exactly what I needed. Just FYI, I was having a problem with Wordpress 2.9 and htmltidy where I was unable to log in to the admin panel (the page would be blank). For others running into the same problem, the fix is to add an extra exclusion: [Line 61 in htmltidy-for-wordpress.php] &lt;code class="php"&gt;stripos($_SERVER['REQUEST_URI'], 'wp-login.php') === false &amp;&amp;&lt;/code&gt; 
    <![CDATA[<p>Thanks for the fantastic plugin, it&#8217;s exactly what I needed. Just FYI, I was having a problem with Wordpress 2.9 and htmltidy where I was unable to log in to the admin panel (the page would be blank). For others running into the same problem, the fix is to add an extra exclusion:</p>
    <p>[Line 61 in htmltidy-for-wordpress.php] <code class="php">stripos($_SERVER['REQUEST_URI'], 'wp-login.php') === false &amp;&amp;</code></p>
    ]]>
     http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-14 Benjamin Wittorf Wed, 06 Jan 2010 20:13:00 +0000 http://benjamin.wittorf.me/?page_id=31#comment-14 Hello Moltar, thank you for taking the time to comment. I'll answer your last question first: &lt;code&gt;===&lt;/code&gt; is a comparison operator that states &lt;q&gt;if $a is equal to $b, and they are of the same type&lt;/q&gt;. So as long as there is no output buffer, it's not only empty, it doesn't exist and thus it's &lt;i&gt;false&lt;/i&gt;. (That type of comparison might be characteristic to PHP.) I could also write it just like you suggested, though. Now, about the output buffer itself – for various compatibility reasons I needed to make sure the output buffer hadn't been modified at another point until where it should be “HTML tidied” (e.g. some caching plugins were playing afoul; &lt;cite&gt;WP Super Cache&lt;/cite&gt; and &lt;cite&gt;Hyper Cache&lt;/cite&gt; play nice). I might re-check that and comment it out if testing goes well (credit's to you, then). Also, please note that I'm currently working on a new version that isn't depended on &lt;cite&gt;HTML Tidy&lt;/cite&gt; anymore which hopefully allows me to get rid of more of these kind of “hacks”. 
    <![CDATA[<p>Hello Moltar, thank you for taking the time to comment.</p>
    <p>I&#8217;ll answer your last question first: <code>===</code> is a comparison operator that states <q>if $a is equal to $b, and they are of the same type</q>. So as long as there is no output buffer, it&#8217;s not only empty, it doesn&#8217;t exist and thus it&#8217;s <i>false</i>. (That type of comparison might be characteristic to PHP.) I could also write it just like you suggested, though.</p>
    <p>Now, about the output buffer itself – for various compatibility reasons I needed to make sure the output buffer hadn&#8217;t been modified at another point until where it should be “HTML tidied” (e.g. some caching plugins were playing afoul; <cite>WP Super Cache</cite> and <cite>Hyper Cache</cite> play nice). I might re-check that and comment it out if testing goes well (credit&#8217;s to you, then).</p>
    <p>Also, please note that I&#8217;m currently working on a new version that isn&#8217;t depended on <cite>HTML Tidy</cite> anymore which hopefully allows me to get rid of more of these kind of “hacks”.</p>
    ]]>
     http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-13 Moltar Wed, 06 Jan 2010 20:12:25 +0000 http://benjamin.wittorf.me/?page_id=31#comment-13 I'm having a problem with &lt;code class="php"&gt;ob_get_length() === false&lt;/code&gt; part. If I comment it out, the plugin works. It seems like the condition isn't satisfied there. Docs mention that the return value is &lt;i&gt;int&lt;/i&gt;, but you compare to &lt;i&gt;false&lt;/i&gt;, which is bool, so it would never be satisfied. I am not pro with PHP, so maybe I am wrong. I come from Perl background, where I'd just say &lt;code&gt;!ob_get_length() &amp;&amp; …&lt;/code&gt; 
    <![CDATA[<p>I&#8217;m having a problem with <code class="php">ob_get_length() === false</code> part. If I comment it out, the plugin works. It seems like the condition isn&#8217;t satisfied there. Docs mention that the return value is <i>int</i>, but you compare to <i>false</i>, which is bool, so it would never be satisfied. I am not pro with PHP, so maybe I am wrong. I come from Perl background, where I&#8217;d just say <code>!ob_get_length() &amp;&amp; …</code></p>
    ]]>
     http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-12 Benjamin Wittorf Wed, 06 Jan 2010 20:10:28 +0000 http://benjamin.wittorf.me/?page_id=31#comment-12 Hey Jonathan, thank you and thanks for your comment. I'm not exactly sure what you mean, though: Do you mean to have actual empty lines before articles and comments? If so, I'm afraid no (but this is something I'll put on my to-do list, thank you). For an example how the source code looks like after it's been processed just have a look at the source code of this page. 
    <![CDATA[<p>Hey Jonathan, thank you and thanks for your comment. I&#8217;m not exactly sure what you mean, though: Do you mean to have actual empty lines before articles and comments? If so, I&#8217;m afraid no (but this is something I&#8217;ll put on my to-do list, thank you). For an example how the source code looks like after it&#8217;s been processed just have a look at the source code of this page.</p>
    ]]>
     http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-11 Jonathan Wed, 06 Jan 2010 20:09:57 +0000 http://benjamin.wittorf.me/?page_id=31#comment-11 Great plugin, Benjamin. Does it also add whitespace before lines in articles and comments? That's been a pet-peeve, and something I haven't been able to alleviate. 
    <![CDATA[<p>Great plugin, Benjamin. Does it also add whitespace before lines in articles and comments? That&#8217;s been a pet-peeve, and something I haven&#8217;t been able to alleviate.</p>
    ]]>
     http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-10 Benjamin Wittorf Wed, 06 Jan 2010 20:08:49 +0000 http://benjamin.wittorf.me/?page_id=31#comment-10 RockyMtnHi – you'll need to download the plugin this entry is about (see section &lt;a href="#tidy_download" rel="nofollow"&gt;Download htmltidy for WordPress&lt;/a&gt;) and install it according to the included installation instructions (unzip, upload to the WordPress plugins directory, activate in the plugins settings of your WordPress admininistration pages). Please don't confuse this plugin to be php-tidy. You need it installed to use this plugin with WordPress. 
    <![CDATA[<p>RockyMtnHi – you&#8217;ll need to download the plugin this entry is about (see section <a href="#tidy_download">Download htmltidy for WordPress</a>) and install it according to the included installation instructions (unzip, upload to the WordPress plugins directory, activate in the plugins settings of your WordPress admininistration pages).</p>
    <p>Please don&#8217;t confuse this plugin to be php-tidy. You need it installed to use this plugin with WordPress.</p>
    ]]>
     http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-9 RockyMtnHi Wed, 06 Jan 2010 20:07:44 +0000 http://benjamin.wittorf.me/?page_id=31#comment-9 I have gone through a lot of pages and documention for php-tidy but I can’t see how to install it in Wordpress 2.6.1. Can you assist here? Many thanks. 
    <![CDATA[<p>I have gone through a lot of pages and documention for php-tidy but I can’t see how to install it in Wordpress 2.6.1.<br />
    Can you assist here? Many thanks.</p>
    ]]>
     http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-8 Erik Poehler Wed, 06 Jan 2010 20:06:56 +0000 http://benjamin.wittorf.me/?page_id=31#comment-8 No apt-get in my cygwin… :) but I guess I can be lucky to have a “remove-a-single-semicolon” installation on my closed source OS :) I love it. Thanks for the tip! 
    <![CDATA[<p>No apt-get in my cygwin…  <img src='http://benjamin.wittorf.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but I guess I can be lucky to have a “remove-a-single-semicolon” installation on my closed source OS <img src='http://benjamin.wittorf.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I love it. Thanks for the tip!</p>
    ]]>
     http://benjamin.wittorf.me/code/wordpress/plugins/htmltidy-for-wordpress/comment-page-1/#comment-7 Benjamin Wittorf Wed, 06 Jan 2010 20:05:25 +0000 http://benjamin.wittorf.me/?page_id=31#comment-7 Erik – thanks for your comment. Of course, this plugin is not only about indenting (but, it is, too, I must admit). Glad you still like the idea, though! Yes, I indeed installed it manually, but not in an environment similar to yours. The good old &lt;code&gt;apt-get install php5-tidy&lt;/code&gt; did it for me (that’s Linux). On Windows, if you have installed PHP5, you’ll just need to active it in the php.ini. If you’re using PHP4 you’ll need to get the php_tidy.dll from somewhere and do funny things with it. Let me know if you need some further assistance. 
    <![CDATA[<p>Erik – thanks for your comment. Of course, this plugin is not only about indenting (but, it is, too, I must admit). Glad you still like the idea, though!</p>
    <p>Yes, I indeed installed it manually, but not in an environment similar to yours. The good old <code>apt-get install php5-tidy</code> did it for me (that’s Linux). On Windows, if you have installed PHP5, you’ll just need to active it in the php.ini. If you’re using PHP4 you’ll need to get the php_tidy.dll from somewhere and do funny things with it. Let me know if you need some further assistance.</p>
    ]]>
    </body>
</html>