Are you considering using the rest API on the WordPress website? Maybe you’ve read it all and are interested in it, but it’s delayed due to several shortcomings in working with JavaScript. You rarely feel nervous when dealing with JavaScript and rest APIs. Finally, if you created WordPress Themes and plug-ins in PHP, or ed third-party themes written in PHP (like almost all themes today), you should learn the entire theme. Master new technology or be familiar with other environments. The
You may also be concerned about what the transition means to site performance and users. Does it affect the user experience? Does it affect SEO? How fast is the site running? The rest API is very new, so it is sometimes difficult to find specific answers to these questions. This post describes some of the issues that may arise when considering rest API operations. I will identify what you need to worry about and what you don’t. After reading this post, I hope to learn more about whether the rest API is prepared for you. The
Let’s look at: Browser compatibility, performance, user experience, search engine optimization, and accessibility. But first, let’s think about what a rest API is and the possibilities it offers us as a developer. Rest API: what? Rest acknowledges that since s and T are transferred on the re semantic table, I don’t say much at all. Wikipedia includes: \
WordPress terminology, which means using HTTP to access the data in the site database, rather than using PHP or SQL to send database queries directly. Is it still chaotic? I know how it feels! In short, the WordPress rest API means that you can access data on your site from external applications, not WordPress. Use JSON (JavaScript object notation) and JavaScript itself to perform this operation. Therefore, you can use JavaScript to build websites or applications instead of PHP. The
This presents two main opportunities. After you build your site using JavaScript, you can create a site called Spa (single page application). If you have used the Google documentation tools, you may have interacted with one of them. Spa is a website. It works the same as an application. It does not need to switch to other pages, but changes the page content according to the interaction. More dynamic and interactive. Not limited to PHP, you can build applications based on word press data on other platforms, such as mobile. Therefore, you can also build a mobile application that can have a normal PHP based WordPress site, update relevant data with the site’s data, and have a completely different design from the website. Word press for automatic. You can also build desktop applications, such as the com Calypso application. Therefore, if you create a simple web site (such as a manual, blog, or information repository), you do not need to use the rest API. However, if you want to build features that are more interactive and responsive to user input, the rest API opens up all types of possibilities. The
Now, you can
This allows you to store data locally on the client (such as a browser) rather than on the server, so users can perform operations that require more data to be loaded faster. Therefore, the answer is that using rest APIs only affects site performance without managing code, and user interaction with pages can improve performance. User experience can be user experience or UX. Using rest APIs to build websites like app can greatly improve UX, but it can only be achieved when users and their expectations are understood. No matter what type of websites are created and what technologies are used, good UX does not come from technology, but from understanding users and their expectations and requirements. If users need an agile application that can quickly respond to input and manipulate data in a way that the standard word press site cannot, the rest API will help. However, if you expect users to consume content, what is more important is the speed at which the content can be easily accessed and loaded. Rest API does not add anything here. Another area where rest APIs can improve UX is supporting desktop sites and making it easier to build mobile applications that are designed to mirror for mobile. Migrate the design of your desktop site to your mobile phone. Don’t expect it to suit your users. Mobile application development is a very different field, which needs to understand the user’s expectations of the interface and the way the application works. Using the rest API, you can do this more easily, for example, by developing a reactive site. Make sure you fully understand the interface and users you are working with. If you are conducting user testing and investigation and developing mobile applications, please familiarize yourself with the description of the operating system interface being developed. When using rest API to develop Android or other operating system applications, corresponding instructions must be followed. SEO sometimes feels like the Holy Grail of web development. When I talk to customers or potential customers, they are only interested in how high Google’s website ranks. Of course, there are more. Maximize conversion, use SEO to attract visitors, and then do what you want without leaving the site. However, it is important to consider the potential impact of JavaScript development on site SEO. Developers often worry that sites built using rest APIs will not scroll through search engines. This is because after the page is opened, the script loads the content, and some robots cannot see the content. But Google and other search engines are not fools. They know that in an environment where JavaScript renders more and more content, users need to scroll through the content to provide useful information. The good news is that they will scroll through sites built from JavaScript. For example, the site for themeconf is built using the rest API. If you search on Google, it will display as expected. However, if the site is built based on JavaScript, the search engine’s permission to control rolling items will be slightly reduced. The test found that Google scrolled almost all the items on the web page loaded with JavaScript. The only exception is the nofollow link. As a result, sites often have problems. Otherwise, there should be no problem. There is a robot in the site that does not display JavaScript. For example, if a user goes through a Facebook link to a site, it will not display correctly. Therefore, social media
Links may be affected, but will not directly affect SEO. Accessibility I have talked about browser compatibility and the fact that the latest browsers fully support JavaScript. However, which users do not use browsers to access the site, but instead use screen readers or other assistive technologies? Screen reader users think they can’t access JavaScript, but that’s not the case. In fact, the webaim 2012 survey shows that 98.6% of screen reader users have JavaScript enabled. Therefore, this does not mean that you cannot access JavaScript sites or spas. However, this means that you must join the task to ensure access. Many developers assume that JavaScript is independent of screen reader users and provide non JavaScript alternatives, regardless of JavaScript accessibility. If you use the rest API to develop your site, you will rely on JavaScript and do not want to make extra efforts to build an alternative accessible version. Make the default site accessible more efficiently. Also, given the number of screen reader users who can access JavaScript, you can’t do that anyway. However, you need to do something to access the site. Webaim says: \