I think its time for Wordpress API to step-up!

Wordpress is one of the greatest things to have happened to the world wide web. About 25% of all the sites existing on the internet run on wordpress. It is in fact by far the most widely used content management system.
three-platforms.png
view source

Its no wonder that most web designers and developers alike make use of this awesome platform to build almost anything.

Its no secret that wordpress started out as a blogging platform meant only for showing the feed of a blogger. However, the reason wordpress became so popular is because it grew!!

Wordpress transformed from that poor little blogging platform to a full blown CMS that can support almost any type of website imaginable.

Part of this improvement in standard was the addition of the WORDPRESS REST API

The REST API came as a savior to developers who wanted to extend their applications beyond the scope of their primary url (as was necessitated by growing need for interactivity of applications).

The WordPress REST API provides API endpoints for WordPress data types that allow developers to interact with sites remotely by sending and receiving JSON (JavaScript Object Notation) objects
https://developer.wordpress.org/rest-api/

However, since its incorporation into the platform a few years ago, there hasn't been much improvement to the state of the API.

My Observations

After working with the wordpress API for quite some time now, here are some few things I noticed using it:

  1. It returns too much information in just one call. A simple call to the ../wp-json/wp/v2/posts returns a ton of JSON objects and strings that can literally blind a beginner and probably make him give up on coding entirely. The downside to this is the response time. The wordpress API takes a fairly longer time to respond than should be (considering the little amount of information the user is actually going to need)
    Screenshot (284).png
    how gruesome the returned JSON looks on chrome
  1. Even after it returns, there are too many redundant arrays in the result.
    A more refined look of that same JSON on mozillaScreenshot (285).png
    Here, we see the first post array has an element "title" which is an array and contains just one element "rendered" which is totally unnecessary

  2. The API Restpoints are left open by default! This, I feel is a major issue that needs to be fixed. Innocuous website owners that have no idea about what an API means have their data floating all over the internet by default and can be used by anyone. It shouldn't be.

  3. Fairly difficult to customize. Except one is a badass oldtime kickass software developer, it is super difficult to understand and make any tangible modification the way the API should work.

Suggestions

  1. The will suggest that more REST endpoints be added to the wordpress API so that users can pinpoint and narrow down their API calls to the specific data they need. This would improve the response time of the API call.

  2. Irrelevant arrays and trees should be removed from the JSON response structure. This will help reduce the stress on developer that otherwise would have written slightly longer lines of code to access those inner layers.

  3. The API endpoints should be left unaccessible by default, seeing that most people who use the wordpress platform are non-coders nor developers. On the contrary, website owners who want to make use of the REST API would have to enable that feature.

  4. The code should be made easier to understand. At least by average developers. More tutorials should be made (video tutorials especially, as those tend to be more interactive)

I really do hope these points would be taken into consideration by the wordpress development team.
It really is time for the WORDPRESS REST API to take the next step in advancement.

Looking forward to v3!!

Go Wordpress!!!



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center