| 1 |
<?php |
| 2 |
|
| 3 |
$notice = ''; |
| 4 |
|
| 5 |
$cache_messages = [ |
| 6 |
'lscache-enabled' => __( 'Page Caching has been enabled.', 'flywp' ), |
| 7 |
'lscache-disabled' => __( 'Page Caching has been disabled.', 'flywp' ), |
| 8 |
]; |
| 9 |
|
| 10 |
if ( isset( $_GET['fly-notice'] ) && isset( $cache_messages[ $_GET['fly-notice'] ] ) ) { |
| 11 |
$notice = $cache_messages[ $_GET['fly-notice'] ]; |
| 12 |
} |
| 13 |
?> |
| 14 |
|
| 15 |
<div class="fw-bg-white fw-shadow fw-rounded fw-sm:rounded-lg fw-mb-6"> |
| 16 |
<div class=""> |
| 17 |
<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"> |
| 18 |
<h3 class="fw-text-lg fw-font-semibold fw-leading-6 fw-text-gray-900 fw-m-0"> |
| 19 |
<?php esc_html_e( 'LiteSpeed Cache', 'flywp' ); ?> |
| 20 |
</h3> |
| 21 |
|
| 22 |
<?php if ( flywp()->litespeed->cache_enabled() ) { ?> |
| 23 |
<div class="fw-text-green-600"> |
| 24 |
<span class="dashicons dashicons-yes-alt"></span> |
| 25 |
<?php esc_html_e( 'Enabled', 'flywp' ); ?> |
| 26 |
</div> |
| 27 |
<?php } else { ?> |
| 28 |
|
| 29 |
<div class="fw-text-gray-400"> |
| 30 |
<span class="dashicons dashicons-no-alt"></span> |
| 31 |
<?php esc_html_e( 'Disabled', 'flywp' ); ?> |
| 32 |
</div> |
| 33 |
<?php } ?> |
| 34 |
</div> |
| 35 |
|
| 36 |
<?php if ( $notice ) { ?> |
| 37 |
<div class="fw-bg-green-200 fw-text-green-800 fw-px-4 fw-py-1 fly-form-notice"> |
| 38 |
<p><?php echo esc_html( $notice ); ?></p> |
| 39 |
</div> |
| 40 |
<?php } ?> |
| 41 |
|
| 42 |
<div class="fw-mt-2 fw-px-4 fw-py-4 fw-fw-sm:p-6 fw-text-sm fw-text-gray-500 md:fw-flex"> |
| 43 |
<div class="md:fw-w-2/3"> |
| 44 |
<p class="fw-mt-0 fw-text-sm"><?php esc_html_e( 'LiteSpeed Cache is a very fast page caching system that boosts up your website page load speed.', 'flywp' ); ?></p> |
| 45 |
</div> |
| 46 |
|
| 47 |
<?php if ( flywp()->litespeed->cache_enabled() ) { ?> |
| 48 |
<div class="md:fw-w-1/3 fw-text-center md:fw-text-right"> |
| 49 |
<a href="<?php echo esc_url( flywp()->litespeed->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> |
| 50 |
</div> |
| 51 |
<?php } ?> |
| 52 |
</div> |
| 53 |
|
| 54 |
|
| 55 |
<div class="fw-px-4 fw-py-3 fw-fw-sm:p-6 fw-mt-5 fw-bg-gray-100 fw-p-4 fw-border-t fw-rounded-br fw-rounded-bl fw-border-gray-200 fw-text-right"> |
| 56 |
<?php if ( flywp()->litespeed->cache_enabled() ) { ?> |
| 57 |
<a href="<?php echo esc_url( $this->litespeed->enable_disable_url( 'disable' ) ); ?>" class="button button-secondary button-large"> |
| 58 |
<?php esc_html_e( 'Disable', 'flywp' ); ?> |
| 59 |
</a> |
| 60 |
<?php } elseif ( flywp()->litespeed->is_plugin_active() ) { ?> |
| 61 |
<a href="<?php echo esc_url( $this->litespeed->enable_disable_url( 'enable' ) ); ?>" class="button button-primary button-large"> |
| 62 |
<?php esc_html_e( 'Enable Cache', 'flywp' ); ?> |
| 63 |
</a> |
| 64 |
<?php } ?> |
| 65 |
|
| 66 |
<?php $settings = flywp()->litespeed->settings_url(); ?> |
| 67 |
|
| 68 |
<a class="button button-secondary button-large fw-flex fw-items-center" href="<?php echo esc_attr( $settings['url'] ); ?>" target="_blank"> |
| 69 |
<span class="dashicons dashicons-admin-generic button-active fw-mt-1"></span> |
| 70 |
<?php echo esc_html( $settings['text'] ); ?> |
| 71 |
</a> |
| 72 |
</div> |
| 73 |
|
| 74 |
</div> |
| 75 |
</div> |
| 76 |
|