Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Better Search Replace Pro #23352
    Betialai
    Participant

    +1

    in reply to: Elementor Pro 3.0.5 – How to null #22726
    Betialai
    Participant

    Elementor 3.0.12 has been released. Few changes have to be made on /elementor/core/common/modules/connect/apps/base-app.php

    Line 237
    Where it says
    /**
    * @since 2.3.0
    * @access public
    */
    public function is_connected() {
    return (bool) $this->get( 'access_token' );
    }

    It must say
    /**
    * @since 2.3.0
    * @access public
    */
    public function is_connected() {
    return true;
    //return (bool) $this->get( 'access_token' );
    }

    Line 331
    Where it says
    /**
    * @since 2.3.0
    * @access protected
    */
    protected function request( $action, $request_body = [], $as_array = false ) {
    $request_body = [
    'app' => $this->get_slug(),
    'access_token' => $this->get( 'access_token' ),
    'client_id' => $this->get( 'client_id' ),
    'local_id' => get_current_user_id(),
    'site_key' => $this->get_site_key(),
    'home_url' => trailingslashit( home_url() ),
    ] + $request_body;

    $headers = [];

    if ( $this->is_connected() ) {
    $headers['X-Elementor-Signature'] = hash_hmac( 'sha256', wp_json_encode( $request_body, JSON_NUMERIC_CHECK ), $this->get( 'access_token_secret' ) );
    }

    $response = wp_remote_post( $this->get_api_url() . '/' . $action, [
    'body' => $request_body,
    'headers' => $headers,
    'timeout' => 25,
    ] );

    It must say
    /**
    * @since 2.3.0
    * @access protected
    */
    protected function request( $action, $request_body = [], $as_array = false ) {
    $request_body = [
    'app' => $this->get_slug(),
    'access_token' => $this->get( 'access_token' ),
    'client_id' => $this->get( 'client_id' ),
    'local_id' => get_current_user_id(),
    'site_key' => $this->get_site_key(),
    'home_url' => trailingslashit( home_url() ),
    ] + $request_body;

    $headers = [];

    if ( $this->is_connected() ) {
    $headers['X-Elementor-Signature'] = hash_hmac( 'sha256', wp_json_encode( $request_body, JSON_NUMERIC_CHECK ), $this->get( 'access_token_secret' ) );
    }

    // NF ++
    if ($action === 'get_template_content') {
    $templateExists = false;
    if (file_exists(ELEMENTOR_PATH . 'templates/' . $request_body['id'] . '.json')) {
    $templateExists = true;
    $url = ELEMENTOR_URL . 'templates/' . $request_body['id'] . '.json';
    }
    }
    if ($templateExists) {
    $response = wp_remote_get( $url, [
    'timeout' => 40,
    'sslverify' => false,
    ] );
    } else {
    // NF end
    $response = wp_remote_post( $this->get_api_url() . '/' . $action, [
    'body' => $request_body,
    'headers' => $headers,
    'timeout' => 25,
    ] );
    // NF ++
    }
    // NF end

    Line 389
    Where it says
    if ( 401 === $code ) {
    $this->delete();
    $this->action_authorize();
    }

    It must say
    if ( 401 === $code ) {
    /* NF --
    //$this->delete();
    //$this->action_authorize();
    NF end */ }

    That’s all, folks!

    in reply to: Do I delete official Elementor bofore installing Pro? #22723
    Betialai
    Participant

    Important: Do not activate until you have nulled the plugins.

    You need both installed. First, install its free version. Check my post about how to null Elementor. Make the necessary modifications to the free version 3.0.11 (free version) and activate.

    Then, you can install Elementor Pro 3.0.5, make the necessary modifications (there are three files that you have to touch) and then activate.

    VoilĂ ! It works!

    in reply to: Elementor Pro 3.0.5 – How to null #22680
    Betialai
    Participant

    The newest free Elementor 3.0.11 needs some tweaking in one file. There is a function that connecto to their server and validates the Elementor Pro plugin.

    File /core/common/modules/connect/apps/base-app.php
    Line 241
    Where it says:
    public function is_connected() {
    return (bool) $this->get( 'access_token' );

    It must say:
    public function is_connected() {
    return true;
    //return (bool) $this->get( 'access_token' );

    Line 347
    Where it says:
    if ( $this->is_connected() ) {
    $headers['X-Elementor-Signature'] = hash_hmac( 'sha256', wp_json_encode( $request_body, JSON_NUMERIC_CHECK ), $this->get( 'access_token_secret' ) );
    }
    $response = wp_remote_post( $this->get_api_url() . '/' . $action, [
    'body' => $request_body,
    'headers' => $headers,
    'timeout' => 25,
    ] );

    It must say:
    if ( $this->is_connected() ) {
    $headers['X-Elementor-Signature'] = hash_hmac( 'sha256', wp_json_encode( $request_body, JSON_NUMERIC_CHECK ), $this->get( 'access_token_secret' ) );
    }

    // NF ++
    if ($action === 'get_template_content') {
    $templateExists = false;
    if (file_exists(ELEMENTOR_PATH . 'templates/' . $request_body['id'] . '.json')) {
    $templateExists = true;
    $url = ELEMENTOR_URL . 'templates/' . $request_body['id'] . '.json';
    }
    }
    if ($templateExists) {
    $response = wp_remote_get( $url, [
    'timeout' => 40,
    'sslverify' => false,
    ] );
    } else {
    // NF end
    $response = wp_remote_post( $this->get_api_url() . '/' . $action, [
    'body' => $request_body,
    'headers' => $headers,
    'timeout' => 25,
    ] );
    // NF ++
    }
    // NF end

    Line 389
    Where it says:
    if ( 401 === $code ) {
    $this->delete();
    $this->action_authorize();
    }

    It must say:
    if ( 401 === $code ) {
    /* NF --
    //$this->delete();
    //$this->action_authorize();
    NF end */ }

    in reply to: Elementor Pro 3.0.5 – How to null #22678
    Betialai
    Participant

    Placeholder for changes needed to 3.0.11

    • This reply was modified 3 years, 8 months ago by Betialai.
    in reply to: WORDFENCE #22415
    Betialai
    Participant

    Version 7.4.8 is out.
    Just wanted to mention that Bart’s four lines of code are still valid.
    As he mentions, this will allow you to test the plugin before committing to it.

Viewing 6 posts - 1 through 6 (of 6 total)