BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News WordPress.com Replaces PHP with JavaScript

WordPress.com Replaces PHP with JavaScript

Lire ce contenu en français

Bookmarks

WordPress.com has replaced PHP with web technologies and a RESTful back-end API for the administration console.

Writing about why WordPress.com decided to move from PHP to JavaScript, Matt Mullenweg, Founder and CEO of Automattic Inc., the company behind wordpress.com, said that the foundations of the platform were not strong enough for what is to come, and some of WordPress’ strengths were also drawbacks. The main component affected by this overhaul is the administrative interface which saw a remake in version 3.8., but gave Mullenweg the conviction that an “incremental approach wouldn’t give us the improvements we needed.” He added that “backward compatibility and working without JavaScript “ were the main culprits in having the interface the way it should be.

Automattic decided back in 2014 to create a new admin interface called Calypso built using web technologies –JavaScript, HTML, CSS, Node.js, React, Flow, WebPack, Babel – and accessing the back-end through a RESTful API. Andy Peatling, Calypso Project Lead, has written on what it meant for a PHP/MySQL company to switch to JavaScript. They had a few advanced JavaScript developers who could contribute to the project, the others being “intimidated” by Calypso. They had also used Trac for project management and had done very little code review. Starting using GitHub and its pull request system followed by commit and code review helped them see “how much easier internal collaboration could be, and how to allow for much greater feedback on individual work being done.” Although initially intimidating, code review “greatly increased the quality of our codebase and helped everyone level up their JavaScript skills.” Over a period of 20 months they went from 7 contributors to 127 and over 26,000 commits. The team has also implemented continuous integration.

The new interface is a single page application with a responsive design adapting to screens of various sizes. According to this feature comparison table, Calypso is fast with near instant page loads, instant publishing, in-page previews for multiple targets, and changes are applied in real time without reloading.

One of the benefits of using a JavaScript responsive design is that creating desktop or mobile clients is much easier than before, as Peatling remarked:

By the middle of 2015 the Calypso codebase was in good enough shape to be used outside of the web browser. Since Calypso is entirely JavaScript, HTML, and CSS, it can run locally on a device with a lightweight node.js server setup. Using a technology called Electron, we built native desktop clients running the same code bundled inside the applications. We started work first on a native Mac desktop app, which is now available, and continued that work on soon-to-be-launched Windows and Linux apps. Seeing these apps come together and using them internally really started to justify all the hard work we’d spent building the Calypso codebase.

Automattic has open sourced Calypso, but they still have “a ton to figure out around plugins, extensibility, contributions, Windows and Linux releases, API speed, localization, and harmonizing the WordPress.com API and WP-API so it can work with core WordPress,” according to Mullenweg. Also, they leave it to the community to decide the inclusion of Calypso in the Core WordPress to replace or not the current admin interface.

WordPress is currently used by a quarter of world’s CMSes, according to W3Techs, up from 13% as it was in 2011.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • WordPress Replaces PHP with JavaScript

    by Cheryl Brand,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    How long until this pops up in the self-hosted platform, and to what extent?

  • Ambiguous article

    by Woody Casey,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I think the headline is a little misleading, not differentiating wordpress from wordpress.com.

    See the comments in the article you linked to... perhaps you could amend and clarify

  • Re: Ambiguous article

    by Abel Avram,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    The article did mention " they leave it to the community to decide the inclusion of Calypso in the Core WordPress to replace or not the current admin interface." But, to avoid any ambiguity I edited the title and the first 2 paragraphs to read "WordPress.com".

  • Restful API Still written in php

    by EJ Campbell,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    The move is for their Frontend component only, so they still use lots of php.

  • Broken link

    by Stéphane Wojewoda,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Hi, the link to wordpress (4th link) is a broken one, targetting to a local file

  • Re: Broken link

    by Abel Avram,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Thx. Fixed.

  • Re: Restful API Still written in php

    by Abel Avram,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Yes. The WP-API project is done ~95% in PHP, 4% JavaScript, 1% shell, according to GitHUb. Perhaps they wanted to put the available PHP skill at good use.

  • PHP is there to stay on the server end - Its the user interface that changes

    by Muzzammil Bambot,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Hi Abel,

    Our CTO here at WisdmLabs has analysed the new Calypso Project in detail and also attempted to break it down in terms of architecture to validate the future possibilities and direction WordPress is taking. Could not add all the points here but You could get a better idea of this on our blog post. goo.gl/jmYFUP

  • Re: PHP is there to stay on the server end - Its the user interface that ch

    by Abel Avram,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Very good and balanced post by Arunesh. He kind of continues what I said, looking at what could happen with WordPress Core. And if it goes as he writes, PHP will have little or no role in WordPress.

    Yes, Calypso regards PHP changes on the client not the server. The reason I wrote this news is that it is significant: PHP technologies were not considered fit for responsive design by Automattic. They needed to use something else to go on devices of various screen sizes, and to reuse most of the code written. And JavaScript has the necessary frameworks for that. Although it was a poorly designed language in the beginning, with a different purpose in mind, JavaScript sees a great momentum right now and it is on the edge of being considered a mature language, with tons of development and a strong future. No wonder why they chose it.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT