website has a bug

The WordPress function wp_localize_script() is used for making translated strings available to the Javascript side of things. The notice you are seeing is due to one of your plugins using wp_localize_script(), and passing in a non-array as the third parameter. Are you using a “single sign on” plugin? If so, see if temporarily disabling this … Read more

Undefined index: id, when I save the options [closed]

Add var_dump($value); at the beggining of this loop. I’m pretty sure that not all options have id property and it may be some other bug… To get rid of these notices, your code should look like so: foreach ($options as $value) { if ( array_key_exists(‘id’, $value) ) { if (isset($_REQUEST[ $value[‘id’] ] ) ) { … Read more

WordPress not writing error.log

You said you added the code in front of the file. In the wp-config.php I’m working with there’s this line towards the end: define(‘WP_DEBUG’, false); if your config file sets it to true first and then to false the problem could be that the last entry wins.

List $wp_admin_bar menu items (debug)

You can use error_log() and print_r(): add_action( ‘wp_footer’, ‘wpse_debug_toolbar’ ); function wpse_debug_toolbar() { global $wp_admin_bar; error_log( print_r( $wp_admin_bar, true ) ); } Note that when using print_r() we’ve set the second parameter $return to true so that the results are returned and not echo’d.

Undefined constant with debug set to true

You have a lot of issues here. Stay away from defining globals and constants if you can. The global scope is an evil place to be. WordPress has made a huge mess of the global scope already, don’t make it a bigger mess than it already is. You can make use a static variable inside … Read more

What does this message from WP_DEBUG mean?

The log message says “Valid response received” and the response code in the JSON object is 200, which is typically a response for a success request. I think it is not an error. Note that the docs for WP_Community_Events::maybe_log_events_response() says “All responses are logged when debugging, even if they’re not WP_Errors”. I understand that if … Read more

How to define WP_DEBUG as true outside of wp-config.php?

WordPress logic forces WP_DEBUG to be defined to something, even if it’s omitted it will be set to false in wp_initial_constants() during load. However “background” (that is not when it is checked explicitly) function of WP_DEBUG is to be a flag for how PHP error reporting should be configured on runtime. That configuration is performed … Read more