And now the 0.6.0 bugs :(

So far I just spotted one bug. If you’re using the Date Archive filtering and you are on a Subdmain Category it may get the wrong count for the month. This happens if a post is linked to more than one category in that subdomain’s heirarchy (i.e that category and any of it’s children).

Apart from that, Adam Dempsey (one of the previous authors of this plugin) confirmed something that I suspected. The feature I added to keep links to pages on the subdomain you’re viewing could be bad in terms of SEO. I’ve decided I will release an update in the next few days to make this a configurable option. However if you want rid of it now then:

  1. Open plugin/filters.php
  2. Go to the function named wps_page_link( $link, $id )
  3. Look for the line $link = $wps_this_subdomain->changePostLink( $link );
  4. Remove or comment it out
  5. Save the file

That’s all for now. Anyone else spots anything then let me know.

Comments (21)

Adam DempseyFebruary 2nd, 2009 at 6:39 pm

Cheers for the mention :-)

I’m going to test it out later, glad someone’s taken it on, was a great plugin I just don’t have the time for it anymore!

A.B. DadaFebruary 4th, 2009 at 12:39 am

Regardless of getting all the bugs ironed out, give us a Paypal address so we can support your effort! I don’t like charity work :)

I had a traffic spike, so I can’t upgrade for at least another day (I’m using some other guy’s plugin still, but ready to upgrade!)

Alex StansfieldFebruary 4th, 2009 at 2:27 am

As you insist :)

You can now find a donate button on the main WP Subdomains page:
http://webdev.casualgenius.com/projects/wordpress-subdomains/

Let me know if there are any problems. I’ve never made one before.

Cheers, Alex

A.B. DadaFebruary 4th, 2009 at 3:34 am

Sweet! When I’m back at the office this week I’ll send you some cashola so you can drink mass quantities :)

I’m about 15 minutes from trying the new version out. Wish me luck, hah.

A.B. DadaFebruary 4th, 2009 at 3:52 am

Installed great, of course. I ended up having the SAME PROBLEM as before where it would give a 404 error when I arrived from a Google search to a particular page.

So I looked at my permalinks, which were set up like this:

/%year%/%monthnum%/%day%/%postname%/

Weird that %category% was not there, yet the previous subdomains plugin from another author worked fine. So I replaced all that with /%category%/%postname%/ and it works fine — even though the OLD url had year/monthnum/day and now doesn’t. Still finds the proper page.

I’m guessing that Wordpress, when fed the date in the permalink, will drop that portion and just match up the postname part of the URL? Weird.

Looks perfect to me. Thanks for making the changes, it’s great!

Alex StansfieldFebruary 4th, 2009 at 8:58 am

Hi,

The problem with the old plugin was that it didn’t honour your permalinks. It just forced you to have them the way it wanted them. Which is why the links it generated for you were nothing like your permalinks. In my version I specifically wanted it to honour your permalinks, this means the rewrite rules section of the plugin became quite complicated. Rather than forcing everyone to accept the permalinks I wanted, it had to determine what you wanted and then integrate the subdomains in there.

I think you may still have a problem with your site that could mean you need to switch back to the old plugin until the next release. One of the other things the old one did was remove the “/category” prefix from the links to category archives. I couldn’t put that into this release because it’s another big rewrite rule change and I wanted to make sure the support for %category% permalinks was working first. So search engines and other sites may have links to these category archives that could well give 404s now.

For example, in my plugin you have:
http://politics.unanimocracy.com/category/anarcho-capitalism/
but in the old plugin it would have been:
http://politics.unanimocracy.com/anarcho-capitalism/
That latter link now 404s while the first one is successful.

Thought I’d better let you know. My aim for the next version is to provide the option of removing this ‘/category’ prefix from category archives. Once that is done I think this plugin should behave just like the old one did.

Cheers, Alex

A.B. DadaFebruary 4th, 2009 at 11:27 am

Argh, you’re right! Also, my plain category archives no longer work again, forgot about testing that. If you go to http://arts.unanimocracy.com it doesn’t list the archive but the most recent post of that section.

If I am the only person that needs this change, don’t make it — I’ll stick to the old plugin, which mostly works anyway :)

Alex StansfieldFebruary 4th, 2009 at 11:52 am

It’s a feature I’ve been planning to have for a while so that people who use the old plugin can move across. Shouldn’t be too hard to implement, I just wanted to make sure my other rewrite rule changes were safe before making more.

I’m slightly confused about what you mean with the plain category archives no longer working? What did you see with the old plugin, what do you see with the new one?

They should show the same posts. The only difference there should be is that my plugin tells wordpress that the subdomain category (not it’s children) isn’t an archive so your theme might not say “Archive of…” at the top. I can make this optional though. I just did it as I wanted the subdomains to be treated like sites on their own rather than archives of a category.

Cheers, Alex

Alex StansfieldFebruary 4th, 2009 at 12:03 pm

Incase you want to test it you can make the archives work again by editing plugin/actions.php. Go to line 93. It should read:
$query->is_archive = false;
Just comment it out.

A.B. DadaFebruary 4th, 2009 at 12:29 pm

Yup, that did it!

What I meant is that if I went to http://crimes.unanimocracy.com, it wouldn’t show archive.php, it would show index.php with the latest post. When I commented out line 93, it works great!

The sub-category shows up as http://crimes.unanimocracy.com/categry/chicago-crime, which is fine for me. Awesome!

Alex StansfieldFebruary 4th, 2009 at 2:25 pm

Great, in the next version I’ll make that there is an option to switch from archive to index as I guess not everyone wants their site the work the same as mine. Glad it’s all working ok. Let me know if you hit any other issues.

A.B. DadaFebruary 4th, 2009 at 2:36 pm

I’m digging deeper looking for bugs but it seems really clean.

As for the archive versus index, it’s more the theme than anything else, I guess. I use the Revolution themes on my sites, and the author pretty much sets it all up that way. Not exactly how I wanted it, but it works decently enough.

Off to add nofollow to enhance SEO now.

Thanks again!

PaulFebruary 11th, 2009 at 3:06 am

I’m seeing a strange issue where only the first 5 posts of the category are redirecting to the subdomain, the others, although showing up in the subdomain listing, show the wrong link and take you back to the main domain.

Alex StansfieldFebruary 11th, 2009 at 3:25 am

Hi Paul,

This bug I know about and have fixed in the version to be released in the next day or so. However, if you are eager to get it fixed now here is how:

Open plugin/classes.php, find line 45 and change it from:
$pages = get_posts( ‘post_type=page&meta_key=’ . $wps_page_metakey_subdomain .’&meta_value=true’ );
to:
$pages = get_posts(
‘numberposts=-1&post_type=page&meta_key=’ . $wps_page_metakey_subdomain
. ‘&meta_value=true’ );

That should do the trick.

Cheers,

Alex

PaulFebruary 11th, 2009 at 4:21 am

Hey,

Thanks for the quick reply! I edited the plugin in the place you recommended and that didn’t work. Looking for other references to get_posts() I replaced the arguments in this section:

switch ( $this->type ) {
case WPS_TYPE_AUTHOR :
$args = ‘numberposts=-1&author=’ . $this->id;
break;
case WPS_TYPE_CAT :
$args = ‘numberposts=-1&category=’ . $this->id;
break;
}

This seems to have worked, thanks.

Alex StansfieldFebruary 11th, 2009 at 7:12 am

Hi Paul,

my apologies. It was gone 3am and I didn’t read your post correctly, the bug I was talking about was when you had more than 5 subdomain *pages* it only correctly linked to the first 5.

You have found and fixed a completely seperate bug. Many thanks, I’ll be sure to credit you in the next release.

Cheers,

Alex

adamFebruary 11th, 2009 at 9:37 pm

I just upgraded from .5.2 to .6 and had major issues, basically, the entire site was redirected to one of my old category subdomains. After trying to fix the issue several times, and correcting database entries, i decided to rebuild the database from a backup and go back to .5.2. Has anyone had the same experience? The upgrade would be nice, as i was looking forward to the link text featured…

Alex StansfieldFebruary 11th, 2009 at 10:43 pm

Blimey, I’ve not heard of anyone having issues that bad. There were some issues with it but I can’t think of any that would do that. I can send you the 0.6.1 I’m currently testing if you like. I found and fixed some bugs today so need another day or two testing to make sure it’s ok. It shouldn’t rewrite anything in your database, so if you want to give it a try just let me know.

Very sorry for the problems caused.

gulfleeFebruary 28th, 2009 at 4:53 pm

dear sir,
i have a greedy ideal.
If need the url as below?

http://category-name.travel.diamond.com/hello-world/
can it be done?? using this plugins?
i had try but i get 404,

regards,

Alex StansfieldMarch 18th, 2009 at 1:53 pm

Hi Gulflee,

I’m afraid this is not possible. I’m not sure if it’s a feature I am going to add but I will make a note of it.

Regards, Alex

Mark78October 23rd, 2009 at 5:08 am

What we have here, but of course, iz: rather small pack of sick puppy style chimps knowingly getting whole herds of other chimps in trouble. ,

Leave a comment

Your comment