A-  A  A+ RSS Feed

Deep Thoughts by Robert Felty

thoughts on wordpress, latex, cooking et alia

Archive for the 'wordpress' Category

Friday, July 24th, 2009

On blog navigation

A few navigation choices after reading an article on a blog

A few navigation choices after reading an article on a blog

I was recently debating with my friend Danny how people navigate sites, especially blogs. As the author of 3 plugins designed to enhance site navigation (collapsing archives, categories, and pages), I of course had my opinions, but what is really compelling is data. So I finally decided to modify my links on my site a bit in order to figure out more exactly how people are navigating my site. There are several different ways in which people can navigate to a particular page on my site.

  • external
    • search
    • social network (digg, reddit, friendfeed, etc.)
  • internal
    • collapsing archives widget
    • collpsing categorries widget
    • collapsing pages widget
    • category page
    • archive page
    • search
    • index page link
    • prev page link
    • next page link

I added a ?nav query to each of these particular options, so that I could then find those values in the server logs. I wrote a little bash script which mostly does some grepping of the log. Here is the script, and the results for the last 12 hours or so. My plan is to collect about 30 days worth of data, and see what the data shows. I think the results will be informative.

#!/bin/bash
# calculate how people navigate my site

# first we filter out all spiders, any internal blog stuff, and requests from
# my own ip, and then pipe that to filter out page refreshes
grep -vEi '(Mediapartners-Google|bot|spider|crawler|slurp|scoutjet|httpunit|htmlparser|favicon|wp-cron.php|wp-content|wp-photos|wp-comments|feed|fail\.php|wp-login.php|POST|\/images|wp-includes|forum|71\.237\.102\.16)' experiment_log |grep -Ev '"GET (.*) .*\1' > nobots

# next we separate into internal and external referers
grep 'http://blog.robfelty.com' nobots > INTERNAL
grep -v 'http://blog.robfelty.com' nobots > EXTERNAL

EXTSEARCH=`grep -ciE '(yahoo|bing|google)' EXTERNAL`
SOCIAL=`grep -ciE '(fark|reddit|digg|slashdot|friendfeed|facebook|twitter)' EXTERNAL`
NOREFERER=`grep -c '"-"' EXTERNAL`
EXTREMAINING=`grep -viE '(yahoo|bing|google|fark|reddit|digg|slashdot|friendfeed|facebook|twitter)' EXTERNAL|grep -cv '"-"'`
COLLARCH=`grep -c '?nav=collapsing-archives' INTERNAL`
COLLCAT=`grep -c '?nav=collapsing-category' INTERNAL`
YEARLY=`grep -c '?nav=yearly' INTERNAL`
MONTHLY=`grep -c '?nav=monthly' INTERNAL`
CAT=`grep -c '?nav=category' INTERNAL`
COLLPAGE=`grep -c '?nav=collapsing-pages' INTERNAL`
SEARCH=`grep -c '?nav=search' INTERNAL`
INDEX=`grep -c '?nav=index' INTERNAL`
PREV=`grep -c '?nav=previous' INTERNAL`
NEXT=`grep -c '?nav=next' INTERNAL`
TOTAL=`wc -l nobots|cut -f1 -d ' '`
INTERNAL=`wc -l INTERNAL|cut -f1 -d ' '`
EXTERNAL=`wc -l EXTERNAL|cut -f1 -d ' '`
# Only firefox prefetches
PREFETCH=`grep -vE '\?nav=(collapsing-category|collapsing-archives|search|index|previous|next)' INTERNAL|grep -c 'Firefox'`
INTREMAINING=`grep -vE '\?nav=(collapsing-category|collapsing-archives|search|index|previous|next)' INTERNAL|grep -cv 'Firefox'`
echo "TOTAL PAGES = $TOTAL"
echo "  EXTERNAL= $EXTERNAL"
echo "    EXTSEARCH = $EXTSEARCH"
echo "    SOCIAL = $SOCIAL"
echo "    NOREFERER = $NOREFERER"
echo "    REMAINING = $EXTREMAINING"
echo "  INTERNAL= $INTERNAL"
echo "    COLLARCH = $COLLARCH"
echo "    YEARLY = $YEARLY"
echo "    MONTHLY = $MONTHLY"
echo "    COLLCAT = $COLLCAT"
echo "    CAT = $CAT"
echo "    COLLPAGE = $COLLPAGE"
echo "    SEARCH = $SEARCH"
echo "    INDEX = $INDEX"
echo "    PREV = $PREV"
echo "    NEXT = $NEXT"
echo "    PREFETCH = $PREFETCH"
echo "    REMAINING = $INTREMAINING"
TOTAL PAGES = 197
  EXTERNAL= 131
    EXTSEARCH = 51
    SOCIAL = 0
    NOREFERER = 43
    REMAINING = 37
  INTERNAL= 66
    COLLARCH = 3
    YEARLY = 0
    MONTHLY = 0
    COLLCAT = 4
    CAT = 0
    COLLPAGE = 0
    SEARCH = 1
    INDEX = 1
    PREV = 0
    NEXT = 0
    PREFETCH = 52
    REMAINING = 5
Wednesday, July 8th, 2009

BBpress forums and wordpress plugin development versions

Gentle reminders for forum users

Gentle reminders for forum users


I host a bbpress forum for each of my wordpress plugins, so that people can report bugs and ask for new features. Bbpress has many of the same features as wordpress, and it integrates very well with wordpress. It is also very fast, and as of version 1.0, now has the same admin interface as wordpress.

When people report bugs on the forum, I frequently try to fix them in the development version of the plugin, and ask them to test it, which requires downloading the development version from the wordpress.org site. Unfortunately, the development version is a bit hidden there, and I have gotten very tired of typing out the url in my replies, so I finally modified the topic.php file in my bbpress template to include a link to the development version (and a link to the faq too).

One downside of bbpress is that there is no documentation yet, so you have to search around for different functions in the code. I have done this several times now, so that it only took me about 20 minutes to figure out how to implement what I wanted. Here is the code I added (just before post_form())

<?php
$thisforum= bb_get_forum(get_forum_id(0));
  $development='http://wordpress.org/extend/plugins/' . $thisforum->forum_slug .
      '/download';
  $faq='http://wordpress.org/extend/plugins/' . $thisforum->forum_slug .
      '/faq';
?>
  <div class='alert'>
  Have you read the <a href='<?php echo $faq; ?>'>FAQ</a>?<br />
  Have you tried the latest <a href='<?php echo $development; ?>'>development version</a> (at the bottom)?
  </div>

I then added the following css to my theme to make it stand out:

.alert {border:1px solid #999;
        background-color: #FBB;
        font-size:1.1.em;
        padding:.2em;
       }
Thursday, June 11th, 2009

wordpress 2.8 is out, and my plugins are ready

As I mentioned a few months back, wordpress 2.8 has a completely new widget API, which means that I had to do quite a bit of work to get my widgetized plugins ready for 2.8. Fortunately, the new API is much better than the old style. I won’t guarantee that they are without bugs, which is why I am calling them beta. But they should all work with the defaults at any rate. They also have some new features, including several default style templates, which should make styling easier for most users. And for people who don’t like widgets, now you can enter all the options into your template manually, meaning you can use different options in different parts of your theme if you wish.

Also I will be on vacation for a few days, so I won’t be answering questions in the forum until Monday the 15th.

Friday, June 5th, 2009

Releasing Postie 1.3.alpha, packed with new features

Thanks to all the users who helped me test out the 1.3.testing version of postie, the wordpress plugin which allows you to post by e-mail. I now feel that it is stable enough to call it 1.3.alpha. There are probably still some bugs, but I think that the new features probably warrant giving it a try for most users. Here is a summary of the new features and fixes:

  • Now using default wordpress image and upload handling, which means:
    • No more creating special directories for postie
    • No more confusion about imagemagick
    • Can now use the gallery feature of wordpress
    • Attachments are now connected to posts in the database
    • All image resizing uses wordpress’s default settings (under media)
  • Configuration, settings and documentation improvements
    • Completely redesigned settings page (mostly thanks to Rainman)
    • Reset configuration no longer deletes mailserver settings
    • Now including help files and faq directly in settings page
  • More media features
    • Automatically turn links to youtube into an embedded player
    • Added option to embed audio files with custom templates
    • Video options are now template based
    • Image options are now solely template based, with several new default
      templates
  • Bug fixes
    • Uploading images from vodafone phones should now work
    • Correctly handling Windows-1252 encoding
    • Correctly handling non-ascii characters in subject line

I still need your help! As I mentioned there are bound to be some bugs, and I would appreciate if you give me feedback in the postie forum. Several people have also provided localizations. That is a big help. Some of the current localizations now need some updating. If you are familiar with that, I would be grateful. A .pot file is included with the postie distribution.

I have mostly stopped development on the 1.2 branch of postie. I will be adding new updates to postie in the development version.

Below is a screenshot of the new options page for postie.

Screenshot of the new postie options page, showing the video and audio templates

Screenshot of the new postie options page, showing the video and audio templates

Saturday, May 16th, 2009

2 new versions of postie released

I would like to announce 2 new versions of my popular postie plugin for wordpress, which gives users advanced options for posting to their blog via e- mail.

The first new version is 1.2.2, which has some minor bug fixes and improvements over 1.2.1. I will continue to release several more 1.2 releases over the coming weeks with bug fixes.

The second new version is 1.3.testing, which is, as the name implies, under testing. The main new feature for the 1.3 line will be the use of wordpress’s built-in attachment uploading, and image handling. This may sound trivial at first, but it actually makes a big difference. Postie has been around since 2004. Over the last 5 years, wordpress has changed dramatically. Postie has gone through several different active maintainers, and several periods of neglect. During the times of neglect, postie got sorely out of date. I am working on bringing it back up to par with wordpress.

For example, Wordpress 2.5 introduced the gallery feature, which makes it very simply to make a nice thumbnail gallery of images in a post simply by using the shortcode . However, this depends on having a link between attachments and the post. Postie currently does not do this. In fact, postie <=1.2 uses its own custom upload directories, instead of the default wordpress directories. This makes postie more difficult to install and configure, and confusing to many users. Starting with 1.3.testing, this is no longer the case. Now postie uploads files into the default wordpress uploads directory (or whatever custom directory you have specified), and it links attachments to the post, which means you can use the gallery feature.

Postie used to have a bunch of different options for image handling, and did the image handling all itself, using either GD or imagemagick. Many users got confused by the imagemagick option. Starting with 1.3.testing, postie now lets wordpress handle resizing images — the same way it does when you would use the web-based post editor. This should simplify options dramatically, and hopefully cause much less confusion.

Also in the works, though not fully documented yet, will be the ability for postie to check multiple inboxes. This could be handy if for example, you have a multi-author blog, and you want some people’s posts to automatically be posted, while others be posted in draft form, and require approval.

I very much appreciate all the feedback I get from postie users in the postie forum, including feature requests, bug reports, praise and donations. I hope that the adventurous amongst you will take the time to download 1.3.testing and let me know what you think. As it is a testing version, I will be updating it on a fairly regular basis. Once I get some feedback from users, I will release an alpha version, and then a stable version in the next month or two.

Finally, I should mention that I posted this via postie, as well as this cooking post which shows off the gallery feature of wordpress.