-
-
Save salmanrazak/ed486e21547bde3c15fb309ee3ec0bd9 to your computer and use it in GitHub Desktop.
Elementor Activator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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