Support » Plugin: SiteOrigin Widgets Bundle » PHP Notices on WP 5.9

  • Resolved htrex

    (@htrex)


    I’m seeing a couple of PHP Notices on wp backend post edit screens.

    Notice: wp_enqueue_script() was called <strong>incorrectly</strong>. "wp-editor" script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets).

    Notice: wp_enqueue_style() was called <strong>incorrectly</strong>. "wp-edit-post" style should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets).

    They disappear when so-widgets-bundle is deactivated.

    WP 5.9
    Page Builder by SiteOrigin 2.16.2
    SiteOrigin Widgets Bundle 1.29.2

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Andrew Misplon

    (@misplon)

    Hi, thanks for getting in touch.

    I’m having trouble replicating the notices at the moment. Please, could you check for a working baseline? The test should take a minute or two. Does the issue persist with a default theme like Twenty Nineteen temporarily activated and all plugins except for the Widgets Bundle temporarily deactivated?

    Thanks again.

    Andrew

    Thread Starter htrex

    (@htrex)

    Hi Andrew,
    yes, I can confirm the issue with every plugin deactivated except the Widgets Bundle and Twenty TwentyTwo theme.

    This is the call stack as printed by xdebug:

    ( ! ) Notice: wp_enqueue_script() was called <strong>incorrectly</strong>. "wp-editor" script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.8.0.) in /var/www/html/wp-includes/functions.php on line 5768
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0001	372456	{main}( )	.../post.php:0
    2	0.0648	4208544	require( '/var/www/html/wp-admin/edit-form-blocks.php' )	.../post.php:187
    3	0.2502	7396024	require_once( '/var/www/html/wp-admin/admin-header.php' )	.../edit-form-blocks.php:303
    4	0.2701	7667856	do_action( )	.../admin-header.php:163
    5	0.2701	7668232	WP_Hook->do_action( )	.../plugin.php:474
    6	0.2701	7668232	WP_Hook->apply_filters( )	.../class-wp-hook.php:331
    7	0.2701	7669360	wp_check_widget_editor_deps( )	.../class-wp-hook.php:307
    8	0.2701	7669680	_doing_it_wrong( )	.../widgets.php:2090
    9	0.2701	7670512	trigger_error ( )	.../functions.php:5768
    
    ( ! ) Notice: wp_enqueue_style() was called <strong>incorrectly</strong>. "wp-edit-post" style should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.8.0.) in /var/www/html/wp-includes/functions.php on line 5768
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0001	372456	{main}( )	.../post.php:0
    2	0.0648	4208544	require( '/var/www/html/wp-admin/edit-form-blocks.php' )	.../post.php:187
    3	0.2502	7396024	require_once( '/var/www/html/wp-admin/admin-header.php' )	.../edit-form-blocks.php:303
    4	0.2701	7667856	do_action( )	.../admin-header.php:163
    5	0.2701	7668232	WP_Hook->do_action( )	.../plugin.php:474
    6	0.2701	7668232	WP_Hook->apply_filters( )	.../class-wp-hook.php:331
    7	0.2701	7669360	wp_check_widget_editor_deps( )	.../class-wp-hook.php:307
    8	0.2703	7669680	_doing_it_wrong( )	.../widgets.php:2103
    9	0.2703	7670512	trigger_error ( )	.../functions.php:5768
    Plugin Author Andrew Misplon

    (@misplon)

    Thanks for trying.

    If you’d like to remove the notices from your WP admin you could perhaps check that WP_DEBUG is set to false in your wp-config.php file.

    Is there a particular page the notices appear on? Any steps we can take to reproduce?

    Thread Starter htrex

    (@htrex)

    Yes Andrew, those are just notices, sure they’ll go away with WP_DEBUG set to false.
    It’s just that I’m developing a new website, I need debug to be on and they appear on every post edit screen as soon as I create a new post or edit an old one.

    Something particular about my setup is that the only feature I use is the fantastic post loop widget included with Siteorigin Builder and enhanced by the Widget bundle. I don’t understand why the query feature of the post loop is only available installing the Widgets bundle, anyway, I’ve disabled all it’s widgets from it’s settings page, and I’ve also deselected all post types from Siteorigin Page builder settings page.

    The only reasonable clue I can give you is that temporarily commenting row 33 on so-widgets-bundle/compat/block-editor/widget-block.php fixes the notices.

    Hope this helps.

    Plugin Contributor alexgso

    (@alexgso)

    Hi htrex,

    Thanks. I’ve had a look at the flagged line and I’ve noticed an issue. I’ve submitted a fix to the rest of the team and created a patch. You can download the patched version by clicking here.

    Before proceeding, do a backup.

    Navigate to Plugins > Installed Plugins and deactivate SiteOrigin Widgets Bundle, and then delete it. Scroll to the top of the page and click Add New, Upload Plugin. Upload so-widgets-bundle.1.30.1-beta.zip and when prompted activate it.

    I don’t understand why the query feature of the post loop is only available installing the Widgets bundle

    Widgets Bundle is required due to the enhanced widget functionality it adds. The base post loop widget is quite simple by design and when the Widgets Bundle is present, the Post Loop query settings are replaced by the Widgets Bundle Development framework Posts form field.

    Kind regards,
    Alex

    Thread Starter htrex

    (@htrex)

    Hi Alex,
    I can confirm that your beta version makes the notices disappear, should have seen myself how this condition looks weird!

    $current_screen->base == is_object( $current_screen ) && 'widgets' ? 'wp-edit-widgets' : 'wp-editor'

    Thanks for your support, I’m waiting for the public release!

    • This reply was modified 4 months, 2 weeks ago by .
    Plugin Contributor alexgso

    (@alexgso)

    Hi htrex,

    That’s great to hear! 🙂
    Please let us know if anything else comes up and we’ll lend a hand. Have a good one mate.

    Kind regards,
    Alex

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.