humanmade / humanmade/wp-stripe
WP_STRIPE_KEY is undefined at plugin activation
- Dominant language
- PHP
- Stars
- 47
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
It's only a warning until the API options are configured, but when first activated we get the following annoying notice message:

This is because the constant is only defined after the api options have been set
```
if ( ! empty( $options['stripe_api_switch'] ) ) {
if ( $options['stripe_api_switch'] === 'Yes') {
Stripe::setApiKey( $options['stripe_test_api'] );
define( 'WP_STRIPE_KEY', $options['stripe_test_api_publish'] );
} else {
Stripe::setApiKey( $options['stripe_prod_api'] );
define( 'WP_STRIPE_KEY', $options['stripe_prod_api_publish'] );
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the plugin activation path containing the shown API-options conditional and the WP_STRIPE_KEY definition. Reproduce activation before API options are configured, then verify the notice no longer appears while configured test and production settings still define the key correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- payments
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100