PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.0.9
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.0.9
3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 172 releases
master-addons / master-addons.php

master-addons.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.0.9, at master-addons.php

222 lines 8.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: Master Addons for Elementor
5 * Description: Master Addons is easy and must have Elementor Addons for WordPress Page Builder. Clean, Modern, Hand crafted designed Addons blocks.
6 * Plugin URI: https://master-addons.com/all-widgets/
7 * Author: Jewel Theme
8 * Author URI: https://master-addons.com
9 * Text Domain: master-addons
10 * Domain Path: /languages
11 * Version: 3.0.9
12 * Elementor tested up to: 4.0.3
13 * Elementor Pro tested up to: 4.0.3
14 * Wordfence Vendor Key: qgxtflvqaabgarz4gu9nozmceloswzrg
15 *
16 */
17 // No, Direct access Sir !!!
18 if ( !defined( 'ABSPATH' ) ) {
19 exit;
20 }
21 $jltma_plugin_data = get_file_data( __FILE__, array(
22 'Version' => 'Version',
23 'Plugin Name' => 'Plugin Name',
24 'Author' => 'Author',
25 'Description' => 'Description',
26 'Plugin URI' => 'Plugin URI',
27 ), false );
28 if ( !function_exists( 'jltma_menu_params__premium_only' ) ) {
29 }
30 if ( function_exists( 'ma_el_fs' ) ) {
31 ma_el_fs()->set_basename( false, __FILE__ );
32 } elseif ( !function_exists( 'ma_el_fs' ) ) {
33 // Create a helper function for easy SDK access.
34 function ma_el_fs() {
35 global $ma_el_fs;
36 if ( !isset( $ma_el_fs ) ) {
37 // Activate multisite network integration.
38 if ( !defined( 'WP_FS__PRODUCT_4015_MULTISITE' ) ) {
39 define( 'WP_FS__PRODUCT_4015_MULTISITE', true );
40 }
41 // Include Freemius SDK.
42 require_once __DIR__ . '/lib/freemius/start.php';
43 $jltma_el_menu = array(
44 'slug' => 'master-addons-settings',
45 'first-path' => 'admin.php?page=master-addons-settings',
46 'account' => false,
47 'network' => false,
48 'support' => false,
49 'contact' => false,
50 'affiliation' => false,
51 'pricing' => true,
52 'addons' => false,
53 );
54 $ma_el_fs = fs_dynamic_init( array(
55 'id' => '4015',
56 'slug' => 'master-addons',
57 'premium_slug' => 'master-addons-pro',
58 'type' => 'plugin',
59 'public_key' => 'pk_3c9b5b4e47a06288e3500c7bf812e',
60 'premium_suffix' => 'Premium',
61 'has_affiliation' => 'selected',
62 'has_addons' => false,
63 'has_paid_plans' => true,
64 'is_org_compliant' => true,
65 'menu' => ( function_exists( 'jltma_menu_params__premium_only' ) ? jltma_menu_params__premium_only() : $jltma_el_menu ),
66 'trial' => false,
67 'is_live' => true,
68 'parallel_activation' => array(
69 'enabled' => true,
70 'premium_version_basename' => 'master-addons-pro/master-addons.php',
71 ),
72 'is_premium' => false,
73 ) );
74 }
75 return $ma_el_fs;
76 }
77
78 // Init Freemius.
79 ma_el_fs();
80 // Disable automatic plugin deactivation on activation
81 ma_el_fs()->add_filter( 'deactivate_on_activation', '__return_false' );
82 // After Freemius consent (connect or skip), go to the settings page
83 // only when the free plugin is active. Otherwise redirect to the
84 // plugins list so the user sees the "install/activate Master Addons
85 // Free" notice instead of a settings page that triggers WordPress's
86 // "Sorry, you are not allowed to access this page." error.
87 // Setup wizard runs first via admin_init redirect; by the time
88 // Freemius consent shows, the wizard is already complete.
89 ma_el_fs()->add_filter( 'after_connect_url', function ( $url ) {
90 if ( is_plugin_active( 'master-addons/master-addons.php' ) ) {
91 return admin_url( 'admin.php?page=master-addons-settings' );
92 }
93 return admin_url( 'plugins.php' );
94 } );
95 ma_el_fs()->add_filter( 'after_skip_url', function ( $url ) {
96 if ( is_plugin_active( 'master-addons/master-addons.php' ) ) {
97 return admin_url( 'admin.php?page=master-addons-settings' );
98 }
99 return admin_url( 'plugins.php' );
100 } );
101 // Signal that SDK was initiated.
102 do_action( 'ma_el_fs_loaded' );
103 }
104 if ( !defined( 'JLTMA' ) ) {
105 define( 'JLTMA', $jltma_plugin_data['Plugin Name'] );
106 }
107 if ( !defined( 'JLTMA_PLUGIN_AUTHOR' ) ) {
108 define( 'JLTMA_PLUGIN_AUTHOR', $jltma_plugin_data['Author'] );
109 }
110 if ( !defined( 'JLTMA_PLUGIN_DESC' ) ) {
111 define( 'JLTMA_PLUGIN_DESC', $jltma_plugin_data['Description'] );
112 }
113 if ( !defined( 'JLTMA_PLUGIN_URI' ) ) {
114 define( 'JLTMA_PLUGIN_URI', $jltma_plugin_data['Plugin URI'] );
115 }
116 if ( !defined( 'JLTMA_VER' ) ) {
117 define( 'JLTMA_VER', $jltma_plugin_data['Version'] );
118 }
119 if ( !defined( 'JLTMA_BASE' ) ) {
120 define( 'JLTMA_BASE', plugin_basename( __FILE__ ) );
121 }
122 if ( !defined( 'JLTMA_SLUG' ) ) {
123 define( 'JLTMA_SLUG', dirname( plugin_basename( __FILE__ ) ) );
124 }
125 if ( !defined( 'JLTMA_FILE' ) ) {
126 define( 'JLTMA_FILE', __FILE__ );
127 }
128 if ( !defined( 'JLTMA_PATH' ) ) {
129 define( 'JLTMA_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
130 }
131 if ( !defined( 'JLTMA_PLUGIN_PATH' ) ) {
132 define( 'JLTMA_PLUGIN_PATH', trailingslashit( plugin_dir_path( __FILE__ ) . 'inc/admin/theme-builder' ) );
133 }
134 //Defined Constants
135 if ( !defined( 'JLTMA_BADGE' ) ) {
136 define( 'JLTMA_BADGE', '<span class="jltma-badge"></span>' );
137 }
138 if ( !defined( 'JLTMA_EXTENSION_BADGE' ) ) {
139 define( 'JLTMA_EXTENSION_BADGE', '<span class="jltma-icon-ma"></span>' );
140 }
141 if ( !defined( 'JLTMA_PRO_RESTRICTED_CLASS' ) ) {
142 define( 'JLTMA_PRO_RESTRICTED_CLASS', '<span class="jltma-pro-disabled"></span>' );
143 }
144 if ( !defined( 'JLTMA_NEW_FEATURE' ) ) {
145 define( 'JLTMA_NEW_FEATURE', '<span class="jltma-new-feature"></span>' );
146 }
147 if ( !defined( 'JLTMA_SCRIPT_SUFFIX' ) ) {
148 define( 'JLTMA_SCRIPT_SUFFIX', ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min' ) );
149 }
150 if ( !defined( 'JLTMA_URL' ) ) {
151 define( 'JLTMA_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
152 }
153 if ( !defined( 'JLTMA_IMAGE_DIR' ) ) {
154 define( 'JLTMA_IMAGE_DIR', trailingslashit( JLTMA_URL ) . 'assets/images/' );
155 }
156 if ( !defined( 'JLTMA_ASSETS' ) ) {
157 define( 'JLTMA_ASSETS', trailingslashit( JLTMA_URL ) . 'assets/' );
158 }
159 if ( !defined( 'JLTMA_ADMIN_ASSETS' ) ) {
160 define( 'JLTMA_ADMIN_ASSETS', JLTMA_URL . '/inc/admin/assets/' );
161 }
162 if ( !defined( 'JLTMA_ADDONS' ) ) {
163 define( 'JLTMA_ADDONS', plugin_dir_path( __FILE__ ) . 'addons/' );
164 }
165 if ( !defined( 'JLTMA_PRO_EXTENSIONS' ) ) {
166 define( 'JLTMA_PRO_EXTENSIONS', plugin_dir_path( __FILE__ ) . 'premium/modules/' );
167 }
168 if ( !defined( 'JLTMA_TEMPLATES' ) ) {
169 define( 'JLTMA_TEMPLATES', plugin_dir_path( __FILE__ ) . 'inc/template-parts/' );
170 }
171 if ( !defined( 'JLTMA_NF' ) ) {
172 define( 'JLTMA_NF', '<span class="jltma-new-control"></span>' );
173 }
174 if ( !defined( 'JLTMA_NETWORK_ACTIVATED' ) ) {
175 if ( !function_exists( 'is_plugin_active_for_network' ) ) {
176 require_once ABSPATH . '/wp-admin/includes/plugin.php';
177 }
178 if ( is_plugin_active_for_network( 'master-addons/master-addons.php' ) || is_plugin_active_for_network( 'master-addons-pro/master-addons.php' ) ) {
179 define( "JLTMA_NETWORK_ACTIVATED", true );
180 } else {
181 define( "JLTMA_NETWORK_ACTIVATED", false );
182 }
183 }
184 // Load the main class (autoloader is embedded within)
185 if ( !class_exists( '\\MasterAddons\\Master_Elementor_Addons' ) ) {
186 require_once __DIR__ . '/class-master-elementor-addons.php';
187 }
188 // Activation and Deactivation hooks
189 if ( class_exists( '\\MasterAddons\\Master_Elementor_Addons' ) ) {
190 register_activation_hook( __FILE__, array('\\MasterAddons\\Master_Elementor_Addons', 'jltma_plugin_activation_hook') );
191 register_deactivation_hook( __FILE__, array('\\MasterAddons\\Master_Elementor_Addons', 'jltma_plugin_deactivation_hook') );
192 // Initialize the plugin
193 \MasterAddons\Master_Elementor_Addons::get_instance();
194 }
195 // Global helper for chainable settings access
196 // Usage: jltma_settings()->addons->get('key')
197 if ( !function_exists( 'jltma_settings' ) ) {
198 function jltma_settings() {
199 return \MasterAddons\Inc\Admin\Settings\Settings::instance();
200 }
201
202 }
203 // Backward-compat: old Pro plugins (< 3.0.0) call jltma_get_options()
204 // which was removed in the v3.0.0 refactor. This wrapper prevents fatal
205 // errors when free v3.0.0+ runs alongside an outdated pro plugin.
206 if ( !function_exists( 'jltma_get_options' ) ) {
207 function jltma_get_options( $key, $network_override = true ) {
208 if ( class_exists( '\\MasterAddons\\Inc\\Classes\\Utils' ) ) {
209 return \MasterAddons\Inc\Classes\Utils::get_options( $key, $network_override );
210 }
211 return get_option( $key );
212 }
213
214 }
215 // Backward-compat: old Pro plugins (< 3.0.0) call jltma_check_options()
216 // which was renamed to jltma_settings() in v3.0.0.
217 if ( !function_exists( 'jltma_check_options' ) ) {
218 function jltma_check_options() {
219 return jltma_settings();
220 }
221
222 }