| @@ -1,12 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor; |
| 3 | 3 | |
| 4 | -use Elementor\Core\Admin\Menu\Admin_Menu_Manager; | |
| 4 | +use Elementor\Core\Admin\Menu\Main as MainMenu; | |
| 5 | 5 | use Elementor\Core\Kits\Manager; |
| 6 | -use Elementor\Includes\Settings\AdminMenuItems\Tools_Menu_Item; | |
| 7 | -use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider; | |
| 8 | -use Elementor\Includes\Settings\AdminMenuItems\Editor_One_Tools_Menu; | |
| 9 | 6 | |
| 10 | 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | 8 | exit; // Exit if accessed directly. |
| 12 | 9 | } |
| @@ -20,16 +17,45 @@ | ||
| 20 | 17 | * @since 1.0.0 |
| 21 | 18 | */ |
| 22 | 19 | class Tools extends Settings_Page { |
| 23 | 20 | |
| 24 | - const CAPABILITY = 'manage_options'; | |
| 25 | - | |
| 26 | 21 | /** |
| 27 | 22 | * Settings page ID for Elementor tools. |
| 28 | 23 | */ |
| 29 | 24 | const PAGE_ID = 'elementor-tools'; |
| 30 | 25 | |
| 26 | + private function register_admin_menu( MainMenu $menu ) { | |
| 27 | + $menu->add_submenu( [ | |
| 28 | + 'page_title' => esc_html__( 'Tools', 'elementor' ), | |
| 29 | + 'menu_title' => esc_html__( 'Tools', 'elementor' ), | |
| 30 | + 'menu_slug' => self::PAGE_ID, | |
| 31 | + 'function' => [ $this, 'display_settings_page' ], | |
| 32 | + 'index' => 50, | |
| 33 | + ] ); | |
| 34 | + } | |
| 35 | + | |
| 31 | 36 | /** |
| 37 | + * Register admin menu legacy. | |
| 38 | + * | |
| 39 | + * Add new Elementor Tools admin menu. | |
| 40 | + * | |
| 41 | + * Fired by `admin_menu` action. | |
| 42 | + * | |
| 43 | + * @since 1.0.0 | |
| 44 | + * @access private | |
| 45 | + */ | |
| 46 | + private function register_admin_menu_legacy() { | |
| 47 | + add_submenu_page( | |
| 48 | + Settings::PAGE_ID, | |
| 49 | + esc_html__( 'Tools', 'elementor' ), | |
| 50 | + esc_html__( 'Tools', 'elementor' ), | |
| 51 | + 'manage_options', | |
| 52 | + self::PAGE_ID, | |
| 53 | + [ $this, 'display_settings_page' ] | |
| 54 | + ); | |
| 55 | + } | |
| 56 | + | |
| 57 | + /** | |
| 32 | 58 | * Clear cache. |
| 33 | 59 | * |
| 34 | 60 | * Delete post meta containing the post CSS file data. And delete the actual |
| 35 | 61 | * CSS files from the upload directory. |
| @@ -41,35 +67,13 @@ | ||
| 41 | 67 | */ |
| 42 | 68 | public function ajax_elementor_clear_cache() { |
| 43 | 69 | check_ajax_referer( 'elementor_clear_cache', '_nonce' ); |
| 44 | 70 | |
| 45 | - if ( ! current_user_can( static::CAPABILITY ) ) { | |
| 46 | - wp_send_json_error( 'Permission denied' ); | |
| 47 | - } | |
| 48 | - | |
| 49 | 71 | Plugin::$instance->files_manager->clear_cache(); |
| 50 | 72 | |
| 51 | 73 | wp_send_json_success(); |
| 52 | 74 | } |
| 53 | 75 | |
| 54 | - public function admin_post_elementor_site_clear_cache() { | |
| 55 | - check_ajax_referer( 'elementor_site_clear_cache' ); | |
| 56 | - | |
| 57 | - if ( ! current_user_can( static::CAPABILITY ) ) { | |
| 58 | - wp_die( 'Permission denied' ); | |
| 59 | - } | |
| 60 | - | |
| 61 | - Plugin::$instance->files_manager->clear_cache(); | |
| 62 | - | |
| 63 | - $http_referer = wp_get_raw_referer(); | |
| 64 | - if ( empty( $http_referer ) ) { | |
| 65 | - $http_referer = admin_url( 'admin.php?page=' . static::PAGE_ID ); | |
| 66 | - } | |
| 67 | - | |
| 68 | - wp_safe_redirect( $http_referer ); | |
| 69 | - die; | |
| 70 | - } | |
| 71 | - | |
| 72 | 76 | /** |
| 73 | 77 | * Recreate kit. |
| 74 | 78 | * |
| 75 | 79 | * Recreate default kit (only when default kit does not exist). |
| @@ -81,12 +85,8 @@ | ||
| 81 | 85 | */ |
| 82 | 86 | public function ajax_elementor_recreate_kit() { |
| 83 | 87 | check_ajax_referer( 'elementor_recreate_kit', '_nonce' ); |
| 84 | 88 | |
| 85 | - if ( ! current_user_can( static::CAPABILITY ) ) { | |
| 86 | - wp_send_json_error( 'Permission denied' ); | |
| 87 | - } | |
| 88 | - | |
| 89 | 89 | $kit = Plugin::$instance->kits_manager->get_active_kit(); |
| 90 | 90 | |
| 91 | 91 | if ( $kit->get_id() ) { |
| 92 | 92 | wp_send_json_error( [ 'message' => esc_html__( 'There\'s already an active kit.', 'elementor' ) ], 400 ); |
| @@ -116,15 +116,11 @@ | ||
| 116 | 116 | */ |
| 117 | 117 | public function ajax_elementor_replace_url() { |
| 118 | 118 | check_ajax_referer( 'elementor_replace_url', '_nonce' ); |
| 119 | 119 | |
| 120 | - if ( ! current_user_can( static::CAPABILITY ) ) { | |
| 121 | - wp_send_json_error( 'Permission denied' ); | |
| 122 | - } | |
| 120 | + $from = ! empty( $_POST['from'] ) ? $_POST['from'] : ''; | |
| 121 | + $to = ! empty( $_POST['to'] ) ? $_POST['to'] : ''; | |
| 123 | 122 | |
| 124 | - $from = Utils::get_super_global_value( $_POST, 'from' ) ?? ''; | |
| 125 | - $to = Utils::get_super_global_value( $_POST, 'to' ) ?? ''; | |
| 126 | - | |
| 127 | 123 | try { |
| 128 | 124 | $results = Utils::replace_urls( $from, $to ); |
| 129 | 125 | wp_send_json_success( $results ); |
| 130 | 126 | } catch ( \Exception $e ) { |
| @@ -149,35 +145,22 @@ | ||
| 149 | 145 | wp_die( esc_html__( 'Not allowed to rollback versions', 'elementor' ) ); |
| 150 | 146 | } |
| 151 | 147 | |
| 152 | 148 | $rollback_versions = $this->get_rollback_versions(); |
| 153 | - $version = Utils::get_super_global_value( $_GET, 'version' ); | |
| 154 | - | |
| 155 | - if ( empty( $version ) || ! in_array( $version, $rollback_versions, true ) ) { | |
| 156 | - wp_die( esc_html__( 'An error occurred, the selected version is invalid. Try selecting different version.', 'elementor' ) ); | |
| 149 | + if ( empty( $_GET['version'] ) || ! in_array( $_GET['version'], $rollback_versions ) ) { | |
| 150 | + wp_die( esc_html__( 'Error occurred, The version selected is invalid. Try selecting different version.', 'elementor' ) ); | |
| 157 | 151 | } |
| 158 | 152 | |
| 159 | - /** | |
| 160 | - * Filter to allow override the rollback process. | |
| 161 | - * Should return an instance of `Rollback` class. | |
| 162 | - * | |
| 163 | - * @since 3.16.0 | |
| 164 | - * | |
| 165 | - * @param Rollback|null $rollback The rollback instance. | |
| 166 | - * @param string $version The version to roll back to. | |
| 167 | - */ | |
| 168 | - $rollback = apply_filters( 'elementor/settings/rollback', null, $version ); | |
| 153 | + $plugin_slug = basename( ELEMENTOR__FILE__, '.php' ); | |
| 169 | 154 | |
| 170 | - if ( ! ( $rollback instanceof Rollback ) ) { | |
| 171 | - $plugin_slug = basename( ELEMENTOR__FILE__, '.php' ); | |
| 172 | - | |
| 173 | - $rollback = new Rollback( [ | |
| 174 | - 'version' => $version, | |
| 155 | + $rollback = new Rollback( | |
| 156 | + [ | |
| 157 | + 'version' => $_GET['version'], | |
| 175 | 158 | 'plugin_name' => ELEMENTOR_PLUGIN_BASE, |
| 176 | 159 | 'plugin_slug' => $plugin_slug, |
| 177 | - 'package_url' => sprintf( 'https://downloads.wordpress.org/plugin/%s.%s.zip', $plugin_slug, $version ), | |
| 178 | - ] ); | |
| 179 | - } | |
| 160 | + 'package_url' => sprintf( 'https://downloads.wordpress.org/plugin/%s.%s.zip', $plugin_slug, $_GET['version'] ), | |
| 161 | + ] | |
| 162 | + ); | |
| 180 | 163 | |
| 181 | 164 | $rollback->run(); |
| 182 | 165 | |
| 183 | 166 | wp_die( |
| @@ -197,14 +180,19 @@ | ||
| 197 | 180 | */ |
| 198 | 181 | public function __construct() { |
| 199 | 182 | parent::__construct(); |
| 200 | 183 | |
| 201 | - add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) { | |
| 202 | - $this->register_editor_one_menu( $menu_data_provider ); | |
| 203 | - } ); | |
| 184 | + if ( Plugin::$instance->experiments->is_feature_active( 'admin_menu_rearrangement' ) ) { | |
| 185 | + add_action( 'elementor/admin/menu_registered/elementor', function( MainMenu $menu ) { | |
| 186 | + $this->register_admin_menu( $menu ); | |
| 187 | + } ); | |
| 188 | + } else { | |
| 189 | + add_action( 'admin_menu', function() { | |
| 190 | + $this->register_admin_menu_legacy(); | |
| 191 | + }, 205 ); | |
| 192 | + } | |
| 204 | 193 | |
| 205 | 194 | add_action( 'wp_ajax_elementor_clear_cache', [ $this, 'ajax_elementor_clear_cache' ] ); |
| 206 | - add_action( 'admin_post_elementor_site_clear_cache', [ $this, 'admin_post_elementor_site_clear_cache' ] ); | |
| 207 | 195 | add_action( 'wp_ajax_elementor_replace_url', [ $this, 'ajax_elementor_replace_url' ] ); |
| 208 | 196 | add_action( 'wp_ajax_elementor_recreate_kit', [ $this, 'ajax_elementor_recreate_kit' ] ); |
| 209 | 197 | |
| 210 | 198 | add_action( 'admin_post_elementor_rollback', [ $this, 'post_elementor_rollback' ] ); |
| @@ -209,46 +197,31 @@ | ||
| 209 | 197 | |
| 210 | 198 | add_action( 'admin_post_elementor_rollback', [ $this, 'post_elementor_rollback' ] ); |
| 211 | 199 | } |
| 212 | 200 | |
| 213 | - private function register_editor_one_menu( Menu_Data_Provider $menu_data_provider ) { | |
| 214 | - $menu_data_provider->register_menu( new Editor_One_Tools_Menu() ); | |
| 215 | - } | |
| 216 | - | |
| 217 | - public function get_warning_span( string $text ): string { | |
| 218 | - $color = 'var(--e-one-palette-error-main)'; | |
| 219 | - return sprintf( '<span style="color: %s;">%s</span>', esc_attr( $color ), esc_html( $text ) ); | |
| 220 | - } | |
| 221 | - | |
| 222 | 201 | private function get_rollback_versions() { |
| 223 | 202 | $rollback_versions = get_transient( 'elementor_rollback_versions_' . ELEMENTOR_VERSION ); |
| 224 | - | |
| 225 | 203 | if ( false === $rollback_versions ) { |
| 226 | 204 | $max_versions = 30; |
| 227 | 205 | |
| 228 | - $versions = apply_filters( 'elementor/settings/rollback/versions', [] ); | |
| 206 | + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; | |
| 229 | 207 | |
| 230 | - if ( empty( $versions ) ) { | |
| 231 | - require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; | |
| 208 | + $plugin_information = plugins_api( | |
| 209 | + 'plugin_information', [ | |
| 210 | + 'slug' => 'elementor', | |
| 211 | + ] | |
| 212 | + ); | |
| 232 | 213 | |
| 233 | - $plugin_information = plugins_api( | |
| 234 | - 'plugin_information', [ | |
| 235 | - 'slug' => 'elementor', | |
| 236 | - ] | |
| 237 | - ); | |
| 214 | + if ( empty( $plugin_information->versions ) || ! is_array( $plugin_information->versions ) ) { | |
| 215 | + return []; | |
| 216 | + } | |
| 238 | 217 | |
| 239 | - if ( empty( $plugin_information->versions ) || ! is_array( $plugin_information->versions ) ) { | |
| 240 | - return []; | |
| 241 | - } | |
| 218 | + krsort( $plugin_information->versions ); | |
| 242 | 219 | |
| 243 | - uksort( $plugin_information->versions, 'version_compare' ); | |
| 244 | - $versions = array_keys( array_reverse( $plugin_information->versions ) ); | |
| 245 | - } | |
| 246 | - | |
| 247 | 220 | $rollback_versions = []; |
| 248 | 221 | |
| 249 | 222 | $current_index = 0; |
| 250 | - foreach ( $versions as $version ) { | |
| 223 | + foreach ( $plugin_information->versions as $version => $download_link ) { | |
| 251 | 224 | if ( $max_versions <= $current_index ) { |
| 252 | 225 | break; |
| 253 | 226 | } |
| 254 | 227 | |
| @@ -275,9 +248,9 @@ | ||
| 275 | 248 | if ( version_compare( $version, ELEMENTOR_VERSION, '>=' ) ) { |
| 276 | 249 | continue; |
| 277 | 250 | } |
| 278 | 251 | |
| 279 | - ++$current_index; | |
| 252 | + $current_index++; | |
| 280 | 253 | $rollback_versions[] = $version; |
| 281 | 254 | } |
| 282 | 255 | |
| 283 | 256 | set_transient( 'elementor_rollback_versions_' . ELEMENTOR_VERSION, $rollback_versions, WEEK_IN_SECONDS ); |
| @@ -310,13 +283,13 @@ | ||
| 310 | 283 | 'sections' => [ |
| 311 | 284 | 'tools' => [ |
| 312 | 285 | 'fields' => [ |
| 313 | 286 | 'clear_cache' => [ |
| 314 | - 'label' => esc_html__( 'Elementor Cache', 'elementor' ), | |
| 287 | + 'label' => esc_html__( 'Regenerate CSS & Data', 'elementor' ), | |
| 315 | 288 | 'field_args' => [ |
| 316 | 289 | 'type' => 'raw_html', |
| 317 | - 'html' => sprintf( '<button data-nonce="%s" data-id="elementor-tools-general-button-clear-files-data" class="button elementor-button-spinner" id="elementor-clear-cache-button">%s</button>', wp_create_nonce( 'elementor_clear_cache' ), esc_html__( 'Clear Files & Data', 'elementor' ) ), | |
| 318 | - 'desc' => esc_html__( "Clear outdated CSS files and cached data in the database (rendered HTML, JS/CSS assets, etc.). We'll regenerate those files the next time someone visits any page on your website.", 'elementor' ), | |
| 290 | + 'html' => sprintf( '<button data-nonce="%s" class="button elementor-button-spinner" id="elementor-clear-cache-button">%s</button>', wp_create_nonce( 'elementor_clear_cache' ), esc_html__( 'Regenerate Files & Data', 'elementor' ) ), | |
| 291 | + 'desc' => esc_html__( 'Styles set in Elementor are saved in CSS files in the uploads folder and in the site’s database. Recreate those files and settings, according to the most recent settings.', 'elementor' ), | |
| 319 | 292 | ], |
| 320 | 293 | ], |
| 321 | 294 | 'reset_api_data' => [ |
| 322 | 295 | 'label' => esc_html__( 'Sync Library', 'elementor' ), |
| @@ -321,9 +294,9 @@ | ||
| 321 | 294 | 'reset_api_data' => [ |
| 322 | 295 | 'label' => esc_html__( 'Sync Library', 'elementor' ), |
| 323 | 296 | 'field_args' => [ |
| 324 | 297 | 'type' => 'raw_html', |
| 325 | - 'html' => sprintf( '<button data-nonce="%s" data-id="elementor-tools-general-button-sync-library" class="button elementor-button-spinner" id="elementor-library-sync-button">%s</button>', wp_create_nonce( 'elementor_reset_library' ), esc_html__( 'Sync Library', 'elementor' ) ), | |
| 298 | + 'html' => sprintf( '<button data-nonce="%s" class="button elementor-button-spinner" id="elementor-library-sync-button">%s</button>', wp_create_nonce( 'elementor_reset_library' ), esc_html__( 'Sync Library', 'elementor' ) ), | |
| 326 | 299 | 'desc' => esc_html__( 'Elementor Library automatically updates on a daily basis. You can also manually update it by clicking on the sync button.', 'elementor' ), |
| 327 | 300 | ], |
| 328 | 301 | ], |
| 329 | 302 | ], |
| @@ -334,19 +307,17 @@ | ||
| 334 | 307 | 'label' => esc_html__( 'Replace URL', 'elementor' ), |
| 335 | 308 | 'sections' => [ |
| 336 | 309 | 'replace_url' => [ |
| 337 | 310 | 'callback' => function() { |
| 311 | + $intro_text = sprintf( | |
| 312 | + /* translators: %s: WordPress backups documentation. */ | |
| 313 | + __( '<strong>Important:</strong> It is strongly recommended that you <a target="_blank" href="%s">backup your database</a> before using Replace URL.', 'elementor' ), | |
| 314 | + 'http://go.elementor.com/wordpress-backups/' | |
| 315 | + ); | |
| 316 | + $intro_text = '<div>' . $intro_text . '</div>'; | |
| 317 | + | |
| 338 | 318 | echo '<h2>' . esc_html__( 'Replace URL', 'elementor' ) . '</h2>'; |
| 339 | - printf( | |
| 340 | - '<p><strong>%1$s</strong> %2$s</p>', | |
| 341 | - esc_html__( 'Important:', 'elementor' ), | |
| 342 | - sprintf( | |
| 343 | - /* translators: 1: Link open tag, 2: Link close tag. */ | |
| 344 | - esc_html__( 'It is strongly recommended to %1$sbackup the database%2$s before using replacing URLs.', 'elementor' ), | |
| 345 | - '<a href="https://go.elementor.com/wordpress-backups/" target="_blank">', | |
| 346 | - '</a>' | |
| 347 | - ) | |
| 348 | - ); | |
| 319 | + Utils::print_unescaped_internal_string( $intro_text ); | |
| 349 | 320 | }, |
| 350 | 321 | 'fields' => [ |
| 351 | 322 | 'replace_url' => [ |
| 352 | 323 | 'label' => esc_html__( 'Update Site Address (URL)', 'elementor' ), |
| @@ -351,9 +322,9 @@ | ||
| 351 | 322 | 'replace_url' => [ |
| 352 | 323 | 'label' => esc_html__( 'Update Site Address (URL)', 'elementor' ), |
| 353 | 324 | 'field_args' => [ |
| 354 | 325 | 'type' => 'raw_html', |
| 355 | - 'html' => sprintf( '<input type="text" name="from" placeholder="https://old.example.com" class="large-text"><input type="text" name="to" placeholder="https://new.example.com" class="large-text"><button data-nonce="%s" data-id="elementor-tools-replace_url-button-replace-url" class="button elementor-button-spinner" id="elementor-replace-url-button">%s</button>', wp_create_nonce( 'elementor_replace_url' ), esc_html__( 'Replace URL', 'elementor' ) ), | |
| 326 | + 'html' => sprintf( '<input type="text" name="from" placeholder="http://old-url.com" class="medium-text"><input type="text" name="to" placeholder="http://new-url.com" class="medium-text"><button data-nonce="%s" class="button elementor-button-spinner" id="elementor-replace-url-button">%s</button>', wp_create_nonce( 'elementor_replace_url' ), esc_html__( 'Replace URL', 'elementor' ) ), | |
| 356 | 327 | 'desc' => esc_html__( 'Enter your old and new URLs for your WordPress installation, to update all Elementor data (Relevant for domain transfers or move to \'HTTPS\').', 'elementor' ), |
| 357 | 328 | ], |
| 358 | 329 | ], |
| 359 | 330 | ], |
| @@ -381,32 +352,29 @@ | ||
| 381 | 352 | 'label' => esc_html__( 'Rollback Version', 'elementor' ), |
| 382 | 353 | 'field_args' => [ |
| 383 | 354 | 'type' => 'raw_html', |
| 384 | 355 | 'html' => sprintf( |
| 385 | - $rollback_html . '<button data-placeholder-text="%1$s v{VERSION}" data-placeholder-url="%2$s" class="button elementor-button-spinner elementor-rollback-button">%1$s</button>', | |
| 386 | - esc_html__( 'Reinstall', 'elementor' ), | |
| 387 | - wp_nonce_url( admin_url( 'admin-post.php?action=elementor_rollback&version=VERSION' ), 'elementor_rollback' ) | |
| 356 | + $rollback_html . '<a data-placeholder-text="' . esc_html__( 'Reinstall', 'elementor' ) . ' v{VERSION}" href="#" data-placeholder-url="%s" class="button elementor-button-spinner elementor-rollback-button">%s</a>', | |
| 357 | + wp_nonce_url( admin_url( 'admin-post.php?action=elementor_rollback&version=VERSION' ), 'elementor_rollback' ), | |
| 358 | + esc_html__( 'Reinstall', 'elementor' ) | |
| 388 | 359 | ), |
| 389 | - 'desc' => $this->get_warning_span( esc_html__( 'Warning: Please back up your database before making the rollback.', 'elementor' ) ), | |
| 360 | + 'desc' => '<span style="color: red;">' . esc_html__( 'Warning: Please backup your database before making the rollback.', 'elementor' ) . '</span>', | |
| 390 | 361 | ], |
| 391 | 362 | ], |
| 392 | 363 | ], |
| 393 | 364 | ], |
| 394 | 365 | 'beta' => [ |
| 395 | - 'show_if' => $this->display_beta_tester(), | |
| 396 | 366 | 'label' => esc_html__( 'Become a Beta Tester', 'elementor' ), |
| 397 | 367 | 'callback' => function() { |
| 398 | 368 | echo '<p>' . |
| 399 | 369 | esc_html__( 'Turn-on Beta Tester, to get notified when a new beta version of Elementor or Elementor Pro is available. The Beta version will not install automatically. You always have the option to ignore it.', 'elementor' ) . |
| 400 | 370 | '</p>'; |
| 401 | - echo '<p>' . sprintf( | |
| 371 | + echo sprintf( | |
| 402 | 372 | /* translators: 1: Link open tag, 2: Link close tag. */ |
| 403 | - esc_html__( '%1$sClick here%2$s %3$sto join our first-to-know email updates.%4$s', 'elementor' ), | |
| 404 | - '<a id="beta-tester-first-to-know" class="elementor-become-a-beta-tester" href="#">', | |
| 405 | - '</a>', | |
| 406 | - '<span class="elementor-become-a-beta-tester">', | |
| 407 | - '</span>', | |
| 408 | - ) . '</p>'; | |
| 373 | + esc_html__( '%1$sClick here%2$s to join our first-to-know email updates.', 'elementor' ), | |
| 374 | + '<a id="beta-tester-first-to-know" href="#">', | |
| 375 | + '</a>' | |
| 376 | + ); | |
| 409 | 377 | }, |
| 410 | 378 | 'fields' => [ |
| 411 | 379 | 'beta' => [ |
| 412 | 380 | 'label' => esc_html__( 'Beta Tester', 'elementor' ), |
| @@ -416,9 +384,9 @@ | ||
| 416 | 384 | 'options' => [ |
| 417 | 385 | 'no' => esc_html__( 'Disable', 'elementor' ), |
| 418 | 386 | 'yes' => esc_html__( 'Enable', 'elementor' ), |
| 419 | 387 | ], |
| 420 | - 'desc' => $this->get_warning_span( esc_html__( 'Please Note: We do not recommend updating to a beta version on production sites.', 'elementor' ) ), | |
| 388 | + 'desc' => '<span style="color: red;">' . esc_html__( 'Please Note: We do not recommend updating to a beta version on production sites.', 'elementor' ) . '</span>', | |
| 421 | 389 | ], |
| 422 | 390 | ], |
| 423 | 391 | ], |
| 424 | 392 | ], |
| @@ -427,12 +395,12 @@ | ||
| 427 | 395 | ]; |
| 428 | 396 | |
| 429 | 397 | if ( ! Plugin::$instance->kits_manager->get_active_kit()->get_id() ) { |
| 430 | 398 | $tabs['general']['sections']['tools']['fields']['recreate_kit'] = [ |
| 431 | - 'label' => esc_html__( 'Recreate Kit', 'elementor' ), | |
| 399 | + 'label' => __( 'Recreate Kit', 'elementor' ), | |
| 432 | 400 | 'field_args' => [ |
| 433 | 401 | 'type' => 'raw_html', |
| 434 | - 'html' => sprintf( '<button data-nonce="%s" class="button elementor-button-spinner" id="elementor-recreate-kit-button">%s</button>', wp_create_nonce( 'elementor_recreate_kit' ), esc_html__( 'Recreate Kit', 'elementor' ) ), | |
| 402 | + 'html' => sprintf( '<button data-nonce="%s" class="button elementor-button-spinner" id="elementor-recreate-kit-button">%s</button>', wp_create_nonce( 'elementor_recreate_kit' ), __( 'Recreate Kit', 'elementor' ) ), | |
| 435 | 403 | 'desc' => esc_html__( 'It seems like your site doesn\'t have any active Kit. The active Kit includes all of your Site Settings. By recreating your Kit you will able to start edit your Site Settings again.', 'elementor' ), |
| 436 | 404 | ], |
| 437 | 405 | ]; |
| 438 | 406 | } |
| @@ -459,27 +427,6 @@ | ||
| 459 | 427 | * @return bool |
| 460 | 428 | */ |
| 461 | 429 | public static function can_user_rollback_versions() { |
| 462 | 430 | return current_user_can( 'activate_plugins' ) && current_user_can( 'update_plugins' ); |
| 463 | - } | |
| 464 | - | |
| 465 | - /** | |
| 466 | - * Check if the beta tester should be displayed. | |
| 467 | - * | |
| 468 | - * @since 3.19.0 | |
| 469 | - * | |
| 470 | - * @return bool | |
| 471 | - */ | |
| 472 | - public function display_beta_tester(): bool { | |
| 473 | - $display_beta_tester = true; | |
| 474 | - /** | |
| 475 | - * Filter to allow override the display of the beta tester. | |
| 476 | - * | |
| 477 | - * @param bool $display_beta_tester Whether to display the beta tester. | |
| 478 | - * | |
| 479 | - * @since 3.19.0 | |
| 480 | - * | |
| 481 | - * return bool | |
| 482 | - */ | |
| 483 | - return apply_filters( 'elementor/admin/show_beta_tester', $display_beta_tester ); | |
| 484 | 431 | } |
| 485 | 432 | } |