Tag: WordPress
-
Registering custom URLs with custom templates in WordPress (without using page templates)
It’s fairly common to find yourself on a situation where you want to use a specific URL to show a custom content (perhaps something an archive page with two different custom post types), and think: “well, that’s easy. I’ll just create a page to register the URL and a custom page template where I’ll query…
-
Mitigating CVE-2018-6389 WordPress DoS attack with lighttpd
Early in 2018, Barak Tawily published a possible DoS attack for WordPress, that basically works by requesting all possible scripts on the /wp-admin/load-scripts.php, a script that fetches and concatenates javascript files — there’s also a load-styles.php file that does the same for styles. His vulnerability report was rejected by the WordPress team, on the account…
-
Filtering active menu element class on WordPress
When using a navigation menu on WordPress, you’ve probably seen the various HTML classes that are added on active elements, such as current-menu-item, current-menu-parent, current-menu-ancestor… While that kind of classes are fine if you must fully reflect the navigation hierarchy on the menu element, there are some times that you just need a more simple…
-
Best way to initialize a class on a WordPress plugin
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…
-
John Maeda and the Open Web
Design superhero John Maeda is now working at Automattic as Global Head, Computational Design and Inclusion because he believes in the open web… The fact that so many people are commenting about it on Facebook, just proves how hard his new mission is… And how easy is to just not “get” why it’s so important.
-
Using Basic Authentication with the WordPress HTTP API
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: Remember that if you’re sending an unencrypted request, all the headers will be…
-
Using OAuth2 to make authenticated calls to WP REST API
This will probably come in handy on a few weeks, so I better save this for later…
-
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…
-
Unified search with Elasticsearch and WordPress
During the last months of 2012, and as a part of AyerViernes, we worked on one of those projects that is as challenging as delightful to take part in, developing a unified search system for a network of over 200 WordPress sites (both single-install and multisite). We developed a real-time sync plugin integrating the WordPress…
-
Importar tu base de datos de WordPress (de la forma más rápida)
Uno de los grandes aprendizajes que he podido aplicar al desarrollo de sitios con WordPress, y del cual soy particularmente entusiasta de sermonear es la necesidad de mantener una versión local de desarrollo lo más parecida posible a lo que vas a utilizar en producción, lo que además se apoya y soporta un montón de…