I have this error notice ‘wp_enqueue_script was called incorrectly’ in my plugin
Removing wp_enqueue_script(‘jquery’); will fix your problem. Put jquery into deps parameter of wp_enqueue_script function.
Removing wp_enqueue_script(‘jquery’); will fix your problem. Put jquery into deps parameter of wp_enqueue_script function.
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
You have several tools at your disposal when working with native WordPress debugging. PHP Debugging – WP_DEBUG is the native WordPress PHP constant for debugging WordPress errors. It sets PHP’s error reporting to to E_ALL for warnings when deprecated functions are used and if none are found it sets it to E_ALL ^ E_NOTICE ^ … Read more
A little bit of simple debugging and everything is clear. $REQUEST[‘action’] is set in this case, so my first guess wasn’t true, but… Its value is ‘save’ and not ‘page’ nor ‘reset’. So your code does exactly nothing, because there is no if part for such value;
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
Just take a look at its source: function wp_debug_mode() { if ( WP_DEBUG ) { error_reporting( E_ALL ); if ( WP_DEBUG_DISPLAY ) ini_set( ‘display_errors’, 1 ); elseif ( null !== WP_DEBUG_DISPLAY ) ini_set( ‘display_errors’, 0 ); if ( WP_DEBUG_LOG ) { ini_set( ‘log_errors’, 1 ); ini_set( ‘error_log’, WP_CONTENT_DIR . ‘/debug.log’ ); } } else { … Read more
The problem was caused by a plugin (wp-spamfree), which simply set error_reporting(0). So if anyone has the same problem, my advice is to search your whole wp-content/plugins directory for words like error_reporting, display_errors and similar to find out if any of your plugins tamper with these settings. You can either disable these plugins, or fix … Read more
You could, but you wouldn’t be able to debug anything that happens before the theme is loaded. This includes most of WordPress loading and all plugins loading. You need to put it in ‘wp-config.php` so that it’s set before anything happens. Also, global debugging is not something themes should control. It’s not appropriate, even if … Read more
You could add following code (if not done already) in wp-config.php (please make a backup first of this file): define(‘WP_DEBUG’, true); define( ‘WP_DEBUG_LOG’, true ); define( ‘WP_DEBUG_DISPLAY’, false ); This way debug is activated but the results (if have errors/notices) will not be shown but will be saved in a logfile which you can find … Read more
To make sure that the index.php will be loaded first add the following line to your .htaccess: DirectoryIndex index.php index.html This tells Apache to ignore an index.html if an index.php exists.