Plugin having issues when used as mu-plugin and other plugins are activated
-
When this plugin is used as a mu-plugin, it is impossible to activate other plugins due to poor checking in the trait-parans file.
2023/11/06 17:06:40 [error] 114785#114785: *326 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /www/[REDACTED]_755/public/releases/20231106170454/web/app/mu-plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/traits/trait-params.php:59 Stack trace: #0 /www/[REDACTED]_755/public/releases/20231106170454/web/app/mu-plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/traits/trait-params.php(48): Cloudinary\Settings->set_param_array(Array, '', '') #1 /www/[REDACTED]_755/public/releases/20231106170454/web/app/mu-plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/traits/trait-params.php(48): Cloudinary\Settings->set_param_array(Array, '', '') #2 /www/[REDACTED]_755/public/releases/20231106170454/web/app/mu-plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/traits/trait-params.php(48): Cloudinary\Settings->set_param_array(Array, Array, '') #3 /www/[REDACTED]_755/public/releases/20231106170454/web/" while reading response header from upstream, client: 24.218.46.206, server: stg-[REDACTED]-staging.kinsta.cloud, request: "GET /wp/wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s= HTTP/1.1", upstream: "fastcgi://unix:/var/run/php8.1-fpm-[REDACTED].sock:", host: "stg-[REDACTED]-staging.kinsta.cloud:55138", referrer: "https://stg-[REDACTED]-staging.kinsta.cloud/wp/wp-admin/plugins.php"
The offending code in the plugin:if ( '' === $key ) { $new[] = $value; } else { $new[ $key ] = $value; } // @TODO: I took ksort out, need to check that it doesn't have any problems being. return $new;
I have tried activating multiple plugins and they all have the same issue.
Why not just add a check in such as the following?if(!is_array($new)) return $new;
This is on a PHP 8.1 installation, Plugin version 3.1.5 and WordPress 6.2.1 on Kinsta.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Plugin having issues when used as mu-plugin and other plugins are activated’ is closed to new replies.