Eugenio Petullà has a strong experience with WordPress and PHP. We interviewed him to learn more about WordPress REST APIs.
Hello Eugenio, we know you are a fan of Codemotion, but what can you tell us about yourself?
I started my career in the tech industry when I was in secondary school, because I was part of the only Linux User Group in the area. I’m from Ostia, near Rome. At university I did maths, not pure computer science. Since then I’ve always followed my passion for Open Source. I learned to program looking at other people’s code. Technically, I’m now a “sufferer” of Open Source, in fact I collaborate with various communities. I’m a contributor for WordPress, I’m a tech speaker for Mozilla and I go around spreading information. At the moment I’m a co-organiser for both the WordPress Roma meetup and for Workcamp Roma. Plus I’m a very active member of the Italian and international WordPress communities. My role is mainly for work reasons, because at work we’re an agency specialising in WordPress development (we don’t make websites, but we develop technologies that interface on the PHP client and web development sides). This has led to us knowing the product from the inside and getting involved with the community.
When it comes to programming languages, which ones do you use on a daily basis?
I really enjoy saying that I pay the bills with PHP, I pay the bills and I have a lot of fun with JavaScript and everything else I’m very curious about. I also enjoy programming at a lower level and, coming from C and compiled languages, I recently discovered a fondness for Rust, which is a very new language adopted by Mozilla. I’m programming in Rust a lot in my free time. But basically I pay the bills with web technologies while I have fun with robots and all the rest of it in my free time.
How did you end up in the tech industry? Was it your choice or did it happen by chance?
I’m my own boss, I have a company with my partners. All three of us met in the community and we chose to give up our former lives to pursue our dream. It was a choice and we’re happy. I started off in computer science while I was studying, and I was a systems engineer, which is the first job you can do when you have a passion for computer science. I got to know Linux and networks very well. From there, the passion for programming also led me to work for other people, then I discovered that working for other people was less fun than choosing the jobs and technologies you’re passionate about and which you can work on, or the communities you collaborate with, so we’ve got our company off to a good start. Not on an economic level, but regarding free time and the things you can do when you can choose your clients.
We decided in the company to spend 50% of the time on work projects and 50% of the time on personal projects of any kind, whether they’re contributions to Open Source, which are “Sunday projects”, or simply random generators to make your friends laugh. It’s a choice of lifestyle and philosophy.
How do you keep yourself up-to-date? What do you follow to enhance your learning, on the personal side as well as at work?
As a tech speaker, I do a lot of conferences and manage to go round and get to know people, which is always the best medium for information and curiosity. The internet is very big, there’s everything these days and yet it’s still difficult to find a project to get excited about, or a language, a technology or simply a thread to follow. Before falling in love with the idea itself I prefer to experience it first-hand and so conferences are the best places to do that because, as Linus Torvalds says, “show me the code, talk is cheap”. I’ve always liked it as a philosophy: “all very enjoyable but show me what you can really do, how to exceed your limits”. The live meetings certainly offer all this, and that’s the reason why I founded a community and I attended several others, because they’re a great source of enrichment. Then, of course, sources like Hacker News, Ycombinator’s blogs. I have to be honest, few social networks. I’m completely abandoning the idea of entrusting my training and curiosity to social networks because it’s increasingly degrading, the groups are less and less interesting, they’re increasingly becoming requests for help. I’m going back to the basement here.
As well as being a frequent attendee of talks, you’ve given several yourself, and in particular one in the WordPress Roma community that was dedicated to the use of REST APIs in WordPress.
We saw how to enable and make the most of the REST APIs that by now are part of WordPress’s core, even if few know it and they’re almost always developers. A little bit in order to make it known that with REST technology we can rejuvenate all the development practices on WordPress and use it as a real back-end framework, and then delegate all the rest to the front-end. This isn’t the only advantage: we’ve seen how you can enable lots of nice little features that are not present in the core of WordPress but can be used with very few lines of code or with some trick. For example I showed how to do the authentication with the MAC Address inside WordPress, then associating a physical device (a bit like Google does with Gmail). This new possibility opens up many other tricks that I showed, for example to allow third-party sites to comfortably embed your posts. We’ve analysed how to make the most of this technology from the point of view of those who develop, to equip themselves with increasingly modern tools so as not always to be tied to the usual concepts of WordPress, which never evolves, but also to show what it’s like from the other side, from the point of view of users, bringing news regarding the platform’s usability and security, aspects most people ignore.
Is this technology only for developers? Or also for simple WordPress users?
The technology is already there even if you’re a simple WordPress user. It’s one of those types of transparent technology in the sense that you don’t see it directly if you’re a simple user, but if you’re a developer you can interface with it by exploiting its potential. It’s the two sides of WordPress: it’s not like Laravel, Symphony or generic frameworks that only give you the programmable part, the block functions on which to build the final product. WordPress is already a product which also provides you with the blocks to customise it. In this case the REST APIs are simply an additional block added to WordPress that opens up many features. Making the user aware of what they are used for is good as well, because it makes them discover other ways to implement their platform. It’s the future of the platform, even if it’s already possible to use it in this way.
In your opinion, what should we expect in the near future? Some kind of evolution in these technologies?
I hope so. Definitely, in fact I’m sure of it! Because the new WordPress editor is about to arrive, version 5 of the new CMS will be a graphic editor similar to Medium and will be based on the REST APIs, managing to immediately cover 90% of the functionality that the old editor had. The 10% it doesn’t cover is due to the fact that it’s missing some REST APIs which will be added to the Core. So, yeah! In the future there’ll just be more and more. You start to see sites made in WordPress but in reality WordPress isn’t there: it’s placed somewhere else and used only as a database and as a form for entering data. Everything else, however, is instead delegated to a custom front-end made entirely in JavaScript, that takes pieces from the REST APIs. The road is still long and holds many surprises for the use of this technology.
Let’s come back to your talk for a sec. Why did you decide to talk about this specific matter?
Everything started with many events explaining how you could interface REST APIs using a very simple front-end side framework which I usually work with (it’s called Vue.js) and make small headless applications. I observed how many people were open-mouthed when they discovered that they could transfer data from WordPress without using it, simply by making a request to an endpoint. So I started asking, “Do they really still not know that all this exists? Maybe it’s a case of showing it live and that it’s possible even without having to program?”. You could potentiality use ad-hoc plugins, such as those for login. There are already plugins to do the physical authentication: all in a transparent way through REST APIs. So it wasn’t a request but rather a necessity.
Do you think you’ll prepare other presentations or talks dedicated to this topic?
Yes, I already take around a lot of even more specific talks on this topic for programmers, because I’m working a lot with the front-end frameworks using WordPress as a back-end, what with my work as a WordPress Customer Expert. I’ve created 200 examples which I speak about in the different talks. In the future, I will focus on more targeted aspects of REST APIs. Soon I’ll show how to work with CMS authentication and build a client for Android that connects to any WordPress. I really like the subject.
Last but not least, do you have any advice that you would like to give to future developers?
One piece of advice I can give is to always be curious! This is the driving force of our work. Don’t fixate on the idea of having studied a technology and stopping there. Soon it will be obsolete. In this field there’s always the search for the new, the technology that’s just come out, and they’re very fun things. Learning new things is always beautiful. Yet WordPress is 15 years old and sometimes I’m ashamed to say that I’m a WordPress programmer, because I’m inexorably associated with people who make websites or showcases for work simply by installing the CMS. Remember, the difference is always the approach. A programmer, a hacker or a curious person should know that very well. So I’d advise you to stay curious and be innovative and curious enough to be able to apply new concepts, new techniques and new technologies, even to solid and backward compatible projects such as WordPress. The fun part of this job is just this: it lets you create new things from scratch!