Tagged WordPress

Display Admin Notices in custom locations in the WordPress Dashboard

If you’ve used WordPress for a while, you’re probably familiar with the nice-looking notices (warnings and errors) that appear at the top of various admin pages:

Screen Shot 2013-02-05 at 2.46.59 PM

These notices are great for posting generic information relevant to a particular page up near the top, where they’ll be easily seen. But what if you want to use the .updated and .error classes to create messaging in other parts of the page? If you just add markup, it will move up to the heading of the page, because of the following JS that runs in wp-admin/js/common.js:

// Move .updated and .error alert boxes. Don't move boxes designed to be inline.
$('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2');
$('div.updated, div.error').not('.below-h2, .inline').insertAfter( $('div.wrap h2:first') );

This explains why messages get pushed to the top of the window regardless of where they are actually placed in the server-side markup. Also, it proveds a really easy way to put the message where you want it: just add a class of .inline and your message will stay where you want it.

Tagline Rotator plugin v2.0 is now available

NB: If you are having any problems with taglines not rotating after the upgrade, please de-activate and re-activate the plugin. This is due to WordPress no longer calling the activation hook when you upgrade a plugin through the Dashboard.

As is often the case over the holidays, I had a little free time to update my Tagline Rotator plugin, which was in need of some serious cleaning up. Version 2.0 is now available on the WordPress plugin repository, and includes the following improvements:

  • Entire plugin is now class-based and the code is significantly cleaned up and better organized
  • All the MySQL queries that the plugin used are eliminated. Instead of using a separate table, the plugin now stores its data in the wp_options table
  • If you’re upgrading from a previous version, the plugin will pull your current taglines from the table and save them to the wp_options table. It will not delete the old table (something like wp_tagline_rotator), so your old taglines will still be there. Once you’ve confirmed the taglines are working properly, you can safely delete the table. I’ll be adding an option to delete any tables created by the plugin thru the admin dashboard in a future version.

As always, if you encounter any problems or have any suggestions, please leave a comment on the plugin’s homepage.

WP-dBug

A colleague at work found dBug, a sweet PHP class for creating nice, clean debug output and implemented it into our framework. While debugging a different WordPress plugin, I realized how nice it would be to have similar output in WordPress. Thanks to some planned system downtime during a major datacenter move where I work, I finally had a chance to create a plugin to implement the dBug class. It’s basically a wrapper for the original class–all the credit should and does go to Kwaku Otchere for creating what is (in my opinion) the nicest-looking debug output I’ve ever seen. It’s simple as heck to use the plugin: just install it, activate, and call it like this:

[cc lang=”php”]
function fill_my_screen_with_stuffs (){
global $wpdb;
wp_dbug( $wpdb );
wp_die( ‘Did you know WP 3.0 has a cool new wp_die() function?’ );
}

[/cc]

As a side note, you can use dBug for whatever code you want–just include the single PHP file and use it according to the author’s instructions.

neverblog is now running on a Linode VPS

[simage=127,288,y,left,]Speed: sweet, glorious speed. That’s what you should find as you visit this site in the future, now that everything’s been moved over to a Linode Virtual Private Server. After checking out a colleague’s site that loads pretty much instantly, despite beingĀ  a similar WordPress blog, I decided to sign on with Linode and dump my current Dreamhost shared hosting. At the same time, I followed the same colleague’s suggestion to switch my web server from Apache to nginx. If you’re not familiar with nginx, and you’re hosting a site on which you control the web server, nginx is definitely worth a look as an alternative to Apache, since it’s lighter and faster (also, it seems that the program’s author is willing to work with users to improve functionality).

I was pretty happy with my Dreamhost shared hosting for a while, but this site has outgrown the limited resources that I had, and furthermore the actual physical host that Dreamhost had me on was getting quite old (and full o’ data). I tried a Dreamhost PS for the last week, and while it seems to be decently fast (although the preview PS has 2+GB of RAM), I’m a little ticked off by the pricing. When I was looking at the PS, it was listed as $15 a month for 300MB of RAM (not a bad deal). Once I signed up for the trial, however, the total cost was revealed as $15 plus the shared hosting fee I already pay ($10.95 a month). That brought the total to about $26 a month, a lot more than the $20 a month for the Linode VPS with 360MB of RAM. All in all, the last 4-5 hours of moving my sites over has been worth it, and Linode has been tip-top so far. I’ll post more on them as I continue to use their hosting, and post some articles about the configuration I’m running on the VPS.

Tagline Rotator Plugin for WordPress version 1.1

Thanks to the holiday break, there’s a new version of Tagline Rotator available in time for the new year. You can read about it on the WordPress site here. The major improvement is that it now uses WordPress database prefixing. If you’re not familiar with this, it won’t affect your use of the plugin (you should still upgrade though). If you run a WPMU (multi-user) blog, or if you have several blogs sharing a single database, however, this is great news. It means you can run as many separate instances of Tagline Rotator as you want on the same database, and they will each use the prefix assigned to that blog. Please let me know if you run into any problems with this new version, and please use the automated upgrade feature of WordPress (or at least de-activate and re-activate the plugin when you upgrade). This will allow the plugin to rename its table using the WP prefix. Otherwise, you will get a mySQL error if your WP database prefix is not wp_ as the new version will be trying to access the taglines from the renamed database before it has been renamed. De-activating and re-activating the plugin fixes this error if you do get it.

Shashin now has a WYSIWYG, or Is Mike Toppa a WordPress god?

I use the Shashin Picasa plugin for the photos on this site. I broke it today trying to upgrade my Tagline Rotator plugin, so I upgraded to the latest version of Shashin to try and get it working again (it did). After checking the version notes, I did a little dance–see, it used to be that you had to go into Shashin’s Tools page in your WordPress admin to get the unique ID associated with your Picasa photo in order to embed it. The main thing that attracted me to Shashin was the the wide variety of ways you can display photos, and the flexibility of the plugin to conform to different blog types, etc. However, while the notation used to insert a photo or a set of photos is simple and quick, having a WYSIWYG within the WordPress editor is very useful and a welcome addition to the plugin. I’d have to say that, for my purposes, Shashin is perfect and its author, Mike Toppa, deserves a good amount of praise for the work he’s done.

License to Blog: REVOKED

License to Blog-REVOKED
Matt the Mac Jedi drew up this image after reading the story about my recent altercation with a disappointed theme downloader. Apparently, having ascertained that said blogger lacked a full understanding of communication on the WWW, not to mention what open-source code is, it was determined that his license to blog needed to be revoked. I still can’t stop laughing.

license to blog, wordpress, blogging, open source, themes, wordpress themes

WordPress Download Monitor Plugin

After a recent post that included a couple of small .zip files for download, I decided I might want to track how many times my files had been downloaded. A Google search for ‘wordpress download monitor plugin’ yielded the aptly named WordPress Download Monitor plugin. At first glance, it seemed as if I would need to re-upload anything I wanted to count downloads on, which seemed like a pain, but I figured if I decided later I had to have a count, it would just be more downloads to re-upload, so I decided to install it and try it out.

The install was typical–upload to your plugins directory and go activate it in the admin section of your site. The first clue that I was in for a treat is right there in the description of the plugin–it tells you where its options page is. Once in the management area, I immediately noticed that you can either add an Existing or a New download to track. Adding an existing download was as simple as pointing the plugin to the URL and giving it a title. Download Monitor then offers 4 simple ways to integrate the plugin into your post using simple bracket tags and the unique ID of the download. You can specify whether to show a link to the download and a count, just a count, or just the download. There’s also some handy PHP functions that you can use to show your top downloads, etc.

All in all, this seems to be a really great plugin. I was worried at first that I might have to lose a bunch of time re-uploading stuff, but obviously that eventuality was accounted for by Mike Jolley, the brains behind Download Monitor. Other than that, it works for keeping a count, and it’s easy to use. The only thing I might think to improve is that some sort of download image could be added as an option, much like the really nice one on the plugin’s homepage. That will bring more attention to the download and separate it from the general flow of the story. Other than that, I’m a happy camper.

wordpress download monitor, wordpress plugin, download, monitor, plugin, wordpress

AWNB will now feature a ‘McAfee Issues’ category

After careful consideration and a review of my postings, I’ve come to the inevitable conclusion that I need a category related directly to McAfee, purveyors of the fine VirusScan Enterprise product I’ve come to know and love so well. Heavens to Betsy, how will I ever convert all of those posts seamlessly and quickly? With the Armenian Eagle’s Category Converter plugin–one of the best WP plugins out there–of course. First in line, though, is upgrading to WP 2.1 (Ella), which is a real pain with all the hacked javascript going on on this blog.
wordpress, category converter, plugin, wp, virusscan, mcafee, armenian eagle, wordpress 2.1