[442] | 1 | <?php
|
---|
[698] | 2 | function find_xpress_update( $version, $locale ){
|
---|
| 3 | $latest_version = get_option('xpressme_latest_version');
|
---|
| 4 | return (object)$latest_version;
|
---|
| 5 | }
|
---|
[701] | 6 |
|
---|
[698] | 7 | function list_xpress_update( $update=null ) {
|
---|
[757] | 8 | global $modInfo,$xpress_config;
|
---|
[442] | 9 |
|
---|
[757] | 10 | $xpress_version = $modInfo->get_module_full_version();
|
---|
[443] | 11 | $lang = WPLANG;
|
---|
[712] | 12 |
|
---|
| 13 | $automatically_enable = file_exists(ABSPATH .'wp-admin/includes/class-wp-upgrader.php');
|
---|
[442] | 14 |
|
---|
[443] | 15 | $check_url = "http://ja.xpressme.info/version_check/index.php?version=$xpress_version&lang=$lang";
|
---|
| 16 |
|
---|
[442] | 17 | echo '<div class="wrap">'."\n";
|
---|
| 18 | echo '<div id="icon-options-general" class="icon32"><br /></div>'."\n";
|
---|
| 19 | echo '<h2>' . __('XPressME Upgrade', 'xpressme') . "</h2><br>\n";
|
---|
[698] | 20 | if( get_xpress_latest_version($check_url)){
|
---|
[442] | 21 | $latest = get_option('xpressme_latest_version');
|
---|
| 22 | if ($latest) {
|
---|
| 23 | $site_url=$latest['url'];
|
---|
| 24 | $package=$latest['package'];
|
---|
| 25 | $latest_version=$latest['latest_version'];
|
---|
| 26 | $check_time=$latest['check_time'];
|
---|
| 27 | }
|
---|
| 28 |
|
---|
[701] | 29 | $show_buttons = false;
|
---|
[698] | 30 | if (version_compare($xpress_version, $latest_version, '>')){
|
---|
[442] | 31 | echo '<h3 class="response">';
|
---|
[701] | 32 | printf(__('You are using a XPressME Integration Kit development version (%s). Cool! Please stay updated.', 'xpressme') , $xpress_version);
|
---|
[442] | 33 | echo '</h3>';
|
---|
| 34 | } else if (version_compare($xpress_version, $latest_version, '<')) {
|
---|
[698] | 35 | echo '<h3 class="response">';
|
---|
[704] | 36 | _e( 'An updated version of XPressME Integration Kit is available.', 'xpressme' );
|
---|
[698] | 37 | echo '</h3>';
|
---|
| 38 |
|
---|
[443] | 39 | if ($latest['diff_response'] == 'diff_exists'){
|
---|
[698] | 40 | $download_diff ='<a class="button" href="' . $latest['diff_package'] . '">';
|
---|
| 41 | $download_diff .= sprintf(__('Download differential file for %s', 'xpressme') , $xpress_version);
|
---|
| 42 | $download_diff .='</a>';
|
---|
[443] | 43 | }
|
---|
[712] | 44 | if($automatically_enable){
|
---|
| 45 | $message = sprintf(__('You can update to XPressME Integration Kit Ver %s</a> automatically or download the package and install it manually:', 'xpressme'), $latest_version);
|
---|
| 46 | } else {
|
---|
| 47 | $message = sprintf(__('You can upgrade to version %s download the package and install it manually:', 'xpressme'),$latest_version);
|
---|
| 48 | }
|
---|
[704] | 49 | $submit = __('Update Automatically', 'xpressme');
|
---|
[698] | 50 | $form_action = 'admin.php?page=upgrade_page&action=do-xpress-upgrade';
|
---|
| 51 | $download = sprintf(__('Download %s', 'xpressme') , $latest_version);
|
---|
| 52 | $show_buttons = true;
|
---|
| 53 |
|
---|
[442] | 54 | } else {
|
---|
[698] | 55 | echo '<h3>';
|
---|
[704] | 56 | printf(__('You have the latest version of XPressME Integration Kit Ver.%s.', 'xpressme'),$xpress_version);
|
---|
[698] | 57 | echo '</h3>';
|
---|
| 58 |
|
---|
| 59 | $message = __('You have the latest version of XPressME Integration Kit. You do not need to upgrade', 'xpressme');
|
---|
[704] | 60 | $submit = __('Re-install Automatically', 'xpressme');
|
---|
[698] | 61 | $form_action = 'update-core.php?action=do-core-reinstall';
|
---|
| 62 |
|
---|
[442] | 63 | }
|
---|
[443] | 64 |
|
---|
[499] | 65 | // develop
|
---|
[701] | 66 | $develop_show = false;
|
---|
[443] | 67 | if ($latest['develop_response'] == 'development_exists'
|
---|
| 68 | && !empty($latest['develop_package'])
|
---|
| 69 | )
|
---|
| 70 | {
|
---|
[701] | 71 | $develop_latest_version=$latest['develop_latest_version'];
|
---|
| 72 | $develop_form_action = 'admin.php?page=upgrade_page&action=do-xpress-develop_upgrade';
|
---|
[712] | 73 | if($automatically_enable){
|
---|
[715] | 74 | $develop_message = sprintf(__('You can update to XPressME Integration Kit development version %s automatically or download the package and install it manually:', 'xpressme'), $develop_latest_version);
|
---|
[712] | 75 | } else {
|
---|
| 76 | $develop_message = sprintf(__('You can use the development version %s download the package and install it manually:', 'xpressme'),$develop_latest_version);
|
---|
| 77 | }
|
---|
[701] | 78 | $develop_show = true;
|
---|
| 79 | $develop_package=$latest['develop_package'];
|
---|
[704] | 80 | $develop_submit = __('Update Automatically', 'xpressme');
|
---|
[701] | 81 | $develop_download = sprintf(__('Download %s', 'xpressme') , $develop_latest_version);
|
---|
| 82 | $develop_download_diff = '';
|
---|
[499] | 83 | // develop diff
|
---|
| 84 | if ($latest['diff_develop_response'] == 'diff_develop_exists'
|
---|
| 85 | && !empty($latest['diff_develop_package'])
|
---|
| 86 | )
|
---|
| 87 | {
|
---|
[701] | 88 | $develop_download_diff = '<a class="button" href="' . $latest['diff_develop_package'] . '">';
|
---|
| 89 | $develop_download_difff .= sprintf(__('Download differential file for %s', 'xpressme') , $latest['diff_develop_latest_version']);
|
---|
| 90 | $develop_download_diff .= '</a>';
|
---|
[499] | 91 | }
|
---|
[443] | 92 | }
|
---|
| 93 |
|
---|
[698] | 94 | echo '<p>';
|
---|
| 95 | echo $message;
|
---|
| 96 | echo '</p>';
|
---|
| 97 | echo '<form method="post" action="' . $form_action . '" name="upgrade" class="upgrade">';
|
---|
| 98 | // wp_nonce_field('upgrade-core');
|
---|
| 99 | echo '<p>';
|
---|
| 100 | echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>';
|
---|
| 101 | echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>';
|
---|
| 102 | if ( $show_buttons ) {
|
---|
[712] | 103 | if($automatically_enable){
|
---|
| 104 | echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($submit) . '" name="upgrade" /> ';
|
---|
| 105 | }
|
---|
[698] | 106 | echo '<a href="' . esc_url($package) . '" class="button">' . $download . '</a> ';
|
---|
| 107 | echo $download_diff;
|
---|
| 108 | }
|
---|
| 109 | echo '</form>';
|
---|
[701] | 110 |
|
---|
| 111 | if ($develop_show){
|
---|
| 112 | echo '<p>';
|
---|
| 113 | echo $develop_message;
|
---|
| 114 | echo '</p>';
|
---|
| 115 | echo '<form method="post" action="' . $develop_form_action . '" name="develop_upgrade" class="develop_upgrade">';
|
---|
| 116 | echo '<p>';
|
---|
| 117 | echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>';
|
---|
| 118 | echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>';
|
---|
[712] | 119 | if($automatically_enable){
|
---|
| 120 | echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($develop_submit) . '" name="develop_upgrade" /> ';
|
---|
| 121 | }
|
---|
[701] | 122 | echo '<a href="' . esc_url($develop_package) . '" class="button">' . $develop_download . '</a> ';
|
---|
| 123 | echo $develop_download_diff;
|
---|
| 124 | echo '</form>';
|
---|
| 125 | }
|
---|
[442] | 126 | } else {
|
---|
| 127 | echo '<h3 class="response">';
|
---|
| 128 | printf(__('There is no response from <a href="%s">version check API</a> now. sorry, please confirm it after.', 'xpressme'),$check_url);
|
---|
| 129 | echo "</div>\n";
|
---|
| 130 | }
|
---|
| 131 | }
|
---|
| 132 |
|
---|
[698] | 133 |
|
---|
| 134 | function xpress_update_core($current) {
|
---|
| 135 | include_once ABSPATH . 'wp-content/plugins/xpressme/include/class-xpress-upgrader.php';
|
---|
| 136 | $upgrader = new Xpress_Upgrader();
|
---|
| 137 | return $upgrader->upgrade($current);
|
---|
| 138 | }
|
---|
| 139 |
|
---|
[701] | 140 | function do_xpress_upgrade( $develop = false,$reinstall = false ) {
|
---|
[757] | 141 | global $wp_filesystem,$modInfo;
|
---|
[698] | 142 |
|
---|
| 143 | if ( $reinstall )
|
---|
[704] | 144 | $url = 'admin.php?page=upgrade_page&action=do-xpress-reinstall';
|
---|
| 145 | else {
|
---|
| 146 | if(!$develop)
|
---|
| 147 | $url = 'admin.php?page=upgrade_page&action=do-xpress-upgrade';
|
---|
| 148 | else
|
---|
| 149 | $url = 'admin.php?page=upgrade_page&action=do-xpress-develop_upgrade';
|
---|
| 150 | $url = wp_nonce_url($url, 'upgrade-xpress');
|
---|
| 151 | }
|
---|
[698] | 152 | if ( false === ($credentials = request_filesystem_credentials($url, '', false, ABSPATH)) )
|
---|
| 153 | return;
|
---|
| 154 |
|
---|
| 155 | $version = isset( $_POST['version'] )? $_POST['version'] : false;
|
---|
| 156 | $locale = isset( $_POST['locale'] )? $_POST['locale'] : 'en_US';
|
---|
| 157 | $update = find_xpress_update( $version, $locale );
|
---|
| 158 | // $update = true;
|
---|
| 159 | if ( !$update )
|
---|
| 160 | return;
|
---|
[701] | 161 | if ( $develop )
|
---|
| 162 | $update->package = $update->develop_package;
|
---|
[698] | 163 |
|
---|
| 164 | if ( ! WP_Filesystem($credentials, ABSPATH) ) {
|
---|
| 165 | request_filesystem_credentials($url, '', true, ABSPATH); //Failed to connect, Error and request again
|
---|
| 166 | return;
|
---|
| 167 | }
|
---|
| 168 | ?>
|
---|
| 169 | <div class="wrap">
|
---|
| 170 | <?php screen_icon(); ?>
|
---|
[704] | 171 | <h2><?php _e('Update XPressME Integration Kit', 'xpressme'); ?></h2>
|
---|
[698] | 172 | <?php
|
---|
| 173 | if ( $wp_filesystem->errors->get_error_code() ) {
|
---|
| 174 | foreach ( $wp_filesystem->errors->get_error_messages() as $message )
|
---|
| 175 | show_message($message);
|
---|
| 176 | echo '</div>';
|
---|
| 177 | return;
|
---|
| 178 | }
|
---|
| 179 |
|
---|
| 180 | if ( $reinstall )
|
---|
| 181 | $update->response = 'reinstall';
|
---|
| 182 |
|
---|
| 183 | $result = xpress_update_core($update, 'show_message');
|
---|
| 184 |
|
---|
| 185 | if ( is_wp_error($result) ) {
|
---|
| 186 | show_message($result);
|
---|
| 187 | if ('up_to_date' != $result->get_error_code() )
|
---|
[704] | 188 | show_message( __('Installation Failed', 'xpressme') );
|
---|
[698] | 189 | } else {
|
---|
[704] | 190 | show_message( __('XPressME Integration Kit files updated successfully', 'xpressme') );
|
---|
| 191 | show_message( __('Please update the module. ', 'xpressme') );
|
---|
| 192 |
|
---|
[757] | 193 | $update_url = $modInfo->get_module_url() .'/admin/update.php';
|
---|
[715] | 194 | show_message( '<strong>' . __('Actions:', 'xpressme') . '</strong> <a href="' . esc_url( $update_url ) . '">' . __('Go to Module Update', 'xpressme') . '</a>' );
|
---|
[698] | 195 | }
|
---|
| 196 | echo '</div>';
|
---|
| 197 | }
|
---|
| 198 |
|
---|
| 199 |
|
---|
| 200 |
|
---|
| 201 |
|
---|
| 202 | function upgrade_page()
|
---|
| 203 | {
|
---|
| 204 | $action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-xpress';
|
---|
| 205 | $upgrade_error = false;
|
---|
| 206 | if ( 'upgrade-xpress' == $action ) {
|
---|
| 207 | list_xpress_update();
|
---|
| 208 | } elseif ( 'do-xpress-upgrade' == $action) {
|
---|
[701] | 209 | $update_develop = false;
|
---|
| 210 | do_xpress_upgrade($update_develop);
|
---|
| 211 | } else if ( 'do-xpress-develop_upgrade' == $action) {
|
---|
| 212 | $update_develop = true;
|
---|
| 213 | do_xpress_upgrade($update_develop);
|
---|
[698] | 214 | }
|
---|
| 215 | }
|
---|
| 216 |
|
---|
[442] | 217 | function xp_remote_get($url, $headers = ""){
|
---|
[757] | 218 | global $modInfo;
|
---|
| 219 | $xpress_version = $modInfo->get_module_full_version();
|
---|
[442] | 220 |
|
---|
[757] | 221 | require_once( $modInfo->get_module_path() . '/wp-includes/class-snoopy.php');
|
---|
[442] | 222 |
|
---|
| 223 | // Snoopy is an HTTP client in PHP
|
---|
| 224 | $client = new Snoopy();
|
---|
| 225 | $client->agent = 'XPressME/' . $xpress_version;
|
---|
| 226 | $client->read_timeout = 2;
|
---|
| 227 | if (is_array($headers) ) {
|
---|
| 228 | $client->rawheaders = $headers;
|
---|
| 229 | }
|
---|
| 230 |
|
---|
| 231 | @$client->fetch($url);
|
---|
| 232 | $response['response']['code'] = $client->status;
|
---|
| 233 | $response['body'] = $client->results;
|
---|
[748] | 234 | /* not use snoopy test code
|
---|
| 235 | $handle = fopen($url,'r');
|
---|
| 236 | if ($handle) {
|
---|
| 237 | $ans = array();
|
---|
| 238 | $num = 0;
|
---|
| 239 | $pos = 0;
|
---|
| 240 | while (($buffer = fgets($handle, 4096)) !== false) {
|
---|
| 241 | $buffer = trim($buffer);
|
---|
| 242 | if (strlen($buffer) == 0) {
|
---|
| 243 | $num++;
|
---|
| 244 | $pos=0;
|
---|
| 245 | } else {
|
---|
| 246 | $ans[$num][$pos] = $buffer;
|
---|
| 247 | $pos++;
|
---|
| 248 | }
|
---|
| 249 | }
|
---|
| 250 | if (!feof($handle)) {
|
---|
| 251 | echo "Error: unexpected fgets() fail\n";
|
---|
| 252 | }
|
---|
| 253 | fclose($handle);
|
---|
| 254 | }
|
---|
| 255 | */
|
---|
| 256 |
|
---|
| 257 |
|
---|
[442] | 258 | return $response;
|
---|
| 259 | return $client;
|
---|
| 260 |
|
---|
| 261 | }
|
---|
| 262 |
|
---|
[702] | 263 | function get_xpress_latest_version($check_url=null){
|
---|
[442] | 264 | global $wp_version, $wpdb, $wp_local_package;
|
---|
[757] | 265 | global $modInfo;
|
---|
[442] | 266 |
|
---|
[757] | 267 | $xpress_version = $modInfo->get_module_full_version();
|
---|
[442] | 268 | $lang = WPLANG;
|
---|
[702] | 269 | if(is_null($check_url))
|
---|
| 270 | $check_url = "http://ja.xpressme.info/version_check/index.php?version=$xpress_version&lang=$lang";
|
---|
[442] | 271 | $request_options = array(
|
---|
| 272 | 'timeout' => 3,
|
---|
| 273 | 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
|
---|
| 274 | );
|
---|
[748] | 275 | $response = xp_remote_get($check_url);
|
---|
[442] | 276 | if (! function_exists('wp_remote_get')) {
|
---|
| 277 | $response = xp_remote_get($check_url);
|
---|
| 278 |
|
---|
| 279 | if (empty($response['body'])) return false;
|
---|
| 280 | } else {
|
---|
| 281 |
|
---|
| 282 | $response = wp_remote_get($check_url, $request_options);
|
---|
| 283 |
|
---|
| 284 | if ( is_wp_error( $response ) )
|
---|
| 285 | return false;
|
---|
| 286 | }
|
---|
| 287 | if ( 200 != $response['response']['code'] )
|
---|
| 288 | return false;
|
---|
| 289 | $body = trim( $response['body'] );
|
---|
| 290 | $body = str_replace(array("\r\n", "\r"), "\n", $body);
|
---|
| 291 | $returns = explode("\n", $body);
|
---|
[443] | 292 |
|
---|
[442] | 293 | if ( isset( $returns[0] ) ) $response = $returns[0]; else $response = '';
|
---|
| 294 | if ( isset( $returns[1] ) ) $url = clean_url( $returns[1] ); else $url = '';
|
---|
| 295 | if ( isset( $returns[2] ) ) $package = clean_url( $returns[2] ); else $package = '';
|
---|
| 296 | if ( isset( $returns[3] ) ) $latest_version = $returns[3]; else $latest_version = '';
|
---|
[443] | 297 | if ( isset( $returns[4] ) ) $lang = $returns[4]; else $lang = '';
|
---|
[442] | 298 |
|
---|
| 299 | // diff
|
---|
[443] | 300 | if ( isset( $returns[6] ) ) $diff_response = $returns[6]; else $diff_response = '';
|
---|
| 301 | if ( isset( $returns[7] ) ) $diff_url = clean_url( $returns[7] ); else $diff_url = '';
|
---|
| 302 | if ( isset( $returns[8] ) ) $diff_package = clean_url( $returns[8] ); else $diff_package = '';
|
---|
| 303 | if ( isset( $returns[9] ) ) $diff_latest_version = $returns[9]; else $diff_latest_version = '';
|
---|
| 304 | if ( isset( $returns[10] ) ) $diff_lang = $returns[10]; else $diff_lang = '';
|
---|
[442] | 305 |
|
---|
| 306 | // developer
|
---|
[443] | 307 | if ( isset( $returns[12] ) ) $develop_response = $returns[12]; else $develop_response = '';
|
---|
| 308 | if ( isset( $returns[13] ) ) $develop_url = clean_url( $returns[13] ); else $develop_url = '';
|
---|
| 309 | if ( isset( $returns[14] ) ) $develop_package = clean_url( $returns[14] ); else $develop_package = '';
|
---|
| 310 | if ( isset( $returns[15] ) ) $develop_latest_version = $returns[15]; else $develop_latest_version = '';
|
---|
| 311 | if ( isset( $returns[16] ) ) $develop_lang = $returns[16]; else $develop_lang = '';
|
---|
[499] | 312 |
|
---|
| 313 | // developer diff
|
---|
| 314 | if ( isset( $returns[18] ) ) $diff_develop_response = $returns[18]; else $diff_develop_response = '';
|
---|
| 315 | if ( isset( $returns[19] ) ) $diff_develop_url = clean_url( $returns[19] ); else $diff_develop_url = '';
|
---|
| 316 | if ( isset( $returns[20] ) ) $diff_develop_package = clean_url( $returns[20] ); else $diff_develop_package = '';
|
---|
| 317 | if ( isset( $returns[21] ) ) $diff_develop_latest_version = $returns[21]; else $diff_develop_latest_version = '';
|
---|
| 318 | if ( isset( $returns[22] ) ) $diff_develop_lang = $returns[22]; else $diff_develop_lang = '';
|
---|
[442] | 319 |
|
---|
| 320 | $write_options = array (
|
---|
| 321 | 'response' => $response ,
|
---|
| 322 | 'url' => $url ,
|
---|
| 323 | 'package' => $package ,
|
---|
| 324 | 'latest_version' => $latest_version ,
|
---|
[443] | 325 | 'lang' => $lang ,
|
---|
[442] | 326 | 'diff_response' => $diff_response ,
|
---|
| 327 | 'diff_url' => $diff_url ,
|
---|
| 328 | 'diff_package' => $diff_package ,
|
---|
| 329 | 'diff_latest_version' => $diff_latest_version ,
|
---|
[443] | 330 | 'diff_lang' => $diff_lang ,
|
---|
[442] | 331 | 'develop_response' => $develop_response ,
|
---|
| 332 | 'develop_url' => $develop_url ,
|
---|
| 333 | 'develop_package' => $develop_package ,
|
---|
| 334 | 'develop_latest_version' => $develop_latest_version ,
|
---|
[443] | 335 | 'develop_lang' => $develop_lang ,
|
---|
[499] | 336 | 'diff_develop_response' => $diff_develop_response ,
|
---|
| 337 | 'diff_develop_url' => $diff_develop_url ,
|
---|
| 338 | 'diff_develop_package' => $diff_develop_package ,
|
---|
| 339 | 'diff_develop_latest_version' => $diff_develop_latest_version ,
|
---|
| 340 | 'diff_develop_lang' => $diff_develop_lang ,
|
---|
[442] | 341 | 'check_time' => time()
|
---|
| 342 | );
|
---|
| 343 |
|
---|
| 344 | $latest_version = get_option('xpressme_latest_version');
|
---|
| 345 | if (!$latest_version) {
|
---|
| 346 | add_option('xpressme_latest_version', $write_options);
|
---|
| 347 | } else {
|
---|
| 348 | update_option('xpressme_latest_version', $write_options);
|
---|
| 349 | }
|
---|
| 350 | return true;
|
---|
| 351 | }
|
---|
| 352 |
|
---|
| 353 | function xpress_update_check() {
|
---|
| 354 | if ( defined('WP_INSTALLING') )
|
---|
| 355 | return;
|
---|
| 356 | global $pagenow;
|
---|
| 357 |
|
---|
| 358 | $php_query_string = $_SERVER['QUERY_STRING'];
|
---|
| 359 |
|
---|
| 360 | if ( 'admin.php' == $pagenow && 'page=upgrade_page' == $php_query_string)
|
---|
| 361 | return;
|
---|
| 362 |
|
---|
| 363 | global $wp_version, $wpdb, $wp_local_package;
|
---|
[757] | 364 | global $modInfo;
|
---|
[442] | 365 |
|
---|
| 366 | $php_query_string = $_SERVER['QUERY_STRING'];
|
---|
[757] | 367 | $xpress_version = $modInfo->get_module_full_version();
|
---|
[442] | 368 |
|
---|
| 369 | $latest = get_option('xpressme_latest_version');
|
---|
| 370 | if (!$latest ) {
|
---|
| 371 | get_xpress_latest_version();
|
---|
| 372 | $latest = get_option('xpressme_latest_version');
|
---|
| 373 | }
|
---|
| 374 |
|
---|
| 375 | if ($latest) {
|
---|
| 376 | $next_check = $latest['check_time'] + (60*60*24);
|
---|
| 377 | $now_time = time();
|
---|
| 378 | if ($next_check < $now_time ){
|
---|
| 379 | get_xpress_latest_version();
|
---|
| 380 | $latest = get_option('xpressme_latest_version');
|
---|
| 381 | }
|
---|
| 382 | }
|
---|
| 383 |
|
---|
| 384 | if ($latest) {
|
---|
| 385 | $url=$latest['url'];
|
---|
| 386 | $package=$latest['package'];
|
---|
| 387 | $latest_version=$latest['latest_version'];
|
---|
| 388 | $check_time=$latest['check_time'];
|
---|
[757] | 389 | $upgrade_page = $modInfo->get_module_url() . "/wp-admin/admin.php?page=upgrade_page";
|
---|
[442] | 390 |
|
---|
| 391 | if (version_compare($xpress_version, $latest_version, '<')) {
|
---|
| 392 | if ( current_user_can('manage_options') ){
|
---|
| 393 | $msg = sprintf( __('XPressME Integration Kit Version %1$s is available! <a href="%2$s">Please update now</a>.', 'xpressme'), $latest_version, $upgrade_page );
|
---|
| 394 | } else {
|
---|
| 395 | $msg = sprintf( __('XPressME Integration Kit Version %1$s is available! Please notify the site administrator.', 'xpressme'), $latest_version );
|
---|
| 396 | }
|
---|
| 397 | echo "<div id='update-nag'>$msg </div>";
|
---|
| 398 | }
|
---|
| 399 | }
|
---|
| 400 | }
|
---|
| 401 | ?> |
---|