
WordPress Plugin Development: Talking to APIs - jdemler
https://www.curry-software.com/en/blog/wordpress_plugin_development-talking_to_apis/
======
news_to_me
This is a really useful and informative writeup.

However, to me it just highlights a lot of things that Wordpress/PHP is bad
at. For one, no mention of testing here (or really hardly anywhere in PHP-
land), although keeping the API logic in a separate class is a good idea.

Also, the flexibility/ease of use tradeoff going from wp_remote_get and
friends is terrible. It's so frustrating that PHP doesn't have a better
general networking solution than "idk, just fork to curl". The Guzzle library
helps a lot here, but I don't see a lot of the PHP/WP community embracing it
much.

With the current plethora of widely-supported Web development frameworks, I
really don't see any reason to use PHP or Wordpress for new projects.

~~~
pagnol
> For one, no mention of testing here (or really hardly anywhere in PHP-land),
> [...]

In a different life I had to maintain a website based on the Drupal CMS and
also one based on the then-popular Laravel PHP framework, and in both
environments testing was common and well-supported. As much as I dislike PHP,
such a blanket statement does not hold up.

~~~
busterarm
Behat is easily one of my favorite test frameworks and PHP, at least since
5.6, is somewhat of a sensible language now.

If you have to build the kind of site that needs to do the things that
WordPress does, it's a great choice.

PHP, unfortunately, is never going to get away from the reputation that it
earned and some of the choices it's stuck with, but it's a perfectly adequate
language to develop web software with and the tooling these days is pretty
good.

It's not my choice to use, but I'm happy to use it in a modern context.

------
poxrud
With the upcoming gutenberg editor release there will be a lot of changes to
the way plugins are written. Expect to see a lot of server side code to be
moved to client side (where possible) with react.

