PluginProbe ʕ •ᴥ•ʔ
Royal Addons for Elementor – Addons and Templates Kit for Elementor / 1.7.1064
Royal Addons for Elementor – Addons and Templates Kit for Elementor v1.7.1064
1.7.1064 1.7.1063 1.7.1062 1.7.1061 1.7.1060 1.7.1059 1.7.1058 trunk 1.0.0 1.1.0 1.2 1.3 1.3.1 1.3.2 1.3.21 1.3.22 1.3.23 1.3.24 1.3.25 1.3.26 1.3.27 1.3.28 1.3.29 1.3.30 1.3.31 1.3.32 1.3.33 1.3.34 1.3.35 1.3.36 1.3.37 1.3.38 1.3.39 1.3.40 1.3.41 1.3.42 1.3.43 1.3.44 1.3.45 1.3.46 1.3.47 1.3.48 1.3.49 1.3.50 1.3.51 1.3.52 1.3.53 1.3.54 1.3.55 1.3.56 1.3.57 1.3.58 1.3.59 1.3.60 1.3.61 1.3.62 1.3.63 1.3.64 1.3.65 1.3.66 1.3.67 1.3.68 1.3.69 1.3.70 1.3.71 1.3.72 1.3.73 1.3.74 1.3.75 1.3.76 1.3.77 1.3.78 1.3.79 1.3.80 1.3.81 1.3.82 1.3.83 1.3.84 1.3.85 1.3.86 1.3.87 1.3.88 1.3.89 1.3.90 1.3.91 1.3.92 1.3.93 1.3.94 1.3.95 1.3.96 1.3.97 1.3.971 1.3.972 1.3.973 1.3.974 1.3.975 1.3.976 1.3.977 1.3.978 1.3.979 1.3.980 1.3.981 1.3.982 1.3.983 1.3.984 1.3.985 1.3.986 1.3.987 1.7.1 1.7.1001 1.7.1002 1.7.1003 1.7.1004 1.7.1005 1.7.1006 1.7.1007 1.7.1008 1.7.1009 1.7.1010 1.7.1011 1.7.1012 1.7.1013 1.7.1014 1.7.1015 1.7.1016 1.7.1017 1.7.1018 1.7.1019 1.7.1020 1.7.1021 1.7.1022 1.7.1023 1.7.1024 1.7.1025 1.7.1026 1.7.1027 1.7.1028 1.7.1029 1.7.1030 1.7.1031 1.7.1032 1.7.1033 1.7.1034 1.7.1035 1.7.1036 1.7.1037 1.7.1038 1.7.1039 1.7.1040 1.7.1041 1.7.1042 1.7.1043 1.7.1044 1.7.1045 1.7.1046 1.7.1047 1.7.1048 1.7.1049 1.7.1050 1.7.1051 1.7.1052 1.7.1053 1.7.1054 1.7.1055 1.7.1056 1.7.1057
royal-elementor-addons / wpr-addons.php
royal-elementor-addons Last commit date
admin 5 days ago assets 5 days ago base 5 days ago classes 5 days ago extensions 5 days ago freemius 5 days ago includes 5 days ago languages 5 days ago modules 5 days ago LICENSE 5 days ago plugin.php 5 days ago readme.txt 5 days ago wpml-config.xml 5 days ago wpr-addons.php 5 days ago
wpr-addons.php
272 lines
1 <?php
2 /*
3 * Plugin Name: Royal Elementor Addons
4 * Description: The only plugin you need for Elementor page builder.
5 * Plugin URI: https://royal-elementor-addons.com/
6 * Author: WP Royal
7 * Version: 1.7.1064
8 * License: GPLv3
9 * Author URI: https://royal-elementor-addons.com/
10 * Elementor tested up to: 4.1.4
11 * Elementor Pro tested up to: 4.1.2
12 *
13 * Text Domain: wpr-addons
14 */
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit; // Exit if accessed directly.
18 }
19
20 define( 'WPR_ADDONS_VERSION', '1.7.1064' );
21
22 define( 'WPR_ADDONS__FILE__', __FILE__ );
23 define( 'WPR_ADDONS_PLUGIN_BASE', plugin_basename( WPR_ADDONS__FILE__ ) );
24 define( 'WPR_ADDONS_PATH', plugin_dir_path( WPR_ADDONS__FILE__ ) );
25 define( 'WPR_ADDONS_MODULES_PATH', WPR_ADDONS_PATH . 'modules/' );
26 define( 'WPR_ADDONS_URL', plugins_url( '/', WPR_ADDONS__FILE__ ) );
27 define( 'WPR_ADDONS_ASSETS_URL', WPR_ADDONS_URL . 'assets/' );
28 define( 'WPR_ADDONS_MODULES_URL', WPR_ADDONS_URL . 'modules/' );
29
30 /**
31 * Feemius Integration
32 */
33
34 if ( function_exists( 'wpr_fs' ) ) {
35 wpr_fs()->set_basename( false, __FILE__ );
36 } else {
37 $register_freemius = true;
38
39 if ( get_option('royal_elementor_addons_pro_activation_time') ) {
40 if ( function_exists('is_plugin_active') ) {
41 if ( is_plugin_active('wpr-addons-pro/wpr-addons-pro.php') || is_plugin_active('royal-elementor-addons-pro/wpr-addons-pro.php') ) {
42 $register_freemius = false;
43 }
44 }
45 }
46
47 if ( $register_freemius ) {
48 // Create a helper function for easy SDK access.
49 function wpr_fs() {
50 global $wpr_fs;
51
52 if ( ! isset( $wpr_fs ) ) {
53 // Include Freemius SDK.
54 require_once dirname(__FILE__) . '/freemius/start.php';
55
56 $wpr_fs = fs_dynamic_init( array(
57 'id' => '8416',
58 'slug' => 'wpr-addons',
59 'premium_slug' => 'wpr-addons-pro',
60 'type' => 'plugin',
61 'public_key' => 'pk_a0b21b234a7c9581a555b9ee9f28a',
62 'is_premium' => false,
63 'has_premium_version' => true,
64 'has_paid_plans' => false,
65 'has_addons' => false,
66 'has_affiliation' => 'selected',
67 'menu' => array(
68 'slug' => 'wpr-addons',
69 'first-path' => 'admin.php?page=wpr-templates-kit',
70 'support' => false,
71 'affiliation' => true,
72 'pricing' => false,
73 ),
74 ) );
75 }
76
77 return $wpr_fs;
78 }
79
80 // Init Freemius.
81 wpr_fs();
82 // Signal that SDK was initiated.
83 do_action( 'wpr_fs_loaded' );
84
85 wpr_fs()->add_filter( 'show_deactivation_subscription_cancellation', '__return_false' );
86 wpr_fs()->add_filter( 'deactivate_on_activation', '__return_false' );
87
88 function disable_contact_for_free_users( $is_visible, $menu_id ) {
89
90 if ( 'contact' != $menu_id ) {
91 return $is_visible;
92 }
93
94 return wpr_fs()->can_use_premium_code();
95 }
96
97 wpr_fs()->add_filter( 'is_submenu_visible', 'disable_contact_for_free_users', 10, 2 );
98
99 }
100 }
101
102
103 /**
104 * Load gettext translate for our text domain.
105 *
106 * @since 1.0.0
107 *
108 * @return void
109 */
110 function wpr_addons_load_plugin() {
111 if ( ! did_action( 'elementor/loaded' ) ) {
112 add_action( 'admin_notices', 'wpr_addons_fail_load' );
113 return;
114 }
115
116 $elementor_version_required = '2.0.0';
117 if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_required, '>=' ) ) {
118 add_action( 'admin_notices', 'wpr_addons_fail_load_out_of_date' );
119 return;
120 }
121
122 require( WPR_ADDONS_PATH . 'plugin.php' );
123 }
124 add_action( 'plugins_loaded', 'wpr_addons_load_plugin' );
125
126 /**
127 * Show in WP Dashboard notice about the plugin is not activated.
128 *
129 * @since 1.0.0
130 *
131 * @return void
132 */
133 function wpr_addons_fail_load() {
134 $screen = get_current_screen();
135 if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
136 return;
137 }
138
139 $plugin = 'elementor/elementor.php';
140
141 if ( _is_elementor_installed() ) {
142 if ( ! current_user_can( 'activate_plugins' ) ) {
143 return;
144 }
145
146 $activation_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin='. $plugin .'&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_'. $plugin );
147
148 $message = '<p>' . esc_html__( 'Royal Elementor Addons is not working because you need to activate the Elementor plugin.', 'wpr-addons' ) . '</p>';
149 $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, esc_html__( 'Activate Elementor Now', 'wpr-addons' ) ) . '</p>';
150 } else {
151 if ( ! current_user_can( 'install_plugins' ) ) {
152 return;
153 }
154
155 $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
156
157 $message = '<p>' . esc_html__( 'Royal Elementor Addons is not working because you need to install the Elementor plugin', 'wpr-addons' ) . '</p>';
158 $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $install_url, esc_html__( 'Install Elementor Now', 'wpr-addons' ) ) . '</p>';
159 }
160
161 echo '<div class="error"><p>'. wp_kses_post($message) .'</p></div>';
162 }
163
164 function wpr_addons_fail_load_out_of_date() {
165 if ( ! current_user_can( 'update_plugins' ) ) {
166 return;
167 }
168
169 $file_path = 'elementor/elementor.php';
170
171 $upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_'. $file_path );
172 $message = '<p>' . esc_html__( 'Royal Elementor Addons is not working because you are using an old version of Elementor.', 'wpr-addons' ) . '</p>';
173 $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $upgrade_link, esc_html__( 'Update Elementor Now', 'wpr-addons' ) ) . '</p>';
174
175 echo '<div class="error">'. wp_kses_post($message) .'</div>';
176 }
177
178 if ( ! function_exists( '_is_elementor_installed' ) ) {
179
180 function _is_elementor_installed() {
181 $file_path = 'elementor/elementor.php';
182 $installed_plugins = get_plugins();
183
184 return isset( $installed_plugins[ $file_path ] );
185 }
186 }
187
188
189 /**
190 * Redirect to Options Page
191 *
192 * @since 1.0.0
193 *
194 */
195
196 function wpr_plugin_activate() {
197 set_transient('wpr_plugin_do_activation_redirect', true, 60);
198 }
199
200 function wpr_plugin_redirect() {
201 if (get_transient('wpr_plugin_do_activation_redirect')) {
202 delete_transient('wpr_plugin_do_activation_redirect');
203
204 if ( !isset($_GET['activate-multi']) ) {
205 wp_redirect('admin.php?page=wpr-addons');
206 }
207 }
208 }
209
210 if ( did_action( 'elementor/loaded' ) ) {
211 register_activation_hook(__FILE__, 'wpr_plugin_activate');
212 add_action('admin_init', 'wpr_plugin_redirect');
213 }
214
215 // Set Plugin Activation Time
216 function royal_elementor_addons_activation_time() {//TODO: Try to locate this in rating-notice.php later if possible
217 if ( false === get_option( 'royal_elementor_addons_activation_time' ) ) {
218 add_option( 'royal_elementor_addons_activation_time', absint(intval(strtotime('now'))) );
219 }
220
221 if ( false === get_option( 'royal_elementor_addons_activation_time_for_sale' ) ) {
222 add_option( 'royal_elementor_addons_activation_time_for_sale', absint(intval(strtotime('now'))) );
223 }
224 }
225
226 register_activation_hook( __FILE__, 'royal_elementor_addons_activation_time' );
227
228 // Plugin Deactivation
229 function royal_elementor_addons_deactivate() {
230 // Reset "never show backup popup" preference so it shows again on reactivation.
231 delete_metadata( 'user', 0, 'wpr_dismiss_backup_popup', '', true );
232 }
233
234 // hook already exists with template kits notice
235 register_deactivation_hook( __FILE__, 'royal_elementor_addons_deactivate' );
236
237 function wpr_script_loader_tag( $tag, $handle ) {
238 if ( 'jquery-core' !== $handle && 'jquery-migrate' !== $handle && 'wpr-addons-js' !== $handle && 'wpr-isotope' !== $handle ) {
239 return $tag;
240 }
241
242
243 // Modern implementations may employ WP_HTML_Tag_Processor here.
244 // return str_replace( ' src=', ' defer src=', $tag );
245 return str_replace( ' src', ' data-cfasync="false" src', $tag );
246 }
247
248 function exclude_wpr_scripts_from_wp_optimize( $excluded_handles ) {
249 // Replace 'my-script-handle' with the handle of the script you want to exclude.
250 $excluded_handles[] = 'wpr-addons-js';
251
252 return $excluded_handles;
253 }
254
255 function exclude_wpr_styles_from_wp_optimize( $excluded_handles ) {
256 // Replace 'my-style-handle' with the handle of the style you want to exclude.
257 $excluded_handles[] = 'wpr-addons-css';
258
259 return $excluded_handles;
260 }
261
262 if ( 'on' === get_option('wpr_ignore_wp_rocket_js', 'on') ) {
263 add_filter( 'script_loader_tag', 'wpr_script_loader_tag', 10, 2 );
264 }
265
266 if ( 'on' === get_option('wpr_ignore_wp_optimize_js', 'on') ) {
267 add_filter( 'wpo_minify_excluded_js_handles', 'exclude_wpr_scripts_from_wp_optimize' );
268 }
269
270 if ( 'on' === get_option('wpr_ignore_wp_optimize_css', 'on') ) {
271 add_filter( 'wpo_minify_excluded_css_handles', 'exclude_wpr_styles_from_wp_optimize' );
272 }