 Mae'r hwn yw'r cyfnodd yn fwyaf o'r cyfnodd y maen nhw yw'r cyfnodd. Felly mae'r ddwyライd. Felly mae'r ddwy Llywodraeth yn gyfnodd yn fwyaf o'r cyfnodd. Yn gyfryd o'r cyfnodd yn y ddwy Llywodraeth yn edrych ar gyfer cyfnodd, mae'r cyfnodd yn cyfnodd yn cyfnodd, rwy'n cyfnodd yn cyfnodd y cyfnodd, surfaces so it can grow more naturally and with less room for errors and problems. So there are a lot of misconceptions about WordPress. I'm sure we've all heard these, WordPress it's insecure. It's only for blogs and news websites. It's not for real developers and WordPress sites look too similar. Mae'r dweud yn diwrdd ei wneud flwyddyn, maen nhw'n gwrtho'r cyfle i'r cyflwyno'r rhagl. Mae'r un gweithio'r un, ac mae gennym eich bod nhw'n gweithio'r gweithio'r cyflwyno, ac yn y cwysig, mae'r cyflwyno'r cyflwyno'r cyflwyno, rwy'n gwneud fe yw'r hynny yw yw'r hwn, a'r tyfnod yw. Mae'r tyfnod yn ychydig yn dda. Dwi'n ddod i ddwy'r cyflwyno yw'r cyflwyno'r cyflwyno'r cyflwyno'r rhagl, A gynnyddio'r ystyried i gyfnodau toeth yn gynhyrchu'r problemau yn gynhyrchu'r gynhyrchu sy'n fawr. A wnaeth yw'r gynhyrchu, yna'r hyn ymgyrch yn y dyfodol? Felly mae'n bwysig o'r gynhyrchu eich bod yn gynhyrchu i weld, yn y cyflym i gyd ymweld. Mae'r gynhyrchu'r modd amser yn gweithio'r gwybodol. So, when we're talking about scaling in terms of development, what do we mean? Firstly, I'll go from what we don't mean, it doesn't mean just making something much bigger or making it a much larger code base or larger piece of software. Also related, it doesn't mean just adding to something that's already there. It does not mean adding more complexity. In fact, I would argue at the reverse is what you should go for. It's not removing old code, although that can be a part of it, but generally if it's legacy code that's actually doing something, then I would argue keep it in there. Not adding more workload or dependencies to any system. So, in the context of a WordPress site, we could argue that's adding plugins or adding to the theme that you've built. I would say scaling is about making something be able to grow organically. By this, I mean with minimal interference or minimal being able to develop it well initially so that there's less need for developer resource labour on down the line. So, you can easily add to it and if there is developer resource needed, you can add some functionality without rewriting everything else. Related to that, make something able to be added to without breaking anything else. This is where things like good development patterns are very good to have and good code structure using object-oriented PHP helps with this, but there are a lot of other things that go into that. Follow-in preset patterns for design implementation, particularly in terms of the code that you're writing. If you follow some set patterns for implementation and adding to that beforehand, particularly if within your team you're following similar coding standards and similar guidelines, it means that it's much easier to add to it later on. Allow for progressive improvements. This is why I meant you will allow for any new code to be added progressively. Particularly if you're building something in agile way where you release the site in a minimum workable version and then add to it later on. If you've scaled it effectively, it should allow for this much more efficiently. It allows for increased workload on the system of minimal impact. This is not only a server issue, but in terms of if we take WordPress, for example, if you can add extra code to the site without it breaking anything, or if you can add particular plugins that you have built, which are similar to maybe other custom ones that you have built, or maybe using some of their same classes, that can actually help. This would be my definition for what scaling is in terms of software development and web development and so on. You build a system in a way that's so minimal that you build a system in such a way that minimal effort is required to add to it's size of workload, and in doing so causes minimal impact. Why may WordPress sites typically have scaling problems? The big one that I found in many cases is over-alliance on third-party plugins. The problem there is that a lot of these plugins may use different coding standards, they may use outdated PHP in some cases, whereas some may be using more modern PHP, or there may be conflicts in their functionality. I've seen this across certain sites where many different caching plugins are added, which sounds, to uninformed users, it may sound like a good idea, but then a lot of that functionality can be conflicting with each other, because memory problems and so on. Potentially just a badly written code that we see in some places, so maybe it's using JavaScript that's not following standards very well, or even using PHP that technically works but could be improved. The WordPress site itself may not have been updated, the plugins may not be updated, so again it may be using older code, particularly if the server version of PHP or whatever software is running may have been updated, but the code base itself hasn't been for that, that can cause some problems. Replicates functionality that can easily be achieved without plugins. I've seen this, I'm not against using plugins, but I tend to take an approach of being very minimal with them. I tend to argue that if you add a plugin, or if a member of my team always adds a plugin, I kind of want to see a good reason why and what to be gained from that. So I'd like to keep it minimal, but I can't really give an idea of how many that should be, that would depend on the site. So if you're replicating functionality that you could easily achieve without plugins or with a very small custom build plugin, then that obviously can cause problems, particularly if that's done in a lot of cases. Or project management and version control mechanisms. So this is not necessarily a down to exactly the code, but more from a development team culture standpoint that can cause some problems for the code base itself. I've seen some of these before, changes being made on the fly, particularly on production where things are made, where we... I know I've probably made this excuse before, it's a very small change, but they add up to many little changes which maybe aren't being tracked well or not being put through version control or through proper testing mechanisms and made it snowballs into quite a big problem eventually. And no formal software development methodology. Now I'm not arguing that every team should go agile or can ban or scrum to the letter, but it's good to at least look at the way these methodologies do things and actually see if you can adapt it to your team in some way. So if you choose to go agile or scrum or can ban or many of the others, that's kind of a way to approach it, but I would argue to actually adapt that to your team. Scope Creek and Curran, we've all seen this when particular building third party websites, the scope can change a lot which does happen, but there should be things in place early on which means that Scope Creek can be redirected either into something that's a second version of the project or that's maybe a smaller component that you can add to it later on and not forcing it into a project at launch, for example. I have seen this not often, but probably more than I would like to admit where I've gone on to projects and there's not been an adequate stage in all development setup where maybe there is a stage in development setup, and there's always a disconnect between that environment and a production environment or there's not proper use of those versioning systems. So obviously that can cause problems in terms of code being pushed adequately and in terms of the code just being kept in good health, so checking it adequately before you actually put in the production. Not keeping themes called and plug-ins updates. This is mentioned and it's pretty simple. I'm sure many of us do realise this. By not keeping those things updated, there's a lot of security vulnerabilities that can be in that code and the code can be in an update standard or it increases potential for conflicts. For example, if a plug-in actually is using object-oriented PHP at me, it's probably calling a class in a particular area, whereas if it's using quite outdated mechanisms and there are many functions in there that are actually interfering with others, there might be similar names and so on. If they're the same, actually no, if they're the same it will often cause a complete error, but in terms of the functionality itself, that's something that could cause conflicts or memory leaks. So overall hosting resources that can't keep up the demand. So in this case, it's not directly down to development, it's more of a DevOps issue but if there's a lack of control over your hosting environment, then that obviously does limit what you can necessarily do with it and limits how you can actually optimise for that. So if you, for example, are hosting a site on shared hosting, that's obviously the obvious limitation. So that's why I would always recommend VPS hosting or dedicated server. They're really not... They are really very affordable now and there's very good setups for that. Like I mentioned earlier, there's many hosting providers we know who give VPS and dedicate server environments and often even for clients it can easily be sold to them that it's a pretty cost-effective solution when you're looking at more uptime, more control over the server environment, the ability to upscale it more efficiently and so on. So, yep, that's essentially, it's default setups being incompatible with project needs can cause this kind of problem. A lack of understanding of WordPress and its structure can cause a lot of these scaling problems. So if I've seen this in cases where certain themes that I've come across where there's PHP functions being declared within the theme itself and then used when those functions actually exist within core or something very similar does exist within the core WordPress framework. So if you get to understand the WordPress codex or similar or the WordPress developer resource you can see all these built-in functions and what they can be used for. So it's best to use that initially and then just if you need to add more you declare them in your functions following the theme and so on. And if you also have seen where some things are not following the template structure so like we have single.php and single-postaip etc. So it's just that with WordPress development the further you go away from the core rules or framework in terms of actually developing templates and developing themes the more room you leave for problems and the more harder it is to actually maintain that particularly when you update WordPress it might cause some problems or so on. And I'll touch on this as well later on but if you stretch your WordPress and store beyond its capacities without planning for it then that obviously can cause some issues. So if both in terms of the size and scale of the site but also in terms of if you're going outside of e-commerce and regular e-commerce and blogging certainly can do that in WordPress and there's many WordPress apps that do that very well but you probably would need a lot of planning to make sure that it's able to scale to that level. Update techniques and pull current standards so I'll touch on this but if you have any kind of outdated codes or use an inconsistency of standards across those things or if there's no proper organisation in the code base then that can cause some issues and use an object directly in PHP it's not a must do but I would say it definitely is you get huge benefits from doing that not just in terms of site performance but also in terms of saving time really and writing code yourself so if you declare a class or an object then you can reuse you can put all the related functions into that class and just reuse it simply put we can go much deeper into that there's no time really object-during PHP on its own it's more than a talk but what can we do so there are a few issues particularly for WordPress that can go scaling issues but what can we do to make them scale more quickly I'll say firstly reduce reliance on third party plugins not saying to move away from them completely some of them are useful even from a development point of view I would say reduce reliance on them where possible before installing ask is this plugin necessary will it actually save development resource or will it actually maybe cause more problems later on will it be something we'll actually need to develop something else to counter against I take this approach here build a custom plugin to store functionality instead of adding to the functions file within your theme if possible it also helps with debugging if you can add it to a plugin that you've custom built then if you do redevelop or change the theme you can simply move that same functionality across ensure plugins are deactivated and removed if they're no longer necessary I know it sounds obvious but I've seen this in many sites a plugin has been left active since launch and it's not doing anything I've seen that several times so something that's important to keep in mind also avoid the thinking of there's a plugin for this or there's a plugin for that plugins are good to use sparingly but then sometimes it's good to write a bit of code because you'd save yourself more time in the long run by doing that in many cases from my point of view sometimes it's the easier option for the team to develop their own functionality in-house implement proper project management methodologies to the development lifecycle so I think a mistake that I've seen in some development teams is particularly of developers who are new to WordPress they come to it with a mentality of WordPress development being easier or being not like building other softwares or other applications but it is a framework like all the others that should be looked at in a similar way I argue so you don't have to follow necessarily any of these or any particular methodology but it's good to at least know what they are about so it's just methods rather than technical knowledge it's the way you would organise a project in software development so if it's a Scrum, Majol or Canban or Scrum and Canban are actually forms of Majol or if it's a very rare now but waterfall or test room development so I think it's good to get at least a basic understanding of a lot of these methodologies and then look at how if you're in a position to do so you look at how the team is structured and the company culture and so on and try and think what the best way to actually implement some kind of system in your workplaces so I would not argue to follow everything to the letter without thinking how you would adapt it to your team because then that's just a recipe for disaster particularly if you're not taking into account the company culture and if you do make the changes I would say meant and gradually for example my team I'm trying to introduce Scrum but we're doing that in a much slower manner because I feel not only with users but also with development teams it's difficult to get people to adopt a new standard if you do it right away and force it right away so it's best to gradually get people used to some of the concepts and introduce some of the ways of working over time you saw the virtual control systems so Git is the main one there's also Mercurial use multiple branches in your repositories maybe it's basic it's just a development staging and production or master but I have seen in other cases where we create feature branches so for each new feature that's being built you'll create a separate branch and then merge it back into development or so on that's been some way of doing it so if you have multiple developers working on a project you can separate your code out more efficiently that way and it's obvious but don't push to production before putting it through the pipeline ideally you would have some kind of extra script that will run from your master branch to production but yeah that's maybe you would have to just do a Git pull depending on the resources keep themes, plugins and core updated as mentioned I won't go too much into this because we've gone for it already so conflicts are more likely if your plugin seems in core updated and performance benefits can be realised if you keep them updated I know sometimes some of you are probably thinking we've often updated things in WordPress and it breaks stuff true, that can still happen which is why you put things on a development server or a staging server first and ensure you run in a server and if you're going to scale your WordPress site and it's going to be a very large site and it's going to have a lot of resources ensure you're running our server or hosting and you'll have all large applications and requests so if ensure it's a server that can handle a lot of traffic and not fall down once it hits 1,000 users or not make sure you can actually run many scripts on there at once or can as I said serve many users and so on VPS hosting or dedicated hosting is ideal for this and if you're trying to sell this to clients to pay a bit more for hosting it's pretty easy to I would argue it's much easier now to sell it to clients than it was previously particularly because that kind of hosting is now much more affordable than it used to be so yeah use a VPS dedicated hosting and ideally also pick one that gives you SSH access so it may not be yourself doing that maybe a DevOps and so on but if you have access directly into the server and access to actually be able to change certain configurations that will help you to optimise it so if you have access to the command line then you can still WordPress CLI and it will just allow you to more scalably manage the application and ensure even within your team that there's an understanding of WordPress and it's you've stripped the limitations in your project team so this is more around basically around the misconception that it's only for blogs or news sites basically commerce so I would argue that you need to your team must have some understanding of that if you are going beyond those core uses of WordPress you can but it may be that you may need to heavily customise your own code or combine it with our frameworks and this is where we get into headless WordPress and so on I would argue if possible at all do not take the plugin heavy approach to this we see there are plugins for social media additions to WordPress and there are plugins for all kinds of additions but I would argue not to take that approach and try and maybe combine it with other frameworks if possible plan ahead and stick to the scope when planning a complex WordPress site so if you know that it's going to be a very complex site you can plan ahead and yes things do change but the more you plan ahead and the more you actually stick to a roadmap the more easier it is to adapt to any roadblocks that might come in the way and I mentioned about headless so you can look at different options depending on the complexity so if you go for the regular couple traditional coach where the CMS and the front end are directly linked or if you go for a headless site where WordPress is just the admin interface multi site obviously splitting up your WordPress site multiple sites within the one site so they can all be administrated separately or decoupled so similar to headless but it's as well as serving the data to a third party application you also serve like cached pages and so on and the last one is actually use modern well structured coding standards so there's only three things I'm really going to talk about here but I don't know if you can see or object-oriented PHP where possible object-oriented PHP two major things of this classes and something called dependency injection which I can't go deep into dependency injection because it's very technical but it's something that you can use within object-oriented PHP that really cleans up the code and makes it much easier to adapt it another recommendation adopt a coding standard in your team doesn't a coding standard will not necessarily improve the code or how it runs but it means if you have multiple developers working on the project it will be much easier to maintain it because for a project management point of view it means that commenting and so on is much easier and it's much more uniform adequate document and comment your code and use SAS to write CSS rules and compile that into CSS files so the last one isn't always necessary but I would recommend it so you use SAS to write your CSS rules and again it's much more scalable because it's generally much more intuitively arranged rules and then you compile that into a style CSS file so it's not central but it does help in terms of being able to scale the rules that you're adding to your CSS to be able to maintain it well and removes a lot of confusion and complexity that may inadvertently arrive from that so I said I've mentioned three areas classes so this is one part of object drawing at PHP so thinking about your code in terms of objects in wordpress you might put this object there's users, post pages, comments etc and any attributes that are associated with them so you combine the general idea is you combine any functions of an object into a class and it can save time encoding and can minimize code created as well as making the calls much more efficient when they're done well so the very basic example so if you take an object car and you create a class for that you could create these set color and get color functions for that so when we're actually calling that we just create new two instances of that car class and then run a set color as we've called it here to actually just add to set a color for each object and then if this was much more complex we would have more functions and it could get more complex and more but this is a very crude basic example just to demonstrate how it works depends injection so you reuse the way this works you reuse the functionality of other classes or objects in a new class to declare and declare functionality that depends on that functionality so saves time encoding is also great when it's cut down on this code or recoding certain functionality so again this is a very very crude example it goes a lot deeper than this but this is, if we were to take the car example again if you imported car as a class into so here the class that we're setting is that's using the dependency injection is the driver class at the bottom so I will explain it because I'm sorry I realize it's a bit so if we set a class driver then we could import functionality from the car class and use that within the driver class that we created so I suppose another good example if you think of a torch that's like think of that as like an object and almost it's like using a dependency injection from batteries or from a switch so a dependency injection is when you use the functionality of another class or object within the one that you're declaring so it's not necessary but you can help to cut down on unnecessary code and rewriting stuff but that's that's a totally separate thing and you could look into it afterwards because it goes quite deep and lastly MVC so this Laravel and Magento and Symphony is built on this but I've seen a lot of WordPress themes starting to use this concept so it's where you divide the model, you divide your code into model view and controller so I've seen this in you see this in other CMS systems like Drupal, Magento and also frameworks like Laravel and Symphony so to put it shortly, model it structures the data in a reliable form and prepares it based on our controller's instructions the view is essentially just your templates so what the user is rendered to the user on the front end and the controller takes user commands and sends them to the model for data updates and sends that to the view right thank you, that's everything I hear a lot about headless CMS at the moment and I was wondering what your experience with it is whether you think it makes a big difference and where you wouldn't use it or would use it and what the limitations are I would not I see a lot of benefits of it and the reason I would probably not use it would depend on if it's maybe overkill for your use so if you're still running a very basic WordPress site that's pretty light then you may not really see much benefit from it but if you are running a WordPress site that will be very complex and maybe it's best to serve that in another application framework then I might go with that approach or if you perhaps want to syndicate your WordPress content elsewhere I've seen that in some cases as well where maybe the content has been served in multiple places so then you might keep it just ahead of the CMS I did one quick question if you're serving a thousand users fairly complex application what kind of server resources would you assign to that? In that case I would go with a dedicated server with high good memory but aside from that it's not really about the server but I would argue use something like Plowflare for example to funnel certain traffic if it comes through a high rate You need an mention of on the life of this bicycle That's going to be difficult to scale on giving the advertiser of the WordPress database That's true It's a very good advertiser I agree that is a problem There are obviously new versions of MySQL that is MongoDB and MariaDB That is a limitation at the moment it's something that Core does can't rely on You can technically change the database but that's a very difficult thing to do So I agree that is a limitation I don't know how you'd overcome that side of it That's a processor Yeah It will probably target that, you'll get the information on it so you probably better partition off the database traditional database methods that we've used for years to handle SQL databases or SQL style databases would be a, you know, so you would separate transactions from data for instance, you would concentrate on, you know, those two put sort of stuff coming in and out you would need to potentially set them up with different you know the hardware at the back There's many ways you could actually walk your way through it I don't know the limitations they're not quite at the end of the world yet I don't think for the interest now about you know you just go back to traditional SQL practices The fundamentals are there at what price, most of the database it doesn't lend itself to the indexing because if you're in a value pair structure of the tables that's very difficult to change that thought puzzle and you're right, that's the limitation that the database is able to sell which is a, that's a different way but you know, normally you could do to look at those hotspots and then try and walk your way through the data but if you see something that you can't you should have a bit of complex Now I was going to say very quickly the other thing you do is split the database onto a different server which is going to complement what you might just say and just have one two separate servers so you can cluster your database also so I'm seeing that in one project I had What do you see? Don't the database have a different server? Well you cluster it into different nodes so rather than serving it all from the same you would have a few, it's only really for very big sites you might cluster it into different servers and they will serve it from different servers In front of me the queries less So it means cuts down queries and it also acts as a backup so in case a nice kind of server goes down it means there's still others that can serve that it helps with the memory and so on Thank you So with a typical framework for the planar version of that you've got database migrations that you've managed to do production in another virus so what would you recommend on that Honestly in terms of WordPress I don't know what I would I work with Laravel a lot so I know I know about migrations and seed files and so on You probably could set something like that for your WordPress install but I don't know the quick and easy solution Have you seen Laravel a new project built into your WordPress system is that what you do I have I have done that before so used headless WordPress with a Laravel application but in terms of because obviously Laravel has the built in like database migrations so you can just create a seed file for your table or you can generate it through the command line and you can move that to a new server WordPress I mean it could be something I've just missed out on but I don't know a solution like that for it In theory you probably could do that with that too maybe with composer or so on but I'm not sure off the top of my head how that would be done Remember if you have an idea for a lightning code you can go and sign up by the registration desk and thank you please Thank you