Category Archives: WordPress

AppEngine WordPress plugin version 1.6 released

We’re happy to announce the latest release of the AppEngine WordPress plugin, version 1.6. We encourage all users of WordPress on App Engine to upgrade to this new version as soon as possible.

This new versions includes the following bug fixes.

  • Media uploads will no longer generate an HTTP error if editing the page for more than 10 minutes.
  • Fix error with image sizes not being shown correctly when attaching images to a post.

Please report any issues with the plugin in the support forum, or ask questions on stackoverflow where members of the team actively participate.

We also gladly accept pull requests – you can find the plugin source on Github.

banner-772x250

AppEngine WordPress plugin version 1.4 released.

We’re happy to announce the latest release of the AppEngine WordPress plugin, version 1.4. We encourage all users of WordPress on App Engine to upgrade to this new version as soon as possible.

This new versions includes a number of bug fixes, as well as a new feature for serving media files over HTTPs.

Bug Fixes

This version of the plugin includes fixes for the following bugs:

  • The default HTTP fetch timeout is now 30 seconds, and fetch errors include a more descriptive message.
  • The public URLs for uploaded media now work correctly in the development environment.
  • The plugin now uses autoloading in the AppEngine SDK to improve load time performance.

New Features

This version of the plugin includes a new feature, that makes it possible to serve uploaded media files over HTTPs or HTTP.

To enable HTTPs serving of uploaded media, select the checkbox in the plugin settings page, as shown below.

Secure URLs checkbox.

Once selected, all media files that are subsequently uploaded will be served over https. Note: Changing this setting has no affect on media files that have already been uploaded.

Please report any issues with the plugin in the support forum, or ask questions on stackoverflow where members of the team actively participate.

We also gladly accept pull requests – you can find the plugin source on Github.

Using the WordPress Importer From the App Engine Plugin

As we announced recently, the new version of our App Engine WordPress Plugin includes import support for WordPress export files, forked from the popular WordPress importer plugin.
This plugin lets you take content that you’ve exported from another WordPress site, in the form of an .xml file, and import it into your App Engine WordPress site.

This post walks through the process of doing such an import. It assumes that you already have a WordPress installation on App Engine— if not, see these instructions.

If you will be doing an import of a large .xml file, see the section below on “What to Do if You Have a Large Import“.  As described in that section, you should make a temporary configuration change to your app before you do the import, to ensure that it finishes successfully.

Continue reading

banner-772x250

AppEngine WordPress plugin Version 1.3 Released

We’re happy to announce that we’ve just released version 1.3 of the AppEngine WordPress plugin. We encourage all users of WordPress on App Engine to upgrade to this new version as soon as possible.

The new version of the plugin includes the following features and bug fixes.

  • Import support for WordPress export files, forked from the popular WordPress importer plugin.
  • URLFetch support for WordPress versions 3.7 and above, that fixes issues caused by core WordPress changes to the WT_HTTP Class.
  • Bug fix for incorrectly detecting if a Google Cloud Storage bucket was writable by the application during setup.
  • Better logging of plugin errors.

Like always, please report any issues with the plugin in the support forum.

We also gladly accept pull requests – you can find the plugin source on Github.

App Engine WordPress plugin Version 1.2 released

We’re happy to announce that we’ve just released version 1.2 of the App Engine WordPress plugin. The new version includes the following changes

  • Fix for the bug “Uncaught exception ‘InvalidArgumentException’ with message ‘max_bytes_per_blob must be an integer'” (forum link)
  • Removes the need for PIL to be installed in the local development environment.
  • Removes the need for PyCrypto to be installed in the local development environment.
  • Better checking if the application has write access to the Google Cloud Storage bucket for uploads.

If you find any issues with the latest version of the plugin you can file them in the support forum.

We also gladly accept pull requests – you can find the plugin source on Github.

Generating Dynamic WordPress sitemaps on App Engine

Sitemaps are a valuable tool in helping search engines crawl your website. In this post I’ll show you how you can have a dynamically generated sitemap for a WordPress blog hosted on Google App Engine.

Because of the read-only nature of the file system on App Engine, we’ll use Google Cloud Storage to store the generated sitemap file. We’ll also add some handlers to serve the sitemap, and to update it as part of a scheduled cron job.

Continue reading

Announcing the Google App Engine WordPress plugin

Screen Shot 2013-06-13 at 5.23.09 PM

Today we officially launched the Google App Engine Plugin for WordPress. We’ve also put the source of the plugin on github for those of you who might be inclined to want to modify of add functionality.

The plugin wires together some code WordPress features with App Engine APIs, for now including:

  • Sending e-mail using the Mail API.
  • Uploading and serving media files to Google Cloud Storage.

Full details on how to install the plugin, as well as optimally configure your WordPress site can be found in this detailed post on developers.google.com.

 

Tips For Configuring The Plugin

The plugin is very easy to configure. Currently there are only two options that you need to be concerned with, EMail Settings and Upload Settings.

Email Settings

Screen Shot 2013-06-13 at 8.19.42 PM

To enable sending of Email using the App Engine Mail API select the checkbox “Use App Engine Email Service”. By default, mail will be sent from wordpress@.appspot.com, but you can change the address to one of the allowed sender addressed as described here.

Upload Settings

Screen Shot 2013-06-13 at 8.24.47 PM

To configure the upload settings, all you need to provide the name of a Google Cloud Storage bucket that the application has permission to write to. You can follow the instructions here to correctly associate your application to a bucket. Once you have done this, simply enter the bucket name in the correct field to enable uploads to that bucket.

When you try and save the settings, the plugin will attempt to write a test file to the bucket to ensure that your application has write permissions. If your application cannot write to the bucket you will be shown a warning at the top of the configuration screen, as shown below.

Screen Shot 2013-06-13 at 8.24.37 PM

Once your configuration settings are correct press save, and your WordPress site will be ready to send mail and handle media uploads.

Caching WordPress for App Engine

Caching is one of the simplest ways to improve the performance of your WordPress site. There are two simple, easy to use caching techniques that you can leverage when hosting a WordPress site on App Engine.

Memcache

App Engine has a zero configuration memcache service that can be used in conjunction with the memcached plugin, that reduces the number of database calls that are required to display a page. Batcache uses the memcache service to store and serve fully rendered pages. It has a number of tuning options that can be used to configure caching to not only reduce the time taken to serve pages, but the overall cost to run your site.

To get started using memcache and WordPress, download and install the plugins like this

$ wget http://downloads.wordpress.org/plugin/memcached.2.0.2.zip
$ unzip memcached.2.0.2.zip -d /path/to/wordpress/wp-content/
$ wget http://downloads.wordpress.org/plugin/batcache.1.2.zip
$ unzip batcache.1.2.zip -d /path/to/wordpress/wp-content/plugins/

Now edit your wp-config.php file and enable caching, and tune the batcache settings if you want.

define('WP_CACHE', true);
$batcache = [
    'seconds' => 0,
    'debug' => false,
    'max_age' => 60 * 30,  // 30 minutes.
];

Setting a large max_age value will dramatically reduce the database access of your application, at the price of clients potentially seeing stale pages. If you site has rarely changing content then this can be an effective way to reduce the overall cost of your application as it will reduce the usage of the CloudSQL database.

Now all that’s left is to use appcfg.py to push your application to production, and your WordPress site will start using the memcache service.You can use the admin console memcache viewer to see how many objects have been cached, how often there is a cache hit and flush the cache if required.

Static File Caching

When serving static files, App Engine will automatically add caching headers so that the resources can be cached by the users browser and any intermediate proxies. By default, the cache expiration time is 10 minutes. However, you can set this expiration time to a higher value if you have resources that rarely, if ever change.

The easiest way to do this is to set the default_expiration value in the app.yaml file of your WordPress site.

application: YOUR_PROJECT_ID
version: wp
runtime: php
api_version: 1

default_expiration: "1d"

Note: Be careful how you set the default expiration value. If you set a large expiration time like 365d then any changes to the content of the static resources will likely not be visible to users as the old content will still be cached in upstream proxies.

Using both of these techniques can result in vastly improved page load times for your site, combined with a reduction in the CloudSQL usage and therefor cost.