Title: Fatal error on plugin activation &#8211; WP-CLI
Last modified: January 6, 2022

---

# Fatal error on plugin activation – WP-CLI

 *  Resolved [Kylen Downs](https://wordpress.org/support/users/kdowns/)
 * (@kdowns)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/)
 * When installing and activating the most recent version (5.169.1) through WP-CLI,
   the plugin outputs the following fatal error and fails to activate.
 *     ```
       $ wp plugin install cleantalk-spam-protect --activate
       Installing Spam protection, AntiSpam, FireWall by CleanTalk (5.169.1)
       Downloading installation package from https://downloads.wordpress.org/plugin/cleantalk-spam-protect.5.169.1.zip...
       Unpacking the package...
       Installing the plugin...
       Plugin installed successfully.
       Activating 'cleantalk-spam-protect'...
       Fatal error: Uncaught Error: Call to undefined function Cleantalk\ApbctWP\apbct_settings__get_ajax_type() in local/Sites/test/wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/Activator.php:15
       Stack trace:
       #0 local/Sites/test/wp-content/plugins/cleantalk-spam-protect/cleantalk.php(408): Cleantalk\ApbctWP\Activator::activation(NULL)
       #1 local/Sites/test/wp-includes/class-wp-hook.php(303): apbct_activation(NULL)
       #2 local/Sites/test/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array)
       #3 local/Sites/test/wp-includes/plugin.php(470): WP_Hook->do_action(Array)
       #4 local/Sites/test/wp-admin/includes/plugin.php(698): do_action('activate_cleant...', NULL)
       #5 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(333): activate_plugin('cleantalk-spam-...', '', NULL)
       #6 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(250): Plugin_Command->activate(Array)
       #7 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(809): WP_CLI\CommandWithUpgrade->install(Array, Array)
       #8 [internal function]: Plugin_Command->install(Array, Array)
       #9 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
       #10 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
       #11 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func(Object(Closure), Array, Array)
       #12 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(399): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
       #13 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(422): WP_CLI\Runner->run_command(Array, Array)
       #14 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1194): WP_CLI\Runner->run_command_and_exit()
       #15 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
       #16 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(77): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
       #17 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
       #18 phar:///usr/local/Cellar/wp-cli/2.5.0/bin/wp/php/boot-phar.php(11): include('phar:///usr/loc...')
       #19 /usr/local/Cellar/wp-cli/2.5.0/bin/wp(4): include('phar:///usr/loc...')
       #20 {main}
         thrown in local/Sites/test/wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/Activator.php on line 15
       ```
   
 * Attempting to activate the currently inactive plugin with `wp plugin activate
   cleantalk-spam-protect`, it outputs the same fatal error.
 * The plugin does activate without issue from the WordPress dashboard.

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

 *  Plugin Support [sergecleantalk](https://wordpress.org/support/users/sergecleantalk/)
 * (@sergecleantalk)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/#post-15226920)
 * Hello,
 * Could you tell us your webserver PHP version and WordPress version?
 *  Thread Starter [Kylen Downs](https://wordpress.org/support/users/kdowns/)
 * (@kdowns)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/#post-15228837)
 * Tested on a couple of production sites running WP 5.8.2 + PHP 7.4 as well as 
   a local site running WP 5.8.3 + PHP 8.0.
 *  Plugin Support [sergecleantalk](https://wordpress.org/support/users/sergecleantalk/)
 * (@sergecleantalk)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/#post-15228925)
 * I’ve tried to install and activate 5.169.1 on WordPress 5.8.3 + PHP 7.4 and found
   no problems. We also didn’t receive such reports yet. Seems like another plugin
   is interfering with Anti-Spam. Could you try to disable plugins one by one?
 *  Thread Starter [Kylen Downs](https://wordpress.org/support/users/kdowns/)
 * (@kdowns)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/#post-15229102)
 * I set the active theme to twentytwenty and deactivated all other plugins. WP-
   CLI is still outputting that error referencing cleantalk-spam-protect/lib/Cleantalk/
   ApbctWP/Activator.php:15
 * *Note this is a fresh install of CleanTalk and so has not been connected to the
   API or had an access key submitted.
 * I did run a test where I added an access key and verified the connection. I then
   deactivated the CleanTalk plugin and again attempted to activate it via WP-CLI.
   Same error.
 * I’m running WP-CLI 2.5.0 on local and the prod sites were running 2.4.0.
 *  Plugin Support [sergecleantalk](https://wordpress.org/support/users/sergecleantalk/)
 * (@sergecleantalk)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/#post-15229167)
 * We will test WP-CLI 2.5.0 in our environment and contact you. It may take 2-3
   business days.
 *  Plugin Support [amagsumov](https://wordpress.org/support/users/amagsumov/)
 * (@amagsumov)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/#post-15234561)
 * Hello [@kdowns](https://wordpress.org/support/users/kdowns/)
 * We’ve fixed the issue. Please install fix version:
    [https://github.com/CleanTalk/wordpress-antispam/releases/download/fix-version/cleantalk-spam-protect.zip](https://github.com/CleanTalk/wordpress-antispam/releases/download/fix-version/cleantalk-spam-protect.zip)
 * – Go to WordPress Administrator Panel —> Plugins.
 * – Find the plugin “Anti-Spam by CleanTalk” —> Deactivate.
 * – After the automatic page refreshing find the plugin again “Anti-Spam by CleanTalk”—
   > Delete. Confirm files deletion.
 * – Download the plugin archive from the link.
 * – Go to Plugins —> Add New —> Upload Plugin.
 * – Choose the downloaded archive and press “Install Now”.
 * Did it help?
 *  Thread Starter [Kylen Downs](https://wordpress.org/support/users/kdowns/)
 * (@kdowns)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/#post-15236135)
 * Cheers! Looks like that fix is working. Thank you!
 *  [SergeM](https://wordpress.org/support/users/serge00/)
 * (@serge00)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/#post-15236184)
 * You are welcome, [@kdowns](https://wordpress.org/support/users/kdowns/)!

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

The topic ‘Fatal error on plugin activation – WP-CLI’ is closed to new replies.

 * ![](https://ps.w.org/cleantalk-spam-protect/assets/icon-256x256.gif?rev=3539767)
 * [Anti Spam for Contact Forms, Comments & Online Stores - CleanTalk](https://wordpress.org/plugins/cleantalk-spam-protect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cleantalk-spam-protect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cleantalk-spam-protect/)
 * [Active Topics](https://wordpress.org/support/plugin/cleantalk-spam-protect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cleantalk-spam-protect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cleantalk-spam-protect/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [SergeM](https://wordpress.org/support/users/serge00/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-plugin-activation-wp-cli/#post-15236184)
 * Status: resolved