@@ -337,9 +337,9 @@ |
||
| 337 | 337 | |
| 338 | 338 | if ( version_compare( PHP_VERSION, '7.0', '<' ) ) { |
| 339 | 339 | $php = '<mark>' . PHP_VERSION . ' - ' . |
| 340 | - __( 'WordPress.org recommends upgrading to PHP 7 or higher for better security.', 'google-calendar-events' ) . |
|
| 341 | - ' <a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'Read more.', 'google-calendar-events' ) . '</a>' . |
|
| 342 | - '</mark>'; |
|
| 340 | + __( 'WordPress.org recommends upgrading to PHP 7 or higher for better security.', 'google-calendar-events' ) . |
|
| 341 | + ' <a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'Read more.', 'google-calendar-events' ) . '</a>' . |
|
| 342 | + '</mark>'; |
|
| 343 | 343 | } else { |
| 344 | 344 | $php = '<mark class="ok">' . PHP_VERSION . '</mark>'; |
| 345 | 345 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | use SimpleCalendar\Abstracts\Admin_Page; |
| 10 | 10 | |
| 11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 11 | +if ( ! defined('ABSPATH')) { |
|
| 12 | 12 | exit; |
| 13 | 13 | } |
| 14 | 14 | |
@@ -30,16 +30,16 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | $this->id = $tab = 'system-status'; |
| 32 | 32 | $this->option_group = $page = 'tools'; |
| 33 | - $this->label = __( 'System Report', 'google-calendar-events' ); |
|
| 33 | + $this->label = __('System Report', 'google-calendar-events'); |
|
| 34 | 34 | $this->description = ''; |
| 35 | 35 | $this->sections = $this->add_sections(); |
| 36 | 36 | $this->fields = $this->add_fields(); |
| 37 | 37 | |
| 38 | 38 | // Disable the submit button for this page. |
| 39 | - add_filter( 'simcal_admin_page_' . $page . '_' . $tab . '_submit', function() { return false; } ); |
|
| 39 | + add_filter('simcal_admin_page_'.$page.'_'.$tab.'_submit', function() { return false; } ); |
|
| 40 | 40 | |
| 41 | 41 | // Add html. |
| 42 | - add_action( 'simcal_admin_page_' . $page . '_' . $tab . '_end', array( $this, 'html' ) ); |
|
| 42 | + add_action('simcal_admin_page_'.$page.'_'.$tab.'_end', array($this, 'html')); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -51,37 +51,37 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | ?> |
| 53 | 53 | <div id="simcal-system-status-report"> |
| 54 | - <p><?php _e( 'Please copy and paste this information when contacting support:', 'google-calendar-events' ); ?> </p> |
|
| 54 | + <p><?php _e('Please copy and paste this information when contacting support:', 'google-calendar-events'); ?> </p> |
|
| 55 | 55 | <textarea readonly="readonly" onclick="this.select();"></textarea> |
| 56 | - <p><?php _e( 'You can also download your information as a text file to attach, or simply view it below.', 'google-calendar-events' ); ?></p> |
|
| 57 | - <p><a href="#" id="simcal-system-status-report-download" class="button button-primary"><?php _e( 'Download System Report', 'google-calendar-events' ); ?></a></p> |
|
| 56 | + <p><?php _e('You can also download your information as a text file to attach, or simply view it below.', 'google-calendar-events'); ?></p> |
|
| 57 | + <p><a href="#" id="simcal-system-status-report-download" class="button button-primary"><?php _e('Download System Report', 'google-calendar-events'); ?></a></p> |
|
| 58 | 58 | </div> |
| 59 | 59 | <hr> |
| 60 | 60 | <?php |
| 61 | 61 | |
| 62 | 62 | global $wpdb; |
| 63 | - $wp_version = get_bloginfo( 'version' ); |
|
| 63 | + $wp_version = get_bloginfo('version'); |
|
| 64 | 64 | |
| 65 | 65 | $sections = array(); |
| 66 | 66 | $panels = array( |
| 67 | 67 | 'wordpress' => array( |
| 68 | - 'label' => __( 'WordPress Installation', 'google-calendar-events' ), |
|
| 68 | + 'label' => __('WordPress Installation', 'google-calendar-events'), |
|
| 69 | 69 | 'export' => 'WordPress Installation', |
| 70 | 70 | ), |
| 71 | 71 | 'theme' => array( |
| 72 | - 'label' => __( 'Active Theme', 'google-calendar-events' ), |
|
| 72 | + 'label' => __('Active Theme', 'google-calendar-events'), |
|
| 73 | 73 | 'export' => 'Active Theme', |
| 74 | 74 | ), |
| 75 | 75 | 'plugins' => array( |
| 76 | - 'label' => __( 'Active Plugins', 'google-calendar-events' ), |
|
| 76 | + 'label' => __('Active Plugins', 'google-calendar-events'), |
|
| 77 | 77 | 'export' => 'Active Plugins', |
| 78 | 78 | ), |
| 79 | 79 | 'server' => array( |
| 80 | - 'label' => __( 'Server Environment', 'google-calendar-events' ), |
|
| 80 | + 'label' => __('Server Environment', 'google-calendar-events'), |
|
| 81 | 81 | 'export' => 'Server Environment', |
| 82 | 82 | ), |
| 83 | 83 | 'client' => array( |
| 84 | - 'label' => __( 'Client Information', 'google-calendar-events' ), |
|
| 84 | + 'label' => __('Client Information', 'google-calendar-events'), |
|
| 85 | 85 | 'export' => 'Client Information', |
| 86 | 86 | ) |
| 87 | 87 | ); |
@@ -98,68 +98,68 @@ discard block |
||
| 98 | 98 | * ====================== |
| 99 | 99 | */ |
| 100 | 100 | |
| 101 | - $debug_mode = $script_debug = __( 'No', 'google-calendar-events' ); |
|
| 102 | - if ( defined( 'WP_DEBUG' ) ) { |
|
| 103 | - $debug_mode = true === WP_DEBUG ? __( 'Yes', 'google-calendar-events' ) : $debug_mode; |
|
| 101 | + $debug_mode = $script_debug = __('No', 'google-calendar-events'); |
|
| 102 | + if (defined('WP_DEBUG')) { |
|
| 103 | + $debug_mode = true === WP_DEBUG ? __('Yes', 'google-calendar-events') : $debug_mode; |
|
| 104 | 104 | } |
| 105 | - if ( defined( 'SCRIPT_DEBUG' ) ) { |
|
| 106 | - $script_debug = true === SCRIPT_DEBUG ? __( 'Yes', 'google-calendar-events' ) : $script_debug; |
|
| 105 | + if (defined('SCRIPT_DEBUG')) { |
|
| 106 | + $script_debug = true === SCRIPT_DEBUG ? __('Yes', 'google-calendar-events') : $script_debug; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $memory = $this->let_to_num( WP_MEMORY_LIMIT ); |
|
| 110 | - $memory_export = size_format( $memory ); |
|
| 111 | - if ( $memory < 67108864 ) { |
|
| 112 | - $memory = '<mark class="error">' . sprintf( __( '%1$s - It is recomendend to set memory to at least 64MB. See: <a href="%2$s" target="_blank">Increasing memory allocated to PHP</a>', 'google-calendar-events' ), $memory_export, 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) . '</mark>'; |
|
| 109 | + $memory = $this->let_to_num(WP_MEMORY_LIMIT); |
|
| 110 | + $memory_export = size_format($memory); |
|
| 111 | + if ($memory < 67108864) { |
|
| 112 | + $memory = '<mark class="error">'.sprintf(__('%1$s - It is recomendend to set memory to at least 64MB. See: <a href="%2$s" target="_blank">Increasing memory allocated to PHP</a>', 'google-calendar-events'), $memory_export, 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP').'</mark>'; |
|
| 113 | 113 | } else { |
| 114 | - $memory = '<mark class="ok">' . $memory_export . '</mark>'; |
|
| 114 | + $memory = '<mark class="ok">'.$memory_export.'</mark>'; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $permalinks = get_option( 'permalink_structure' ); |
|
| 118 | - $permalinks = empty( $permalinks ) ? '/?' : $permalinks; |
|
| 117 | + $permalinks = get_option('permalink_structure'); |
|
| 118 | + $permalinks = empty($permalinks) ? '/?' : $permalinks; |
|
| 119 | 119 | |
| 120 | 120 | $is_multisite = is_multisite(); |
| 121 | 121 | |
| 122 | 122 | $sections['wordpress'] = array( |
| 123 | 123 | 'name' => array( |
| 124 | - 'label' => __( 'Site Name', 'google-calendar-events' ), |
|
| 124 | + 'label' => __('Site Name', 'google-calendar-events'), |
|
| 125 | 125 | 'label_export' => 'Site Name', |
| 126 | - 'result' => get_bloginfo( 'name' ), |
|
| 126 | + 'result' => get_bloginfo('name'), |
|
| 127 | 127 | ), |
| 128 | 128 | 'home_url' => array( |
| 129 | - 'label' => __( 'Home URL', 'google-calendar-events' ), |
|
| 129 | + 'label' => __('Home URL', 'google-calendar-events'), |
|
| 130 | 130 | 'label_export' => 'Home URL', |
| 131 | 131 | 'result' => home_url(), |
| 132 | 132 | ), |
| 133 | 133 | 'site_url' => array( |
| 134 | - 'label' => __( 'Site URL', 'google-calendar-events' ), |
|
| 134 | + 'label' => __('Site URL', 'google-calendar-events'), |
|
| 135 | 135 | 'label_export' => 'Site URL', |
| 136 | 136 | 'result' => site_url(), |
| 137 | 137 | ), |
| 138 | 138 | 'version' => array( |
| 139 | - 'label' => __( 'Version', 'google-calendar-events' ), |
|
| 139 | + 'label' => __('Version', 'google-calendar-events'), |
|
| 140 | 140 | 'label_export' => 'Version', |
| 141 | 141 | 'result' => $wp_version, |
| 142 | 142 | ), |
| 143 | 143 | 'locale' => array( |
| 144 | - 'label' => __( 'Locale', 'google-calendar-events' ), |
|
| 144 | + 'label' => __('Locale', 'google-calendar-events'), |
|
| 145 | 145 | 'label_export' => 'Locale', |
| 146 | 146 | 'result' => get_locale(), |
| 147 | 147 | ), |
| 148 | 148 | 'wp_timezone' => array( |
| 149 | - 'label' => __( 'Timezone', 'google-calendar-events' ), |
|
| 149 | + 'label' => __('Timezone', 'google-calendar-events'), |
|
| 150 | 150 | 'label_export' => 'Timezone', |
| 151 | 151 | 'result' => simcal_get_wp_timezone(), |
| 152 | 152 | ), |
| 153 | 153 | 'multisite' => array( |
| 154 | - 'label' => __( 'Multisite', 'google-calendar-events' ), |
|
| 154 | + 'label' => __('Multisite', 'google-calendar-events'), |
|
| 155 | 155 | 'label_export' => 'Multisite', |
| 156 | - 'result' => $is_multisite ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ), |
|
| 156 | + 'result' => $is_multisite ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'), |
|
| 157 | 157 | 'result_export' => $is_multisite ? 'Yes' : 'No' |
| 158 | 158 | ), |
| 159 | 159 | 'permalink' => array( |
| 160 | - 'label' => __( 'Permalinks', 'google-calendar-events' ), |
|
| 160 | + 'label' => __('Permalinks', 'google-calendar-events'), |
|
| 161 | 161 | 'label_export' => 'Permalinks', |
| 162 | - 'result' => '<code>' . $permalinks . '</code>', |
|
| 162 | + 'result' => '<code>'.$permalinks.'</code>', |
|
| 163 | 163 | 'result_export' => $permalinks, |
| 164 | 164 | ), |
| 165 | 165 | 'memory_limit' => array( |
@@ -182,86 +182,86 @@ discard block |
||
| 182 | 182 | * ============ |
| 183 | 183 | */ |
| 184 | 184 | |
| 185 | - include_once ABSPATH . 'wp-admin/includes/theme-install.php'; |
|
| 185 | + include_once ABSPATH.'wp-admin/includes/theme-install.php'; |
|
| 186 | 186 | |
| 187 | - if ( version_compare( $wp_version, '3.4', '<' ) ) { |
|
| 188 | - $active_theme = get_theme_data( get_stylesheet_directory() . '/style.css' ); |
|
| 189 | - $theme_name = '<a href="' . $active_theme['URI'] . '" target="_blank">' . $active_theme['Name'] . '</a>'; |
|
| 187 | + if (version_compare($wp_version, '3.4', '<')) { |
|
| 188 | + $active_theme = get_theme_data(get_stylesheet_directory().'/style.css'); |
|
| 189 | + $theme_name = '<a href="'.$active_theme['URI'].'" target="_blank">'.$active_theme['Name'].'</a>'; |
|
| 190 | 190 | $theme_version = $active_theme['Version']; |
| 191 | - $theme_author = '<a href="' . $active_theme['AuthorURI'] . '" target="_blank">' . $active_theme['Author'] . '</a>'; |
|
| 192 | - $theme_export = $active_theme['Name'] . ' - ' . $theme_version; |
|
| 191 | + $theme_author = '<a href="'.$active_theme['AuthorURI'].'" target="_blank">'.$active_theme['Author'].'</a>'; |
|
| 192 | + $theme_export = $active_theme['Name'].' - '.$theme_version; |
|
| 193 | 193 | } else { |
| 194 | 194 | $active_theme = wp_get_theme(); |
| 195 | - $theme_name = '<a href="' . $active_theme->ThemeURI . '" target="_blank">' . $active_theme->Name . '</a>'; |
|
| 195 | + $theme_name = '<a href="'.$active_theme->ThemeURI.'" target="_blank">'.$active_theme->Name.'</a>'; |
|
| 196 | 196 | $theme_version = $active_theme->Version; |
| 197 | 197 | $theme_author = $active_theme->Author; |
| 198 | - $theme_export = $active_theme->Name . ' - ' . $theme_version; |
|
| 198 | + $theme_export = $active_theme->Name.' - '.$theme_version; |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | $theme_update_version = $theme_version; |
| 202 | 202 | |
| 203 | - $api = themes_api( 'theme_information', array( |
|
| 203 | + $api = themes_api('theme_information', array( |
|
| 204 | 204 | 'slug' => get_template(), |
| 205 | - 'fields' => array( 'sections' => false, 'tags' => false ), |
|
| 206 | - ) ); |
|
| 207 | - if ( $api && ! is_wp_error( $api ) ) { |
|
| 205 | + 'fields' => array('sections' => false, 'tags' => false), |
|
| 206 | + )); |
|
| 207 | + if ($api && ! is_wp_error($api)) { |
|
| 208 | 208 | $theme_update_version = $api->version; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | - if ( version_compare( $theme_version, $theme_update_version, '<' ) ) { |
|
| 212 | - $theme_version = '<mark class="error">' . $theme_version . ' (' . sprintf( __( '%s is available', 'google-calendar-events' ), esc_html( $theme_update_version ) ) . ')</mark>'; |
|
| 211 | + if (version_compare($theme_version, $theme_update_version, '<')) { |
|
| 212 | + $theme_version = '<mark class="error">'.$theme_version.' ('.sprintf(__('%s is available', 'google-calendar-events'), esc_html($theme_update_version)).')</mark>'; |
|
| 213 | 213 | } else { |
| 214 | - $theme_version = '<mark class="ok">' . $theme_version . '</mark>'; |
|
| 214 | + $theme_version = '<mark class="ok">'.$theme_version.'</mark>'; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | $theme = '<dl>'; |
| 218 | - $theme .= '<dt>' . __( 'Name', 'google-calendar-events' ) . '</dt>'; |
|
| 219 | - $theme .= '<dd>' . $theme_name . '</dd>'; |
|
| 220 | - $theme .= '<dt>' . __( 'Author', 'google-calendar-events' ) . '</dt>'; |
|
| 221 | - $theme .= '<dd>' . $theme_author . '</dd>'; |
|
| 222 | - $theme .= '<dt>' . __( 'Version', 'google-calendar-events' ) . '</dt>'; |
|
| 223 | - $theme .= '<dd>' . $theme_version . '</dd>'; |
|
| 218 | + $theme .= '<dt>'.__('Name', 'google-calendar-events').'</dt>'; |
|
| 219 | + $theme .= '<dd>'.$theme_name.'</dd>'; |
|
| 220 | + $theme .= '<dt>'.__('Author', 'google-calendar-events').'</dt>'; |
|
| 221 | + $theme .= '<dd>'.$theme_author.'</dd>'; |
|
| 222 | + $theme .= '<dt>'.__('Version', 'google-calendar-events').'</dt>'; |
|
| 223 | + $theme .= '<dd>'.$theme_version.'</dd>'; |
|
| 224 | 224 | $theme .= '</dl>'; |
| 225 | 225 | |
| 226 | 226 | $is_child_theme = is_child_theme(); |
| 227 | 227 | $parent_theme = $parent_theme_export = '-'; |
| 228 | 228 | |
| 229 | - if ( $is_child_theme ) { |
|
| 230 | - if ( version_compare( $wp_version, '3.4', '<' ) ) { |
|
| 229 | + if ($is_child_theme) { |
|
| 230 | + if (version_compare($wp_version, '3.4', '<')) { |
|
| 231 | 231 | |
| 232 | 232 | $parent_theme = $parent_theme_export = $active_theme['Template']; |
| 233 | 233 | |
| 234 | 234 | } else { |
| 235 | 235 | |
| 236 | - $parent = wp_get_theme( $active_theme->Template ); |
|
| 236 | + $parent = wp_get_theme($active_theme->Template); |
|
| 237 | 237 | $parent_theme = '<dl>'; |
| 238 | - $parent_theme .= '<dt>' . __( 'Name', 'google-calendar-events' ) . '</dt>'; |
|
| 239 | - $parent_theme .= '<dd>' . $parent->Name . '</dd>'; |
|
| 240 | - $parent_theme .= '<dt>' . __( 'Author', 'google-calendar-events' ) . '</dt>'; |
|
| 241 | - $parent_theme .= '<dd>' . $parent->Author . '</dd>'; |
|
| 242 | - $parent_theme .= '<dt>' . __( 'Version', 'google-calendar-events' ) . '</dt>'; |
|
| 243 | - $parent_theme .= '<dd>' . $parent->Version . '</dd>'; |
|
| 238 | + $parent_theme .= '<dt>'.__('Name', 'google-calendar-events').'</dt>'; |
|
| 239 | + $parent_theme .= '<dd>'.$parent->Name.'</dd>'; |
|
| 240 | + $parent_theme .= '<dt>'.__('Author', 'google-calendar-events').'</dt>'; |
|
| 241 | + $parent_theme .= '<dd>'.$parent->Author.'</dd>'; |
|
| 242 | + $parent_theme .= '<dt>'.__('Version', 'google-calendar-events').'</dt>'; |
|
| 243 | + $parent_theme .= '<dd>'.$parent->Version.'</dd>'; |
|
| 244 | 244 | $parent_theme .= '</dl>'; |
| 245 | 245 | |
| 246 | - $parent_theme_export = strip_tags( $parent->Name ) . ' - ' . $parent->Version; |
|
| 246 | + $parent_theme_export = strip_tags($parent->Name).' - '.$parent->Version; |
|
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | $sections['theme'] = array( |
| 251 | 251 | 'theme' => array( |
| 252 | - 'label' => __( 'Theme Information', 'google-calendar-events' ), |
|
| 252 | + 'label' => __('Theme Information', 'google-calendar-events'), |
|
| 253 | 253 | 'label_export' => 'Theme', |
| 254 | 254 | 'result' => $theme, |
| 255 | 255 | 'result_export' => $theme_export, |
| 256 | 256 | ), |
| 257 | 257 | 'theme_child' => array( |
| 258 | - 'label' => __( 'Child Theme', 'google-calendar-events' ), |
|
| 258 | + 'label' => __('Child Theme', 'google-calendar-events'), |
|
| 259 | 259 | 'label_export' => 'Child Theme', |
| 260 | - 'result' => $is_child_theme ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ), |
|
| 260 | + 'result' => $is_child_theme ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'), |
|
| 261 | 261 | 'result_export' => $is_child_theme ? 'Yes' : 'No', |
| 262 | 262 | ), |
| 263 | 263 | 'theme_parent' => array( |
| 264 | - 'label' => __( 'Parent Theme', 'google-calendar-events' ), |
|
| 264 | + 'label' => __('Parent Theme', 'google-calendar-events'), |
|
| 265 | 265 | 'label_export' => 'Parent Theme', |
| 266 | 266 | 'result' => $parent_theme, |
| 267 | 267 | 'result_export' => $parent_theme_export, |
@@ -273,61 +273,61 @@ discard block |
||
| 273 | 273 | * ============== |
| 274 | 274 | */ |
| 275 | 275 | |
| 276 | - include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; |
|
| 276 | + include_once ABSPATH.'wp-admin/includes/plugin-install.php'; |
|
| 277 | 277 | |
| 278 | - $active_plugins = (array) get_option( 'active_plugins', array() ); |
|
| 279 | - if ( is_multisite() ) { |
|
| 280 | - $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) ); |
|
| 278 | + $active_plugins = (array) get_option('active_plugins', array()); |
|
| 279 | + if (is_multisite()) { |
|
| 280 | + $active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array())); |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - foreach ( $active_plugins as $plugin ) { |
|
| 283 | + foreach ($active_plugins as $plugin) { |
|
| 284 | 284 | |
| 285 | - $plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); |
|
| 285 | + $plugin_data = @get_plugin_data(WP_PLUGIN_DIR.'/'.$plugin); |
|
| 286 | 286 | |
| 287 | - if ( ! empty( $plugin_data['Name'] ) ) { |
|
| 287 | + if ( ! empty($plugin_data['Name'])) { |
|
| 288 | 288 | |
| 289 | 289 | $plugin_name = $plugin_data['Title']; |
| 290 | 290 | $plugin_author = $plugin_data['Author']; |
| 291 | 291 | $plugin_version = $plugin_update_version = $plugin_data['Version']; |
| 292 | 292 | |
| 293 | 293 | // Afraid that querying many plugins may risk a timeout. |
| 294 | - if ( count( $active_plugins ) <= 10 ) { |
|
| 295 | - $api = plugins_api( 'plugin_information', array( |
|
| 294 | + if (count($active_plugins) <= 10) { |
|
| 295 | + $api = plugins_api('plugin_information', array( |
|
| 296 | 296 | 'slug' => $plugin_data['Name'], |
| 297 | 297 | 'fields' => array( |
| 298 | 298 | 'version' => true, |
| 299 | 299 | ), |
| 300 | - ) ); |
|
| 301 | - if ( $api && ! is_wp_error( $api ) ) { |
|
| 302 | - if ( ! empty( $api->version ) ) { |
|
| 300 | + )); |
|
| 301 | + if ($api && ! is_wp_error($api)) { |
|
| 302 | + if ( ! empty($api->version)) { |
|
| 303 | 303 | $plugin_update_version = $api->version; |
| 304 | - if ( version_compare( $plugin_version, $plugin_update_version, '<' ) ) { |
|
| 305 | - $plugin_version = '<mark class="error">' . $plugin_version . ' (' . sprintf( __( '%s is available', 'google-calendar-events' ), esc_html( $plugin_update_version ) ) . ')</mark>'; |
|
| 304 | + if (version_compare($plugin_version, $plugin_update_version, '<')) { |
|
| 305 | + $plugin_version = '<mark class="error">'.$plugin_version.' ('.sprintf(__('%s is available', 'google-calendar-events'), esc_html($plugin_update_version)).')</mark>'; |
|
| 306 | 306 | } else { |
| 307 | - $plugin_version = '<mark class="ok">' . $plugin_version . '</mark>'; |
|
| 307 | + $plugin_version = '<mark class="ok">'.$plugin_version.'</mark>'; |
|
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | $plugin = '<dl>'; |
| 314 | - $plugin .= '<dt>' . __( 'Author', 'google-calendar-events' ) . '</dt>'; |
|
| 315 | - $plugin .= '<dd>' . $plugin_author . '</dd>'; |
|
| 316 | - $plugin .= '<dt>' . __( 'Version', 'google-calendar-events' ) . '</dt>'; |
|
| 317 | - $plugin .= '<dd>' . $plugin_version . '</dd>'; |
|
| 314 | + $plugin .= '<dt>'.__('Author', 'google-calendar-events').'</dt>'; |
|
| 315 | + $plugin .= '<dd>'.$plugin_author.'</dd>'; |
|
| 316 | + $plugin .= '<dt>'.__('Version', 'google-calendar-events').'</dt>'; |
|
| 317 | + $plugin .= '<dd>'.$plugin_version.'</dd>'; |
|
| 318 | 318 | $plugin .= '</dl>'; |
| 319 | 319 | |
| 320 | - $sections['plugins'][ sanitize_key( strip_tags( $plugin_name ) ) ] = array( |
|
| 320 | + $sections['plugins'][sanitize_key(strip_tags($plugin_name))] = array( |
|
| 321 | 321 | 'label' => $plugin_name, |
| 322 | - 'label_export' => strip_tags( $plugin_data['Title'] ), |
|
| 322 | + 'label_export' => strip_tags($plugin_data['Title']), |
|
| 323 | 323 | 'result' => $plugin, |
| 324 | 324 | 'result_export' => $plugin_data['Version'], |
| 325 | 325 | ); |
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - if ( isset( $sections['plugins'] ) ) { |
|
| 330 | - rsort( $sections['plugins'] ); |
|
| 329 | + if (isset($sections['plugins'])) { |
|
| 330 | + rsort($sections['plugins']); |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | /** |
@@ -335,54 +335,54 @@ discard block |
||
| 335 | 335 | * ================== |
| 336 | 336 | */ |
| 337 | 337 | |
| 338 | - if ( version_compare( PHP_VERSION, '7.0', '<' ) ) { |
|
| 339 | - $php = '<mark>' . PHP_VERSION . ' - ' . |
|
| 340 | - __( 'WordPress.org recommends upgrading to PHP 7 or higher for better security.', 'google-calendar-events' ) . |
|
| 341 | - ' <a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'Read more.', 'google-calendar-events' ) . '</a>' . |
|
| 338 | + if (version_compare(PHP_VERSION, '7.0', '<')) { |
|
| 339 | + $php = '<mark>'.PHP_VERSION.' - '. |
|
| 340 | + __('WordPress.org recommends upgrading to PHP 7 or higher for better security.', 'google-calendar-events'). |
|
| 341 | + ' <a href="https://wordpress.org/about/requirements/" target="_blank">'.__('Read more.', 'google-calendar-events').'</a>'. |
|
| 342 | 342 | '</mark>'; |
| 343 | 343 | } else { |
| 344 | - $php = '<mark class="ok">' . PHP_VERSION . '</mark>'; |
|
| 344 | + $php = '<mark class="ok">'.PHP_VERSION.'</mark>'; |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - if ( $wpdb->use_mysqli ) { |
|
| 348 | - $mysql = @mysqli_get_server_info( $wpdb->dbh ); |
|
| 347 | + if ($wpdb->use_mysqli) { |
|
| 348 | + $mysql = @mysqli_get_server_info($wpdb->dbh); |
|
| 349 | 349 | } else { |
| 350 | - $mysql = '<mark class="error">' . __( 'Cannot connect to MySQL database.', 'google-calendar-events' ) . '</mark>'; |
|
| 350 | + $mysql = '<mark class="error">'.__('Cannot connect to MySQL database.', 'google-calendar-events').'</mark>'; |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | $host = $_SERVER['SERVER_SOFTWARE']; |
| 354 | - if ( defined( 'WPE_APIKEY' ) ) { |
|
| 354 | + if (defined('WPE_APIKEY')) { |
|
| 355 | 355 | $host .= ' (WP Engine)'; |
| 356 | - } elseif ( defined( 'PAGELYBIN' ) ) { |
|
| 356 | + } elseif (defined('PAGELYBIN')) { |
|
| 357 | 357 | $host .= ' (Pagely)'; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | $default_timezone = $server_timezone_export = date_default_timezone_get(); |
| 361 | - if ( 'UTC' !== $default_timezone ) { |
|
| 362 | - $server_timezone = '<mark class="error">' . sprintf( __( 'Server default timezone is %s - it should be UTC', 'google-calendar-events' ), $default_timezone ) . '</mark>'; |
|
| 361 | + if ('UTC' !== $default_timezone) { |
|
| 362 | + $server_timezone = '<mark class="error">'.sprintf(__('Server default timezone is %s - it should be UTC', 'google-calendar-events'), $default_timezone).'</mark>'; |
|
| 363 | 363 | } else { |
| 364 | 364 | $server_timezone = '<mark class="ok">UTC</mark>'; |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | // WP Remote POST test. |
| 368 | - $response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array( |
|
| 368 | + $response = wp_safe_remote_post('https://www.paypal.com/cgi-bin/webscr', array( |
|
| 369 | 369 | 'timeout' => 60, |
| 370 | 370 | 'body' => array( |
| 371 | 371 | 'cmd' => '_notify-validate', |
| 372 | 372 | ), |
| 373 | - ) ); |
|
| 374 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 373 | + )); |
|
| 374 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
| 375 | 375 | $wp_post_export = 'Yes'; |
| 376 | - $wp_post = '<mark class="ok">' . __( 'Yes', 'google-calendar-events' ) . '</mark>'; |
|
| 376 | + $wp_post = '<mark class="ok">'.__('Yes', 'google-calendar-events').'</mark>'; |
|
| 377 | 377 | } else { |
| 378 | 378 | $wp_post_export = 'No'; |
| 379 | - $wp_post = '<mark class="error">' . __( 'No', 'google-calendar-events' ); |
|
| 380 | - if ( is_wp_error( $response ) ) { |
|
| 381 | - $error = ' (' . $response->get_error_message() . ')'; |
|
| 379 | + $wp_post = '<mark class="error">'.__('No', 'google-calendar-events'); |
|
| 380 | + if (is_wp_error($response)) { |
|
| 381 | + $error = ' ('.$response->get_error_message().')'; |
|
| 382 | 382 | $wp_post .= $error; |
| 383 | 383 | $wp_post_export .= $error; |
| 384 | 384 | } else { |
| 385 | - $error = ' (' . $response['response']['code'] . ')'; |
|
| 385 | + $error = ' ('.$response['response']['code'].')'; |
|
| 386 | 386 | $wp_post .= $error; |
| 387 | 387 | $wp_post_export .= $error; |
| 388 | 388 | } |
@@ -390,65 +390,65 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | // WP Remote GET test. |
| 393 | - $response = wp_safe_remote_get( get_home_url( '/?p=1' ) ); |
|
| 394 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 393 | + $response = wp_safe_remote_get(get_home_url('/?p=1')); |
|
| 394 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
| 395 | 395 | $wp_get_export = 'Yes'; |
| 396 | - $wp_get = '<mark class="ok">' . __( 'Yes', 'google-calendar-events' ) . '</mark>'; |
|
| 396 | + $wp_get = '<mark class="ok">'.__('Yes', 'google-calendar-events').'</mark>'; |
|
| 397 | 397 | } else { |
| 398 | 398 | $wp_get_export = 'No'; |
| 399 | - $wp_get = '<mark class="error">' . __( 'No', 'google-calendar-events' ); |
|
| 400 | - if ( is_wp_error( $response ) ) { |
|
| 401 | - $error = ' (' . $response->get_error_message() . ')'; |
|
| 399 | + $wp_get = '<mark class="error">'.__('No', 'google-calendar-events'); |
|
| 400 | + if (is_wp_error($response)) { |
|
| 401 | + $error = ' ('.$response->get_error_message().')'; |
|
| 402 | 402 | $wp_get .= $error; |
| 403 | 403 | $wp_get_export .= $error; |
| 404 | 404 | } else { |
| 405 | - $error = ' (' . $response['response']['code'] . ')'; |
|
| 405 | + $error = ' ('.$response['response']['code'].')'; |
|
| 406 | 406 | $wp_get .= $error; |
| 407 | 407 | $wp_get_export .= $error; |
| 408 | 408 | } |
| 409 | 409 | $wp_get .= '</mark>'; |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | - $php_memory_limit = ini_get( 'memory_limit' ); |
|
| 413 | - $php_max_upload_filesize = ini_get( 'upload_max_filesize' ); |
|
| 414 | - $php_post_max_size = ini_get( 'post_max_size' ); |
|
| 415 | - $php_max_execution_time = ini_get( 'max_execution_time' ); |
|
| 416 | - $php_max_input_vars = ini_get( 'max_input_vars' ); |
|
| 412 | + $php_memory_limit = ini_get('memory_limit'); |
|
| 413 | + $php_max_upload_filesize = ini_get('upload_max_filesize'); |
|
| 414 | + $php_post_max_size = ini_get('post_max_size'); |
|
| 415 | + $php_max_execution_time = ini_get('max_execution_time'); |
|
| 416 | + $php_max_input_vars = ini_get('max_input_vars'); |
|
| 417 | 417 | |
| 418 | 418 | $curl_info = ''; |
| 419 | 419 | |
| 420 | - if ( function_exists( 'curl_version' ) ) { |
|
| 420 | + if (function_exists('curl_version')) { |
|
| 421 | 421 | $curl_info = curl_version(); |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | $sections['server'] = array( |
| 425 | 425 | 'host' => array( |
| 426 | - 'label' => __( 'Web Server', 'google-calendar-events' ), |
|
| 426 | + 'label' => __('Web Server', 'google-calendar-events'), |
|
| 427 | 427 | 'label_export' => 'Web Server', |
| 428 | 428 | 'result' => $host, |
| 429 | 429 | ), |
| 430 | 430 | 'php_version' => array( |
| 431 | - 'label' => __( 'PHP Version', 'google-calendar-events' ), |
|
| 431 | + 'label' => __('PHP Version', 'google-calendar-events'), |
|
| 432 | 432 | 'label_export' => 'PHP Version', |
| 433 | 433 | 'result' => $php, |
| 434 | 434 | 'result_export' => PHP_VERSION, |
| 435 | 435 | ), |
| 436 | 436 | 'mysql_version' => array( |
| 437 | - 'label' => __( 'MySQL Version', 'google-calendar-events' ), |
|
| 437 | + 'label' => __('MySQL Version', 'google-calendar-events'), |
|
| 438 | 438 | 'label_export' => 'MySQL Version', |
| 439 | - 'result' => version_compare( $mysql, '5.5', '>' ) ? '<mark class="ok">' . $mysql . '</mark>' : $mysql, |
|
| 439 | + 'result' => version_compare($mysql, '5.5', '>') ? '<mark class="ok">'.$mysql.'</mark>' : $mysql, |
|
| 440 | 440 | 'result_export' => $mysql, |
| 441 | 441 | ), |
| 442 | 442 | 'server_timezone' => array( |
| 443 | - 'label' => __( 'Server Timezone', 'google-calendar-events' ), |
|
| 443 | + 'label' => __('Server Timezone', 'google-calendar-events'), |
|
| 444 | 444 | 'label_export' => 'Server Timezone', |
| 445 | 445 | 'result' => $server_timezone, |
| 446 | 446 | 'result_export' => $server_timezone_export, |
| 447 | 447 | ), |
| 448 | 448 | 'display_errors' => array( |
| 449 | 449 | 'label' => 'Display Errors', |
| 450 | - 'result' => ( ini_get( 'display_errors' ) ) ? __( 'Yes', 'google-calendar-events' ) . ' (' . ini_get( 'display_errors' ) . ')' : '-', |
|
| 451 | - 'result_export' => ( ini_get( 'display_errors' ) ) ? 'Yes' : 'No', |
|
| 450 | + 'result' => (ini_get('display_errors')) ? __('Yes', 'google-calendar-events').' ('.ini_get('display_errors').')' : '-', |
|
| 451 | + 'result_export' => (ini_get('display_errors')) ? 'Yes' : 'No', |
|
| 452 | 452 | ), |
| 453 | 453 | 'php_memory_limit' => array( |
| 454 | 454 | 'label' => 'Memory Limit', |
@@ -472,23 +472,23 @@ discard block |
||
| 472 | 472 | ), |
| 473 | 473 | 'fsockopen' => array( |
| 474 | 474 | 'label' => 'fsockopen', |
| 475 | - 'result' => function_exists( 'fsockopen' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ), |
|
| 476 | - 'result_export' => function_exists( 'fsockopen' ) ? 'Yes' : 'No', |
|
| 475 | + 'result' => function_exists('fsockopen') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'), |
|
| 476 | + 'result_export' => function_exists('fsockopen') ? 'Yes' : 'No', |
|
| 477 | 477 | ), |
| 478 | 478 | 'curl_init' => array( |
| 479 | 479 | 'label' => 'cURL', |
| 480 | - 'result' => ! empty( $curl_info ) ? $curl_info['version'] . ', ' . $curl_info['ssl_version'] : __( 'No version found.', 'google-calendar-events' ), |
|
| 481 | - 'result_export' => ! empty( $curl_info ) ? $curl_info['version'] . ', ' . $curl_info['ssl_version'] : 'No version found.', |
|
| 480 | + 'result' => ! empty($curl_info) ? $curl_info['version'].', '.$curl_info['ssl_version'] : __('No version found.', 'google-calendar-events'), |
|
| 481 | + 'result_export' => ! empty($curl_info) ? $curl_info['version'].', '.$curl_info['ssl_version'] : 'No version found.', |
|
| 482 | 482 | ), |
| 483 | 483 | 'soap' => array( |
| 484 | 484 | 'label' => 'SOAP', |
| 485 | - 'result' => class_exists( 'SoapClient' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ), |
|
| 486 | - 'result_export' => class_exists( 'SoapClient' ) ? 'Yes' : 'No', |
|
| 485 | + 'result' => class_exists('SoapClient') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'), |
|
| 486 | + 'result_export' => class_exists('SoapClient') ? 'Yes' : 'No', |
|
| 487 | 487 | ), |
| 488 | 488 | 'suhosin' => array( |
| 489 | 489 | 'label' => 'SUHOSIN', |
| 490 | - 'result' => extension_loaded( 'suhosin' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ), |
|
| 491 | - 'result_export' => extension_loaded( 'suhosin' ) ? 'Yes' : 'No', |
|
| 490 | + 'result' => extension_loaded('suhosin') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'), |
|
| 491 | + 'result_export' => extension_loaded('suhosin') ? 'Yes' : 'No', |
|
| 492 | 492 | ), |
| 493 | 493 | 'wp_remote_post' => array( |
| 494 | 494 | 'label' => 'WP Remote POST', |
@@ -510,26 +510,26 @@ discard block |
||
| 510 | 510 | $user_client = new \SimpleCalendar\Browser(); |
| 511 | 511 | |
| 512 | 512 | $browser = '<dl>'; |
| 513 | - $browser .= '<dt>' . __( 'Name:', 'google-calendar-events' ) . '</dt>'; |
|
| 514 | - $browser .= '<dd>' . $user_client->getBrowser() . '</dd>'; |
|
| 515 | - $browser .= '<dt>' . __( 'Version:', 'google-calendar-events' ) . '</dt>'; |
|
| 516 | - $browser .= '<dd>' . $user_client->getVersion() . '</dd>'; |
|
| 517 | - $browser .= '<dt>' . __( 'User Agent:', 'google-calendar-events' ) . '</dt>'; |
|
| 518 | - $browser .= '<dd>' . $user_client->getUserAgent() . '</dd>'; |
|
| 519 | - $browser .= '<dt>' . __( 'Platform:', 'google-calendar-events' ) . '</dt>'; |
|
| 520 | - $browser .= '<dd>' . $user_client->getPlatform() . '</dd>'; |
|
| 513 | + $browser .= '<dt>'.__('Name:', 'google-calendar-events').'</dt>'; |
|
| 514 | + $browser .= '<dd>'.$user_client->getBrowser().'</dd>'; |
|
| 515 | + $browser .= '<dt>'.__('Version:', 'google-calendar-events').'</dt>'; |
|
| 516 | + $browser .= '<dd>'.$user_client->getVersion().'</dd>'; |
|
| 517 | + $browser .= '<dt>'.__('User Agent:', 'google-calendar-events').'</dt>'; |
|
| 518 | + $browser .= '<dd>'.$user_client->getUserAgent().'</dd>'; |
|
| 519 | + $browser .= '<dt>'.__('Platform:', 'google-calendar-events').'</dt>'; |
|
| 520 | + $browser .= '<dd>'.$user_client->getPlatform().'</dd>'; |
|
| 521 | 521 | $browser .= '</dl>'; |
| 522 | 522 | |
| 523 | - $browser_export = $user_client->getBrowser() . ' ' . $user_client->getVersion() . ' (' . $user_client->getPlatform() . ')'; |
|
| 523 | + $browser_export = $user_client->getBrowser().' '.$user_client->getVersion().' ('.$user_client->getPlatform().')'; |
|
| 524 | 524 | |
| 525 | 525 | $sections['client'] = array( |
| 526 | 526 | 'user_ip' => array( |
| 527 | - 'label' => __( 'IP Address', 'google-calendar-events' ), |
|
| 527 | + 'label' => __('IP Address', 'google-calendar-events'), |
|
| 528 | 528 | 'label_export' => 'IP Address', |
| 529 | 529 | 'result' => $_SERVER['SERVER_ADDR'], |
| 530 | 530 | ), |
| 531 | 531 | 'browser' => array( |
| 532 | - 'label' => __( 'Browser', 'google-calendar-events' ), |
|
| 532 | + 'label' => __('Browser', 'google-calendar-events'), |
|
| 533 | 533 | 'result' => $browser, |
| 534 | 534 | 'result_export' => $browser_export, |
| 535 | 535 | ) |
@@ -540,12 +540,12 @@ discard block |
||
| 540 | 540 | * ============ |
| 541 | 541 | */ |
| 542 | 542 | |
| 543 | - $panels = apply_filters( 'simcal_system_status_report_panels', $panels ); |
|
| 544 | - $sections = apply_filters( 'simcal_system_status_report_sections', $sections ); |
|
| 543 | + $panels = apply_filters('simcal_system_status_report_panels', $panels); |
|
| 544 | + $sections = apply_filters('simcal_system_status_report_sections', $sections); |
|
| 545 | 545 | |
| 546 | - foreach ( $panels as $panel => $v ) : |
|
| 546 | + foreach ($panels as $panel => $v) : |
|
| 547 | 547 | |
| 548 | - if ( isset( $sections[ $panel ] ) ) : |
|
| 548 | + if (isset($sections[$panel])) : |
|
| 549 | 549 | |
| 550 | 550 | ?> |
| 551 | 551 | <table class="widefat simcal-system-status-report-panel"> |
@@ -555,15 +555,15 @@ discard block |
||
| 555 | 555 | </tr> |
| 556 | 556 | </thead> |
| 557 | 557 | <tbody> |
| 558 | - <?php foreach ( $sections[ $panel ] as $row => $cell ) : ?> |
|
| 558 | + <?php foreach ($sections[$panel] as $row => $cell) : ?> |
|
| 559 | 559 | <tr> |
| 560 | 560 | <?php |
| 561 | - $label_export = isset( $cell['label_export'] ) ? $cell['label_export'] : $cell['label']; |
|
| 562 | - $result_export = isset( $cell['result_export'] ) ? $cell['result_export'] : $cell['result']; |
|
| 561 | + $label_export = isset($cell['label_export']) ? $cell['label_export'] : $cell['label']; |
|
| 562 | + $result_export = isset($cell['result_export']) ? $cell['result_export'] : $cell['result']; |
|
| 563 | 563 | ?> |
| 564 | - <td class="tooltip"><?php echo isset( $cell['tooltip'] ) ? ' <i class="simcal-icon-help simcal-help-tip" data-tip="' . $cell['tooltip'] . '"></i> ' : ''; ?></td> |
|
| 565 | - <td class="label" data-export="<?php echo trim( $label_export ); ?>"><?php echo $cell['label']; ?></td> |
|
| 566 | - <td class="result" data-export="<?php echo trim( $result_export ); ?>"><?php echo $cell['result']; ?></td> |
|
| 564 | + <td class="tooltip"><?php echo isset($cell['tooltip']) ? ' <i class="simcal-icon-help simcal-help-tip" data-tip="'.$cell['tooltip'].'"></i> ' : ''; ?></td> |
|
| 565 | + <td class="label" data-export="<?php echo trim($label_export); ?>"><?php echo $cell['label']; ?></td> |
|
| 566 | + <td class="result" data-export="<?php echo trim($result_export); ?>"><?php echo $cell['result']; ?></td> |
|
| 567 | 567 | </tr> |
| 568 | 568 | <?php endforeach; ?> |
| 569 | 569 | </tbody> |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | jQuery( '#simcal-system-status-report-download' ).on( 'click', function() { |
| 642 | 642 | var file = new Blob( [ report ], { type: 'text/plain' } ); |
| 643 | 643 | jQuery( this ).attr( 'href', URL.createObjectURL( file ) ); |
| 644 | - jQuery( this ).attr( 'download', '<?php echo sanitize_title( str_replace( array( 'http://', 'https://' ), '', get_bloginfo( 'url' ) ) . '-system-report-' . date( 'Y-m-d', time() ) ); ?>' ); |
|
| 644 | + jQuery( this ).attr( 'download', '<?php echo sanitize_title(str_replace(array('http://', 'https://'), '', get_bloginfo('url')).'-system-report-'.date('Y-m-d', time())); ?>' ); |
|
| 645 | 645 | } ); |
| 646 | 646 | |
| 647 | 647 | </script> |
@@ -661,13 +661,13 @@ discard block |
||
| 661 | 661 | * |
| 662 | 662 | * @return int|double|string |
| 663 | 663 | */ |
| 664 | - private function let_to_num( $size ) { |
|
| 664 | + private function let_to_num($size) { |
|
| 665 | 665 | |
| 666 | - $l = substr( $size, -1 ); |
|
| 667 | - $ret = substr( $size, 0, -1 ); |
|
| 666 | + $l = substr($size, -1); |
|
| 667 | + $ret = substr($size, 0, -1); |
|
| 668 | 668 | |
| 669 | 669 | // Note: do not insert break or default in this switch loop. |
| 670 | - switch ( strtoupper( $l ) ) { |
|
| 670 | + switch (strtoupper($l)) { |
|
| 671 | 671 | case 'P': |
| 672 | 672 | $ret *= 1024; |
| 673 | 673 | // no break |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | $ret *= 1024; |
| 682 | 682 | // no break |
| 683 | 683 | case 'K': |
| 684 | - $ret *= 1024;; |
|
| 684 | + $ret *= 1024; ; |
|
| 685 | 685 | // no break |
| 686 | 686 | } |
| 687 | 687 | |