Posted in wordpress plugins | June 20th, 2008 No Comments »
Simple hack to make the avatars displayed as part of the comment to link to the site of the comment author.
Requirements: wordpress 2.5+
Installation: Download it, unzip and upload it to your plugins directory and activate it. No configuration is needed.
License: Do with it whatever you want, just don’t blame me…
Posted in Uncategorized | April 24th, 2008 1 Comment »
Wordpress 2.5 has a native support for comment avatars via the gravatar service. When a theme which supports avatar is used, for each comment a small image retrieved from the gravatar service is added to the comment whenever the commentor (based on his e-mail) has a configured image with the service. For commentors which do not have such an image a standard image was displayed.
This week the gravatar guys had announced that they have integrated the functionality of three wordpress plugins, which created a random avatar for commentors without an gravatar, into their service.
The aim of this plugin is to expose this new functionality. You can configure it to use one of three methods to generate random avatar - wavatars (kind of faces), monsters, and geometric shapes.
When using the monster algorithm the comment section might look like this

You can select which random avatar type to use in under the Settings >> Default gravatar type window

Requirements:
Wordpress 2.5
Installation:
Download this file, unzip it, and upload the defaultgravatars directory into the plugins directory of your blog. Now go to the plugin management panel, and activate it. Next go to the Settings >> Default gravatar type window and select the type of random avatar you wish to use.
License: BSD.
Posted in wordpress plugins | April 24th, 2008 2 Comments »
The wordpress text widget is wrongly named as it is actually an HTML widget, capable of hosting not only plain text, but also HTML markup.
People who know basic html can easily use it in the text widget, but the advice given to the casual user was “write what you want in the post editor, go to the HTML tab, and copy the HTML to the widget”. For those people this plugin brings the editor right into the text widget.

As the image above indicates, the fancy editor allows you to change the foreground and background color of a text, its size, make text bold, italic, underlined or with a strike through, and lets you insert links and images.
Since the plugin do not make any change in the text you enter, you can turn off the plugin at any point in time without losing your data. After turning the plugin off you will simply see the raw HTML when editing the widget.
Requirements:
Wordpress 2.5
Installation:
Download this file, unzip it, and upload the fancytextwidget directory into the plugins directory of your blog. Now go to the plugin management panel, and activate it.
License: BSD.
Posted in wordpress misc | April 5th, 2008 1 Comment »
If you are using a good non trivial password for your wordpress blog, then it is very likely that at some point in time you will forget it. This is not a real issue as long as you can go to your login page and request that a new password will be generated and sent to your e-mail account, but sometimes you either don’t have access to your mail, or the server is not configured to send mails. If you are in this unfortunate situation you need a method to bypass the normal wordpress password administration procedures.
For pre-2.5 wordpress versions, all you needed is an access to your server’s phpmyadmin, and you could follow the simple instructions at devlounge to reset your password. Since the 2.5 the method in which passwords are being hashed when stored at the database had changed, and the hashing is no longer a simple MD5. More then that, the hashing function is now pluggable (can be overridden by a plugin) which means that there is no more a uniform way to calculate the hash results as was described at the devlounge article.
The following script pass-calc solves this problem by calculating a password hash using the relevant functions from your wordpress installation. All you have to do is download the script, install it at your wordpress root directory, and run it by navigating to {your wordpress url}/calc-pass.php.
The script will ask you to enter the new password, and will generate an hash code for it. This hash code should be stored at your database by following the same instructions described in the devlounge article.
The script intentionally does only the calculation and do not update the database as this can be a security breach.
Posted in wordpress misc | December 30th, 2007 No Comments »
The reason for having style information on top and javascript at the bottom has nothing to do with wordpress but everything to do with the way browsers are rendering the HTML page and the resulting user experience.
The browser tries to show activity as early as possible, and starts to draw the page almost immediately after the page was loaded. The drawing is based on the styling information available at the the time the element is being drawn. If a style information is read after the drawing process has started, the browser has to find all of the elements which might be affected by the new style and redraw them. The best thing to do is to give the style information a head start, and put it as close to the top of the page.
In terms of the wordpress plugin API it means that style information should be inserted at the wp_hook
function style() {
echo " <style>p {color:red}</style>";
}
add_action('wp_head','style');
Javascript code may alter the structure of the page while it is being loaded (with the document.write function for example), but since the changes can have a bigger impact, the browser actually stop everything it does while a javascript code is being parsed and executed. If this happens while the page content is being rendered, for the user it feels like the page is loading slower. When the javascript is at the bottom of the file, it still takes the same amount of time for the page to load and the rendering to be completed, but since the page is rendered earlier the user feels as if the page was loaded faster, even if the progress indicator on the browser’s status bar had not reached its “complete” status.
In terms of the wordpress plugin API it means that javascript should be inserted at the wp_footer
function js() {
echo " <script>var author="mark";</script>";
}
add_action('wp_footer','js');
Based on information from yslow related articles.
Posted in wordpress misc | December 14th, 2007 No Comments »
The reason for the bug is that the kubric theme generates list bullets by using a property (”before”) which is part of the CSS 2.1 standard which is not implemented by the IE 6 and IE 7 browsers.
One way to fix this problem is by specifying a different source for the bullet and using the IE conditional comments feature to specify it only for the IE browsers.
This is the code I’m using
<!–[if lte IE 7]>
<style type=”text/css” media=”screen”>
html > body .entry ul {
list-style: circle;
}
#sidebar ul li.page_item {
list-style: circle inside;
}
</style>
<![endif]–>
Posted in wordpress mu | October 4th, 2007 2 Comments »
It seems like many people which are considering the use of wordpress mu for their own purposes are looking for a localized version and don’t find one. This is probably a testament to the huge world wide popularity of wordpress and the free nature of it and its associated products (thems, plugins, localizations) that people have become used to expect that everything which is related to the wordpress brand name will be available and free.
So what are the reasons it is hard to find wordpress mu localizations although there are several wordpress mu based site all over the world?
- There are much less people which use MU then the single blog version. This means that there are less candidates for doing the not very exiting task of translation.
- People which actually use MU are often motivated by gaining some profit from their installations. Giving the translation for free might help possible competition.
- Many sites are targeting a specific niche and tweak the core code for their purposes. Translation of those sites might differ from the expected result.
- MU system usually host several blogs. Since an upgrade will require a coordination with the bloggers and many tests to assure that the themes and plugins work as expected in the new version, upgrades are delayed as much as possible. This means that a running MU site is very likely to be using a previous version and will not be interested in translating the bleeding edge versions.
I am sure that as MU becomes a more mature product, and gain more installers those reasons will go away, but what do you care about the future when you need the translation now, so here an explanation on what is quickest way to translate it by your self.
- Get the source code probably from here. If you intend to made changes in the default themes, then there is probably no point in tranlating them at this moment, and you can remove the themes directory (wp-content/themes), in the hope that this will save some work.
- Get a translation tool which can be used on your platform. You can use the same translation tools which are used for the translation of wordpress.
- Get the latest localized version of wordpress for your language.
- Locate the .po file which hopefully is included with the localized wordpress version (if you can not find one, try to contact the translator), and copy it for convenience, to the root directory of the MU source. Open it, find and change the path setting if needed to the path of the MU source, and run the update functionality.
- If you are using the poEdit tool on windows you will get a table with rows colored as blue, yellow or white. The white rows contain translations inherited from the localized wordpress and there is no need to change them. The yellow ones contain fuzzy translation (translation based on similar phrases found in the translated rows). The blue rows, don’t contain any translation.
- Now you need to actually translate it. As this is a boring task which might take several hours I advice that you go to a quite place in which no one will bother you and get you out of the zone. My experience is that it is better to try and translate as many stings in the initial attempt, as this is a boring task you will not like to repeat.
- After the translation was completed generate a .mo file (in the case of poEdit it involves a simple save).
- Install the MU. Change the value of the WPLANG variable in the wp-config.php file to your locale. Upload the .mo file to the wp-include/languages directory (don’t forget to rename it if needed to {your locale}.mo).
- Now its time for the iterative task of testing, debugging and testing again. For each string which you need to fix you should open the .po file with the translation tool if it supports search, or with a text editor, located the offending string and change it. Then you should use your translation tool to generate a new .mo file, upload it and try again.
- The order I have followed is to test the process of blog and users creation and deletion first, and then I have created a blog and checked that its admin panel have the right text in all places. I have decided not to fix any errors at the site admin panels as I am going to be the administrator of the site and the mistakes were not annoying enough.
- Now all that is left to do is to find nice themes and plugins that your users will love to use, and localize them. Since the process of localizing themes and plugins was discussed in many places and languages on the web I will not go into it.
Posted in wordpress plugins | June 12th, 2007 No Comments »
When search engine display relevant results from your blog, they usually display only the highest ranked page matching the search terms. People coming from the search engine, take a look at the page, and if they do not find what they are looking for, they might leave without ever having any clue that your blog contains more information which is relevant to to what he is searching for.
The original landing sites plugin by the undersigned offered a way to show to the visitor referred by a search engine a list of post which might be of an interest to him. Landingsites++ is a rewrite of that plugin with added administration functionality and some changes in its operation.
How does it work:
When a visitor enters the site, the plugin inspects the URL of the page which had referred him to the site. If the URL contains a parameter which resembles a google search (contains a “q” parameter) then the plugin displays in a configurable place a list of posts which have an exact match with the search terms used by the visitor. If there are more relevant post results then the plugin is configured to show, it can be configured to offer a full internal search for the search term.
Configuration options:
The configuration option are accessible from the admin window under the options/landing sites++/
- Welcome message - The message which gives the visitor some idea of what is the meaning of the links which follow it. Two special strings can be used to insert the name of the search engine and the search terms, and the message can formatted using HTML tags.
- Link formatting - By using HTML tags it is possible to format how the links will be shown.
- Internal Search referral - Use to configure the use and display of the automatic referral to the internal search
- Maximal number of result to display - The maximal number of links to related posts to show
- Placement - where to place the list of link, at the top the page or its bottom. Neither should be selected if you intend to manually change your theme.
Deficiencies:
- The plugin requires that the blog is hosted on a system which uses MYSQL 4.1 and above. Since this is the minimal requirement for wordpress 2.2, I guess it should not be a problem.
- Most popular search engines use the “q” convension, but not all of them. In case there is a search engine you realy need to support which do not follow this convention, it should be easy to change the mk_landingsites_get_delim function to support it.
- The parsing of the search is very naive and assumes that each word in the search terms should match. the plugin do not attempt to understand any of the options which can be used when searching with a search engine.
- The internal search being done searches only the titles and posts. Comments are not being searched.
- The placement configuration options work only with themes which are compatible with the recomended wordpress 2.0 loop structure. If it does not work for you, you will have to edit the theme.
How to manually change the theme to support the plugin functionality
The easiest way is to place the following line
<?php mk_landingsites_startloop(); ?>
wherever you want the list of links to appear.
If you need more control then that, you may use the following functions:
- mk_landingsites_get_referer(). Return the search site from which the visitor was referred.
- mk_landingsites_get_terms(). It reurns an empty string if the blog was not referred from a search engine, or the search term if it did.
- mk_landingsites_internal_search($terms, $limit). Returns an array of results for searching after $terms , with a maximum of $limit results. The array contains up to $limit arrays of results, sorted by their relevance. Each array contains an ‘ID’ of the post, its ‘post_title’ and ‘post_content’.
Installation:
Download this file, and upload it to your wordpress plugins directory (or even better create an mk_landingsites directory under the plugins directory and upload the file to there).
In the administration window change the plugin setting and activate it.
License:
Free for use, and modification for personal and not for profit usage.
You may not redistribute the code.
Posted in wordpress plugins | June 7th, 2007 3 Comments »
The DieOnSpam anti spam wordpress plugin blocks comments spam based on the language in which the comment is written, with any comment in english being treated by default as spam. For the full rational behind this plugin please read the initial version page.
Version 2.0 provides the following enhancments over the original version:
- Bug fix
- Comments from commentators which previously had posted a comment which was approved, are not being filtered by this plugin. Think of it as if the first approved comments served as kind of registration.
- An option to control whether an english comment with no links with no links in it should be filtered, was added. This might be useful if you are running a bilingual blog, and your comment spam usually contains links.
Intallation instructions:
Save this file, and upload it to your plugins directory. In your blog admin panel, enter the options/dieonspam window, configure the error message to be displayed for comments detected to be spam, and whether english comments without links are to be considered to be spam, and finally activate the plugin.
Upgrading from previous version:
Nothing special to do, just upload the file and check the new option.
Posted in wordpress plugins | April 4th, 2007 No Comments »
The aim of this plugin is to try and give an accurate account of how actual people are using the site, to a count of people which read the site (by using an aggressive method to exclude all of the bots), which article they have read, and from where they had been referred to the site. Logged-in users, which are usually the blog owner and writers, are excluded as well.
The GUI supplies information on which pages were read, with a clear identification of posts, home page, empty and non existing pages, category pages, author pages, and archive pages. For each page there is information the referrer to the page when the information is known. Other information made available is the external referrers to the site (an aggregate of the per page information), the type of bots reading the site, and the type of browsers being used to read the site.
Instead of the traditional way of identifying bots and browsers by their user-agent string, a method which required having a list of all the user-agents in the world which should be updated any time a new bot or browser is introduced, the plugin identifies bots by their behavior. Bots are usually not “interested” in styling information and therefore if a page load session loads a styling CSS file, it is probably a browser otherwise its a bot. This method is not 100% accurate since there are browsers like lynx which are text only browser, but their use is insignificant.
License: Free for personal use, and for non-profit organizations. Redistribution of this software is not allowed.
Installation: Download this zip file. Extract its content, and transfer the “pageviews” directory and its content to the wp-content/plugins directory of your wordpress installation. Now go to the plugins page in your wordpress administration section, and activate the plugin.
Usage: To view the statistics, go to the administration section, select the dashboard menu and the “page views” sub-menu. The default view shows the most popular pages at the last 24 hours, you can change this settings whenever you need to.
To do in the next releases:
- Improve the look of the GUI
- Group browsers by their manufactures
- Explicitly identify search terms which directed visitors to the site
- Provide widget to display the number of visitors