← All changes
|
Inc/Modules/ServerInformation/ServerInfo_WP_Details.php
+46
-17
4.3.2
→
4.0.5.4
View file →
| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -namespace PXLBSAdminify\Inc\Modules\ServerInformation; | |
| 3 | +namespace WPAdminify\Inc\Modules\ServerInformation; | |
| 4 | 4 | |
| 5 | -use PXLBSAdminify\Inc\Classes\ServerInfo; | |
| 6 | -use PXLBSAdminify\Inc\Utils; | |
| 5 | +use WPAdminify\Inc\Classes\ServerInfo; | |
| 6 | +use WPAdminify\Inc\Utils; | |
| 7 | 7 | |
| 8 | 8 | // no direct access allowed |
| 9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | 10 | exit; |
| @@ -10,9 +10,9 @@ | ||
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | - * PXLBSAdminify | |
| 14 | + * WPAdminify | |
| 15 | 15 | * |
| 16 | 16 | * @package Server Information |
| 17 | 17 | * |
| 18 | 18 | * @author WP Adminify <support@wpadminify.com> |
| @@ -38,9 +38,9 @@ | ||
| 38 | 38 | $sec_key = '<span class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Please enter this security key in the wp-confiq.php file', 'adminify' ) . '!</span>'; |
| 39 | 39 | ?> |
| 40 | 40 | |
| 41 | 41 | <div class="wrap"> |
| 42 | - <h1><?php echo wp_kses_post( Utils::admin_page_title( esc_html__( 'Site Information', 'adminify' ) ) ); ?></h1> | |
| 42 | + <h1><?php echo Utils::admin_page_title( esc_html__( 'Site Information', 'adminify' ) ); ?></h1> | |
| 43 | 43 | </div> |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | <p><?php echo wp_kses_post( 'First, you can see the most important information about your WordPress installation at a glance. Learn more about the <a href="https://wordpress.org/about/requirements/" target="_blank" rel="noopener">requirements</a>' ); ?>.</p> |
| @@ -60,14 +60,14 @@ | ||
| 60 | 60 | </tr> |
| 61 | 61 | |
| 62 | 62 | <tr> |
| 63 | 63 | <td><?php esc_html_e( 'PHP Version', 'adminify' ); ?>:</td> |
| 64 | - <td><?php echo wp_kses_post( Utils::kses_custom( $server_info->get_php_version() ) ); ?></td> | |
| 64 | + <td><?php echo Utils::wp_kses_custom( $server_info->get_php_version() ); ?></td> | |
| 65 | 65 | </tr> |
| 66 | 66 | |
| 67 | 67 | <tr> |
| 68 | 68 | <td><?php esc_html_e( 'MySQL Version', 'adminify' ); ?>:</td> |
| 69 | - <td><?php echo wp_kses_post( Utils::kses_custom( $server_info->get_mysql_version() ) ); ?></td> | |
| 69 | + <td><?php echo Utils::wp_kses_custom( $server_info->get_mysql_version() ); ?></td> | |
| 70 | 70 | </tr> |
| 71 | 71 | |
| 72 | 72 | <tr> |
| 73 | 73 | <td><?php esc_html_e( 'PHP Memory WP-Limit', 'adminify' ); ?>:</td> |
| @@ -118,17 +118,17 @@ | ||
| 118 | 118 | <td><?php esc_html_e( 'PHP Memory WP-Usage', 'adminify' ); ?>:</td> |
| 119 | 119 | <td> |
| 120 | 120 | <?php |
| 121 | 121 | if ( $server_info->get_wp_memory_usage()['MemLimitGet'] == '-1' ) { |
| 122 | - echo wp_kses_post( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemUsageFormat'] ) ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . esc_html__( 'Unlimited', 'adminify' ) . ' (-1)'; | |
| 122 | + echo Utils::wp_kses_custom( $server_info->get_wp_memory_usage()['MemUsageFormat'] ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . esc_html__( 'Unlimited', 'adminify' ) . ' (-1)'; | |
| 123 | 123 | } else { |
| 124 | - echo wp_kses_post( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemUsageFormat'] ) ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . wp_kses_post( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemLimitFormat'] ) ); | |
| 124 | + echo Utils::wp_kses_custom( $server_info->get_wp_memory_usage()['MemUsageFormat'] ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . Utils::wp_kses_custom( $server_info->get_wp_memory_usage()['MemLimitFormat'] ); | |
| 125 | 125 | ?> |
| 126 | 126 | |
| 127 | 127 | <div class="adminify-system-progress"> |
| 128 | 128 | <div class="status-progressbar"> |
| 129 | - <span><?php echo wp_kses_post( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemUsageCalc'] ) ) . '% '; ?></span> | |
| 130 | - <div style="width: <?php echo esc_attr( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemUsageCalc'] ) ); ?>%"></div> | |
| 129 | + <span><?php echo Utils::wp_kses_custom( $server_info->get_wp_memory_usage()['MemUsageCalc'] ) . '% '; ?></span> | |
| 130 | + <div style="width: <?php echo Utils::wp_kses_custom( $server_info->get_wp_memory_usage()['MemUsageCalc'] ); ?>%"></div> | |
| 131 | 131 | </div> |
| 132 | 132 | </div> |
| 133 | 133 | <?php } ?> |
| 134 | 134 | </td> |
| @@ -138,15 +138,15 @@ | ||
| 138 | 138 | <td><?php esc_html_e( 'PHP Memory Server-Usage', 'adminify' ); ?>:</td> |
| 139 | 139 | <td> |
| 140 | 140 | <?php |
| 141 | 141 | if ( $server_info->get_server_memory_usage()['MemLimitGet'] == '-1' ) { |
| 142 | - echo wp_kses_post( Utils::kses_custom( $server_info->get_server_memory_usage()['MemUsageFormat'] ) ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . esc_html__( 'Unlimited', 'adminify' ) . ' (-1)'; | |
| 142 | + echo Utils::wp_kses_custom( $server_info->get_server_memory_usage()['MemUsageFormat'] ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . esc_html__( 'Unlimited', 'adminify' ) . ' (-1)'; | |
| 143 | 143 | } else { |
| 144 | - echo wp_kses_post( Utils::kses_custom( $server_info->get_server_memory_usage()['MemUsageFormat'] ) ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . wp_kses_post( Utils::kses_custom( $server_info->get_server_memory_usage()['MemLimitFormat'] ) ); | |
| 144 | + echo Utils::wp_kses_custom( $server_info->get_server_memory_usage()['MemUsageFormat'] ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . Utils::wp_kses_custom( $server_info->get_server_memory_usage()['MemLimitFormat'] ); | |
| 145 | 145 | ?> |
| 146 | 146 | <div class="adminify-system-progress"> |
| 147 | 147 | <div class="status-progressbar"> |
| 148 | - <span><?php echo wp_kses_post( Utils::kses_custom( $server_info->get_server_memory_usage()['MemUsageCalc'] ) ) . '% '; ?></span> | |
| 148 | + <span><?php echo Utils::wp_kses_custom( $server_info->get_server_memory_usage()['MemUsageCalc'] ) . '% '; ?></span> | |
| 149 | 149 | <div style="width: <?php echo esc_attr( $server_info->get_server_memory_usage()['MemUsageCalc'] ); ?>%"></div> |
| 150 | 150 | </div> |
| 151 | 151 | </div> |
| 152 | 152 | <?php } ?> |
| @@ -186,8 +186,9 @@ | ||
| 186 | 186 | </thead> |
| 187 | 187 | |
| 188 | 188 | <tbody> |
| 189 | 189 | <?php |
| 190 | + include_once ABSPATH . 'wp-admin/includes/theme-install.php'; | |
| 190 | 191 | $active_theme = wp_get_theme(); |
| 191 | 192 | $theme_version = $active_theme->Version; |
| 192 | 193 | ?> |
| 193 | 194 | <tr> |
| @@ -327,16 +328,44 @@ | ||
| 327 | 328 | if ( ! empty( $plugin_data['PluginURI'] ) ) { |
| 328 | 329 | $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage', 'adminify' ) . '" target="_blank" rel="noopener">' . $plugin_name . '</a>'; |
| 329 | 330 | } |
| 330 | 331 | |
| 331 | - if ( ! empty( $plugin_data['Network'] ) ) { | |
| 332 | - $network_string = ' – <strong style="color:black;">' . __( 'Network enabled', 'adminify' ) . '</strong>'; | |
| 332 | + if ( strstr( $dirname, 'adminify-' ) && strstr( $plugin_data['PluginURI'], 'woothemes.com' ) ) { | |
| 333 | + if ( false === ( $version_data = get_transient( md5( $plugin ) . '_version_data' ) ) ) { | |
| 334 | + $changelog = wp_safe_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' ); | |
| 335 | + $cl_lines = explode( "\n", wp_remote_retrieve_body( $changelog ) ); | |
| 336 | + if ( ! empty( $cl_lines ) ) { | |
| 337 | + foreach ( $cl_lines as $line_num => $cl_line ) { | |
| 338 | + if ( preg_match( '/^[0-9]/', $cl_line ) ) { | |
| 339 | + $date = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) ); | |
| 340 | + $version = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) ); | |
| 341 | + $update = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) ); | |
| 342 | + $version_data = [ | |
| 343 | + 'date' => $date, | |
| 344 | + 'version' => $version, | |
| 345 | + 'update' => $update, | |
| 346 | + 'changelog' => $changelog, | |
| 347 | + ]; | |
| 348 | + set_transient( md5( $plugin ) . '_version_data', $version_data, DAY_IN_SECONDS ); | |
| 349 | + break; | |
| 350 | + } | |
| 351 | + } | |
| 352 | + } | |
| 353 | + } | |
| 354 | + | |
| 355 | + if ( ! empty( $version_data['version'] ) && version_compare( $version_data['version'], $plugin_data['Version'], '>' ) ) { | |
| 356 | + $version_string = ' – <strong style="color:red;">' . esc_html( sprintf( _x( '%s is available', 'Version info', 'adminify' ), $version_data['version'] ) ) . '</strong>'; | |
| 357 | + } | |
| 358 | + | |
| 359 | + if ( $plugin_data['Network'] != false ) { | |
| 360 | + $network_string = ' – <strong style="color:black;">' . __( 'Network enabled', 'adminify' ) . '</strong>'; | |
| 361 | + } | |
| 333 | 362 | } |
| 334 | 363 | ?> |
| 335 | 364 | <tr> |
| 336 | 365 | <td><?php echo wp_kses_post( $plugin_name ); ?></td> |
| 337 | 366 | <td><?php echo esc_html( $plugin_data['Version'] ) .wp_kses_post( $version_string) . wp_kses_post($network_string); ?></td> |
| 338 | - <td><?php echo wp_kses_post( $plugin_data['Author'] ); ?></td> | |
| 367 | + <td><?php echo sprintf( esc_html__( '%s', 'by author', 'adminify' ), wp_kses_post($plugin_data['Author']) ); ?></td> | |
| 339 | 368 | </tr> |
| 340 | 369 | <?php |
| 341 | 370 | } |
| 342 | 371 | } |