1'; if($newversion) { // Compare current theme version with the remote XML version add_dashboard_page( NOTIFIER_THEME_NAME . ' Theme Updates', NOTIFIER_THEME_NAME . ' Update '.$count, 'administrator', PEXETO_UPDATE_PAGE_NAME, 'update_notifier'); } } } add_action('admin_menu', 'update_notifier_menu'); function pexeto_check_if_new_version(){ $xml = get_latest_theme_version(NOTIFIER_CACHE_INTERVAL); // Get the latest remote XML file on our server $latest = explode('.',$xml->latest); $current= explode('.',PEXETO_VERSION); $newversion=false; for($i=0; $iadd_menu( array( 'id' => 'update_notifier', 'title' => '' . NOTIFIER_THEME_NAME . ' New Updates', 'href' => get_admin_url() . 'index.php?page=theme-update-notifier' ) ); } } } add_action( 'admin_bar_menu', 'update_notifier_bar_menu', 1000 ); // The notifier page function update_notifier() { $xml = get_latest_theme_version(NOTIFIER_CACHE_INTERVAL); // Get the latest remote XML file on our server $theme_data = wp_get_theme(); // Read theme current version from the style.css $options_url= admin_url('index.php?page='.PEXETO_UPDATE_PAGE_NAME.'&pexeto_update=true'); ?>

Theme Updates

message; ?> You have version Version; ?> installed. Please update to version latest; ?>.

Automatic Update Instructions

Important: Please note that with the automatic theme update any code modifications done in the theme's code will be lost, so please make sure you have a backup copy of the theme files before you update the theme.

In order to use this functionality, you have to:
1. Go to " Options" » "General" » "Theme Update" section and insert your Envato Marketplace username and API Key in the relevant fields.
2. Make sure that the name of the folder that contains the theme files is called "". This is the default folder name, so if you haven't modified it manually, the name of the folder on your server should be called ""

Are you sure you want to update the theme and replace all your current theme files with the new updated files?
You haven't inserted your Marketplace username and API Key - please go to the Options page and populate the required data in the "Theme Update" section.
Automatically Update Theme

Manual Update Instructions

It is recommended to manually install the update if you have done some modifications to the theme's code. If so, first create a backup copy of the current theme you have installed and modified and then you can proceed with installing the update.

View Update Instructions

To download the latest update of the theme, login to ThemeForest, head over to your Downloads section and re-download the theme like you did when you bought it.

There are two main ways of installing an update manually:

  1. By uploading the theme as a new theme (recommended)- this is an easier way to accomplish this. You just have to upload the updated theme zip file via the built in WordPress theme uploader as a new theme from the Appearance » Themes » Install Themes » Upload section.
    Note: Please note that with the activating of the new theme it is possible your menu setting not to be saved for the new theme. If so, you just have to go to Appearance » Menus » Theme Locations, select the menu (it will be still there) and press the "Save" button.
  2. Via FTP - you have to first unzip the zipped theme file and then you can use an FTP client (such as FileZilla) and replace all the theme files with the updated ones.
    Note: Please note that with the file replacing all the code changes you have made to the files (if you have made any) will be lost, so please make sure you have a backup copy of the theme files before you do the replacement. All the settings that you have made from the admin panel won't be lost- they will be still available.

For more information about the updates, please refer to the "Updates" section of the documentation included.



Update Changes

changelog; ?>
$interval) ) { // cache doesn't exist, or is old, so refresh it $res = wp_remote_get( $notifier_file_url ); $cache=wp_remote_retrieve_body($res); if ($cache) { // we got good results update_option( $db_cache_field, $cache ); update_option( $db_cache_field_last_updated, time() ); } // read from the cache file $notifier_data = get_option( $db_cache_field ); }else { // cache file is fresh enough, so read from it $notifier_data = get_option( $db_cache_field ); } // Let's see if the $xml data was returned as we expected it to. // If it didn't, use the default 1.0 as the latest version so that we don't have problems when the remote server hosting the XML file is down if( strpos((string)$notifier_data, '') === false ) { $notifier_data = '1.0'; } // Load the remote XML data into a variable and return it $xml = simplexml_load_string($notifier_data); return $xml; } /*------------------------------------------------------------- AUTOMATIC UPDATE FUNCTIONALITY --------------------------------------------------------------*/ add_action('admin_init', 'pexeto_set_update_functionality'); function pexeto_set_update_functionality(){ // include the library include_once('envato-wordpress-toolkit-library/class-envato-wordpress-theme-upgrader.php'); $theme_data = wp_get_theme(); $theme_name = $theme_data->Name; $tf_username = get_opt('_tf_username'); $tf_api_key = get_opt('_tf_api_key'); $allow_cache=true; if($tf_username && $tf_api_key){ global $pexeto_data; if(isset($_GET['pexeto_update']) && $_GET['pexeto_update']=='true'){ if (in_array ('curl', get_loaded_extensions())){ //cURL is enabled, the Envato Toolkit uses cURL, so the update can be performed $upgrader = new Envato_WordPress_Theme_Upgrader( $tf_username, $tf_api_key ); $upgrader->check_for_theme_update($theme_name, $allow_cache); $res = $upgrader->upgrade_theme($theme_name, $allow_cache); $success = $res->success; $pexeto_data->theme_updated = $success; }else{ $pexeto_data->curl_disabled = true; } } } } add_action('admin_notices', 'pexeto_update_notice' ); function pexeto_update_notice(){ global $pexeto_data; $message_type="updated"; if(isset($pexeto_data->theme_updated)){ if($pexeto_data->theme_updated){ $message = 'The theme has been updated successfully'; }else{ $message = 'An error occurred, the theme has not been updated. Please try again later or install the update manually.'; $message_type = "error"; } }elseif(isset($pexeto_data->curl_disabled) && $pexeto_data->curl_disabled){ $message = 'Error: The theme was not updated, because the cURL extension is not enabled on your server. In order to update the theme automatically, the Envato Toolkit Library requires cURL to be enabled on your server. You can contact your hosting provider to enable this extension for you.'; $message_type = "error"; } if(isset($message)){ echo '

'.$message.'

'; } } ?>