Pages

Saturday, February 16, 2013

Wordpress stuck in maintenance mode

Problem: You are using WordPress’ great feature of automatic theme or plugin updates, but the AJAX throbber doesn’t stop moving – your site seems to be stuck. You hit the reload button of your browser and this is what you get:

“Briefly unavailable for scheduled maintenance. Check back in a minute.”

Solution: Open your (S)FTP program and delete the file called “.maintenance” in the root of the WordPress folder. This lets WordPress ignore the failed update, which you can then try again. It might be useful to update plugins one by one, or to check if some of them have become unstable.

Thursday, February 7, 2013

Moving Wordpress, the Dirty Way

Sometimes it’s time to say goodbye. To a Web Host for example. But we want to take our beloved WordPress website with us. If the relocation is urgent (for example because the old host charges a ridiculous yearly fee) this can cause quite some stress. Calm down. Here is a short list of how to move any WordPress site in no time. Prepare some coffee and just follow these steps.


  1. Grab your files. I normally use SFTP to copy the files from my old host to my new host. This takes about 5 minutes if your WordPress installation is not too large. Transfer mode “auto” should be fine. In case you have a lot of large plugins installed you could use yet another plugin to backup your files and download them as a zip, that you upload to your new host later. (Of course, if you have shell-access to your server, you can use that).
  2. Grab your database. Your old host should provide access to a tool like PhpMyAdmin, where you can export the database. Just use the standard options and save the .sql file.
  3. Upload your files. Create a new directory in the root of your new web space and place the files there. You can of course copy them directly from one FTP site to another using a smart FTP client. (I install the site on my localhost WAMP server before I transfer it to the target).
  4. Create a (sub)domain. Your new web host has a web interface such as Plesk, where you create a new subdomain, or order a new domain. They should notify your old host and take care of domain registration. You map that (sub)domain to the directory created in the previous step.
  5. Create and upload the database. In the same web interface, you create a new database. Choose a password. Write down database name, username, and password. Use Import to import the .sql file you downloaded previously.
  6. Change your wp-config.php. You enter at least the following information:
    database host (often, but not always, localhost
    database name
    user name
    password 
  7. Change permalink structure. If you visit Settings > Permalinks, WordPress should automatically update your permalink structure, if you change the setting and save it. In my case, this didn’t happen, so I changed it directly in the MySql database using the following SQL statement (careful):
    UPDATE wp_posts
    SET guid = REPLACE (guid,'[old-url]', '[new-url]')
    WHERE guid LIKE '[old-url]'

    Replace [old-url] and [new-url] with the names of your urls.The WHERE-clause is not necessary, but added in case for whatever reason you have links to external pages in your database, that should not be changed.
All set. You have moved your WordPress installation. You might want to test it first, and fine-tune the settings of your plugins, particularly the ones handling caching and SEO.

Saturday, February 2, 2013

Web Stats with Piwik

Yesterday I started using the open source alternative to Google Analytics, Piwik (www.piwik.org) on my WordPress multisite network. Setup is fast and easy. Here are some comments on the setup steps and possible issues:

  1. Download the piwik zip (about 6 MB, fast);
  2. Upload to your browser. I placed it at {root}/piwik.
    SSH/SFTP is recommended as there are many thousands of files and it would take a long time using FTP. Make sure transfer mode is set to “binary”, because “ascii” or “auto” would result in messing up line breaks, so that you don’t pass the file integrity check of Piwik;
  3. Creating a database is trivial. I used a separate DB that I can DROP whenever I get enough of Piwik;
  4. It works pretty much out of the box. In the menu item “API” you’ll find your auth-code, that you put in the appropriate text field of the WP_piwik plugin.

Install was fast and with the WordPress plugin WP_piwik installed, tracking codes can be added automatically to all your blogs, and stats are integrated with your WordPress dashboard.

Enjoy the narcissism (or masochism) of watching your visitors come and go in real time :)

Friday, February 1, 2013

.htaccess rules

… or does it? I found this list of things you can do with .htaccess that I want to share with you.

http://devmoose.com/coding/20-htaccess-hacks-every-web-developer-should-know-about

Have a look if you like to

  • prevent spammy commenters
  • ban IP addresses
  • protect files or directories with a password
  • redirect to another site without being punished by the big G
  • create custom error pages
  • remove filename extensions from your URL

and more :)

 

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Lady Gaga, Salman Khan