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!