WPwatercooler

EP313 – Inheriting code on a new WordPress project

March 15, 2019

On this episode of WPwatercooler, Jason Tucker hosts a candid discussion about the intricacies of inheriting code when embarking on a new WordPress project. Doris Ponce, who’s been with the Jetpack team at Automattic for the last six years, joins in, as does George and others. The discussion sheds light on the importance of discovery before taking on a project and the challenges that arise when encountering older, possibly outdated code. There’s an emphasis on ensuring that any code, whether old or new, adheres to WordPress best practices. The team also highlights the significance of considering the mobile experience, with tools like Google PageSpeed and White House being recommended. The episode touches on the unfortunate passing of Alex Mills, a long-time member of the WordPress community, and the effort by Automattic’s internal team, the Guardians, to ensure his plugins’ legacy remains intact. The episode wraps up with a nod to ServerPress and their tool, WP Site Sync, emphasizing its usefulness for seamless content migration between sites.

00:00 Introduction with Jason Tucker
00:10 Introducing the Episode Topic: Inheriting WordPress Code
01:06 Participant Introductions
02:31 The Challenge of Inheriting Someone Else’s Code
03:11 The Importance of Discovery in WordPress Projects
04:00 Avoiding Disparaging Previous Developers
05:10 The Evolution of Code Over Time
06:15 Discussing Hosting Decisions and Client Expectations
07:55 The Complexities of Legacy Code and Cost Implications
09:17 Long-term Effects of Code Decisions
10:28 Writing Code for Future Developers
13:10 WordPress Best Practices Over Time
13:48 Security and Code Best Practices
15:18 Importance of Mobile Performance Checks
17:35 Analyzing the WordPress Database for Redundancies
18:37 The Need for Website CARFAX: History of Web Development on a Site
21:53 Treating Clients as Partners in Web Development
23:38 Importance of Managed WordPress Hosting
25:09 Maintaining Legacy Plugins: Honoring Alex Mills
26:47 Onboarding Process and Handling Adopted Code
28:49 Wrapping Up and Sponsor Mention: ServerPress

Panel

Episode Transcription

(00:10) for inside oh my gosh what’s up this is Jason Tucker this is day P water-cooler episode number 313 we actually have a topic today but is inheriting code on a new WordPress project yes exactly that’s real stuff honest start us off tell us about yourself um hi I’m Doris Ponce I work on the jetpack team and automatic for the last six years and I get to do hiring and interviews and all sorts of randomizing email George say how about you I am cautious we are all Jean Valjean we are many he is one its if
(01:06) anyway 15 days lobster say my name is safe if they read and I do stuff with WordPress all the time t-shirt rest make repressed preach WordPress sleep WordPress eat WordPress wait sleep WordPress on all this yeah because I have like a bunch of WordPress okay go see your good thing about you those words I am Steve singing on the founder of Zeke Interactive I run the USU WordPress meetup I’m also in the organizing committee for OC word camp which is coming up April twice out Casper how about you hey everybody Jason Casper
(01:48) aka the human blink tag how’s it goin aka fat Mullenweg what’s up to be here just looking forward to having this conversation today me too I’m Jason Tucker you can find me over at Jason Tucker on Twitter my website Jason so I could not blog I do this show and ap blab we didn’t do it WP blah blah this this week and we’re probably not gonna do it next week as well sorry about this right now but is how this is how things happen so yes so yeah let’s talk let’s talk about inheriting inheriting code from you know
(02:31) somebody else build a website Yury you know you you’ve bid it on it you are yeah and now you have the code and you got the big rock crud so this person did XY and Z on this code what do I need to do here so let’s talk a little bit about that and kind of wait what should you do do you start from scratch do you take what they’re using and just kind of run with it I have so much yes so the first thing you do is say I will charge you X dollars to do discovery yeah I can give you a quote based on that and if you want to go with me
(03:11) great now a builded thing out for you you’ve got this discovery document you can make to anyone else and they can give you a better estimate than they could without it couldn’t have said it better myself we’re done all right and what do you do during discovery George ah you take a look at all the plugins that are installed make sure no one is hacked curves or plugins that things can be updated frequently you count the numbers for any plugins so you can get updates if you need to you can so say you bring up a good point is is a couple
(04:00) a couple okay so can you look back and tell us which episode that was no problem give me about 30 minutes but you bring up a good point right so one of the things it’s pretty let’s put tech aside for a second when I inherit code you know one of things I make sure I do is never despair as the personally inherited code from right probably privately to the client right I know what happens prior to me and hearing the code right I don’t know that the developer necessarily made the decisions that were there in the compelling I don’t know if
(04:37) the client forced those decisions I don’t know if the developer inherited the code from a prior developer before them right you have no idea what happened so don’t disparage anybody in here this is so important and this is what I was gonna say about being on both sides of this because I have clients who I did you know custom developed devs for when in May 2013 like this literally six years ago and they’re still up and running and you know I know you know if they’re redoing those things now I’m
(05:10) like you can’t you cannot compare the 2013 code to what is happening now like that’s literally like light years away and you don’t know why that developer left you know I just wanted to say a real quick story about this I what a client that you know did custom stuff for of this client was you know their type increasing they you know their their need to be online all the time and you know they were on shared hosting mm-hmm and it started to be where they would like you know call me if there were hosting issues and I’m like so
(05:46) FYI I’m not a hosting company I’m not on call 24 hours I can’t help you with this stuff we need to move and your site needs to be up you need you need more attention than what you have for your technical setup so I was like you need to move to WP engine WP engine is great it’s exactly what you need you’ll be up it’s a little bit more expensive you have support lotta dude upgrades in the backups all this fun stuff you just said the e word which one expensive no I mean yeah right okay so you know
(06:15) comparatively though right and this was back when WP engine had bike didn’t have the $29 plan or whatever so they were you know like double what it was just one just one managed tenho skaters okay guys just so you know it’s ten it’s ten you go daddy’s on your intro trick it’s funny but so they so I’m like here’s my recommendation this is you know this is what it would take to move this to that level ah here we go this is gonna be great for you and their response to me was I’ve I googled this
(06:52) and I looked some people on the internet are saying that WP engine is too expensive and not worth it and two weeks I said great you should them to help you it’s been great working with you and I have to go now that that is awesome right and so uh the things I was gonna say to tie that back into George’s comment about discovery right what you just said and discovery those are great weed out processes for I mean they were already my client but that was that was the reason that I left and the code stayed there stayed on a subpar thing it
(07:24) was so much that needed to be updated and I was just like I if you are going to question my knowledge about something so simple as a hosting company wholly the people on the internet that you don’t know that means you have no respect for my opinion no trust in what I’m recommending to you and why would you trust anything else that I say that’s great I’m specifically talking about cost right so somebody is not willing to pay a hundred bucks a month right for decent hosting right oh it’s 115 there right and if they’re not
(07:55) willing to pay your discovery bill it’s not gonna be a good engagement for it’s not gonna be a good relationship because anytime in the heritage code I I don’t think I’ve ever inherited code where it hasn’t become a larger project than what the client expected it is a large project when you go in you’re inheriting code because you’re gonna make it yours right and they’re there there is a process that’s involved in that right even whether you’re refactoring or you were doing it’s gonna be more expensive
(08:21) than what the client has nmi well because in the clients mind you know they’ve already built the site and so they’re just like taking their car to get an oil change or you know like update software something they’re not like thinking oh I need a new transmission well you might be like hey this actually has been recalled and you know take it out and so if the client comes to you and they’ve already built the site they think they’ve already spent this money right and they figure it’s just a maintenance
(08:48) project or an oil change how do you handle that conversation by well what I started to do you know and what I do kind of recurringly is I collect there’s there’s people out there who are willing to be just like technicians will they’ll go in and do exactly what the client wants on top of whatever is existing there and I you know basically at this point funnel to those people because I won’t do that anymore I’m not gonna fix a broken system I I refuse no longer happening so no so here’s what I do I
(09:17) get into the conversation of short term and long term right you can spend you know some now right to have a much better long-term experience right we can put some things in place where which makes maintenance easier it makes the site and run smoother it’s just gonna put make the site more future-proof right or you can you can not do those things and spend down the road right and and it turns it over time it’s a lot more in my experience it’s a lot more if you spend over time then put in the effort crap here’s a graph it’s really
(09:49) right here either way what do you want you also have to factor in business loss if the site does go down the cost of that on top of you still have to fix it later and in this code this code that we’re talking about isn’t just isn’t just if you were to bring on new client but also if you went and switched from working at one company to another and now you’re in that company and you own that code like that’s not like and there may be some history behind that code it may be like Dave just used to tell me
(10:28) that that you’re that when you’re going to write this code you need to make sure that you’re writing it for future Jason or future future Dave Josh almost always this thing was like worrying about the guy that it’s gonna be dealing with this later and it may be you you write a code you wrote five minutes ago I’ve bumped into future Steve he’s an [ __ ] yeah but mean think of all you’ve done to them the poor guy no I get it no I understand that I’m part of the problem I featured passport future costs for as a
(11:01) really cool jacket but he will not tell me where he got it best summaries I’ve heard very much along those lines saying that write your code and document your code as though if you don’t do it right draw you will come back and play in the future so back in back in the day I didn’t you know I didn’t think about future whatever like long time ago like you’re saying and I didn’t I didn’t know I didn’t even think that but like you know I didn’t do you know you don’t necessarily do extensive documentation
(11:45) or whatever and like that I think is really the way to like in the code that is how you can communicate later with people you’re like this is why I put this here right right here and the cool thing about that is you’re literally talking to the other developers and if the person isn’t in there it’s probably because their client and they wouldn’t understand it anyway but the person who comes into the code and is like oh this makes sense I mean I do that even just like on my CSS files and like this is our what these things
(12:12) are for like you know just what it’s connected I don’t I don’t need to switch and we’ve got a lot to cover right so I want to talk about some things that I look for in discovery so in that discovery process I’m doing it code analysis one of the first things I’m looking for is best practices right so I looking for what plugins are using what scene they’re using was a custom built theme are the is there any custom code where was it placed is at least plugin is it in mu plugins is it sitting
(12:41) somewhere it’s not supposed to be sitting right right is there something sitting in the root for have they make changes to core code like George said right core WordPress code core plugins things like that right look for all those things but especially in the custom code line when I identify a piece of custom code over that up and immediately I’m looking for WordPress WordPress best practices the problem again I just want to reiterate WordPress back best practices in like 2013 2015 different than WordPress back
(13:10) 20:19 being cuffed that is the same absolutely but when I but and that’s and I think what you’re referring to as a matter of how you document that stuff right when I talk with that stuff I’m not saying what was this developer thinking yeah it might be of course but my report is this these lines of code these pieces these functions I found aren’t following WordPress best practices or it’s just old it’s been depreciated they may be have you ever used a function before you be wishing the other thing I’m looking for is is
(13:48) security best practices right appropriately is it they’re using best practices for getting things in and out of posts and and and requests and things like that so you know I’m also analyzing for security best practices the last thing I look at this is this is the biggies is I install query monitor I’m looking for sequel best practices you know slow queries things that are that are really slowing the system now and and that’s one of the things that you know when I when I when I inherit site when I first are doing a curve you I
(14:20) will put it on a local machine I’ll put it in the sandbox right and I’ll just see how the site feels right forget query right just yeah just just start going through things see how is it loading properly is you know as I’m cruising around is it is it is it running smoothly right and then I start to look at the query monitors see if there are is evidence of slow queries duplicate queries PHP errors all that kinda stuff also it you know but if there is there are issues it very well could be the content you know maybe the
(14:51) client didn’t use it right maybe they didn’t understand how it was set up in the first place so you know something’s been going in the wrong spot or being renamed or they’re using you know giant images where they’re supposed to or they you know they’re putting their own stuff their own hacks into stuff oh it could be it could be a content you know inside the admin issue and not even in the code and so one of the things that I do externally to technically for what you’re saying say is I used something
(15:18) like Pingdom tools Google PageSpeed and I pick a set of pages right and I run through all these tools because they don’t give you a full report of you know are there are scripts that are lower or other scripts that are loading slowly is our CDN in place or are there two other images that are just taking a lot of space how is the external load happening yeah so there’s so many sites I want to like go back and rebuild the worst thing is like your old code and I’m like oh I just would have done that differently or
(15:45) oh I wish I had had technology then and oh I don’t know we’re not good that the person wrote but rather the plugins that they selected that Jack it all up and that was one of the topics with now I remembering this Steve that was one of the topics that we were thinking about was that whole idea of like using somebody else’s code in your website and having that that plug-in be the thing well so Jason I put three links in the chat one is the tools Google Page the GT matrix between all those and there’s a
(16:15) lot of crossover there but one things I like a Google page Google PageSpeed is it’ll kind of tell you why you’re getting the great you’re getting and pay attention to those things because it’ll tell you do you need to async your javascript is there stuff that’s loading that doesn’t need to be loading and there’s some interesting things that they’ve done in the chrome developer tools that will tell you that you can actually drill down at the page and script level it’ll tell you what scripts
(16:41) are actually not being used and what can be kind of moved off to you know later loads to start improving those scores and most of the time I’d say eight or nine times out of ten that stuff’s coming from a plug-in it’s being loaded something’s being loaded by a plugin that’s just not needed you know the same thing does apply for old plugins right there was a plugin that five years ago was a great plugin and you know like we talked about a couple of weeks ago it hadn’t been updated or whatever or you
(17:07) know maybe it hasn’t been updated but it hasn’t been updated in the repository so you don’t know that it’s out of date because it doesn’t have that plug-in you’re talking about two episodes ago but look at that episode if you want but like you know you don’t even know that that’s that plug-in is bringing in the bad and so and it related to that one of the other things I do in the site analysis open up the database I look in PHP myadmin or in in in another day a stool I look at the database and what
(17:35) I’m specifically looking for is just like where if there’s bloated tables but also are there tables that aren’t being used anymore because a lot of times what people do is install plugins and either deactivate them and and the tables will stick around for forget it the activator and then just delete the plug-in which makes the tables just sit there right so now you’ve got this bloated database with all this stuff that you don’t need so I’ll do it I’m actually do a table analysis see are these tables actually
(18:04) still being used by active plugins they’re tool used for that or is that just manual it’s right now it’s me I have a phone I was like oh they take some time it’s nice that part of the fight now which plugin created a given table and what it’s not what it the way I do it is is I look at the tables and I you know I know by now kind of what what the gravity forms tables look like what they know stables look like but if I see one I don’t recognize I will actually copy the name of the table and I’ll go right to the code I
(18:37) use the code as a source and I’ll search for those table names in the code to see if it’s even if it even exists that’ll tell me what plugin it comes from yeah what White House is actually an interesting project that Google has started including in chrome that also amongst the tools that Steve shared what White House does is it basically checks from mobile standpoint yeah what your performance is like a lot of people because they’re just developing on their browser do not think to check how things
(19:15) look on mobile you know especially a lot of starting developers you know folks are a little more experienced like Steve and say I’m sure at least take the time to feature say around could you join them yeah so white houses they actually have a command line tool there’s also a tool included in chrome now and newer versions of chrome that will allow you to run White House reports on any of your domains on specific pages etc so you can get a very deep understanding and inside of like okay well see you have a responsive page but you’re still
(20:14) serving up full sized images on you know on the mobile view like you can totally trim those down you should draw those down you know things like that those little additional insights that PageSpeed GT metrics webpagetest those things won’t necessarily like shakeout for you what do you do if you install white house or use the code if you put another link in there if you go to Google PageSpeed there’s a link to a white house in there where you can run it inside of prove chrome dev tools sorry go ahead oh just good say so what do you do when
(20:55) you you know you present all this discovery and you’re like okay well you know this these these images here this is here this code needs to be updated over here we need to find a new plugin for this and we recommend it’s gonna be to fix all this you know your transmission cost for example are going to be X number of dollars they’re like whoa cuz you know sticker shock and all that like if they don’t want to or can’t pay for all of that at once or at all do you say C add you say ok these are the
(21:26) most important things but we can’t be held responsible for this other stuff because if that stuff violates your best practice like so I have you know you were kind of touching on this with the client wanted it in there or the client dictated note this is what I choose I’ve been fresh you know I’ve had a lot of clients that made choices that weren’t my choices like they went again Commendation they weren’t the best practice right and I you know you can’t you got to do it and it’s like you can’t
(21:53) just say ok bye to every single client who doesn’t do everything you want them to do so what is your method for dealing with that well I will say sometimes during that conversation I do like to hit the roof of the website and say you can fit so many more sales into this baby you can fit so many more blog posts into this baby if you just do if you just spend the money and that normally gets me far less pushback but that’s I mean that’s just me Steve language yeah for me good miles on it yeah for me it’s more of a
(22:33) conversation right it’s it’s it’s hey this is where we stand now these choices were made before I came along this is what I’m recommending and here’s why right and and let’s discuss the long-term effects of both ways right so I really try to treat the client as a partner and just have a conversation about what these decisions codes will lead to what the cost savings look like down the road for spending the money now right I don’t I don’t know that there’s you know there’s any time I’ve ever you
(23:06) know said that or thought look if you make this decision we’re just we’re done here right that’s not really isn’t really how it works it’s really if they weren’t gonna move they didn’t want to move we’d be like sure I’ll deal with your Hostgator site okay there is a line there is a line we found it well but I’ve never but I’ve never had to I’ve never had to make that decision I’ve always explained the benefits of shares of hey I made a better persuasion score
(23:38) Steve my website runs on PHP 4 what will you make sure that my site stays working yeah now again keep in mind so we talked about a week a weed out process right so if there’s a client that is insisting that hundred dollars a month is too much for them right or the discovery that we’re proposing is too much for them that’s just not our it’s our clients so that’s why i don’t run these things we’ve already weeded them out by that point right so you you you brought on clients who are basically like a vetted
(24:08) and they’re they have they have demonstrated their willingness to respect your professional expertise yeah I think that’s part of it I think more what we’re looking for is clients that are gonna okay as partners no it’s not even pay it’s not even about paint yes I mean that makes sense but it’s really you know we’re weaving out clients that don’t want to be in partnerships right because I don’t I don’t like to be a vendor right when we’re a vendor we sort of that’s not a comfortable relationship
(24:41) that’s sort of the relationship that you’re describing I think that’s really the key because I think there’s a lot of clients out there who view web development as that as like you know a car purchase whatever when exactly what you’re saying is it’s not like that it’s like your accountant more it’s let you know it’s like you’re that you need to continually check in with and adopt things for and every year you got it you know to your upgrades and your bookkeeping Steve what percentage of
(25:09) discovery is the total cost of of a project like if it like on average like is it ten percent of the project is it five percent the project is it again it depends on the project I mean I’ll give you my discovery costs to your site analysis starts at $2,500 all right so that by itself is you know is a marker right there’s a lot of points there’s a lot of clients with your site their budget for the website is $2,500 right that means that you’re not putting in – you’re not taking that website and put
(25:41) it in on built with and going yeah use WordPress hours of discovery why the reason why I bring that up is the simple fact that there’s people out there that are building websites for fifteen hundred bucks and they’re trying to figure out how can I go and like do discovery on a 15 higher dollar project and you you really can’t you’re essentially saying like I’m gonna use built with to tell you that you’re using WordPress dollar they’re our project goes down and they don’t even think
(26:15) about discovery being a cost to them in terms of time they think about it and often the client thinks about it in terms of proposal development go in and look at your code and stuff to figure out what I’m gonna tell you goodbye and think about it as its own cost and those the clients will just take it and go somewhere else and say here built this for me after you live in an hours building the proposal Jason for those clients that are watching that you know that have that sort of budget I’m gonna give the free advice right now
(26:47) right move WordPress house no do not yes move to a man’s WordPress host and if that’s not a possibility install WP super cache like or putting put cloud fire in place that’s it manage hosting go to go to a place like WP h or wordpress.com that gives you built in support where you can talk to somebody and they will help you I like because that’s a DIY budget where you’re bringing it you’re doing it yourself and maybe bringing in some people to help you you see this all the time in our
(27:20) meetups where you have submit shows up who’s had 20 different developers may be that all 20 people that are in the room have gone through this person you know to do all their stuff and then they go like I you know I don’t want to pay for discovery and you’re like well if you would have paid first discovery at the beginning you would have found that all of these 20 different people have built their website all these different ways you know essentially have contributed to the issues that you’re currently having
(27:44) franken site yep hey you know maybe maybe there needs to be like you know there’s like CARFAX there should provide websites like I think Oh like the web developers like leave it like like there should be like that’s a file in the code like here’s the web there’s a VIN there’s a Vince website okay just how many crashes how many times is this by Brent act like we’re wrapping up but one last thing I really want to get in we’re talking about inheriting all the people’s code this has been mostly and
(28:17) hurting other people’s websites there’s also something where if a plug-in seems like it’s gonna get abandoned or the person can no longer maintain it it might get adopted or pass over to someone else um recently a lot folks are aware that Alex Mills who’s been part of the WordPress community for well over a decade has passed away automatic has an internal team the Guardians who is going to be taking over the majority of maintenance on most of Alex’s plugins yeah yep they’re still actively using the WordPress community
(28:49) very heavily on they’re going to be taking ownership of those going forward maintaining them so they don’t just like fall into disrepair link rod and his legacy will live on we talk about is is the onboarding process right I want to talk about what you actually do once you get what you have the code awesome we can definitely do that let’s do it sweet well III do want to let you folks know that if you go over to server press comm they’re the folks that sponsored this particular episode and I want you to
(29:41) know that the the stuff that they’ve been building over there is pretty awesome and last week we did talk about a WP site sync which is just amazing way of being oh the move content from one site to another or from local to or any of those sorts of things so yeah feel free to go take a look at that that’s over it server press calm they’ve been doing some amazing stuff over there and they’ve been helping us out with making sure that we keep the lights on over here so I can help you do your discovery
(30:07) yeah definitely do your discovery I like that all right folks you have a good one touch y’all later going to record home / subscribe see you later

Show More Show Less

Likes, Bookmarks, and Reposts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.