Categories
General

Using WordPress as an independent backend

One of the things that sets us apart at Photon Software is the level of standards we follow and our processes. We leverage world renown technologies to bring innovative & scalable solutions to complex problems.

Anyone can build you a WordPress website. But few companies out there are implementing WordPress as an independent backend, as part of their standards.

What does it mean to use WordPress as an independent backend?

You can skip this section if you are familiar with the WordPress REST API.

We are all familiar with WordPress as a friendly tool used to build a website or blog. But there is so much more that it can do! All thanks to the WordPress REST API.

The REST API is what WordPress uses to communicate with other apps on the internet. An app can be in a separate server and running on a different language and it would still be able to talk to WordPress via the REST API.

WP REST API Logo
WP REST API Logo, image credit: WP Scholar.

In a typical WordPress installation, you choose a theme to control the aesthetics of your website. When a user visits your site, WordPress loads the theme, then the theme displays your site controlling the aesthetics in the process.

Using WordPress as an independent backend means that WordPress does not actually display your website. In other words, the theme does not control the aesthetics of your site. All it does is expose your WordPress content as resources that can be accessed by a cohesive set of routes over HTTP requests. This is commonly referred to as a Headless theme.

Benefits of using WordPress as an independent backend

A headless theme allows you to manage your site’s content from WordPress and load said content from a super fast and scalable application, instead of WordPress.

You can load your content from a web app or an iOS or Android app. Since your content is pulled directly from WordPress every time the app loads, when you make changes to your content those changes are automatically available to your users.

Basically, using a Headless theme in WordPress allows you to reap all the benefits from WordPress as a content management system, while offering your users an incredibly quick & scalable interface.

Using WordPress as an independent backend can also make your team more agile. Since WordPress and the site are separate entities, developers can work on the site without interrupting the team from working on content — assets, structuring menus, sitemap, content migrations, etc.

So my content loads 1 second faster, so what?! 🤷🏻‍♂️

A second here and there does not sound like a lot. It is. But the additional second is not all there is to it.

To really understand the benefits of using a headless theme in WordPress, we have to talk about the things that WordPress lacks out of the box.

To be clear, WordPress is an amazing tool —It wouldn’t power half the internet if it wasn’t. The reason why we [The Photon Team] think WordPress lacks in some areas is because there are tools out there today that can do certain things a lot better. Loading a quick & scalable user interface is one of those things.

You see, every time WordPress loads a page on your website, ANY page, a whole bunch of stuff runs in the background. All your active plugins run, your theme runs, even the WordPress admin runs some processes while users are visiting your website. The result, for example, is that any of your active plugins can tell WordPress to load wasteful code. Forcing it to do unnecessary work, and therefore, become inefficient.

Photo by Lavi Perchik on Unsplash

Again, this is not because WordPress is a bad product or because the WordPress community didn’t have the foresight to see this as an issue. It’s because developers that publish plugins on WordPress focus on reliability and compatibility, not necessarily performance or scalability.

But who could blame them? If I am a developer writing a plugin with functionality that can be used from widgets, posts, pages, etc, I am going to worry about compatibility. Not whether my JavaScript is loading only when it is needed by a specific widget.

Plugins are the best thing about WordPress, they are also the worst thing about WordPress.

Mario Vallejo | Founder @ Photon Software

Having said that… Trust us on this one, while there are some good developers out there taking compatibility & even performance into account, there’s a few that do not give a shit about what processes they run on your server.

So what displays your website if WordPress doesn’t?

Welcome to PWAs.

A PWA, or a Progressive Web App, is a small cross-platform application. It is cross-platform in the sense that it can behave as a native app no matter what device it is loaded on. And it is small, as in lightweight, so it loads extremely fast.

PWAs are also really quick even when the app grows larger. This is possible via the use of code splitting. — Loading code only as it is needed. — For example, when a user visits the home page, only the code required to run the home page loads, nothing else. When the user navigates to another page, any new code required to run the new page is loaded.

PWAs can also offer additional features like the ability to display content offline. They can also be saved as a native app or published to the App Store.

We use React JS to build PWAs here at Photon.

Dark photo of a black iPhone
Photo by Rami Al-zayat on Unsplash

In Conclusion

When you use WordPress as an independent backend you get a number of benefits:

  1. A user friendly admin interface to manage and save all your content.
  2. A web app that can scale to millions of users.
  3. The ability to distribute your content from one place into multiple platforms — website, iOS app, Android app.

WordPress is evolving. It’s the whole reason for the REST API and the reason why WordPress is still relevant today.

Earlier this year Frontity, a React theme built to be used with a WordPress headless theme, announced a round of funding with Automattic, the owners of WordPress itself.

Clearly, WordPress realizes the potential it has as an independent backend. But, are you getting the most out of your site?

Let’s chat!

By Mario Vallejo

Mario Vallejo is the founder of Photon Software.
Mario is passionate about utilizing software to bring innovative solutions to complex problems.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.