Hosted ElasticSearch (2017 edition)

ElasticSearch offers an excellent alternative when you need to implement a better alternative to MySQL FULLTEXT search, with nice features such as related results, facets, “did-you-mean” and many, many options to control exactly what you need to get from it. Unfortunately, as your data grows it also becomes harder to host on your own and… Continue reading Hosted ElasticSearch (2017 edition)

Simple, automated and low cost MySQL backup strategy

Setting up a mysql backup strategy it’s hardly an exciting task, so having a simple solution it’s key to actually get it out of your to-do list. Here’s a simple, automated and low-cost alternative that I use to keep MySQL database backups of small to medium-sized projects. Setting up automatic backups automysqlbackup it’s a simple… Continue reading Simple, automated and low cost MySQL backup strategy

When you’re developing a WordPress plugin, there are certain patterns and practices that are extremely useful to know and apply in order to get a better fit with the platform as a whole.

One of these things it’s what’s the better way to initialize a class on a plugin, which this answer on the WordPress StackExchange covers in great detail, while also explaining other interesting topics and recommendations such as using an autoloader and global access, registry and service locator patterns.

While you’re at it, you might also want to check these posts from Tom McFarlin:

 

Big companies that use PHP

Every now and then there’s still some people who can’t believe PHP can be used for a big, successful project, when actually there are several examples of huge sites using PHP. Here’s how some of them share their experience. Facebook With over 1.49 billion active users, Facebook has been forced into finding creative, out-of-the-box solutions… Continue reading Big companies that use PHP

Pixel Density, Demystified

…or “what you must know about designing for retina display and high-density screens”. Pixel density it’s an often misunderstood subject: some people think that the solution it’s just to design everything at twice the size that they used to, but actually it’s a little simpler and more complicated than that… at the same time. Be sure… Continue reading Pixel Density, Demystified

A Natural Language User Interface is just a User Interface

Conversational bots are one of those things that might seem “magical” at first glance, but on a deeper look you can discover that there’s nothing more than a clever new way of doing things.

Matthew Honnibal proposes we call this kind of technology Linguistic User Interface, by analogy with Graphical User Interfaces, explains clearly and simply how language input it’s not that different from a click, and why the opportunity for taking advantage of this kind of interfaces it’s probably much more narrow than people may think.

Read his full article on: A Natural Language User Interface is just a User Interface

 

Basic Authentication it’s often used as a simple security measure or as a temporary authentication method while developing with certain APIs.

While the WordPress HTTP API doesn’t have explicit support for basic authentication, it’s still possible to use it as a header:

$request = wp_remote_post(
  $remote_api_endpoint,
  array(
    'body'    => array( 'foo' => 'bar' ),
    'headers' => array(
      'Authorization' => 'Basic '. base64_encode( $username .':'. $password )
    )
  )
);

Remember that if you’re sending an unencrypted request, all the headers will be sent in plain text, so you should only use it over HTTPS.

Many people (by which I mean many Windows users”) don’t realize the huge difference between “the Windows way of doing things” and, basically, everyone elses’ way, i.e: the POSIX world which comprises all of the Unices, Linux, BSD and even OS X.

Hugo Landau writes:

From the perspective of POSIX, Windows is “alien technology” […] Windows and POSIX are fundamentally different in many ways, and lead to further “cultural” differences in how software is developed on these platforms. Windows and POSIX, then, are two “cultures”, the technical differences of the core technology itself being only a small part of that.

Read the entire piece at: The Cultural Defeat of Microsoft

Use get_the_terms() instead of wp_get_object_terms()

I was recently debugging the front page of a WordPress site and found a lot of queries to the terms and term relationships database tables. Digging a little deeper, I found that the culprit were a set of functions that were calling wp_get_object_terms() to get the terms from a set of looped posts… and then… Continue reading Use get_the_terms() instead of wp_get_object_terms()