# Deployment Process

When the integration and testing process is completed, you're ready to upload your plugin or theme to the Freemius Developer Dashboard.

![Freemius Dashboard - Deployment](/help/assets/ideal-img/freemius-dashboard-deployments.4473069.480.png)

## Deploying Your WordPress Plugin or Theme[​](#deploying-your-wordpress-plugin-or-theme "Direct link to Deploying Your WordPress Plugin or Theme")

First, compress (Zip) the root folder of your product that will be uploaded to the Freemius Developer Dashboard. Now, you can deploy your product by:

1. Go to the **Deployment** page.
2. Click the **Add New Version** button.
3. Upload the product ZIP file.
   <!-- -->
   ![Freemius Dashboard - Deployment Add New Version](/help/assets/ideal-img/freemius-dashboard-deployment.893f2f9.480.png)
   <!-- -->
   The product code will then be parsed and checked before the final free and premium versions are generated and compressed into production-ready ZIP files.
4. Finally set the **Release Status** to **Released** to make the new version available for download and updates.
   <!-- -->
   ![Freemius Dashboard - Release Status](/help/assets/ideal-img/freemius-deployment-release-status.99298c4.480.png)

tip

For detailed instructions, and tips for automation, see the [release management guide](https://freemius.com/help/help/documentation/release-management/deployment/.md).

## Free and Premium Version Generation[​](#free-and-premium-version-generation "Direct link to Free and Premium Version Generation")

The deployment process lets you maintain **one codebase for both the free [(WordPress.org compatible)](https://freemius.com/help/help/documentation/wordpress-sdk/integration/software-licensing/.md#wordpressorg-compliance) and premium versions** of your [Freemium product](https://freemius.com/blog/freemium-business-model-wordpress/#what_is_a_freemium_wordpress_product).

It works by combining the [Freemius WordPress SDK markers](https://freemius.com/help/help/documentation/wordpress-sdk/integration/software-licensing/.md) in your product with the preprocessor that runs from the Freemius Developer Dashboard ***Deployment*** page.

The Freemius preprocessor will auto-generate **two versions** of your plugin/theme:

### Premium Version[​](#premium-version "Direct link to Premium Version")

This is identical to your uploaded version. This includes all the code and will be available for download only for customers with a valid license (paid or trial).

The generated premium version supports licenses with various plans and pricing depending on your [plans configuration](https://freemius.com/help/help/documentation/wordpress/setup-product-pricing-plans-refunds/.md).

The premium version, along with all future updates, will be served directly to paying customers with an active license (they'll see update notifications via the WP Admin).

### Free Version[​](#free-version "Direct link to Free Version")

The same code with all paid features and premium-only code removed.

![Freemius Dashboard - Deployment with Free and Premium Versions](/help/assets/ideal-img/freemius-dashboard-deployments-versions.de213d9.480.png)

It's also the version that can be submitted to the [WordPress.org repository](#distributing-the-free-version-on-wordpressorg) or distributed on your website.

## How the Free Version is Generated[​](#how-the-free-version-is-generated "Direct link to How the Free Version is Generated")

The [Freemius WordPress SDK](https://freemius.com/help/help/documentation/wordpress-sdk/.md) includes:

* [**Special logic**](https://freemius.com/help/help/documentation/wordpress-sdk/integration/software-licensing/.md#examples) for wrapping premium-only code with special conditional statements for PHP code.
* [**Special meta tags**](https://freemius.com/help/help/documentation/wordpress-sdk/integration/software-licensing/.md#excluding-files-and-folders-from-the-free-plugin-version) to define which files and folders should be included in the respective versions.
* [**Special meta comments**](https://freemius.com/help/help/documentation/wordpress-sdk/integration/software-licensing/.md#handling-licensing-in-javascript) for readme.txt files, JavaScript, and CSS that are used as annotations by the preprocessor to understand what should be included in the free and premium versions.

In practical terms, the preprocessor looks for Freemius markers in your codebase and removes those premium-only parts from the generated free version. That can include full files, folders, PHP methods, PHP `if` blocks, JavaScript blocks, CSS blocks, and paid-only `readme.txt` content.

In the examples below, the **Source / Premium Version** tab represents the code you upload to Freemius. The **Generated Free Version** tab shows what remains after the preprocessor removes premium-only code.

### Example: Multiple Paid Plans With Trials[​](#example-multiple-paid-plans-with-trials "Direct link to Example: Multiple Paid Plans With Trials")

For a plugin with **Professional** and **Business** plans, where both plans can be used during a trial, wrap the premium feature in `is_plan_or_trial__premium_only()`. For example, a booking plugin could make calendar sync available to Professional trials, Professional customers, and higher plans:

* Source / Premium Version
* Generated Free Version

```
add_action( 'admin_init', 'my_plugin_register_basic_booking_fields' );





if ( my_fs()->is_plan_or_trial__premium_only( 'professional' ) ) {

    add_action( 'admin_init', 'my_plugin_enable_calendar_sync' );

}



if ( my_fs()->is_plan_or_trial__premium_only( 'business', true ) ) {

    add_action( 'admin_menu', 'my_plugin_register_client_reports_page' );

}
```

```
add_action( 'admin_init', 'my_plugin_register_basic_booking_fields' );
```

The premium version keeps the basic booking fields, calendar sync, and client reports code. The free version keeps only the basic booking fields and removes the Professional and Business plan logic.

### Example: Exclude Premium Folders And Files[​](#example-exclude-premium-folders-and-files "Direct link to Example: Exclude Premium Folders And Files")

If a feature lives in its own files, mark those files or folders as premium-only in the main plugin file header:

* Source / Premium Version
* Generated Free Version

```
/**

 * Plugin Name: My Booking Plugin

 * Version:     1.0.0

 *

 * @fs_premium_only /includes/calendar-sync/, /assets/js/calendar-sync.js

 */
```

```
my-booking-plugin/

|-- my-booking-plugin.php

|-- includes/

|   |-- booking-form.php

|   |-- calendar-sync/

|   |   |-- class-calendar-sync.php

|   |   `-- providers.php

|   `-- export-bookings__premium_only.php

|-- assets/

|   |-- js/

|   |   |-- booking-form.js

|   |   |-- calendar-sync.js

|   |   `-- revenue-report__premium_only.js

|   `-- css/

|       |-- admin.css

|       `-- revenue-report__premium_only.css

`-- readme.txt
```

```
my-booking-plugin/

|-- my-booking-plugin.php

|-- includes/

|   `-- booking-form.php

|-- assets/

|   |-- js/

|   |   `-- booking-form.js

|   `-- css/

|       `-- admin.css

`-- readme.txt
```

In this example, the `/includes/calendar-sync/` folder and `/assets/js/calendar-sync.js` file are removed because of `@fs_premium_only`. The `export-bookings__premium_only.php`, `revenue-report__premium_only.js`, and `revenue-report__premium_only.css` files are removed because of the `__premium_only` file suffix.

### Example: Exclude PHP Methods[​](#example-exclude-php-methods "Direct link to Example: Exclude PHP Methods")

To mark a method as premium-only, add the `__premium_only` suffix to the method name and wrap the call to it in premium-only logic:

* Source / Premium Version
* Generated Free Version

```
class My_Booking_Plugin {

    public function init() {

        $this->register_booking_form();



        if ( my_fs()->is_plan_or_trial__premium_only( 'professional' ) ) {

            $this->register_calendar_sync__premium_only();

        }

    }



    private function register_booking_form() {

        add_shortcode( 'my_booking_form', array( $this, 'render_booking_form' ) );

    }



    private function register_calendar_sync__premium_only() {

        add_action( 'admin_post_my_plugin_sync_calendar', array( $this, 'sync_calendar' ) );

    }

}
```

```
class My_Booking_Plugin {

    public function init() {

        $this->register_booking_form();

    }



    private function register_booking_form() {

        add_shortcode( 'my_booking_form', array( $this, 'render_booking_form' ) );

    }

}
```

The free version keeps the booking form method and removes the premium-only `if` block and `register_calendar_sync__premium_only()` method.

### Example: Exclude JavaScript Code[​](#example-exclude-javascript-code "Direct link to Example: Exclude JavaScript Code")

If only part of a JavaScript file is premium-only, wrap that part with Freemius meta comments:

* Source / Premium Version
* Generated Free Version

```
(function ($) {

  $('.my-plugin-basic-filter').on('change', refreshBookings);



  /*! <fs_premium_only> */

  $('.my-plugin-calendar-sync').on('click', syncCalendar);

  /*! </fs_premium_only> */

})(jQuery);
```

```
(function ($) {

  $('.my-plugin-basic-filter').on('change', refreshBookings);

})(jQuery);
```

The generated free version keeps the basic filter behavior and removes the calendar sync JavaScript.

### Example: Exclude Paid-Only `readme.txt` Content[​](#example-exclude-paid-only-readmetxt-content "Direct link to example-exclude-paid-only-readmetxt-content")

You can also keep one `readme.txt` while showing different content in the free and premium packages:

* Source / Premium Version
* Generated Free Version

```
== Description ==



Accept booking requests from your website.



== Changelog ==



= 1.2.0 =

[//]: # fs_premium_only_begin

* New: Calendar sync for Professional and Business plans.

[//]: # fs_premium_only_end

* Improved: Booking form compatibility fixes.
```

```
== Description ==



Accept booking requests from your website.



== Changelog ==



= 1.2.0 =

* Improved: Booking form compatibility fixes.
```

For all of these examples, the paid package keeps the premium-only code and content. The free package removes it during deployment.

tip

To learn the complete licensing and code-stripping workflow, including all supported methods and common edge cases, see the [Software Licensing guide](https://freemius.com/help/help/documentation/wordpress-sdk/integration/software-licensing/.md).

## Distributing The Free Version On WordPress.org[​](#distributing-the-free-version-on-wordpressorg "Direct link to Distributing The Free Version On WordPress.org")

Generation Of The Free Version

Ensure that your product has a "Free" plan. If you haven't defined a "Free" plan, only the premium version will be generated when you deploy your product.

If you plan to distribute your free plugin through WordPress.org, use the generated free version from the Freemius Developer Dashboard. This is the package where the preprocessor has removed the premium-only PHP blocks, files, folders, JavaScript, CSS, and `readme.txt` content marked in your codebase.

After deployment, download the free ZIP and commit its contents to the WordPress.org SVN repository as you normally would for a release. Freemius prepares the WordPress.org-compatible package, but it does not publish it to WordPress.org for you.

Once the free version is published on WordPress.org, free users receive updates from WordPress.org. The premium version and its updates continue to be distributed by Freemius only to customers with a valid license or trial.

This separation keeps premium functionality out of the free WordPress.org package, in line with [WordPress.org guidelines](https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/). For more details about update distribution, see [Free Version Updates](https://freemius.com/help/help/documentation/wordpress/software-updates-distribution/.md#free-version-updates).

## Troubleshooting Issues[​](#troubleshooting-issues "Direct link to Troubleshooting Issues")

Whenever you encounter deployment issues, our Developer Dashboard provides a detailed error message and a link to our documentation to help you troubleshoot. Below are some common issues you may encounter during deployment and how to resolve them.

### Corrupted ZIP Files[​](#corrupted-zip-files "Direct link to Corrupted ZIP Files")

Please ensure that you've created the ZIP file using a supported method as outlined in the [ZIP File Creation](https://freemius.com/help/help/documentation/release-management/deployment/.md#zip-file-creation) guide.

### Missing `readme.txt` File[​](#missing-readmetxt-file "Direct link to missing-readmetxt-file")

Freemius requires a `readme.txt` file in the root of your plugin/theme ZIP. It is used to extract the product description and other metadata displayed during [automatic updates](https://freemius.com/help/help/documentation/wordpress/software-updates-distribution/.md#premium-version-updates).

Create a `readme.txt` file in the same manner as you would for a WordPress.org plugin/theme, following the [WordPress.org guidelines](https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/). You can also use a tool like [Plugin Readme Generator](https://generatewp.com/plugin-readme/).

### `uninstall.php` File[​](#uninstallphp-file "Direct link to uninstallphp-file")

When deploying a plugin with Freemius, you cannot include an `uninstall.php` file. Freemius tracks the uninstall event, and due to a [WordPress limitation](https://codex.wordpress.org/Function_Reference/register_uninstall_hook), if this file is present, uninstall data, including [feedback from the user](https://freemius.com/help/help/documentation/analytics/user-feedback/.md), will not be sent.

To resolve this, move the logic from `uninstall.php` into a function and delete the file. Hook the function to the Freemius [uninstall action](https://freemius.com/help/help/documentation/wordpress-sdk/customization/filters-actions-hooks/.md#after_uninstall), which executes after the uninstall event is reported to the server:

```
function my_uninstall_cleanup() {

    // Clean up logic goes here, for example:

    delete_option( "my_plugin_option" );

}

// Not like register_uninstall_hook(), you do NOT have to use a static function.

my_fs()->add_action( "after_uninstall", "my_uninstall_cleanup" );
```

### Missing WordPress SDK[​](#missing-wordpress-sdk "Direct link to Missing WordPress SDK")

Our deployment system requires the WordPress SDK to be included in your plugin or theme. Ensure that you have integrated the SDK correctly by following our [WordPress SDK integration guide](https://freemius.com/help/help/documentation/wordpress/integration-with-sdk/.md).

If you have a reason not to include the WordPress SDK, please contact our support team to discuss your specific use case and explore possible solutions.

## Advanced Usage[​](#advanced-usage "Direct link to Advanced Usage")

The following advanced usage scenarios are supported by the Freemius deployment system:

* [**Semantic Versioning**](https://freemius.com/help/help/documentation/release-management/semantic-versioning/.md): Use semantic versioning to manage your product versions and releases.
* [**Staged Rollouts**](https://freemius.com/help/help/documentation/release-management/staged-rollouts/.md): Gradually release new versions to a subset of users before a full rollout.
* [**Incremental Updates**](https://freemius.com/help/help/documentation/release-management/incremental-update/.md): Deploy updates incrementally to minimize disruption and ensure a smooth user experience.
* [**Beta Releases**](https://freemius.com/help/help/documentation/release-management/deployment/.md#release-the-deployed-version): Release beta versions to a select group of users for testing and feedback before the official release.
