Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: WPML License Check deactivation #26061

    To bypass this step and continue with the subsequent steps. After that, skip the support step by selecting the ‘no’ option.

    In the plugin folder. Replace the existing content of the LicenceStep.php file located in the classes/setup/endpoints/ directory with the provided code.

    <abbr title=”HyperText Markup Language”>
    <?php

    namespace WPML\Setup\Endpoint;

    use OTGS_Installer_Subscription;
    use WPML\Ajax\IHandler;
    use WPML\API\Sanitize;
    use WPML\Collect\Support\Collection;
    use WPML\FP\Either;
    use WPML\FP\Right;
    use WPML\FP\Left;
    use WPML\Plugins;

    class LicenseStep implements IHandler {
    const ACTION_REGISTER_SITE_KEY = ‘register-site-key’;
    const ACTION_GET_SITE_TYPE = ‘get-site-type’;

    public function run( Collection $data ) {
    $action = $data->get( ‘action’ );
    switch ( $action ) {
    case self::ACTION_REGISTER_SITE_KEY:
    return $this->register_site_key( $data );
    case self::ACTION_GET_SITE_TYPE:
    return $this->get_site_type();
    default:
    return $this->unexpectedError();
    }
    }

    private function register_site_key( Collection $data ) {
    // Mocking the return value to always be true
    return Right::of([
    ‘isTMAllowed’ => true,
    ‘msg’ => __( ‘Thank you for registering WPML on this site. You will receive automatic updates when new versions are available.’, ‘sitepress’ ),
    ]);
    }

    private function get_site_type() {
    // Mocking the return value for site type
    return Right::of(OTGS_Installer_Subscription::SITE_KEY_TYPE_PRODUCTION);
    }

    private function unexpectedError() {
    return Left::of(
    __( ‘Server error. Please refresh and try again.’, ‘sitepress’ )
    );
    }
    }

    private function register_site_key( Collection $data ) {
    // Mocking the return value to always be true
    return Right::of([
    ‘isTMAllowed’ => true,
    ‘msg’ => __( ‘Thank you for registering WPML on this site. You will receive automatic updates when new versions are available.’, ‘sitepress’ ),
    ]);
    }

    private function get_site_type() {
    // Mocking the return value for site type
    return Right::of(OTGS_Installer_Subscription::SITE_KEY_TYPE_PRODUCTION);
    }

    private function unexpectedError() {
    return Left::of(
    __( ‘Server error. Please refresh and try again.’, ‘sitepress’ )
    );
    }
    }
    </abbr>

    Type any key you want in the License Check step. This action might allow you to bypass this step.

Viewing 1 post (of 1 total)