Title: wp-cli activation broken
Last modified: December 16, 2022

---

# wp-cli activation broken

 *  Resolved [oolongm](https://wordpress.org/support/users/oolongm/)
 * (@oolongm)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/)
 * Since 6.0 update wp cli activation is broken.
 * rsssl_user_can_manage() returns false so activation function is exited right 
   in the beginning. What is also bad is the fact that activation function return
   value is not checked, so we see a success message in wp cli ( ‘SSL activated’)
   in any way, no matter what really happened.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/wp-cli-activation-broken/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wp-cli-activation-broken/page/2/?output_format=md)

 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16296818)
 * Hi [@oolongm](https://wordpress.org/support/users/oolongm/),
 * Thanks for reporting the issue. I have created a fix for this here:
 * [https://github.com/Really-Simple-Plugins/really-simple-ssl/tree/wpcli](https://github.com/Really-Simple-Plugins/really-simple-ssl/tree/wpcli)
 * It also includes your suggestion for feedback on SSL activation failure.
 * Let me know if this resolves the issue for you.
 *  Thread Starter [oolongm](https://wordpress.org/support/users/oolongm/)
 * (@oolongm)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16296821)
 * Thanks for this super fast reply! I’ll try it soon, next time I’ll setup some
   new sites. But the code looks like it should solve the problem.
 *  Thread Starter [oolongm](https://wordpress.org/support/users/oolongm/)
 * (@oolongm)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16303292)
 * Hi [@rogierlankhorst](https://wordpress.org/support/users/rogierlankhorst/),
 * I just tested your code, unfortunately it doesn’t work yet.
 * > It also includes your suggestion for feedback on SSL activation failure.
 * This part basically works, however you return the error instead of success state.
   You probably meant to write !$error here: [https://github.com/Really-Simple-Plugins/really-simple-ssl/blob/master/class-admin.php#L387](https://github.com/Really-Simple-Plugins/really-simple-ssl/blob/master/class-admin.php#L387)
 * With this line changed the cli action completes and outputs the success message,
   however in the wp backend the ssl activation state is still _deactivated_ afterwards.
   I’m afraid you will actually have to run this code to see what’s going on – or
   what is not 😛
 * I also noticed another bug: The plugin localization doesn’t respect the user 
   language, but only the wp core language. So for example if I have a french wp
   site, but my wp user has en_US as language, because my french is poor, then the
   backend is all english besides RSSSL UI what is still in french.
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16303408)
 * [@oolongm](https://wordpress.org/support/users/oolongm/) thanks for checking,
   I see the problem, I overlooked the ‘rsssl_update_option()’ function, which limits
   access using the rsssl_user_can_manage() function. I’ve now moved the WP_CLI 
   check to this function, which allows the activation to go through. This should
   now work as expected:
 * [https://github.com/Really-Simple-Plugins/really-simple-ssl/tree/wp-cli-%3D-capability-check-extended](https://github.com/Really-Simple-Plugins/really-simple-ssl/tree/wp-cli-%3D-capability-check-extended)
 * The language issue should already be resolved in the current main. The plugin
   switched to the core wpFetch method, which has such checks built int. I just 
   checked this, and the use language changed for me.
 *  Thread Starter [oolongm](https://wordpress.org/support/users/oolongm/)
 * (@oolongm)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16304035)
 * I can confirm the language issue is gone in the latest version.
 * The cli activation however still doesn’t work. You really don’t have a system
   where you could test it?
 * PHP Fatal error: Uncaught Error: Call to undefined function rsssl_uses_htaccess()
   in /public_html/wp-content/plugins/really-simple-ssl/settings/config/disable-
   fields-filter.php:10
   Stack trace:#0 /public_html/wp-includes/class-wp-hook.php(
   308): rsssl_remove_fields(Array)#1 /public_html/wp-includes/plugin.php(205): 
   WP_Hook->apply_filters(Array, Array)#2 /public_html/wp-content/plugins/really-
   simple-ssl/settings/config/config.php(1109): apply_filters(‘rsssl_fields’, Array)#
   3 /public_html/wp-content/plugins/really-simple-ssl/settings/settings.php(536):
   rsssl_fields(false)#4 /public_html/wp-content/plugins/really-simple-ssl/class-
   admin.php(356): rsssl_update_option(‘redirect’, ‘wp_redirect’)#5 in /public_html/
   wp-content/plugins/really-simple-ssl/settings/config/disable-fields-filter.php
   on line 10
    -  This reply was modified 3 years, 5 months ago by [oolongm](https://wordpress.org/support/users/oolongm/).
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16304156)
 * Ok, thanks for checking. I’ll set it up tomorrow.
    -  This reply was modified 3 years, 5 months ago by [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/).
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16304385)
 * [@oolongm](https://wordpress.org/support/users/oolongm/) You’re right, should
   have done this right away. I installed wp cli locally, and successfully ran an
   ssl_activation on the test server, so this should now be resolved for you as 
   well. An additional file needed to be included for this to work.
 * [https://github.com/Really-Simple-Plugins/really-simple-ssl/tree/wp-cli-capability-check-extended](https://github.com/Really-Simple-Plugins/really-simple-ssl/tree/wp-cli-capability-check-extended)
 * Thanks for pointing the issue out to me!
 *  Thread Starter [oolongm](https://wordpress.org/support/users/oolongm/)
 * (@oolongm)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16379068)
 * One month and one major release later:
 * > wp-cli.phar rsssl activate_ssl
   > Error: SSL activation failed
 * Just this time without any debug/error messages.
    -  This reply was modified 3 years, 4 months ago by [oolongm](https://wordpress.org/support/users/oolongm/).
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16379308)
 * [@oolongm](https://wordpress.org/support/users/oolongm/) I’m very sorry to hear
   this still doesn’t work. I did successfully test the activation with wp cli, 
   but I think I have found the difference: we always test with the actual site 
   open, which sets the ‘site_has_ssl’ option if a site has SSL.
 * For the full explanation of what I think has happened, please see my response
   here: [https://wordpress.org/support/topic/wp-cli-activation-broken-2/#post-16379288](https://wordpress.org/support/topic/wp-cli-activation-broken-2/#post-16379288)
 * I hope this resolves the issue with wp-cli, I can’t find any other issues at 
   the moment.
 * This is added to the test queue again, and will get tested by a different tester
   as well, with the above in mind.
    -  This reply was modified 3 years, 4 months ago by [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/).
 *  Thread Starter [oolongm](https://wordpress.org/support/users/oolongm/)
 * (@oolongm)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16395003)
 * Thank you [@rogierlankhorst](https://wordpress.org/support/users/rogierlankhorst/),
   issue seems to be gone now 🙂
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16395370)
 * [@oolongm](https://wordpress.org/support/users/oolongm/) thanks for your adjusted
   review 🙂!
 * Your other request regarding the notices was a simple addition which I’ve added
   in the current master. I’ve added a generic option which allows you to set options
   in Really Simple SSL using wp cli.
 * To dismiss all notices, you can use:
 * `rsssl update_option dismiss_all_notices true`
 * But you can use it to update any option in the plugin this way, which seems a
   nice addition anyway.
 * This will be included in the update next week.
 * [https://github.com/really-simple-plugins/really-simple-ssl](https://github.com/really-simple-plugins/really-simple-ssl)
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16395781)
 * I’ve changed the command pattern a bit, as this seems more intuitive, and also
   allows for multiple option updates in one line:
 * `rsssl update_option --dismiss_all_notices=true`
 *  Thread Starter [oolongm](https://wordpress.org/support/users/oolongm/)
 * (@oolongm)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16422255)
 * > I’ve changed the command pattern a bit, as this seems more intuitive, and also
   > allows for multiple option updates in one line:
   > `rsssl update_option --dismiss_all_notices=true`
 * Thank you so much for adding this, however it doesn’t seem to have any affect
   for me on the popup that comes after first login and the notices that show up.
   Is it supposed to let this all disappear?
 * > This will be included in the update next week.
 * I just tested the latest release (6.1.1) and it seems like there is a regression
   for the ssl activation. It still says “Success: SSL activated successfully” in
   the console, however in the wp backend it says “ssl not activated” :/
 * Now the new thing is that if I run the activation command a second time, it seems
   to work. Also if after the first (failed) attempt, I uninstall the plugin with
   the option “Delete all data on plugin deletion” activated – and then I try the
   whole process again it seems to work on the first attempt.
 * Any ideas about this?
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16422319)
 * the dismiss notices setting does not dismiss the modal. That can be controlled
   with a regular wordpress option update:
 * `wp option update rsssl_onboarding_dismissed true`
 * I didn’t post the correct command here, please try:
 * `rsssl update_option --dismiss_all_notices=1`
 * We’ve tested extensively on several setups, but I’ll check what your tested and
   see if we can find anything.
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/#post-16430572)
 * [@oolongm](https://wordpress.org/support/users/oolongm/) after repeated testing,
   we noticed that this can unexpectedly happen. Running activation twice always
   seems to work, which can be used as a workaround until it’s fixed.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/wp-cli-activation-broken/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wp-cli-activation-broken/page/2/?output_format=md)

The topic ‘wp-cli activation broken’ is closed to new replies.

 * ![](https://ps.w.org/really-simple-ssl/assets/icon-256x256.png?rev=2839720)
 * [Really Simple Security - Simple and Performant Security (formerly Really Simple SSL)](https://wordpress.org/plugins/really-simple-ssl/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/really-simple-ssl/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/really-simple-ssl/)
 * [Active Topics](https://wordpress.org/support/plugin/really-simple-ssl/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/really-simple-ssl/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/really-simple-ssl/reviews/)

 * 17 replies
 * 2 participants
 * Last reply from: [oolongm](https://wordpress.org/support/users/oolongm/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/wp-cli-activation-broken/page/2/#post-16484522)
 * Status: resolved