I’m using BackUpWordPress to do regular database and file tree backups of this blog. Unfortunately, there is a nasty bug in this plugin which may cause the tarball to contain every backuped file multiple times (to be precise, every file except the first one will go into the tarball exactly three times).
The problem is that the . and .. directories may appear in a somewhat random order and not necessarily as the first entries in a directory. This is probably host specific (I encountered this error for the first time after I relocated this blog to another server).
To fix BackUpWordPress v0.4.5, locate line 103 in Directory.php (resides in wp-content/plugins/backupwordpress/Archive/Reader/) and change the while-loop inside the next() function
...
while ($this->source === null ||
($error = $this->source->next()) !== true) {
...
like this
...
$file = null;
while ($this->source === null ||
$file == '.' || $file == '..' ||
($error = $this->source->next()) !== true) {
...
Alternatively, you can use the following patch:
--- Directory.php.orig 2010-07-17 15:02:56.093238736 +0200
+++ Directory.php 2010-07-17 15:04:10.367237641 +0200
@@ -103,0 +104 @@
+ $file = null;
@@ -104,0 +106 @@
+ $file == '.' || $file == '..' ||
Resources:
http://pear.php.net/bugs/bug.php?id=6546
I recently installed myStat to keep track of this blog’s rapidly increasing number of readers. Unfortunately, the plugin break the rss feed. The problem is the plugin’s myStat_footer() function, which does not check if the page is a feed before deciding to insert the myStat footer image into the page code.
To fix myStat v2.6, locate line 475 in mystat.php and change the myStat_footer() function
function myStat_footer() {
global $cmn;
if($cmn->getParam("myStat_debug")==1){$cmn->setDebug('FOOTER LOAD');};
echo "<img style=(...);
}
like this
function myStat_footer() {
global $cmn;
if($cmn->getParam("myStat_debug")==1){$cmn->setDebug('FOOTER LOAD');};
if (!is_feed()) {
echo "<img style=(...);
}
}
Resources:
http://wordpress.org/support/topic/325426
As you probably know, I’m using SyntaxHighlighter Evolved to post syntax-highlighted code. Some people mailed me, that in some of my posted code the underscores are not visible (although copy&paste works). Well, the culprit is the line-height attribute of the SyntaxHighlighter Evolved cascading stylesheet:
.syntaxhighlighter,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody
{
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
outline: 0 !important;
background: none !important;
text-align: left !important;
float: none !important;
vertical-align: baseline !important;
position: static !important;
left: auto !important;
top: auto !important;
right: auto !important;
bottom: auto !important;
height: auto !important;
width: auto !important;
line-height: 1.21 !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
/*min-height: inherit !important; *//* For IE8, FF & WebKit */
/*min-height: auto !important;*/ /* For IE7 */
direction: ltr !important;
}
Simply increasing the line-height from the default 1.1em to 1.21em in wp-content/plugins/syntaxhighlighter/syntaxhighlighter/styles/shCore.css did the trick.
Saw my last article about RF remotes and Fedora? Noticed the box in the top right corner containing a table of contents? Pretty cool, huh?
This really nice plugin by Hackadelic parses your headings automatically and puts them into a TOC-box. It’s even collapsable and you can change its position through shortcodes within the post.
Read more…
Recently (well, yesterday to be exact) I was really sold on a a syntax highlighting plugin for WordPress called WP-Syntax. Basically, I am still. It is still easy to use, looks good and comes with a huge variety of supported languages.
But if you ask the WordPress-guys it isn’t first choice. In their FAQ they point you to Alex Gorbatchev’s syntaxhighligher Google Code project. There are quite a lot of implementations availible including three different plugins for WordPress. So I looked a little closer at SyntaxHighlighter Evolved and I must admit that it is really nice.
public class Hello {
public static void main(String[] args) {
/* This line is highlighted. */
System.out.println("Hello world!");
}
}
Especially the line highlighting is very nice. It doesn’t support as many languages as WP-Syntax, but as I mainly use it for Java snippets that shouldn’t be a major problem.
I just ran into WP-Syntax which is a syntax highlighting plugin for WordPress using GeSHi. It supports a wide range of popular languages (including of course Java!).
Examples? Here we go:
1
2
3
4
5
| public class Hello {
public static void main(String[] args) {
System.out.println("Hello world!");
}
} |
Pretty cool, huh?