In this session, we show how to troubleshoot a broken thesis upgrade. In this example when a plugin activation is attemped, the admin panel is knocked out. After an upgrade from thesis 1.8 to thesis 1.8.2 it continued not to work correctly.
Rick: Okay so the next thing we’re going to then, in the absence of other questions is we’re going to try to solve a problem on a site. This is Tranque. He’s a guest tonight and he is having problems on his site. He’s having problems upgrading his site and it all started with an upgrade. Well actually, I’m not sure where it all started with. But nevertheless, we’re having sort of a ongoing problem with the site and I’m going to unmute his microphone. Good evening, Tranque. How are you doing? Hello? Are we there? Tranque?
Okay well, I’m just going to assume he’s futzing around with his microphone while he tries to get on here. So I’m going to go to his site though and if we come over here and look at absolutepersonaltransformations… so he’s got this Thesis WordPress site that had been throwing all kinds of errors. So you know, if we went to install a plugin or if we tried to activate a plugin, every time we did that, we ended up with an error that prevented… that essentially knocked out the admin panel. And we mess around with it a bit yesterday and got to this point. But when you try to install Thesis and upgrade Thesis from 1.8 to 1.82, it all fell apart again. And so what we’re going to do tonight is try this again. We’re going to install Thesis 1.82 on this site and then we’re going to troubleshoot until it’s working.
So I hear some noise in the background. I think that means Tranque is on the line or Tranque, are you with us? Okay well, I know he’s in Japan so there’s going to be a little bit of excitement in the communication. I can’t hear you yet. Just keep on talking, I’m sure it’ll work.
Tranque: I can hear you now.
Rick: Okay, perfect.
Tranque: Yeah, I can hear you now.
Rick: So are you ready to upgrade to Thesis 1.82 and deal with whatever problems we find? I’m going to take that as a yes.
Now actually, the very first thing I’m going to do… that’s okay. The very first thing I’m going to do is I’m going to install a backup system here. And those of you who are familiar with me know I use Backup Buddy for this and so that’s what we’re going to do. We’re going to install Backup Buddy on this site and you know, I think I told you all that there is a coupon code for Backup Buddy this month or… not this month but the next few days, from the 26th to the 31st. That coupon code is BACKUP in all uppercase letters, BACKUP2011. If that isn’t clear enough for you, I can send you it if you need it. But probably everybody’s already bought Backup Buddy.
But we’re going to go ahead and install this. Let’s see, downloads, Backup Buddy… sure, it’s alphabetical so it would up near the top, wouldn’t it? Okay, Backup Buddy… open, install, activate, manage the license, generate a key. Okay so now we’ve got our key generator for this and let’s just refresh that. Yeah okay, we still got the latest version and so the next thing we’re going to do is actually backup the site.
Actually, the latest version of this wants me to do some settings so I thinl the one thing I’m going to do create an Import Buddy password. What are we going to call this? Actually, we’re just going to use his first name. Okay and then in terms of those things we’re going to skip, we’re not going to do cgi bin, pages or site maps. We’re going to hit save settings so we won’t be backing up those other sections. This is an abbreviated version of what we did last week or the week before… whenever it was… before Christmas sometime when we did the big transfer of site.
Please correct the following errors and try again. Okay, let’s try it again. Okay… oh the password didn’t match. Oh, no wonder it didn’t match. I had caps lock on there. Okay now we’ll save the settings.
Okay and so then we’re going to come over to Backup and Restore and we’re going to do a… I’m sorry. We’re going to do a full backup. It’s going to do the database separately because I clicked the wrong button but it’ll be fast so we’ll go back and get the right button. Okay, let’s go back up to Backup and Restore. I hope this doesn’t mean we’re… oh there, perfect. It doesn’t mean that.
Okay, full backup. Okay and then while we’re doing this, I’m just going to show you that I have a connection to his site and if we look at themes, we have Thesis 1.8 2011 and 2010 and we are going to add Thesis 1.82 to this. And in fact, we can just go ahead and do this. Oh no, we can’t do that while the backup’s happening, actually. We don’t want to give it a heartache.
Okay so we’ve got a 32 MB zip file. I’m just downloading it so if we have a problem, we have something to bring up. And then while that is downloading, I’m going to come back over to Backup and Restore and I’m going to also download that Import Buddy file. So now we’ve got everything downloading. Once that download is completed… it is… now we’re just going to use the manual method of uploading Thesis and we’re just going to upload it directly.
Now yesterday, when we were trying to do this Thesis… every time we would move Thesis from one place from… but we moved Thesis around in BlueHost. This time I decided to have it use my own clean copy of Thesis on my computer and upload it directly. This copy of Thesis 1.82 however, does have his custom folder in it so he’s got his custom functions php and his custom CSS files. So those are there.
And so let’s go ahead and run it and see what happens. Come back over here to Appearance and Themes. Okay, we’re going to activate Thesis 1.82 and this is the kind of problem that we ran into is these little bits of debris. Yeah okay so we’re going to come back over to this now and the first… well actually, we’re just going to rename this actually. We’re going to rename that to Thesis 1.8… actually, no. We’re not going to do that. What we’re going to do is rename custom to old. Now, the reason why we did is because we want to find out whether or not some of the custom functions are throwing the error. So we’ve renamed our custom old so now the custom functions php file can’t be fired… can’t rev up. So the next thing we’re going to do is try to do this again without… okay, there we go.
So we clearly have a problem inside of custom functions php. Thesis 1.82 has been activated and if we go look at Design Options, the Design Options are… yeah, these are all the changes that he made before. So the Design Options stayed the same. And if we refresh this page now… yeah, okay. That’s what I thought. So we refresh this page and what has happened now is the menu is no longer down below and he had a bunch of custom sidebars that are now gone.
Now actually, as it turns out, I have his files here. And this actually must be a problem because of WordPres 3.3. These are… this is a poorly written function for sidebars and I’m guessing that what we really have is a conflict between this custom functions php file and the site. So we’re going to try to fix this by giving it a function. You can see that each of these register sidebars, they’ve created footer widgets left, footer widgets middle, footer widgets right so they’ve got this fat footer sidebar thing going on. Except that it’s asking a question if the function exists, register sidebar. And then it is registering a site and then it’s just registering the sidebar in that case. Well, in the first place, this if question is poorly… well in the first place, it’s not necessary. In the second place, it’s poorly formed. It’s poorly formed because it’s formed in a short order version or short version which theoretically allows you to skip these brackets if you’ve got a single php function. Well, it’s going to seem no php function but it’s includes in array and he’s given it a bunch of extra lines which breaks that whole thing altogether. But in reality, this is not necessarily. We don’t need to ask if WordPress has the ability to do sidebars because the ability to create sidebars has existed since version 2.4 or 2.3. And so we no longer need to ask if it can happen.
The other thing is that this is happening wherever… well, this isn’t being told when to happen because it does not exist in the function and that function is not hooked to a hook. So what we’re going to do with this is we’re going to put it in a function… okay, my custom sidebars. That’s a really bad name actually but we’re going to do it anyway. You know, what I would have done is I would have said byob… that’s what I should do… byob custom sidebars. I preface all of my functions with the byob to make sure… because nobody else is doing that and therefore, I know all of my functions is going to be… my functions will be unique and won’t be called… it won’t clash with anybody else’s functions. That’s what’s important. My widgetized footer is not a very good name because it’s pretty generic. It’s better to have function names that are not generic like custom attributes.
Actually you know, I’m going to assume that that might be a problem too. And so we’re going to change the name of that function to… from custom attributes to byob custom attributes. And then we’ve got our custom sidebars. And then we need to add this… add action and I believe it is widgits in it. I believe that’s the hook. I’m going to double check that before we get too far down the road here though. That’s the hook. This is the function name. Was that off? Let’s go check. Actually, let’s just check and see what I’ve done here myself on my site. Themes, thesis 182, custom, sidebars.
Yeah okay. Let’s look one more place because it doesn’t look like I’m doing it right either. I did that a long time ago. Where is test bed? Test bed and then okay, simple header widgets. And then we’ll look at sidebars. Okay so there’s the call. It must be in admin where I have… oh, maybe I’ve got it under this. In it… initialize the header… actually, it is. It’s not widgits init, it’s init. So we come back over here and get rid of widgits in it. Okay, add action init, byob custom sidebars. Actually, let’s just do the same thing at this. BYOB widgetize footer and BYOB widgetize footer. So we absolutely know they are no naming conflicts and we’ll save that. And I don’t believe any of those things can be causing a problem here so we’ll go ahead and save this.
And then we will come back over to… I think I’m going to take custom hold and delete it. And then we’ll take custom… because here’s the new files. So now we’ll take custom and upload it again and then we’ll come back to the site and see if it crashes.
Now to tell you the truth, I did not really see that as… I didn’t think that was going to be the problem when we did this. I didn’t think we were going to discover that there was a problem in the custom functions php file.
Okay, we still have a problem and it’s still related to the fact that we have this custom functions php file because if we rename it old again… actually, I don’t want to rename it old. What I’m going to do is I’m going to rename custom functions php. Let’s see if that solves our problem.
So what we’re doing here is we’re trying to isolate where the error exists. Okay, it exists in that custom functions php file. And long time watchers will notice that there aren’t any errors showing up in this in Netbean which means that it’s not actually a php error. I’m guessing that it’s actually a flaw in the file. So we’re going to create a brand new custom functions php file for this site and we’re going to have a new file. Where am I? Yeah, it’s going to go to a new file… it’s not right. File… a new file, php file. Let’s call it customfunctions.php. Okay, that file already exists there too. I’m just going to name it that for the time being.
Okay and then I’m going to page that code that I just copied out of there into this file and we’re going to say this is our new custom functions php file and save it. And then in Windows Explorer, I’m going to go over to websites, byob website, tutorial sites, base, WordPress, wp content, themes, thesis 182, custom, custom functions php and we’re going to rename this to old.
And then the other thing I’m going to do, if I can drag it from here, I can. Perfect. Oh no, I guess I can’t. Okay so then I’m going to open up another of those windows… well actually, let’s just go there. Okay and dummy project and custom functions 2… cut it out and then we’re just going to go back to here. Paste, okay. Let’s refresh our view of this. So it’s custom functions 2, here is custom functions old. We’re going to upload custom functions 2 to there. We’re going to make sure the thing doesn’t crash which it shouldn’t. Okay, it’s not crashing. So then we’re going to rename that file to custom functions php and we’re going to go to custom file editor. And we’re going to look at custom functions php. Okay, it’s all working.
Let’s go back to the page. So now we’ve got that stuff here. We’ve lost our little widgets. Okay, inactive sidebar not used. This sidebar is no longer available and does not show anywhere on your site. Let’s go back to that… let’s go back to thesis 1.8 and see what happens here. Okay so in Thesis 1.8, we have sidebar 1, sidebar2, footer widgets left, footer widgets middle, footer widgets right. Oh, footer widgets left is the only one with anything in it and it’s that one there. Okay, let’s see. I’m just going to add a name to this so that… footer widget. Save, okay. I’ll take that out later and then I’m going to say sidebar 1, sidebar 2 so I know which ones go where, right? That’s what I’m doing here. Sidebar 3 and then sidebar 4.
Okay and then we’re going to our themes. We’ll activate Thesis 182. We’ll come back over to Appearance and Widgets and we’re going to take sidebar 1, sidebar 2, sidebar 3 and sidebar 4. Oh, there’s nothing in that text widget. How about the rest of them? Okay, we don’t even need it if it’s.. and then footer left, we take our footer widget and drag it to there. Let’s get rid of these titles. Hit save. Let’s drag this over to inactive widgets. Delete that and hit save. Delete that and hit save. Delete that and hit save. Come back over here and refresh this stuff.
Okay so Tranque, I haven’t been able to hear you really but it looks to me like right now, it’s working. Do you see something that I’m missing?
Tranque: No, it looks good. If you can hear me now…
Rick: I can hear you, yeah. That’s perfect. Yeah you know, I think we were butting our heads against a variety of problems at the same time. One of the problems that we were having difficulty with is that there was actually an error in the file, your custom functions php file. And you know, I’m guessing that your VA you know, opens up the custom file editor and paste some stuff in there and then maybe somewhere else along the line, opens it up in FileZilla or some other ftp program then pastes some other stuff in there. And then maybe even opens it up in Dreamweaver and pastes some stuff in there. And in that process, using editors that are not designed to be necessarily text editors, what happens is you know, errors get introduced. I’ve especially seen that happen when people do this. Here they are inside of their FileZilla and they say, “You know, let’s go ahead and edit this file.” And so they click View Edit and then what happens is they get this file that they can change and they get in there and they make some little bit of change. And then save it and that introduces a corruption in the file. And so really, the only right way to edit your custom functions php file is the way I just did it which is using an error checking code editor that can tell you whether or not there are errors inside the code itself.
And when you do that, you never introduce the kinds of errors that I think we just found. And if you do introduce them, you just fix it the way I just showed you which is create a brand new php file and paste the contents of the old corrupted file into the new php file and then upload that and see if it works. In this case, it was a guess. And when we started tonight, that was not my guess. I didn’t think that was the problem. I thought that what we were going to find here was that we had some kind of a problem inside the database that would become evident when I uploaded a clean copy of Thesis. I uploaded my own copy so I wasn’t using a copy that you had. And I was using my own clean copy that I had already uploaded to antoher site successfully so I knew this one was fine. And then to that, I downloaded your custom folder and it was the custom folder that was coming from your working site. So I assumed it was fine and it was only because I first renamed that custom folder and the site went back to life. And then renamed the custom functions php file that I was really able to tell where the problem was. And I didn’t see that coming here. I didn’t expect that to be the problem. I thought we were going to have something else.
Tranque: So the initial issue was with all the plugins? I mean, can we activate plugins and see if there’s…
Rick: Well, we just activated a big plugin which is Backup Buddy. Backup Buddy requires a lot of memory and it is a… it requires a lot of memory to run and a lot of memory to load. And that backed up just fine. I mean, it backed up. It loaded and it backed up just fine. Where is the memory? What do we have for a memory limit here now?
Oh actually, also Blue Host has given you a nice high memory limit. They have given you a memory limit of 256 MB. So you remember, in your wp config file last night, we raised it to 96. But we could increase it higher if we felt that was necessary. We could take it up to 128 easily because Blue Host has allocated on the server 256 MB for you. But I mean, I don’t know. Be that as it may, we can… let’s see. What was a problem plugin you had last night?
Tranque: Weren’t they all? I mean, that’s the problem after a while.
Rick: Let’s see, no category base. Well you know, we had a database backup on that was causing problems.
Tranque: Yeah, that was the one.
Rick: So let’s just see if we can… let’s add new database backup. Okay…
Tranque: It was WP Backup.
Rick: Is this it here, WP DB Backup? Okay, let’s try it. Yeah, Austin Matzko. It sounds right. We activate the plugin. If we have a problem now… we don’t. We don’t have a problem. It went fine. If we select edit… no, we’re not going to edit. Let’s just go to… let’s create a database, a backup with it. Where did it go? Tools, backup… let’s backup all this stuff. Yeah, this is the plugin we had chosen with last night. Let’s back it up. I know what you’re thinking. You’re thinking to yourself as soon as we go away tonight, it’s going to stop working again.
Tranque: Yeah. It’s always the worry. Like when you drive your car out of the mechanic’s yard and…
Rick: Exactly. I don’t have any idea what you’re talking about. You know, we couldn’t make that noise.
Tranque: Yeah absolutely.
Rick: No, I got it. I feel your pain here but I think…
Tranque: It’s clear that this is something that I never could have diagnosed and most people can. And I’m kind of… I bet a lot of the pros would have struggled with that, man. You really did a great job figuring that one out.
Rick: Well you know, it’s… I mean, what you need is a tool set to just… have a process that you go through that you know and you just check the boxes off until you make the silly thing work. And we did that last night you know, when we were trying to activate the other plugins. And then we just did it again you know, with Thesis. But… I mean, it looks to me like these are all working just fine now. Let’s… I don’t know.
Tranque: Yeah you know, I honestly… as a php, I mean, the only thing I’ve ever done in that one file is follow the instructions in Thesis and pasted some code in there. But I don’t like to mess with that folder because all that follows is a big trainwreck. What happened was it did have the site not work so I had to upload from Dreamweaver to php file back into the folder. That’s probably where the problem occurs. Is that it?
Rick: Yeah, that probably is. It probably is. I mean you know, Dreamweaver is the kind of code editor I’m talking about that you should use. Dreamweaver is a perfectly acceptable substitute for Netbeans. And so you shouldn’t have any trouble using Dreamweaver as your code editor for php. But if you… but you probably can’t use… probably can’t do anything in conjunction with the custom file editor. You probably need to use… you probably need to do… well, I think you need to do all of your editing always in your code editor on your computer. So you should always use Dreamweaver for all of your code editing and never use the custom file editor.
Tranque: I see. The one within the site?
Rick: Never use the one inside the site. The only reason to use the one inside the site is to look and see what’s in the file itself. But never use it to edit. Never save anything there.
Tranque: Well that’s really good to know. So basically just download the folder and then do all the changes within Dreamweaver and then upload it again?
Rick: Right. And that is what I just did, right? I downloaded your custom folder from the site to my computer and then opened up those files in Netbeans and edited them.
Tranque: Okay. I’ll tell my VA to stay out of there in the future so we’ll just… so at least, if it’s screwed up, if it’s me, I’ll know it’s me that’s done it.
Rick: Yeah you know, if you can enforce the right behavior then you can let him do it. I mean, I have my staff that had to learn how to use the right tools before they can make changes like this you know, and they’re young people in the Philippines. And they just needed to learn how to do it. And once they learned how to do it, they’re capable of doing it.
Tranque: The issue is I think he was doing exactly what you said like throwing code in right from the site, inside the site so we have no way of checking through there for anything.
Rick: Right. I think that’s probably true too. And you know, Thesis has this thing built in that allows you to make those changes. But there isn’t anybody on the forum that recommends you do that. Even the people who are employed by Thesis, don’t recommend you do that.
Tranque: That’s interesting.
Rick: If you are an expert coder and you can tell the difference between error in code and not having an error in code, it can be a useful tool. But that’s only if you’re an expert coder. And you know, I do myself, from time to time when I’m troubleshooting something, I will, in fact, use that. But more often than not, people have problems with it.
Tranque: We’re also doing it because I certainly can’t write code or create it. So all I’m doing is copying what they’re showing us to copy and paste into that. So somewhere along the line, something happens.
Rick: Except that you’re copying it in a web browser which in it of itself is not a code editor. And you’re copying it from a HTML file which can have any number of visible and invisible codes in it. And when you copy those things in the web browser, it’s actually copying all that stuff.
Tranque: Yeah, I always paste into a… just a Word… I mean, into a text thing. I don’t know if that actually helped… how much that helps but I try to do that to clean up anything.
Rick: That does help a lot if you paste it directly into a… if you paste first into a plain text file as long as it’s not Word or something like that… but a plain text file.
Tranque: It just cleans it up.
Rick: Then it can help a lot. But the plain text file can still you know, use bat ticks instead of quotation marks for example.
Tranque: Interesting, yeah.
Rick: There are all kinds of little things that happen that… I mean, cutting and pasting errors occur all the time.
Tranque: Man, I sure appreciate you getting this cleared out. I never could have found that. It was nothing I can have done with my limited knowledge.
Rick: Well you know, I’m glad it’s working for you.
Tranque: Yeah me too. Now I can move on.
Rick: There you go.
Tranque: Yeah, alright.
Tranque: Thanks again. I really appreciate it.
Rick: Well, have a good day there.
Tranque: You too. Thanks.
Rick: Okay, bye bye.