PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.17
UiCore Elements – Free widgets and templates for Elementor v1.3.17
1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 All 41 releases
← All changes | plugin.php +65 -53 1.2.41.3.17 View file →
@@ -1,10 +1,10 @@
1 1 <?php
2 2 /*
3 3 Plugin Name: UiCore Elements
4 4 Plugin URI: https://elements.uicore.co
5 -Description: Elementor Widgets and Theme Builder Elements
6 -Version: 1.2.4
5 +Description: Free widgets and templates for Elementor
6 +Version: 1.3.17
7 7 Author: UiCore
8 8 Author URI: https://uicore.co
9 9 License: GPL3
10 10 Text Domain: uicore-elements
@@ -9,14 +9,15 @@
9 9 License: GPL3
10 10 Text Domain: uicore-elements
11 11 Domain Path: /languages
12 12 * Elementor requires at least: 3.19.2
13 - * Elementor tested up to: 3.28.4
13 + * Elementor tested up to: 4.2.4
14 14 */
15 +
15 16 namespace UiCoreElements;
16 17
17 18 // don't call the file directly
18 -if ( !defined( 'ABSPATH' ) ) exit;
19 +if (!defined('ABSPATH')) exit;
19 20
20 21 /**
21 22 * Base class
22 23 *
@@ -21,9 +22,10 @@
21 22 * Base class
22 23 *
23 24 * @class Base The class that holds the entire plugin
24 25 */
25 -final class Base {
26 +final class Base
27 +{
26 28
27 29 /**
28 30 * Plugin version
29 31 *
@@ -28,9 +30,9 @@
28 30 * Plugin version
29 31 *
30 32 * @var string
31 33 */
32 - public $version = '1.2.4';
34 + public $version = '1.3.17';
33 35
34 36 /**
35 37 * Holds various class instances
36 38 *
@@ -43,16 +45,17 @@
43 45 *
44 46 * Sets up all the appropriate hooks and actions
45 47 * within our plugin.
46 48 */
47 - public function __construct() {
49 + public function __construct()
50 + {
48 51
49 52 $this->define_constants();
50 53
51 - register_activation_hook( __FILE__, array( $this, 'activate' ) );
52 - register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
54 + register_activation_hook(__FILE__, array($this, 'activate'));
55 + register_deactivation_hook(__FILE__, array($this, 'deactivate'));
53 56
54 - add_action( 'plugins_loaded', array( $this, 'init_plugin' ) );
57 + add_action('plugins_loaded', array($this, 'init_plugin'));
55 58 }
56 59
57 60 /**
58 61 * Initializes the Base() class
@@ -59,12 +62,13 @@
59 62 *
60 63 * Checks for an existing Base() instance
61 64 * and if it doesn't find one, creates it.
62 65 */
63 - public static function init() {
66 + public static function init()
67 + {
64 68 static $instance = false;
65 69
66 - if ( ! $instance ) {
70 + if (! $instance) {
67 71 $instance = new Base();
68 72 }
69 73
70 74 return $instance;
@@ -76,11 +80,12 @@
76 80 * @param $prop
77 81 *
78 82 * @return mixed
79 83 */
80 - public function __get( $prop ) {
81 - if ( array_key_exists( $prop, $this->container ) ) {
82 - return $this->container[ $prop ];
84 + public function __get($prop)
85 + {
86 + if (array_key_exists($prop, $this->container)) {
87 + return $this->container[$prop];
83 88 }
84 89
85 90 return $this->{$prop};
86 91 }
@@ -91,10 +96,11 @@
91 96 * @param $prop
92 97 *
93 98 * @return mixed
94 99 */
95 - public function __isset( $prop ) {
96 - return isset( $this->{$prop} ) || isset( $this->container[ $prop ] );
100 + public function __isset($prop)
101 + {
102 + return isset($this->{$prop}) || isset($this->container[$prop]);
97 103 }
98 104
99 105 /**
100 106 * Define the constants
@@ -100,16 +106,18 @@
100 106 * Define the constants
101 107 *
102 108 * @return void
103 109 */
104 - public function define_constants() {
105 - define( 'UICORE_ELEMENTS_VERSION', $this->version );
106 - define( 'UICORE_ELEMENTS_FILE', __FILE__ );
107 - define( 'UICORE_ELEMENTS_PATH', dirname( UICORE_ELEMENTS_FILE ) );
108 - define( 'UICORE_ELEMENTS_INCLUDES', UICORE_ELEMENTS_PATH . '/includes' );
109 - define( 'UICORE_ELEMENTS_URL', plugins_url( '', UICORE_ELEMENTS_FILE ) );
110 - define( 'UICORE_ELEMENTS_ASSETS', UICORE_ELEMENTS_URL . '/assets' );
111 - define( 'UICORE_ELEMENTS_BADGE', '<span title="Powered by UiCore Elements" style="font-size:10px;font-weight:500;background:#5dbad8;color:black;padding:2px 5px;border-radius:3px;margin-right:4px;">UiCore</span> ');
110 + public function define_constants()
111 + {
112 + define('UICORE_ELEMENTS_VERSION', $this->version);
113 + define('UICORE_ELEMENTS_FILE', __FILE__);
114 + define('UICORE_ELEMENTS_PATH', dirname(UICORE_ELEMENTS_FILE));
115 + define('UICORE_ELEMENTS_INCLUDES', UICORE_ELEMENTS_PATH . '/includes');
116 + define('UICORE_ELEMENTS_URL', plugins_url('', UICORE_ELEMENTS_FILE));
117 + define('UICORE_ELEMENTS_ASSETS', UICORE_ELEMENTS_URL . '/assets');
118 + define('UICORE_ELEMENTS_BADGE', '<span title="Powered by UiCore Elements" style="font-size:10px;font-weight:500;background:#5dbad8;color:black;padding:2px 5px;border-radius:3px;margin-right:4px;">UiCore</span> ');
119 + define('UICORE_ELEMENTS_NEW_OPTION', '<span title="New" style="font-size:10px;font-weight:500;background:#532df5;color:white;padding:2px 5px;border-radius:3px;margin-left:4px;line-height: 2em;">New</span> ');
112 120 }
113 121
114 122 /**
115 123 * Load the plugin after all plugis are loaded
@@ -115,10 +123,11 @@
115 123 * Load the plugin after all plugis are loaded
116 124 *
117 125 * @return void
118 126 */
119 - public function init_plugin() {
120 - if(\class_exists('Elementor\Plugin')){
127 + public function init_plugin()
128 + {
129 + if (\class_exists('Elementor\Plugin')) {
121 130 $this->includes();
122 131 $this->init_hooks();
123 132 }
124 133 }
@@ -127,17 +136,18 @@
127 136 * Placeholder for activation function
128 137 *
129 138 * Nothing being called here yet.
130 139 */
131 - public function activate() {
140 + public function activate()
141 + {
132 142
133 - $installed = get_option( 'uicore_elements_installed' );
143 + $installed = get_option('uicore_elements_installed');
134 144
135 - if ( ! $installed ) {
136 - update_option( 'uicore_elements_installed', time() );
145 + if (! $installed) {
146 + update_option('uicore_elements_installed', time());
137 147 }
138 148
139 - update_option( 'uicore_elements_version', UICORE_ELEMENTS_VERSION );
149 + update_option('uicore_elements_version', UICORE_ELEMENTS_VERSION);
140 150 }
141 151
142 152 /**
143 153 * Placeholder for deactivation function
@@ -143,32 +153,31 @@
143 153 * Placeholder for deactivation function
144 154 *
145 155 * Nothing being called here yet.
146 156 */
147 - public function deactivate() {
157 + public function deactivate() {}
148 158
149 - }
150 -
151 159 /**
152 160 * Include the required files
153 161 *
154 162 * @return void
155 163 */
156 - public function includes() {
164 + public function includes()
165 + {
157 166
158 167 require_once UICORE_ELEMENTS_INCLUDES . '/class-assets.php';
159 168 require_once UICORE_ELEMENTS_INCLUDES . '/class-elementor.php';
169 + require_once UICORE_ELEMENTS_INCLUDES . '/class-design-cloud.php';
160 170 require_once UICORE_ELEMENTS_INCLUDES . '/class-rest-api.php';
161 171 require_once UICORE_ELEMENTS_INCLUDES . '/class-helper.php';
162 172
163 - if ( $this->is_request( 'admin' ) ) {
173 + if ($this->is_request('admin')) {
164 174 require_once UICORE_ELEMENTS_INCLUDES . '/class-admin.php';
165 175 }
166 176
167 - if ( $this->is_request( 'frontend' ) ) {
177 + if ($this->is_request('frontend')) {
168 178 require_once UICORE_ELEMENTS_INCLUDES . '/class-frontend.php';
169 179 }
170 -
171 180 }
172 181
173 182 /**
174 183 * Initialize the hooks
@@ -174,14 +183,15 @@
174 183 * Initialize the hooks
175 184 *
176 185 * @return void
177 186 */
178 - public function init_hooks() {
187 + public function init_hooks()
188 + {
179 189
180 - add_action( 'init', array( $this, 'init_classes' ) );
190 + add_action('init', array($this, 'init_classes'));
181 191
182 192 // Localize our plugin
183 - add_action( 'init', array( $this, 'localization_setup' ) );
193 + add_action('init', array($this, 'localization_setup'));
184 194 }
185 195
186 196 /**
187 197 * Instantiate the required classes
@@ -187,17 +197,18 @@
187 197 * Instantiate the required classes
188 198 *
189 199 * @return void
190 200 */
191 - public function init_classes() {
201 + public function init_classes()
202 + {
192 203
193 204 new REST_API();
194 205 new Elementor();
195 - if ( $this->is_request( 'admin' ) ) {
206 + if ($this->is_request('admin')) {
196 207 $this->container['admin'] = new Admin();
197 208 }
198 209
199 - if ( $this->is_request( 'frontend' ) ) {
210 + if ($this->is_request('frontend')) {
200 211 $this->container['frontend'] = new Frontend();
201 212 }
202 213
203 214 $this->container['assets'] = new Assets();
@@ -207,10 +218,11 @@
207 218 * Initialize plugin for localization
208 219 *
209 220 * @uses load_plugin_textdomain()
210 221 */
211 - public function localization_setup() {
212 - load_plugin_textdomain( 'uicore-elements', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
222 + public function localization_setup()
223 + {
224 + load_plugin_textdomain('uicore-elements', false, dirname(plugin_basename(__FILE__)) . '/languages/');
213 225 }
214 226
215 227 /**
216 228 * What type of request is this?
@@ -218,17 +230,17 @@
218 230 * @param string $type admin, ajax, cron or frontend.
219 231 *
220 232 * @return bool
221 233 */
222 - private function is_request( $type ) {
223 - switch ( $type ) {
224 - case 'admin' :
234 + private function is_request($type)
235 + {
236 + switch ($type) {
237 + case 'admin':
225 238 return is_admin();
226 239
227 - case 'frontend' :
228 - return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
240 + case 'frontend':
241 + return (! is_admin() || defined('DOING_AJAX')) && ! defined('DOING_CRON');
229 242 }
230 243 }
231 -
232 244 } // Base
233 245
234 246 $uicore_elements = Base::init();