# Testing your product before releasing to production

After integrating the Freemius SDK into your WordPress product, you should test it to ensure everything works properly before releasing a version to production.

Here is what Freemius recommends for testing the functionality and integration:

* The [opt-in process](https://freemius.com/help/help/documentation/wordpress-sdk/features/opt-in-screen/.md) for the free version. This will be done when seperately installing after the generation of the free version zip file in the Deployment process, as the opt-in screen is only shown to users who have the free version of your product activated.
* Free to [Trial to Paid](https://freemius.com/help/help/documentation/wordpress/free-trials/.md) upgrades.
* Directly Free to Paid upgrades with the [in-dashboard upgrading](https://freemius.com/help/help/documentation/wordpress-sdk/features/wp-admin-in-dashboard-upgrading/.md).

You can test the payments process using:

* The [sandbox mode](#check-out-the-wordpress-admin-pricing-page-with-sandbox-payments), which allows you to simulate transactions without processing real payments
* A generated license key for testing by purchasing one in [sandbox mode](https://freemius.com/help/help/documentation/checkout/integration/testing/.md) or by [manually creating one](https://freemius.com/help/help/documentation/wordpress-sdk/testing/.md#generating-a-license-key-for-testing) in the Freemius Developer Dashboard.

## Setting Freemius into Development Mode[​](#setting-freemius-into-development-mode "Direct link to Setting Freemius into Development Mode")

During development and testing, add the following constant to your testing environment's `wp-config.php` file to display the **Freemius Debug** menu item. This will allow you to view all the Freemius data associated with your local environment.

```
/* Set Freemius into development mode */

define( 'WP_FS__DEV_MODE', true );
```

tip

These definitions are added under the **WordPress debugging mode** section before the *WordPress Engine* starts, i.e. before `/* That is all, stop editing! Happy blogging. */` comment.

When you refresh the WP Admin, you should notice a new top-level menu item. If you click it, you will be able to see all the Freemius data associated with your local environment.

![Freemius SDK - Development mode WP Admin menu item](/help/assets/ideal-img/freemius-sdk-development-mode-wp-admin-menu-item.81b9077.480.png)

Important Warning

Activating development mode also sets the SDK for debugging, which, among other things, will turn the SDK's logging system on:

* Logs are stored in the DB, so activating logging on a highly-active production site can quickly fill up the DB storage.
* Logs are also printed out to the console log, so if a highly-active site utilizes a filesystem caching plugin while running in debug mode, the site’s disk may fill up quickly.

Therefore, do not forget to turn development mode off after completing troubleshooting.

## Enable Sandbox Checkout for Testing[​](#enable-sandbox-checkout-for-testing "Direct link to Enable Sandbox Checkout for Testing")

The Freemius WordPress SDK embeds a full checkout system that allows you to monetize your products via the **Upgrade** or pricing page. This checkout process can be fully tested in a sandbox environment before going live.

To set Freemius Checkout to sandbox payment mode, make sure your `wp-config.php` file contains the following constant with your secret key:

```
/* Set Freemius into development mode */

define( 'WP_FS__DEV_MODE', true );



/*

 * Set your plugin / theme Freemius secret key for super powers!

 *   1. Replace `my-slug` with your product's lowercase slug.

 *   2. Replace `sk_mySecretKey` with your product's secret key.

 */

define( 'WP_FS__my-slug_SECRET_KEY', 'sk_mySecretKey' );
```

With this setup, choose the desired plan from the pricing page. When the Checkout appears, complete the payment using these [credit cards](https://freemius.com/help/help/documentation/checkout/integration/testing/.md#testing-credit-cards) and [PayPal](https://freemius.com/help/help/documentation/checkout/integration/testing/.md#testing-paypal-accounts) accounts in sandbox mode.

## Generating a License Key for Testing[​](#generating-a-license-key-for-testing "Direct link to Generating a License Key for Testing")

You can generate a license key for testing by purchasing one in [sandbox mode](https://freemius.com/help/help/documentation/checkout/integration/testing/.md) or by manually creating one in the [Freemius Developer Dashboard](https://dashboard.freemius.com/).

Follow these steps to create a license key in the Freemius Developer Dashboard:

1. Navigate to the ***Licenses*** page.
2. Click the **Create License** button.
   <!-- -->
   ![Freemius SDK - Create License button](/help/assets/ideal-img/freemius-developer-dashboard-test-license-activation.81395fd.480.png)
3. Follow the prompts to complete the process to create the license key.
4. Use the generated license key to activate the premium features in your product during testing.

## Skipping Email Activation[​](#skipping-email-activation "Direct link to Skipping Email Activation")

For security and data integrity reasons, if an already opted-in user attempts to opt in to Freemius again, you will first receive an activation email to complete the process. This helps prevent users from hijacking other user accounts.

However, this step might slow down the development and testing process. To skip it, add the following constant to your testing environment's `wp-config.php` file in addition to the previously added constants:

```
/* Skip email activation when a user with the same email already opted-in */

define( 'WP_FS__SKIP_EMAIL_ACTIVATION', true );



/*

 * Set your plugin / theme Freemius secret key for super powers!

 *   1. Replace `my-slug` with your product's lowercase slug.

 *   2. Replace `sk_mySecretKey` with your product's secret key.

 */

define( 'WP_FS__my-slug_SECRET_KEY', 'sk_mySecretKey' );
```

Please note that this also requires the SDK to have the secret key of the product defined in the `wp-config.php` file.
