Skip to content

Instantly share code, notes, and snippets.

@lupetalo
Last active April 6, 2024 20:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lupetalo/38e6d40b620b7da976c42c2d207c674a to your computer and use it in GitHub Desktop.
Save lupetalo/38e6d40b620b7da976c42c2d207c674a to your computer and use it in GitHub Desktop.
Elementor Activator
<?php
/**
* Plugin Name: Elementor Activation
* Description: Activates Elementor Pro - Not everybody have shell acces to run WP CLI or desire for eveybody to see license key. Manual activation is needed, and since Elementor wont add this, community will :)
* Plugin URI: https://github.com/elementor/elementor/issues/8667
* Gist Plugin URI: https://gist.github.com/lupetalo/38e6d40b620b7da976c42c2d207c674a
* Version: 1.3
*/
add_filter('pre_http_request', function($request, $request_params, $url){
if (strpos($url, 'my.elementor.com/api/v2/license/')!==false){
$response=[
"expires"=>"lifetime",
"subscription_id"=>"internal",
"status"=>"lifetime",
"recurring"=>true,
"features"=>[
"experts",
"template_access_level_20",
"kit_access_level_20",
"editor_comments"
],
"activated"=>true,
"success"=>true
];
$request['response']=[
"code"=>200,
"message"=>"OK"
];
$request['body']=json_encode($response);
return $request;
}
return false;
}, 1, 3);
add_action('elementor/init', function(){
if (!get_option('elementor_pro_license_key', false)){
\ElementorPro\Plugin::elementor()->admin->get_component('admin-notices')->print_admin_notice([
'title'=>"Elementor is Now Active",
'description'=>"Not everybody have shell acces to run WP CLI or desire for eveybody to see license key. Manual activation is needed, and since Elementor wont add this, community will :)" . $out,
'button'=>[
'text'=>'<i class="dashicons dashicons-update" aria-hidden="true"></i>Check Github Issue',
'url'=>"https://github.com/elementor/elementor/issues/8667",
'target'=>"_blank",
],
]);
update_option('elementor_pro_license_key', 'removed');
}
if (!get_option('elementor_connect_site_key', false)){
update_option('elementor_connect_site_key', 'removed');
}
add_filter('elementor/connect/additional-connect-info', '__return_empty_array', 999);
}, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment