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