dump() and dd() are two useful debug helpers available in the Laravel framework.
Category: WordPress
Using e() or esc_html_() when translating on WordPress
In a talk at the WordCamp Spain online 2021 Adriá Cobo asked me one interesting question about these 2 functions (e() and esc_html_()):
If everything that is printed must be escaped, what is the point of _e()? Is it a legacy code?
In this post, I try to answer this question.
Documenting GlotPress with phpDocumentor
The current GlotPress API documentation (October 2021) was generated by ApiGen. Last commit was made on April 4th, 2016.
The last ApiGen commit was made on 23 Apr 2018, so I think this tool is deprecated. Furthermore, I was not able to use it with PHP 7.4 and GlotPress, so I look for another tool. The most PHP used tool is phpDocumentor. In this post I explain how to use it with GlotPress.
Install phpDocumentor globally on the machine, using the .phar tool.
cd ~/code/utils mkdir phpDocumentor cd phpDocumentor
Get the last .phar URL.
wget https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.1.2/phpDocumentor.phar
To run phpDocumentor, execute:
php phpDocumentor.phar run \ -d ~/code/wordpress/glotpress-env/glotpress.git \ -t ~/code/wordpress/glotpress-env/gp-docs \ --ignore "vendor/"
Where:
~/code/wordpress/glotpress-env/glotpress.git
is the GlotPress folder.~/code/wordpress/glotpress-env/gp-docs
is the documentation folder.vendor/
is the folder where Composer stores all the information. It is located in the root folder of the project.
Installing wordpress-develop on M1 chip
I have had some problems installing wordpress-develop on the M1 chip, so I describe here how I have solved it.
Install a WordPress development environment with Laravel Valet
Laravel Valet is a development environment for macOS minimalists. It was developed to use in Laravel projects, but in this post, I will explain how to install and use with WordPress.
Ten un plan de contingencia por si un apocalipsis zombi destruye tu WordPress
En el siguiente enlace (PDF, español) dejo las transparencias de la presentación «Ten un plan de contingencia por si un apocalipsis zombi destruye tu WordPress» de la WordCamp Zaragoza 2020, celebrada en Granada el 17 de enero del 2020.
Automatizando tu comercio electrónico: WooCommerce desde la CLI
En el siguiente enlace (PDF, 7,83 MB, español) dejo las transparencias de la presentación «Automatizando tu comercio electrónico: WooCommerce desde la CLI» de la WordCamp Granada 2019, celebrada en Granada el 30 de noviembre del 2019.
How to setup a master-master replication system between two MySQL servers
In this post, I will go to explain how to set up a master-master replication system between two MySQL to replicate an existing database.
The MySQL master-master configuration is a master-slave configuration in both directions and allows us to get a high availability configuration because you have the same data in both servers and if one goes down you can still work with the live server.
Pon un task runner en tu vida para automatizar tu flujo de trabajo
En el siguiente enlace (PDF, 9,5 MB, español) dejo las transparencias da presentación «Pon un task runner en tu vida para automatizar tu flujo de trabajo» de la WordCamp València 2019 del 19 de octubre del 2019.
Update the own URL when you add an SSL certificate in WordPress with the WP-CLI
When you add an SSL certificate to a WordPress site, you have to update all the own references on the website, changing the ‘http’ string to ‘https’.
In this post I will explain how to do it with the ‘search-replace‘ subcommand of WP-CLI.