problem with size of debug.log file

debug.log is exactly what it sounds – it’s just a file that contains log information for debugging purposes. You can easily delete it and without any fear. But… Debugging should not be turned on on production site – it’s a security problem. If your debug.log file is so big, then your site has many problems. … Read more

How to display SQL query that ran in WC_Order_Query?

WC_Order_Query does not store a record of the SQL it generated, or the WP_Query that it used internally. So it’s not possible to get the information you need from WC_Order_Query directly. You could try using $wpdb->last_query immediately after using the class or function, but the last query more than likely isn’t the one you’re actually … Read more

Debug Errors, site health

You should be looking for the wp-config.php file in the root of your WordPress installation. From the documentation in the WP_Debug Section WP_DEBUG is a PHP constant (a permanent global variable) that can be used to trigger the “debug” mode throughout WordPress. It is assumed to be false by default and is usually set to … Read more

Best location for a debugging script

Maybe as a must-use plugin? From docs, Always-on, no need to enable via admin and users cannot disable by accident. Can be enabled simply by uploading file to the mu-plugins directory, without having to log-in. Loaded by PHP, in alphabetical order, before normal plugins, meaning API hooks added in an mu-plugin apply to all other … Read more

Unable to get a simple plugin admin page to work

Well, as it usually goes, after banging my head on this for hours yesterday and then finally deciding to ask for help, I was able to solve it within a few minutes. Here is what I needed to change: public function init() { // add_action(‘admin_menu’, array($this, ‘add_plugin_admin_menu’)); $this-> add_plugin_admin_menu(); } Clearly, I have much to … Read more