Archive for the 'WordPress' Category

IpPreviewTheme v1.0 – a Wordpress Plugin

Short: Use this wordpress plugin to preview your own theme when comming from your IP:

This is a wordpress plugin to allow viewing the selected theme when comming from your own Ip, logged in and have over 8 in user_level. Usefull when developing a new theme or debugging something. I got this idea from the preview-theme. I just did not want to specify the ?preview_theme=[Theme name] in the URL all the time. Therefor I changed it a lot and saved the theme name and IP from a Option page.

Sign out, and you will se how the page is for a normal user.
Sign in and debug it when you’re comming from your IP.
I recommend turing off the plugin when not debugging/developing a new theme.

Bear with me, this is the first Wordpress plugin I have created for 2.5 (I think I have created a wordpress plugin earlier). I will probably release this one in wordpress normal plugin directory after testing it for a while (I hope).
Continue reading ‘IpPreviewTheme v1.0 – a Wordpress Plugin’

WP 2.5.1: Secure Cookies in Wordpress with SECRET_KEY parameter in config settings

Ready to solveJosé Carlos Nieto Jarquín reported a vulnerability WP 2.5:
He published an advisory on SecurityFocus on 15 Apr 2008 regarding insecurity regarding the default SECRET_KEY configuration value. You could gain access to any account if you know the default SECRET_KEY value on a system where SECRET_KEY is left with default value.

Read about the vulnerability in Wordpress 2.5 on Securityfocus

To generate a random new SECRET_KEY for your configuration file, you can go
here.

The default wp-config.php sais:

Change SECRET_KEY to a unique phrase.  You won't have to remember
it later, so make it long and complicated.  You can visit
https://www.grc.com/passwords.htm to get a phrase generated for you,
or just make something up.
define('SECRET_KEY', 'put your unique phrase here');

Here is a example of what you could put in your SECRET_KEY

define('SECRET_KEY', 'b<r4 c/.I.?d+3<cW$DITK79.Aiq~W]Xk.!D^ic]O]ppxSgy+o\'gT\\r+*t0Kqlq:');

K2 layout and major upgrade

Today or actually yesterday I started on upgrading my wordpress blog. I found out that I would like to upgrade the wordpress to a newer version, reinstall some plugins and make sure not to tweak to much because that just makes upgrade even harder. I found the K2 to be a nice theme. I said to myself.. Shouldn’t I also move the domain at the same time? Ofcause.. After a hell of a work. I have done all that and even some more.
I’m still not satisfied with the way any of the plugins I have tested for presenting programmingcode/snippets in a easy readable way. I think I will go for the plain console lookalike thing laiter with black background. I guess I could fix that with only the <pre>-tag and some .css editing.

I should probably also install an image-manager and look if I missed out on any important plugins.

Here is a peek back at how the page was looking before the change.

rolfs-no-webpage-before-mars-2008.png rolfs-no-webpage-before-mars-2008-bottom.png rolfs-no-webpage-before-mars-2008-comments.png

I was impressed of the easy way to add widgets after adding new plugins.

I learned something new about favatar and gravatars. It was easy to add in the K2 theme.

liferea-add-feed – Start Liferea if it is not running to add RSS feed

The bash script /usr/bin/liferea-add-feed is adding the url you send as an argument to your list of rss feeds in Liferea. If liferea is not running it will tell you “Liferea is not running! You need to start it first.” but if you did like me, the url is passed from firefox to the liferea-add-feed -script without you seeing that anything goes wrong. To avoid this, I changed the liferea-add-feed script so it makes sure that liferea is running before trying to add the RSS feed.
Continue reading ‘liferea-add-feed – Start Liferea if it is not running to add RSS feed’

Wordpress plugins to check out

5ThirtyOne writes about ultimate wordpress plugins. I’m looking forward to test more of what others call the best plugins.

Integrate blogging into the browser

I was starting to explore how to integrate Wordpress into the browser. The default way to blog something is to use the current browserwindow to go to the post page, and the results are that you’re navigating away from the page you want to blog about. Since the Blog button is just a bunch of javascripts, I’ve decided to make it blog in a new window. A Quick google search for “javascript location browser.open” gave me:
Displaying Popup Windows
With a example that shows a hyperlink using the window.open method to open a new browser window.

The Button/Favorite link/bookmark now holds this: Remember to fix example.com to your domain. Here is my modified WordPress Blog button:

javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}window.open('http://www.example.com/wp-admin/post.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title), 'blog');void(0);

I’ve merged Simple Syntax Highlighter and iG:Syntax Hiliter

I’ve merged Simple Syntax Highlighter and iG:Syntax Hiliter by modifying the iG:Syntax Hiliter. That gave me the possibility to post code written in a file, just as Simple Syntax did, but with the nice boxed version like iG:Syntax have.
Continue reading ‘I’ve merged Simple Syntax Highlighter and iG:Syntax Hiliter’

Xinha for WordPress: High resolution for ImageManager

I felt the ImageManager had to small window by default. Therefor I fixed a small patch to fix it. Shown below is only a part of the manager.php that I needed to edit.. You can download the file: xinha_core/plugins/ImageManager/manager.php

[syntax,manager-patch.php,php]

And I needed a new managerHQ.css file in xinha_core/plugins/ImageManager/assets

Xinha v316 (9/14/2005)
Xinha4WP: v1.1 (11/02/2005)

WordPress winampsong plugin

I’ve just created a WordPress plugin to the MSN-SongText program.
Here is a the output (also on the footer of this page):
##WINAMP##

Writing the song anywhere in the themes..

echo winampsong();

or use one of the two strings:

 <!--winampsong-->
##WINAMP##

Download the plugin here put it in your wordpress plugin directory.

I guess this plugin does not work with WP2.5