WordPress now in JavaScript
Using the WP API, Wordpress is no longer written in PHP, but is switching to JavaScript, which allows you to use modern frameworks as an application interface...

Since Wordpress wants to become an application framework (this is claimed by the team), it should abandon PHP in favor of a language that allows the user to better interact with available content.
This does not call into question existing PHP code, at least in the short term, but suggests another way to do the same in a different way. Instead of loading a PHP application (which can probably always be done in the coming years), a JavaScript framework is installed that presents a blog or site in accordance with similar principles, but with different methods.
Using JavaScript code, all exchanges with a database reading or writing are carried out via HTTP GET and POST requests!
Based on the Backbone.js model, based on many frameworks, the new platform also allows you to create plugins and themes using a JavaScript framework.
The WP API is broken down into several sections: post APIs, API users, API versions, etc. They all use the WP Query interface, which executes database queries in the form of JSON descriptions. These requests are automatically implemented by HTML and JavaScript in response to user actions.
End of "loop"
Any page in classic software has the shape of a loop in PHP, for example:
<?php while ( have_posts() ) : the_post() ?>
<h1 class="postitle"><?php the_title(); ?></h1>
<div class="content"><?php the_content(); ?></div>
<div class="postinfo">
Author: <?php the_author(); ?> on <?php the_date(); ?>
</div>
?>
This allows you to view a part or list of articles or titles and summaries.
This is replaced by the WP API with a GET request at the following URL:
/posts?filter[s]="Titre du billet"
or:
/posts/<id>
In response, the system provides a JSON file containing all the elements that make up the site page, which is then converted by the API into HTML code...
When editing a post, the form data is also converted to a JSON file, as below, which will be converted to SQL queries for storing in the database...
{
"title": "Titre du billet",
"content_raw": "Le texte",
"date":"2015-03-0212:00:00+01:00"
}
Goodbye PHP...
The Wordpress team plans to gradually integrate the WP API into the basis of the project, which will eventually replace the current PHP code with a new JavaScript model. This will start with a dashboard that already uses JavaScript, and will eventually only use that language. Displaying content will be an option that allows authors of themes and plugins to adapt them before one day becomes the default method: then Wordpress will become a Drupal-like framework, but without complexity and benefiting from all the new technologies that make the interface dynamic and intuitive.
Updated 23 November 2015
On November 23, the team announced Calypso, a new interface written in JavaScript. Calypso replaces the CMS client side and supports themes and plugins. The server requires Node.js. Replacement is completely optional .
Resources
- WP API. Code on GitHub allows you to access your content, articles, profiles, etc. from the REST API, using the JSON format to communicate with the database.
- Client node. WP API client for Node.js. Allows you to create your own site with WordPress resources, but a clean interface .