Hi @Calvin Alkan
I'm still unable to get the reauthorization to happen without deleting the key in the CUI dashboard. Here's some additional info on how to replicate our scenario:
Starting setup:
orionmagazine.org
orionmagazine.localhost
They both have the license key installed in wp-config like this:
define( 'CUI_LICENSE_KEY', 'ak_123example123' );
Each has individually be authorized to the same key.
Local commandui_activations value:
wp option get commandui_activations --format=json
{"20b3baf00ef350c820a4bd018e7e4f7d":{"first_connected":1765469324,"connection_key":"ck_***************CoWszhM","maybe_original_fingerprint":"orionmagazine.localhost"}}
Production commandui_activations value:
wp option get commandui_activations --format=json
{"da93498ff319fcca5b15c3925840f3b2":{"first_connected":1748967410,"connection_key":"ck_***************UeKYkbk","maybe_original_fingerprint":"orionmagazine.org"}}
Both sites show successful license connection at /wp-admin/options-general.php?page=commandui
Now we run our sync process:
- pull down a copy of the production database
- import into local
- we do a find replace that includes https so
wp search-replace 'https://orionmagazine.org' 'https://orionmagazine.localhost' --all-tables - so that won't replace the bare domain in the commandui_activations option.
After this is done the value of commandui_activations is the production site value, but we're now on the localhost URL. This causes the scenario like described above to happen. Everywhere on the dashboard:
Please activate a license key to keep using CommandUI without disruptions. Activate CommandUI License / Dismiss for a day
On the /wp-admin/options-general.php?page=commandui page:
Activate your CommandUI License
Please activate a license key to activate CommandUI on this site.
[ the key from wp-config is filled in the field ]
Note: We found an existing activation key and pre-filled it above. This typically happens when you've moved your WordPress site (e.g., to staging or a new URL).
You can use this same key to activate CommandUI on this new location.
Now if they key has a slot available and you press Activate you get:
Error: The fingerprint is already activated for this license.
Code: commandui_api_error.fingerprint_already_active
API Request ID: req_01kc7ge3y83hf9yhrnz085ze5m
Or if the key has no slots available - even if the current URL is on the list of sites taking up a slot for that license - then you get this error:
Error: The license key is configured to allow a maximum of 3 sites. You can not connect another site to this license key.
Code: commandui_api_error.license_key_max_sites_reached
API Request ID: req_01kc7gth48p79qke4smnv5k5v5
This is kind of the crux of the situation. It seems like if you try and re-authorize a site that's already on this key it should work and refresh the value in commandui_activations to a valid one. Or even better - if the key in wp-config is valid for the current domain name of the current site but commandui_activations is out of date, refresh it for us automatically so we don't have to go back and click the button again.
What currently works to resolve this?
- delete the site under "Connected Sites" in https://my.snicco.io/licenses/ and then click Activate in WP
- store somewhere before the sync and re-assign the old value of commandui_activations for the target site.
Just seems like it should be much easier than that to authorize prod/staging/local for a project one time and then just have them all work with no additional tinkering around as long as the wp-config value is valid.