Episode 129 / 2022.04.11
On this standup, we have Ben Croker from Put Your Lights On to discuss the ongoing war with squirrels that Andrew has been engaged in.
Far from the cute, cuddly little plushies that Ben thinks they are, squirrels are actually insidiously evil little monsters that eat your house down one shingle at a time.
We then also discuss pressing topics like the proper plural of € “Euro”, and have a chat about Craft CMS 4, the work we’ve needed to do on our plugins to get them updated, and what the new yearly versioning scheme means to you.
We then go on to talk about PHP benchmarks, and how to keep motivated with content creation.
- Ben Croker on Twitter
- Why do squirrels chew on roofs?
- Roma Gans
- A coffee costs €2: The plural of euro
- Language and the Euro
- Craft CMS 4 Beta blog post
- Craft CMS 3 as an Application Platform devMode episode
- Craft CMS Roadmap
- GitHub Actions
- Template Comments plugin diff
- Craft CMS 3 PHP version benchmarks
- Common Security Vulnerabilities in Craft CMS Plugins
Andrew: And welcome to devmo fm a podcast dedicated to the tools techniques and technologies used in modern web development I'm Andrew Welch from and ny studio one zero seven and we've got Ben on today because Ryan is off.
Ben Croker: And I'm Ben Kroger from putyarddeit song.
Andrew: Wearing his mankini vacationing somewhere in the South Pacific is my understanding and we're gonna do a little standup where we're gonna We're gonna talk about a couple of things right? ben.
Ben Croker: Yeah, how dare he go on holiday when you have ah when you have a show scheduled I mean it's unheard of.
Andrew: I guess it's sort. It's very irresponsible to be honest, but so I don't know if you know but actually I'm I'm gonna start over so Ryan I'm I'm feeling really good today because I got to sleep in today. My son. Okay.
Ben Croker: You called me ryan.
Andrew: Sorry so Ben I'm feeling really good today I got to sleep in today. It was magnificent. My son came in my room in the morning I normally drive the kids to work I normally drive the kids to school in the morning. So I have to get up in time for them and I was actually up late working on something. And he came in the room and he said he was feeling a little sick and he wasn't going to school today and I was just like oh I'm sorry to hear that and I just rolled over and I went back to sleep and it was glorious Ben it was absolutely glorious and if you hear any weird noises while we're doing this podcast I got a couple things going on. We had. Live in an area with a bunch of trees I live kind of in like a grove of trees and we had the second highest winds ever recorded from some freak system that came in and so I've got people that are taking all these trees down a couple narrowly missed the house and god they they didn't hit it and then also.
Ben Croker: Oh wow.
Andrew: I've got this ongoing battle with squirrels all right? So I work out of a barn and apparently some squirrels have moved in like I went into the back area of the barn like the unfinished area where my office is not and there's a little model of the house that the people that owned it before us. They built this model. The house because they were expanding it and the frickin' squirrels got into the model of the house. They they tore up the insulation and they put it in this model of my house and they nested in a mini model of my house. It's like they're planning their grand takeover and this is the the preparation for it or something and I've been hearing them ah run. There's like a little crawl space above the roof I've been hearing them run and you know fighting over nuts and stuff. They've been driving me crazy. So I've got some people here that were building a rodent barrier around the barn. They're digging like kind of a moat around the barn. And they're putting basically fencing in there and then they're plugging up all the holes and they're leaving like 8 traps and where're we're gonna catch all these frickin squirrels and apparently I didn't know this but squirrels I guess because they're fuzzy and cute. They're protected so you can't just kill them like you can't just set like. Ah, trap with poison in it and kill them. You have to catch them so they're going to be caught and released at this place called Kineius Lake it's like a vacation area. So if you hear any weird sounds right? If you hear any weird sounds Ben. That's all of the squirrels and the the people digging the the moat and all the crazy stuff that's going on around my house and.
Ben Croker: So what this this assumes that squirrels burrow underneath the soil like under the under the down into the foundation rather than just like hopping off a tree onto the roof and finding their way in that way because that seems a bit more plausible if I'm honest, okay.
Andrew: So They do both. They do both. They definitely do like I've seen the areas that they have dug underneath to get in and so they definitely do both but they also the barn is sealed off so there's no real way for them to easily get in and in addition to that barrier. They're also. Ah, fortifying the rest of the barn to make sure that there is no way for these little suckers to get in. So.
Ben Croker: Okay, well if I'm honest I wouldn't condone killing them so'm I'm glad they're being sent away to to their retirement home or sounds like they're equivalent of the equivalent to where where Ryan's gone for his holidays.
Andrew: Right? Well listen if you wouldn't condone killing squirrels that you have never lived in a place where you have squirrels infesting your home I guarantee it okay because listen when I was a kid.
Ben Croker: I Have not yeah.
Andrew: Ah, used to I literally used to have to walk about a little over a mile to get to the bus stop. We lived in kind of ah a rural area and the the road was really hilly a bus couldn't get on there and there was a lady that lived down the street and her name was roma gans g a n n s I believe. And actually if you Google her name. She's a children's book author so she is a sweet old lady. She lived in a house that her husband built for her and she wrote children's books and we used to visit her sometimes when we were coming to and from the bus stop and she would give us candy so we called her the the candy lady and she's really sweet. She read us books and everything. There's this one time I was walking Roma Gans yeah so we were we were walking up to her house 1 time and I heard these gunshots going all like and it turned out that she was out there with a shotgun just plugging squirrels that were gnawing on her their wooden roofs she's just blowing them away.
Ben Croker: Candy gans.
Andrew: This kind of and in a childhood trauma of my and in in it.
Ben Croker: Oh but but they're protected there where where you are and actually you you said that you had some of the windiest weather you've had in years and that's that must be saying something because you're near the great lakes right? So it regularly blows there.
Andrew: It's right. It's really, it's usually not too bad. The the thing with squirrels. They're not protected right? They're they're everywhere here Man they're not an endangered species. They're actually invasive.
Ben Croker: Are. Yeah.
Andrew: They're just classified differently I guess cause they're cute, but they're rodents then they're rodents. That's what they are. They're just rodents that have cute little tails and they look cute because they're eating their little nuts but man they can gnaw apart your house in a heartbeat they they can be brutal.
Ben Croker: Well, it sounds like they're plotting something up in your in your ceiling in your loft.
Andrew: Anyway, one of the things that I do with Ryan pretty often. It's a thing that I've started is we talk about a word origin and I wanted to bring one up to you because this has special meaning it's near and dear to your heart. It's called the euro what is.
Ben Croker: A Euro is well. It's the currency that the that every country in the European union that has opted into the eurocurrency is using as its um, currency of trade and it was introduced wait.
Andrew: Ah, Euro then.
Ben Croker: Where are you going with this before I like start taking this year do you do you have you winding me up here you pulling my leg. Okay, okay, so yeah, so it's the the form of currency that most of I don't know how many of the european union countries are using.
Andrew: No, no continue continue. No, it's a very serious topic.
Ben Croker: And some of the countries decided to stick to their to their own currency. So Sweden Denmark um, the Uk when they were in the euro obviously stuck with the with the british pound um that's it that's what the euro is.
Andrew: But what is the plural of euro. So if I gave you 1 euro obviously that makes sense. But what if I wanted to give you 2 How would I say that.
Ben Croker: Well, Ah, the correct way to say it is to Euro because um, it was agreed I believe um when they came up with the name for the currency. They also came up for the plural and they said well not every country Puts An You know, not every language puts an s on the end. To indicate the plural of a word. So um, it's just going to be Euro Regardless of whether it's one or multiple.
Andrew: And my understanding is that this is a pet peeve of yours because I remember I was with you a long time ago and I said you know here's two Euros or whatever and you're like no no, it was in the middle of a cab ride or something and you're like no Andrew this is very serious. That is incorrect. You cannot say euros that is incorrect is that right.
Ben Croker: I did say that yes you can say it and people will understand you. It's not like people are not going to know what you're talking about like what what is this euros thing you speak of Andrew um, and you know people for example, the british ah very often will say euros um, but hey. They use pounds. So whatever, go ahead.
Andrew: All right? Well I did my research Ben I got bad news for you. It is the official stance that in english both euro and euros are correct though. Euro tends to be less popular in everyday speech. However, the eu legislators use euro if you're not 1 of them here's the advice from a freelance editor use the version that you like chances are you already have a strong preference. However, it is written into the style guides of Miriam Webster Colins dictionary http://cambridgedictionarydictionary.com etc etc etc that Euros is the correct usage of the word euro and in fact, they they originally introduced it. They wanted it just to be euro because they didn't want ul sorts of weirdness in singular versus plural. Um, the currency. But as soon as they did that a number of countries France Slovenia Spain and portugal they made their own pluralized version of it and english did the same so it actually it's only technically correct. If you're doing it in the context of legal or european commission work in everyday usage. Everyone is totally fine with euro or euros I'm sorry Ben I don't want to I don't want to have to do this to you but you're gonna have to accept.
Ben Croker: Are you saying that our cab ride was not a legal setting in which we were discussing legislative legislative Manners matters I mean.
Andrew: Ah I'm sorry Ben you're gonna have to accept that you know there's ah, there's a little bit of flexibility. You're gonna need here. You're gonna need to be a little little tolerant. Oh here we go.
Andrew: Yep Well I'm just letting you know in a lot of style guides and a lot of usage they say it's totally fine and it's not just English where you might use Euro and Euros It's also in a number of other languages Apparently where the singular differs from the plural. Because it's more natural for their language Usage. So change change man change I know you look skeptical and and.
Ben Croker: I'm working on my I'm I'm working on my tolerance. Sandra.
Andrew: Ah, you're looking at youre you're looking at youre like oh man as far as I'm Concerned. It's still Euro I don't care I'm using underscores for all my private methods. It doesn't matter. Okay, all right, all right. So That's our that's our little word stuff. Well why don't we get into some more tech stuff so you had a couple of things that you wanted to to talk about.
Ben Croker: Yeah I mean we have craft four on the horizon or more than just on the horizon. We actually have a beta I think we're at beta 2 now with a ah with a hopeful launch date of what is it may the fourth I believe.
Andrew: They and they're hijacking the the star wars day which is it's cultural appropriation. Brandon I think you're it's not good anyway.
Ben Croker: And.
Ben Croker: I was pretty I was pretty floored when I when I put 2 and 2 together actually but but we have that on the horizon and for me at least that means you know, basically asking the questions. Well what does this enable not just in terms of what can I build with this What can I use craft for. But. What can I add to my plugins and also starts starts me up thinking um these kind of wider. So I'm just going to start that little last thought again and it also got me thinking again about. How craft can be used in the broader sense. So we think of craft as a web-based content management system which is what it is at its core and it's probably the the most common usage of it but we actually did an episode back in late 2018 believe it or not I had to look that up because I can't believe it was that long ago.
Andrew: My goodness.
Ben Croker: Ah, so we had ah an episode here. KraftCMS 3 as an application platform and there we talked about yes Kraft is a Cms and you have plugins for it but you can actually think of it as a framework not only for building sites on websites and web apps. Um, say websites the sorry to do that again. I'm going to go back and resset that you can think of it as not only a platform for building websites on but you can actually due to its extensible. Architecture and the way that you can use plugins and modules to essentially do anything. Um, you can think of it as also a framework for developing content-based web apps on top of as well and obviously with the introduction of the graphql api and headless mode and all of those things. Throughout the throughout the craft 3 minor version releases. We saw it kind of evolving more and more in that direction and you know it's three and a half years later so maybe we could kind of revisit what has changed and and now with craft four. Um, the horizon and how that is has become even more and has introduced even more possibilities.
Andrew: So let me ask you a question Ben. What do you think about the new versioning system and release schedule that pixel and tonic uses. So everyone that was in the ecosystem from the craft 2 to craft three upgrade. Remembers that especially for plugin developers but also to some extent for people that were just building websites. It was kind of a major update and it was a lot of work to convert it over what they're doing now is they're doing annual releases. So there's going to be a major release of craft every year. And you can think of the scope of the changes in those releases as being more like a couple of minor versions of craft 3 kind of put together so they're going to be There's gonna be a major release every year but the the delta or what has changed is going to be smaller. What are your thoughts on that as a. Plugin developer or just as someone that builds sites with kra they're changing of that versioning system and their release schedule.
Ben Croker: Well I mean I welcome it very much and and even the the 3 the 3 point one three point 2 those kind of minor releases even Brandon and Kelly has said you know some of those probably should have been a major release due to the nature of the. Features that they packed in there and some of them maybe had some small or minor breaking changes I'm sure some of those features would have been easier to add if if it had been a major version because they could have broken a bit more and maybe they wouldn't have had to and. Try and maintain that reverse compatibility backwards compatibility I should say um, but I welcome this for for several reasons for 1 it's it's um just a more predictable model so we kind of know that K Craft four is going to be supported and. Believe for for 2 years and then for another year of security updates if I haven't got that wrong. So so we kind of have a timeline that once you once you commit to a version of craft. You know that that's going to be supported for x number of years and you know how long that's going to be and you also know how. How long you have until the next major version is ready so you can prepare for that you can if you're an agency then you can build it into your maintenance schedule for example. So I think that's that's good across the board for everybody as a plugin developer I'm especially looking forward to. Being able to put updates out there more regularly that take advantage of the features that k craft introduces and this is one of the big things I think that that this long cycle because it's been four years right? 4 years since K Craft three was reduced and. You and I both try to and when we're pushing updates in our plugins. We do our best to maintain backwards compatibility so you can go back and use this as far back as 3 in some cases 3.0 in some cases 3 point 1 or 3 point 2 craft is now at 3 point 7 and the tricky thing there is that if they introduce a feature in 3 point 5 for example and we want to take advantage of that in one of our plugins. We either have to say okay, you can only install this plugin now this plugin now only works from three point five and above or we have to kind of just. Compromise and say okay, we can't take advantage of this feature so we have to we have to continue doing it the old way which which means that there's often some legacy code left in place or there is maybe an in-between which I think you've used a few times Andrew which is where you kind of.
Ben Croker: Have a conditional you check what version of craft is installed and if it is high enough then you can use those features and that will work sometimes but but with features that are you know, really close to the metal or or very very involved. It's not really feasible to be doing that. So. Um, So so as a plugin developer I look forward to being able to kind of modernize my codebase more often and it means that then for every major version. It will be a less painful update because there'll be less to basically rip out and throw Away. Ah. And there will be like we'll be able to continue keeping on top of the the nice additions. The K Craft makes.
Andrew: So I'm going to get back to that but I want to mention that from my perspective them using this new versioning scheme the number 1 thing in my mind is that if this makes it easier for the pixel and tonic team to manage the project then I'm all for it. Like forgetting about everything else if this is something that it gives them a little more structure a little more routine so that now if there is a major breaking feature. They're not going to introduce it into point release I can say okay well it's just next year that we have to wait and we can put these things together. So my number one concern.
Ben Croker: Right.
Andrew: Is if this is something that makes it better or easier for pixel and tonic to do the things that they need to do like I think that's fantastic I agree with you that a reliable and dependable release schedule is really important because then you can plan maintenance. You can plan updates you can do all that kind of stuff right. Remains to be seen I think you know they say they're going to be annual releases. Let's hope they are and this isn't a knock on them. It's just software is software. You know if you have a fixed release date for something The only thing you can do is cut features to meet that release date. There is no other way to do it. Have to say this is the the date either from a marketing concern or a public concern or or whatever and we're going to release this and I think it was great that pixel and tonic came up with a roadmap showed us what we're working on but we also saw the reality of this in that they think there were 8 major features that they. Had kind of planned for 4 that just didn't make the cut but that's the reality of doing software development when you're on a release date schedule like that just is what it is and it's going to happen. You know, um, what you were talking about before in terms of versioning one of the reasons why I have done in my plugins where. Will check for a specific version of K Craft and only then enable that feature is that I've just seen the way that people work with k craft they tend to keep the updates are not necessarily They're not necessarily always updating to the latest version of craft I think they should be but I also understand from the perspective of. You make a website for a client and they don't want a maintenance contract. You know it's just there. It is what it is I wanted to be able to add these features in a way that people could continue updating my plugin getting bug fixes, etc, etc without having to force them to update to a new version of craft now. It remains to be seen whether that is actually worthwhile doing it certainly I'm gonna have to do it a little bit less I think with the new versioning. The 1 thing it does it does let you modernize stuff right? So now you can say all I'm going to target this for craft four but on the other hand it does make you maintain a separate fork.
Ben Croker: Sure yeah.
Andrew: Of the plugin right? because you're going to have to support and issue updates for craft 3 plugins for whatever your term is I'm doing a year of updates and then a year of security fixes which matches what pixel and tonic is doing for craft when kraf.
Ben Croker: Okay I think I said 2 years plus 1 year but it's it's 1 year plus 1 year okay
Andrew: 1 year plus 1 year unless they've changed it recently. So it's a total of ah so it's possible that there will be 3 versions of craft that you are going to have to be doing stuff for your plugins at any 1 time because they'll be the the current version which is craft 4 and then next year there's going to be a craft five in beta that you're going to have to start porting your plugins to and then you'll also have craft three that will be in the security fix phase now. The nice thing is that this phase is down right? There'll be less and less support and less and less work that needs to be done on the older versions of k craft. As the newer versions are coming in but it also does add complexity from that point of view in terms of you have to juggle these different branches and make sure everything's in sync and all that kind of stuff. So I think it's a tradeoff but is that a tradeoff that you think is going to be worth it.
Ben Croker: I think it is going to be worth it. I mean my my perspective is that once a new major version comes out. There'll be a feature freeze on on the older version so bug fixes. Ah obviously will continue and. Security updates that goes without saying but any major versions will go into the current. So the the the version of the plugin that works with the newest version of craft. So if there's ah and a version of Blitz that's now working with K Craft four that's the version that we'll get. Ah, new features and the reason for that is because the new features that are going to go into Blitz 4 which works on craft four are going to be. They're going to take advantage of these you know new craft four features for the most part.
Andrew: Well let's say you've got this cool new feature for Blitz. It's just it's really cool. Maybe it's the stale wall revalidate or stale wall and or sorry oh my god what is it called? okay.
Ben Croker: Stale while revalidated.
Andrew: Maybe it's the stale wall revalidate which is sort of ah, kind of a nerdy technical thing but basically means that when the cache is broken. It will continue to serve up cached pages while it's rebuilding the actual new cache which is a wonderful feature for static cache sites and you you got it implemented. It doesn't depend on. Anything craft 4 specific and it will add so much value to your users that this part of you want to be able to make that work in the the craft 3 version and.
Ben Croker: Well funny funny. You should bring up that example because that is exactly what I'm working on at the moment. Um, and yes it is tempting. It is tempting to say well you know why should all of the craft 3 users miss out on this if it is really a feature that doesn't touch any of the you know. Anything new that has been releasing K Craft for then I would consider it. That's for sure. But I'm not sure if it's a feature that is so in demandd that you know everybody who's on craft three will be. You know will be will be looking to try it out straight Away. So. I'm not sure if there's such an urgency on that kind of thing. But I mean.
Andrew: Well, it would be perfectly valid to say to them if you want this feature update to craft four now. The only thing that.
Ben Croker: Right? And the idea is right? The idea is that the update from craft three to craft four should be relatively relatively painless and therefore why would you not? especially once we have a stable release and maybe.
Ben Croker: After a little bit of time has passed and everything is kind of settled down. Why would you not update to craft four. The only reason would be that there's something major holding you back, but that probably has to do with some custom modules or some plugins that haven't updated and hopefully that will just be a matter of time before.
Andrew: That right? and I do think that the update from craft three to craft four even though it is much more minor than the update from craft 2 to craft three I also think it's going to be.
Ben Croker: Before those are updated.
Andrew: Probably 1 of the quote unquote worst updates only in that every plugin and every custom module very likely had to have some kind of refactoring done for it to work. It's very possible that the craft 4 to craft five update will require no modifications. The plugins unless they touch on certain areas of craft that they have changed and refactored and and done stuff with it's it's.
Ben Croker: Right? And a big a big part of that is the switch or the the change of the minimum required php version right? because we've gone from 7 point 2 to 8 and then they've added some strict typing so so there is that requirement and very likely when craft 5 comes out. Maybe the minimum requirement will go to 8 point one but there there's less of a justification to actually introduce breaking changes for plugins.
Andrew: Well, even if it just required ph p eight we still wouldn't necessarily have had to update any plugins or custom modules or anything. It's only because they decided to add typing to the classes that Kraft offers. And they did that for a very valid reason I mean typed languages are just so much nicer I've actually had it happen that a couple of bugs that have been in some of my plugins for forever have surfaced because I've added typing and I'm like oh crap like this shouldn't be this shouldn't ever be a string like something is is definitely wrong here. But. It's because of that typing that they've added that is breaking things and they're doing this once and then that breaking change that kind of affects. Everything is not going to be there going forward so it probably will only be plugins that are like you know, let's say they do matrix in matrix or some other complicated thing. Probably will only be plugins that are really intimately tied with the inner workings of that that will require an update whereas most plugins from craft 4 to craft five probably you just have to change the the December in there you know, just change it to the the version of k craft that we work with in a way we go the the thought that I have.
Ben Croker: I Just wanted to mention um because you said you talked about the roadmap and having to kind of let features go I think it's also good to remember that the craft four roadmap doesn't necessarily mean these are all the features. We want to get in the four dot O like you know the stable The first stable release I think.
Ben Croker: My assumption is that they've prioritized the big features or the features that will break something or anything and therefore they've decided. Okay, let's prioritize those. Let's get those in the four dot o and maybe there are things that got left behind that they can do in the four point one four point two if you know if it makes the cut.
Andrew: Well currently their roadmap does explicitly say 4.0. So maybe that's something that they need to change in the roadmap I think it probably should be 4 point X for any pending features and I think they just ran out of time I think that. Developing something like this in a decent sized team is just a lot of work and they're juggling lots of stuff and I think they just plain run out run out of time The the.
Ben Croker: For sure and it's good to see though I Just want to say that they stuck to you know the promise timeline. So I I would prefer that they do that and just like let a few features go then just push out the timeline and push it out and push it out.
Andrew: Yes. I oh I'm in 100 % agreement you know like I said that's just the way software development works I've been doing it forever and if you have a hard and fast date that something needs to be out by there are always going to be features that end up on the cutting room floor like that's just just the way that it works. And it's just because software engineering is such a complicated thing a lot of times you don't know what you don't know you have to actually get in and try to solve the problem before you really have any idea of how long it's going to take to solve the problem. It's just it's kind of ah a catch 22 situation but the the issue that we're talking about in terms of. People wanting to take advantage of some new feature in the plugin and I don't know like people might be stuck on k craft three because they're using their own internal hosting system and their it department doesn't have phhpeight. So it's just a no go. They're just not gonna be able to update and. I think that it's something that would encourage people potentially to pay plug-in renewals if they see that they're continuing to get these updates that add value to them. You know this is a reason to continue to pay these renewals now since they're only annual renewals that. Probably is a little bit less of an argument because realistically there's going to be a major new version of K Craftft every year I'm just saying that people may lag behind and updating and my modus operandi even though I encourage everyone to always update to the latest version of everything is if I can add a little conditional in there I want to make that. Available to them now I'm in a situation that is a little bit different and it's of my own making it's my own little hell then but I've been working on a pro version of seomatic for quite some time and I'm in a situation where it's not ready to ship with ah craft four. So. Um, developing it for craft three and the plan is that I'm going to make that available for craft three as well. As for craft four and I think that's going to make sense because it's it's a major new version. Sorry it's a major new feature and it's an additional pay tier as well. And there may be a number of people that are using seomatic for craft three and they would love to take advantage of some of the features that are in there. But for whatever reason at the current time It's a no-go to force people to update to craft four in order to be able to use this thing so I'm sort of stuck in a situation where.
Andrew: Probably am going to be adding features to older plugins I obviously will also be adding specific things for craft four where they make sense I don't know I guess part of it is just like Pixel and Tonic we have to get used to this whole new release schedule and landscape and have it all shake out and see what it means you know.
Ben Croker: Right? I think I think the craft four updates for plugins are going to fall into 2 camps 1 is going to be like it's just a compatibility update. So so this plugin that you were using on craft three. You can now use on craft four and then I think some plugins. Are going to do a lot of refactoring an example of this might be craft commerce for example, craft commerce now you know they've pulled the addresses field out and that's going into craft core. There's a money field as well and unauthenticated I think it's. And authenticated users. They're calling them I don't know because that that term has changed so often and but whatever it was that customers were in commerce are now going to be core users in craft. So so there's a lot to overhaul there. Another example is K Craft campaign I'm sorry. Another example is the campaign plugin which is one of mine where I'm taking advantage of new features in craft four which have to do with custom element types being able to have their own drafts and revisions so you can have versions of your of your campaigns and not only that. Can apply the same logic to other element types like contacts where contacts can also now become users. So I think there will be plugins that just have you know a small amount of changes and it's mostly a compatibility update and then you'll have. Others that are you know a big refactoring for the purposes of taking advantage of what K Craft four has used in this case, it sounds like you'll release seomatic 4 which will be a compatability update but you're in the background I'd heard murmurings so you're working on a a new pro edition which will. Which is a big feature that will go into both which which makes sense. It's like ah like I was going to say I don't think the majority of people update plugins or pay update subscription fees for features I think most people pay them for the bug fixes and security updates. But every now and then something does come along. In this case, it sounds like it's a different addition so there might be an upgrade fee anyway, rather than ah yeah.
Andrew: And right well in general I think people pay for value and that value can be bug fixes that value can be new features that value can be support. It can be any number of things that would motivate people to to then pay for the updates to these things. So.
Ben Croker: Sure.
Andrew: I think that for people that are looking to convert plugins or modules over what I would generally recommend doing for just about anything is get it working first do what you were talking about get a compatibility version that it's the same thing that runs in craft three it now runs in k craft four and. You've got that out there people can then start doing what they're doing with it and then work on any craft force specific stuff that you want to add now I know that you're not doing this with campaign I understand you're you're taking a different route I'm just saying in general I think that's the best way to do things and it's the same with. Any kind of engineering. Let's say performance optimization. The first thing you do is get it working and then you can you can do some metrics and see you know where the bottlenecks are and then you optimize it know what I mean get it working and then make it work great for K Craft 4 in general if you're listening to this that is probably. Easiest route forward and it will keep your users waiting the least they'll be able to immediately adopt graph 4 and start playing around with it I understand you're taking a different route with campaign because it uses custom elements and it's very integrated and you're also very enthusiastic about. Checking out the new features and using them so with any rule there is an exception but in general I think that doing as little as possible to get it up and running and then going back and refactoring it or going back and then adding um, adding features that are specific to that craft version is probably the way to go and. That's what I'm doing for all of mine is I've got compatibility releases I'm adding typing in there in most places just to make it easier for me to catch bugs I've caught a number of bugs just by adding typing to various things and then I'm going to be building any craft for specific additions.
Ben Croker: Right? The only thing I would maybe add to that is if there's something that you know you need to break in terms of your own plugins Api then this is you know, according to semantic versioning. You should do that in a major update major version so that's the only thing that might.
Andrew: On top of that.
Ben Croker: You might want to consider as well. Do I plan on breaking something down the line. Let's break it now and when I say break I Just mean you know deprecate or remove something that very likely is not being used but as long as it's part of the public api. You should really only do that if possible in ah in a major version.
Andrew: I and I have found generally porting plugins to craft four to be pretty painless. It's not so bad I did a whole bunch of them by hand and with the aid of ph p storm that really was pretty easy to do. And I have been adopting rector now where I run rector to do the first pass through and then I go in and I tweak stuff or add my own types here and there where I want to and I found that workflow to be quite easy. The 1 thing that has taken a little bit of time I think I'm I've got 27 plugins and I think. 20 of them are ported and the ones that are left I've been what I did is I did all the paid plugins first and then I sorted the plugins by popularity like I want to have maximum impact and I just started going down the line. So the ones that are are left to do are the ones that only have a couple hundred installs and probably don't impact that many people. What has been taking more time than anything else is that I also have been modernizing some stuff as I go so I've got a documentation system that originally I was using vue and I was building the documentation locally and I went since switched over to use v press or sorry. I've got a documentation system that originally was using viewpress and I built the documentation locally and then I switched over to use vpress and have the documentation built via a github action. So in the process of updating my plugins I've also been. Redoing the documentation system for all of them modernizing some stylistic bits of the code that I just kind of want to be the same everywhere and converting it over to build the documentation via github actions and then plugging that into algolia doc search. So every plugin that I do is. The amount of time it actually takes to convert the code is trivial generally compared to the the infro that's around it but 1 of the things that I found is that if I try to make a lot of things the same everywhere when I go back to look at it in a year or six months whatever it's just as much easier to. Get back in there. So I'm willing to do the work now to update everything to do that? Um I did have 1 particular plugin that I wanted to mention that I think you might find kind of amusing I have a plugin called template comments which is a plugin that it's similar to what. Groupple allows you to do which is that it will put comments in your code that show you where the blocks of html come from so you can say okay, this block comes from the or this block of content comes from this block called content and it's being rendered by this template you know wherever it is.
Andrew: And especially when you're approaching a new project. It makes it so easy to figure out where stuff is coming from and it also has performance timings and stuff like that in there well craft four is using twig three and that plugin was completely broken because because of some of the stuff that they did so I I spent. Some time trying to refactor it and get it working I ended up getting it working and the fun part has been that I removed so much code because I looked at the way that I did it and I'm like yeah that worked but that doesn't work anymore. Twig doesn't allow you to do this anymore. There's no way that this can work. I'm like oh man I was going through I'm sure you've been there where you're late at night and I'm I'm going through the the twig code and node parsers and I'm like Nessa deep in this and ah and then I took a step back and I thought about it I'm like you know what? there's an easier better way to do this. So I deleted a whole shitload of stuff from the code and improved it. The way that it works now and it was wonderful. It was a great feeling and I wanted to tell people about it. But no one was gonna care. So yeah.
Ben Croker: Yeah,, that's the best though when you figure out a better way to do it. It means you can like delete a whole bunch of legacy code that was well I don't know if it was necessary or not for that version of twig. But. But now you know that you've modernized your code and it's working the way it should be.
Andrew: It? Yep and that plugin is ported and it's working on K Graph 4 and that was the one that took a decent amount of time because I had to refactor everything that I was doing in there and I had the feeling I was going to need to because a new major version of twig and the way that it integrates with it is a little bit specific. Basically the way that it works is that when ah, a block is rendered it if the template comments plugin is running and it only does this in dev mode and under a whole bunch of conditions. So it never will happen on production. What it does is it replaces the block renderer with my own.
Ben Croker: Are.
Andrew: Renderer Basically and so I can add the performance timings I can add the comments and do all that stuff back in front and I was writing my own twig template Loader So I could get the name of the template and say okay this template is here. And what I found out man is inside of the ah I think it was a inside of the twig node class or something like that you can just do this get template name and then you got the name of the template and so I'm like oh well I can just use that and I can delete the loader I can delete all this.
Ben Croker: Perfect.
Andrew: Crap that you know was causing problems and and away we go So I was pretty satisfied about that.
Ben Croker: Very cool interesting I haven't I know that yeah that the version of twig changed. But I haven't had any issues with plugins. So so that was pretty great I Think the only thing was that one of the namespaces changed or a couple of namespaces changed. But besides that.
Andrew: You Yeah, you won't but.
Ben Croker: And nothing else. 1 thing that I did notice. Um there was because we're because we're being required to use ph p eight or or higher well currently, it's 8 or 8 point one I did notice that there was a. Some php benchmarks were released on a site called http://kinsta.com and maybe we'll we'll share the link in the in the show notes but it actually did benchmarks across all sorts of php frameworks and content management systems. And they did one with Kra Cms 3.5 and the results were I don't know like I don't know how accurate this was because they tested the login page and the login page. So the admin login page of craft and that page is is quite unique because. As far as I know it has a random delay probably not in in terms of loading it. But in terms of submitting the form so I'm not sure if if that had an impact but um I can kind of read off the the results of this. Ah, it's it's better if you actually go look at it because it's you know it's better to see these visually of course.
Andrew: It does. Yeah, so.
Ben Croker: Ah, but they measure you know with benchmarks and performance they often are measured in requests per second so with with 7.2 sorry this is now ph p so they were benchmarking different php versions of course so ph p seven point 2 got 75 requests per second. And and this is only relevant relative to the other results right? This isn't you wouldn't compare this against wordpress and say oh one is faster than the other you just compare. You know each framework or or Cms with with the other php results for it for it. So 7.2 was 75 requests per second seven point three was about the same seven point four there was an increase in performance up to 81 requests per second and then in php 8.0 it jumps up to 417 and in 8.1 it jumps to 443 so just to just to reiterate that seven php. So seven point four was eighty one requests per second and Php eight point zero was four hundred and seventeen requests per second so that's a. More than a 5 x performance boost. So I would take these numbers with a grain of salt because you'd probably have to test multiple pages and in multiple environments to really get a good number. But but that's pretty impressive that just you know, updating the Php version can have.
Andrew: I yeah.
Ben Croker: Such a significant impact and I'm not saying it's going to be 5 x across the board. But if it's if it's two x I mean that's pretty amazing already.
Andrew: And this is not even using the jit so they did not enable the Justin Time compiler which is something that I yeah which is something that I've been enabling they say that in general it probably doesn't apply that much to.
Ben Croker: Oh really.
Andrew: Things like cms in terms of performance I've done a little bit of benchmarking nothing informal but it does seem to be better. So I'm like well what the hell I'll just turn it on and everything's been working great like in the the plugin Dev environment. It uses the Jit in there and ah I've been using that all over. So.
Ben Croker: Um.
Andrew: It works good. But yeah, that's that's wonderful that just updating to Ph P Eight will give you a performance increase most likely I have noticed I'm looking at the page now. Um their Chart does not match their benchmark results I don't know what's going on with that. See what I'm talking about.
Ben Croker: I have I have a screenshot of the results I'm not able to interact with it. So I can't really tell.
Andrew: All right? So I'm putting the the link in the chat and I'll obviously I'll cut this part out. Okay.
Ben Croker: But those results do seem too good to be true. Don't they.
Andrew: So if you go to the actual page. The chart says that it's a little ah above 200 requests per second for ph p seven point two and then you go down and you look at what they have down there. It has 75 requests per site which is weird like I don't.
Ben Croker: Yeah I'm here.
Ben Croker: Oh yeah, see what you're seeing.
Andrew: I don't know which is right? but the Chart does not match the results that they're listing either way.
Ben Croker: Also the the chart if you look at the caption of the chart. It's saying 3 point 7
Andrew: I yeah I don't I don't know what the deal is I don't know which is right? But either way, let's let's say that it is the chart is correct. It's still almost twice as fast in terms of the number of requests per second which you know if you've done any kind of performance optimization.
Ben Croker: Yeah.
Andrew: If you can get something that's a 2 x increase that is massive that is massive. Yeah, and usually you're struggling for you know, 10% 20% better but if you can get something that's just updating to that gives you that kind of boost I mean that's amazing.
Ben Croker: It's huge. Yeah.
Ben Croker: Yeah, ah sorry are we still recording? Yeah, so in addition to that of course and 1 of the things that k craft 4 introduces is performance improvements in the in the control panel.
Ben Croker: Especially when saving entries that have a significant amount of matrix blocks. So I think that was one of the one of the issues with later three point seven releases I'm sorry. I think that was an issue with and with k craft three since theyd since they introduced autosaving was that you get you know auto saving in the background and if there are all these matrix blocks and related fields then they have to be saved and duplicated in multiple places. So. And they've made some big shifts in craft three point four where matrix blocks and other block types actually can have multiple owners so so they don't need to go and deep copy or deep duplicate entries. They can just duplicate the entry itself and whatever blocks have changed. So. I think from what I've heard that is making a big big difference to people who have struggled with that in the control panel previously.
Andrew: So if if you have a lot of matrix fields and especially if you have a lot of sites that have these matrix fields on multiple sites. It was pretty horrendous like it would slow to a crawl because it would propagate these things every time something was saved.
Ben Croker: E.
Andrew: And it would really really Bog things down so that is a great performance improvement in craft four for people that are using matrix blocks with multiple sites or if they're using nested stuff like Neo supertable with matrix blocks. It's a massive improvement for people that have that kind of a setup for sure and.
Andrew: So one of the other things that I wanted to ask you about Ben is that you are someone that have done a decent amount of content creation in one form or another so you've created a number of blogs on security you've created a whole host of. Recipes for sprig and you've created all these things I wanted to talk to you about your your impetus and your approach to doing that kind of stuff because I also have created a bunch of content. We're creating content now right? We're doing ah a podcast recording stuff right? so.
Ben Croker: Absolutely.
Andrew: I'm a little bit behind man my last blog post was actually in December I think so I usually average about one a month and a combination of other work that I have picked up and also investigating stuff for craft 4 porting plugins all that kind of stuff. It's just shoot up my time and I'm making a conscious effort to get back into it I've got this mythical article on matrix facades that in theory was going to be published. You know at the end of December still not out, but. Um, planning on getting that done. What is your approach to content creation. What have and what have you found to be the benefits of doing that because it's something that whenever you publish something I think lots of people benefit from it whereas if you just learn something and you keep it to yourself. Well, it's it's kind of just you.
Ben Croker: Right? Well, there's so many different forms of content creation like you said this is one So so even though you said you're behind on your articles. You're still doing these um standups and Dev mode fm podcasts and ah the the live stream.
Andrew: You The craft Quest live streams. Yeah.
Ben Croker: Yeah, so so you're still putting lots of content down out there including tweets and and whatever you're doing on social media. Um I mean my take is exactly what you said you know if I'm learning this because as developers we're constantly learning. And there's no way around that there's no way around. You know we're basically problem solvers and the only way to to solve a problem that you have no idea about is to do a deep dive and learn about this thing or learn as much as you need to and. In my experience. One of the best ways to learn about it is you know you take notes and at the end of it. You have all these notes that you can keep or you can go through the process of sorting those and and processing what you've learned by kind of explaining it as if you would kind of be explaining it to somebody else and. That's a lot of work because it is a lot of work to take what you've learned and you know write it up in a format that other people can then learn from that I think it is very beneficial I mean I'm sure you've done this I've done this tons of times where um.
Ben Croker: I'm working on something and I'm like oh I did write an article on that and I go back and reference my own article. So that's always a good sign for me that you know I put something useful out there. Um.
Andrew: Oh absolutely I go back and I'm trying to do something I'm like I know I did that and I go back and I look at it I'm like oh okay, that's how I did it all right? cool.
Ben Croker: Right? right? So in one sense. It's a form of notekeeping to to your future self and to future other people. But I do find that the process of turning that knowledge into material that other people can also benefit From. Has the added benefit of you kind of reprocess it yourself and then you can come back to it at a later time and I I would love to be more self-disciplined about it. But I know that I'm just not and if I force myself to sit down at the at the keyboard and start you know, typing words then.
Andrew: For sure.
Ben Croker: Just Garbage is going to come out So I do it when when I feel like I have the time and I want to share something or I feel like you know I've just learned this thing and the best way of solidifying that learning would be to put it down in in words and that's when I decide to. Release this if I think it would be relevant to other people.
Andrew: That's when it works best for me is if I'm still all hot and bothered about this cool thing that I did or this problem that I solved if I sit down to write it then I'm still energized about it I'm still pumped I want everyone to know about it if for whatever reason I let it rest and a couple of months pass I'm less motivated to do it because it's just you know I'm onto the the new thing and I just you know it's just not the same so I try to strike while the yeah yeah I try to strike when the iron's hot. Yeah, exactly exactly and i.
Ben Croker: Yeah, the the the timing is while the iron's hot. Yeah, the timing is key and if you get the timing right? then it it almost writes itself right? It still needs to be proofd and edited but you know it just kind of comes out in 1
Andrew: It does? yep.
Ben Croker: Kind of in one Swift load and.
Andrew: You you were gonna say something bad I know you were ah I could tell by the look on your face. You had some kind of metaphor there. It's probably not pg 13 all right? Ah oh it's getting worse. It's getting worse. It's getting worse.
Ben Croker: And then you clean it up and then then you put it out there.
Andrew: But you mentioned something earlier that I think is really is really key and is really interesting. Is you mentioned that we're all constantly learning and your job fundamentally is problem solving and I've had people that I've talked to that they they feel. Down on themselves because they're you know I'm doing the saying and I feel a little lost I don't know what I'm doing literally your job description as a problem Solver is not knowing what you're doing that is your job if it if you knew what you were doing. It wouldn't be a problem. You would just sit down and you would bang it out and you do it. So I think it's Important. So I think it's important for people to understand not knowing what you're doing is your job description as a developer because you have been given a task. You're not really sure how to do it. You may feel lost but that's what you're supposed to be doing So Don't feel bad about that. That's something that. Every single developer No matter how skilled or experienced unless they're doing the same thing repetitively over and over that's something that everybody feels right.
Ben Croker: Absolutely yeah and the the major skill here is learning how to figure out the problem like learning had to figure out what the problem is first of all and then how to go about not not necessarily solving it. But you know figuring it out and then it then it kind of the solving it.
Ben Croker: Is is just something that that happens um happens as you've got caught up in my words.
Andrew: It happens as you break the problem down and you figure out what the the aspects of the problem are and you start solving these little problems and it reminds me of there's someone who is an an exercise guy on Youtube or whatever and and someone asked him. You know what's the what's the most important thing. Do if I'm thinking about starting an exercise program and he said start that is the most important thing it doesn't matter whether you know everything that you're doing it doesn't matter that you're doing everything perfectly. What matters the most is that you start and I think it's the same with problem solving. Developing is start doing it by the virtue of starting that process you'll begin to uncover it and most of the time it ends up being that the problem is not nearly as bad as you've made it out into your mind. You just have to start with.
Ben Croker: Yeah I agree.
Andrew: Well I'm I'm going to try my best to get this matrix facade article out I've got that I've got an article on documentation with V press that I've been wanting to get out for forever and I've got a whole. Number of other things that I want to start making time for what happened is exactly what I described where I solved the problem I started the article I was all hot and bothered by it but I had a bunch of other stuff going on and so I put that aside and the fire. Just. Dwindle a little bit I Still think they're They're really useful and it's something that people might really be interested in but it's it's just not quite the Same. You know what I mean.
Ben Croker: Totally do yeah and I've seen the matrix for sad stuff. So I think it is really interesting but I get it like if the fire is not there then it's.
Andrew: So it's it'll get there if I start it again if I sit down and I start to write it again. It'll rekindle. it's okay It's not it's not out there's still a little ember burning there Ben it's not a big deal. We'll we'll get that fire going again. You know.
Ben Croker: I have these articles that I put out. Um, so and what was it called securing your craft site in 2021 now. Obviously we're not in 2021 and this was supposed to be a 4 part series I wrote parts one and 2 both in January Twenty Twenty one and 3 and 4 just never came so I'm I'm thinking of just you know, starting over.
Andrew: So you're you're like that R Martin guy the game of thrones author that has kept everyone waiting for the the final couple of books in the series for like a decade or 2 right.
Ben Croker: I Don't know if anyone's waiting for this but I know about it I know that they're missing.
Andrew: Yeah, well, it's something that once people see it. They probably will be really appreciative so you know maybe you and I.
Ben Croker: I did actually have somebody recently say hey when's the next part coming out. That's why that's why it's fresh on my mind actually but but like you said well security is like this never ending learning topic right? It's like this huge field and.
Andrew: Ah, maybe you and I could motivate each other got.
Ben Croker: Had a ah long phase last year where I was very interested in not just security but also privacy and privacy I'm still very so interested in but um, just different things have come up and my mind is completely somewhere else now I'm like so deep in code and refactoring at the moment that. I Don't think I could do a deep dive on security right Now. So the time will come but I'll have to I'll just I'll just have to rename the the title of that article.
Andrew: I blame hyperscript for. Well maybe you and I could do a little motivational thing. You know, maybe we could have a little wager on who gets the the next article out first.
Ben Croker: Um, if it's if it's article regardless of what it it's about yeah we could do that I mean I don't know.
Andrew: I Don't you dare put out a little article that just details your your current trip or your flight over the alps like it's got to be something substantive because the mine are gonna be you know.
Ben Croker: I Just don't know if I can compete with you. You're constantly putting stuff out there.
Andrew: It it hasn't been since December that I put an article out. You're catching me at a weak moment. What do you think want to do a wazr your next security article versus my matrix facade article whoever gets it out first.
Ben Croker: I think I've learned my lesson I have learned my lesson with with taking wagers with you. You know exactly what I'm talking about.
Andrew: Ah, what are you talking about I don't I don't know what you're talking about but ah. I I recently won a little weezer with Brandon Kelly too I got to collect on that one but that about wraps it up for another episode of the demo fm podcast if you enjoy the show make sure to subscribe tell a friend drop us a review. We'd really appreciate it. Or the demo fm podcast I'm Andrew Welch
Ben Croker: I'm Ben Kroger
Andrew: So so basically Brendan messaged me and he said you know are you going to watch that Apple event tomorrow and he he said some offhand comment about how it was going to make my current machine obsolete so he was kind of like jabbing at me or whatever and my son. For whatever reason is really into following Apple rumors and all this kind of stuff and Brandon was thinking that they're going to introduce a new mac pro and I asked my son about it and he said no yeah, all the rumors say it's not going to happen. So I put a little wager with Brandon about whether it was going to happen so we're watching the event and it was quite a sweat. Because they introduced this new chip where it really looked like the the ultra whatever it looked like this was going to be for the new mac pro and then it ended up being in the studio and then at the end, the guy was like and the 1 thing we didn't talk about was mac pro and like out here. It is great I'm gonna have to ship Brandon some money. And they said but that's a topic for another date and I'm like yes I I feel like I should have to cut my son in on this or something anyway.