Articles of wp debug

what are WP_DEBUG conditions?

i’m trying to debug my theme using below code to find out some errors,do i need to fix all errors or is it OK when i ignore some of them? error_reporting(E_ALL); ini_set(‘display_errors’, 1); define( ‘WP_DEBUG’, true);

Prevent wp_debug from polluting ajax within plugin

I’ve ran into an issue here where wp_debug notices foul up my ajax response. The codex suggests using ob_clean just before returning or echoing: To parse AJAX, WordPress must be reloaded through the admin-ajax.php script, which means that any PHP errors encountered in the initial page load will also be present in the AJAX parsing. […]

How to debug vars inside function at functions.php file?

I have this function: function wpse_210493_apply_advertising_position( &$posts, $return = false ) { $ad_posts = array(); $content_posts = array_filter( $posts, function ( $post ) { $position = get_post_meta( $post->ID, ‘rw_adversiting_position’, true ); if ( empty( $position ) ) { return true; } $ad_posts[ intval( $position ) ] = $post; return false; } ); $content_posts = array_values( […]

WordPress debug messages not displaying

WordPress is not displaying any errors / debug messages, even though I double- and triple-checked every setting. In php.ini, I have error_reporting = E_ALL & ~E_NOTICE display_errors = On display_startup_errors = On log_errors = On track_errors = On In wp-config.php, I have: define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’, true); @ini_set(‘display_errors’, 1); error_reporting(E_ALL^E_NOTICE); Still, no errors are […]

White screen on front page only

I’ve got the famous white screen, but only on my home page. Deeper pages load just fine. I moved my themes directory to themes-old and made a new themes directory that only has twentyten in it. I changed my theme to twenty ten. I don’t have any plugins enabled, but I moved my plugins directory […]

Getting a WordPress Debug Strategy

I have been reading up on debugging. I watched Chip Bennett’s video on and was inspired to take debugging seriously. What I have found in my reading up though has confused me a bit. I know about define( ‘WP_DEBUG’, true ); and some of the debug plugins like ‘debug bar’ and ‘firephp‘ and also […]

How to debug 'Notice: Undefined index' on a Request

I use the next code in order to save the options of my theme (by using the Wp Settings API), but when I debug it, I get the ‘Notice: Undefined index: action’ error/notification. In order to fix it, I added “isset()” before the first $_REQUEST. Now the notification is not apperaring, but the options are […]

Undefined index: id, when I save the options

I’m making a WordPress theme and I get these ‘Notices’ repeated a lot of times when I save the options using the WP_DEBUG: Notice: Undefined index: id in /var/www/Seozeta/wp-content/themes/seozeta/seozeta-options.php on line 997 Notice: Undefined index: id in /var/www/Seozeta/wp-content/themes/seozeta/seozeta-options.php on line 1000 The code is this: foreach ($options as $value) { if (isset($_REQUEST[ $value[‘id’] ] ) […]

Why does WP_DEBUG only work after wp_debug_mode() is called?

With debugging set to on, define(‘WP_DEBUG’, true); my instance of WordPress doesn’t show any debugging info. After a lot of searching I figured that after I call wp_debug_mode() debug info shows correctly. Can anyone tell me why calling wp_debug_mode() is necessary, since the debugging documentation page doesn’t even mention this function? Is there something in […]

Using debug log in production, is that a security concern?

Is having the WP_DEBUG_LOG enabled, and having a debug.log in a production environment a security issue?