PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.2
Elementor Website Builder – more than just a page builder v3.0.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | core/base/module.php +7 -65 4.0.73.0.2 View file →
@@ -1,10 +1,7 @@
1 1 <?php
2 2 namespace Elementor\Core\Base;
3 3
4 -use Elementor\Plugin;
5 -use Elementor\Utils;
6 -
7 4 if ( ! defined( 'ABSPATH' ) ) {
8 5 exit; // Exit if accessed directly.
9 6 }
10 7
@@ -76,9 +73,9 @@
76 73 * @since 1.7.0
77 74 * @access public
78 75 * @static
79 76 *
80 - * @return $this An instance of the class.
77 + * @return Module An instance of the class.
81 78 */
82 79 public static function instance() {
83 80 $class_name = static::class_name();
84 81
@@ -110,12 +107,8 @@
110 107 public static function class_name() {
111 108 return get_called_class();
112 109 }
113 110
114 - public static function get_experimental_data() {
115 - return [];
116 - }
117 -
118 111 /**
119 112 * Clone.
120 113 *
121 114 * Disable class cloning and throw an error on object clone.
@@ -126,13 +119,10 @@
126 119 * @since 1.7.0
127 120 * @access public
128 121 */
129 122 public function __clone() {
130 - _doing_it_wrong(
131 - __FUNCTION__,
132 - sprintf( 'Cloning instances of the singleton "%s" class is forbidden.', get_class( $this ) ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
133 - '1.0.0'
134 - );
123 + // Cloning instances of the class is forbidden
124 + _doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'elementor' ), '1.0.0' );
135 125 }
136 126
137 127 /**
138 128 * Wakeup.
@@ -142,13 +132,10 @@
142 132 * @since 1.7.0
143 133 * @access public
144 134 */
145 135 public function __wakeup() {
146 - _doing_it_wrong(
147 - __FUNCTION__,
148 - sprintf( 'Unserializing instances of the singleton "%s" class is forbidden.', get_class( $this ) ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
149 - '1.0.0'
150 - );
136 + // Unserializing instances of the class is forbidden
137 + _doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'elementor' ), '1.0.0' );
151 138 }
152 139
153 140 /**
154 141 * @since 2.0.0
@@ -223,9 +210,9 @@
223 210 final protected function get_assets_url( $file_name, $file_extension, $relative_url = null, $add_min_suffix = 'default' ) {
224 211 static $is_test_mode = null;
225 212
226 213 if ( null === $is_test_mode ) {
227 - $is_test_mode = Utils::is_script_debug() || Utils::is_elementor_tests();
214 + $is_test_mode = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || defined( 'ELEMENTOR_TESTS' ) && ELEMENTOR_TESTS;
228 215 }
229 216
230 217 if ( ! $relative_url ) {
231 218 $relative_url = $this->get_assets_relative_url() . $file_extension . '/';
@@ -268,9 +255,9 @@
268 255 *
269 256 * @param string $file_name
270 257 * @param string $relative_url Optional. Default is null.
271 258 * @param string $add_min_suffix Optional. Default is 'default'.
272 - * @param bool $add_direction_suffix Optional. Default is `false`.
259 + * @param bool $add_direction_suffix Optional. Default is `false`
273 260 *
274 261 * @return string
275 262 */
276 263 final protected function get_css_assets_url( $file_name, $relative_url = null, $add_min_suffix = 'default', $add_direction_suffix = false ) {
@@ -287,27 +274,8 @@
287 274 return $this->get_assets_url( $file_name, 'css', $relative_url, $add_min_suffix );
288 275 }
289 276
290 277 /**
291 - * Get Frontend File URL
292 - *
293 - * Returns the URL for the CSS file to be loaded in the front end. If requested via the second parameter, a custom
294 - * file is generated based on a passed template file name. Otherwise, the URL for the default CSS file is returned.
295 - *
296 - * @since 3.24.0
297 - *
298 - * @access public
299 - *
300 - * @param string $file_name
301 - * @param boolean $has_custom_breakpoints
302 - *
303 - * @return string frontend file URL
304 - */
305 - public function get_frontend_file_url( $file_name, $has_custom_breakpoints ) {
306 - return Plugin::$instance->frontend->get_frontend_file_url( $file_name, $has_custom_breakpoints );
307 - }
308 -
309 - /**
310 278 * Get assets base url
311 279 *
312 280 * @since 2.6.0
313 281 * @access protected
@@ -327,32 +295,6 @@
327 295 * @return string
328 296 */
329 297 protected function get_assets_relative_url() {
330 298 return 'assets/';
331 - }
332 -
333 - /**
334 - * Get the module's associated widgets.
335 - *
336 - * @return string[]
337 - */
338 - protected function get_widgets() {
339 - return [];
340 - }
341 -
342 - /**
343 - * Initialize the module related widgets.
344 - */
345 - public function init_widgets() {
346 - $widget_manager = Plugin::instance()->widgets_manager;
347 -
348 - foreach ( $this->get_widgets() as $widget ) {
349 - $class_name = $this->get_reflection()->getNamespaceName() . '\Widgets\\' . $widget;
350 -
351 - $widget_manager->register( new $class_name() );
352 - }
353 - }
354 -
355 - public function __construct() {
356 - add_action( 'elementor/widgets/register', [ $this, 'init_widgets' ] );
357 299 }
358 300 }