Google XML Sitemaps v. 3.2.3 WordPress Plugin Review

Site Map

Site Map

This plugin generates XML file with special sitemap data. Such file helps to search engines like Google, Bing, Yahoo and Ask.com to index site content. Search crawlers using such sitemap data, much easier discover the whole site structure and retrieve its content more efficiently. “Google (XML) Sitemap Generator for WordPress” plugin supports all kinds of WordPress generated content. It also notifies major search engines (Google, Bing, Yahoo and Ask.com) every time you update your blog content.
Author: Arne Brachhold
Plugin page at WordPress.org
Plugin Home Page

I use this plugin about a year and sure that it is very helpful. Recommend it to all WordPress blog owners.


Today I tried to check what is new in the version 3.2.3 and discovered that Arne missed that information at the plugin’s change log page for some reason. I’m sure he will fix it soon. For that time I decided to help you with this information. Thanks to Arne, he put some words about it into documentation.txt file in the plugin package:
“2010-04-02 3.2.3 Fixed that all pages were not included in the sitemap if the “Uncategorized” category was excluded”.

Comparing to version 3.2.2 we have these changes in the plugin installation package:

  • readme.txt – Plugin version number was changed and some minor text updates were made.
    One of them: Link to “Upgrade to the PRO version to get extra features and professional support” was removed. It seems that opened to public “Google XML Sitemaps” becomes PRO and extra-featured for free. Thanks to Arne for his hard work.
  • documentation.txt – change log item for the v. 3.2.3 was added
  • Chines translation files sitemap-zh_CN.po, sitemap-zh_CN.po were updated.
  • Indian translation files sitemap-hi_IN.po, sitemap-hi_IN.po were added.
  • sitemap.php – version information in comments was updated only
  • sitemap-core.php
    1) version information was updated;
    2) That early mentioned fix, when all pages were not included in the sitemap if the “Uncategorized” category was excluded, can be found in this file at lines 1702-1722.
    I think, this information is enough to take a decision if you need install this version update or can skip it.

If you are a PHP or WordPress developer, it can be interesting for you to look into source code changes. I put it for you below.
Code before update:

$excludes = $this->GetOption('b_exclude'); //Excluded posts
 
$exclCats = $this->GetOption("b_exclude_cats"); // Excluded cats
 
if($exclCats && count($exclCats)>0 && $this->IsTaxonomySupported()) {
 
	$exPosts = get_objects_in_term($exclCats,"category"); // Get all posts in excl. cats
 
	if(is_array($exPosts) && count($exPosts) > 0) { //Merge it with the list of user excluded posts
		$excludes = array_merge($excludes, $exPosts);

Current updated code:

$excludes = $this->GetOption('b_exclude'); //Excluded posts and pages (user enetered ID)
 
$exclCats = $this->GetOption("b_exclude_cats"); // Excluded cats
 
if($exclCats && count($exclCats)>0 && $this->IsTaxonomySupported()) {
 
	$excludedCatPosts = get_objects_in_term($exclCats,"category"); // Get all posts in excl. cats. Unforttunately this also gives us pages, revisions and so on...
 
//Remove the pages, revisions etc from the exclude by category list, because they are always in the uncategorized one.
	if(count($excludedCatPosts)>0) {
		$exclPages = $wpdb->get_col("SELECT ID FROM `" . $wpdb->posts . "` WHERE post_type!='post' AND ID IN ('" . implode("','",$excludedCatPosts) . "')");
 
		$exclPages = array_map('intval', $exclPages);
 
		//Remove the pages from the exlusion list before
		if(count($exclPages)>0)	$excludedCatPosts = array_diff($excludedCatPosts, $exclPages);
 
		//Merge the category exclusion list with the users one
		if(count($excludedCatPosts)>0) $excludes = array_merge($excludes, $excludedCatPosts);
	}
}

As you can see, plugin code is accurate and well commented. Thanks again Arne for your excelent work.

Tags: ,