[Desperately Seeking WordPress]Moving from Blogger (Atom XML) to WordPress with RSS Import

Note: this is only half the problem.  The comments do backup onto your hard drive.  But this will not import them into WordPress.    You can request access to the beta version of the Blogger Backup utility if you need to backup and restore posts – and you can use the BLOGML xml type instead of the ATOM. This post is only to get the conversation started!!

Step Zero:  Prepare Blogger

Have blogger feeds at Full.  And comment feeds at Full.

Step One: Download Atom Files

  1. Download the Blogger Backup Utility that comes with a nice easy setup wizard.
  2. Settings: Save Comments [Y], Save posts as:  [Atom, all posts in single file]  Max Posts: [100 Posts per file]  Get only recent Posts: [No Limit - Get them All].
  3. Download your backups to a memorable folder ( “Transfer” in the Downloads folder for ease of use – for me, it looks like C:\Users\Sony\Downloads\Transfer ).

Step Two: Download a Conversion Utility

Because there are NO import tools to import Atom to WordPress, we have to convert it to RSS and then we can use the RSS upload utility.  But you’re gonna have to use the command line (if you dont know what that is, I’ll show you in a moment).  This tutorial is for Windows Users.

  1. First you have to have the Microsoft XML utility.  (I’m not sure if thats built in or not.  Just download this to be sure.)  Select the first one and set it up on your computer (has set up wizard)
  2. Download the MSXSL utility and save it to the Downloads\Transfer folder.

Step Three: Download Atom 2 Rss Transformation Stylesheet. 

Another thing that I’ve just become aware of, is that you can take an Atom XML file and convert it to an RSS XML (both types of XML formatting) using an XML stylesheet.  Thank heavens we dont have to learn how to create these, as the work was done for us by geekhood.net.

  1. Navigate to Atom2Rss.xsl
  2. Click on “View Source”
  3. Copy that and paste into a text editor (not Word Processor).
  4. Save as atom2rss.xsl into our Downloads/transfer folder

There should now be the XML (atom) files from the backup, the msxsl.exe file, and the atom2rss.xsl file in the downloads/transfer folder.

Step Four: Executing the Conversion

Now you have to use the dreaded “command line”.  It will bring back the days of the TRS-80 and give you nightmares of blinking cursors, but it is the only way that I found to do this.

To open a command line window, navigate to the start button, in the search box at the bottom, type “cmd” no quotes.  It will show one option with the scary black box icon.  Click it.

Remember our old commands?  dir will give you a list of the contents of the directory;  cd will let you change directory?  My default location is c:\Users\Sony.  So to get to our new transfer folder, I type:

cd downloads/transfer

To execute the conversion for each file, where my first backup file is backupfile1.xml, I typed this:

msxsl.exe -o newbackup1.rss backupfile1.xml atom2rss.xsl

And voila, the new file in rss format – newbackup1.rss is created in the transfer directory!

*props to Darren for the commands here!

Step Five: Import to WordPress

Then the easy part – navigate to Tools> Import > RSS and follow the steps to download the importer and run the plugin.  Select each of your new files in turn to upload into WP.

[Desperately Seeking WordPress]10% Coupon for Genesis by StudioPress for Developers

Now is the time!

If you’ve been thinking about purchasing the StudioPress / Genesis package, and humming and hawing over it – now is the time!  The price is going up next month!  We are not usually early adopters into software – I like to play it safe for a little while – see how it does, if support is going to wane, what the reviews are going to be like.

Mashable calls Genesis the “best of the best” among premium frameworks.

Adopting early into StudioPress has been one of the best decisions of my career!

Here’s what you get for $299 at the moment:

  • incredible support!! Way beyond the normal support in forums – these developers expect that Genesis will be taken and twisted to our clients’ needs and are ready to help.
  • 44 professionally designed themes (with PSDs)
  • unlimited upgrades to each and every one (they tend to keep the child themes updated before adding new ones – so the child themes are always up to date both design-wise and code-wise)
  • Search Engine Optimized by Greg Boser (we still use SEO for WP by Yoast plugin)
  • Secured code by Mark Jaquith
  • small selection of custom widgets, we add some more of our own
  • Free upgrades for life (Genesis 1.8 came out with built-in responsiveness)
  • Free themes for life (see #2) & any additional ones
  • Over 65,000 installations so far, so people like Bill Erickson and Nick the Geek are developing awesome advanced tutorials
This package is NOT for those who cannot ‘speak’ php or edit a file via FTP.

I have heard many, many complaints from people who think Genesis will be “easy” to edit. And it is easy, if you know php. Instead of having to write templates, have them go out of date, and then have to re-write them on every major upgrade or security release, you can let the Framework do that heavy lifting. As a developer, we only need to ‘hook’ into those things we want to change, and the framework does the rest.

If that sounds like greek to you, contact me! I’d love to work with you as your developer! You can still have the benefits of the Genesis Framework – you might just need a little help to get it customized to your liking.

Get 10% off Genesis

Before the price increases January 31!  

Use discount code TEN to get 10% off between now and then.  If you can edit php, and you are a WordPress developer – this is a must!

Go to StudioPress

 

 

[WordPress Canada]Plugin Review: WP Deals

Do you run an online store? Do you often run specials or deals on your products? If yes you may want to take a look at WP Deals.

WP Deals is a free plugin brought to you by the folks behind Tokokoo, maker of fine premium WordPress e-commerce themes.

After you have installed and activated the plugin setting it up is a snap. First navigate to Settings > Deal Options where you can configure the general options. See the image below. (click to enlarge)

WP Deals general options

Referring to the above image the configurable options are as follows:

  1. If you have an SSL certificate you can check this box to use it.
  2. Here you can choose your currency.
  3. Display your deals in list or grid view.
  4. Set the position of the currency symbol - left, left with space, right or right with space
  5. Set the thousand separator of displayed prices.
  6. Set the decimal separator of displayed prices.
  7. Set the number of decimal points shown in displayed prices.
  8. Set the default image size. You'll want to adjust this according to your theme.
  9. Set the single deal image size. Again, you'll want to adjust this according to your theme.

Next, while in the same screen click the PayPal tab at the top. Here you can configure the PayPal options. See the image below. (click to enlarge)

WP Deals PayPal Options

Referring to the above image you can set your PayPal email where you want payment sent. You can also enable the PayPal sandbox and create a sandbox email to test everything. See the developers section of the PayPal website for further info on that.

The next step is to create your invoice. While in the current screen click the Invoice tab at the top. You will see the image below. (click to enlarge)

WP Deals invoice options

Referring to the above image the configurable options are as follows:

  1. Set your store name.
  2. Insert your logo link.
  3. Set your store description.
  4. Enter some footer text that will appear at the bottom of the invoice.

Finally, we can now integrate some social media links. While in the current screen click the Account tab at the top. You will see the image below. (click to enlarge)

WP Deals account options
Referring to the above image you can set your Twitter, Facebook and RSS links. You can also choose to display or hide the share icons.

Okay, now that we have everything configured let's start creating some deals! Navigate to Daily Deals > Add Deal. You'll arrive at a screen that looks very much like the Add Post or Add Page screen. Add a title for your deal. Enter some info about the deal. See image below. (click to enlarge)

add a deal

After you have completed that there are a few other things to fill out.

Deal Properties
deal properties

Referring to the above image you can:

  1. Set the base price.
  2. Set the discount price.
  3. Insert number of deals available.
  4. Insert the date and time the deal will expire. A popup window will assist you in making your selection.
  5. Select yes or no if deal is expired.

Categories (self-explanatory)
categories

Tags (self-explanatory)
tags

Feature Image (self-explanatory)
feature image

I've created a couple of deals to see how this thing works. Let's take a look.

The plugin will create a page called Daily Deals. Clicking it will take you to a current list of your daily deals. (either in grid or list view as per you earlier selections) Here is my Daily Deals page ...

daily deals

Oooo look ... killer deals on hammers and bananas! Let's click the Bananas link to explore that deal further.

banana deals

Isn't that a lovely looking product page? Everything you might want to know about the deal is listed. Price, discount, savings, description and a thumbnail image. Your social media links are also displayed. (if you chose that option earlier) You can even print out the deal. Clicking the price tag will take you to PayPal where you can buy those bananas for only $100.00!

Once you have created several daily deals and have them listed on the daily deals page you can set one of them as a Featured Deal. The plugin will create a page dedicated for that.

The plugin will track all transactions and create various reports for your perusal including Sales, Invoices, Subscribers and Reports. All of this data can be located under the Daily Deals menu on the left side of the page.

Now while all of this functionality is free, there are several paid extensions for it that you may be interested in.

Related Deals
Display a list of related deals. Options include:

  • Sort by category or tag
  • Set the number of related deals to be shown
  • Define the display to include thumbnail image, title and/or price
  • Set the dimensions of the image
  • Cost - $30

Download Monitor
Track who has downloaded what. Find out what has been downloaded the most.

  • Cost - $15

Subscribe Lightbox
A cool looking lightbox popup encouraging tire kickers to subscribe.

  • Cost - $15

Deals Feed
A highly configurable dedicated feed for your deals.

  • Cost - $30

Deal Votes
Allow customers to rate your deals.

  • Cost - $15

Facebook and WP Comment
Integrate either Facebook comments or the default WordPress comment system.

  • Cost - $30

I've been playing around with this plugin on a dev site for a couple of days and I think it's simply awesome. If you're running a deals-type site or thinking about running one definitely give WP Deals a look.

You can download WP Deals from the WordPress Plugin Directory. For more info about the plugin including the paid extensions and a working demo head over to the official WP Deals site.

Tokokoo is an Indonesian-based WordPress theme shop specializing in premium e-commerce themes. They also operate WPCharity where you can find and download great looking TwentyTen child themes for a small donation. A percentage of the proceeds go to charity. You can follow Tokokoo on Twitter @tokokoo. You can follow WP Deals on Twitter @wpdealsme

[Desperately Seeking WordPress]How to Insert Flickr Photos into WordPress

In this tutorial, we’ll cover two ways of adding a flickr image into your WordPress posts or pages.

1.  Step One: Log into Flickr

2.  Step Two: Click on Share

When you click on Share – > More share options, get the BBcode – and it will look something like this:

[url=http://www.flickr.com/photos/27186552@N08/3991626682/][img]http://farm3.staticflickr.com/2592/3991626682_d372402407.jpg[/img][/url]
[url=http://www.flickr.com/photos/27186552@N08/3991626682/]blue rose[/url] by [url=http://www.flickr.com/people/27186552@N08/]o2cathy[/url], on Flickr 

3.  Step Three: Paste into Post

You have two options.  If you want to place the image (as is), you can use the regular flickr link:
http://www.flickr.com/photos/27186552@N08/3991626682/ 
 Paste this link into the visual editor where you want the image to show up.
If you’d like to use the image with the built-in WordPress capabilities – to align it in the text, add borders, titles, and captions, then you need the actual image – not the flickr link.  The image link is the one that ends in …..jpg.
Like this: http://farm3.staticflickr.com/2592/3991626682_d372402407.jpg  
Because this is an actual IMAGE link, you can use the “add an image” button in your post editor, found here:
And click on the “From URL” tab here:
Add your URL, a title (for good SEO), alternate text – for voice browsers, a caption (optional), alignment, and a link.  Then click Insert into Post.
Questions?

[Desperately Seeking WordPress]Bulk Editing of Posts and Categories, Tags, and other Terms

We’ve found two plugins that make editing a batch  of posts and categories a snap!  First, use Term Management Tools by Scribu to turn all those categories into a nice easy to manage hierarchy of main categories, sub-categories, and tags.

Then use Batch Cat by Lenin Lee to add /edit / remove the appropriate terms from the posts in bulk.

I just edited several hundred categories and 1,700 posts in about 30 minutes.

We heart plugin authors!

To install plugins:
  1. go to Plugins -> Add new.
  2. Search for the title.
  3. Match the author against the results.
  4. Install and activate.
  5. Visit the corresponding Tools or Settings page to configure.

 

[WordPress Canada]Updates to Winfield and Winfield Dark

Both the Winfield and Winfield Dark Genesis child themes have been updated. Both themes feature a custom widgetized home page that defaults to a standard blog format if no widgets are active. The problem was I included a function in the functions.php file of both themes that forced a full width layout on the home page. This was fine as long as the custom home page had active widgets. If no widgets were being used both themes reverted to a standard blog format, as they should, but the full width layout was still being forced.

I corrected this by removing the function from the functions.php file of both themes. I then re-wrote the home.php files of both themes and included the function as a conditional. In other words, the full width layout is in effect if widgets are active on the custom home page. If no widgets are active both themes revert to a standard blog format AND the default layout (whatever that may be) is in effect.

[Peter's Useful Crap]How to access “most viewed pages” data using the Google Analytics API 3.0 and PHP

If you are running Google Analytics on your site, you can use its API to read visitor data and display the information. Here is a quick framework how-to on using the API to get the data to create a “most viewed” widget based on the pages that get the most pageviews. The data is accessed periodically in the background from a script on your website’s server.

Version 3.0 of the Google Analytics API 3.0 implements the OAuth 2.0 protocol. Among the benefits of OAuth are the fact that applications don’t have to store user credential information, and that users can revoke an application’s permissions at any time. However, the OAuth authorization process can be a bit more involved compared to some other API approaches. Also, the Google documentation is a bit light in terms of summarizing the process for server-side data access.

This how-to will use PHP to make the server-side calls to the Google Analytics API, which returns information in the JSON format. The code examples assume that you have cURL for PHP installed, and that you are using PHP 5.2.0 or later in order to use the json_decode function to parse the Google responses.

The setup steps are as follows: We will first set up the application in the Google API console. Then we’ll authorize the application with a Google account that has access to your site’s data. Using the resulting authorization code, we’ll request a refresh token from Google.

From there, you can build the application part: The refresh token is used to get access tokens that are finally used to actually read the data from Google. The details of implementing the data for the widget will be left up to you.

Google API console setup

Log in to the Google API console with a Google account. Note that the account that you log in with here does not need to be the same account that has access to your site’s data.

At the top of the left menu, create a new API project in the dropdown list:

Create new API project

Name the API project

Once your new project is created, select the “Services” page from the left menu, and turn on the Google Analytics API:

Turn on the Analytics API

Note that there are per-day query limits for each API service.

Select the “API Access” page from the left menu, then create a web application client.

Create a new client ID

The name of the web application client will be displayed to the user (you) later when you authorize the application.

Client ID details

Client ID application type

You will need both the client ID and client secret later, used in a PHP script accessible at the redirect URI, which you can rename to add the “.php” suffix as necessary.

Client ID, client secret

If you need to access data server-side when an authorized user is not logged in, the web application client is not sufficient. You also have to create a server API key, limited to the IP address(es) of your server(s):

New server key

Authorize the application

Next, you’ll have to authorize the application to access your Google Analytics data. Remember that the account that created the API application does not have to be the same account that has access to your site’s data.

To prompt the user (you) to authorize your application, you have to build the authorization URL. First, however, we should build a very basic script at the configured redirect URI. The first iteration of the script has this code at http://www.theblog.ca/oauth2callback.php:

<?php
    var_dump( $_REQUEST );
?>

This is simply going to output to your screen the raw data that is being sent to the script via either POST or GET parameters. It is not the complete script yet, but will be used for illustrative purposes.

To build the authorization URL (which is a set of GET parameters at the URL https://accounts.google.com/o/oauth2/auth), you’ll need the following information, which is as follows for our example application:

  • Callback URL: http://www.theblog.ca/oauth2callback.php
  • Client ID: 63311316168.apps.googleusercontent.com
  • Client secret: _iXNRZ5zMj1beMTab0wA4lXC

You will also need to specify a response type (always “code”), the type of access you are requesting (“offline” since we are accessing the data in the background without user intervention), and a “scope” specific to Google Analytics. See the Google API OAuth 2.0 documentation for information on the URL parameters and the resulting response.

For our example application, the authorization URL is:

https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=63311316168.apps.googleusercontent.com
&redirect_uri=http://www.theblog.ca/oauth2callback.php&access_type=offline
&scope=https://www.googleapis.com/auth/analytics.readonly

Get the permanent refresh token

When you access the authorization URL, it should prompt the user (you) to allow the application to access the site data. Once you click the authorization button, you should be redirected to your authorization URL, which you will discover has the “code” GET parameter. You will have to use the value of that GET parameter to ask Google for the refresh token.

Our example uses cURL to build the refresh token request, whose URL uses a similar format to the authorization URL, posting a set of fields to https://accounts.google.com/o/oauth2/auth. According to the Google API OAuth 2.0 documentation, you’ll need the client ID, client secret, and redirect URI information from before, as well as the “code” and an extra field “grant_type”, which is always “authorization_code”.

In oauth2callback.php, use the following code:

<?php
if( isset( $_GET['code'] ) )
{
    $ch = curl_init();
    $timeout = 5;
    curl_setopt( $ch, CURLOPT_URL, 'https://accounts.google.com/o/oauth2/token' );
    curl_setopt( $ch, CURLOPT_POST, 1);
    curl_setopt( $ch, CURLOPT_POSTFIELDS, 'code=' . $_GET['code']. '&client_id=63311316168.apps.googleusercontent.com&client_secret=_iXNRZ5zMj1beMTab0wA4lXC&redirect_uri=http://www.theblog.ca/oauth2callback.php&grant_type=authorization_code');
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER,1 );
    curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
    $data = curl_exec( $ch );
    curl_close( $ch );
    $result = json_decode( $data, true );
    var_dump( $result );
}
else
{
    var_dump( $_REQUEST, true );
}
?>

Note that we are once again using a quick and dirty “var_dump” to output the returned information on the screen. If you visit the same authorization URL in your browser once again, you should get redirected to the same URL as before, but this time showing the response from the extra request for the refresh token. This response should, of course, contain the refresh token.

One extra note: to see which applications you’ve authorized under a Google account, you can go to this URL: https://accounts.google.com/IssuedAuthSubTokens, where you can also revoke access, forcing the application(s) to ask for your authorization again.

Use the refresh token and access the data

The refresh token is the most important piece of information, as it is essentially the permanent key that you need to access the Google Analytics data. (It is permanent as long as the user account that authorized the application does not revoke access.) The more accurate description is that the refresh token is used to get a time-limited access token, and that the access token is used along with the API key you had set up, valid only for specific IP addresses, to access the data.

In our example, the refresh token is:
1/7DRzjcqm-ypH9By1FrY3T-l_oSW3KdklC0LJuZLk5Q0

The following example script is a framework for what you would use with your website, and assumes that you are running it periodically, about once an hour, and therefore you need to ask for a new access token every time. A Google Analytics access token typically has an expiry of just over 1 hour, and thus you can use it for more than 1 request within that hour.

The script gets the top 10 pages based on pageviews for the past 1 day.

<?php

// First, ask for an access token using the refresh token
$ch = curl_init();
$timeout = 5;
curl_setopt( $ch, CURLOPT_URL, 'https://accounts.google.com/o/oauth2/token' );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, 'refresh_token=1/7DRzjcqm-ypH9By1FrY3T-l_oSW3KdklC0LJuZLk5Q0&client_id=63311316168.apps.googleusercontent.com&client_secret=_iXNRZ5zMj1beMTab0wA4lXC&grant_type=refresh_token');
curl_setopt( $ch, CURLOPT_RETURNTRANSFER,1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
$data = curl_exec( $ch );
curl_close( $ch );
$result = json_decode( $data, true );

/*
You should get a response like this in the result:
{
  "access_token":"1/fFBGRNJru1FQd44AzqT3Zg",
  "expires_in":3920,
  "token_type":"Bearer",
}

Then, you can use that access token to build queries (see http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html or http://code.google.com/apis/explorer/#_s=analytics&_v=v3 for examples):
*/

if( isset( $result['access_token'] ) )
{
    // Look up only the last day of visits
    $endDate = date( 'Y-m-d' );
    $startDate = date( 'Y-m-d', strtotime( '-1 day' ) );
    /*
        "ids" value comes from this URL in the last portion of the URL, after the "p": https://www.google.com/analytics/web/#dashboard/default/a381759w192893p9122283/
        Or use http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html to show the GA ID for each your Analytics accounts
        "key" is the API key that you'd set up in the Google APIs console, restricted to certain IP addresses
    */
    $url = 'https://www.googleapis.com/analytics/v3/data/ga?' . 'key=AIzaSyDyWgfb45VYfVYdVnmpH4JZCCRNas5P0SE&ids=ga:9122283&start-date=' . $startDate . '&end-date=' . $endDate . '&metrics=ga:pageviews&sort=-ga:pageviews&dimensions=ga:pagePath&max-results=10';
    $ch = curl_init();
    $timeout = 5;
    curl_setopt( $ch, CURLOPT_URL, $url );
    curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $result['access_token'] ) );
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER,1 );
    curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
    $data = curl_exec( $ch );
    curl_close( $ch );
    $mostViewedRaw = json_decode( $data, true );
    var_dump( $mostViewedRaw );
}
?>

From here, it is up to you to use the returned data in ways that best suit your needs and application. For example, for performance reasons and API call limitations, you might want to run the script only about once an hour, and store the results in a database table or a data structure specific to your content management system. You might also want to do some extra filtering on the Google Analytics results to only display certain types of pages (omitting the front page, for example). Note that the resulting Google Analytics data is simply output to the screen in our example so that you can see its structure and determine how to use it to suit your needs.

[WordPress Canada]WPCanada Releases Winfield Dark Theme

WPCanada is pleased to announce the release of the Winfield Dark 1.0 child theme. This is a child theme of the Genesis framework and thus requires Genesis in order for it to function.

Theme Features

  • Custom home page
  • Custom header
  • Feature images
  • Multiple layouts
  • 10 different "alert box" styles
  • Google fonts
  • and much more

Winfield Dark 1.0 child theme

Winfield Dark is the same theme as Winfield which was released a couple of days ago but with a dark colour palette. This is a free child theme and is released under the GPL.

Please see the official release page for theme demo and download.

[WordPress Canada]WPCanada Releases Winfield Theme

WPCanada is pleased to announce the release of the Winfield 1.0 child theme. This is a child theme of the Genesis framework and thus requires Genesis in order for it to function.

Theme Features

  • Custom home page
  • Custom header
  • Feature images
  • Multiple layouts
  • 10 different "alert box" styles
  • Google fonts
  • and much more

Winfield 1.0 child theme

This is a free child theme and is released under the GPL.

Please see the official release page for theme demo and download.

[WordPress Canada]Akismet Adds New Features

Do you use Akismet on your site? Have you checked your comment moderation queue lately? If you answered yes to both questions you've probably noticed a couple of nifty new features added to Akismet.

Actually v2.5.4 added a number of new features:

  • Added author URL quick removal functionality
  • Added mShot preview on Author URL hover
  • Limit Akismet CSS and Javascript loading in wp-admin to just the pages that need it
  • Added empty index.php to prevent directory listing
  • Move wp-admin menu items under Jetpack, if it is installed
  • Purge old Akismet comment meta data, default of 15 days

However the ones I find interesting are the 1st and 2nd items listed above.

comment moderation

See that little 'x' next to the URL in the image above? Clicking it will remove the link to the site. This is a handy feature if you have a comment that borders on spam or one that you're really not sure about. Click the 'x' then publish the comment.

The other feature I think is neat is the mShot preview. Once again, referring to the image above take a look at the URL attached to the comment. Hovering over it will result in a lightbox-type of popup with a preview of the site in question. You can get a look at the site without actually going over there first.

Planet WordPress Canada theme by WPDesigner, syndication by Pipes, FeedWordPress, and Feedburner, powered by ?