Log WordPress Database Queries

If you want to debug / log WordPress database queries, you have to enable SAVEQUERIES in wp-config.php: After enabling SAVEQUERIES, add this code to your functions.php or a plugin: This method will create a file wp-content/sql.log and log all your database queries there. … Read more

Reset PhpStorm When Using macOS

If you are using macOS and want to reset PhpStorm to its default settings, you can use these commands (run them from a terminal): These commands remove configuration (in Preferences folder), caches (in Caches folder), plugins (in Application Support folder) and logs (in Logs folder). More information can be found here. … Read more

Get Twig Version

If you want to check the used version of Twig, you can enter this line to one of your template files: Another option is to check the file vendor/twig/twig/lib/Twig/Environment.php or vendor/twig/twig/src/Environment.php, depending of the version you use. In one of the two files, a there is a version constant: … Read more

Disable XML-RPC in WordPress

Disable XML-RPC in WordPress WordPress XML-RPC can be used to try several thousands passwords in a short time – great for hackers using brute force attacks. To avoid this, you can disable XML-RPC by adding this line of code to your WordPress installation: This line does not disable XML-RPC completly – but it disables all … Read more