wp-media / adminimize

Adminimize is a WordPress plugin that lets you hide 'unnecessary' items from the WordPress backend.
https://wordpress.org/plugins/adminimize/
GNU General Public License v2.0
100 stars 31 forks source link

[Bug]: Show WordPress Dashboard: PHP Fatal error: Uncaught TypeError: strip_tags() #153

Closed denarie closed 1 year ago

denarie commented 1 year ago

Description of the bug

When opening the WordPress dashboard, adminimize creates a fatal error (php 8.0) or warning (php 7.4)

Reproduction instructions

  1. Activate plugin wpSEO and adminimize
  2. Enable wpSEO dashboard: Go to the wpSEO settings: Monitor -> “Show wpSEO Status on Dashboard”: enable checkbox and save settings
  3. open WordPress Dashboard
  4. Error is shown

Expected behavior

The dashboard should produce no error

Environment info

No response

Relevant log output

PHP Fatal error: Uncaught TypeError: strip_tags(): Argument #1 ($string) must be of type string, array given in wp-content/plugins/adminimize/inc-setup/dashboard.php:161
Stack trace:
#0 wp-content/plugins/adminimize/inc-setup/dashboard.php(161): strip_tags()
#1 wp-content/plugins/adminimize/inc-setup/dashboard.php(36): _mw_adminimize_get_dashboard_widgets()

Additional context

Reason for this error: strip_tags expects a string, but receives an array. The error is on the side of the wpSEO plugin (and perhaps other plugins as well), I opended a bug report there as well.

The wpSEO dashboard widget has the following title countsArray ( [0] => wpSEOde_Dashboard [1] => add_front )

That is the reason why adminimize crashes.

Code of Conduct

bueltge commented 1 year ago

Fix with #154, Great feedback!