We are hosted on WordPress VIP, and since updating to PHP 8.0 our debug logs are full of the below errors:
PHP message: Warning: foreach() argument must be of type array|object, bool given in /var/www/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php on line 1678 [www.oursite.com.au/2011/03/28/digital-media-convergence-where-legal-and-ethical-lines-blur-too/] [wp-content/plugins/wpdiscuz/utils/class.WpdiscuzHelper.php:349 wpdFormAttr\Form->getThemes(), wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php:1256 WpdiscuzHelper->enqueueWpDiscuzStyle(), wp-includes/class-wp-hook.php:308 WpdiscuzCore->frontendFiles(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/script-loader.php:2180 do_action('wp_enqueue_scripts'), wp-includes/class-wp-hook.php:308 wp_enqueue_scripts(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/general-template.php:3043 do_action('wp_head'), wp-content/themes/oursite/header.php:58 wp_head(), wp-includes/template.php:783 require_once('wp-content/themes/oursite/header.ph... PHP message: Warning: scandir(vip://wp-content/uploads/wpdiscuz/themes/): Failed to open directory: "Automattic\VIP\Files\VIP_Filesystem_Stream_Wrapper::dir_opendir" call failed in /var/www/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php on line 1675 [www.oursite.com.au/2022/12/06/ukraine-russia-war-europe-weapons/] [wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php:1675 scandir(), wp-content/plugins/wpdiscuz/utils/class.WpdiscuzHelper.php:349 wpdFormAttr\Form->getThemes(), wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php:1255 WpdiscuzHelper->enqueueWpDiscuzStyle(), wp-includes/class-wp-hook.php:308 WpdiscuzCore->frontendFiles(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/script-loader.php:2180 do_action('wp_enqueue_scripts'), wp-includes/class-wp-hook.php:308 wp_enqueue_scripts(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/general-template.php:3043 do_... PHP message: Warning: scandir(): (errno 13): Permission denied in /var/www/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php on line 1675 [www.oursite.com.au/2022/12/06/ukraine-russia-war-europe-weapons/] [wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php:1675 scandir(), wp-content/plugins/wpdiscuz/utils/class.WpdiscuzHelper.php:349 wpdFormAttr\Form->getThemes(), wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php:1255 WpdiscuzHelper->enqueueWpDiscuzStyle(), wp-includes/class-wp-hook.php:308 WpdiscuzCore->frontendFiles(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/script-loader.php:2180 do_action('wp_enqueue_scripts'), wp-includes/class-wp-hook.php:308 wp_enqueue_scripts(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/general-template.php:3043 do_action('wp_head'), wp-content/themes/oursite/header.php:58 wp_head(), wp-includes/template.php:783 require_once('wp-content/th...
We did some digging and worked out what the issue was:
WordPress VIP does not allow upload folder write access to plugins, hence the issues above.
We had to modify the code in one of your files, but this resolved the issue for us. In short, we also check not only that the folder exists, but that the folder has write_permissions as well.
I thought I'd share given that we can't be the only ones affected by this. This replaces the file in forms/wpdFormAttr/
Thank you aohagan,
I've asked the developers to check the issue.
Please revert back the customizations you're making and use this one:
The changes you've done are not a good solution.
Thanks for the response Asti.
We ran the code you provided, and it it has returned 2 of the 3 warning errors.
PHP message: Warning: scandir(vip://wp-content/uploads/wpdiscuz/themes/): Failed to open directory: "Automattic\VIP\Files\VIP_Filesystem_Stream_Wrapper::dir_opendir" call failed in /var/www/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php on line 1675 [www.oursite.com.au/2022/12/06/ukraine-russia-war-europe-weapons/] [wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php:1675 scandir(), wp-content/plugins/wpdiscuz/utils/class.WpdiscuzHelper.php:349 wpdFormAttr\Form->getThemes(), wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php:1255 WpdiscuzHelper->enqueueWpDiscuzStyle(), wp-includes/class-wp-hook.php:308 WpdiscuzCore->frontendFiles(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/script-loader.php:2180 do_action('wp_enqueue_scripts'), wp-includes/class-wp-hook.php:308 wp_enqueue_scripts(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/general-template.php:3043 do_... PHP message: Warning: scandir(): (errno 13): Permission denied in /var/www/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php on line 1675 [www.oursite.com.au/2022/12/06/ukraine-russia-war-europe-weapons/] [wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php:1675 scandir(), wp-content/plugins/wpdiscuz/utils/class.WpdiscuzHelper.php:349 wpdFormAttr\Form->getThemes(), wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php:1255 WpdiscuzHelper->enqueueWpDiscuzStyle(), wp-includes/class-wp-hook.php:308 WpdiscuzCore->frontendFiles(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/script-loader.php:2180 do_action('wp_enqueue_scripts'), wp-includes/class-wp-hook.php:308 wp_enqueue_scripts(), wp-includes/class-wp-hook.php:332 WP_Hook->apply_filters(), wp-includes/plugin.php:517 WP_Hook->do_action(), wp-includes/general-template.php:3043 do_action('wp_head'), wp-content/themes/oursite/header.php:58 wp_head(), wp-includes/template.php:783 require_once('wp-content/th...
We're happy to test anything you provide, but will continue with our solution for now given that it has been running successfully on our production sites for a number of days without incident.