Not long ago, torque posted a post complaining about the code quality of themeforest theme. If you are a WordPress user who or purchases themes or plug-ins to be used on the website, you may want to ensure that the themes and plug-ins you are using are well encoded, stable and secure. But this is not just for users. It is also important for WordPress developers to code their own themes and plug-ins according to these standards. This helps make your site safer, faster, and more stable, improve customer service, and work as a member of the development team. The
This post will look at the elements that generate quality code and provide the top 10 tips for the code quality of topics and plug-ins, whether coding for yourself, the client, or the public release. Themeforest is often criticized for the theme of wrong sales coding. But is bad media justified? There are several main code attributes that can be judged as good quality from the side of \
Valid and compliant code. Code that conforms to the WordPress coding standard. Easy to build maintainable code. Use WordPress APIs, functions, hooks, and classes correctly. Accessible code that uses comprehensive assistive technologies or does not discriminate against visitors with sensory impairments. Internationalization allows users in other languages, not your language, to interact with your themes and plug-ins. Efficient code without bloating. Logical code for you or others to understand and use later. Code that improves the performance of the site on which the site is running. Code that does not threaten the security of the site where the code is running. Here, we will examine these implications and provide 10 key techniques for improving code quality. The
The first rule of all code used in a valid standards compliance code web browser is that standards must be followed. If you are not familiar with the W3C web standard, do so. Now. Please check whether the male code conforms to W3C validators and standards. Standard compatible code works as expected in the latest browsers, including mobile devices and screen readers. Omit (or replace) unused or highly experimental annotations, and effectively use code in standards (including HTML and CSS, but excluding PHP or JavaScript). The
The most important aspects of standards compliance code include: Use HTML5 command code (if you haven’t used HTML5, it works well in word press, which is worth noting). Use the document tree according to the standard, correctly use the male and male elements, and correctly organize the annotations. Avoid unnecessary classes or IDS whenever possible. Use CSS instead of HTML in your presentation (including not using tables in your layout). Some images of the content will be encoded as HTML, and decorative images will be encoded as CSS. Cross device and browser compatibility. Use Title elements correctly: don’t add titles in the wrong order as my customers have tried to, so as to improve SEO! Make sure you have access to the code: more on this later in the post. If you are experimenting with new HTML and CSS features, especially in your own projects, you cannot interrupt the operation, but you must ensure that page flow is not required and provide alternatives. However, if the code is designed to be public, it is not recommended to use it. The
To validate the code, use W3C’s HTML and CSS validation tools. Character imprint coding standard W3C standard
Use plug-ins. Avoid the temptation to add more features to your theme. Tim Berners Lee, inventor of access code world broadband network, emphasized accessibility: The
The power of the web lies in universality. It is an essential aspect that everyone can access regardless of the fault. Accessibility is one of the core principles of W3C standard. If accessors using accessible technologies cannot access the code, it is not validated. The coolfields website helps to understand the accessibility of word press. To better understand how to make WordPress code accessible, it is best to read the Codex page of accessibility and the coolfield blog of WordPress accessibility expert Graham Armfield. You should also be familiar with WCAG (web content accessibility Guide). When you submit a topic to the WordPress plug-in repository, its accessibility is tested. If the topic is not accessible, it is paused in the repository. The standards applicable to the subject are divided into two headings: required and recommended. This applies to plug-ins as well as topics and should be integrated with plug-ins. The necessary standards are as follows: Use the title correctly, including the H1 element used first. Use the aria role. Please code the link correctly. Use meaningful text in the link (not \