Incorrect dependencies on wp_enqueue_script()
-
Hello,
We have tracked the source of this bug down to your plugin …
[10-Mar-2025 10:12:59 UTC] E_USER_NOTICE: Function wp_enqueue_script() was called incorrectly. “wp-editor” script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see Debugging in WordPress for more information. (This message was added in version 5.8.0.) in /wp-includes/functions.php on line 6114
On line 91 your plugin uses
wp_enqueue_script()
to register the script but nominateswp-editor
as a dependency …
add_action('init', 'block_logic_set_script_translations');
function block_logic_enqueue_block_editor_assets()
{
if (is_admin()) {
// Enqueue our script
wp_enqueue_script(
'block-logic',
esc_url(plugins_url('/build/js/block-logic.js', __FILE__)),
['wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor'],
'1.0.8',
false // Do not enqueue the script in the footer.
);
wp_enqueue_style(
'block-logic',
esc_url(plugins_url('/build/css/block-logic.css', __FILE__)),
);
}
}… when it should instead designate
wp-block-editor
. You may also need to update/build/js/block-logic.js
accordingly.When updating your plugin to be compatible with WordPress v5.8 and higher, would you please test against WordPress v6.9.2 and update the “tested-up-to” attribute of your readme.txt so that the WordPress plugin repository stops warning that your plugin “hasn’t been tested with the latest 3 major releases of WordPress” which makes your plugin very difficult for users to find and install as such plugins are shown last in “Dashboard – Plugins – Add new plugin”.
Thank you,
Oliver
- You must be logged in to reply to this topic.