New Year Bug Fix release soon
I fixed the page parent bug easily and put the fix on the last post. I was going to just do a new release yesterday, so those not brave enough to fix the bug themselves could just download a new version. However I got a little carried away with cleaning up crappy code, adding some comments and fixing a few other issues that I’m now having to test it fully again.
I’ve deicided to release this as a very quick 0.5.2 in the next few days. If you need the page parent bug fixed before that and don’t want to change the PHP yourself then send me a message and I’ll send you a replacement php file.
December 31st, 2008 by
Alex Stansfield in
WP Subdomains, Web Development
Tags: bugs, wordpress
236 views | 31 Comments
Tags: bugs, wordpress
236 views | 31 Comments

Having some problems with the plugin. Please check out http://fjsoftllc.com/test –
Here are the problems:
1. The subdomains show all posts, not just posts tagged with that category.
2. And I cannot for some reason activate a separate theme for each subdomain. I activate it in category editing, but it is not displayed (it displays as ‘none’) when I edit that category again.
I have wordpress 2.6.5. I might try updating to 2.7 to see if that fixes things.
I have *.fjsoftllc.com CNAME’d to fjsoftllc.com. Maybe thats the problem?
Upgraded to 2.7, no improvement. The plugin’s admin basically does not work as I expect it to. When I select ‘make all root categories subdomains’ and then edit Uncategorized to not be a subdomain, it doesn’t work — it doesn’t remember the setting after saving. When I do the opposite, deselect ‘make all root categories subdomains’ and then edit e.g. test17 to be a subdomain and save, this also is not remembered. Looks like the save function on editing individual categories is not working as intended.
Hi,
can you check your wordpress database and see if a table called wp_category_subdomains was created.
I’ve seen a few problems where for some reason the functions that are supposed to run when you activate the plugin don’t work.
If it’s not there please deactivate and then reactivate the plugin.
The settings are saved in this table, so I’m thinking perhaps it’s not been created.
Cheers,
Alex
Hi Alex, indeed there’s no such table in my DB. I have only the regular 10 wordpress tables. Deactivated both plugins (the wp_subdomains and wp_subdomains_widgets ones) and reactivated, no luck. I’m not 100% sure whether both should be active, just for certainty sake I did both
Perhaps you could give me the SQL to execute on my phpMyAdmin interface?
I forgot to mention one humungous big thing: THANKS! Thanks for this plugin! I have huge plans to use it…
Found another small problem — in the plugin control panel when I’m editing a specific caegor and trying to set a theme for it, the link in Options/Subdomains does not work:
Pick your theme name and activate category themes in Options/Subdomains
The link points at http://fjsoftllc.com/wordpress/wp-admin/options-general.php?page=category-subdomains.php
Thanks,
I’ll get this fixed. I just forgot to update the Url when I changed the configuration pages.
The page it links to is just the main plugin settings page that you can get to via the other links.
Cheers,
Alex
I see what I did wrong.
Basically try activating the plugin by clicking on the “Activate” link that’s in the same row as all the plugin details. I was using a fairly crappy way to tell if someone activated it or not.
I’ve now found the correct way to do it and that will be in the bug fix release tomorrow.
Using the method above to activate the plugin should create the table.
Cheers,
Alex
Thank you very much, I’m just sorry that there have been some many problems with it.
Thank you for not giving up and letting me know any bugs you find.
Cheers,
Alex
Hi Alex, I’ll try that. If that does not work maybe you can just send me the mySQL for creating the table? If not, I’ll wait for 0.5.2
Tried upgrading from someone else’s “Category Subdomains” plugin that I’ve been using for 6 months, same problems, though.
First, the sub-category archives don’t work. Secondly, the date archives don’t work. Do you have them working successfully on your sites?
Going to mess around with it on Sunday, a slow traffic day.
Thanks for keeping it updated. Paypal account to donate?
Hi,
Just need to check which method you used to activate the plugin? If you saw my comment above about using the “Activate” link.
Also by sub-category do you mean the going to http://stuff.mydomain.com shows you the archives for the “Stuff” category? That works fine here.
Date archives I’m not so sure what you mean. could you be more specific?
Cheers,
Alex
I always activate plugins by using the “Activate” link in the plugin details page.
Here are the bugs, in greater detail, using my domain and categories for reference:
1. If you go http://finances.unanimocracy.com/category/money and click NEXT PAGE, it takes you to http://finances.unanimocracy.commoney//page/2/ (notice the trailing slash after .com is AFTER money twice, instead of BEFORE money). The page 2 link is also missing /category before /money. If I manually move the slash and add /category, all is good!
2. I figured out the Archives problem, I have to fix it myself, someone. The built-in WordPress Archives command doesn’t set up Archives separately properly, as:
http://politics.unanimocracy.com/2008/01
http://finances.unanimocracy.com/2008/12
Etc. So I will probably have to write the code myself. If I manually key the URL, they work great. I disabled the archives section entirely because it creates some odd loop problem that slows my site down tremendously and then errors out for the user.
Thanks, again, for checking these bugs out. Please list a Paypal account so I can help drop a tip in the jar!
Hmm, found another bug. Let’s list it as bug #3.
3. If you go to a subcategory domain, such as http://politics.unanimocracy.com/ it goes to the HOME PAGE rather than the subdomain list of posts (archive list).
This bug does NOT happen with Dempsey’s plug-in. Odd.
I tried the “page parent” fix by modifying filters.php, but that didn’t work. I’m PHP savvy, so I know how to edit it correctly. I assume I don’t have to deactivate and reactive the plugin after modifying it, correct?
Hi,
thanks for getting back to me with your results:
1. I think this may be down to permalinks. Can you send me your permalink setup and I can try it out on my end to see if I can work out why it’s going funny.
2. I see what you mean about the archives now. I’ll take a look into it this end too.
Whilst I’m not going to turn down a donation, I don’t feel right accepting one when the software doesn’t work properly. Once I’ve fixed the problems and you’re happy with how it works let me know and I’ll give you my paypal account.
Cheers,
Alex
The parent page fix shouldn’t need the plugin to be deactivated and reactivated. It should just work.
As for the subdomains showing the home page I remember seeing that one another person’s before so I’ll go through my past emails and see if I can find out what it was. Trouble is I thought it was one of the bugs I fixed but I guess not.
I’m guessing that a lot of these come down to wordpress configuration and permalinks as it all works on my site and unfortuantely it’s the only one I test with. However I will make a not of all popular permalink settings and in furture will try them out before doing a release.
One last thing I noticed. The old plugin got rid of the ‘category/’ folder in the sub categories. My version doesn’t currently do this as I didn’t like the way it was implemented in the old version so I removed it. I going to fix it and put it back hopefully in the 0.5.3 release. If everything goes right 0.5.2 will be out today. Anyway I saw you have a number of manual links that expect that ‘category/’ to not be there and they now produce 404s. Thought I’d let you know.
Cheers,
Alex
Quick note to let you know that 0.5.2 is out.
I found it a bit strange that manually typing in the date archive urls worked for you because they didn’t work for me. I just had to write some code to make them work.
Are you sure they’re actually only showing the posts from categories they’re supposed to?
Anyway, the code required is very simple and I could send it to you if you need it.
You should get some rest, unless you’re in Europe
I am NOT sure that manually keying in the dates gets them to display properly. I’d love to see the code, but if you’re incorporating it into the next update, I can wait.
Hehe, I’m actually in China so it’s only just gone 5pm here. I’ll send you a mail with the code later as it’s just one short function and a line you slot in in the main class.
Thanks for the head’s up on the manual link breaks — I’ll let it slide for now so it forces me to get this plugin operational properly
My permalink structure is:
/%year%/%monthnum%/%day%/%postname%/
If you find that fix for the subdomain displaying the main homepage, I’d appreciate it! Maybe add that info to the readme file, too?
Odd, that permalink is the same as mine. As for the person with a similar problem, theirs was subdomain pages not working rather than categories and from what I can tell was fixed in 0.5.1. Do you have any other plugins running?
Lots. Some that definitely don’t play well with others:
1. Akismet
2. Featured Content Gallery
3. Get Recent Comments
4. Secure and Accessible PHP Comment Form
5. Text Link Ads
6. WP Subdomains
I am considering disabling 3 & 4 since I don’t use them anymore. Will see if that helps the permalinks problem!
Thanks, again.
I was just wondering how you were getting on with this? I also realised there was one important question I forgot to ask. What version of WordPress are you using?
I have a question about the rendering of category/tag/date archives.
When on a subdomain page (http://articles.icmcc.org) all categories and tags point to ?cat or ?tag at root page (i.e. http://www.icmcc.org/?cat=2) in stead of to the subdomain (http://articles.icmcc.org/?cat=2).
If I make a category into a subcategory to the domain naming one (so cat 2 “news” is child of “articles”) the archive turns to http://articles.icmcc.org/category/news/ which causes an error page.
My permalinks are default.
Posts are shown with subdomain url. Is there a way to achieve the same for category, date and tag archives?
Thank you for answering.
Hi Lodewijk,
This some how made it into spam queue so only just seen it. I guess I’ve already addressed all these questions.
Cheers,
Alex
Hi, I’m having trouble installing the plugin. It’s created the wp_category_subdomains table but I don’t get any new options in “edit categories”. It’s just the same as before, i.e. name, slug, parent, description – no option to activate a subdomain or set the theme. Any suggestions? Thanks.
Hi Chris,
which version of the plugin are you using and which version of wordpress?
Cheers, Alex
WordPress 2.7.1 and plugin 0.6.0.
Thanks.
Hi Chris,
Just need to check. You’re trying to edit an existing category? You wont see the options when creating new ones. You need to create one and then edit it.
Regards, Alex
I don’t see the options when editing either, just the usual category attributes.
Thanks
Chris