add wp-rocket

This commit is contained in:
nguyen dung
2022-02-18 19:09:35 +07:00
parent 39b8cb3612
commit 3110d00ee7
927 changed files with 271703 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
<?php
/**
* Addons section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-addons"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
</div>

View File

@@ -0,0 +1,24 @@
<?php
/**
* Advanced cache section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-rules"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
</div>

View File

@@ -0,0 +1,24 @@
<?php
/**
* Cache section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-files"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
</div>

View File

@@ -0,0 +1,54 @@
<?php
/**
* Cloudflare section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1">
<img src="<?php echo esc_url( WP_ROCKET_ASSETS_IMG_URL . 'logo-cloudflare.svg' ); ?>" width="246" height="35" alt="Logo Cloudflare">
</h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
<div class="wpr-optionHeader">
<h3 class="wpr-title2"><?php esc_html_e( 'Cloudflare Cache', 'rocket' ); ?></h3>
</div>
<?php if ( current_user_can( 'rocket_purge_cloudflare_cache' ) ) : ?>
<div class="wpr-fieldsContainer">
<div class="wpr-fieldsContainer-description">
<?php
printf(
// translators: %s is a "Learn more" link.
esc_html__( 'Purges cached resources for your website. %s', 'rocket' ),
'<a href="' . esc_url( __( 'https://support.cloudflare.com/hc/en-us/articles/200169246', 'rocket' ) ) . '" target="_blank">' . esc_html__( 'Learn more', 'rocket' ) . '</a>'
);
?>
</div><br>
<?php
$this->render_action_button(
'link',
'rocket_purge_cloudflare',
[
'label' => __( 'Clear all Cloudflare cache files', 'rocket' ),
'attributes' => [
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-button--purple wpr-icon-trash',
],
]
);
?>
</div>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,263 @@
<?php
/**
* Dashboard section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* @type array $faq {
* Items to populate the FAQ section.
*
* @type string $id Documentation item ID.
* @type string $url Documentation item URL.
* @type string $title Documentation item title.
* }
* @type object $customer_data WP Rocket customer data.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-home"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php
$rocket_boxes = get_user_meta( get_current_user_id(), 'rocket_boxes', true );
if ( ! in_array( 'rocket_activation_notice', (array) $rocket_boxes, true ) ) :
?>
<div class="wpr-notice">
<div class="wpr-notice-container">
<div class="wpr-notice-supTitle"><?php esc_html_e( 'Congratulations!', 'rocket' ); ?></div>
<h2 class="wpr-notice-title">
<?php esc_html_e( 'WP Rocket is now activated and already working for you.', 'rocket' ); ?>
<br>
<?php esc_html_e( 'Your website should be loading faster now!', 'rocket' ); ?>
</h2>
<div class="wpr-notice-description"><?php esc_html_e( 'To guarantee fast websites, WP Rocket applies 80% of web performance best practices.', 'rocket' ); ?><br> <?php esc_html_e( 'We also enable options that provide immediate benefits to your website.', 'rocket' ); ?></div>
<div class="wpr-notice-continue"><?php esc_html_e( 'Continue to the options to further optimize your site!', 'rocket' ); ?></div>
<a class="wpr-notice-close wpr-icon-close rocket-dismiss" href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=rocket_ignore&box=rocket_activation_notice' ), 'rocket_ignore_rocket_activation_notice' ) ); ?>"><span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.', 'rocket' ); ?></span></a>
</div>
</div>
<?php endif; ?>
<?php
/**
* Fires before displaying the dashboard tab content
*
* @since 3.7.4
*/
do_action( 'rocket_before_dashboard_content' );
?>
<div class="wpr-Page-row">
<div class="wpr-Page-col">
<?php if ( ! defined( 'WP_ROCKET_WHITE_LABEL_ACCOUNT' ) || ! WP_ROCKET_WHITE_LABEL_ACCOUNT ) : ?>
<div class="wpr-optionHeader">
<h3 class="wpr-title2"><?php esc_html_e( 'My Account', 'rocket' ); ?></h3>
<?php
$this->render_action_button(
'button',
'refresh_account',
[
'label' => __( 'Refresh info', 'rocket' ),
'attributes' => [
'class' => 'wpr-infoAction wpr-icon-refresh',
],
]
);
?>
</div>
<div class="wpr-field wpr-field-account">
<div class="wpr-flex">
<div class="wpr-infoAccount-License">
<span class="wpr-title3"><?php esc_html_e( 'License', 'rocket' ); ?></span>
<span class="wpr-infoAccount wpr-isValid" id="wpr-account-data">
<?php echo esc_html( $data['customer_data']['license_type'] ); ?>
</span><br>
<?php
/**
* Fires when displaying the license information
*
* @since 3.7.3
*/
do_action( 'rocket_dashboard_license_info' );
?>
<p>
<span class="wpr-title3"><?php esc_html_e( 'Expiration Date', 'rocket' ); ?></span>
<span class="wpr-infoAccount <?php echo esc_attr( $data['customer_data']['license_class'] ); ?>" id="wpr-expiration-data"><?php echo esc_html( $data['customer_data']['license_expiration'] ); ?></span>
</p>
</div>
<div>
<?php
$this->render_action_button(
'link',
'view_account',
[
'label' => __( 'View my account', 'rocket' ),
'attributes' => [
'target' => '_blank',
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-button--purple wpr-icon-user',
],
]
);
?>
</div>
</div>
</div>
<?php endif; ?>
<?php
/**
* Fires after the account data section on the WP Rocket settings dashboard
*
* @since 3.5
*/
do_action( 'rocket_dashboard_after_account_data' );
?>
<?php
$this->render_settings_sections( $data['id'] );
?>
</div>
<div class="wpr-Page-col wpr-Page-col--fixed">
<div class="wpr-optionHeader">
<h3 class="wpr-title2"><?php esc_html_e( 'Quick Actions', 'rocket' ); ?></h3>
</div>
<div class="wpr-fieldsContainer">
<fieldset class="wpr-fieldsContainer-fieldset">
<?php if ( current_user_can( 'rocket_purge_cache' ) ) : ?>
<div class="wpr-field">
<h4 class="wpr-title3"><?php esc_html_e( 'Remove all cached files', 'rocket' ); ?></h4>
<?php
$this->render_action_button(
'link',
'purge_cache',
[
'label' => __( 'Clear cache', 'rocket' ),
'parameters' => [
'type' => 'all',
],
'attributes' => [
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-icon-trash',
],
]
);
?>
</div>
<?php endif; ?>
<?php if ( get_rocket_option( 'manual_preload' ) && current_user_can( 'rocket_preload_cache' ) ) : ?>
<div class="wpr-field">
<h4 class="wpr-title3"><?php esc_html_e( 'Start cache preloading', 'rocket' ); ?></h4>
<?php
$this->render_action_button(
'link',
'preload',
[
'label' => __( 'Preload cache', 'rocket' ),
'attributes' => [
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-icon-refresh',
],
]
);
?>
</div>
<?php endif; ?>
<?php
$opcache_enabled = filter_var( ini_get( 'opcache.enable' ), FILTER_VALIDATE_BOOLEAN ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
$restrict_api = ini_get( 'opcache.restrict_api' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
$can_restrict_api = true; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
if ( $restrict_api && strpos( __FILE__, $restrict_api ) !== 0 ) {
$can_restrict_api = false; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
}
if ( function_exists( 'opcache_reset' ) && $opcache_enabled && current_user_can( 'rocket_purge_opcache' ) && $can_restrict_api ) :
?>
<div class="wpr-field">
<h4 class="wpr-title3"><?php esc_html_e( 'Purge OPCache content', 'rocket' ); ?></h4>
<?php
$this->render_action_button(
'link',
'rocket_purge_opcache',
[
'label' => __( 'Purge OPCache', 'rocket' ),
'attributes' => [
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-icon-trash',
],
]
);
?>
</div>
<?php endif; ?>
<?php if ( get_rocket_option( 'async_css' ) && apply_filters( 'do_rocket_critical_css_generation', true ) && current_user_can( 'rocket_regenerate_critical_css' ) ) : // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound ?>
<div class="wpr-field">
<h4 class="wpr-title3"><?php esc_html_e( 'Regenerate Critical CSS', 'rocket' ); ?></h4>
<?php
$this->render_action_button(
'link',
'rocket_generate_critical_css',
[
'label' => __( 'Regenerate Critical CSS', 'rocket' ),
'attributes' => [
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-icon-refresh',
],
]
);
?>
</div>
<?php endif; ?>
</fieldset>
</div>
</div>
</div>
<div class="wpr-Page-row">
<div class="wpr-Page-col">
<?php $this->render_part( 'getting-started' ); ?>
<div class="wpr-optionHeader">
<h3 class="wpr-title2"><?php esc_html_e( 'Frequently Asked Questions', 'rocket' ); ?></h3>
</div>
<div class="wpr-fieldsContainer-fieldset">
<div class="wpr-field">
<ul class="wpr-field-list">
<?php foreach ( $data['faq'] as $rocket_faq_item ) : ?>
<li class="wpr-icon-information"><a href="<?php echo esc_url( $rocket_faq_item['url'] ); ?>" data-beacon-article="<?php echo esc_attr( $rocket_faq_item['id'] ); ?>" target="_blank"><?php echo esc_html( $rocket_faq_item['title'] ); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<div class="wpr-field">
<div class="wpr-flex wpr-flex--egal">
<div>
<h3 class="wpr-title2"><?php esc_html_e( 'Still cannot find a solution?', 'rocket' ); ?></h3>
<p class="wpr-field-description"><?php esc_html_e( 'Submit a ticket and get help from our friendly and knowledgeable Rocketeers.', 'rocket' ); ?></p>
</div>
<div>
<?php
$this->render_action_button(
'link',
'ask_support',
[
'label' => __( 'Ask support', 'rocket' ),
'attributes' => [
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-button--blue wpr-icon-help wpr-js-askSupport',
'target' => '_blank',
],
]
);
?>
</div>
</div>
</div>
</div>
</div>
<div class="wpr-Page-col wpr-Page-col--fixed">
<?php $this->render_part( 'documentation' ); ?>
</div>
</div>
</div>

View File

@@ -0,0 +1,29 @@
<?php
/**
* Database section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-database"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
<div class="wpr-fieldsContainer-helper wpr-icon-important">
<?php esc_html_e( 'Backup your database before you run a cleanup!', 'rocket' ); ?>
<p><?php esc_html_e( 'Once a database optimization has been performed, there is no way to undo it.', 'rocket' ); ?></p>
</div>
<input type="submit" class="wpr-button" name="wp_rocket_settings[submit_optimize]" value="<?php esc_attr_e( 'Save Changes and Optimize', 'rocket' ); ?>">
</div>

View File

@@ -0,0 +1,24 @@
<?php
/**
* CSS & Javascript section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-stack"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
</div>

View File

@@ -0,0 +1,25 @@
<?php
/**
* Heartbeat section template.
*
* @since 3.2
* @author Grégory Viguier
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-heartbeat-hover"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
</div>

View File

@@ -0,0 +1,49 @@
<?php
/**
* Imagify section template.
*
* @since 3.2
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="imagify" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-imagify-hover"><?php esc_html_e( 'Image Optimization', 'rocket' ); ?></h2>
</div>
<div class="wpr-imagify">
<div class="wpr-imagify-description">
<p>
<?php
// Translators: %1$s = <strong>, %2$s = </strong>, %3$s = <span class="imagify-name">, %4$s = </span>.
printf( esc_html__( '%1$sWP ROCKET%2$s created %3$sIMAGIFY%4$s %1$sfor best-in-class image optimization.%2$s', 'rocket' ), '<strong>', '</strong>', '<span class="wpr-imagify-name">', '</span>' );
?>
</p>
<p><?php esc_html_e( 'Compress image to make your website faster, all while maintaining image quality.', 'rocket' ); ?></p>
<p class="wpr-imagify-more"><?php esc_html_e( 'More on Imagify:', 'rocket' ); ?></p>
<ul>
<li><a href="https://wordpress.org/plugins/imagify/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Imagify Plugin Page', 'rocket' ); ?></a></li>
<li><a href="https://imagify.io/?utm_source=wp_plugin&utm_medium=wp-rocket&utm_campaign=partnership" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Imagify Website', 'rocket' ); ?></a></li>
<li><a href="https://www.imagely.com/image-optimization-plugin-comparison/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Review of Image Compression Plugins', 'rocket' ); ?></a></li>
</ul>
<?php
if ( ! \Imagify_Partner::is_imagify_activated() ) {
$imagify = new \Imagify_Partner( 'wp-rocket' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
if ( \Imagify_Partner::is_imagify_installed() ) {
$button_text = __( 'Activate Imagify', 'rocket' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
} else {
$button_text = __( 'Install Imagify', 'rocket' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
}
echo '<a class="button-primary" href="' . esc_url( $imagify->get_post_install_url() ) . '">' . esc_html( $button_text ) . '</a>';
}
?>
</div>
<div class="wpr-imagify-screenshot">
<img src="https://wp-rocket.me/wp-content/uploads/1/imagify.jpg?ver=<?php echo esc_attr( time() ); ?>" alt="" width="613" height="394">
</div>
</div>
</div>

View File

@@ -0,0 +1,61 @@
<?php
/**
* License section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div class="wpr-sectionHeader">
<h2 id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-title1 wpr-icon-important"><?php echo esc_html( $data['title'] ); ?></h2>
<div class="wpr-sectionHeader-title wpr-title3">
<?php esc_html_e( 'WP Rocket was not able to automatically validate your license.', 'rocket' ); ?>
</div>
<div class="wpr-sectionHeader-description">
<?php
// translators: %1$s = tutorial URL, %2$s = support URL.
printf(
// translators: %1$s = tutorial URL, %2$s = support URL.
esc_html__( 'Follow this %1$s, or contact %2$s to get the engine started.', 'rocket' ),
sprintf(
// translators: %1$s = <a href=", %2$s = tutorial href, %3$s = " target="_blank">, %4$s = </a>.
esc_html__( '%1$s%2$s%3$stutorial%4$s', 'rocket' ),
'<a href="',
esc_url( __( 'https://docs.wp-rocket.me/article/100-resolving-problems-with-license-validation/?utm_source=wp_plugin&utm_medium=wp_rocket', 'rocket' ) ),
'" target="_blank">',
'</a>'
),
sprintf(
// translators: %1$s = <a href=", %2$s = support href, %3$s = " target="_blank">, %4$s = </a>.
esc_html__( '%1$s%2$s%3$ssupport%4$s', 'rocket' ),
'<a href="',
rocket_get_external_url( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Dynamic content is properly escaped in the view.
'support',
[
'utm_source' => 'wp_plugin',
'utm_medium' => 'wp_rocket',
]
),
'" target="_blank">',
'</a>'
)
);
?>
</div>
</div><br>
<div class="wpr-fieldsContainer">
<div class="wpr-fieldsContainer-fieldset wpr-fieldsContainer-fieldset--split">
<?php $this->render_settings_sections( $data['id'] ); ?>
</div>
</div>

View File

@@ -0,0 +1,24 @@
<?php
/**
* Media section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-media"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
</div>

View File

@@ -0,0 +1,40 @@
<?php
/**
* CDN section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-cdn"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php
/**
* Fires before displaying CDN sections on WP Rocket settings page
*
* @since 3.5
*/
do_action( 'rocket_before_cdn_sections' );
?>
<?php $this->render_settings_sections( $data['id'] ); ?>
<?php
/**
* Fires after displaying CDN sections on WP Rocket settings page
*
* @since 3.5
*/
do_action( 'rocket_after_cdn_sections' );
?>
</div>

View File

@@ -0,0 +1,24 @@
<?php
/**
* Preload section template.
*
* @since 3.0
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-refresh"><?php echo esc_html( $data['title'] ); ?></h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
</div>

View File

@@ -0,0 +1,55 @@
<?php
/**
* Sucuri Cache section template.
*
* @since 3.2
* @author Grégory Viguier
*
* @param array {
* Section arguments.
*
* @type string $id Page section identifier.
* @type string $title Page section title.
* }
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="<?php echo esc_attr( $data['id'] ); ?>" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1">
<img src="<?php echo esc_url( WP_ROCKET_ASSETS_IMG_URL . 'logo-sucuri.png' ); ?>" width="99" height="35" alt="<?php echo esc_attr( $data['title'] ); ?>">
</h2>
</div>
<?php $this->render_settings_sections( $data['id'] ); ?>
<?php if ( current_user_can( 'rocket_purge_sucuri_cache' ) ) : ?>
<div class="wpr-optionHeader">
<h3 class="wpr-title2"><?php echo esc_html( $data['title'] ); ?></h3>
</div>
<div class="wpr-fieldsContainer">
<div class="wpr-fieldsContainer-description">
<?php
printf(
// translators: %s is a "Learn more" link.
esc_html__( 'Purges cached resources for your website. %s', 'rocket' ),
'<a href="https://kb.sucuri.net/firewall/Performance/clearing-cache" target="_blank">' . esc_html__( 'Learn more', 'rocket' ) . '</a>'
);
?>
</div><br>
<?php
$this->render_action_button(
'link',
'rocket_purge_sucuri',
[
'label' => __( 'Clear all Sucuri cache files', 'rocket' ),
'attributes' => [
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-button--purple wpr-icon-trash',
],
]
);
?>
</div>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,119 @@
<?php
/**
* Import page section template.
*
* @since 3.0
*/
use WP_Rocket\Logger\Logger;
defined( 'ABSPATH' ) || exit;
// Debug mode.
$rocket_log_description = '';
if ( rocket_direct_filesystem()->exists( Logger::get_log_file_path() ) ) {
$rocket_stats = Logger::get_log_file_stats();
if ( ! is_wp_error( $rocket_stats ) ) {
// translators: %1$s = formatted file size, %2$s = formatted number of entries (don't use %2$d).
$rocket_log_description .= sprintf( esc_html__( 'Files size: %1$s. Number of entries: %2$s.', 'rocket' ), '<strong>' . esc_html( $rocket_stats['bytes'] ) . '</strong>', '<strong>' . esc_html( $rocket_stats['entries'] ) . '</strong>' );
// translators: %1$s = opening <a> tag, %2$s = closing </a> tag.
$rocket_log_description .= '<br/>' . sprintf( esc_html__( '%1$sDownload the file%2$s.', 'rocket' ), '<a href="' . esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=rocket_download_debug_file' ), 'download_debug_file' ) ) . '">', '</a>' );
// translators: %1$s = opening <a> tag, %2$s = closing </a> tag.
$rocket_log_description .= ' - ' . sprintf( esc_html__( '%1$sDelete the file%2$s.', 'rocket' ), '<a href="' . esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=rocket_delete_debug_file' ), 'delete_debug_file' ) ) . '">', '</a>' );
}
}
?>
<div id="tools" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-tools"><?php esc_html_e( 'Tools', 'rocket' ); ?></h2>
</div>
<div class="wpr-tools">
<div class="wpr-tools-col">
<div class="wpr-title3 wpr-tools-label wpr-icon-export"><?php esc_html_e( 'Export settings', 'rocket' ); ?></div>
<div class="wpr-field-description"><?php esc_html_e( 'Download a backup file of your settings', 'rocket' ); ?></div>
</div>
<div class="wpr-tools-col">
<?php
$this->render_action_button(
'link',
'rocket_export',
[
'label' => __( 'Download settings', 'rocket' ),
'attributes' => [
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-button--purple wpr-icon-chevron-down',
],
]
);
?>
</div>
</div>
<?php $this->render_import_form(); ?>
<div class="wpr-tools">
<div class="wpr-tools-col">
<div class="wpr-title3 wpr-tools-label wpr-icon-rollback"><?php esc_html_e( 'Rollback', 'rocket' ); ?></div>
<div class="wpr-field-description">
<?php
// translators: %s = WP Rocket version number.
printf( esc_html__( 'Has version %s caused an issue on your website?', 'rocket' ), esc_html( WP_ROCKET_VERSION ) );
?>
<br><br>
<?php
// translators: %s = <br>.
printf( esc_html__( 'You can rollback to the previous major version here.%sThen send us a support request.', 'rocket' ), '<br/>' );
?>
</div>
</div>
<div class="wpr-tools-col">
<?php
$this->render_action_button(
'link',
'rocket_rollback',
[
// translators: %s = WP Rocket previous version.
'label' => sprintf( __( 'Reinstall version %s', 'rocket' ), WP_ROCKET_LASTVERSION ),
'attributes' => [
'class' => 'wpr-button wpr-button--icon wpr-button--small wpr-button--red wpr-icon-refresh',
],
]
);
?>
</div>
</div>
<?php
/**
* Fires after the Settings Tools page content
*
* @since 3.6
*/
do_action( 'rocket_settings_tools_content' );
?>
<!-- Temporary hide the option. The logger can still be activated by adding the following to the wp-config.php file: define( 'WP_ROCKET_DEBUG', true );
<div class="wpr-tools">
<div class="wpr-tools-col wpr-radio">
<div class="wpr-title3 wpr-tools-label">
<input id="debug_enabled" name="wp_rocket_settings[debug_enabled]" value="1"<?php checked( true, Logger::debug_enabled() ); ?> type="checkbox">
<label for="debug_enabled">
<span data-l10n-active="On" data-l10n-inactive="Off" class="wpr-radio-ui"></span>
<?php esc_html_e( 'Debug mode', 'rocket' ); ?>
</label>
</div>
<div class="wpr-field-description">
<?php esc_html_e( 'Create a debug log file.', 'rocket' ); ?>
</div>
</div>
<div class="wpr-tools-col">
<?php echo $rocket_log_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Dynamic content is properly escaped in the view. ?>
</div>
</div>
-->
</div>

View File

@@ -0,0 +1,65 @@
<?php
/**
* Tutorials section template.
*
* @since 3.4
*/
defined( 'ABSPATH' ) || exit;
$rocket_tutorials = [
[
'title' => __( 'Getting Started', 'rocket' ),
'tutorials' => [
'7seqacq2ol' => __( 'Getting Started with WP Rocket', 'rocket' ),
'fj42vucf99' => __( 'Finding the Best Settings for Your Site', 'rocket' ),
'z1qxl7s2zn' => __( 'How to Check if WP Rocket is Caching Your Site', 'rocket' ),
'j042jylrre' => __( 'How to Measure the Speed of Your Site', 'rocket' ),
],
],
[
'title' => __( 'File Optimization', 'rocket' ),
'tutorials' => [
'frwm2xrksl' => __( 'Troubleshooting Display Issues with File Optimization', 'rocket' ),
'95z0cb0yxb' => __( 'How to Find the Right JavaScript to Exclude', 'rocket' ),
'9m1zg8p5wc' => __( 'How External Content Slows Your Site', 'rocket' ),
],
],
[
'title' => __( 'Preload', 'rocket' ),
'tutorials' => [
'803tlui8oi' => __( 'How Preloading Works', 'rocket' ),
],
],
[
'title' => __( 'Add-ons', 'rocket' ),
'tutorials' => [
'09kolaz9o0' => __( 'Set Up the Cloudflare Add-on', 'rocket' ),
],
],
];
?>
<div id="tutorials" class="wpr-Page">
<div class="wpr-sectionHeader">
<h2 class="wpr-title1 wpr-icon-tutorial-hover"><?php esc_html_e( 'Tutorials', 'rocket' ); ?></h2>
</div>
<div class="wpr-Page-row">
<div class="wpr-Page-col">
<?php foreach ( $rocket_tutorials as $section ) : // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound ?>
<div class="wpr-optionHeader">
<h3 class="wpr-title2"><?php echo esc_html( $section['title'] ); ?></h3>
</div>
<div class="wpr-field wpr-tutorials-section">
<?php foreach ( $section['tutorials'] as $rocket_tutorial_id => $rocket_tutorial_title ) : ?>
<div class="wpr-tutorial-item">
<?php // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript ?>
<script src="https://fast.wistia.com/embed/medias/<?php echo esc_attr( $rocket_tutorial_id ); ?>.jsonp" async></script><div class="wistia_responsive_padding" style="padding:56.25% 0 0 0;position:relative;"><div class="wistia_responsive_wrapper" style="height:100%;left:0;position:absolute;top:0;width:100%;"><span class="wistia_embed wistia_async_<?php echo esc_attr( $rocket_tutorial_id ); ?> popover=true popoverAnimateThumbnail=true videoFoam=true" style="display:inline-block;height:100%;position:relative;width:100%">&nbsp;</span></div></div>
<h4 class="wpr-fieldsContainer-description"><?php echo esc_html( $rocket_tutorial_title ); ?></h4>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>
</div>
</div>