PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.2
Elementor Website Builder – more than just a page builder v3.4.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 | modules/safe-mode/module.php +75 -42 4.2.43.4.2 View file →
@@ -8,9 +8,9 @@
8 8 use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
9 9 use Elementor\Utils;
10 10
11 11 if ( ! defined( 'ABSPATH' ) ) {
12 - exit; // Exit if accessed directly.
12 + exit; // Exit if accessed directly
13 13 }
14 14
15 15 class Module extends \Elementor\Core\Base\Module {
16 16
@@ -63,16 +63,9 @@
63 63
64 64 return $value;
65 65 }
66 66
67 - /**
68 - * @throws \Exception If the safe mode cannot be enabled.
69 - */
70 67 public function ajax_enable_safe_mode( $data ) {
71 - if ( ! current_user_can( 'install_plugins' ) ) {
72 - throw new \Exception( 'Access denied.' );
73 - }
74 -
75 68 // It will run `$this->>update_safe_mode`.
76 69 update_option( 'elementor_safe_mode', 'yes' );
77 70
78 71 $document = Plugin::$instance->documents->get( $data['editor_post_id'] );
@@ -107,15 +100,15 @@
107 100 if ( is_wp_error( $results ) ) {
108 101 return;
109 102 }
110 103
111 - $token = hash( 'sha256', wp_rand() );
104 + $token = md5( wp_rand() );
112 105
113 106 // Only who own this key can use 'elementor-safe-mode'.
114 107 update_option( self::OPTION_TOKEN, $token );
115 108
116 109 // Save for later use.
117 - setcookie( self::OPTION_TOKEN, $token, time() + HOUR_IN_SECONDS, COOKIEPATH, '', is_ssl(), true );
110 + setcookie( self::OPTION_TOKEN, $token, time() + HOUR_IN_SECONDS, COOKIEPATH );
118 111 }
119 112
120 113 public function disable_safe_mode() {
121 114 if ( ! current_user_can( 'install_plugins' ) ) {
@@ -137,9 +130,9 @@
137 130 delete_option( 'theme_mods_elementor-safe' );
138 131 delete_option( 'elementor_safe_mode_created_mu_dir' );
139 132
140 133 delete_option( self::OPTION_TOKEN );
141 - setcookie( self::OPTION_TOKEN, '', 1, '', '', is_ssl(), true );
134 + setcookie( self::OPTION_TOKEN, '', 1 );
142 135 }
143 136
144 137 public function filter_preview_url( $url ) {
145 138 return add_query_arg( 'elementor-mode', 'safe', $url );
@@ -154,23 +147,26 @@
154 147 <style>
155 148 .elementor-safe-mode-toast {
156 149 position: absolute;
157 150 z-index: 10000; /* Over the loading layer */
158 - inset-block-end: 10px;
159 - inset-inline-end: 10px;
151 + bottom: 10px;
160 152 width: 400px;
161 153 line-height: 30px;
162 - display: flex;
163 - flex-direction: column;
164 - gap: 20px;
165 - color: var(--e-a-color-txt);
166 - background: var(--e-a-bg-default);
154 + background: white;
167 155 padding: 20px 25px 25px;
168 156 box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
169 157 border-radius: 5px;
170 - font-family: var(--e-a-font-family);
158 + font-family: Roboto, Arial, Helvetica, Verdana, sans-serif;
171 159 }
172 160
161 + body.rtl .elementor-safe-mode-toast {
162 + left: 10px;
163 + }
164 +
165 + body:not(.rtl) .elementor-safe-mode-toast {
166 + right: 10px;
167 + }
168 +
173 169 #elementor-try-safe-mode {
174 170 display: none;
175 171 }
176 172
@@ -176,50 +172,88 @@
176 172
177 173 .elementor-safe-mode-toast .elementor-toast-content {
178 174 font-size: 13px;
179 175 line-height: 22px;
176 + color: #6D7882;
180 177 }
181 178
182 179 .elementor-safe-mode-toast .elementor-toast-content a {
183 - color: var(--e-a-color-info);
180 + color: #138FFF;
184 181 }
185 182
186 183 .elementor-safe-mode-toast .elementor-toast-content hr {
187 184 margin: 15px auto;
188 185 border: 0 none;
189 - border-block-start: var(--e-a-border);
186 + border-top: 1px solid #F1F3F5;
190 187 }
191 188
192 189 .elementor-safe-mode-toast header {
193 190 display: flex;
194 191 align-items: center;
195 - gap: 10px;
192 + justify-content: space-between;
193 + flex-wrap: wrap;
194 + margin-bottom: 20px;
196 195 }
197 196
197 + .elementor-safe-mode-toast header > * {
198 + margin-top: 10px;
199 + }
200 +
201 + .elementor-safe-mode-toast .elementor-safe-mode-button {
202 + display: inline-block;
203 + font-weight: 500;
204 + font-size: 11px;
205 + text-transform: uppercase;
206 + color: white;
207 + padding: 10px 15px;
208 + line-height: 1;
209 + background: #A4AFB7;
210 + border-radius: 3px;
211 + }
212 +
213 + #elementor-try-safe-mode .elementor-safe-mode-button {
214 + background: #39B54A;
215 + }
216 +
198 217 .elementor-safe-mode-toast header i {
199 218 font-size: 25px;
200 - color: var(--e-a-color-warning);
219 + color: #fcb92c;
201 220 }
202 221
222 + body:not(.rtl) .elementor-safe-mode-toast header i {
223 + margin-right: 10px;
224 + }
225 +
226 + body.rtl .elementor-safe-mode-toast header i {
227 + margin-left: 10px;
228 + }
229 +
203 230 .elementor-safe-mode-toast header h2 {
204 231 flex-grow: 1;
205 232 font-size: 18px;
233 + color: #6D7882;
206 234 }
207 235
208 - .elementor-safe-mode-list {
209 - display: flex;
210 - flex-direction: column;
211 - gap: 10px;
236 + .elementor-safe-mode-list-item {
237 + margin-top: 10px;
238 + list-style: outside;
212 239 }
213 240
214 - .elementor-safe-mode-list-item {
215 - margin-inline-start: 15px;
216 - list-style: outside;
241 + body:not(.rtl) .elementor-safe-mode-list-item {
242 + margin-left: 15px;
217 243 }
218 244
245 + body.rtl .elementor-safe-mode-list-item {
246 + margin-right: 15px;
247 + }
248 +
249 + .elementor-safe-mode-list-item b {
250 + font-size: 14px;
251 + }
252 +
219 253 .elementor-safe-mode-list-item-content {
220 254 font-style: italic;
221 - color: var(--e-a-color-txt);
255 + color: #a4afb7;
222 256 }
223 257
224 258 .elementor-safe-mode-list-item-title {
225 259 font-weight: 500;
@@ -225,11 +259,10 @@
225 259 font-weight: 500;
226 260 }
227 261
228 262 .elementor-safe-mode-mu-plugins {
229 - background-color: var(--e-a-bg-hover);
230 - color: var(--e-a-color-txt-hover);
231 - margin-block-start: 20px;
263 + background-color: #f1f3f5;
264 + margin-top: 20px;
232 265 padding: 10px 15px;
233 266 }
234 267 </style>
235 268 <?php
@@ -239,11 +272,11 @@
239 272 $this->print_safe_mode_css()
240 273 ?>
241 274 <div class="elementor-safe-mode-toast" id="elementor-safe-mode-message">
242 275 <header>
243 - <i class="eicon-warning" aria-hidden="true"></i>
276 + <i class="eicon-warning"></i>
244 277 <h2><?php echo esc_html__( 'Safe Mode ON', 'elementor' ); ?></h2>
245 - <a class="elementor-button elementor-safe-mode-button elementor-disable-safe-mode" target="_blank" href="<?php echo esc_url( $this->get_admin_page_url() ); ?>">
278 + <a class="elementor-safe-mode-button elementor-disable-safe-mode" target="_blank" href="<?php echo esc_url( $this->get_admin_page_url() ); ?>">
246 279 <?php echo esc_html__( 'Disable Safe Mode', 'elementor' ); ?>
247 280 </a>
248 281 </header>
249 282
@@ -317,9 +350,9 @@
317 350 location.replace( location.href.replace( '&elementor-mode=safe', '' ) );
318 351 }
319 352 },
320 353 error: function() {
321 - alert( 'An error occurred.' );
354 + alert( 'An error occurred' );
322 355 },
323 356 },
324 357 true
325 358 );
@@ -347,11 +380,11 @@
347 380 ?>
348 381 <div class="elementor-safe-mode-toast" id="elementor-try-safe-mode">
349 382 <?php if ( current_user_can( 'install_plugins' ) ) : ?>
350 383 <header>
351 - <i class="eicon-warning" aria-hidden="true"></i>
384 + <i class="eicon-warning"></i>
352 385 <h2><?php echo esc_html__( 'Can\'t Edit?', 'elementor' ); ?></h2>
353 - <a class="elementor-button e-primary elementor-safe-mode-button elementor-enable-safe-mode" target="_blank" href="<?php echo esc_url( $this->get_admin_page_url() ); ?>">
386 + <a class="elementor-safe-mode-button elementor-enable-safe-mode" target="_blank" href="<?php echo esc_url( $this->get_admin_page_url() ); ?>">
354 387 <?php echo esc_html__( 'Enable Safe Mode', 'elementor' ); ?>
355 388 </a>
356 389 </header>
357 390 <div class="elementor-toast-content">
@@ -359,9 +392,9 @@
359 392 <a href="<?php Utils::print_unescaped_internal_string( self::DOCS_TRY_SAFE_MODE_URL ); ?>" target="_blank"><?php echo esc_html__( 'Learn More', 'elementor' ); ?></a>
360 393 </div>
361 394 <?php else : ?>
362 395 <header>
363 - <i class="eicon-warning" aria-hidden="true"></i>
396 + <i class="eicon-warning"></i>
364 397 <h2><?php echo esc_html__( 'Can\'t Edit?', 'elementor' ); ?></h2>
365 398 </header>
366 399 <div class="elementor-toast-content">
367 400 <?php echo esc_html__( 'If you are experiencing a loading issue, contact your site administrator to troubleshoot the problem using Safe Mode.', 'elementor' ); ?>
@@ -391,9 +424,9 @@
391 424 success: function( url ) {
392 425 location.assign( url );
393 426 },
394 427 error: function() {
395 - alert( 'An error occurred.' );
428 + alert( 'An error occurred' );
396 429 },
397 430 },
398 431 true
399 432 );
@@ -424,9 +457,9 @@
424 457 return;
425 458 }
426 459
427 460 if ( ! $notice.data( 'visible' ) ) {
428 - $notice.attr( 'style', 'display: flex;' );
461 + $notice.show().data( 'visible', true );
429 462 }
430 463
431 464 // Re-check after 500ms.
432 465 setTimeout( handleTrySafeModeNotice, 500 );