new self() vs new static() in PHP

What’s the difference between new self() and new static() in PHP? Or is it the same? It is not the same. self refers the class in which the new keyword is actually written. static refers to the class in the hierarchy, where the method has been called. Look at the following example: … Read more

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