-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmain.php
More file actions
134 lines (128 loc) · 7.1 KB
/
Copy pathmain.php
File metadata and controls
134 lines (128 loc) · 7.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
/**
* @wordpress-plugin
* Plugin Name: Elementor Pro Activ@tor
* Plugin URI: https://bit.ly/elm-act
* Description: Elementor Pro Plugin Activ@tor
* Version: 1.6.0
* Requires at least: 5.9.0
* Requires PHP: 7.2
* Author: moh@medhk2
* Author URI: https://bit.ly/medhk2
**/
defined( 'ABSPATH' ) || exit;
use Elementor\Plugin;
use ElementorPro\License\Admin;
use ElementorPro\License\API;
$PLUGIN_NAME = 'Elementor Pro Activ@tor';
$PLUGIN_DOMAIN = 'elementor-pro-activ@tor';
extract( require_once __DIR__ . DIRECTORY_SEPARATOR . 'functions.php' );
if (
$admin_notice_ignored()
|| $admin_notice_plugin_install( 'elementor-pro/elementor-pro.php', null, 'Elementor Pro', $PLUGIN_NAME, $PLUGIN_DOMAIN )
|| $admin_notice_plugin_install( 'elementor/elementor.php', 'elementor', 'Elementor', $PLUGIN_NAME, $PLUGIN_DOMAIN )
|| $admin_notice_plugin_activate( 'elementor/elementor.php', $PLUGIN_NAME, $PLUGIN_DOMAIN )
|| $admin_notice_plugin_activate( 'elementor-pro/elementor-pro.php', $PLUGIN_NAME, $PLUGIN_DOMAIN )
) {
return;
}
$license_data = function () {
$has = function ( $class, $attribute ): bool {
return class_exists( $class ) && defined( "$class::$attribute" );
};
return [
'success' => true,
'payment_id' => '0123456789',
'license_limit' => 1000,
'site_count' => 1,
'activations_left' => 1000,
'expires' => 'lifetime',
'subscription_id' => 'Free 4 All',
'tier' => 'Advanced',
'features' => [
$has( 'ElementorPro\Modules\CustomCode\Module', 'MODULE_NAME' )
? ElementorPro\Modules\CustomCode\Module::MODULE_NAME : 'custom_code',
$has( 'ElementorPro\Modules\Forms\Submissions\Component', 'NAME' )
? ElementorPro\Modules\Forms\Submissions\Component::NAME : 'form-submissions',
$has( 'ElementorPro\Modules\Popup\Module', 'DOCUMENT_TYPE' )
? ElementorPro\Modules\Popup\Module::DOCUMENT_TYPE : 'popup',
$has( 'ElementorPro\Modules\RoleManager\Module', 'ROLE_MANAGER_OPTION_NAME' )
? ElementorPro\Modules\RoleManager\Module::ROLE_MANAGER_OPTION_NAME : 'role-manager',
$has( 'ElementorPro\Modules\AtomicForm\Module', 'AKISMET_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\AtomicForm\Module::AKISMET_LICENSE_FEATURE_NAME : 'akismet',
$has( 'ElementorPro\Modules\CustomAttributes\Module', 'LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\CustomAttributes\Module::LICENSE_FEATURE_NAME : 'custom-attributes',
$has( 'ElementorPro\Modules\CustomCode\AdminMenuItems\Custom_Code_Menu_Item', 'LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\CustomCode\AdminMenuItems\Custom_Code_Menu_Item::LICENSE_FEATURE_NAME : 'custom_code',
$has( 'ElementorPro\Modules\CustomCss\Module', 'LICENSE_FEATURE_NAME_GLOBAL' )
? ElementorPro\Modules\CustomCss\Module::LICENSE_FEATURE_NAME_GLOBAL : 'global-css',
$has( 'ElementorPro\Modules\CustomCss\Module', 'LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\CustomCss\Module::LICENSE_FEATURE_NAME : 'custom-css',
$has( 'ElementorPro\Modules\DisplayConditions\Module', 'LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\DisplayConditions\Module::LICENSE_FEATURE_NAME : 'display-conditions',
$has( 'ElementorPro\Modules\DynamicTags\Module', 'LICENSE_FEATURE_ACF_NAME' )
? ElementorPro\Modules\DynamicTags\Module::LICENSE_FEATURE_ACF_NAME : 'dynamic-tags-acf',
$has( 'ElementorPro\Modules\DynamicTags\Module', 'LICENSE_FEATURE_TOOLSET_NAME' )
? ElementorPro\Modules\DynamicTags\Module::LICENSE_FEATURE_TOOLSET_NAME : 'dynamic-tags-toolset',
$has( 'ElementorPro\Modules\DynamicTags\Module', 'LICENSE_FEATURE_PODS_NAME' )
? ElementorPro\Modules\DynamicTags\Module::LICENSE_FEATURE_PODS_NAME : 'dynamic-tags-pods',
$has( 'ElementorPro\Modules\DynamicTags\Module', 'LICENSE_FEATURE_DYNAMIC_TAGS_NAME' )
? ElementorPro\Modules\DynamicTags\Module::LICENSE_FEATURE_DYNAMIC_TAGS_NAME : 'dynamic-tags',
$has( 'ElementorPro\Modules\ElementManager\Module', 'LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\ElementManager\Module::LICENSE_FEATURE_NAME : 'element-manager-permissions',
$has( 'ElementorPro\Modules\Forms\Module', 'AKISMET_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Forms\Module::AKISMET_LICENSE_FEATURE_NAME : 'akismet',
$has( 'ElementorPro\Modules\Forms\Module', 'ACTIVITY_LOG_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Forms\Module::ACTIVITY_LOG_LICENSE_FEATURE_NAME : 'activity-log',
$has( 'ElementorPro\Modules\Forms\Module', 'CF7DB_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Forms\Module::CF7DB_LICENSE_FEATURE_NAME : 'cf7db',
$has( 'ElementorPro\Modules\GlobalWidget\Module', 'LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\GlobalWidget\Module::LICENSE_FEATURE_NAME : 'global-widget',
$has( 'ElementorPro\Modules\Notes\Module', 'LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Notes\Module::LICENSE_FEATURE_NAME : 'editor_comments',
$has( 'ElementorPro\Modules\Payments\Module', 'STRIPE_LICENCE_FEATURE_NAME' )
? ElementorPro\Modules\Payments\Module::STRIPE_LICENCE_FEATURE_NAME : 'stripe-button',
$has( 'ElementorPro\Modules\Woocommerce\Module', 'SITE_SETTINGS_PAGES_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Woocommerce\Module::SITE_SETTINGS_PAGES_LICENSE_FEATURE_NAME : 'settings-woocommerce-pages',
$has( 'ElementorPro\Modules\Woocommerce\Module', 'SITE_SETTINGS_NOTICES_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Woocommerce\Module::SITE_SETTINGS_NOTICES_LICENSE_FEATURE_NAME : 'settings-woocommerce-notices',
$has( 'ElementorPro\Modules\Woocommerce\Module', 'MENU_CART_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Woocommerce\Module::MENU_CART_LICENSE_FEATURE_NAME : 'woocommerce-menu-cart',
$has( 'ElementorPro\Modules\Woocommerce\Module', 'SINGLE_PRODUCT_TEMPLATE_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Woocommerce\Module::SINGLE_PRODUCT_TEMPLATE_LICENSE_FEATURE_NAME : 'product-single',
$has( 'ElementorPro\Modules\Woocommerce\Module', 'ARCHIVE_PRODUCT_TEMPLATE_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Woocommerce\Module::ARCHIVE_PRODUCT_TEMPLATE_LICENSE_FEATURE_NAME : 'product-archive',
$has( 'ElementorPro\Modules\Woocommerce\Module', 'DYNAMIC_TAGS_LICENSE_FEATURE_NAME' )
? ElementorPro\Modules\Woocommerce\Module::DYNAMIC_TAGS_LICENSE_FEATURE_NAME : 'dynamic-tags-wc',
'atomic-custom-css',
'atomic-custom-attributes',
'theme-builder',
'pro-interactions',
'transitions',
'size-variable',
],
];
};
add_action( 'admin_init', function () use ( $license_data ) {
if ( class_exists( Admin::class ) ) {
Admin::set_license_key( md5( 'free4all' ) );
}
if ( class_exists( API::class ) ) {
API::set_transient( Admin::LICENSE_DATA_OPTION_NAME, $license_data(), '+1000 year' );
}
if ( isset( Plugin::$instance ) ) {
$admin = Plugin::$instance->admin;
if ( $admin ) {
remove_filter( 'admin_footer_text', [ $admin, 'admin_footer_text' ] );
}
}
} );
add_filter( 'pre_http_request', function ( $pre, $parsed_args, $url ) use ( $license_data, $json_response ) {
if ( class_exists( API::class ) ) {
switch ( $url ) {
case API::BASE_URL . 'license/validate':
return $json_response( $license_data() );
}
}
return $pre;
}, 99, 3 );