ndiego / block-visibility

Conditional visibility controls for all WordPress blocks.
https://www.blockvisibilitywp.com
GNU General Public License v2.0
129 stars 10 forks source link

PHP warning notice on Widgets screen when debug is enabled. #25

Closed ndiego closed 1 year ago

ndiego commented 2 years ago

Description

When using Block Visibility with WordPress 5.8+, on the Widgets screen a PHP notice will appear when debug is enabled. This is a very common error that is cropping up in other plugins like Yoast SEO and Gravity Forms. A reference to the issue in Yoast SEO is here.

While this issue does not impede the functionality of Block Visibility in the Widgets screen, it is annoying to users that have debug enabled.

Step-by-step reproduction instructions

  1. Install Block Visibility, the TT1 theme and make sure you are using WordPress 5.8+
  2. Enable debug in wp-config.php
  3. Navigate to the Widget screen and you will see the following notice.

Notice:

( ! ) Notice: 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 /Users/Local Sites/blockvisibility/app/public/wp-includes/functions.php on line 5663

ndiego commented 2 years ago

This issue was resolved in Block Visibility Pro, version 1.5.0.

ndiego commented 2 years ago

The implemented fix caused an unforeseen conflict with the EditorsKit plugin. Given the number of users that use both Block Visibility Pro and EditorsKit, the fix for the PHP warning on the Widget screen was reverted. We will explore an alternative solution in the next release of Pro.

ndiego commented 1 year ago

This is now fixed in Block Visibility Pro v1.6.2.