Articles of debug

Intercepting WP_MAIL to view contents

I’m looking for a way to hook into the mail function before it sends so I can var_dump the output. Are there any action hooks with the mail message that I can hook into? I’m having trouble finding the wp_mail function in core. Any other methods of debugging mail output would be greatly appreciated as […]

Why do plugins that cause 'unexpected output' create AJAX problems?

I just had to fix an AJAX failure in the admin area (the search/attach dialog box in the Media Library wasn’t working) and tracked down a plugin that was the culprit. On activation, this plugin was generating ‘unexpected output’ (it had a space after the final php tag). Removing this solved the problem. Why was […]

Huge amount of queries on my site

My site is reaching CPU limits all the time, I just ran Debug Queries and got more than 4000 queries, no wonder site is slow.

How to debug a unit test for a WordPress plugin, which uses wordpress-test?

I’m attempting to debug a unit test for a WordPress plugin. The unit test uses wordpress-test (and PHPUnit). However, wordpress-test: calls system(php …) the new external PHP process attempts to connect to the same debugger, but the debugger is already busy so both PHP processes hang. — How can I prevent this? Details / clarifications: […]

WordPress Ajax Problems

Update I got it to fire using the following curl command: curl -H “Accept: application/json” -X POST http://localhost/wordpress/wp-admin/admin-ajax.php -d “action=vixo_wordpress_signon&data=banjometer” –trace – Not really sure how to work out to get it to accept json, but hey… Original Question I am new to WordPress and I am having problems getting Ajax to work – but […]

Theme Check: Could not find post_class

I’ve inherited a theme from a another developer that I’ve re-styled for a client. We’re just about finished, but I thought I’d run it through the Theme-Check plug-in to see if there’s any errors or problems. Unfortunately there’s a ton. I’ve gotten rid of most of them, but I have one Required left: REQUIRED: Could […]

Unhook jQuery from WooCommerce via `functions.php`?

So I am using the plugin for eCommerce and it’s registering jQuery local and conflicting with my default jQuery call from Google CDN. It took a long time but I isolated the issue to the following lines of code within woocommerce.php: $suffix = defined(‘SCRIPT_DEBUG’) && SCRIPT_DEBUG ? ” : ‘.min’; $lightbox_en = (get_option(‘woocommerce_enable_lightbox’)==’yes’) ? […]

How to debug a blank page?

I’m not being able to load this page, although I can easily load all other posts that load the same custom post type template (please look for “// From now on, WP is throwing a blank page” on that template to pin point where exactly this situation occurs). When turning debugging on, I only get: […]

The plugin generated xx characters of unexpected output. How to solve?

I get the following message when I activate the plugin `The plugin generated 655 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.’ How can I debug this? I have turned WP_DEBUG on. Any solutions? <?php /* Plugin […]

Debugging with functions.php

I’m trying to check the output of a variable in my functions.php file that runs after a new woocommerce order. The code will get the order time from a new order and store it in a variable for me to use elsewhere the code being: $meeting_time = wc_get_order_item_meta($order_id, ‘Time’); print_r($meeting_time); I’ve tried a few ways […]