| @@ -16,9 +16,9 @@ | ||
| 16 | 16 | <div class="fw-bg-white fw-shadow fw-rounded fw-sm:rounded-lg fw-mb-4"> |
| 17 | 17 | <div class=""> |
| 18 | 18 | <div class="fw-flex fw-px-4 fw-py-4 fw-fw-sm:p-6 fw-items-center fw-justify-between fw-border-b fw-border-gray-200"> |
| 19 | 19 | <h3 class="fw-text-lg fw-font-semibold fw-leading-6 fw-text-gray-900 fw-m-0"> |
| 20 | - <?php esc_html_e( 'PHP OPcache', 'flywp' ); ?> | |
| 20 | + <?php esc_html_e( 'PHP Opcache', 'flywp' ); ?> | |
| 21 | 21 | </h3> |
| 22 | 22 | |
| 23 | 23 | <?php if ( flywp()->opcache->enabled() ) { ?> |
| 24 | 24 | <div class="fw-text-green-600"> |
| @@ -34,51 +34,54 @@ | ||
| 34 | 34 | <?php } ?> |
| 35 | 35 | </div> |
| 36 | 36 | |
| 37 | 37 | <?php if ( $notice ) { ?> |
| 38 | - <div class="fw-bg-green-200 fw-text-green-800 fw-px-4 fw-py-1 fly-form-notice"> | |
| 38 | + <div class="fw-bg-green-200 fw-text-green-800 fw-px-4 fw-py-1" id="fly-page-cache-notice"> | |
| 39 | 39 | <p><?php echo esc_html( $notice ); ?></p> |
| 40 | 40 | </div> |
| 41 | 41 | <?php } ?> |
| 42 | 42 | |
| 43 | 43 | <div class="fw-mt-2 fw-px-4 fw-py-4 fw-fw-sm:p-6 fw-text-sm fw-text-gray-500"> |
| 44 | - <p class="fw-mt-0 fw-text-sm"><?php esc_html_e( 'OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.', 'flywp' ); ?></p> | |
| 44 | + <p class="fw-mt-0"><?php esc_html_e( 'OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.', 'flywp' ); ?></p> | |
| 45 | + | |
| 46 | + | |
| 47 | + <div class="fw-flex fw-w-full fw-mb-4 fw-gap-3 fw-items-center"> | |
| 48 | + <div class="fw-w-2/3"> | |
| 49 | + <dl class="fw-m-0 fw-mt-2"> | |
| 50 | + <div class="fw-flex fw-w-full"> | |
| 51 | + <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-flex-none sm:fw-pr-6">Hit Rate</dt> | |
| 52 | + <dd><?php echo number_format( $status['opcache_statistics']['opcache_hit_rate'], 2 ) . '%'; ?></dd> | |
| 53 | + </div> | |
| 45 | 54 | |
| 46 | - <?php if ( flywp()->opcache->enabled() ) { ?> | |
| 47 | - <div class="md:fw-flex fw-w-full fw-mb-4 fw-gap-3 fw-items-center"> | |
| 48 | - <div class="sm:fw-w-2/3 fw-mb-6 sm:fw-mb-0"> | |
| 49 | - <dl class="fw-m-0 fw-mt-2"> | |
| 50 | - <div class="fw-flex fw-justify-between sm:fw-justify-normal"> | |
| 51 | - <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-flex-none sm:fw-pr-6"><?php esc_html_e( 'Hit Rate', 'flywp' ); ?></dt> | |
| 52 | - <dd><?php echo number_format( $status['opcache_statistics']['opcache_hit_rate'], 2 ) . '%'; ?></dd> | |
| 53 | - </div> | |
| 55 | + <div class="fw-flex"> | |
| 56 | + <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-pr-6">Cached Scripts</dt> | |
| 57 | + <dd><?php echo $status['opcache_statistics']['num_cached_scripts']; ?></dd> | |
| 58 | + </div> | |
| 54 | 59 | |
| 55 | - <div class="fw-flex fw-justify-between sm:fw-justify-normal"> | |
| 56 | - <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-pr-6"><?php esc_html_e( 'Cached Scripts', 'flywp' ); ?></dt> | |
| 57 | - <dd><?php echo $status['opcache_statistics']['num_cached_scripts']; ?></dd> | |
| 58 | - </div> | |
| 60 | + <div class="fw-flex"> | |
| 61 | + <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-pr-6">Memory</dt> | |
| 62 | + <dd><?php echo sprintf( '%s of %s', size_format( $status['memory_usage']['used_memory'] ), size_format( $config['directives']['opcache.memory_consumption'] ) ); ?></dd> | |
| 63 | + </div> | |
| 59 | 64 | |
| 60 | - <div class="fw-flex fw-justify-between sm:fw-justify-normal"> | |
| 61 | - <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-pr-6"><?php esc_html_e( 'Memory', 'flywp' ); ?></dt> | |
| 62 | - <dd><?php echo sprintf( '%s of %s', size_format( $status['memory_usage']['used_memory'] ), size_format( $config['directives']['opcache.memory_consumption'] ) ); ?></dd> | |
| 63 | - </div> | |
| 65 | + <div class="fw-flex"> | |
| 66 | + <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-pr-6">Keys</dt> | |
| 67 | + <dd><?php echo sprintf( '%d of %d', $status['opcache_statistics']['num_cached_keys'], $status['opcache_statistics']['max_cached_keys'] ); ?></dd> | |
| 68 | + </div> | |
| 64 | 69 | |
| 65 | - <div class="fw-flex fw-justify-between sm:fw-justify-normal"> | |
| 66 | - <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-pr-6"><?php esc_html_e( 'Keys', 'flywp' ); ?></dt> | |
| 67 | - <dd><?php echo sprintf( '%d of %d', $status['opcache_statistics']['num_cached_keys'], $status['opcache_statistics']['max_cached_keys'] ); ?></dd> | |
| 68 | - </div> | |
| 70 | + <div class="fw-flex"> | |
| 71 | + <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-pr-6">Engine</dt> | |
| 72 | + <dd><?php echo sprintf( '%s (%s)', $config['version']['opcache_product_name'], $config['version']['version'] ); ?></dd> | |
| 73 | + </div> | |
| 74 | + </dl> | |
| 75 | + </div> | |
| 69 | 76 | |
| 70 | - <div class="fw-flex fw-justify-between sm:fw-justify-normal"> | |
| 71 | - <dt class="fw-font-medium fw-text-gray-900 sm:fw-w-32 sm:fw-pr-6"><?php esc_html_e( 'Engine', 'flywp' ); ?></dt> | |
| 72 | - <dd><?php echo sprintf( '%s (%s)', $config['version']['opcache_product_name'], $config['version']['version'] ); ?></dd> | |
| 73 | - </div> | |
| 74 | - </dl> | |
| 77 | + <?php if ( flywp()->opcache->enabled() ) { ?> | |
| 78 | + <div class="fw-w-1/3"> | |
| 79 | + <a href="<?php echo esc_url( flywp()->opcache->purge_cache_url() ); ?>" class="button button-primary button-hero"><?php esc_html_e( 'Clear Cache', 'flywp' ); ?></a> | |
| 75 | 80 | </div> |
| 81 | + <?php } ?> | |
| 82 | + </div> | |
| 76 | 83 | |
| 77 | - <div class="sm:fw-w-1/3 fw-text-center sm:fw-text-right"> | |
| 78 | - <a href="<?php echo esc_url( flywp()->opcache->purge_cache_url() ); ?>" class="button button-primary button-hero !fw-bg-indigo-600 hover:!fw-bg-indigo-700"><?php esc_html_e( 'Clear Cache', 'flywp' ); ?></a> | |
| 79 | - </div> | |
| 80 | - </div> | |
| 81 | - <?php } ?> | |
| 84 | + | |
| 82 | 85 | </div> |
| 83 | 86 | </div> |
| 84 | 87 | </div> |