WP Café #135 | Efficient Asset Loading ![rw-book-cover](https://img.youtube.com/vi/NkfDAyoW5B8/maxresdefault.jpg) Hello and welcome to episode number 135 of WP Cafe, the show where we share the real unfiltered experience of running a WordPress business. I'm Keith Devon and as always I'm joined by my co-host Mark Wilkinson. We're both from High-Rise Digital, which is a tiny agency building WordPress websites and products. Today we're going to be talking about a number of things. I guess mostly about efficient asset loading in our WordPress websites that we build. Uh so grab a brew, settle in as we explore what it's really like behind the scenes. You can follow us over on X, formerly Twitter at WP Cafe Show, and find us on Blue Sky and the web at wpcafe.show. If you enjoy the episode, hit subscribe and like, leave us a comment, and share it with someone who might find it useful. And we'd love to hear your thoughts. So, if you're watching along live on YouTube, please do join the conversation and let us know what you think. So, on to the show. But before we get stuck into the topics, let's catch up with Mark. Mark, how have you been this week? What's been going on? >> Uh, not so bad. I'm not uh feeling 100% I must admit like the rest of the UK. I think everyone seems to be a bit uh down under the weather, don't they? So, um if I disappear, it's probably because I'm about to sneeze my head off. Um but I will be back. But when I finish doing that, so put your head back on. >> Yeah. >> So, uh, but yeah, other than that, um, doing all right. Just plotting along. Uh, yeah. Got a few things to chat through today, so it's good. What about you? >> Yeah. Uh, similar. Took a couple of days off at the start of this week. Um, with a bit of a a nasty cold. They hit me really hard and then disappeared really quickly, which is unusual for me because usually usually once I get a cold, I'm like I'm in it for quite a while. I'm still a little bit kind of blocked up, but I feel so much better. Um, ginger and cinnamon is what I was taking. And I don't know. I don't know. It's uh it's a sample of one, but uh I I heard I I saw some stupid thing on the internet about like traditional remedies for colds and the guy was all about about it. So, I was like, well, I've got I've got ginger and cinnamon in the house, so I'll give it a go. Few cups of that was right. Um but >> put it in boiling water, you know. >> Yeah. Yeah. Yeah. Yeah. Yeah. I just chopped up a bunch of ginger, sprinkled in some ground cinnamon with >> honey. >> Yeah. >> Yeah. >> Yeah. >> And uh Yeah. It was reasonably tasty. It's quite fiery and apparently apparently that's what works, but you know, it gets the blood flowing and blah blah blah. Anyway, it's probably absolute nonsense, but >> um but now my daughter's really sick and I've I've got a horrible feeling that a hospital visit is imminent cuz she's got a very high temperature and I know what the GP is going to say. They're just going to send us all off to hospital with the rest of the country. Like you said, like everyone's everyone's sick at the minute. So, it could be in for a pretty grim 24 hours, but >> uh let's enjoy the last of it before that happens. All right. So, yeah, let's get on with uh let's get on with the show. Um, so yeah, a few things to chat about there. Um, the first one is all about basically efficiently loading CSS and JavaScript in our WordPress sites. And it came about I'll do the intro mark because I reckon you're going to be talking through the technicalities because it's mostly been your work so far. Um but it came about because of a performance kind of audit uh that we're doing for a client of ours and one of the you know we're just running it through Google page speed. One of the main insights was that the theme CSS file was quite large and it was it's kind of grown over time. Um, and it's reasonably big. And we have previously and since this project uh been much clever about how we kind of load our CSS. I don't know how why this project kind of we haven't we weren't doing those things. Um, but what we what we thought is that we should probably be loading block styles uh like block CSS specifically uh only when those blocks are on the page if possible. and we we know it is possible. Um so you set about to figure out um how to look for those assets in a particular place in the theme if the block was on the page over to you. What challenges did you face? What solutions did you come up with? >> I'm just checking out the right branch so I can see my code at the same time as >> Yeah, good idea. And it magically appears in my file. There we go. Um, so I've done this before actually, so it's just a matter of like revisiting it. And I've actually approached it in a few different ways. The very first way I approached it was to get all of the blocks on the website. So you can do that. I think there's like a block registry class thing and you can get all of the registered blocks and then you kind of loop through each of those. You check whether you've got a file present and if you have, you kind of incue it. But that that's kind of inefficient. So I thought we may as well do it the other way around in that if we have a block file block file present then loop through those and then work out what the block is that you need to sort of add the block style. So that's the approach I've gone for. So essentially we get um we're just using the PHP glob function which basically looks at a directory of the files. So, I'm looking at in this directory. I think it's assets. This is in the theme. It's assets blocks essentially. Um, and it looks for any files in there that are ending in CSS. And then we loop through each of those files. We build a path because you need the path. Come to that in a minute. We build a file name. And then we from the file name, we build the block name because obviously the file name is going to be like core- paragraph whereas the blocks called core slash paragraph. bit annoying, but that's what you have to do. Um, and then for each of those, we then use the core WordPress function WP NQB block style, >> which kind of does what it says on the tin. It it registers your CSS file with WordPress and it encues it when that block is detected in a page load. So, you'll only ever get that loaded if you have that block on the page, which seems much more efficient. you know, if we've got some specific styles for a media and text block, but that's not on the current page, it seems silly to load the CSS for that when we don't need it. So, this is trying to attack this so that only the CSS you want is loaded. And that should help because our CSS files quite large. So, we can split that into smaller files and only load those when they're needed. It makes sense. The other thing that the WPMPQ block style does and this is why you need the path of your stylesheet. Uh it's like the path on the server is because it will try and inline those styles if it judges that they are suitable for being inlined. >> Um I haven't actually looked into what the criteria is that. I think part of it is how how much CSS there is in your file. So if you've only got a few rules, it's probably just going to inline them straight away, which is again a little bit more efficient. So uh that works. So basically once that has that function has been running and I've just added that into the theme, um it's hooked into the ad, uh the in it hook and it will it will try and cue styles for each block uh if they're present. So now all Keith has to do is put the files in the folder and they'll just automatically get incued because they because of their presence essentially when those blocks from the page. >> So the next task after that is to go and look at the theme stylesheet which is all one and then try and split that into the different block stylesheets and try and then >> split those out. We'll still have a theme stylesheet because not everything's rel, you know, relative to a block. But, um, that's that's the plan. So, I don't know how you're going to do that obviously because you're using SAS. SAS, is that right? >> Yeah. Yeah. CSS. Yeah. Yeah. >> So, to try and compile those into the right place. I'm not sure. But that's the next task. Um, that is the next task. We So, Mark, we did something similar uh on the Kimolton school. I don't want to put you on the spot having to remember exactly what code you wrote for that. >> Yep. >> Uh I wasn't compiling my CSS. I was just writing CSS files on that particular project. I just thought I'd try that as an approach. So So my side of things was in a way much simpler. >> Is is your new approach different to what we did for Kim Bolton? >> And if so, how and kind of is it better? >> Uh no, it's extremely similar. The only thing that I have changed, and this is because you don't need it with the original site where we did this, uh, I'm doing the same approach, looping through each of the files that we've got. >> Yeah. And what I was doing is registering a style and then encuing the block style which actually you don't need to do because the WPNQ block style function handles the registration and the NQing very much like the WPNQ style function does. >> If it hasn't been registered, it will register it. If it is registered and it it won't register it. >> So that's the only change here just to make it a little bit more efficient. Um, but it's essentially very similar. >> And are we doing the same thing with our JavaScript? >> Good. I'm glad you asked. So, um, we're not, but we probably could be. I've been experimenting with that, uh, this week. >> Yeah. What what was a key thing for me was I you can load JavaScript for any block on the front end quite straightforward. So we've we've done this for this particular project. So we have >> um I'll take an example. We have a a gallery block and we turn that into a slider when they want like a logo slider. So what we essentially do is we create a block style that's called logo slider I think it's called and when they apply that block style the JavaScript that we've got will obviously then hook into the CSS class that's added and turn it into a slider. So you want to incue your JavaScript when the gallery block is loaded. >> Yes. So you can do that uh using the filter called block type metadata which essentially filters the block JSON file for the blocks in question >> and you can add your script uh into that. It's called view script. View means like viewing is on the front end. It's basically load this script when we're viewing this on the front end. So you'd register a script as you normally would and then you'd filter this and pass the handle of the script to this to this block JSON or this block meta filter. and then your JavaScript will get loaded when the block's on the front end. >> Okay, >> now that's great and it works for any block as long as it has a block JSON file because that's what you're filtering. So if you've got a very old ACF block that was using like ACF register block type, it didn't work for that. So we and we've got a few blocks like that. So we need to update them slightly. >> Um but they have other functions that you can use to to encue assets as well. So you can still do this, it's just a different method. Um, the one thing it doesn't do, which is what I really wanted to try and solve, is that I only want to encue that um, logo slider JavaScript file that you've written when that block style is selected. I don't want to incue it. If they just had a gallery, a normal gallery, there's no point. It's a waste. They don't need it. >> Yeah. So, that's what we have been doing currently. So we we've got scripts for example that get loaded on every paragraph block because there's a certain paragraph style that >> correct >> does like a little counter. Yeah, >> correct that does a little counter. So every every paragraph has that which essentially means it runs on every page because pretty much every page has a paragraph. So I went about trying to solve that issue of how do we how do we only incue uh block assets sorry block uh JavaScript when the block is actually being viewed. And I'm actually just going to load up the post I wrote. Uh, hang on. So I can actually get the code in front of me. Um, and then we can see. So I I asked used a bit of um AI as we do and uh got some help from from Bob. But essentially what I wanted to do is to say if this block has this block style then I want to somehow incue our JavaScript. So we'll use the logo slider as an example. So and the way in which I'm doing that is you you can't you can't do that with filtering the block metadata because at that point in time the instance of the block hasn't loaded. You're just sort of saying this is the data for all blocks if you know what I mean. >> Yeah. >> Not the actual instance that's on your page. >> Yeah. >> So the the only method that I found to do it with you have to do that using the render block filter which if you didn't know the render block filter allows you to change the block HTML and it also allows you to to obviously run your own code at the same time. >> Yeah. So there is also render block filters for each individual block. So render\_block underscore and then the block name will only run your code on that particular block. So in the gallery one we do render block core slash gallery and then we'd run our code. And what we're doing with in the code that I've got is it's looking for a class name called is style whatever your style is. Ours is logo slider. If that class is not present, then we just return the normal block content as it was. We don't want to touch it. We just finish there. That's it. If that is the case, then what we can do is run the WPNQ script function, which will encue our logo slider JavaScript. Um, and then just return the block content as it was. We don't we don't want to touch the block content. We're not really interested in that. We just want to do something at the point the block loads. >> Yeah. >> And that works really well. um the the and it the the script gets encued only when your style is run. >> Haven't tested it on the actual site yet. I've been running it on a local little test environment, just a simple test WordPress. >> Um but I've added multiple blocks of different styles and it all seems to only load when you you've obviously got your style selected. >> Yeah. >> Which is great. So we just need to do a bit more testing. But yeah, it's good. >> Very cool. Um, few comments I think we should go through now while we're fresh on the topic. First of all, a little wave uh from Mark. Uh, Mark, >> nice to have you. Nice to have you here, Mark. Um, Courtney uh says, "I always registered CSS and JS with each ACF block in brackets JSON. However, this created too many HTTP requests and caused its own issue. Um, do you use asset bundling?" have to say I don't know what asset bundling is. >> I don't know. No. >> Um but yeah, so obviously this will create more HTTP requests. Um if we're breaking up stylesheets and JavaScript files into you know smaller smaller chunks um that was that HTTP2 can handle that >> and I'll bring in Mark uh for for for that. So Mark then comments if the site is loaded over HTTP2 then it's more efficient to load separate files than one merged file. If the path attribute is passed the WP and Q block style then the CSS is inlined which makes the issue of separate asset loading moot. Okay. So that is what I kind of thought as well. I mean, does it get to a point where even with HTTP2, you know, like you can have too many requests? I I don't know because presumably it can only kind of handle a certain number at a time. Um >> I don't I don't know. My my understanding with HTTP one or whatever it was it 1.1 can't remember. >> Was that the browser can only handle one request at a time? So, it requests the JavaScript file. It waits for the server to respond. the server responds with a JavaScript file and it requests the next one and so on. Whereas with HTTP2, I understand was it it can like open a connection and then it can say like give me this one, this one, this one, this one, this one, this one and then it can just send them to you. >> Yeah, you can see that in the network tab on most websites now. So if if you open the network tab and you can see that kind of waterfall view, >> they'll quite often just be like it gets to the kind of right, I need to load my CSS or JavaScript files now and they're all just stacked exactly vertically like >> they happen at the same time in instead of like one after another. So instead of like the step effect that you used to get, it's just a single kind of line. It's just like bang, they're all done in in in one go. Um Elliot then says, hi Elliot. He says, "Agree. SAS compilers aren't great for blocks work as they need to only load if the block is loaded on the page." So, yeah, not compiling all of your I guess he's saying agreeing that not compiling all of our block CSS into one uh into one file is is the right is the right thing to do. Uh and he says, "Just so happens I created a PHP class for extending block assets for CSS and JS in my GitHub." Go. Uh I think we've kind of biged up Elliot before, but he puts out a lot of really great uh WordPress developer content. So please do go and check out his stuff uh including his GitHub and his YouTube channel. Um and then one more from Elliot Hook WP and Qcript 2 and QB block assets should work. You might have to help me with that one. Mark Hook, I'm not quite sure what he means there. So, uh, NQ block assets is a hook that will run on both the front end and the back end. >> Mhm. >> So, if you want if you want your JavaScript to load in the editor as well as in on the front end, then you'd want to use ENQ block assets >> rather than something like render block. I would imagine that's what he's meaning. >> Most of the time with these things, we don't want to load these in the in the editor because it actually makes editing JavaScript. >> Yeah, we don't load the JavaScript because actually if you turn it into a slider in the back end, >> how do you click on an image to then start replacing it and stuff like that? >> It depends what you're doing. I think the time, but I find most of the time you probably don't want to load the JavaScript in the back end, but that is very specific to what you're doing. Yeah, that's exactly what Courtney's asking here. She she said, uh, how do you render sliders in the admin? Do you write admin CSS to just show one slide for example the way we've done it so uh there's lots of different ways uh it depends on the slider um you know we we've built kind of custom blocks with uh that are sliders and in that case we're often just using ACF to build the block and then just using like a repeater field so there is really no what you see is what you get kind of experience um or we're using a current block like the gallery block for example. And in the back end in the editor, we just leave it as a gallery so that the client, the user, the editor can see all of the images uh and just click on them and change them and and move them around like they would with a normal gallery just knowing that on the front end it's not going to look like that. that that's the compromise that we've found because I think having a proper slider interface and having to kind of as a gallery would be >> could be pretty horrible as a as a user interface. >> This is where the block editor often conflicts with this what you see is what you get. Like sometimes it just isn't easier to to handle what you see is what you get in the back end. Like you it doesn't make sense. Like with this slider, it'd be so difficult to sort of like change images because often would be off the screen cuz they're on a slider. >> Yeah. Yeah. >> So you'd have to slide everything across and then it just doesn't really make sense. >> And actually despite some of its limitations which are obviously changing that's one of the reasons I actually really like building blocks with ACF because you're getting a very kind of datacentric editing editor view. >> Uh and then you can you could switch across to the like the preview mode which will show what it looks like. >> Yeah. And you've got this edit mode which is a better sometimes editing experience. Um >> it is now with the new ACF. >> Certain yeah certainly like coming on leaps and bounds at the minute. So >> two two of the new features of ACF 6.7 are inline editing. So you can just edit things by clicking on them kind of like you're doing a block editor. I think that only works for a limited number of blocks at the moment ACF blocks. Um, and then the other one is that you have this new sort of like panel that can come out on the right hand side rather than fill in the block sidebar. So have a look at those things. They're quite nice as well. >> Yeah, it's interesting. So Elliot says here, take the interactivity API. It's only available in the front end. So there is no uh Wizzywig with the interactivity API. So I wonder I haven't really played with interactivity API so I don't know kind of what that what that then looks like in the editor. I don't really even know how to kind of how to use it yet. But that that is interesting. That's something bit of bit of a potential limitation there. But I'm sure that's something that they'll look at in the future. Um >> yeah true. >> But yeah so so kind of fun stuff. So, I've I've not now got to rewrite my npm scripts to uh to save my instead of compiling all my CSS into one uh theme file, I need to get them all saving in the right places. So, that's that's my little challenge. I don't think that's going to be too difficult. Um but hopefully I'll have that ready to talk about maybe for next week or early in the new year. >> Um >> we we also don't minify it yet, do we? As well, which we could do. The saving on that wasn't particularly massive though, was it? >> We should. >> We should. We should do it. It wasn't groundbreakingly. Oh my god, that's harvest time. It was a tiny amount. But >> makes sense. >> You're automating it anyway with with SAS. Makes sense. Just squash it all. >> Yeah. Yeah. Yeah. Same same with JavaScript. So, yeah, probably probably look at that as well. Um, there's one more kind of technical one that I just want to cover. Just an interesting issue that we came across today uh which is one of our job relay customers um and a and a rack press customer actually. So we built their job board uh hooked it up to Bullhorn for them and I got an email this morning saying one of our one of our jobs is 403ing and I was like that's kind of weird and writing off that one 403ed and all the other jobs didn't. Um and I had a The thing that just jumped out at me almost as soon as I saw it was that the the job that had the issue, the 403 um had an uml in the uh title of the job. Uh and it was making the URL look very very strange. Um so we we've kind of dug into that a little bit this morning. How have we actually kind of found the solution or figured it out or or do you are we still a bit confused? I haven't tested it yet. >> Yeah. >> But I'll explain what happens. So >> yeah, >> when a job gets delivered from or gets delivered to the website, wherever it's coming from, whether it's Bullhorn or Broadbean or Logic Melon or whatever it is, um we simply use the WP insert post function to sort of create the post in WordPress, the job post. And obviously we pass the uh the job title into there when you create the post. And WordPress automatically generates the post name if you don't specify it. And it'll generate it by taking the title and essentially separating it with dashes um and doing a few other checks and things. One of those checks that WordPress does is to check for I'm just going to call them weird characters. I'm I'm sure that uh Germans and French don't call them weird, but apologies for that. >> Special characters. >> Special characters. Are they special? They're not special to those anyway. >> Non-standard >> English characters. I don't know what to call them, but you >> There is an official word for this, but we haven't got it. So, >> yeah. And what it does is it it strips those out. So, for example, in this particular case, it was the letter A with an over, which if you don't know, it's got two little dots over the top of it. Um, and it just strips out for a normal A and then saves the the post name. Um, but then in in my code, what we do next is we actually update the post name once the post has been created with appending the post ID. So I can't do it when the post is created because at that point I don't know the ID. So I append the post ID at the end of it in an update. And the reason we do that is so every job has a unique URL because lots of recruiters they recruit the same sort of jobs. So they end up posting a job and it's like marketing-manager-london and then that job gets deleted and another one comes in and it has the same URL as the original and it just confuses ATS systems. It confuses lots of things. >> Yeah. >> So long short long story short is we put the post ID on the end so they're always unique. And when I'm doing that update, so say WP update post and I'm changing the post name, I needed to sanitize the title. So, I used sanitize title with dashes, which it kind of does what it says on the tin. It puts dashes in the title that that was given. >> However, it would appear that that does not convert the accents or special characters or whatever we're calling them. It doesn't do that. It doesn't do that at all. So, then it left that in the URL and then when you view it, again, I'm not entirely sure why it 403s. Is that a server thing? Is that a I don't know, but it's 403s and it it's clearly the problem because you replace it and it doesn't. However, what I've since worked out I think today is that you should use sanitize title and the reason for that is because sanitize title I believe calls sanitize title with dashes and it calls the function called remove accents which is does this little replacement between the special characters to normal ones. So, I need to update our plugin to swap that sort of sanitization function out. And I think, as I said, I haven't tested it, but once I do that, it will actually solve this problem. >> Yeah, we'll see. >> It's a weird one. I can't believe we haven't come across it before. >> Yeah, that's what I was I was amazed that this hasn't been a problem before. So, >> and you're thinking maybe that is because there's some kind of like server level configuration or even something within WordPress that's kind of >> like a security plugin or something that isn't isn't loving the the character but >> yeah basically trying to again I'm completely making this up as a guess but if the server is seeing that in the URL is it sort of some firewall saying that looks a bit weird I'm just going to block it 403 access denied unauthorized whatever I don't know. Yeah. >> Yeah. So Marcus said make sure that the saved value part of the post name has been run through sanitized title. That will convert characters. >> Exactly. >> And most browsers understand special characters, but if they're not converted properly, eg UTF8, uh then that may well cause a problem. So yeah, that's I think that's what we've been uh experiencing. So yeah, hopefully we'll get a fix out for that. But >> essentially, it's me using the wrong function. >> But like >> my brain thought sanitiz title with dashes was the right function because that's literally what I want to do. I want to take the tile and put the dashes in the right place. So it's not you know what I mean? But apparently no. You should use sanitize title. >> You learn something every day. >> Yeah. Yeah. Yeah. Yeah. It's that was interesting. But yeah, hopefully a little fix there, a little improvement to the product. So that's good. Um, last thing on the list and I don't think well well maybe we will won't take too long on this I don't think um is sale pricing and discounts. So sale Why did why did you put this one on the list? What was uh >> well I think I was watching >> I was watching WP Builds earlier this week and they were sort of chatting about Black Friday deals and things like that. >> Yeah. >> Um and then we had a customer actually which has kind of brought it up again. So I we had a customer earlier this week and they were I'd sent them everything that they need to buy the product. They decided to buy the product and then um interestingly on the call they'd already said oh I spoke to you three years ago and then it was like your product was 35 quid and you know now it's 49 quid. So immediately I'm thinking you know they're thinking about discounted prices and and I just said well you know the world's moved on since then the price is what it is now sort of thing. And then the customer uh I sent them everything they need to buy it. They said, "Yeah, yeah, I'm going to go ahead and buy it now." And then they sent an email about like two minutes later says, "Oh, I can see there's a discount code box on your checkout page, you know, is there a Christmas discount that I can use?" You know, you know, all feeling of goodwill and stuff. So, I was just thinking and it got me thinking about Black Friday prices as well, you know, like why offer a Black Friday deal? I don't quite understand it because why are you offering this sale? Because if people want the product, then surely they will they will pay for it. And if >> if you're not selling them unless you offer a discount, then isn't your pricing just wrong? As in make the price the Black Friday discount rather than having to run these sales and discount codes. I don't understand it. >> Yeah. >> But then we we were talking earlier, weren't we about businesses have different models, don't they? How they sell things. You know, if you think about um you know, sofa companies in this this country, they constantly have offers on. Like you you you'd never buy a full price sofa in this country because they've literally like >> they always got a sale on. So >> do do a lot of businesses run >> which is technically illegal by the way. >> I'm pretty sure >> I'm I'm sure they're not being illegal because they'll be pricing them at the right price for certain periods just long enough and so on. >> Yeah. Yeah. Exactly. Yeah. So is is the customer and I'm taking this customer in particular for us are they seeing like oh it's it's £419 a year is job really yeah but we're not going to pay that way because there's always going to be some sort of like discount that they're going to give us on the call you know and that sort of thing and a lot lot has that you know is that the best price you can do and everything like that and I'm like yeah because that that's how much it costs whereas I think other custo other companies might be yeah but if you buy it today we can give you a discount code for 20% off and and and so on. So, is the customer that was asking us in the mindset that if they pay £419, then they're they're losing out like why are they paying that much when there's a discount code box on the checkout and everyone else will be putting a discount code in there and I'm not. >> So, it's an interesting >> I just think it's a really interesting like mindset. My my my thought process is that we shouldn't offer discounts. We shouldn't offer discounts for for the product and because we value well we we price the product at what we think is a value to the customer and they either think that's valuable or not. Now if we experience that and like you know 75% of the customers book calls they love the product and then they I'm not buying it because the product is the price is too expensive then we'd have to think about whether it's the right price. >> But I don't think that's the case with our product. I think the price is the right price. So why would we want to offer discounts? I don't quite understand why that would be the right thing to do. >> And it's so I think our product is so niche as well that we don't have a lot of kind of direct competition. There isn't we we actually do have some competition in in our in our space for job relay, but it's not like it's not like buying a a hi-fi or like a TV and you're and you're like you could buy the same Panasonic TV from a million different places and you're going to search through all through them all to find the one that's giving you the the best deal. >> Like >> yeah, I I I've got kind of different experiences, I guess, with sales and discounts. So, for example, I just bought a soundbar for my home, my my TV in my living room. >> Uh, and I've I've waited for nearly two years actually for a Black Friday sale because I forgot to buy it last year. Um, so like Black Friday came along and I was like, right, I I'm actually going to like troll about and see if I can find a good sound bar for a good price. And I did and I bought it. So having a Black Friday sale at this point in time meant I bought that particular thing. So but >> but if they never had a Black Friday sale, would you have waited two years to get a Black Friday deal or would you have decided I'm going to buy? >> No, cuz I Well, I didn't have a specific model in mind until now. So, I just I just knew that like electronic equipment is is sold on Black Friday. It's nearly always discounted around this time of year, but like do people think of think like that with WordPress products and plugins and web SAS stuff >> as wait for Black Friday. >> Yeah. So, there's the Black Friday thing. I think Katie Keith has loads of like thoughts on this. She's run like experiments and put stuff out into the world. to maybe like try to track down some of her content on whether Black Friday works or not. I think it's been a bit hit and miss. I think they sell a lot because it's discounted. It's not quite right. I don't know. >> It'll it'll work. I mean, why won't it work? Like, you're probably going to sell products around Black Friday if you've got a Black Friday discount. Like, it's not rocket science, is it? People are going to anyone who was in two minds and like they jump on, oh, they've got a black, oh right, okay, I'll buy it now. So, I don't I don't quite understand like that will work, but you're selling it for less than you thought it was worth. >> Yeah. >> And and if if the cases, well, actually, Hang on, most customers aren't buying it. They're just waiting until Black Friday. Why not just make the Black Friday price the price? >> And then you'll sell them all year. >> Yeah. Yeah. >> Because that's the price we want to pay for it. >> I really don't I really don't know. Yeah. One company that I think jumps into mind is is Apple. Like they don't do sales. >> Yeah. >> They just don't do sales. So no one feels they're missing out because they never do sales. So the price you see on the website is the price I pay, you pay, everyone pays. >> Yeah, that's true. >> There's no feeling of missing out or anything. The only thing they do is like the student thing, don't they? Get like a AirPods if you buy something for students. >> But that's it. That's that's >> all. Yeah. Yeah. Yeah. We we have priced our MacBook Pro at this price and that's it. >> I remember when I was going to going to buy a car. Uh I think it was maybe the first time I'd ever like gone to like a dealership to like to buy a car. >> And I I'm I'm an introvert. I'm a conflict avoider. The thought of like haggling on a price is just like kryptonite to me. But I thought I'm going to I'm going to do it. I'm gonna like I'm gonna be brave and I'm gonna like so like the salesman sits us down and he goes right and this is the price and like outlines and everything and I was like okay so you know can you you know what kind of what kind of deal can you do like what's what's the lowest you can go he's like no that's that's it I was like no seriously come on and he just I was I was certain I was in a car dealership I was certain there was a lower price to be had and it really really annoyed me that he just wouldn't budge And in the end, like >> did you walk away? >> No, I think I told this story. >> She just walked away. >> I can't remember if I threatened to, but I didn't. I actually did it. And I remember that's not for me. And just walk off. >> I got so desperate that um I'm a cycling fan and I was buying a scooter and scooter sponsored the tour to France and they had like the scooter tour to France green jerseys up in the in the thing. And I was like, "Okay, would you just give me just would can I just have a turn of France jersey? Like I'll pay full price, but can I just have one of those turn?" No, no, you can't have that. I was like, "Oh my god." I bought the thing. Bought the thing because I wanted it and it was a good deal. But yeah, but I Yeah, that was that was a horrible experience. I just I I felt like I was uh just not very skilled that Oh, I'm not I'm not skilled at that. I should have left that to my wife. She's she's really good at that kind of >> Yeah, I can imagine she is. She loves a haggle. >> Yeah. Elliot says, "Not a Black Friday related, but I think offering a discount for early adopters is a viable reason for discounting." I >> I like that. I like early. >> I don't disagree with you. Yeah. Yeah. >> But these are like the nothing to do with early adopters. This is just, hey, this arbitrary day has happened in the year where you can have a discount. >> I'll tell you something else. This isn't Black Friday related. I used to work for Adidas uh in one of their retail outlets. Um I was like assistant manager of of of the shop. Um and we we were just basically told if someone asks for a discount, you can give it to them. So like you it was just all they have to do is say, "Are there any discounts?" And you and you could basically make it up up to a point. So you could say, "Yeah, I'll give you 10% off >> or yeah, I'll give you 15% off." Like we we had that power. So there is stuff out there where if you just ask you will get. I was going to say if you don't ask you don't get do you? >> Yeah. So like you can literally walk up to a I don't know if they still do that kind of thing. So at Adidas outlet shops give it a go. That was a long time ago. But uh >> but but that's so so if so if I I meet up with a friend at night and we've we've both been shopping in the day and so let's say yourself you've been into the adidash shop and you bought a beautiful pair of trainers for 100 quid and you've asked you say oh is there any discounts and yeah oh yeah get 10% off then you go so if I buy we bought the same product and I've paid 100 quid for them because I didn't ask and then we both have a chat afterwards. I come away with a really bad feeling about that company. >> Why didn't I get a 10% off? Like we we bought at the same time, literally. >> So, how's that good? >> I don't know. I don't know. I guess like No, I guess partly the purpose of an outlet shop is to get rid of stuff. Like, they're literally just like if you can sell it, sell it because, you know, this is stuff that's going in the bin otherwise. So, >> yeah, maybe that's a bit different than that sort of type of stuff is. Yeah. >> Yeah. Yeah. Yeah. got a bit away from the WordPress there, but uh but yeah, >> as you can tell, I'm not a fan of uh discounts and really >> Black Fridays and >> I think they have their I think they have their place, but I do find I do find them to be a bit weird sometimes and bit arbitrary and >> the whole Black Friday thing I find absolutely bizarre, but there you go. >> Set your price, stick to it, review it if it's not working. >> Yeah, >> that's my that's my my chance. >> Early adopters, I'm with Elliot on that. I think that's a I think that's a really good That's that's a different one. I get that. But I think that's a different conversation to the one we're having. I think if you're starting out, you want some that I Yeah, that makes sense. That makes sense. >> Didn't even get into lifetime discounts. Let's not get you started on that. Anyway, moving on. Moving on. In fact, not moving on. Let's finish up there that we've done uh done about 40 minutes. Uh covered a lot. So, let's finish up for this week. As always, thank you so much for joining us, for listening, for watching. Uh if you do enjoy the show, please do consider leaving a little like, just click that little thumbs up and uh if you want more of this kind of thing, you can subscribe and you will get notified if you also click the bell on YouTube or if you uh follow us on your favorite podcast player. Um and if you do like it as well, maybe there's someone else in your network that would enjoy this show. Uh if you could possibly just send them a link, uh let them know about us, that would be superb. Uh are we doing a show next week, Mark? Are we? It's getting very close to the Christmas holidays. We should do >> do a little festive number. >> Um, so we should be we should be here next week. So again, if you want to uh get notified of that, please do subscribe and hopefully we will see you there. Have a great week. >> Bye-bye., WP Café #135 | Efficient Asset Loading, YouTube, 01kcc8xfg3ec41hqrwnhmh4pzh.