Changeset 1983445
- Timestamp:
- 11/30/2018 07:23:16 PM (7 years ago)
- File:
-
- 1 edited
-
site-info/trunk/alar-site-info.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
site-info/trunk/alar-site-info.php
r1983432 r1983445 208 208 echo '<h2 class="alar-site-info-subheading">'.__('Installed Version', 'alar-site-info').'</h2>'; 209 209 echo '<ul class="alar-site-info-indent-two">'; 210 if (!isset($wp_version)) { 211 $dashicon = 'warning'; 212 $tooltip = __('Platform version not detected.', 'alar-site-info'); 213 $message = $tooltip; 210 211 if (function_exists('classicpress_version')) { 212 // If ClassicPress. 213 $dashicon = 'yes'; 214 $tooltip = ''; 215 $message = classicpress_version(); 214 216 echo $this->get_list_item($dashicon, $tooltip, $message); 215 217 } else { 216 $response = wp_remote_get('https://api.wordpress.org/core/version-check/1.7/');217 $obj = json_decode($response['body']); 218 $latest_version = $obj->offers[0]->version;219 if (version_compare($wp_version, $latest_version, '=')) {220 $ dashicon = 'yes';221 $ tooltip = '';222 $message = $wp_version;218 // If WordPress. 219 220 if (!isset($wp_version)) { 221 $dashicon = 'warning'; 222 $tooltip = __('Platform version not detected.', 'alar-site-info'); 223 $message = $tooltip; 224 echo $this->get_list_item($dashicon, $tooltip, $message); 223 225 } else { 224 $dashicon = 'warning'; 225 $tooltip = __('For maximum security and stability, please update your site to the latest version.', 'alar-site-info'); 226 $message = $wp_version.' [<a href="'.admin_url().'update-core.php">'.__('Update Recommended', 'alar-site-info').'</a>]'; 226 $response = wp_remote_get('https://api.wordpress.org/core/version-check/1.7/'); 227 $obj = json_decode($response['body']); 228 $latest_version = $obj->offers[0]->version; 229 if (version_compare($wp_version, $latest_version, '=')) { 230 $dashicon = 'yes'; 231 $tooltip = ''; 232 $message = $wp_version; 233 } else { 234 $dashicon = 'warning'; 235 $tooltip = __('For maximum security and stability, please update your site to the latest version.', 'alar-site-info'); 236 $message = $wp_version.' [<a href="'.admin_url().'update-core.php">'.__('Update Recommended', 'alar-site-info').'</a>]'; 237 } 238 echo $this->get_list_item($dashicon, $tooltip, $message); 227 239 } 228 echo $this->get_list_item($dashicon, $tooltip, $message); 229 } 240 241 } 242 230 243 echo '</ul>'; 231 244
Note: See TracChangeset
for help on using the changeset viewer.