Title: PHP crash when deactivating plugin
Last modified: April 4, 2023

---

# PHP crash when deactivating plugin

 *  Resolved [FormulaRon](https://wordpress.org/support/users/formularon/)
 * (@formularon)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-crash-when-deactivating-plugin/)
 * Hello Support,
 * I’ve stumbled across a similar PHP error that others have reported previously.
   Not when using but when deactivating the plugin.
 * I get the following crash reported…
 *     ```wp-block-code
       ordPress version 6.2
       Active theme: Twenty Fourteen Child 2023 (version 23.03.01)
       Current plugin: WP-Optimize - Clean, Compress, Cache (version 3.2.14)
       PHP version 8.1.16
   
   
   
       Error Details
       =============
       An error of type E_ERROR was caused in line 161 of the file /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/ImageMagick.php. Error message: Uncaught Error: Call to undefined function WebPConvert\Convert\Converters\escapeshellarg() in /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/ImageMagick.php:161
       Stack trace:
       #0 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/ImageMagick.php(252): WebPConvert\Convert\Converters\ImageMagick->createCommandLineOptions('6.9.10-68')
       #1 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/ConverterTraits/EncodingAutoTrait.php(57): WebPConvert\Convert\Converters\ImageMagick->doActualConvert()
       #2 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/ConverterTraits/EncodingAutoTrait.php(95): WebPConvert\Convert\Converters\ImageMagick->convertTwoAndSelectSmallest()
       #3 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/AbstractConverter.php(256): WebPConvert\Convert\Converters\ImageMagick->runActualConvert()
       #4 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/AbstractConverter.php(295): WebPConvert\Convert\Converters\AbstractConverter->doConvertImplementation()
       #5 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/webp/class-wpo-webp-test-run.php(48): WebPConvert\Convert\Converters\AbstractConverter->doConvert()
       #6 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/webp/class-wp-optimize-webp.php(55): WPO_WebP_Test_Run::get_converter_status()
       #7 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/webp/class-wp-optimize-webp.php(20): WP_Optimize_WebP->set_converter_status()
       #8 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/webp/class-wp-optimize-webp.php(43): WP_Optimize_WebP->__construct()
       #9 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/wp-optimize.php(262): WP_Optimize_WebP::get_instance()
       #10 /home/beggarsf/public_html/wordpress/wp-content/plugins/wp-optimize/wp-optimize.php(1807): WP_Optimize->get_webp_instance()
       #11 /home/beggarsf/public_html/wordpress/wp-includes/class-wp-hook.php(308): wpo_deactivation_actions(false)
       #12 /home/beggarsf/public_html/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
       #13 /home/beggarsf/public_html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
       #14 /home/beggarsf/public_html/wordpress/wp-admin/includes/plugin.php(814): do_action('deactivate_wp-o...', false)
       #15 /home/beggarsf/public_html/wordpress/wp-admin/plugins.php(209): deactivate_plugins('wp-optimize/wp-...', false, false)
       #16 {main}
         thrown
       ```
   

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-crash-when-deactivating-plugin/#post-16626541)
 * Can you try unchecking the option to create WebP images before deactivating the
   plugin?
 *  Thread Starter [FormulaRon](https://wordpress.org/support/users/formularon/)
 * (@formularon)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-crash-when-deactivating-plugin/#post-16628457)
 * I’ve never enabled “Automatically compress newly-added images” nor for any manual
   compressions but I do notice that on the “Compress Image” settings…
 * “**WebP conversion**
 * No WebP conversion tools are available on your web-server.”
 * …is displayed and which would then explain the failure to find the function.
 * There were 2 webp images on the site. I’ve replaced them with jpg’s, but still
   crashes and I don’t get a stack trace now.
 *  Plugin Contributor [Venkat Raj](https://wordpress.org/support/users/webulous/)
 * (@webulous)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-crash-when-deactivating-plugin/#post-16628806)
 * [@formularon](https://wordpress.org/support/users/formularon/) I assume, your
   hosting provider added PHP’s built in function `escapeshellarg` to `disable_functions`
   directive for security purposes. 
   You can add `define('WPO_USE_WEBP_CONVERSION',
   false);` to your `wp-config.php` file to prevent this.
 *  Thread Starter [FormulaRon](https://wordpress.org/support/users/formularon/)
 * (@formularon)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-crash-when-deactivating-plugin/#post-16629691)
 * Thanks for that clue.
 * I’ve added that, and the webp text has disappeared from the Settings.
 * But it still crashes but with no stack trace.
 *  Plugin Contributor [Venkat Raj](https://wordpress.org/support/users/webulous/)
 * (@webulous)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-crash-when-deactivating-plugin/#post-16635524)
 * [@formularon](https://wordpress.org/support/users/formularon/) Could you please
   provide more information about your server? Do you use clourflare? 
   If you would
   like to discuss this in private, please send email [support.wpo@updraftplus.com](https://wordpress.org/support/topic/php-crash-when-deactivating-plugin/support.wpo@updraftplus.com?output_format=md)
 *  Thread Starter [FormulaRon](https://wordpress.org/support/users/formularon/)
 * (@formularon)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-crash-when-deactivating-plugin/#post-16651279)
 * Hello Venjkat,
 * No I don’t used Cloudfare. The hosting is with [https://www.uk2.net/](https://www.uk2.net/)
   here in the UK. [https://www.uk2.net/web-hosting/](https://www.uk2.net/web-hosting/)
 * I have another site, with a second account with UK2 which also uses WP Optmise.
   The plugin here is 2 versions earlier and the same issue occurs there as well.
 * It’s not a show stopper for me. I routinely activate/deactivate those plugins
   I use infrequently.
 * Nigel

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘PHP crash when deactivating plugin’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [FormulaRon](https://wordpress.org/support/users/formularon/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/php-crash-when-deactivating-plugin/#post-16651279)
 * Status: resolved