How to fully emulate an active WPML subscription (beyond setup)

This post is also available in: Українська Русский

The standard setup bypass gets you past the initial wizard, but online functions like updates, translations, and theme/plugin registration remain inactive. For development or testing environments where you need full functionality without immediate key access, a more comprehensive approach is required.

This guide shows how to modify the subscription check at its source, making WPML and its add-ons believe they are registered with an active, valid license.

The Approach

Instead of just bypassing the initial key check, we will modify the class responsible for parsing the subscription data from the OTGS Installer API. By replacing the real response parser with our own that returns a hardcoded “active subscription” object, we can trick all dependent components.

Step-by-step guide

Step 1 — Locate the correct file

First, navigate to the main WPML plugin folder on your server via FTP or file manager. Find the file located at:

/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/src/Api/Endpoint/Subscription.php

This file contains the Subscription class, which handles the API response containing license information.

Step 2 — Replace the parseResponse method

Open Subscription.php and locate the parseResponse method. Its original code attempts to fetch and unserialize a real response from the WPML servers.

Replace the entire function block:

public function parseResponse( $response ) {
        $body = wp_remote_retrieve_body( $response );
        if ( ! $body || ! is_serialized( $body ) || ! ( $apiResponse = @unserialize( $body ) ) ) {
            throw new InvalidResponseException();
        }

        if ( isset( $apiResponse->error ) ) {
            throw new InvalidSubscription( $apiResponse->error );
        }

        if ( isset( $apiResponse->subscription_data )
             && isset( $apiResponse->site_key )) {
            return $apiResponse;
        }

        throw  new InvalidSubscriptionResponseException();
    }

With this modified version:

public function parseResponse( $response ) {

        $apiResponse = new \stdClass();

        // Create a fake subscription_data object with active status
        $apiResponse->subscription_data = new \stdClass();
        $apiResponse->subscription_data->status = 1;              // 1 = SUBSCRIPTION_STATUS_ACTIVE
        $apiResponse->subscription_data->expires = '2027-01-01';  // Far future expiry date
        $apiResponse->subscription_data->subscription_type = 1;   // Any valid type ID
        $apiResponse->subscription_data->notes = '';

        // Create a fake site_key array
        $apiResponse->site_key = [
            'type' => 0,  // 0 = SITE_KEY_TYPE_PRODUCTION, 1 = DEVELOPMENT
        ];
       
        return $apiResponse;

        // This original exception will never be reached
        throw  new InvalidSubscriptionResponseException();
    }

What this does

Step 3 — Complete the setup wizard

  1. Save the Subscription.php file after making the changes.
  2. Go to Plugins → WPML in your WordPress admin to start or continue the setup wizard.
  3. When prompted for the Site Key on step 3, enter any dummy key — for example, 0123456789.
  4. Proceed through the wizard. WPML will now accept the key and complete the setup.

Step 4 — Verify the result

After completing the wizard, check the following:

⚠️ Critical Warning

This is an invasive modification that completely replaces core license verification logic. Use it only on development/staging sites, never on production.

Restoring original functionality

When you’re ready to use a real license:

  1. Replace the modified file with the original Subscription.php (restore from backup or reinstall the WPML plugin).
  2. Enter your real Site Key in Plugins → WPML → Account.
  3. The site will then register correctly with the WPML servers.

Final Note

This method provides a more complete emulation of an active subscription than the basic setup bypass. It’s useful for client demonstrations, testing complex multilingual configurations, or developing custom translation workflows without an immediate license purchase. However, it’s still a temporary technical measure — if you’re using WPML on a live site, always support the developers by purchasing a valid license.


⚠️ Disclaimer

The information in this article is provided for educational purposes only. The author accepts no responsibility for any consequences resulting from the methods described — including any changes to files, database, or site functionality.

All actions are performed at your own risk. Before making changes, always create a full backup of your site and database.

The workaround described here is a temporary technical measure for emergency or development situations. WPML is a commercial product. Long-term use without a valid license violates the software’s terms of service. Please support the developers — purchase and register your license through official channels.

#WordPress #WPML