- This topic has 10 replies, 8 voices, and was last updated 2 years, 8 months ago by Tushar Thakur.
-
AuthorPosts
-
September 26, 2020 at 10:19 am #22657BetialaiParticipant
Note to admins: If this is not allowed, please delete this message. Thanks.
Pretty straightforward:
Three files need to be modified.- /licenses/admin.php
Line 150
Where it says:
public function display_page() {
$license_key = self::get_license_key();$is_manual_mode = ( isset( $_GET['mode'] ) && 'manually' === $_GET['mode'] );
It must say:
public function display_page() {
$license_key = self::get_license_key();$is_manual_mode = true;
Line 179
Where it says:
$license_data = array(
'success'=>true,
'license'=>'valid',
'item_name'=>'Elementor Pro',
'license_limit'=>999,
'site_count'=>1,
'expires'=>'2048-06-06 23:59:59',
'activations_left'=>998,
'payment_id'=>'12345',
'customer_name'=>'*********',
'customer_email'=>'[email protected]',
'price_id'=>'1'
); ?>
It must say:
$license_data = API::get_license_data( true ); ?>
- /license/api.php
Line 27
Where it says:
private static function remote_post( $body_args = [] ) {
$body_args = wp_parse_args(
It must say:
private static function remote_post( $body_args = [] ) {
return ['license' => 'valid', 'expires' => 'lifetime', 'subscriptions', 'enable', 'renewal_discount','',];
$body_args = wp_parse_args(
Line 38
Where it says:
$response = 200;
It must say:
$response = wp_remote_post( self::STORE_URL, [
'timeout' => 40,
'body' => $body_args,
] );if ( is_wp_error( $response ) ) {
return $response;
}$response_code = wp_remote_retrieve_response_code( $response );
if ( 200 !== (int) $response_code ) {
return new \WP_Error( $response_code, __( 'HTTP Error', 'elementor-pro' ) );
}
Line 40
Where it says:
$data = json_decode( wp_remote_retrieve_body( $response ), true );
$data = array(
'success'=>true,
'license'=>'valid',
'item_name'=>'Elementor Pro',
'license_limit'=>999,
'site_count'=>1,
'expires'=>'2050-01-01 23:59:59',
'activations_left'=>998,
'payment_id'=>'12345',
'customer_name'=>'*********',
'customer_email'=>'[email protected]',
'price_id'=>'1'
);return $data;
}
It must say:
$data = json_decode( wp_remote_retrieve_body( $response ), true );
if ( empty( $data ) || ! is_array( $data ) ) {
return new \WP_Error( 'no_json', __( 'An error occurred, please try again', 'elementor-pro' ) );
}return $data;
}
Line 62
Where it says:
'license' => '*********************************',
];$license_data = array(
'success'=>true,
'license'=>'valid',
'item_name'=>'Elementor Pro',
'license_limit'=>999,
'site_count'=>1,
'expires'=>'2050-01-01 23:59:59',
'activations_left'=>998,
'payment_id'=>'12345',
'customer_name'=>'*********',
'customer_email'=>'[email protected]',
'price_id'=>'1'
);
It must say:
'license' => $license_key,
];$license_data = self::remote_post( $body_args );
Line 88
Where it says:
$license_data = array(
'success'=>true,
'license'=>'valid',
'item_name'=>'Elementor Pro',
'license_limit'=>999,
'site_count'=>1,
'expires'=>'2050-01-01 23:59:59',
'activations_left'=>998,
'payment_id'=>'12345',
'customer_name'=>'*********',
'customer_email'=>'[email protected]',
'price_id'=>'1'
);
It must say:
$license_data = self::remote_post( $body_args );
Line 124
Where it says:
public static function set_license_data( $license_data, $expiration = null ) {
$expiration = 'lifetime';
self::set_transient( '_elementor_pro_license_data_fallback', $license_data, '+24 hours' );
self::set_transient( '_elementor_pro_license_data', $license_data, $expiration );
}
It must say:
public static function set_license_data( $license_data, $expiration = null ) {
if ( null === $expiration ) {
$expiration = '+12 hours';self::set_transient( Admin::LICENSE_DATA_FALLBACK_OPTION_NAME, $license_data, '+24 hours' );
}self::set_transient( Admin::LICENSE_DATA_OPTION_NAME, $license_data, $expiration );
}
Right underneath, on line 134
Where it says:
public static function get_license_data( $force_request = false ) {
$license_data = array(
'success'=>true,
'license'=>'valid',
'item_name'=>'Elementor Pro',
'license_limit'=>999,
'site_count'=>1,
'expires'=>'2050-01-01 23:59:59',
'activations_left'=>998,
'payment_id'=>'12345',
'customer_name'=>'*********',
'customer_email'=>'[email protected]',
'price_id'=>'1'
);return $license_data;
It must say:
public static function get_license_data( $force_request = false ) {
$license_data_error = [
'license' => 'http_error',
'payment_id' => '0',
'license_limit' => '0',
'site_count' => '0',
'activations_left' => '0',
'success' => false,
];
There is no return, that is correct.
Line 156
Where it says:
$license_data = self::get_transient( '_elementor_pro_license_data' );
It must say:
$license_data = self::get_transient( Admin::LICENSE_DATA_OPTION_NAME );
Line 164
Where it says:
$license_data = array(
'success'=>true,
'license'=>'valid',
'item_name'=>'Elementor Pro',
'license_limit'=>999,
'site_count'=>1,
'expires'=>'2050-01-01 23:59:59',
'activations_left'=>998,
'payment_id'=>'12345',
'customer_name'=>'*********',
'customer_email'=>'[email protected]',
'price_id'=>'1'
);
It must say:
$license_data = self::remote_post( $body_args );
Line 179
Where it says:
$license_data = self::get_transient( '_elementor_pro_license_data_fallback' );
It must say:
$license_data = self::get_transient( Admin::LICENSE_DATA_FALLBACK_OPTION_NAME );
Line 325
Where it says:
$error_msg = '';
It must say:
if ( isset( $errors[ $error ] ) ) {
$error_msg = $errors[ $error ];
} else {
$error_msg = __( 'An error occurred. Please check your internet connection and try again. If the problem persists, contact our support.', 'elementor-pro' ) . ' (' . $error . ')';
}
Line 335
Where it says:
return true;
It must say:
return self::STATUS_VALID === $license_data['license'];
Line 340
Where it says:
return false;
It must say:
if ( ! empty( $license_data['subscriptions'] ) && 'enable' === $license_data['subscriptions'] ) {
return false;
}if ( 'lifetime' === $license_data['expires'] ) {
return false;
}
- /elementor-pro.php
Line 17
Delete:
update_option( 'elementor_pro_license_key', 'activated' );
set_transient( 'elementor_pro_license_data', [ 'license' => 'valid', 'expires' => '01.01.2030' ] );
set_transient( 'timeout_elementor_pro_license_data', 1893456000 );
Line 21
Where it says:
define( 'ELEMENTOR_PRO_VERSION', '3.0.2' );
It must say:
define( 'ELEMENTOR_PRO_VERSION', '3.0.5' );
Line 31
Right underneath
define( 'ELEMENTOR_PRO_MODULES_URL', ELEMENTOR_PRO_URL . 'modules/' );
Insert these two lines
update_option( 'elementor_pro_license_key', 'activated' );
update_option( '_elementor_pro_license_data', [ 'timeout' => strtotime( '+12 hours', current_time( 'timestamp' ) ),'value' => json_encode( [ 'license' => 'valid', 'expires' => 'lifetime','renewal_discount' => '', 'subscriptions' => 'enable' ] ) ] );That’s all, folks!
October 1, 2020 at 3:00 pm #22676Gabriel A.ParticipantThank you very much! It worked well :D
October 2, 2020 at 9:38 am #22678BetialaiParticipantPlaceholder for changes needed to 3.0.11
- This reply was modified 4 years ago by Betialai.
October 2, 2020 at 9:49 am #22680BetialaiParticipantThe 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 */ }October 21, 2020 at 12:22 pm #22726BetialaiParticipantElementor 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!
November 11, 2020 at 1:09 pm #22756Mitch CohenParticipantI’m a little confused at all the posts.
Does both free and pro need to be modified?November 13, 2020 at 6:35 am #22760Jackie MasekParticipantExcellent question! WHAT program needs to be modified? I am assuming just the pro version but could someone clarify, please?
December 11, 2020 at 1:26 pm #22980Guillo RaParticipantHi Betialai
Is this file modification working for Version 3.0.14?February 1, 2021 at 1:30 pm #23057Daniel ArroyoParticipantis this working with the 3.0.10 version that is here to dowload ?
November 8, 2021 at 10:55 am #23640Bernz CaasiParticipantHello, I am using this for my clients. Will using null plugins have a negative impact on the website of my clients?
February 8, 2022 at 3:36 pm #23854Tushar ThakurParticipantall users are in comments have zero knowledge of code but talking about making a null, null is just for whom they have purchased a license and want to use some more place too
-
AuthorPosts
- You must be logged in to reply to this topic.