| Name | Size | Mode | Actions |
|---|---|---|---|
| api/ | - | 0755 | rm |
| cache/ | - | 0755 | rm |
| data/ | - | 0755 | rm |
| lib/ | - | 0755 | rm |
| mu-plugins/ | - | 0755 | rm |
| post/ | - | 0755 | rm |
| Cache.php | 8931 | 0644 | editdlrm |
| CompatibilityWarning.php | 70131 | 0644 | editdlrm |
| HTTPInterface.php | 15950 | 0644 | editdlrm |
| init.php | 26058 | 0644 | editdlrm |
| Logger.php | 3796 | 0644 | editdlrm |
| PageResource.php | 56372 | 0644 | editdlrm |
| Portability.php | 170237 | 0644 | editdlrm |
| README.md | 934 | 0644 | editdlrm |
| SupportCenter.php | 125576 | 0644 | editdlrm |
| SupportCenterMUAutoloader.php | 1629 | 0644 | editdlrm |
| Updates.php | 35874 | 0644 | editdlrm |
| VersionRollback.php | 18591 | 0644 | editdlrm |
/home/desid573/verdenaturopathy.com.au/wp-content/themes/Divi/core/components/VersionRollback.php (18591B)
' . et_get_safe_localization( sprintf( __( 'You\'re currently rolled back to Version %1$s from Version %2$s.', 'et-core' ), esc_html( $this->_get_latest_installed_version() ), esc_html( $this->_get_previous_installed_version() ) ) ) . '
' . et_get_safe_localization( sprintf( __( 'Update to the latest version to unlock the full power of %1$s. Learn more here.', 'et-core' ), esc_html( $this->product_name ), esc_url( $this->_get_update_documentation_url() ) ) ) . '
'; wp_send_json_error( array( 'errorCode' => 'et_unknown', 'error' => $error, ), 400 ); } $success = $this->rollback(); if ( is_wp_error( $success ) ) { $error = $success->get_error_message(); if ( $success->get_error_code() === 'et_version_rollback_blocklisted' ) { $error = '' . et_get_safe_localization( sprintf( __( 'For privacy and security reasons, you cannot rollback to Version %1$s.', 'et-core' ), esc_html( $this->_get_previous_installed_version() ) ) ) . '
'; } wp_send_json_error( array( 'errorIsUnrecoverable' => in_array( $success->get_error_code(), array( 'et_version_rollback_not_available', 'et_version_rollback_blocklisted' ) ), 'errorCode' => $success->get_error_code(), 'error' => $error, ), 400 ); } wp_send_json_success(); } /** * Execute a version rollback. * * @since 3.10 * * @return bool|WP_Error */ public function rollback() { // Load versions before rollback so they are not affected. $previous_version = $this->_get_previous_installed_version(); $latest_version = $this->_get_latest_installed_version(); $api = new ET_Core_API_ElegantThemes( $this->api_username, $this->api_key ); $available = $api->is_product_available( $this->product_name, $previous_version ); if ( is_wp_error( $available ) ) { $major_minor = implode( '.', array_slice( explode( '.', $previous_version ), 0, 2 ) ); if ( $major_minor . '.0' === $previous_version ) { // Skip the trailing 0 in the version number and retry. $previous_version = $major_minor; $available = $api->is_product_available( $this->product_name, $previous_version ); } if ( is_wp_error( $available ) ) { return $available; } } $download_url = $api->get_download_url( $this->product_name, $previous_version ); // Buffer and discard output as upgrader classes still output content even if the upgrader skin is silent. $buffer_started = ob_start(); $result = $this->_install_theme( $download_url ); if ( $buffer_started ) { ob_end_clean(); } if ( is_wp_error( $result ) ) { return $result; } if ( true !== $result ) { return new WP_Error( 'et_unknown', esc_html__( 'An unknown error has occurred. Please try again later.', 'et-core' ) ); } /** * Fires after successful product version rollback. * * @since 3.26 * * @param string $product_short_name - The short name of the product rolling back. * @param string $rollback_from_version - The product version rolling back from. * @param string $rollback_to_version - The product version rolling back to. */ do_action( 'et_after_version_rollback', $this->product_shortname, $latest_version, $previous_version ); // Swap version numbers after a successful rollback. $this->_set_previous_installed_version( $latest_version ); $this->_set_latest_installed_version( $previous_version ); } /** * Install a theme overwriting it if it already exists. * Copied from Theme_Upgrader::install() due to lack of control over the clear_desination argument. * * @see Theme_Upgrader::install() @ WordPress 4.9.4 * * @since 3.10 * * @param string $package * * @return bool|WP_Error */ protected function _install_theme( $package ) { require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); $upgrader = new Theme_Upgrader( new ET_Core_LIB_SilentThemeUpgraderSkin() ); $defaults = array( 'clear_update_cache' => true, ); $parsed_args = wp_parse_args( array(), $defaults ); $upgrader->init(); $upgrader->install_strings(); add_filter('upgrader_source_selection', array( $upgrader, 'check_package' ) ); add_filter('upgrader_post_install', array( $upgrader, 'check_parent_theme_filter' ), 10, 3 ); if ( $parsed_args['clear_update_cache'] ) { // Clear cache so wp_update_themes() knows about the new theme. add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); } $upgrader->run( array( 'package' => $package, 'destination' => get_theme_root(), 'clear_destination' => true, // Overwrite theme. 'clear_working' => true, 'hook_extra' => array( 'type' => 'theme', 'action' => 'install', ), ) ); remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 ); remove_filter( 'upgrader_source_selection', array( $upgrader, 'check_package' ) ); remove_filter( 'upgrader_post_install', array( $upgrader, 'check_parent_theme_filter' ) ); if ( ! $upgrader->result || is_wp_error( $upgrader->result ) ) { return $upgrader->result; } // Refresh the Theme Update information. wp_clean_themes_cache( $parsed_args['clear_update_cache'] ); return true; } /** * Get update documentation url for the product. * * @since 3.10 * * @return string */ protected function _get_update_documentation_url() { return "https://www.elegantthemes.com/documentation/{$this->product_shortname}/update-{$this->product_shortname}/"; } /** * Return ePanel option. * * @since 3.10 * * @return array */ public function get_epanel_option() { return array( 'name' => esc_html__( 'Version Rollback', 'et-core' ), 'id' => 'et_version_rollback', 'type' => 'callback_function', 'function_name' => array( $this, 'render_epanel_option' ), 'desc' => et_get_safe_localization( __( 'If you recently updated to a new version and are experiencing problems, you can easily roll back to the previously-installed version. We always recommend using the latest version and testing updates on a staging site. However, if you run into problems after updating you always have the option to roll back.', 'et-core' ) ), ); } /** * Render ePanel option. * * @since 3.10 * * @return void */ public function render_epanel_option() { $previous = $this->_get_previous_installed_version(); $modal_renderer = array( $this, 'render_epanel_no_previous_version_modal' ); if ( ! empty( $previous ) ) { $modal_renderer = array( $this, 'render_epanel_confirm_rollback_modal' ); if ( $this->_is_rolled_back() ) { $modal_renderer = array( $this, 'render_epanel_already_rolled_back_modal' ); } } add_action( 'admin_footer', $modal_renderer ); ?> _get_ajax_action(); $url = add_query_arg( array( 'action' => $action, 'nonce' => wp_create_nonce( $action ), ), admin_url( 'admin-ajax.php' ) ); ?> _get_previous_installed_version(); $latest_installed_version = $this->_get_latest_installed_version(); // Get the theme version since the files may have changed but // we are still executing old code from memory. $theme_version = et_get_theme_version(); if ( $latest_installed_version === $theme_version ) { return; } if ( empty( $latest_installed_version ) ) { $latest_installed_version = $theme_version; } if ( version_compare( $theme_version, $latest_installed_version, '!=') ) { $previous_installed_version = $latest_installed_version; $latest_installed_version = $theme_version; } /** * Fires after new version number is updated. * * @since 4.10.0 */ do_action( 'et_store_before_new_version_update' ); $this->_set_previous_installed_version( $previous_installed_version ); $this->_set_latest_installed_version( $latest_installed_version ); /** * Fires after new version number is updated. * * @since 4.10.0 */ do_action( 'et_store_after_new_version_update' ); } } endif;