WordPress Version: 3.3.1 Wordpress SEO Version: 1.1.7 Plugin Author: Joost de Valk
Problem: Canonical links turned on for non-duplicate content pages.
Having been happily using Yoast’s WordPress SEO on a customers WP e-Commerce health products site for some time I decided to implement it on my Japanese Arts gallery hobby site.
The Japanese Arts gallery site uses the NextGEN plugin to manage the gallery albums and images. Having deactivated the All in One SEO plugin and Google XML Sitemaps I installed and activated WordPress SEO by Yoast and everything looked pretty good. The settings import function is excellent – loads of time saved there.
On closer checking however, it appears using WordPress SEO has reintroduced a canonical URL problem I previously had on the site.
The problem is that after clicking on a gallery thumbnail the NextGEN generated image page that’s opened has a canonical URL set pointing back to the gallery thumbnail page. However, both the gallery thumbnail page and image page have unique content. The vast majority of my content is on image pages which include text/descriptions so to have them listed by site review tools and potentially treated by Google as not to be indexed is a serious issue. I resolved this previously by commenting out the add_action for rel=canonical from the default-filters.php file in WordPress.
Obviously this is not a ‘fault’ with WordPress SEO given this problem existed previously – the problem is that the plugin does not let the user choose if they want to use canonical URL’s or not. The resolution is simple – remove WordPress SEO and go back to using All In One SEO which very usefully has a setting to turn canonical URL’s on or off. Unfortunately Yoast’s WordPress SEO doesn’t have such a feature (please correct me if I’m wrong). I’m not sure why that functionality isn’t available given the number of forum issues that are reported for canonical URL problems.
An additional thing I noted in the short time I used WordPress SEO on the gallery site was that the xml sitemap function didn’t include any of my sites translated pages. I use a translation plugin to bulk up my site and because many of my visitors are from non-english speaking countries. My previous sitemaps generated by Google XML Sitemaps do include the translated pages and Google has most of them indexed.
If your a NextGEN gallery user be sure to check that ‘sub/child/nested’ pages of your site are not set to be non-indexable (even though Google doesn’t always adhere to that). You may be better served using All in One SEO with Google XML Sitemaps and Robots Meta.
Yoast WordPress SEO Canonical URLs Turned On
Update: 2012/05/25 – Response from Joost de Valk (aka Yoast). Hows this for great service. We posted a short version of the post above on the WordPress forum and Yoast responded the same day.
” I’m not going to add a setting for it, as that is bound to confuse people, but adding this to your functions.php does it nice and simple: add_filter( 'wpseo_canonical', '__return_false' ); ”
If your having a problems with canonical URL’s while using WordPress SEO then using the above filter will turn them off.
When using WPEC 220.127.116.11.2 the Transaction Results Page is built from three different parts of WPEC – two from with-in WPEC configuration settings and one from WPEC code.
The following screen capture shows the three areas of the tranasaction results page and where the content for those areas is sourced from.
WPEC Transaction Results Layout
Having used WPEC on a number of sites I find that the way the layout of the transaction results is built to lack flexibility.
Issue 1: As the top section of the transaction results layout is hard coded in a php program it’s always present and its content is fixed. Given this content could simply be supplied by the user in either the gateway settings under the Payments tab or in the purchase receipt settings under the Admin tab I fail to see what possible use it serves and why the authors of WPEC would bother setting it up. It also tells the customer they will be receiving an email once the order clears but orders don’t clear, payments clear. It also assumes we will be emailing our customer at that time but that might not necessarily be the case.
Issue 2: The bottom section of the transaction results page is also somewhat of an issue because the content is set once and it then applies to all the payment gateways. It would be very useful if each payment gateway could have its own purchase receipt content. How would this be helpful? One example would be: a number of WPEC users (myself included) have wanted to use WPEC to allow users to request quotes for some products. Having unqiue settings would allow a ‘quote’ payment gateway to be setup which does nothing but send the site admin and customer an email.
Issue 3: Another issue I’ve run into is that sometimes you want the content to only be displayed on the WPEC transaction results page but presently the content is displayed on that page and also emailed to the customer.
These are pretty straight forward changes (especially the first one) so hopefully the WPEC team will look into implementing them in a future release.
The problem occurs in a number of NextGen programs including /view/gallery-caption.php, /view/singlepic/php and /widgets/widgets.php.
The ‘must change’ two for me are /view/gallery-caption.php and /view/singlepic/php as they caused visual problem with my Nextgen galleries.
I haven’t provided a fix to /widgets/widgets.php as the only impact from that I’ve noticed is puttng lots of junk into my page source. I’m trying to keep my customising to a minimum so that one can stay.
Basically the fix requires occurrences of the variables ‘description’, ‘caption’ and ‘linktitle’ to be changed to ‘alttext’ whenever they are used as titles and alt text in <href> or <img> statements. I first made these changes a long time ago and from memory had 404 errors occur when viewing the gallery (although I may have also may other changes at the same time). Either way, updating permalinks resolved that.
Here’s before and after screen caps to show what a difference the changes below made.
NextGen Template Caption Shortcode - Default Web Page Layout
The following code was run through a converter to allow it to be viewed as text on this page – hopefully the syntax is still correct. Between the two programs I only changed three words so personally I would change those manually rather than cut/paste the whole snippet.
I’ve just ugraded to the latest version of the NextGen Gallery Plugin and as in previous versions it has in my opinion a problem with it’s handling of Titles/Captions/Alt-Text and Descriptions.
Logically Titles, Captions and Alt-Text would usually be set to just a few words where-as a Description would be longer. This logic is correctly reflected in the NextGen plugin Gallery Settings page where the Alt & title Text input field is a single line (no html allowed) and the Description input field can be any size you want (with html allowed). In my woodlbock print gallery I set the Alt & Title field to be the artist and print name. The Description field is set to be a html table containing details about the artist and print. My gallery pages all use the shortcode [nggallery id=x template=caption].
NextGen Gallery Settings
Up to this point NextGen Gallery and I agree on how to handle these fields. Now however, we go our separate ways as when viewing any gallery on my website the following issues appear.
(1) The large Description field (a html table in my case) is being used as the thumbnails caption totally destroying the layout. What should appear in the image below is a nice thumbnail grid view with each thumbnail having a Title/Caption of a few words under it. As can be seen that’s not what’s being displayed.
NextGen Template Caption Shortcode - Web Page Layout
(2) Hovering my mouse beside a thumbmail displays the raw html table stored in the Description field.
(3) A view page source of the gallery page shows it is cluttered up with ‘junk’ as a result of the Description field being used as the href title tag. This also occurs on any web page where the NextGen Widget is used to show Random/Recent updates.
NextGen Gallery - Page Source Problem
The examples above are from my test site running the latest version of the NextGen Gallery plugin. To see the gallery working correctly after I’d made some coding changes in the NextGen plugin visit http://japaneseartsgallery.com or more specifically the Osamu Sugiyama Woodblock Prints page.
When using WPEC 18.104.22.168.2 the checkout page has a section at the bottom titled “Review and Purchase”. Unfortunately however the WPEC developers have chosen not to show the customer the complete details of the transaction to review.
The WPEC default presentation is to show the Total Shipping, Discounts and the grand Total. The product total and tax are not given and to see those you need to scroll back to the top of the page.
Wilst WPEC is a great plugin there are many issues with it – you only need to look in the support forum to see that. My main problem with WPEC is the simple things they either take a long time to fix or don’t fix – and this is one of the latter.
If you’d like to add the product total and tax amounts to the review section then the following code will do that. It works for me but please check it carefully on your development/test site before using it live and be sure to take a backup of the code before making changes.
You can add these two snippets in whatever order you like to the wpsc-shopping_cart_page.php file after line 451 within the <table class=’wpsc_checkout_table table-4′> section.
WPEC Checkout – Put Product Total in Review and Purchase Section
WPEC Checkout – Put Tax Total in Review and Purchase Section
<?php if($wpec_taxes_controller->wpec_taxes_isenabled()): ?> <tr class="total_price total_shipping"> <td class=’wpsc_totals’> <?php _e(‘Tax’, ‘wpsc’); ?>: </td> <td class=’wpsc_totals’> <?php echo wpsc_cart_tax(); ?> </td> </tr> <?php endif; ?> (the php if statement might be optional, without it you’d probably just see 0 as the tax amount??)
Checkout Page Before Changes
Checkout Page After Changes
You can see a working example at USANA Canada but as this is a live site please don’t click on the Purchase button and empty your cart before you leave the site. If anyone can improve the code so it lines up tidily and make the subtotals unbold that’d be great. For now however it’s just so much more professional to have all the numbers available for the customer to see.