Skip to content

Instantly share code, notes, and snippets.

View charlesbatista's full-sized avatar

Charles Batista charlesbatista

View GitHub Profile
@charlesbatista
charlesbatista / gist:1c3443a1e80c61dc7325cb8e2a117d9c
Created August 11, 2023 17:08
How to prevent WordPress from logging DEPRECATED errros on debug.log
1. Open the "load.php" file on "wp-includes" directory.
2. Find the line 572 and change:
From: error_reporting(E_ALL);
To: error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT);
3. If the WordPress is updated in the future, you must to change the line again.
@charlesbatista
charlesbatista / gist:9229d985b7bd89971a7356a6eac65e29
Created March 7, 2023 17:28
Como instalar WP-CLI no Windows
1. Baixe o arquivo pelo link: https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
2. Mova o arquivo para C:/wp-cli ou C:/xampp/wp-cli, como preferir.
3. Crie um arquivo chamado wp.bat e insira o conteúdo:
@ECHO OFF
php "c:/xampp/wp-cli/wp-cli.phar" %*
- Lembre-se de alterar o caminho logo acima para o diretório do arquivo .phar que baixou.
4. Well done!
@charlesbatista
charlesbatista / import-sql-files-command-line.txt
Last active February 14, 2023 20:13
How to import SQL files using command line
We're using MySQL database and XAMPP as our web server. In this case, I'm using Windows 11.
If you are struggling on importing big files to your database and you are getting any messages related to time of execution exceed or memory limit was reached,
try to use MySQL command line to help you get through it.
First of all, go to you mysql bin folder. In my case, it is:
- c:\xampp\mysql\bin.
And then you type:
- mysql.exe -u root -p database_name < C:\path_to_file\my_database.sql.