plugin

Milestone for WordPress self-hosted v0.9

The website I made for Rachel and myself is, of course, run on WordPress. After looking through some themes, I eventually settled on the Forever theme. Forever is a WordPress.com theme, but can be downloaded via SVN from
https://wpcom-themes.svn.automattic.com/forever/1 so someone can use it on a self-hosted WordPress installation. Everything was going great, but I couldn’t find the plugin for this really neat widget they have that counts down to The Big Day:

It’s called Milestone and as of January 2012 it was supposed to be included in a future release of Jetpack, the official WordPress plugin for things of that nature.

But here we are in August and there’s no plugin.

And I don’t know what the timeline is for actually releasing it.

So I did what any engineer would do when they don’t want to wait, I made my own version. There’s decent enough documentation on the backend and the front end is just stylized with CSS. It’s a pretty simple implementation and only took a few hours to crank out. There are some more things I want to add and tweak, like adding a drop down calendar select and better input checking, but it will work for now.

Here’s how it looks:

Milestone clone

It’s a quick solution that I hope others will enjoy too. I also got a chance to try out using a deploy script to help automate the push from GitHub to SVN. This could help a lot of things go smother.

Read more or download v0.9!

0
  1. svn co http://wordpress.org/extend/plugins/milestone/ 

New Plugin: WP Plugin Data

For better or worse, I’ve released a brand new plugin. It was one of those things I did spur of the moment because I wanted to implement something and the way I wanted to do it wasn’t available (insert some comment about necessity being the mother of invention here).

The new plugin is WP Plugin Data. It’s designed to use the WordPress.org Plugin API to get data about a specific plugin. John Blackbourn already wrote a plugin, Plugin Info, that does something similar. However, it requires that you set a Custom Field to the plugin name. I didn’t like this approach because I could only grab data for one plugin per a page.

So, using John’s plugin as a template, I wrote my own plugin that used shortcodes to add the data. And then I released it. This is why I love the GNU GPL. As for naming, I really hate it when plugins use the “WP” moniker in their titles. Typically, the plugin has absolutely no affiliation to WordPress and I feel the only reason they put “WP” in their name is to gain some form of (undeserved) recognition. For this reason, I really didn’t want to put “WP” in the title. However, I did end up using because this plugin actually does integrate itself into the WP.org backend using the API…so I feel the use is justified.

Anyway, enough about that.

Read more, or download version 0.5!

0

Force User Field Registration End-of-Life

For better or for worse, this is the End-of-Life announcement for Force User Field Registration.

This history behind the plugin is rather odd for me. I originally wrote it as a proof-of-concept for Add Custom fields to User Profile & Registration Pages. I never planned to actually implement it and support it, which I suppose it what I get for trying to be helpful ;).

In fact, the orginial code was just posted as a snipnet on my blog over two years and required the user to copy and paste the code into a file themselves! I finally released the code in a file you could download a four months later. It’s seen several upgrades, mostly to deal with WordPress updates that broke stuff and I even forked it into a version for WordPress MU.

I think one of the most difficult things about maintaining this plugin over the last few years is the fact that I never use it myself. I really enjoy using my own plugins and not using them on a regular basis creates a very wide disconnect for me, I don’t get to eat my own dog food.

I digress.

I was answering a request related to the Force User Field Plugin and doing some research when I came across a superior plugin that not only meets all goals set out by Force User Field Registration, but far exceeds them.

It’s called Register Plus and is coded by Skullbit.

I downloaded it and played with it briefly; and I have to say, I really like it. There are a few quirks that I’m sure the developer will work out, but nothing blocking. It also implements a number of requests that users have asked for in the past and I have not added because they fall outside the scope of the plugin or I never got around to.

Thanks to everyone who has ever used the the plugin or left a comment. At last check, there were over 1600 downloads and 143 comments (probably half of which are mine, though).

The formal announcement:

Force User Field Registration is going End-of-Life on or before December 31, 2008 23:59 PST.
I will continue to provide official patch releases (i.e. 0.6.x) as needed to maintain compatibility with WordPress 2.6.x and WordPress MU based on WordPress 2.6.x.

On or before January 1, 2009 00:00 PST, I will provide help on a case by case basis, however I will no longer be releasing updates.

The code will remain posted and licensed under the GNU GPL. The official plugin page will remain up: Force User Field Registration

What I believe to be a suitable replacement:
Register Plus by Skullbit.

0

Force User Field Registration v0.6

So it seems like WordPress 2.5 ended up breaking some things in the previous version. So I did some work over the weekend and brought everything back up to speed. Here’s a list of what’s been updated:

  • Added PHPDoc
  • Updated add_action to use inbuilt filter rather then have users add their own
  • Update admin UI to 2.5 LnF1
  • Updated input tag to make it look like native input tags
  • Updated fergcorp_forceRegistrationField_updateFields to use passed variable instead of DB query
  • Updated error handling in fergcorp_forceRegistrationField_checkFields to use the new WP_Error object (note: this makes WP 2.5 a minimum requirement)

I think the best news is that you don’t need to modify files anymore to get the plugin to work, you can just drop it in and go. WordPress also has implemented a new error handling framework (WP_Error) which is pretty spiffy.

On a side note, I did take a gander at the MU version of the plugin and it appears to be working properly…at least for now.

Read more or download it!

1 LnF: Look and Feel

0

Countdown Timer v2.2

I wanted to release this earlier, but between finals, being sick, and field session, I haven’t had a lot of time. This version of Countdown Timer (almost) updates the UI to 2.5 look and feel. As it turns out, there’s actually some function calls I can use to better create the UI and I’ll be using those in the future. There’s a couple of bug updates and added some new functionality.

Also, Countdown Timer v2.2 requires WordPress 2.5 or higher!

The run down:

  • Updated some phrases that missed being i18n.
  • Updated i18n to use use sprintf’s to assist in proper translation.
  • Update the admin page to WordPress 2.5 Look and Feel.
  • Users are now able to define the data (text/HTML) that comes after the title and before the actual countdown.
  • Implemented a new function, fergcorp_countdownTimer_single($date), that allows users to create a one-off event outside of The Loop. $date should be PHP strtotime parseable string.
  • Plugin output is now XHTML 1.0 Strict compliant.

Read more or download version 2.2!

0

Call for Translations: Pending Release of Countdown Timer v2.2

The release of Countdown Timer v2.2 is just around the corner (May 15th at 18:00 GMT). In preparation, I released the PO files for translation last night and sent out an email to all the wonderful participants who’ve translated in the past. Here’s the basic jist of what’s going on:

I’ve updated the PO files and uploaded them to my website. All you should need to do is find the language that’d you like to translate and click on the link below. The page will load with the existing data filled in that has not changed. The blank fields represent data that has changed and needs to be updated.

Also, there are a couple of special fields you should be aware of: “translator_name” is for your name as you’d like it to appear in the credits within the plugin (if you want it displayed). “translator_url” is for the URL link that will be associated with you name (again, if you would like it included).

There are a handful of fields that go something like: %d years,
The %d is a place holder for an integer (such as 5 days,) and can be moved around if needed depending on the localization requirements.

Similarly, there is a %s ago and in %s. Where %s represents a string (in this case, the countdown). This allows the translation of “in” and “ago” to be put in its proper place depending on the localization.

I really hope all that makes sense. If it doesn’t, I’d be more then happy to answer any questions you have. If you’re unsure of the context of certain strings, you can also download the trunk version version at http://downloads.wordpress.org/plugin/countdown-timer.zip

Languages already (mostly) completed:

  • Czech (cs_CS)
  • German (de_DE)
  • Spanish (es_ES)
  • French (fr_FR)
  • Dutch/Holland (nl_NL)
  • Portuguese/Brazil (pt_BR)
  • Swedish/Sweden (sv_SE)
  • Turkish (tr_TR)

As always, if you’d like to add a new translation, you can start here: http://fergcorp.com/project/phPo/phPo.php?poFileName=afdn_countdownTimer.po

And stay tuned for the pending release on Thursday!

0

Countdown Timer v2.1.1

After dilly dallying around for a couple months, I finally got serious about pushing the 2.1 version out the door. A couple of reasons for this actually.

First, the WordPress 2.5 is coming out end of March/beginning of April and I wanted to get out one more release (this one) before the next version of WordPress hits the streets.

Second, it’s fits with my development flow; releasing every few months when I can.

Here are the list of updates in Countdown Timer v2.1.1:

  • Fixed i18n translation issues where mo file would sometimes not be loaded
  • Updated UI (note: Based on UI code from Google XML Sitemaps)
  • Removed code dealing with recurring events (which has not been included for a few versions now)
  • Added js countdown ability to admin example (which doesn’t have wp_footer hook?)
  • Updated the link to the JS file to make it dynamic in case a folder gets renamed
  • Fixed a bug in the JS file that caused dates to be calculated incorrectly
  • Append a letter to the beginning of the unique id (as per XHTML requirement)…who knew?
  • Added two language files: Swedish (thanks to Mattias Tengblad) and Spanish (thanks to Google Translator)

The biggest change user will notice is the new UI. It’s based off the code from Google XML Sitemaps which I’m assuming is based off the code from WordPress itself. The great thing about the new design is that you can collapse, expand and move around the boxes to fit your work flow.

All the other changes are ‘under the hood’ and deal with code changes to make things work better in a larger variety of situations.

The Countdown Timer plugin is about three months shy of its third anniversary of public release! I’ve basically been maintaining it since the end of freshman year in college, which is when I switched to WordPress.

The first public version was v0.6. It had about 50 lines of code and used a text file to store the data. There was also no UI at all.

Version 2.1 is about 950 lines of code. Storing data in a text file is gone, instead using the WPDB. There are also several support files, including the javascript port of the countdown mechanism which is another 150 LoC.

Since the beginning of last March, there have been over 8700 downloads, which would almost pay for a semester of college if everyone gave a $1 (wink wink)!

Read more or download version 2.1.1!

Update: Had to increment the plugin to version 2.1.1 because of the way that WordPress does version numbers. In short, v2.01 is the same as v2.1. So I had to release this as 2.1.1.

0

Countdown Timer v2.0, Now with v2.01 goodness!

Update: There was a bug in the initial 2.0 version that required the plugin to have PHP5 or greater. This has now been fixed and it works with PHP4 and PHP5. Thanks to Jim Lynch for bug report.

Well, I finally managed to push Countdown Timer v2.0 out the door. It’s a bit later then I wanted, but it’s out and that’s all that matters for now. The biggest update for v2.0 is the ability to have the time automatically update using some Javascript. The idea for this has actually been around for a while and credit for it goes to Tobias (see: Ultimate Countdown Timer; 1-Up’d by a 14 Year Old). I was hoping I could use a lot of Tobias’ code, however I had changed a lot between then and now.

During the development phase, I wrote some code that basically took a look at what value the timer was at and then subtracted one second from that. Unfortunately, it quickly became clear that this method would not work. Because there are a variety of options in what units of time are displayed, screen scraping and then recalculating would have been pretty cumbersome. It also meant that I had two ways of calculating the time (the first way was the PHP-based fuzzyDate function I wrote, the second would have been this monstrosity). So I did what any code programmer does and copied myself. I converted the PHP-based fuzzyDate function into Javascript and then passed the needed values to the JS function. Voila!

In any event, here’s the changelog:

  • Updated plugin description line
  • Rearranged text in the installation notes to emphasize using the widget rather then the code
  • Fixed a bug that crashed the plugin if no dates were present (a PHP 5 problem??)
  • Implemented the ‘register_activation_hook’ function rather then the old way
  • Changed the way DB updates are handeled. Instead of having a specific update regimine for each version, the plugin will only update an option field if it doesn’t exist (if it exists, but is blank, it will NOT update…as it shouldn’t).
  • Updated fergcorp_countdownTimer_fuzzyDate with another variable so that the real target date is always known.
  • Removed code dealing with updates since WP 2.3 now does this automatically
  • Bug fix. Widget title isn’t saveable due to a programming error. Thanks to Michael Small for the catch.
  • Renamed some functions from afdn to fergcorp
  • Added JavaScript function for JS countdown
  • Tabbed $afdnOptions array to make it more readable
  • Fixed strtotime typo
  • Brought time display inline with current WordPress practice. This fixes the dreaded timezone glitch.
  • Strip non-sig zeros option added
  • Fixed bug where “No dates present” would _not_ show if the data was returned instead of echo’d
  • Renamed to $getOptions to $fergcorp_countdownTimer_getOptions to avoid clashing

Read more or download version 2.01!

Note: Comments moved and closed. Please leave future comments, questions, pleads for help, etc on the Countdown Timer page.

0

Countdown Timer v1.97 Technical Preview 2

It’s been many moons since I released the last technical preview of Countdown Timer 2.0. Honestly, things were stalled for a bit because I was busy with school and trying to figure out how I wanted to do what I wanted to do with the program.

The semester is over and I got it all figured out. So welcome to Countdown Timer version 1.97, better known as version 2.0 technical preview 2.

The Javascript that handles the updating of the countdown has been completely rewritten. I ended up scrapping what I had and then taking the PHP code I was already using and converted it to Javascript. This is the “elegant solution” I mentioned I was looking for earlier.

In terms of stability, everything seems fine; I am currently using this Technical Preview on AFdN. There are a couple known bugs that deal with stripping non significant digits and I haven’t fully tested the upgrade process. Other then that, everything is complete. I’m hoping to have 2.0 shipped before the New Year.

Go download it!

0

Google Chart API

I typically don’t blog about new Google stuff, especially APIs (application programming interfaces). However, this one is particularly cool because it allowed me to easily finish up a project that I had shelved for several months (maybe years? I’ll just call it ‘a while back’).

A while back, I had this idea to chart monthly blog frequency. I had found some code that did a pretty bang up job of making graphs using just PHP. However, it wasn’t the sleek looking graph I was hoping for. I had bookmarked a few sites that had Macromedia Flash applications that you could just drop the data into, but I never got around to playing with them.

Finally, Google introduced the Google Chart API. In a nut shell, I can easily create graphs such as:

Blog posts for Nov. 2007

This chart shows my blogging frequency for the month of November. The code I’m using on the back end is pretty crappy (I literally just patched some code I already had) and it can only handle a single month at a time.

Technical details to follow…
Read More »Google Chart API

0