Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automating WordPress for Fun and Profit - WordC...

Automating WordPress for Fun and Profit - WordCamp NL 2022

This presentation is about how to automate WordPress using the REST and GraphQL API’s. There are quite a lot of plugins to help you automate WordPress, plugins however come at a performance cost, might fail and they need to be regularly updated.

WordPress REST and GraphQL API’s make it easy to automate all sorts of tasks, while handling errors gracefully without needing to resort to using any plugins.

In this talk we will look at how you can use the WordPress REST and GraphQL API’s to create all sorts of automations, uptime monitoring, image generation, database cleanup, backups, updates, ….

We will have a look at different no-code, low-code tools to help you setup automations, Zapier, Github Actions, Pipedream, Cronhooks, CloudFlare Workers etc.

URL: https://netherlands.wordcamp.org/2022/

---
Info about DOCman for WordPress: https://www.joomlatools.com/wordpress

Johan Janssens

September 15, 2022
Tweet

More Decks by Johan Janssens

Other Decks in Programming

Transcript

  1. The HTMLolithic era In the beginning, let’s call it the

    HTMLolithic era, if you wanted to publish on the internet you had no choice but to learn HTML, and produce a static HTML page that you could link to by its Unique Resource Location (URL).
  2. 1 The first web page went live on August 6,

    1991. It was dedicated to information on the World Wide Web project and was made by Tim Berners-Lee. It ran on a NeXT computer at the European Organization for Nuclear Research, CERN. The first web page address was http://info.cern.ch/hypertext/WWW/ TheProject.html.
  3. 3 The Hypertext Markup Language (HTML) is a simple markup

    language used to create hypertext documents that are platform independent. HTML documents are SGML documents with generic semantics that are appropriate for representing information from a wide range of domains. 
 
 HTML markup can represent hypertext news, mail, documentation, and hypermedia; menus of options; database query results; simple structured documents with in-lined graphics; and hypertext views of existing bodies of information. From: https://www.w3.org/MarkUp/html-spec/
  4. 4 HTML 2.0 included everything from the original 1.0 specifications

    but added a few new features to the mix. » HTML 2.0 was the standard for website design until January 1997 and defined many core HTML features for the first time. For more history: https://www.yourhtmlsource.com/starthere/historyofhtml.html
  5. The Dynamolithic era In evolutionary terms, the next step for

    web publishing didn’t take too long. In the Dynamolithic era, instead of a single fl at fi le to build and display a page, pages were split up into re-useable blocks and could be coupled to a database. This made the task of publishing articles a lot easier as the developer could build multiple pages whilst reusing code for common areas like headers and footers, as well as import data that was held in a database, in order to display an HTML page.
  6. 5 PHP development began in 1994 when Rasmus Lerdorf wrote

    several Common Gateway Interface (CGI) programs in C, which he used to maintain his personal homepage. He extended them to work with web forms and to communicate with databases, and called this implementation "Personal Home Page/ Forms Interpreter" or PHP/FI. 
 
 PHP/FI could be used to build simple, dynamic web applications. To accelerate bug reporting and improve the code, Lerdorf initially announced the release of PHP/FI as "Personal Home Page Tools (PHP Tools) version 1.0”.
  7. 6 Early PHP was not intended to be a new

    programming language, and grew organically, with Lerdorf noting in retrospect: "I don't know how to stop it, there was never any intent to write a programming language [...] I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way." A development team began to form and, after months of work and beta testing, officially released PHP/FI 2 in November 1997.
  8. 7 Zeev Suraski and Andi Gutmans rewrote the parser in

    1997 and formed the base of PHP 3, changing the language's name to the recursive acronym PHP: Hypertext Preprocessor Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. They then started a new rewrite of PHP's core, producing the Zend Engine in 1999 They also founded Zend Technologies in Ramat Gan, Israel. On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released.
  9. The Webpubolithic era Once the permanency of the internet had

    been established, individuals and businesses all over the world were clamouring to get a website online. This led to the natural evolution of web publishing systems that would allow non-developers to write and publish articles to a website. Like their ancestors in the dynamolithic, web publishing systems could be connected to a database in order to provide dynamic content to an otherwise static HTML page.
  10. 9 WordPress was released on May 27, 2003, by its

    founders, American developer Matt Mullenweg and English developer Mike Little, as a fork of b2/cafelog. The software is released under the GPLv2 (or later) license. 
 
 “WordPress is a factory that makes webpages” is a core analogy designed to clarify the functions of WordPress: it stores content and enables a user to create and publish webpages, requiring nothing beyond a domain and a hosting service. WordPress has a web template system using a template processor. Its architecture is a front controller, routing all requests for non-static URIs to a single PHP file which parses the URI and identifies the target page. This allows support for more human- readable permalinks. From: https://wpshout.com/courses/learn-wordpress-development-the-basic-course/ wordpress-is-a-factory/
  11. The Automatolithic era In the automatolithic era, which we are

    living in today, the number of WordPress websites on the internet multiplied exponentially, more than 40% of the internet now runs on it. Web technology has also evolved exponentially, websites are no longer silo’s of data but need to interact and integrate with other systems. This is creating new challenges to ensure WordPress sites can be kept maintained and can be connected with third party services.
  12. 11

  13. 13

  14. 14

  15. 15

  16. 3 OpenSwoole is a CLI PHP extension that allows you

    to build high-performance, async multi-tasking webservices and applications using an easy to use Coroutine API. Compared with other async programming frameworks or software such as Node.js, Go, Python, ... OpenSwoole is a complete async solution that has built-in support for async programming via coroutines. It offers a range of multi-threaded I/O modules (HTTP Server, WebSockets, TaskWorkers, Process Pools) out of the box and support for popular PHP clients like PDO for MySQL, and CURL. You can find more info at https://openswoole.com