 DJI, mae hi i nifer eich synod. Fe pwrdd yna ddechrau. Rwy'n wedi wneud ar y cyflawn i'w cyflawni, eich hyn ar y bethau'r twistedr hyn o'r pindodi. Dwi'n ffordd ymlawn i'r ffordd i'r pindodi. Fyddwch yn ymlawn i'n golygu'r clywed. Mae'r su, mae'r athun. Rydyn ni'n ddod, As mentioned, my title is Ten Things All WordPress Developers Should Avoid. Now, I'm going to make this quite general and not too specific. Now, there's a couple of reasons. First of all, I wanted this to appeal to a wider audience as possible. Even if you're not a developer, you should generally understand most of what I talk about today. And also, I'm fully aware of the fact that my day job is not as a developer and there's probably some very professional developers out in this audience. So, if I get too specific, the Q&As at the end could get quite interesting. So, I'm going to avoid that from happening. And the other thing I want to say as well is, within the 30 minutes, I'm going to struggle to give answers to the 10 things I mentioned. So, in some cases, I'm not. However, if there's something really burning, there's the Q&As at the end and you can ask. So, four examples of what I wanted to show today. I created a blank test site and I installed what WordPress.org said were all the popular plugins. And a couple more that I knew had some interesting features. I installed and activated 33 plugins. I did it so you don't have to. It was a mess and we'll get to it. The other thing to say as well is that the 10 things I'm going to say today are in no particular order except for number one. Because when I put my name forward to speak here, I came up with a title like a lot of people do and a short description. But that's as far as I got. So, when I got the call to come and talk, I panicked a little bit. Oh, now I need some content. I asked chat GPT because that's the thing to do. I've ignored that. You would have got bored quite quickly with what it came up with. So, I turned to social media instead. And I asked, what's the things that plugin developers do that you wish they'd stop? And I got overwhelmed with one answer. So, in the end, I started asking people, what's the one thing that you wish they devoid that isn't this one thing? So, my number one, the first thing up here, is that thing that I told people to stop talking about. And as my only audience participation, I'm going to ask you, what do you think number one was? Any suggestions for the thing that annoys people the most that plugin developers keep doing? Hm? It was, it was. No, it wasn't that at all. It was, what I call aggressive promotion, or what everybody else said, banners. Admin notices. Now, it's quite interesting. I'm going to come up with some examples in a minute. It was, what people were frustrated about was banners in general, not just, although most people said advertising banners. But the frustration seems to be the sheer number. Now, this bit that I call aggressive promotion is just the advertising banners. So, there's going to be quite a lot of overlap between my 10 things you'll find today. You know, there is an interesting Venn diagram hiding somewhere my 10 things of all these different things overlapping. But yes, the main one is banner ads. And here's an example from that site I set up. Once I'd activated all those plugins, I lost my dashboard. And there are lots of different types of banners up there you'll see. There is some that are promotional. A lot of them are just saying, oh, you need to go into your settings and do something before this plugin is going to work. Now, I have some sympathies for those, particularly if your support would otherwise get overwhelmed because you forgot to put an API key into a setting somewhere. But some of those don't fall into that category. They're very much kind of like, oh, just go into your settings please at some point. And also even the different types of banner ads we have here, there's even one there that's got a completely different width to all the others, which I'm not quite sure is about. Even how they get dismissed, some have got the X button, some have got links to be dismissed. And that yellow bar at the top, we will get to that. That's an interesting one in point entirely. And that will pop up again. So we've got all these different types, and this is the kind of thing that people were talking about. So, as I was writing this up, I was looking on Reddit, and lo and behold, somebody voiced the exact same frustrations with a very similar looking dashboard, and this is what we hear from users. Now, this next one I think is particularly good. The Roy Kent there is not part of the banner image that came up. I've just put that on because that's how I was feeling when this happened. I think it happened like a week after I had installed all these plugins. Three new banner ads suddenly popped up, and it's because I have three plugins by the same developer in. And so essentially the same pop-up appeared three times. And as you can see, it's very big, and the dismiss is only for 12 months. You don't get a full dismiss for this one at all. No, and I actually spoke to the WordPress core plugin team, not core, the WordPress plugin review team, to ask them, kind of like, is that right according to the guidelines, dismiss for 12 months? And it's kind of more, it's against the spirit of it rather than anything else. But there's also the other advertising we get as well. So this is a setting screen. And as I said before, a lot of the time, all you've got to do is just put an API key in for settings, and this is an example here. Go in, put an API key in, save. All of that text is advertising by a little bit of help on the right-hand side. Even the text under the save button is advertising. The help should really be in a little help tab in the top right-hand corner, as is the standard WordPress way of doing this. And the rest of it is just getting in the way of you, putting an API key and saving. And how many times are you going to do that in the life of a plugin? One admin is going to come in here once, put an API key in and save. How much is all that advertising, all that that's getting in the way of what you need to do? What's it achieving? So, now I say cheeky at that top bit. I've not looked into this, but I noticed that another plugin that also deals with Mailchimp is putting up a banner advertising their product. Now, I don't know whether they're spotting the fact that this is a Mailchimp plugin and injecting their own banner in or not. I've not got that far, but seems a little suspicious. Now, WordPress org's own guidelines say advertising within the WordPress dashboard should be avoided as it is generally ineffective. Now, the next three are under a section that I call Don't Make It All About You. Look at me, me, me, plugins that feel the need to stand out. And here... Oh, no. So, the first one is inconsistent and confusing menus. And here are a few examples. Now, this is from the test site I set up. So, let's start up in that top left hand corner. The mini-orange plugin. It's not going to have a graphic the same size as everybody else. It's going to have one twice the size of everybody else. And also as well, I put this one up, as it's a nice example of a menu which you question whether it should even be cluttering up your WP admin bar. Because all of the submenu options shouldn't... It's either selling, or in the case of plugin configuration, it should be under settings. Ideally, all of that should be under settings. OK, so you end up with a very cluttered menu bar through all of these plugins which feel the need to be on that menu bar simply so that they can call themselves out. Now, if we go to the bottom left hand corner, this plugin, I should say, I think has now changed this behaviour since I did these screenshots. But essential add-ons there. Purple background. Now, one of the things I did when I set up my test site was I changed the default colours of the dashboard. Which you can do. Not everybody realises you can do that. Obviously a lot of developers don't know you can do that. Because it breaks a lot of things when you do that. But at the same time, it's great for accessibility to be able to do that. And so essential add-ons, purple background. And if you look at the dashboard image in the middle, you can see that the little next to updates, the little notifications bubble should be beige in my colour scheme. So essential add-ons is decided to go for red. So they're even overriding that colour as well. And if you go to the right hand side, you can see the consequence of this. All in one WP migration. How many people can see their nice little graphic next to the menu? It's a bit difficult to make out. I think with the default colours, you can see it absolutely fine. But because I've changed my colours, you can't. And there's lots of examples there of people changing default colours, including their little graphical image as well. Now the middle one. I bought up. I'm going to have an interesting conversation with one of the sponsors later on, I suspect. Google, Google site kit. This is an example of plug-ins that fill the need to push themselves to the top of the admin bar. Because they're obviously more important than posts and pages are. Because when you go into WordPress, when you go into WordPress, you're not thinking about posts and pages, are you? No, you're thinking of going to Google site kit every time. And there's many other plug-ins that do the same thing as well. So those are just a few examples. And let's move on. Okay, so number three. Don't take over the user process. So again, another example screenshot. I went into that mini-orange plug-in. Now first of all, they've decided a little modal white pop-up as part of their settings. I think you can actually just dismiss that and still get to the settings so I don't quite know what that's about. But it's that yellow bar again. Because they have decided to, instead of using the standard admin notices, they've decided to put their own JavaScript notification bar in. It conflicts with this little pop-up. And so now we have it in the exact middle of the screen overlaying everything else. The other advantage or disadvantage, as I like to call it, is that that wordfence, if you couldn't read who it was, it's wordfence, that wordfence bar also appears in the block editor as well. You can't get rid of it. It's everywhere. Which might be why they did it that way. Now, right, and here's another example of what I mean by this as well. There was a couple of examples of plug-ins that did this. And that is, once activated, a little pop-up appeared in the plug-ins list. And you can't access the plug-ins list until you action their little pop-up. OK. Why? Why do they feel the need to stop me from accessing my plug-in information for this? I'll say there was two examples of this, just in the most popular plug-ins that I installed. But there's also plug-ins I found as well that when you activate them, they take you straight into their setting screen. So if you've just activated a number of plug-ins, you don't want to have anything to do with those other plug-ins. No, I'm going to guide you straight into my setting screens because that's the most important thing right now. Number four, avoid creating your own UI. I'm not going to go into too much detail, and I think we kind of know what I mean by this, but I was talking to somebody about this yesterday, actually, and I think there may not be a general consensus on this one. But, yeah, when you come into new users or just non-experienced users coming in and using WordPress, going into a menu or going into any kind of screen within WordPress and finding they have implemented how their menus and everything else works completely differently is not the greatest user experience. And when you have multiple plug-ins, and I say these were just all examples I took from those popular plug-ins that I installed, all different plug-ins using completely different methods and styling and all the rest of it, breaking you out of the standard WordPress look and feel to do things in completely different ways. Now, at one point as well, I decided to speak to the plug-in review team at WordPress.org to see what's the one thing they'd like to developers to avoid doing. And they said lack of data validation. In fact, Mika, for those who know Mika, she was pretty outspoken on this one. So I'm going to quote her directly. Sanitise early escape, do not make excuses about one and two or use a darn nonce. I might have reworded that last sentence. Number six, loading unnecessary content. This one came up quite a bit as well. Plug-ins that will load scripts that just aren't needed at that point. So if you've written a plug-in that forms some kind of action in a postal page and the postal page you're coming and you're viewing doesn't need that script, don't load it. And the other thing as well is loading scripts designed for the back end in the front end and vice versa. Number seven, leaving content behind. So this is... So when somebody uninstalls your plug-in, which I'm sure they won't do, but if they ever do, does it leave anything behind? So many plug-ins leave behind data within the options table or even entire tables themselves if your plug-in created one. WordPress offers an uninstall hook, which you can use. Or better still, if in your plug-in folder you can create a file called uninstall.php and just put a script in there which removes all the data. So this is just a show. I practice what I preach. This is one of my uninstalls from one of my plug-ins. I also do a talk about WordPress Transients. So if I didn't mention them at this point, I would be failing in my duties. They are really terrible at housekeeping themselves, Transients are. So if your plug-in uses Transients, clear them out, which is what some of this big uninstall of mine is having to do. The TLDR of all that is try not to leave a footprint behind. Number eight, forgetting accessibility standards. This is probably the biggest one for me that I need to do better as a plug-in developer myself. So keyboard navigation, screen reader compatibility and just proper contrast. And of course, don't cull your menu options. Number nine, ignoring code quality checking PHPCS is your friend. This is a personal one to me, this one. I love PHPCS. There's lots of tools available for developers to check the quality of their code and to make sure that it follows standards and guidelines. PHPCS in particular is the one I use. And there are lots of rule sets that you plug into PHPCS and it runs through your code and there are some WordPress rule sets. The hardest bit I find of PHPCS is just installing it in the first place. If you've got over that hurdle, it's easy after that. You can integrate it directly into your code editor. But if you've got a piece of mine, every time I try and save one of my WordPress files, it will automatically scan through and tell me if I've got anything wrong or if I'm missing anything. The great thing about things like this is the fact that it actually covers off some of the things I've been talking about already. A lot of things like the accessibility and all the rest of it, it'll highlight issues. It'll highlight the security issues that Mika was talking about. And number 10 finally is a big question mark. And there's a reason for that. There was a lot left over and there wasn't a 10th thing that I was really passionate about. So, I had these left over. Flooding users with too many updates. Deactivation surveys, just don't. Overuse of important in CSS. Pushing forum support off of .org. Ignoring the WordPress APIs. Not providing hooks or filters in your code. Creating new database tables. Abandoning your plug-in or if you have to, how to do it properly. So, these were just a few of the things that could have been number 10. So, I had a great idea. We've got a Q&A. So, if anybody feels passionately about what they think number 10 should be, here's your opportunity. Q&A, please tell me what you think number 10 will be. Now, I've set up this URL for anyone and at the moment there's not much there. It's holding page right now. But I'm going to put up all the slides and things like that from here. But the other thing I'm going to do over the next few months is all the items that I've talked about today are going to be I'm going to write separate posts for them. And including those ones that could have made number 10. And in a lot more detail. And then I'm going to put them onto here as well. I don't want to know anything more. Also as well, if there's any of these things I've spoken about today that you'd like me to write about first, let me know in the comments on that page as well. And I'll be happy to. And that, I think, with 10 minutes to spare somehow, normally I ramble forever and ever. But somehow, with extra time to spare, I've got to the end of the presentation. So, thank you very much. And we'll have some Q&A. Sorry, it's my mic on. It is great. Thank you. That was a great speech. Thank you very much for that talk. I think I'm probably guilty of doing all of those 10 things probably only just yesterday. But that was great. So we've got some time for Q&A now. We've got 15 minutes. I'm going to kick off the first question if that's all right. So of those 10, which is your personal most important and you can't choose CSS important. Which one would you choose? Probably just based on the fact that I've had more dealings and it's a personal annoyance to me was probably the menus, which is probably why I took quite a bit of time early on that one. The menus bit annoys me so much. I'm actually at the moment writing a plugin that will actually just trawl through the admin menus and tidy them all up automatically and put things under settings and all the rest of it because it's just I can't see an easy solution to it but yeah, I think the menus and just trying to find things sometimes I don't know about anybody else just clicking on settings the number of times I clicked on settings to find the settings for something and I couldn't find it and it's like it must be somewhere else and it turns out it was there because it's not in an alphabetical list I just missed it and install a few plugins and that settings can get quite large so yeah much better method of viewing and tidy a menu system I think. I think is when you log into a site and then you have to scroll all the way down the screen on the left hand side and it just keeps on going. Yeah and I said as well that those plugins that are at the top and all the rest of it it's just that even just starting off where is it to begin with and then as I say plugins that don't put their settings under settings that decides there are plugins out there where there's no submenu options under the menu they put a menu option in there's no submenu options when you click on the menu it just takes you into settings and it's like why is that there why is that not under settings it's an entire menu option just for something that shouldn't be there alright thank you for that answer I'm guilty of making another settings menu that says site settings as well don't do that either that's very bad do we have any questions from the floor for David hang on oh we need a mic up there please we could have one hi hi hi thanks great talk so I have a question about the custom UIs for the admin and I agree these are awful and we know it but on the other hand WooCommerce, the new admin UI is also a custom UI and I agree it's done properly it's nice but on the other hand still if an automatic owned company is doing things like this how we can expect developers to stop doing so when I talked about plugins that put themselves at the top of the menus I know Jetpack is one of those so I'm not here to talk for automatic or WordPress more generally you know whatever the solution is these are annoyances for users and that's what I'm here to present and what the solution to that is and I understand why people use the custom UIs why people are doing a lot of these things all about trying to promote your plugin and we go back to that the option of the me me me there is a reason why they want you to look at them they want to promote their plugin but it's this balance I think between how much do you gain from that versus how much annoyance you're causing there are some plugins that are so popular that people install and despite all their grumbles and all the rest of it and you know and it's a difficult one I am not marketing I would love to know the numbers to know how some of these things particularly like the banner images how much that really does gain versus how much it turns away customers and noise customers and as well it might actually not stop a sale but how much is the frustration of a customer versus the loss of a customer what's that worth in comparison and I do wonder if because it's not a loss of a customer it's just a frustration whether that gets lost sometimes yeah if all plugins look like core WordPress when you installed them then most people probably wouldn't even realise there's some kind of premium product or whatever so the upselling method is the bit is a lot of the time and so it'll be just the same for like Woo and anyone else trying to do that promotional stuff UI bit yeah it's another way of allowing it to stand out in some way but yeah I think the banner ads at least doesn't confuse the customer whereas things like the UI can do because you know when you've got whole screens where things operate in a completely different way from everything else that is just going to cause confusion for people thanks for the question do we have any more questions from the floor anyone else want to put their hand up on over there please hello I've got a potential 10th one forgetting about internationalisation and the volunteers who help with translating so I know that there are quite a number of plugins that basically get translated for free by volunteers and as a plugin developer you can support them in that so for example premium plugin be nice to your translators indeed yes there's another option for number 10 do we have one more question down there I think yeah there please hi thanks for the great great talk I would like to add some more about internationalisation please there are so many languages in this room here assume the string can be double the length if you have a button with fixed size and the German or Russian translation is two times as long the button layout breaks so as a developer please don't use fixed width for things and assume every string can be double the size that is a very good point something I've not appreciated myself is that something you've come across in support issues at all I know as a developer I especially find that as you said with German strings they can tend to be very long and need hyphenation in a specific place no I've not come across I've appreciated that myself I will be bearing that one in mind for myself in future yes one more to add to the list any more questions from the floor over there please hi well less of a question but more of an addition to using more hooks for less actions please add proper documentation even though we can also scroll through the code it's more convenient to just read proper documentation on your website instead and update it yeah any more questions from the floor anyone with a question just see if we got any on social media all right well I think we'll call it a day there then oh we do have one more question I'm sorry great thank you we have a few more minutes so like most of us I'm also annoyed by most of the stuff but I kind of feel like this is not coming because people just want to annoy us there's probably a reason for it and I suspect that all of this annoying marketing advertising probably just works so I doubt that we'll get plugin developers to stop doing it as long as it pays unless there's an alternative in some way so yeah one thing I often think about all these upselling stuff is probably only relevant to the administrators of the site because a normal user is not in the position to buy the pro version and install it anyway so maybe something like a only showing that stuff to the people who actually can act on it or something like this so some compromise because just complaining probably won't help if it pays yeah I understand what you're saying there whether the fact that the people who probably can't afford the premium products are the ones you're left pushing it all to is whether that's therefore the best solution doesn't seem good compromise yeah and this is one of the reasons why I said that I didn't have the time for the answers because the question around the promotional side I think is probably long just to talk about that alone would probably be longer than this talk could be anyway it's a complicated question but what I think I'm asking more for today's people to think about it when they're doing these things you know as I said that setting screen where you're only going to use it once an admin is just going to use it once what was the point in all of that advertising all of that clutter on that screen for me it was pointless I don't think that served any purpose some of the banner advertising that one which decided duplicate itself three times what's the point there why did they not think only do that the once it's a duplicate of the same thing it's just about thinking about how much of an impact that's having on the user experience and just making it a bit better if there's one thing I can ask from all this today it's good we're not going to resolve all of this but we can make it a little bit better than it is right now and just give users particularly the less experienced users a slightly better experience than they get right now thanks for the question I seem to remember seeing something on track about a feature notification plug-in to clear up admin notifications I don't know if that's still happening and that may help with those sorts of banners but I think people are still going to push them I was on contribute today yes when I heard that was one of the tables I actually went to that table just because I was talking about notifications today so yes it is still active but anyone else who would like to get involved in the notifications feature the idea is it will hopefully go into call there's an API as well as an interface to display notifications and it works like you see notifications elsewhere that all of the banner ads and eventually things like email and such like might then get pushed to a little icon and a little sidebar notification system out of the way a lot more banners will still happen in certain cases because there's still going to be times when you do need to push something more urgent in front of the user but yeah it'll just help tidy everything up that we've got there now so I'm just loosely involved only found out about it yesterday so I'm not running it so but if anybody wants to get involved in the notifications feature please do right thanks any more questions from the floor we've got one more over there please we've just got a couple of minutes left thank you you mentioned custom admin UI and a lot of plugins are doing it can you give a couple of good examples where a plugin has a lot of settings that need to be used and understandable and convenient that is not using a custom admin UI like an example that plugins developers could follow or base their new developments on so an example of a plugin that for the settings doesn't use its own UI and you think it's a good example not off the top of my head because I did spend my time looking for bad examples for this so I wasn't actually looking for good examples but I think personally the way I was thinking admittedly all the plugins I've ever written have not been commercial ones so I'm coming from a different place for this but certainly whenever I'm writing something I mentioned in those things that could have been a number 10 to use the WordPress APIs and I think that's quite key using more of the WordPress APIs to make your screens just look like the core and this is what I try and do when I write plugins as much as possible I'm proud of my plugins and I want them to look like they came with WordPress I think that's a good thing to show off to people install this and it'll blend in the back of course for something commercial that isn't what you want into the background and become invisible but that for me I think is actually for those that want to a good example for me is that does it look like it came boxed with WordPress and isn't a plugin Great, thanks very much for the question I think we're going to wrap up Q&A there everyone here wins a prize and that prize is to go back and refactor all your code so congratulations David again would you give it up for David please thank you very much one sec