BoldGrid / w3-total-cache

GNU General Public License v2.0
153 stars 86 forks source link

Type-error in UserExperience_Remove_CssJs_Page_View.php #904

Closed Hikariii closed 5 months ago

Hikariii commented 5 months ago

When editing the "User Experience" settings in free (non-pro) mode the "Remove CSS/JS Individually" gives an error in https://github.com/BoldGrid/w3-total-cache/blob/82d88046c30bf09bdd0ec476ba5b800ac4532e5e/UserExperience_Remove_CssJs_Page_View.php#L129-L131

Probably recently introduced by https://github.com/BoldGrid/w3-total-cache/pull/894

An error of type E_ERROR was caused in line 130 of the file 
./wp-content/plugins/w3-total-cache/UserExperience_Remove_CssJs_Page_View.php. 
Error message: Uncaught TypeError: Cannot access offset of type string on string in 
./wp-content/plugins/w3-total-cache/UserExperience_Remove_CssJs_Page_View.php:130

Stack trace:
#0 ./wp-content/plugins/w3-total-cache/UserExperience_Remove_CssJs_Extension.php(179): include()
#1 ./wp-includes/class-wp-hook.php(324): W3TC\UserExperience_Remove_CssJs_Extension->w3tc_userexperience_page()
#2 ./wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#3 ./wp-includes/plugin.php(517): WP_Hook->do_action()
#4 ./wp-content/plugins/w3-total-cache/UserExperience_Page_View.php(22): do_action()
#5 ./wp-content/plugins/w3-total-cache/UserExperience_Page.php(7): include('...')
#6 ./wp-content/plugins/w3-total-cache/UserExperience_Plugin_Admin.php(89): W3TC\UserExperience_Page->render_content()
#7 ./wp-includes/class-wp-hook.php(324): W3TC\UserExperience_Plugin_Admin->w3tc_settings_page_w3tc_userexperience()
#8 ./wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#9 ./wp-includes/plugin.php(517): WP_Hook->do_action()
#10 ./wp-content/plugins/w3-total-cache/Root_AdminMenu.php(312): do_action()
#11 ./wp-includes/class-wp-hook.php(324): W3TC\Root_AdminMenu->options()
#12 ./wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#13 ./wp-includes/plugin.php(517): WP_Hook->do_action()
#14 ./wp-admin/admin.php(259): do_action()
#15 {main}
  thrown

Rendering like this: image

cssjoe commented 5 months ago

@Hikariii Thank you for reporting this issue. We will be looking into it. There is another report of this at https://wordpress.org/support/topic/wordpress-caught-an-error-with-one-of-your-plugins-w3-total-cache/

cssjoe commented 5 months ago

@Hikariii A fix for this issue will be included in the next release.