Be Smart: Update/Backup WordPress

Over the last two weeks we have been busy fixing a lot of issues for people that could have been avoided all together if two simple tasks were done:

  1. Backup your WordPress data
  2. Keep WordPress up to date

Luckily for most people – both of these tasks are simple and even automated. First of all – make sure you always have a recent backup of your WordPress database. There is a great plugin available (free) that will actually automate the process and even email you a copy of the database every x days, x weeks, etc. If you have one plugin installed with your WordPress site – install AND use WP-DB-Backup.

If you have a lot of media on your local server – make it a point to back that up every x days (whatever you can live with if something were to happen).

As for keeping WordPress up to date – it has never been more simple. When there is a new version of WordPress available – you will be notified when you log into your site. Simply click on the link to either download the latest version or to update WordPress right then and there. You cannot imagine how much time, effort, stress, and money simply updating WordPress can save you in the long run.

WordPress: Keep Up to Date – No Excuses

Over the past few days, there has been a lot of buzz going around about keeping WordPress up to date because of a specific worm going around that is causing havoc for out of date WordPress versions. The worm creates a user, hides it from the user list, and then inserts all kinds of junk into your posts.

There are multiple ways to easily find out when WordPress has been updated.

Since everyone who uses WordPress should stay on top of these updates, here are a few ideas on how to find out when a new version has been released:

  1. Pay attention the the “Upgrade Now” notice when you log into WordPress.
  2. Get notified by email with the Upgrade Notification by Email plugin
  3. Read regularly/subscribe to the WordPress blog
  4. Read regulary/subscribe to this blog

Updating is quick and easy – and should always be done after you have a database backup. Database backups are quick and easy as well with WP-DB-Backup plugin.

Not really sure if you want to do the upgrade yourself? We would be happy to do it for you – just contact us.

WordPress 2.8/Plugins Issues

I have updated over 25 sites so far and for the most part – everything has gone smoothly. There were a handful of sites though that had issues with a few plugins (including this site) due to one common issue: jQuery. If you are seeing any strange behavior – post upgrade, the first thing you will want to do is to make sure all your plugins are up to date. After that – if you are still having problems – check to see if any of your plugins rely on jQuery. If they do – next check the code (either look at the js files in the plugins, or look at your site’s source code to see if it is loading an old version of jQuery). There is a good chance they are using an older version, or are relying on something that no longer works with the latest release of jQuery (1.3.2 as of today).

Some plugin developers are aware of the issues but have not released an updated plugin. Because you are most likely not alone with your issues – check out their support forums, or post comments to see if someone came up with a quick fix so you can be back in business.

While most WordPress updates can be performed quickly and easily by almost any user – there are times when you run into unexpected problems that can cost you dearly. When this happens – don’t hesitate to call us. We have been working through WordPress updates for years and can help out!

View All Options for WordPress

Ever need to view all options for all your plugins (and standard WordPress options like home URL, etc)?
You can view every option available (and edit most) by going to: http://www.yoursiteurl.com/wp-admin/options.php (assuming WordPress is in the root folder).

So now if you need to look at options, make changes, or see a particular value – you can do so on one page.

Conditionally Show Only On Home Page (Front Page)

There a are two functions that are used quite a bit to conditionally show content on the very front page (home page or page 1 of your blog). First - we had the function is_home(), but in WordPress version 2.5 - a new function was introduced: is_front_page().

You might think both would conditionally only display content on the home page (front page, page 1 of your blog) - but you actually need to use the following code to accomplish showing something ONLY on the front page of your paged blog:

PHP:
  1. <?php if (is_front_page() && !is_paged()):?>
  2. <p>Show this text only on the home page</p>
  3. <?php endif;?>

So - if you want to easily show something on what I would consider the front page - use the code above to successfully achieve that. (This is particularly helpful if you have ads that run speficically on the home page and others that are ROS (run of site).

Further reading:

WordPress 2.5 Common Questions and Answers

After upgrading a number of sites to WordPress 2.5 - the questions are pouring in over the new user interface and the new functionality. I have compiled a list of the top questions I have received so far.

  1. I am getting weird PHP errors on my pages, what is going on? I have been busy with a lot of these issues and mostly from people who have updated to WordPress 2.5 but did not update any of their plugins at the same time. During the installation process - do not forget to grab the latest version of your plugins as well.
  2. My thumbnails are squished - how do I make them look better? WordPress 2.5 allows you to set the size of your thumbnails as well as gives you a "medium" size image option. By default, WordPress uses this option: Crop thumbnail to exact dimensions (normally thumbnails are proportional). If you upload images that are not square - this will really make your thumbnails look squished. I would recommend un-checking this option. (Settings > Miscellaneous)
  3. How do I turn on/off Gravatar support? This setting is located at the bottom of the discussion setting page (Settings > Discussion)
  4. How can I link my images to a page (attachment) like I did in 2.3? If you want to link your images to a page with a bigger version of the image within your page template, you can do so by selecting "Post URL" in the "Link URL" field when uploading an image with the new media uploader. There is also a new template for this page - image.php. You can find an example template in the default theme.
  5. My comments are not visible in the WordPress admin - what can I do to fix this? I have found this to be an issue on some sites with really outdated versions of WordPress. By executing: create index comment_date_gmt on wp_comments(comment_date_gmt); on the WP database - I have found that that usually clears it up. (Thanks to the WordPress forum thread on this)
  6. What all changed? If you want a great overview (with a video) check out the WordPress blog post on WordPress 2.5

Hopefully these answers will help you with getting more comfortable with WordPress 2.5. There are a lot of big and small changes to this new version of WordPress and every day I use it - I like it more (and hope you do too).

My Page Order WordPress Plugin Modifcation

I have been working with a client recently that was using the My Page Order plugin for the WordPress CMS I set up. They had several "draft" pages they used for templates and did not want them to show up in the My Page Order Admin interface. After looking at the SQL code, I added in a piece that would only show published (live) pages.
To make the same change in your code, open up the plugin file (mypageorder.php), go to line 47 and change the following line:

PHP:
  1. $results=$wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = $parentID and post_type = 'page' ORDER BY menu_order ASC");

to:

PHP:
  1. $results=$wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = $parentID and post_type = 'page' and post_status='publish' ORDER BY menu_order ASC");

Now, only the pages you really want to order will appear in the menu.