Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings thrown by the WP Fusion checker #24

Closed
Clorith opened this issue Nov 24, 2021 · 1 comment
Closed

Warnings thrown by the WP Fusion checker #24

Clorith opened this issue Nov 24, 2021 · 1 comment
Assignees
Labels
Bug Something isn't working, looks like a 🐛.

Comments

@Clorith
Copy link

Clorith commented Nov 24, 2021

Description

When using WP Fusion checks with Block Visibility, warnings are thrown that $attributes are undefined.

This is coming from

$can_access = apply_filters(
'wpf_user_can_access_block', // phpcs:ignore
$can_access,
$attributes
wherethe variable is used as part of a filter, but the variable has not been declared prior to this.

The visibility options are still applied as expected at this time, but may not in future versions of PHP or similar with warnings behing served.

Notice: Undefined variable: attributes in /sites/testsite.localhost/files/public/wp-content/plugins/block-visibility/includes/frontend/visibility-tests/wp-fusion.php on line 100

Step-by-step reproduction instructions

  1. Enable debugging on your site
  2. Add a block, and add visibility options with WP Fusion enabled
  3. Visit the front-end of your site where the block should be shown, making sure that no other rules previously would have set $is_visible to true
  4. Observe warnings being thrown once per block that has visibility settings in place.

Expected behavior

No warnings should be generated by the base plugin.

Actual behavior

Warnings are thrown.

System information

  • Block Visibility version: 2.2.0
  • Block Visibility Pro version: 1.3.2
  • WordPress version: 5.8.2
  • Gutenberg version: Not installed
  • Are all plugins except Block Visibility, Block Visibility Pro (if installed), and Gutenberg (if installed) deactivated? No
  • Are you using a default theme (e.g. Twenty Twenty-One)? No
@ndiego ndiego added the Bug Something isn't working, looks like a 🐛. label Dec 16, 2021
@ndiego ndiego self-assigned this Dec 16, 2021
@ndiego
Copy link
Owner

ndiego commented Aug 3, 2022

This bug has been fixed in the latest release (2.4.3)

@ndiego ndiego closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working, looks like a 🐛.
Projects
None yet
Development

No branches or pull requests

2 participants