HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/tpl.tar
admin-home-page.php000064400000005523151534501340010213 0ustar00<?php
$settings = siteorigin_panels_setting();
$builder_supports = apply_filters( 'siteorigin_panels_builder_supports', array(), $post, $panels_data );
?>

<div class="wrap" id="panels-home-page">
	<form
		action="<?php echo esc_url( add_query_arg('page', 'so_panels_home_page') ) ?>"
		class="hide-if-no-js siteorigin-panels-builder-form"
		method="post"
		id="panels-home-page-form"
		data-type="custom_home_page"
		data-post-id="<?php echo get_the_ID() ?>"
		data-preview-url="<?php echo SiteOrigin_Panels::preview_url() ?>"
		data-builder-supports="<?php echo esc_attr( json_encode( $builder_supports ) ) ?>"
		>
		<div id="icon-index" class="icon32"><br></div>
		<h2>
			<label class="switch">
				<input class="switch-input" type="checkbox" <?php checked( ( get_option('siteorigin_panels_home_page_id') && get_option('siteorigin_panels_home_page_id') == get_option('page_on_front') && get_option('show_on_front') == 'page' ) ) ?> name="siteorigin_panels_home_enabled">
				<span class="switch-label" data-on="<?php _e('On', 'siteorigin-panels') ?>" data-off="<?php _e('Off', 'siteorigin-panels') ?>"></span>
				<span class="switch-handle"></span>
			</label>

			<?php esc_html_e('Custom Home Page', 'siteorigin-panels') ?>

			<?php if( get_option('siteorigin_panels_home_page_id') && ($the_page = get_post( get_option('siteorigin_panels_home_page_id') ) ) ) : ?>
				<div id="panels-view-as-page">
					<a href="<?php echo admin_url('post.php?post='.$the_page->ID.'&action=edit') ?>" class="add-new-h2">Edit As Page</a>
				</div>
			<?php endif; ?>
		</h2>

		<?php if( isset($_POST['_sopanels_home_nonce']) && wp_verify_nonce($_POST['_sopanels_home_nonce'], 'save') ) : global $post; ?>
			<div id="message" class="updated">
				<p>
					<?php
					echo preg_replace(
						'/1\{ *(.*?) *\}/',
						'<a href="' . get_the_permalink( $post ) . '">$1</a>',
						__('Home page updated. 1{View page}.', 'siteorigin-panels')
					);
					?>
				</p>
			</div>
		<?php endif; ?>

		<div class="siteorigin-panels-builder-container so-panels-loading">

		</div>

		<script type="text/javascript">
			( function( builderId, panelsData ){
				// Create the panels_data input
				document.write( '<input name="panels_data" type="hidden" class="siteorigin-panels-data-field" id="panels-data-field-' + builderId + '" />' );
				document.getElementById( 'panels-data-field-' + builderId ).value = JSON.stringify( panelsData );
			} )( "home-page", <?php echo json_encode( $panels_data ); ?> );
		</script>

		<p><input type="submit" class="button button-primary" id="panels-save-home-page" value="<?php esc_attr_e('Save Home Page', 'siteorigin-panels') ?>" /></p>
		<input type="hidden" id="post_content" name="post_content"/>
		<?php wp_nonce_field('save', '_sopanels_home_nonce') ?>
	</form>
	<noscript><p><?php _e('This interface requires Javascript', 'siteorigin-panels') ?></p></noscript>
</div>
help.php000064400000000434151534501340006207 0ustar00<p>
	<?php
	echo preg_replace(
		'/1\{ *(.*?) *\}/',
		'<a href="https://siteorigin.com/page-builder/settings/" target="_blank" rel="noopener noreferrer">$1</a>',
		__( 'Please read the 1{settings guide} of the Page Builder documentation for help.', 'siteorigin-panels' )
	);
	?>
</p>js-templates.php000064400000052342151534501340007674 0ustar00<?php
global $post;
$layouts = apply_filters( 'siteorigin_panels_prebuilt_layouts', array() );
?>

<script type="text/template" id="siteorigin-panels-builder">

	<div class="siteorigin-panels-builder">

		<div class="so-builder-toolbar">

			<a class="so-tool-button so-widget-add" title="<?php esc_attr_e( 'Add Widget', 'siteorigin-panels' ) ?>">
				<span class="so-panels-icon so-panels-icon-add-widget"></span>
				<span class="so-button-text"><?php esc_html_e('Add Widget', 'siteorigin-panels') ?></span>
			</a>

			<a class="so-tool-button so-row-add" title="<?php esc_attr_e( 'Add Row', 'siteorigin-panels' ) ?>">
				<span class="so-panels-icon so-panels-icon-add-row"></span>
				<span class="so-button-text"><?php esc_html_e('Add Row', 'siteorigin-panels') ?></span>
			</a>

			<a class="so-tool-button so-prebuilt-add" title="<?php esc_attr_e( 'Prebuilt Layouts', 'siteorigin-panels' ) ?>">
				<span class="so-panels-icon so-panels-icon-layouts"></span>
				<span class="so-button-text"><?php esc_html_e('Hazır Şablonlar', 'siteorigin-panels') ?></span>
			</a>

			<?php if( !empty($post) ) : ?>

				<a class="so-tool-button so-history" style="display: none" title="<?php esc_attr_e( 'Edit History', 'siteorigin-panels' ) ?>">
					<span class="so-panels-icon so-panels-icon-history"></span>
					<span class="so-button-text"><?php _e('History', 'siteorigin-panels') ?></span>
				</a>

				<a class="so-tool-button so-live-editor" style="display: none" title="<?php esc_html_e( 'Live Editor', 'siteorigin-panels' ) ?>">
					<span class="so-panels-icon so-panels-icon-live-editor"></span>
					<span class="so-button-text"><?php _e('Live Editor', 'siteorigin-panels') ?></span>
				</a>

			<?php endif; ?>

			<?php if( SiteOrigin_Panels::display_premium_teaser() ) : ?>
				<a class="so-tool-button so-learn" title="<?php esc_attr_e( 'Page Builder Addons', 'siteorigin-panels' ) ?>" href="<?php echo esc_url( SiteOrigin_Panels::premium_url() ) ?>" target="_blank" rel="noopener noreferrer" style="margin-left: 10px;">
					<span class="so-panels-icon so-panels-icon-addons"></span>
					<span class="so-button-text"><?php esc_html_e( 'Addons', 'siteorigin-panels' ) ?></span>
				</a>
			<?php endif; ?>
			
			<a class="so-switch-to-standard"><?php _e('Varsayılan Editör', 'siteorigin-panels') ?></a>

		</div>

		<div class="so-rows-container">

		</div>

		<div class="so-panels-welcome-message">
			<div class="so-message-wrapper">
				<?php
				printf(
					__( 'Öncelikle bir %s, %s veya %s ekleyin%s..', 'siteorigin-panels' ),
					"<a href='#' class='so-tool-button so-widget-add'>" . __( 'Bileşen', 'siteorigin-panels' ) . "</a>",
					"<a href='#' class='so-tool-button so-row-add'>" . __( 'Satır', 'siteorigin-panels' ) . "</a>",
					"<a href='#' class='so-tool-button so-prebuilt-add'>" . __( 'Hazır Şablon', 'siteorigin-panels' ) . "</a>",
					"<a href='https://siteorigin.com/page-builder/documentation/' target='_blank' rel='noopener noreferrer'>" . __( 'documentation', 'siteorigin-panels' ) . "</a>"
				);
				?>
			</div>

			<?php if( SiteOrigin_Panels::display_premium_teaser() ) : ?>
				<div class="so-tip-wrapper">
					<strong><?php _e( 'Pro Tip', 'siteorigin-panels' ) ?>: </strong>
					<?php SiteOrigin_Panels_Admin::display_footer_premium_link() ?>
				</div>
			<?php endif; ?>
		</div>

	</div>

</script>

<script type="text/template" id="siteorigin-panels-builder-row">
	<div class="so-row-container ui-draggable so-row-color-{{%= rowColorLabel %}}">

		<div class="so-row-toolbar">
			{{% if( rowLabel ) { %}}
			<h3 class="so-row-label">{{%= rowLabel %}}</h3>
			{{% } %}}
			<span class="so-row-move so-tool-button"><span class="so-panels-icon so-panels-icon-move"></span></span>

			<span class="so-dropdown-wrapper">
				<a class="so-row-settings so-tool-button"><span class="so-panels-icon so-panels-icon-settings"></span></a>

				<div class="so-dropdown-links-wrapper">
					<ul>
						<li><a class="so-row-settings"><?php _e('Edit Row', 'siteorigin-panels') ?></a></li>
						<li><a class="so-row-duplicate"><?php _e('Duplicate Row', 'siteorigin-panels') ?></a></li>
						<li><a class="so-row-delete so-needs-confirm" data-confirm="<?php esc_attr_e('Are you sure?', 'siteorigin-panels') ?>"><?php _e('Delete Row', 'siteorigin-panels') ?></a></li>
						<li class="so-row-colors-container">
							<?php
							// See css/admin.less variable @row_colors. This should match the number of colors defined there.
							$row_color_count = 5;

							for ( $i = 1; $i <= $row_color_count; $i++ ) {
								$classes = array( 'so-row-color', 'so-row-color-' . $i );

								?>
								<div data-color-label="<?php echo esc_attr( $i ); ?>"
									class="<?php echo esc_attr( implode( ' ', $classes ) ) ?>{{% if( rowColorLabel == '<?php echo esc_attr( $i ); ?>' ) print(' so-row-color-selected'); %}}"
									></div>
								<?php
							}
							?>
						</li>
					</ul>
					<div class="so-pointer"></div>
				</div>
			</span>
		</div>

		<div class="so-cells">

		</div>

	</div>
</script>

<script type="text/template" id="siteorigin-panels-builder-cell">
	<div class="cell">
		<div class="resize-handle"></div>
		<div class="cell-wrapper widgets-container">
		</div>
	</div>
</script>

<script type="text/template" id="siteorigin-panels-builder-widget">
	<div class="so-widget ui-draggable" data-widget-class="{{%- widget_class %}}">
		<div class="so-widget-wrapper">
			<div class="title">
				<h4>{{%= title %}}</h4>
				<span class="actions">
					<a class="widget-edit"><?php _e('Edit', 'siteorigin-panels') ?></a>
					<a class="widget-duplicate"><?php _e('Duplicate', 'siteorigin-panels') ?></a>
					<a class="widget-delete"><?php _e('Delete', 'siteorigin-panels') ?></a>
				</span>
			</div>
			<small class="description">{{%= description %}}</small>
		</div>
	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog">
	<div class="so-panels-dialog {{% if(typeof left_sidebar != 'undefined') print('so-panels-dialog-has-left-sidebar '); if(typeof right_sidebar != 'undefined') print('so-panels-dialog-has-right-sidebar '); %}}">

		<div class="so-overlay"></div>

		<div class="so-title-bar {{% if ( dialogIcon ) print( 'so-has-icon' ) %}}">
			<a class="so-show-left-sidebar"><span class="so-dialog-icon"></span></a>
			{{% if ( ! _.isEmpty( dialogIcon ) ) { %}}
				<div class="so-panels-icon so-panels-icon-{{%- dialogIcon %}}"></div>
			{{% } %}}
			<h3 class="so-title{{% if ( editableLabel ) print(' so-title-editable')%}}"
			    {{% if ( editableLabel ) print('contenteditable="true" spellcheck="false" tabIndex="1"')%}}
				>{{%= title %}}</h3>
			<div class="so-title-bar-buttons">
				<a class="so-previous so-nav"><span class="so-dialog-icon"></span></a>
				<a class="so-next so-nav"><span class="so-dialog-icon"></span></a>
				<a class="so-show-right-sidebar"><span class="so-dialog-icon"></span></a>
				<a class="so-close"><span class="so-dialog-icon"></span></a>
			</div>
		</div>

		<div class="so-toolbar">
			<div class="so-status">{{% if(typeof status != 'undefined') print(status); %}}</div>
			<div class="so-buttons">
				{{%= buttons %}}
			</div>
		</div>

		<div class="so-sidebar so-left-sidebar">
			{{% if(typeof left_sidebar  != 'undefined') print(left_sidebar ); %}}
		</div>

		<div class="so-sidebar so-right-sidebar">
			{{% if(typeof right_sidebar  != 'undefined') print(right_sidebar ); %}}
		</div>

		<div class="so-content panel-dialog">
			{{%= content %}}
		</div>

	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog-builder">
	<div class="dialog-data">

		<h3 class="title"><?php _e('Page Builder', 'siteorigin-panels') ?></h3>

		<div class="content">
			<div class="siteorigin-panels-builder">

			</div>
		</div>

		<div class="buttons">
			<input type="button" class="button-primary so-close" value="<?php esc_attr_e('Done', 'siteorigin-panels') ?>" />
		</div>

	</div>
</script>


<script type="text/template" id="siteorigin-panels-dialog-tab">
	<li><a href="{{% if(typeof tab != 'undefined') { print ( '#' + tab ); } %}}">{{%= title %}}</a></li>
</script>

<script type="text/template" id="siteorigin-panels-dialog-widgets">
	<div class="dialog-data">

		<h3 class="title"><?php printf( __('Add New Widget %s', 'siteorigin-panels'), '<span class="current-tab-title"></span>' ) ?></h3>

		<div class="left-sidebar">

			<input type="text" class="so-sidebar-search" placeholder="<?php esc_attr_e('Search Widgets', 'siteorigin-panels') ?>" />

			<ul class="so-sidebar-tabs">
			</ul>

		</div>

		<div class="content">
			<ul class="widget-type-list"></ul>
		</div>

		<div class="buttons">
			<input type="button" class="button-primary so-close" value="<?php esc_attr_e('Close', 'siteorigin-panels') ?>" />
		</div>

	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog-widgets-widget">
	<li class="widget-type">
		<div class="widget-type-wrapper">
			<h3>{{%= title %}}</h3>
			<small class="description">{{%= description %}}</small>
		</div>
	</li>
</script>

<script type="text/template" id="siteorigin-panels-dialog-widget">
	<div class="dialog-data">

		<h3 class="title"><span class="widget-name"></span></h3>

		<div class="right-sidebar"></div>

		<div class="content">

			<div class="widget-form">
			</div>

		</div>

		<div class="buttons">
			<div class="action-buttons">
				<a class="so-delete"><?php _e('Delete', 'siteorigin-panels') ?></a>
				<a class="so-duplicate"><?php _e('Duplicate', 'siteorigin-panels') ?></a>
			</div>

			<input type="button" class="button-primary so-close" value="<?php esc_attr_e('Done', 'siteorigin-panels') ?>" />
		</div>

	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog-widget-sidebar-widget">
	<div class="so-widget">
		<h3>{{%= title %}}</h3>
		<small class="description">
			{{%= description %}}
		</small>
	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog-row">
	<div class="dialog-data">

		<h3 class="title">
			{{%= title %}}
		</h3>

		<div class="right-sidebar"></div>

		<div class="content">

			<div class="row-set-form">
				<?php
				$cells_field = apply_filters('siteorigin_panels_row_column_count_input', '<input type="number" min="1" max="12" name="cells" class="so-row-field" value="2" />');
				$ratios = apply_filters('siteorigin_panels_column_ratios', array(
					'Tam Genişlik' => 1,
					'Hazır-1' => 0.61803398,
					'Hazır-2' => 0.5,
					'Hazır-3' => 0.33333333,
				) );
				$ratio_field = '<select name="ratio" class="so-row-field">';
				foreach( $ratios as $name => $value ) {
					$ratio_field .= '<option value="' . esc_attr($value) .  '">' . esc_html($name . ' (' . round($value, 3) . ')') . '</option>';
				}
				$ratio_field .= '</select>';

				$direction_field = '<select name="ratio_direction" class="so-row-field">';
				$direction_field .= '<option value="right">' . esc_html__('Left to Right', 'siteorigin-panels') . '</option>';
				$direction_field .= '<option value="left">' . esc_html__('Right to Left', 'siteorigin-panels') . '</option>';
				$direction_field .= '</select>';

				printf(
					preg_replace(
						array(
							'/1\{ *(.*?) *\}/',
						),
						array(
							'<strong>$1</strong>',
						),
						__('1{Sütun Sayısı}: %1$s Oran: %2$s Satır Düzeni: %3$s', 'siteorigin-panels')
					),
					$cells_field,
					$ratio_field,
					$direction_field
				);
				echo '<button class="button-secondary set-row">' . esc_html__('Set', 'siteorigin-panels') . '</button>';
				?>
			</div>

			<div class="row-preview">

			</div>

		</div>

		<div class="buttons">
			{{% if( dialogType == 'edit' ) { %}}
				<div class="action-buttons">
					<a class="so-delete"><?php _e('Delete', 'siteorigin-panels') ?></a>
					<a class="so-duplicate"><?php _e('Duplicate', 'siteorigin-panels') ?></a>
				</div>
			{{% } %}}

			{{% if( dialogType == 'create' ) { %}}
				<input type="button" class="button-primary so-insert" value="<?php esc_attr_e('Insert', 'siteorigin-panels') ?>" />
			{{% } else { %}}
				<input type="button" class="button-primary so-save" value="<?php esc_attr_e('Done', 'siteorigin-panels') ?>" />
			{{% } %}}
		</div>

	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog-row-cell-preview">
	<div class="preview-cell" style="width: {{%- weight*100 %}}%">
		<div class="preview-cell-in">
			<div class="preview-cell-weight">{{% print(Math.round(weight * 1000) / 10) %}}</div>
		</div>
	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog-prebuilt">
	<div class="dialog-data">

		<h3 class="title"><?php _e('Page Builder Layouts', 'siteorigin-panels') ?></h3>

		<div class="left-sidebar">

			<input type="text" class="so-sidebar-search" placeholder="<?php esc_attr_e('Search', 'siteorigin-panels') ?>" />

			<ul class="so-sidebar-tabs">
				<?php if( !empty( $layouts ) ) : ?>
					<li>
						<a href="#prebuilt"><?php _e('Prebuilt Layouts', 'siteorigin-panels') ?></a>
					</li>
				<?php endif; ?>
				
				<?php
				$directories = SiteOrigin_Panels_Admin_Layouts::single()->get_directories();
				foreach ( $directories as $id => $directory ) {
					?><li><a href="#directory-<?php echo urlencode( $id ) ?>"><?php echo esc_html( $directory['title'] ) ?></a></li><?php
				}
				?>
				<li><a href="#import"><?php _e('Import/Export', 'siteorigin-panels') ?></a></li>

				<?php
				$post_types = siteorigin_panels_setting('post-types');
				foreach($post_types as $post_type) {
					$type = get_post_type_object( $post_type );
					if( empty($type) ) continue;
					?><li><a href="#<?php echo 'clone_'.$post_type ?>"><?php printf( __('Clone: %s', 'siteorigin-panels'), $type->labels->name ) ?></a></li><?php
				}
				?>
			</ul>

		</div>

		<div class="content">
		</div>

		<div class="buttons">
			<span class="so-dropdown-wrapper">
				<input type="button" class="button-primary so-dropdown-button so-import-layout disabled" value="<?php esc_attr_e('Insert', 'siteorigin-panels') ?>" disabled="disabled"/>

				<div class="so-dropdown-links-wrapper hidden">
					<ul class="so-layout-position">
						<li><a class="so-toolbar-button" data-value="after"><?php esc_html_e('Insert after', 'siteorigin-panels') ?></a></li>
						<li><a class="so-toolbar-button" data-value="before"><?php esc_html_e('Insert before', 'siteorigin-panels') ?></a></li>
						<li><a class="so-toolbar-button so-needs-confirm" data-value="replace" data-confirm="<?php esc_attr_e('Are you sure?', 'siteorigin-panels') ?>"><?php esc_html_e('Replace current', 'siteorigin-panels') ?></a></li>
					</ul>
				</div>
			</span>
		</div>

	</div>
</script>

<script type="text/template" id="siteorigin-panels-directory-enable">
	<div class="so-enable-prebuilt">
		<?php _e('Do you want to browse the Prebuilt Layouts directory?', 'siteorigin-panels') ?>
		<button class="button-primary so-panels-enable-directory"><?php _e('Enable', 'siteorigin-panels') ?></button>
	</div>
</script>

<script type="text/template" id="siteorigin-panels-directory-items">
	<div class="so-directory-items">

		<div class="so-directory-browse">
		</div>

		<div class="so-directory-items-wrapper">
			{{% if(items.length === 0) { %}}
				<div class="so-no-results">
					<?php _e( "Your search didn't return any results", 'siteorigin-panels' ); ?>
				</div>
			{{% } else { %}}
				{{% _.each(items, function(item) { %}}
					<div class="so-directory-item" data-layout-id="{{%- item.id %}}" data-layout-type="{{%- item.type %}}">
						<div class="so-directory-item-wrapper">
							<div class="so-screenshot" data-src="{{%- item.screenshot %}}">
								<div class="so-panels-loading so-screenshot-wrapper"></div>
							</div>
							<div class="so-description">{{%- item.description %}}</div>

							<div class="so-bottom">
								<h4 class="so-title">{{%= item.title %}}</h4>
								{{% if( item.preview ) { %}}
									<div class="so-buttons">
										<a href="{{%- item.preview %}}" class="button-secondary so-button-preview" target="_blank" rel="noopener noreferrer">Preview</a>
									</div>
								{{% } %}}
							</div>
						</div>
					</div>
				{{% }); %}}
			{{% } %}}
		</div>

		<div class="clear"></div>

		<div class="so-directory-pages">
			<a class="so-previous button-secondary" data-direction="prev"><?php _e('Previous', 'siteorigin-panels') ?></a>
			<a class="so-next button-secondary" data-direction="next"><?php _e('Next', 'siteorigin-panels') ?></a>
		</div>
	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog-prebuilt-importexport">
	<div class="import-export">
		<div class="import-upload-ui hide-if-no-js">
			<div class="drag-upload-area">

				<h2 class="drag-drop-message"><?php _e('Drop import file here', 'siteorigin-panels'); ?></h2>
				<p class="drag-drop-message"><?php _e('Or', 'siteorigin-panels') ?></p>

				<p class="drag-drop-buttons">
					<input type="button" value="<?php esc_attr_e('Select Import File', 'siteorigin-panels'); ?>" class="file-browse-button button" />
				</p>

				<p class="drag-drop-message js-so-selected-file"></p>

				<div class="progress-bar">
					<div class="progress-percent"></div>
				</div>
			</div>
		</div>

		<div class="export-file-ui">
			<iframe id="siteorigin-panels-export-iframe" style="display: none;" name="siteorigin-panels-export-iframe"></iframe>
			<form action="<?php echo admin_url('admin-ajax.php?action=so_panels_export_layout') ?>" target="siteorigin-panels-export-iframe" class="so-export" method="post">
				<input type="submit" value="<?php esc_attr_e('Download Layout', 'siteorigin-panels') ?>" class="button-primary" />
				<input type="hidden" name="panels_export_data" value="" />
				<?php wp_nonce_field('panels_action', '_panelsnonce') ?>
			</form>
		</div>
	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog-history">
	<div class="dialog-data">

		<h3 class="title"><?php _e('Page Builder Change History', 'siteorigin-panels') ?></h3>

		<div class="left-sidebar">
			<div class="history-entries"></div>
		</div>

		<div class="content">
			<form method="post" action="<?php echo SiteOrigin_Panels::preview_url() ?>" target="siteorigin-panels-history-iframe-{{%= cid %}}" class="history-form">
				<input type="hidden" name="live_editor_panels_data" value="">
				<input type="hidden" name="live_editor_post_ID" value="">
			</form>
			<iframe class="siteorigin-panels-history-iframe" name="siteorigin-panels-history-iframe-{{%= cid %}}" src=""></iframe>
		</div>

		<div class="buttons">
			<input type="button" class="button-primary so-restore" value="<?php esc_attr_e('Restore Version', 'siteorigin-panels') ?>" />
		</div>

	</div>
</script>

<script type="text/template" id="siteorigin-panels-dialog-history-entry">
	<div class="history-entry">
		<h3>{{%= title %}}{{% if( count > 1 ) { %}} <span class="count">({{%= count %}})</span>{{% } %}}</h3>
		<div class="timesince"></div>
	</div>
</script>

<script type="text/template" id="siteorigin-panels-live-editor">
	<div class="so-panels-live-editor">

		<div class="live-editor-collapse">
			<div class="collapse-icon"></div>
		</div>

		<div class="so-sidebar-tools">
			<button
				class="live-editor-save button-primary"
				data-save="<?php esc_html_e('Save Draft', 'siteorigin-panels') ?>"
				data-update="<?php esc_html_e('Update', 'siteorigin-panels') ?>"
			><?php esc_html_e('Update', 'siteorigin-panels') ?></button>
			<button class="live-editor-close button-secondary"><?php esc_html_e('Close', 'siteorigin-panels') ?></button>

			<a class="live-editor-mode live-editor-desktop so-active" title="<?php esc_attr_e( 'Toggle desktop mode', 'siteorigin-panels' ) ?>" data-mode="desktop" data-width="100%" >
				<span class="dashicons dashicons-desktop"></span>
			</a>
			<a class="live-editor-mode live-editor-tablet" title="<?php esc_attr_e( 'Toggle tablet mode', 'siteorigin-panels' ) ?>" data-mode="tablet" data-width="720px">
				<span class="dashicons dashicons-tablet"></span>
			</a>
			<a class="live-editor-mode live-editor-mobile" title="<?php esc_attr_e( 'Toggle mobile mode', 'siteorigin-panels' ) ?>" data-mode="mobile" data-width="320px">
				<span class="dashicons dashicons-smartphone"></span>
			</a>

		</div>

		<div class="so-sidebar">
			<div class="so-live-editor-builder"></div>
		</div>

		<div class="so-preview"></div>

		<div class="so-preview-overlay">
			<div class="so-loading-container"><div class="so-loading-bar"></div></div>
		</div>

	</div>
</script>

<script type="text/template" id="siteorigin-panels-context-menu">
	<div class="so-panels-contextual-menu"></div>
</script>

<script type="text/template" id="siteorigin-panels-context-menu-section">
	<div class="so-section">
		<h5>{{%- settings.sectionTitle %}}</h5>

		{{% if( settings.search ) { %}}
			<div class="so-search-wrapper">
				<input type="text" placeholder="{{%- settings.searchPlaceholder %}}" />
			</div>
		{{% } %}}
		<ul class="so-items">
			{{% for( var k in items ) { %}}
				<li data-key="{{%- k %}}" class="so-item {{% if( !_.isUndefined( items[k].confirm ) && items[k].confirm ) { print( 'so-confirm' ); } %}}">{{%= items[k][settings.titleKey] %}}</li>
			{{% } %}}
		</ul>
		{{% if( settings.search ) { %}}
		<div class="so-no-results">
			<?php _e('No Results', 'siteorigin-panels') ?>
		</div>
		{{% } %}}
	</div>
</script>

<script type="text/template" id="siteorigin-panels-add-layout-block-button">
	<div class="siteorigin-panels-add-layout-block wp-block">
		<button class="components-button is-button is-primary">
			<span class="siteorigin-panels-block-icon white"></span>
			<?php _e( 'Add SiteOrigin Layout Block', 'siteorigin-panels' ) ?>
		</button>
	</div>
</script>
live-editor-preview.php000064400000002453151534501340011164 0ustar00<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
wp_enqueue_style( 'siteorigin-preview-style', siteorigin_panels_url( 'css/live-editor-preview' . SITEORIGIN_PANELS_CSS_SUFFIX . '.css' ), array(), SITEORIGIN_PANELS_VERSION );
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="http://gmpg.org/xfn/11">
	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
	<div id="content" class="site-content">
		<div class="entry-content">
			<?php
			if( !empty( $_POST['live_editor_panels_data'] ) ) {
				$data = json_decode( wp_unslash( $_POST['live_editor_panels_data'] ), true );
				if(
					!empty( $data['widgets'] ) && (
						!class_exists( 'SiteOrigin_Widget_Field_Class_Loader' ) ||
						method_exists( 'SiteOrigin_Widget_Field_Class_Loader', 'extend' )
					)
				) {
					$data['widgets'] = SiteOrigin_Panels_Admin::single()->process_raw_widgets( $data['widgets'], false, false );
				}
				echo siteorigin_panels_render( 'l' . md5( serialize( $data ) ), true, $data);
			}
			?>
		</div><!-- .entry-content -->
	</div>
	<?php wp_footer(); ?>
</body>
</html>
metabox-panels.php000064400000002433151534501340010177 0ustar00<?php
global $post;
$builder_id = uniqid();
$builder_type = apply_filters( 'siteorigin_panels_post_builder_type', 'editor_attached', $post, $panels_data );
$builder_supports = apply_filters( 'siteorigin_panels_builder_supports', array(), $post, $panels_data );
?>

<div id="siteorigin-panels-metabox"
	data-builder-type="<?php echo esc_attr( $builder_type ) ?>"
	data-preview-url="<?php echo $preview_url; ?>"
	data-preview-markup="<?php echo esc_attr( json_encode( $preview_content ) ); ?>"
	data-builder-supports="<?php echo esc_attr( json_encode( $builder_supports ) ) ?>"
	<?php if( !empty( $_GET['so_live_editor'] ) ) echo 'data-live-editor="1"' ?>
	>
	<?php do_action('siteorigin_panels_before_interface') ?>
	<?php wp_nonce_field('save', '_sopanels_nonce') ?>

	<script type="text/javascript">
		( function( builderId, panelsData ){
			// Create the panels_data input
			document.write( '<input name="panels_data" type="hidden" class="siteorigin-panels-data-field" id="panels-data-field-' + builderId + '" />' );
			document.getElementById('panels-data-field-<?php echo esc_attr($builder_id) ?>').value = JSON.stringify( panelsData );
		} )( "<?php echo esc_attr($builder_id) ?>", <?php echo json_encode( $panels_data ); ?> );
	</script>

	<?php do_action('siteorigin_panels_metabox_end'); ?>
</div>
banner/ajax.php000064400000000676151540355030007457 0ustar00<?php
/**
 * @deprecated 3.3 Will only show banner after user manually checked score
 */

namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;

$url = Utility::build_url( Router::ACTION_HEALTH, Health::TYPE_SPEED, true ) ;
$url = htmlspecialchars_decode( $url ) ;
?>
<script>
	document.addEventListener( 'DOMContentLoaded', function( event ) {
		jQuery(document).ready( function() {
			jQuery.get( '<?php echo $url; ?>' ) ;
		} ) ;
	} ) ;
</script>banner/cloud_news.tpl.php000064400000003524151540355030011467 0ustar00<?php
namespace LiteSpeed;

defined( 'WPINC' ) || exit;

?>

<div class="litespeed-wrap notice notice-success litespeed-banner-promo-full">

	<div class="litespeed-banner-promo-content">
		<h3 class="litespeed-banner-title litespeed-top15"><?php echo $this->_summary[ 'news.title' ] ; ?></h3>
		<div class="litespeed-banner-description" style="flex-direction: column;">
			<div class="litespeed-banner-description-padding-right-15">
				<p class="litespeed-banner-description-content">
					<?php echo $this->_summary[ 'news.content' ]; ?>
				</p>
			</div>
			<div class="litespeed-inline">
				<div class="litespeed-banner-description-padding-right-15 litespeed-margin-bottom10">
					<?php if ( ! empty( $this->_summary[ 'news.plugin' ] ) ) : ?>
					<?php $install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array( 'plugin' => $this->_summary[ 'news.plugin' ] ) ); ?>
					<a href="<?php echo $install_link ; ?>" class="button litespeed-btn-success">
						 <?php echo __( 'Install', 'litespeed-cache' ); ?>
						 <?php if ( ! empty( $this->_summary[ 'news.plugin_name' ] ) ) echo $this->_summary[ 'news.plugin_name' ]; ?>
					</a>
					<?php endif; ?>
					<?php if ( ! empty( $this->_summary[ 'news.zip' ] ) ) : ?>
					<?php $install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_ZIP ); ?>
					<a href="<?php echo $install_link ; ?>" class="button litespeed-btn-success">
						 <?php echo __( 'Install', 'litespeed-cache' ); ?>
					</a>
					<?php endif; ?>
				</div>
			</div>
		</div>
	</div>

	<div>
		<?php $dismiss_url = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_DISMISS_RECOMMENDED ) ; ?>
		<span class="screen-reader-text">Dismiss this notice.</span>
		<a href="<?php echo $dismiss_url ; ?>" class="litespeed-notice-dismiss">X</a>
	</div>
</div>
banner/cloud_promo.tpl.php000064400000005267151540355030011655 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

?>

<div class="litespeed-wrap notice notice-success litespeed-banner-promo-qc">

	<div class="litespeed-banner-promo-qc-content">

		<div class="litespeed-banner-promo-qc-description">
			<h2><?php echo __('You just unlocked a promotion from QUIC.cloud!', 'litespeed-cache'); ?></h2>
			<p>
				<?php
				echo sprintf(
					__('Spread the love and earn %s credits to use in our QUIC.cloud online services.', 'litespeed-cache'),
					'<strong>' . $this->_summary['promo'][0]['quota'] . '</strong>'
				); ?></p>
			<p>
				<a class="button button-primary" href="<?php echo $this->_summary['promo'][0]['url']; ?>" target="_blank">
					<?php
					echo sprintf(
						__('Send to twitter to get %s bonus', 'litespeed-cache'),
						$this->_summary['promo'][0]['quota']
					);
					?>
				</a>
				<a href="https://www.quic.cloud/faq/#credit" target="_blank"><?php echo __('Learn more', 'litespeed-cache'); ?></a>
			</p>
		</div>

		<div class="litespeed-banner-promo-qc-preview">
			<h4 class="litespeed-tweet-preview-title"><?php echo __('Tweet preview', 'litespeed-cache'); ?></h4>
			<div class="litespeed-tweet-preview">

				<div class="litespeed-tweet-img"><img src="<?php echo $this->_summary['promo'][0]['image']; ?>"></div>

				<div class="litespeed-tweet-preview-content">
					<p class="litespeed-tweet-text"><?php echo $this->_summary['promo'][0]['content']; ?></p>

					<div class="litespeed-tweet-cta">
						<a href="<?php echo $this->_summary['promo'][0]['url']; ?>" class="litespeed-tweet-btn" target="_blank"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 250 250" xml:space="preserve">
								<path class="st0" d="M78.6,226.6c94.3,0,145.9-78.2,145.9-145.9c0-2.2,0-4.4-0.1-6.6c10-7.3,18.7-16.3,25.6-26.5
								c-9.4,4.1-19.3,6.9-29.5,8.1c10.7-6.4,18.7-16.5,22.5-28.4c-10.1,6-21.1,10.2-32.6,12.4c-19.4-20.7-51.9-21.7-72.6-2.2
								c-13.3,12.5-19,31.2-14.8,49C81.9,84.3,43.4,64.8,17.4,32.8c-13.6,23.4-6.7,53.4,15.9,68.5c-8.2-0.2-16.1-2.4-23.3-6.4
								c0,0.2,0,0.4,0,0.6c0,24.4,17.2,45.4,41.2,50.3c-7.6,2.1-15.5,2.4-23.2,0.9c6.7,20.9,26,35.2,47.9,35.6c-18.2,14.3-40.6,22-63.7,22
								c-4.1,0-8.2-0.3-12.2-0.7C23.5,218.6,50.7,226.6,78.6,226.6" />
							</svg>
							<?php echo __('Tweet this', 'litespeed-cache'); ?>
						</a>
					</div>
				</div>

			</div>

		</div>
	</div>

	<div>
		<?php $dismiss_url = Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_CLEAR_PROMO); ?>
		<span class="screen-reader-text"><?php echo __('Dismiss this notice', 'litespeed-cache'); ?>.</span>
		<a href="<?php echo $dismiss_url; ?>" class="litespeed-notice-dismiss">X</a>
	</div>
</div>banner/new_version.php000064400000006562151540355030011072 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

/**
 * NOTE: Only show for single site
 */
if (is_multisite()) {
	return;
}

if ($this->conf(Base::O_AUTO_UPGRADE)) {
	return;
}

$current = get_site_transient('update_plugins');
if (!isset($current->response[Core::PLUGIN_FILE])) {
	return;
}

$last_check = empty($this->_summary['new_version.last_check']) ? 0 : $this->_summary['new_version.last_check'];
// Check once in a half day
if (time() - $last_check > 43200) {
	GUI::save_summary(array('new_version.last_check' => time()));

	// Detect version
	$auto_v = Cloud::version_check('new_version_banner');
	if (!empty($auto_v['latest'])) {
		GUI::save_summary(array('new_version.v' => $auto_v['latest']));
	}
	// After detect, don't show, just return and show next time
	return;
}

if (!isset($this->_summary['new_version.v'])) {
	return;
}

// Check if current version is newer than auto_v or not
if (version_compare(Core::VER, $this->_summary['new_version.v'], '>=')) {
	return;
}

//********** Can show now **********//

$this->_promo_true = true;

if ($check_only) {
	return;
}

?>
<div class="litespeed-wrap notice notice-success litespeed-banner-promo-full">
	<div class="litespeed-banner-promo-logo"></div>

	<div class="litespeed-banner-promo-content">
		<h3 class="litespeed-banner-title litespeed-top15"><?php echo __('LiteSpeed Cache', 'litespeed-cache'); ?>: <?php echo __('New Version Available!', 'litespeed-cache'); ?></h3>
		<div class="litespeed-banner-description">
			<div class="litespeed-banner-description-padding-right-15">
				<p class="litespeed-banner-description-content">
					<?php echo sprintf(__('New release %s is available now.', 'litespeed-cache'), 'v' . $this->_summary['new_version.v']); ?>
				</p>
			</div>
			<div class="litespeed-row-flex litespeed-banner-description">
				<div class="litespeed-banner-description-padding-right-15">
					<?php $url = Utility::build_url(Router::ACTION_ACTIVATION, Activation::TYPE_UPGRADE); ?>
					<a href="<?php echo $url; ?>" class="button litespeed-btn-success litespeed-btn-mini">
						<i class="dashicons dashicons-image-rotate">&nbsp;</i>
						<?php echo __('Upgrade', 'litespeed-cache'); ?>
					</a>
				</div>
				<div class="litespeed-banner-description-padding-right-15">
					<?php
					$cfg = array(Conf::TYPE_SET . '[' . Base::O_AUTO_UPGRADE . ']' => 1);
					$url = Utility::build_url(Router::ACTION_CONF, Conf::TYPE_SET, false, null, $cfg);
					?>
					<a href="<?php echo $url; ?>" class="button litespeed-btn-primary litespeed-btn-mini">
						<i class="dashicons dashicons-update">&nbsp;</i>
						<?php echo __('Turn On Auto Upgrade', 'litespeed-cache'); ?>
					</a>
				</div>
				<div class="litespeed-banner-description-padding-right-15">
					<?php $url = Utility::build_url(Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PROMO, false, null, array('promo_tag' => 'new_version')); ?>
					<a href="<?php echo $url; ?>" class="button litespeed-btn-warning litespeed-btn-mini">
						<?php echo __('Maybe Later', 'litespeed-cache'); ?>
					</a>
				</div>
			</div>
		</div>
	</div>

	<div>
		<?php $dismiss_url = Utility::build_url(Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PROMO, false, null, array('promo_tag' => 'new_version', 'later' => 1)); ?>
		<span class="screen-reader-text"><?php _e('Dismiss this notice.', 'litespeed-cache'); ?></span>
		<a href="<?php echo $dismiss_url; ?>" class="litespeed-notice-dismiss">X</a>
	</div>
</div>banner/new_version_dev.tpl.php000064400000002416151540355030012520 0ustar00<?php
namespace LiteSpeed;

defined( 'WPINC' ) || exit;

?>

<div class="litespeed-wrap notice notice-warning litespeed-banner-promo-full">
	<div class="litespeed-banner-promo-logo"></div>

	<div class="litespeed-banner-promo-content">
		<h3 class="litespeed-banner-title litespeed-top15"><?php echo __( 'LiteSpeed Cache', 'litespeed-cache' ) ; ?>: <?php echo __( 'New Developer Version Available!', 'litespeed-cache' ) ; ?></h3>
		<div class="litespeed-banner-description">
			<div class="litespeed-banner-description-padding-right-15">
				<p class="litespeed-banner-description-content">
					<?php echo sprintf( __( 'New developer version %s is available now.', 'litespeed-cache' ), 'v' . $this->_summary[ 'version.dev' ] ) ; ?>
				</p>
			</div>
			<div class="litespeed-row-flex litespeed-banner-description">
				<div class="litespeed-banner-description-padding-right-15">
					<?php $url = Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_BETA_TEST, false, null, array( Debug2::BETA_TEST_URL => 'dev' ) ) ; ?>
					<a href="<?php echo $url ; ?>" class="button litespeed-btn-success litespeed-btn-mini">
						<i class="dashicons dashicons-image-rotate">&nbsp;</i>
						 <?php echo __( 'Upgrade', 'litespeed-cache' ) ; ?>
					</a>
				</div>
			</div>
		</div>
	</div>

</div>
banner/score.php000064400000014221151540355030007636 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$health_scores = Health::cls()->scores();

// If speed is not reduced half or score is larger
if ( $health_scores[ 'speed_before' ] <= $health_scores[ 'speed_after' ] * 2 || $health_scores[ 'score_before' ] >= $health_scores[ 'score_after' ] ) {
	return;
}

//********** Can show now **********//
$this->_promo_true = true;

if ( $check_only ) {
	return;
}

?>
<div class="litespeed-wrap notice notice-info litespeed-banner-promo-full">
	<div class="litespeed-banner-promo-logo"></div>

	<div class="litespeed-banner-promo-content">
		<h3 class="litespeed-banner-title litespeed-banner-promo-content"><?php echo __( 'Thank You for Using the LiteSpeed Cache Plugin!', 'litespeed-cache' ); ?></h3>

		<div class="litespeed-row-flex litespeed-banner-promo-content litespeed-margin-left-remove litespeed-flex-wrap">
			<div class="litespeed-right50 litespeed-margin-bottom20">
				<h2 class="litespeed-text-grey litespeed-margin-bottom-remove litespeed-top10"><?php echo __( 'Page Load Time', 'litespeed-cache' ); ?></h2>
				<hr class="litespeed-margin-bottom-remove" />
				<div class="litespeed-row-flex" style="margin-left: -10px;">
					<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
						<div>
							<p class="litespeed-text-grey litespeed-margin-y-remove">
                                <?php echo __( 'Before', 'litespeed-cache' ); ?>
							</p>
						</div>
						<div class="litespeed-top10 litespeed-text-jumbo litespeed-text-grey">
							<?php echo $health_scores[ 'speed_before' ]; ?><span class="litespeed-text-large">s</span>
						</div>

					</div>
					<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
						<div>
							<p class="litespeed-text-grey litespeed-margin-y-remove">
                                <?php echo __( 'After', 'litespeed-cache' ); ?>
							</p>
						</div>
						<div class="litespeed-top10 litespeed-text-jumbo litespeed-success">
							<?php echo $health_scores[ 'speed_after' ]; ?><span class="litespeed-text-large">s</span>
						</div>
					</div>
					<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
						<div>
							<p class="litespeed-text-grey litespeed-margin-y-remove" style="white-space: nowrap;">
                                <?php echo __( 'Improved by', 'litespeed-cache' ); ?>
							</p>
						</div>
						<div class="litespeed-top10 litespeed-text-jumbo litespeed-text-fern">
							<?php echo $health_scores[ 'speed_improved' ]; ?><span class="litespeed-text-large">%</span>
						</div>
					</div>
				</div>

			</div>

			<?php if ( $health_scores[ 'score_before' ] < $health_scores[ 'score_after' ] ) : ?>
			<div class="litespeed-margin-bottom20">
				<h2 class="litespeed-text-grey litespeed-margin-bottom-remove litespeed-top10"><?php echo __( 'PageSpeed Score', 'litespeed-cache' ); ?></h2>
				<hr class="litespeed-margin-bottom-remove" />
				<div class="litespeed-row-flex" style="margin-left: -10px;">
					<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
						<div>
							<p class="litespeed-text-grey litespeed-text-center litespeed-margin-y-remove">
                                <?php echo __( 'Before', 'litespeed-cache' ); ?>
							</p>
						</div>
						<div class="litespeed-promo-score" style="margin-top:-5px;">
							<?php echo GUI::pie( $health_scores[ 'score_before' ], 45, false, true, 'litespeed-pie-' . $this->get_cls_of_pagescore( $health_scores[ 'score_before' ] ) ); ?>
						</div>
					</div>
					<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
						<div>
							<p class="litespeed-text-grey litespeed-text-center litespeed-margin-y-remove">
                                <?php echo __( 'After', 'litespeed-cache' ); ?>
							</p>
						</div>
						<div class="litespeed-promo-score" style="margin-top:-5px;">
							<?php echo GUI::pie( $health_scores[ 'score_after' ], 45, false, true, 'litespeed-pie-' . $this->get_cls_of_pagescore( $health_scores[ 'score_after' ] ) ); ?>
						</div>
					</div>
					<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
						<div>
							<p class="litespeed-text-grey litespeed-margin-y-remove" style="white-space: nowrap;">
                                <?php echo __( 'Improved by', 'litespeed-cache' ); ?>
							</p>
						</div>
						<div class="litespeed-top10 litespeed-text-jumbo litespeed-text-fern">
							<?php echo $health_scores[ 'score_improved' ]; ?><span class="litespeed-text-large">%</span>
						</div>
					</div>
				</div>

			</div>
			<?php endif; ?>

		</div>

		<div class="litespeed-row-flex litespeed-flex-wrap litespeed-margin-y5">
			<div class="litespeed-banner-description-padding-right-15">

				<a href="https://wordpress.org/support/plugin/litespeed-cache/reviews/?filter=5#new-post" target="_blank" style="text-decoration: none;">
					<button class="button litespeed-btn-success litespeed-btn-mini">
						<?php echo __( 'Sure I\'d love to review!', 'litespeed-cache' ); ?>
						⭐⭐⭐⭐⭐
					</button>
				</a>
				<button type="button" class="button litespeed-btn-primary litespeed-btn-mini" id="litespeed-promo-done"> <?php echo __( 'I\'ve already left a review', 'litespeed-cache' ); ?></button>
				<button type="button" class="button litespeed-btn-warning litespeed-btn-mini" id="litespeed-promo-later"> <?php echo __( 'Maybe later', 'litespeed-cache' ); ?></button>
			</div>
			<div>
				<p class="litespeed-text-small">
					<?php echo __( 'Created with ❤️  by LiteSpeed team.', 'litespeed-cache' ); ?>
					<?php echo sprintf(
						__( '<a %s>Support forum</a> | <a %s>Submit a ticket</a>', 'litespeed-cache' ),
						'href="https://wordpress.org/support/plugin/litespeed-cache" target="_blank"',
						'href="https://www.litespeedtech.com/support" target="_blank"'
					); ?>
				</p>
			</div>
		</div>
	</div>

	<div>
		<?php $dismiss_url = Utility::build_url( Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PROMO, false, null, array( 'promo_tag' => 'score', 'later' => 1 ) ); ?>
		<span class="screen-reader-text">Dismiss this notice.</span>
		<a href="<?php echo $dismiss_url; ?>" class="litespeed-notice-dismiss">X</a>
	</div>

</div>banner/slack.php000064400000003363151540355030007625 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;
?>
<div class="litespeed-wrap notice notice-info litespeed-banner-promo-full" id="litespeed-banner-promo-slack">
	<div class="litespeed-banner-promo-logo"></div>

	<div class="litespeed-banner-promo-content">
		<h3 class="litespeed-banner-title"><?php echo __( 'Welcome to LiteSpeed', 'litespeed-cache' ) ; ?></h3>
		<div class="litespeed-banner-description">
			<div class="litespeed-banner-description-padding-right-15">
				<p class="litespeed-banner-description-content">
					<?php echo __( 'Want to connect with other LiteSpeed users?', 'litespeed-cache' ) ; ?>
					<?php echo sprintf( __( 'Join the %s community.', 'litespeed-cache' ), '<a href="https://join.slack.com/t/golitespeed/shared_invite/enQtMzE5ODgxMTUyNTgzLTNiNWQ1MWZlYmI4YjEzNTM4NjdiODY2YTQ0OWVlMzBlNGZkY2E3Y2E4MjIzNmNmZmU0ZjIyNWM1ZmNmMWRlOTk" target="_blank" class="litespeed-banner-promo-slack-textlink">LiteSpeed Slack</a>' ) ; ?>
				</p>
				<p class="litespeed-banner-promo-slack-line2">
					golitespeed.slack.com
				</p>
			</div>
			<div>
				<h3 class="litespeed-banner-button-link">
					<a href="https://join.slack.com/t/golitespeed/shared_invite/enQtMzE5ODgxMTUyNTgzLTNiNWQ1MWZlYmI4YjEzNTM4NjdiODY2YTQ0OWVlMzBlNGZkY2E3Y2E4MjIzNmNmZmU0ZjIyNWM1ZmNmMWRlOTk" target="_blank">
						<?php echo __( 'Join Us on Slack', 'litespeed-cache' ) ; ?>
					</a>
				</h3>
			</div>
		</div>
	</div>
	<div>
		<?php $dismiss_url = Utility::build_url( Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PROMO, false, null, array( 'promo_tag' => 'slack' ) ) ; ?>
		<span class="screen-reader-text">Dismiss this notice.</span>
		<a href="<?php echo $dismiss_url; ?>" class="litespeed-notice-dismiss">
			<?php _e('Dismiss', 'litespeed-cache'); ?>
		</a>
	</div>
</div>cache/entry.tpl.php000064400000004172151540355030010264 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$menu_list = array(
	'cache' 	=> __( 'Cache', 'litespeed-cache' ),
	'ttl' 		=> __( 'TTL', 'litespeed-cache' ),
	'purge' 	=> __( 'Purge', 'litespeed-cache' ),
	'excludes' 	=> __( 'Excludes', 'litespeed-cache' ),
	'esi' 		=> __( 'ESI', 'litespeed-cache' ),
);

if ( ! $this->_is_multisite ) {
	$menu_list[ 'object' ] = __( 'Object', 'litespeed-cache' );
	$menu_list[ 'browser' ] = __( 'Browser', 'litespeed-cache' );
}

$menu_list[ 'advanced' ] = __( 'Advanced', 'litespeed-cache' );

/**
 * Generate rules for setting usage
 * @since 1.6.2
 */
global $wp_roles;
if ( !isset( $wp_roles ) ) {
	$wp_roles = new \WP_Roles();
}

$roles = array();
foreach ( $wp_roles->roles as $k => $v ) {
	$roles[ $k ] = $v[ 'name' ];
}
ksort( $roles );

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __('LiteSpeed Cache Settings', 'litespeed-cache'); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>
<div class="litespeed-wrap">
	<h2 class="litespeed-header nav-tab-wrapper">
	<?php
		$i = 1;
		$accesskey_set = array();
		foreach ( $menu_list as $tab => $val ) {
			$accesskey = '';
			if ( $i <= 9 ) {
				$accesskey = "litespeed-accesskey='$i'";
			}
			else {
				$tmp = strtoupper( substr( $tab, 0, 1 ) );
				if ( ! in_array( $tmp, $accesskey_set ) ) {
					$accesskey_set[] = $tmp;
					$accesskey = "litespeed-accesskey='$tmp'";
				}
			}

			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
			$i ++;
		}
		do_action( 'litespeed_settings_tab', 'cache' );
	?>
	</h2>

	<div class="litespeed-body">
		<?php $this->cache_disabled_warning(); ?>

	<?php
	$this->form_action();

	require LSCWP_DIR . "tpl/inc/check_if_network_disable_all.php";
	require LSCWP_DIR . "tpl/cache/more_settings_tip.tpl.php";

	// include all tpl for faster UE
	foreach ( $menu_list as $tab => $val ) {
		echo "<div data-litespeed-layout='$tab'>";
		require LSCWP_DIR . "tpl/cache/settings-$tab.tpl.php";
		echo "</div>";
	}

	do_action( 'litespeed_settings_content', 'cache' );

	$this->form_end();

	?>
	</div>
</div>
cache/entry_network.tpl.php000064400000002474151540355030012040 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$menuArr = array(
	'cache' 	=> __( 'Cache', 'litespeed-cache' ),
	'purge' 	=> __( 'Purge', 'litespeed-cache' ),
	'excludes' 	=> __( 'Excludes', 'litespeed-cache' ),
	'object' 	=> __( 'Object', 'litespeed-cache' ),
	'browser'	=> __( 'Browser', 'litespeed-cache' ),
	'advanced' 	=> __( 'Advanced', 'litespeed-cache' ),
);

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __('LiteSpeed Cache Network Cache Settings', 'litespeed-cache'); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">
	<h2 class="litespeed-header nav-tab-wrapper">
	<?php
		$i = 1;
		foreach ($menuArr as $tab => $val){
			$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
			$i ++;
		}
	?>
	</h2>
	<div class="litespeed-body">
		<?php $this->cache_disabled_warning(); ?>

		<?php
		$this->form_action( Router::ACTION_SAVE_SETTINGS_NETWORK );

		// include all tpl for faster UE
		foreach ($menuArr as $tab => $val) {
			echo "<div data-litespeed-layout='$tab'>";
			require LSCWP_DIR . "tpl/cache/network_settings-$tab.tpl.php";
			echo "</div>";
		}

		$this->form_end( true );

		?>
	</div>
</div>
cache/more_settings_tip.tpl.php000064400000000663151540355030012662 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

global $pagenow;
if ( $pagenow != 'options-general.php' ) {
	return;
}
?>
	<div class="litespeed-callout notice notice-success inline">

		<h4><?php echo __( 'NOTE', 'litespeed-cache' ); ?></h4>

		<p>
			<?php echo sprintf( __( 'More settings available under %s menu', 'litespeed-cache' ), '<code>' . __( 'LiteSpeed Cache', 'litespeed-cache' ) . '</code>' ); ?>
		</p>

	</div>
cache/network_settings-advanced.tpl.php000064400000000641151540355030014274 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'Advanced Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#advanced-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>

<?php
	require LSCWP_DIR . 'tpl/cache/settings_inc.login_cookie.tpl.php';
?>

</tbody></table>

cache/network_settings-browser.tpl.php000064400000000166151540355030014214 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

require LSCWP_DIR . 'tpl/cache/settings_inc.browser.tpl.php';
cache/network_settings-cache.tpl.php000064400000002212151540355030013566 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __('Cache Control Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cache/'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th><?php echo __('Network Enable Cache', 'litespeed-cache'); ?></th>
			<td>
				<?php $this->build_switch(Base::O_CACHE); ?>
				<div class="litespeed-desc">
					<?php echo __('Enabling LiteSpeed Cache for WordPress here enables the cache for the network.', 'litespeed-cache'); ?><br />
					<?php echo __('It is <b>STRONGLY</b> recommend that the compatibility with other plugins on a single/few sites is tested first.', 'litespeed-cache'); ?>
					<?php echo __('This is to ensure compatibility prior to enabling the cache for all sites.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<?php
		require LSCWP_DIR . 'tpl/cache/settings_inc.cache_resources.tpl.php';
		require LSCWP_DIR . 'tpl/cache/settings_inc.cache_mobile.tpl.php';
		require LSCWP_DIR . 'tpl/cache/settings_inc.cache_dropquery.tpl.php';
		?>

	</tbody>
</table>cache/network_settings-excludes.tpl.php000064400000001007151540355030014340 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'Exclude Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#excludes-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>

<?php
	// Cookie
	require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_cookies.tpl.php';

	// User Agent
	require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_useragent.tpl.php';
?>

</tbody></table>

cache/network_settings-object.tpl.php000064400000000165151540355030013776 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

require LSCWP_DIR . 'tpl/cache/settings_inc.object.tpl.php';
cache/network_settings-purge.tpl.php000064400000000637151540355030013656 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'Purge Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#purge-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>

<?php
	require LSCWP_DIR . 'tpl/cache/settings_inc.purge_on_upgrade.tpl.php';
?>

</tbody></table>

cache/settings-advanced.tpl.php000064400000004423151540355030012525 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __('Advanced Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cache/#advanced-tab'); ?>
</h3>

<div class="litespeed-callout notice notice-warning inline">
	<h4><?php echo __('NOTICE:', 'litespeed-cache'); ?></h4>
	<p><?php echo __('These settings are meant for ADVANCED USERS ONLY.', 'litespeed-cache'); ?></p>
</div>

<table class="wp-list-table striped litespeed-table">
	<tbody>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_AJAX_TTL; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<div class="litespeed-textarea-recommended">
					<div>
						<?php $this->build_textarea($id, 60); ?>
					</div>
				</div>
				<div class="litespeed-desc">
					<?php echo __('Specify an AJAX action in POST/GET and the number of seconds to cache that request, separated by a space.', 'litespeed-cache'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<?php
		if (!$this->_is_multisite) :
			require LSCWP_DIR . 'tpl/cache/settings_inc.login_cookie.tpl.php';
		endif;
		?>

		<tr>
			<th>
				<?php $id = Base::O_UTIL_NO_HTTPS_VARY; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Enable this option if you are using both HTTP and HTTPS in the same domain and are noticing cache irregularities.', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cache/#improve-httphttps-compatibility'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_UTIL_INSTANT_CLICK; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('When a visitor hovers over a page link, preload that page. This will speed up the visit to that link.', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cache/#instant-click'); ?>
					<br />
					<font class="litespeed-danger">
						⚠️
						<?php echo __('This will generate extra requests to the server, which will increase server load.', 'litespeed-cache'); ?>
					</font>

				</div>
			</td>
		</tr>

	</tbody>
</table>cache/settings-browser.tpl.php000064400000000166151540355030012443 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

require LSCWP_DIR . 'tpl/cache/settings_inc.browser.tpl.php';
cache/settings-cache.tpl.php000064400000012132151540355030012017 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __('Cache Control Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cache/'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th>
				<?php $id = Base::O_CACHE; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php if ($this->_is_multisite) : ?>
					<?php $this->build_switch($id, array(__('OFF', 'litespeed-cache'), __('ON', 'litespeed-cache'), __('Use Network Admin Setting', 'litespeed-cache'))); ?>
				<?php else : ?>
					<?php $this->build_switch($id); ?>
				<?php endif; ?>
				<div class="litespeed-desc">
					<?php echo sprintf(
						__('Please visit the <a %s>Information</a> page on how to test the cache.', 'litespeed-cache'),
						'href="https://docs.litespeedtech.com/lscache/lscwp/installation/#testing" target="_blank"'
					); ?>

					<strong><?php echo __('NOTICE', 'litespeed-cache'); ?>: </strong><?php echo __('When disabling the cache, all cached entries for this site will be purged.', 'litespeed-cache'); ?>

					<?php if ($this->_is_multisite) : ?>
						<br><?php echo __('The network admin setting can be overridden here.', 'litespeed-cache'); ?>
					<?php endif; ?>

					<?php if (!$this->conf(Base::O_CACHE) && $this->conf(Base::O_CDN_QUIC)) : ?>
						<br>
						<font class="litespeed-success"><?php echo __('With QUIC.cloud CDN enabled, you may still be seeing cache headers from your local server.', 'litespeed-cache'); ?></font>
					<?php endif; ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_PRIV; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Privately cache frontend pages for logged-in users. (LSWS %s required)', 'litespeed-cache'), 'v5.2.1+'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_COMMENTER; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Privately cache commenters that have pending comments. Disabling this option will serve non-cacheable pages to commenters. (LSWS %s required)', 'litespeed-cache'), 'v5.2.1+'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_REST; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Cache requests made by WordPress REST API calls.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_PAGE_LOGIN; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Disabling this option may negatively affect performance.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<?php
		if (!$this->_is_multisite) :
			require LSCWP_DIR . 'tpl/cache/settings_inc.cache_resources.tpl.php';
			require LSCWP_DIR . 'tpl/cache/settings_inc.cache_mobile.tpl.php';
		endif;
		?>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_PRIV_URI; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('URI Paths containing these strings will NOT be cached as public.', 'litespeed-cache'); ?>
					<?php $this->_uri_usage_example(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_FORCE_URI; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Paths containing these strings will be cached regardless of no-cacheable settings.', 'litespeed-cache'); ?>
					<?php $this->_uri_usage_example(); ?>
					<br /><?php echo __('To define a custom TTL for a URI, add a space followed by the TTL value to the end of the URI.', 'litespeed-cache'); ?>
					<?php echo sprintf(__('For example, %1$s defines a TTL of %2$s seconds for %3$s.', 'litespeed-cache'), '<code>/mypath/mypage 300</code>', 300, '<code>/mypath/mypage</code>'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_FORCE_PUB_URI; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Paths containing these strings will be forced to public cached regardless of no-cacheable settings.', 'litespeed-cache'); ?>
					<?php $this->_uri_usage_example(); ?>
					<br /><?php echo __('To define a custom TTL for a URI, add a space followed by the TTL value to the end of the URI.', 'litespeed-cache'); ?>
					<?php echo sprintf(__('For example, %1$s defines a TTL of %2$s seconds for %3$s.', 'litespeed-cache'), '<code>/mypath/mypage 300</code>', 300, '<code>/mypath/mypage</code>'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<?php
		if (!$this->_is_multisite) :
			require LSCWP_DIR . 'tpl/cache/settings_inc.cache_dropquery.tpl.php';
		endif;
		?>

	</tbody>
</table>cache/settings-esi.tpl.php000064400000013133151540355030011536 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'ESI Settings', 'litespeed-cache' ) ; ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#esi-tab' ); ?>
</h3>

<div class="litespeed-description">
	<p><?php echo __( 'With ESI (Edge Side Includes), pages may be served from cache for logged-in users.', 'litespeed-cache' ) ; ?></p>
	<p><?php echo __( 'ESI allows you to designate parts of your dynamic page as separate fragments that are then assembled together to make the whole page. In other words, ESI lets you “punch holes” in a page, and then fill those holes with content that may be cached privately, cached publicly with its own TTL, or not cached at all.', 'litespeed-cache' ) ; ?>
		<?php Doc::learn_more( 'https://blog.litespeedtech.com/2017/08/30/wpw-private-cache-vs-public-cache/', __( 'WpW: Private Cache vs. Public Cache', 'litespeed-cache' ) ); ?>
	</p>
	<p>
		💡:
		<?php echo __( 'You can turn shortcodes into ESI blocks.', 'litespeed-cache' ) ; ?>
		<?php echo sprintf(
			__( 'Replace %1$s with %2$s.', 'litespeed-cache' ),
			'<code>[shortcodeA att1="val1" att2="val2"]</code>',
			'<code>[esi shortcodeA att1="val1" att2="val2"]</code>'
		) ; ?>
		<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/admin/#turning-wordpress-shortcodes-into-esi-blocks' ); ?>
	</p>
	<p>
		<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/api/#generate-esi-block-url', __( 'ESI sample for developers', 'litespeed-cache' ) ); ?>
	</p>
</div>

<div class="litespeed-relative">

<?php if ( ! LSWCP_ESI_SUPPORT && ! $this->conf( Base::O_CDN_QUIC ) ) : ?>
	<div class="litespeed-callout-danger">
		<h4><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?></h4>
		<h4><?php echo __( 'These options are only available with LiteSpeed Enterprise Web Server or QUIC.cloud CDN.', 'litespeed-cache' ); ?></h4>
	</div>
<?php endif; ?>

<table class="wp-list-table striped litespeed-table"><tbody>
	<tr>
		<th>
			<?php $id = Base::O_ESI ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_switch( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Turn ON to cache public pages for logged in users, and serve the Admin Bar and Comment Form via ESI blocks. These two blocks will be uncached unless enabled below.', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_ESI_CACHE_ADMBAR ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_switch( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo __(' Cache the built-in Admin Bar ESI block.', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_ESI_CACHE_COMMFORM ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_switch( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Cache the built-in Comment Form ESI block.', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_ESI_NONCE ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<div class="litespeed-row-flex">
				<div class="">
					<?php $this->build_textarea( $id ) ; ?>
				</div>
				<div class="litespeed-width-3-10">
					<p class="litespeed-desc">
						<?php echo __( 'The list will be merged with the predefined nonces in your local data file.', 'litespeed-cache' ); ?>
						<?php echo __( 'The latest data file is', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/master/data/esi.nonces.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/master/data/esi.nonces.txt</a>
						<br /><font class="litespeed-success">
							<?php echo __( 'API', 'litespeed-cache' ); ?>:
							<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_esi_nonces</code>' ); ?>
						</font>
					</p>
				</div>
			</div>
			<div class="litespeed-desc">
				<?php echo __( 'The above nonces will be converted to ESI automatically.', 'litespeed-cache' ); ?>
				<?php Doc::one_per_line(); ?>
				<br /><?php echo __( 'An optional second parameter may be used to specify cache control. Use a space to separate', 'litespeed-cache' ); ?>: <code>my_nonce_action private</code>
			</div>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Wildcard %1$s supported (match zero or more characters). For example, to match %2$s and %3$s, use %4$s.', 'litespeed-cache' ), '<code>*</code>', '<code>nonce_formid_1</code>', '<code>nonce_formid_3</code>', '<code>nonce_formid_*</code>' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_VARY_GROUP ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<table class="litespeed-vary-table wp-list-table striped litespeed-table form-table"><tbody>
			<?php foreach ( $roles as $role => $title ): ?>
				<tr>
					<td class='litespeed-vary-title'><?php echo $title ; ?></td>
					<td class='litespeed-vary-val'>
					<?php
						$this->build_input(
							$id . '[' . $role . ']',
							'litespeed-input-short',
							$this->cls( 'Vary' )->in_vary_group( $role )
						);
					?>
					</td>
				</tr>
			<?php endforeach; ?>
			</tbody></table>
			<div class="litespeed-desc">
				<?php echo __( 'If your site contains public content that certain user roles can see but other roles cannot, you can specify a Vary Group for those user roles. For example, specifying an administrator vary group allows there to be a separate publicly-cached page tailored to administrators (with “edit” links, etc), while all other user roles see the default public page.', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>

</tbody></table>

</div>
cache/settings-excludes.tpl.php000064400000010536151540355030012576 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __('Exclude Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cache/#excludes-tab'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_EXC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Paths containing these strings will not be cached.', 'litespeed-cache'); ?>
					<?php $this->_uri_usage_example(); ?>
					<br /><?php echo __('Predefined list will also be combined w/ the above settings', 'litespeed-cache'); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/cache_nocacheable.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/cache_nocacheable.txt</a>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_EXC_QS; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Query strings containing these parameters will not be cached.', 'litespeed-cache'); ?>
					<?php echo sprintf(__('For example, for %s, %s and %s can be used here.', 'litespeed-cache'), '<code>?aa=bb&cc=dd</code>', '<code>aa</code>', '<code>cc</code>'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_EXC_CAT; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php
				$excludes_buf = '';
				if ($this->conf($id)) {
					$excludes_buf = implode("\n", array_map('get_cat_name', $this->conf($id)));
				}
				$this->build_textarea($id, false, $excludes_buf);
				?>
				<div class="litespeed-desc">
					<b><?php echo __('All categories are cached by default.', 'litespeed-cache'); ?></b>
					<?php echo sprintf(__('To prevent %s from being cached, enter them here.', 'litespeed-cache'), __('categories', 'litespeed-cache')); ?>
					<?php Doc::one_per_line(); ?>
				</div>
				<div class="litespeed-callout notice notice-warning inline">
					<h4><?php echo __('NOTE', 'litespeed-cache'); ?>:</h4>
					<ol>
						<li><?php echo __('If the category name is not found, the category will be removed from the list on save.', 'litespeed-cache'); ?></li>
					</ol>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_EXC_TAG; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php
				$excludes_buf = '';
				if ($this->conf($id)) {
					$tag_names = array();
					foreach (array_map('get_tag', $this->conf($id)) as $tag) {
						$tag_names[] = $tag->name;
					}
					if (!empty($tag_names)) {
						$excludes_buf = implode("\n", $tag_names);
					}
				}
				$this->build_textarea($id, false, $excludes_buf);
				?>
				<div class="litespeed-desc">
					<b><?php echo __('All tags are cached by default.', 'litespeed-cache'); ?></b>
					<?php echo sprintf(__('To prevent %s from being cached, enter them here.', 'litespeed-cache'), __('tags', 'litespeed-cache')); ?>
					<?php Doc::one_per_line(); ?>
				</div>
				<div class="litespeed-callout notice notice-warning inline">
					<h4><?php echo __('NOTE', 'litespeed-cache'); ?>:</h4>
					<ol>
						<li><?php echo __('If the tag slug is not found, the tag will be removed from the list on save.', 'litespeed-cache'); ?></li>
						<li><?php echo sprintf(
								__('To exclude %1$s, insert %2$s.', 'litespeed-cache'),
								'<code>http://www.example.com/tag/category/tag-slug/</code>',
								'<code>tag-slug</code>'
							); ?></li>
					</ol>
				</div>
			</td>
		</tr>

		<?php
		if (!$this->_is_multisite) :
			// Cookie
			require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_cookies.tpl.php';

			// User Agent
			require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_useragent.tpl.php';

		endif;
		?>

		<tr>
			<th>
				<?php $id = Base::O_CACHE_EXC_ROLES; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<div class="litespeed-desc">
					<?php echo __('Selected roles will be excluded from cache.', 'litespeed-cache'); ?>
				</div>
				<div class="litespeed-tick-list">
					<?php foreach ($roles as $role => $title) : ?>
						<?php $this->build_checkbox($id . '[]', $title, Control::cls()->in_cache_exc_roles($role), $role); ?>
					<?php endforeach; ?>
				</div>

			</td>
		</tr>

	</tbody>
</table>cache/settings-object.tpl.php000064400000000165151540355030012225 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

require LSCWP_DIR . 'tpl/cache/settings_inc.object.tpl.php';
cache/settings-purge.tpl.php000064400000013551151540355030012104 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'Purge Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#purge-tab' ); ?>
</h3>

<?php
$option_list = array(
	Base::O_PURGE_POST_ALL => __( 'All pages', 'litespeed-cache' ),
	Base::O_PURGE_POST_FRONTPAGE => __( 'Front page', 'litespeed-cache' ),
	Base::O_PURGE_POST_HOMEPAGE => __( 'Home page', 'litespeed-cache' ),
	Base::O_PURGE_POST_PAGES => __( 'Pages', 'litespeed-cache' ),

	Base::O_PURGE_POST_PAGES_WITH_RECENT_POSTS => __( 'All pages with Recent Posts Widget', 'litespeed-cache' ),

	Base::O_PURGE_POST_AUTHOR => __( 'Author archive', 'litespeed-cache' ),
	Base::O_PURGE_POST_POSTTYPE => __( 'Post type archive', 'litespeed-cache' ),

	Base::O_PURGE_POST_YEAR => __( 'Yearly archive', 'litespeed-cache' ),
	Base::O_PURGE_POST_MONTH => __( 'Monthly archive', 'litespeed-cache' ),
	Base::O_PURGE_POST_DATE => __( 'Daily archive', 'litespeed-cache' ),

	Base::O_PURGE_POST_TERM => __( 'Term archive (include category, tag, and tax)', 'litespeed-cache' ),
);

// break line at these ids
$break_arr = array(
	Base::O_PURGE_POST_PAGES,
	Base::O_PURGE_POST_PAGES_WITH_RECENT_POSTS,
	Base::O_PURGE_POST_POSTTYPE,
	Base::O_PURGE_POST_DATE,
);

?>

<table class="wp-list-table striped litespeed-table"><tbody>

	<?php if ( ! $this->_is_multisite ) : ?>
		<?php require LSCWP_DIR . 'tpl/cache/settings_inc.purge_on_upgrade.tpl.php'; ?>
	<?php endif; ?>

	<tr>
		<th><?php echo __( 'Auto Purge Rules For Publish/Update', 'litespeed-cache' ); ?></th>
		<td>
			<div class="litespeed-callout notice notice-warning inline">
				<h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
				<p>
					<?php echo __( 'Select "All" if there are dynamic widgets linked to posts on pages other than the front or home pages.', 'litespeed-cache' ); ?><br />
					<?php echo __( 'Other checkboxes will be ignored.', 'litespeed-cache' ); ?><br />
					<?php echo __( 'Select only the archive types that are currently used, the others can be left unchecked.', 'litespeed-cache' ); ?>
				</p>
			</div>
			<div class="litespeed-top20">
				<div class="litespeed-tick-wrapper">
					<?php
						foreach ( $option_list as $id => $title ) {

							$this->build_checkbox( $id, $title );

							if ( in_array( $id, $break_arr ) ) {
								echo '</div><div class="litespeed-tick-wrapper litespeed-top10">';
							}
						}
					?>
				</div>
			</div>
			<div class="litespeed-desc">
				<?php echo __( 'Select which pages will be automatically purged when posts are published/updated.', 'litespeed-cache' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_PURGE_STALE; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'If ON, the stale copy of a cached page will be shown to visitors until a new cache copy is available. Reduces the server load for following visits. If OFF, the page will be dynamically generated while visitors wait.', 'litespeed-cache' ); ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#serve-stale' ); ?>
			</div>
			<div class="litespeed-callout notice notice-warning inline">
				<h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
				<p>
					<?php echo __( 'By design, this option may serve stale content. Do not enable this option, if that is not OK with you.', 'litespeed-cache' ); ?><br />
				</p>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_PURGE_TIMED_URLS; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id, 80 ); ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'The URLs here (one per line) will be purged automatically at the time set in the option "%s".', 'litespeed-cache' ), __( 'Scheduled Purge Time', 'litespeed-cache' ) ); ?><br />
				<?php echo sprintf( __( 'Both %1$s and %2$s are acceptable.', 'litespeed-cache' ), '<code>http://www.example.com/path/url.php</code>', '<code>/path/url.php</code>' ); ?>
				<?php Doc::one_per_line(); ?>
			</div>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Wildcard %1$s supported (match zero or more characters). For example, to match %2$s and %3$s, use %4$s.', 'litespeed-cache' ), '<code>*</code>', '<code>/path/u-1.html</code>', '<code>/path/u-2.html</code>', '<code>/path/u-*.html</code>' ); ?>
			</div>
			<div class="litespeed-callout notice notice-warning inline">
				<h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
				<p>
					<?php echo __( 'For URLs with wildcards, there may be a delay in initiating scheduled purge.', 'litespeed-cache' ); ?><br />
					<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#scheduled-purge-urls' ); ?>
				</p>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_PURGE_TIMED_URLS_TIME; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id, null, null, 'time' ); ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Specify the time to purge the "%s" list.', 'litespeed-cache' ), __( 'Scheduled Purge URLs', 'litespeed-cache' ) ); ?>
				<?php echo sprintf( __( 'Current server time is %s.', 'litespeed-cache' ), '<code>' . date( 'H:i:s', time() + LITESPEED_TIME_OFFSET ) . '</code>' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_PURGE_HOOK_ALL; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>

			<div class="litespeed-textarea-recommended">
				<div>
					<?php $this->build_textarea( $id, 50 ); ?>
				</div>
				<div>
					<?php $this->recommended( $id ); ?>
				</div>
			</div>

			<div class="litespeed-desc">
				<?php echo __( 'A Purge All will be executed when WordPress runs these hooks.', 'litespeed-cache' ); ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#purge-all-hooks' ); ?>
			</div>
		</td>
	</tr>


</tbody></table>

cache/settings-ttl.tpl.php000064400000006106151540355030011563 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'TTL', 'litespeed-cache' ) ; ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#ttl-tab' ); ?>
</h3>


<table class="wp-list-table striped litespeed-table"><tbody>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_TTL_PUB ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
			<div class="litespeed-desc">
				<?php echo __('Specify how long, in seconds, public pages are cached.', 'litespeed-cache'); ?>
				<?php $this->recommended( $id ) ; ?>
				<?php $this->_validate_ttl( $id, 30 ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_TTL_PRIV ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Specify how long, in seconds, private pages are cached.', 'litespeed-cache' ) ; ?>
				<?php $this->recommended( $id ) ; ?>
				<?php $this->_validate_ttl( $id, 60, 3600 ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_TTL_FRONTPAGE ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Specify how long, in seconds, the front page is cached.', 'litespeed-cache' ) ; ?>
				<?php $this->recommended( $id ) ; ?>
				<?php $this->_validate_ttl( $id, 30 ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_TTL_FEED ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Specify how long, in seconds, feeds are cached.', 'litespeed-cache' ) ; ?>
				<?php echo __( 'If this is set to a number less than 30, feeds will not be cached.', 'litespeed-cache' ) ; ?>
				<?php $this->recommended( $id ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_TTL_REST ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Specify how long, in seconds, REST calls are cached.', 'litespeed-cache' ) ; ?>
				<?php echo __( 'If this is set to a number less than 30, feeds will not be cached.', 'litespeed-cache' ) ; ?>
				<?php $this->recommended( $id ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_TTL_STATUS ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>

			<div class="litespeed-textarea-recommended">
				<div>
					<?php $this->build_textarea( $id, 30 ) ; ?>
				</div>
				<div>
					<?php $this->recommended( $id ) ; ?>
				</div>
			</div>
			<div class="litespeed-desc">
				<?php echo __( 'Specify an HTTP status code and the number of seconds to cache that page, separated by a space.', 'litespeed-cache' ) ; ?>
				<?php Doc::one_per_line(); ?>
			</div>
		</td>
	</tr>

</tbody></table>

cache/settings_inc.browser.tpl.php000064400000003627151540355030013302 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
	<?php echo __( 'Browser Cache Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#browser-tab' ); ?>
</h3>

<?php if ( LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_OLS' ) : ?>
<div class="litespeed-callout notice notice-warning inline">
	<h4><?php echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4>
	<p><?php echo __( 'OpenLiteSpeed users please check this', 'litespeed-cache' ); ?>:
	<?php Doc::learn_more( 'https://openlitespeed.org/kb/how-to-set-up-custom-headers/', __( 'Setting Up Custom Headers', 'litespeed-cache' ) ); ?></p>
</div>
<?php endif; ?>

<table class="wp-list-table striped litespeed-table"><tbody>
	<tr>
		<th>
			<?php $id = Base::O_CACHE_BROWSER; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Browser caching stores static files locally in the user\'s browser. Turn on this setting to reduce repeated requests for static files.', 'litespeed-cache' ); ?>
				<br /><?php Doc::notice_htaccess(); ?>
				<br /><?php echo sprintf( __( 'You can turn on browser caching in server admin too. <a %s>Learn more about LiteSpeed browser cache settings</a>.', 'litespeed-cache' ), 'href="https://docs.litespeedtech.com/lscache/lscwp/cache/#how-to-set-it-up" target="_blank"' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_TTL_BROWSER; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id ); ?> <?php $this->readable_seconds(); ?>
			<div class="litespeed-desc">
				<?php echo __( 'The amount of time, in seconds, that files will be stored in browser cache before expiring.', 'litespeed-cache' ); ?>
				<?php $this->recommended( $id ); ?>
				<?php $this->_validate_ttl( $id, 30 ); ?>
			</div>
		</td>
	</tr>
</tbody></table>cache/settings_inc.cache_dropquery.tpl.php000064400000001372151540355030014767 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;
?>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_DROP_QS; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id, 40 ); ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Ignore certain query strings when caching. (LSWS %s required)', 'litespeed-cache' ), 'v5.2.3+' ); ?>
				<?php echo sprintf( __( 'For example, to drop parameters beginning with %s, %s can be used here.', 'litespeed-cache' ), '<code>utm</code>', '<code>utm*</code>' ); ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#drop-query-string' ); ?>

				<br />
				<?php Doc::one_per_line(); ?>

				<br /><?php Doc::notice_htaccess() ; ?>
			</div>
		</td>
	</tr>
cache/settings_inc.cache_mobile.tpl.php000064400000004567151540355030014215 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

?>

	<!-- build_setting_mobile_view start -->
	<tr>
		<th>
			<?php $id = Base::O_CACHE_MOBILE; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php
				$this->build_switch( $id );
			?>
			<div class="litespeed-desc">
				<?php echo __( 'Serve a separate cache copy for mobile visitors.', 'litespeed-cache' ); ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#cache-mobile', __( 'Learn more about when this is needed', 'litespeed-cache' ) ); ?>
				<br /><?php Doc::notice_htaccess(); ?>
				<br /><?php Doc::crawler_affected(); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th class="litespeed-padding-left">
			<?php $id = Base::O_CACHE_MOBILE_RULES; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
		<?php
			// if set, use value as input value
			if ( $this->conf( Base::O_CACHE_MOBILE ) ) {

				// if enabled, check the setting in file
				if ( defined( 'LITESPEED_ON' ) ) {

					try {
						$mobile_agents = Htaccess::cls()->current_mobile_agents();
						if ( $mobile_agents !== Utility::arr2regex( $this->conf( $id ), true ) ) {
							echo '<div class="litespeed-callout notice notice-error inline"><p>'
									. __( 'Htaccess did not match configuration option.', 'litespeed-cache' )
									. ' ' . sprintf( __( 'Htaccess rule is: %s', 'litespeed-cache' ), '<code>' . $mobile_agents . '</code>' )
								. '</p></div>';
						}
					} catch( \Exception $e ) {
						echo '<div class="litespeed-callout notice notice-error inline"><p>' . $e->getMessage() . '</p></div>';
					}

				}
			} ?>

			<div class="litespeed-textarea-recommended">
				<div>
					<?php $this->build_textarea( $id, 40 ); ?>
				</div>
				<div>
					<?php $this->recommended( $id ); ?>
				</div>
			</div>

			<div class="litespeed-desc">
				<?php Doc::one_per_line(); ?>

				<?php $this->_validate_syntax( $id ); ?>

				<?php if ( $this->conf( Base::O_CACHE_MOBILE ) && ! $this->conf( $id ) ) : ?>
				<font class="litespeed-warning">
					❌
					<?php echo sprintf( __( 'If %1$s is %2$s, then %3$s must be populated!', 'litespeed-cache' ), '<code>' . __('Cache Mobile', 'litespeed-cache') . '</code>', '<code>' . __('ON', 'litespeed-cache') . '</code>', '<code>' . __('List of Mobile User Agents', 'litespeed-cache') . '</code>' ); ?>
				</font>
				<?php endif; ?>
			</div>
		</td>
	</tr>
	<!-- build_setting_mobile_view end -->cache/settings_inc.cache_resources.tpl.php000064400000001074151540355030014746 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>

	<!-- build_setting_cache_resources -->
	<tr>
		<th>
			<?php $id = Base::O_CACHE_RES; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Some themes and plugins add resources via a PHP request.', 'litespeed-cache' ); ?>
				<?php echo __( 'Caching these pages may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache' ); ?>
				<br /><?php Doc::notice_htaccess(); ?>
			</div>
		</td>
	</tr>
cache/settings_inc.exclude_cookies.tpl.php000064400000001031151540355030014747 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;
?>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_EXC_COOKIES ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ), __( 'cookies', 'litespeed-cache') ) ; ?>
				<?php Doc::one_per_line() ; ?>
				<?php $this->_validate_syntax( $id ) ; ?>
				<br /><?php Doc::notice_htaccess() ; ?>
			</div>
		</td>
	</tr>
cache/settings_inc.exclude_useragent.tpl.php000064400000001037151540355030015316 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;
?>

	<tr>
		<th>
			<?php $id = Base::O_CACHE_EXC_USERAGENTS ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
		<?php $this->build_textarea( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ), __( 'user agents', 'litespeed-cache') ) ; ?>
				<?php Doc::one_per_line() ; ?>
				<?php $this->_validate_syntax( $id ) ; ?>
				<br /><?php Doc::notice_htaccess() ; ?>
			</div>
		</td>
	</tr>
cache/settings_inc.login_cookie.tpl.php000064400000006022151540355030014250 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;
?>

<tr>
	<th>
		<?php $id = Base::O_CACHE_LOGIN_COOKIE; ?>
		<?php $this->title($id); ?>
	</th>
	<td>
		<?php
		$this->build_input($id);

		$this->_validate_syntax($id);

		echo '<p class="litespeed-desc">' . __('SYNTAX: alphanumeric and "_".', 'litespeed-cache')
			. ' ' . __('No spaces and case sensitive.', 'litespeed-cache')
			. ' ' . __('MUST BE UNIQUE FROM OTHER WEB APPLICATIONS.', 'litespeed-cache')
			. '</p>'
			. '<p class="litespeed-desc">'
			. sprintf(__('The default login cookie is %s.', 'litespeed-cache'), '<code>_lscache_vary</code>')
			. ' ' . __('The server will determine if the user is logged in based on the existence of this cookie.', 'litespeed-cache')
			. ' ' . __('This setting is useful for those that have multiple web applications for the same domain.', 'litespeed-cache')
			. ' ' . __('If every web application uses the same cookie, the server may confuse whether a user is logged in or not.', 'litespeed-cache')
			. ' ' . __('The cookie set here will be used for this WordPress installation.', 'litespeed-cache')
			. '</p>'
			. '<p class="litespeed-desc">'
			. __('Example use case:', 'litespeed-cache')
			. '<br />'
			. sprintf(__('There is a WordPress installed for %s.', 'litespeed-cache'), '<u>www.example.com</u>')
			. '<br />'
			. sprintf(__('Then another WordPress is installed (NOT MULTISITE) at %s', 'litespeed-cache'), '<u>www.example.com/blog/</u>')
			. ' ' . __('The cache needs to distinguish who is logged into which WordPress site in order to cache correctly.', 'litespeed-cache')
			. '<br />'; ?>
		<?php Doc::notice_htaccess();
		echo '</p>'; ?>
		<?php

		if (preg_match('#[^\w\-]#', $this->conf($id))) {
			echo '<div class="litespeed-callout notice notice-error inline"><p>❌ ' . __('Invalid login cookie. Invalid characters found.', 'litespeed-cache') . '</p></div>';
		}

		if (defined('LITESPEED_ON') && $this->conf($id)) {
			$cookie_rule = '';
			try {
				$cookie_rule = Htaccess::cls()->current_login_cookie();
			} catch (\Exception $e) {
				echo '<div class="litespeed-callout notice notice-error inline"><p>' . $e->getMessage() . '</p></div>';
			}

			$cookie_arr = explode(',', $cookie_rule);
			if (!in_array($this->conf($id), $cookie_arr)) {
				echo '<div class="litespeed-callout notice notice-warning inline"><p>'
					. __('WARNING: The .htaccess login cookie and Database login cookie do not match.', 'litespeed-cache')
					. '</p></div>';
			}
		}

		?>
	</td>
</tr>

<tr>
	<th>
		<?php $id = Base::O_CACHE_VARY_COOKIES; ?>
		<?php $this->title($id); ?>
	</th>
	<td>
		<?php
		$this->build_textarea($id, 50);

		$this->_validate_syntax($id);

		echo '<p class="litespeed-desc">' . __('SYNTAX: alphanumeric and "_".', 'litespeed-cache')
			. ' ' . __('No spaces and case sensitive.', 'litespeed-cache')
			. '</p>'
			. '<p class="litespeed-desc">'
			. ' ' . __('You can list the 3rd party vary cookies here.', 'litespeed-cache')
			. '</p>'
			. '<p class="litespeed-desc">'; ?>
		<?php Doc::notice_htaccess();
		echo '</p>'; ?>
	</td>
</tr>cache/settings_inc.object.tpl.php000064400000015040151540355030013055 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;


$lang_enabled = '<font class="litespeed-success">' . __( 'Enabled', 'litespeed-cache' ) . '</font>' ;
$lang_disabled = '<font class="litespeed-warning">' . __( 'Disabled', 'litespeed-cache' ) . '</font>' ;

$mem_enabled = class_exists( 'Memcached' ) ? $lang_enabled : $lang_disabled ;
$redis_enabled = class_exists( 'Redis' ) ? $lang_enabled : $lang_disabled ;

$mem_conn = $this->cls( 'Object_Cache' )->test_connection();
if ( $mem_conn === null ) {
	$mem_conn_desc = '<font class="litespeed-desc">' . __( 'Not Available', 'litespeed-cache' ) . '</font>' ;
}
elseif ( $mem_conn ) {
	$mem_conn_desc = '<font class="litespeed-success">' . __( 'Passed', 'litespeed-cache' ) . '</font>' ;
}
else {
	$severity = $this->conf( Base::O_OBJECT, true ) ? "danger" : "warning";
	$mem_conn_desc = '<font class="litespeed-' . $severity . '">' . __( 'Failed', 'litespeed-cache' ) . '</font>' ;
}

?>


<h3 class="litespeed-title-short">
	<?php echo __( 'Object Cache Settings', 'litespeed-cache' ) ; ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#object-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_switch( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Use external object cache functionality.', 'litespeed-cache' ) ; ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/admin/#memcached-lsmcd-and-redis-object-cache-support-in-lscwp' ); ?>
			</div>
			<div class="litespeed-block">

				<div class='litespeed-col-auto'>
					<h4><?php echo __( 'Status', 'litespeed-cache' ) ; ?></h4>
				</div>
				<div class='litespeed-col-auto'>
					<?php echo sprintf( __( '%s Extension', 'litespeed-cache' ), 'Memcached' ) ; ?>: <?php echo $mem_enabled ; ?><br />
					<?php echo sprintf( __( '%s Extension', 'litespeed-cache' ), 'Redis' ) ; ?>: <?php echo $redis_enabled ; ?><br />
					<?php echo __( 'Connection Test', 'litespeed-cache' ) ; ?>: <?php echo $mem_conn_desc ; ?>
					<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/admin/#how-to-debug' ); ?>
				</div>

			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_KIND ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_switch( $id, array( 'Memcached', 'Redis' ) ); ?>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_HOST; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id ); ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Your %s Hostname or IP address.', 'litespeed-cache' ), 'Memcached/<a href="https://docs.litespeedtech.com/products/lsmcd/" target="_blank">LSMCD</a>/Redis' ) ; ?>
				<br /><?php echo sprintf( __( 'If you are using a %1$s socket, %2$s should be set to %3$s', 'litespeed-cache' ), 'UNIX', Lang::title( $id ), '<code>/path/to/memcached.sock</code>' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_PORT; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id, 'litespeed-input-short2' ) ; ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Default port for %1$s is %2$s.', 'litespeed-cache' ), 'Memcached', '<code>11211</code>' ) ; ?>
				<?php echo sprintf( __( 'Default port for %1$s is %2$s.', 'litespeed-cache' ), 'Redis', '<code>6379</code>' ) ; ?>
				<br /><?php echo sprintf( __( 'If you are using a %1$s socket, %2$s should be set to %3$s', 'litespeed-cache' ), 'UNIX', Lang::title( $id ), '<code>0</code>' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_LIFE; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id, 'litespeed-input-short2' ) ; ?> <?php echo __( 'seconds', 'litespeed-cache' ) ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Default TTL for cached objects.', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_USER; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id ); ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Only available when %s is installed.', 'litespeed-cache' ), 'SASL' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_PSWD; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Specify the password used when connecting.', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_DB_ID; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id, 'litespeed-input-short' ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Database to be used', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_GLOBAL_GROUPS; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id, 30 ) ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Groups cached at the network level.', 'litespeed-cache' ) ; ?>
				<?php Doc::one_per_line() ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_NON_PERSISTENT_GROUPS; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id, 30 ) ; ?>
			<div class="litespeed-desc">
				<?php Doc::one_per_line() ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_PERSISTENT; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Use keep-alive connections to speed up cache operations.', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_ADMIN; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'Improve wp-admin speed through caching. (May encounter expired data)', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OBJECT_TRANSIENTS; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Save transients in database when %1$s is %2$s.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_OBJECT_ADMIN ) . '</code>', '<code>' . __( 'OFF', 'litespeed-cache' ) . '</code>' ) ; ?>
				<br />
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#store-transients' ); ?>
			</div>
		</td>
	</tr>


</tbody></table>
cache/settings_inc.purge_on_upgrade.tpl.php000064400000000715151540355030015137 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;
?>

	<!-- build_setting_purge_on_upgrade -->
	<tr>
		<th>
			<?php $id = Base::O_PURGE_ON_UPGRADE ; ?>
			<?php $this->title( $id ) ; ?>
		</th>
		<td>
			<?php $this->build_switch( $id ) ; ?>
			<div class="litespeed-desc">
				<?php echo __( 'When enabled, the cache will automatically purge when any plugin, theme or the WordPress core is upgraded.', 'litespeed-cache' ) ; ?>
			</div>
		</td>
	</tr>
cdn/cf.tpl.php000064400000013274151540355030007217 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$this->form_action();
?>

<h3 class="litespeed-title-short">
	<?php echo __('Cloudflare Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cdn/'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th>
				<?php $id = Base::O_CDN_CLOUDFLARE; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Use %s API functionality.', 'litespeed-cache'), 'Cloudflare'); ?>
				</div>
				<div class="litespeed-block">
					<div class='litespeed-col'>
						<label class="litespeed-form-label"><?php echo __('Global API Key / API Token', 'litespeed-cache'); ?></label>

						<?php $this->build_input(Base::O_CDN_CLOUDFLARE_KEY); ?>
						<div class="litespeed-desc">
							<?php echo sprintf(__('Your API key / token is used to access %s APIs.', 'litespeed-cache'), 'Cloudflare'); ?>
							<?php echo sprintf(__('Get it from <a %1$s>%2$s</a>.', 'litespeed-cache'), 'href="https://dash.cloudflare.com/profile/api-tokens" target="_blank"', 'Cloudflare'); ?>
							<?php echo sprintf(__('Recommended to generate the token from Cloudflare API token template "WordPress".', 'litespeed-cache')); ?>
						</div>
					</div>

					<div class='litespeed-col'>
						<label class="litespeed-form-label"><?php echo __('Email Address', 'litespeed-cache'); ?></label>

						<?php $this->build_input(Base::O_CDN_CLOUDFLARE_EMAIL); ?>
						<div class="litespeed-desc">
							<?php echo sprintf(__('Your Email address on %s.', 'litespeed-cache'), 'Cloudflare'); ?>
							<?php echo sprintf(__('Optional when API token used.', 'litespeed-cache')); ?>
						</div>
					</div>

					<div class='litespeed-col'>
						<label class="litespeed-form-label"><?php echo __('Domain', 'litespeed-cache'); ?></label>

						<?php
						$cf_zone = $this->conf(Base::O_CDN_CLOUDFLARE_ZONE);
						$cls = 	$cf_zone ? ' litespeed-input-success' : ' litespeed-input-warning';
						$this->build_input(Base::O_CDN_CLOUDFLARE_NAME, $cls);
						?>
						<div class="litespeed-desc">
							<?php echo __('You can just type part of the domain.', 'litespeed-cache'); ?>
							<?php echo __('Once saved, it will be matched with the current list and completed automatically.', 'litespeed-cache'); ?>
						</div>
					</div>
				</div>
			</td>
		</tr>

	</tbody>
</table>

<?php
$this->form_end();
$cf_on = $this->conf(Base::O_CDN_CLOUDFLARE);
$cf_domain = $this->conf(Base::O_CDN_CLOUDFLARE_NAME) ?: '-';
$cf_zone = $this->conf(Base::O_CDN_CLOUDFLARE_ZONE) ?: '-';

$curr_status = CDN\Cloudflare::get_option(CDN\Cloudflare::ITEM_STATUS, array());

?>

<h3 class="litespeed-title"><?php echo __('Cloudflare', 'litespeed-cache'); ?></h3>

<?php if (!$cf_on) : ?>
	<div class="litespeed-callout notice notice-error inline">
		<h4><?php echo __('WARNING', 'litespeed-cache'); ?></h4>
		<p>
			<?php echo __('To enable the following functionality, turn ON Cloudflare API in CDN Settings.', 'litespeed-cache'); ?>
		</p>
	</div>
<?php endif; ?>

<p><?php echo __('Cloudflare Domain', 'litespeed-cache'); ?>: <code><?php echo esc_textarea($cf_domain); ?></code></p>
<p><?php echo __('Cloudflare Zone', 'litespeed-cache'); ?>: <code><?php echo esc_textarea($cf_zone); ?></code></p>

<p>
	<b><?php echo __('Development Mode', 'litespeed-cache'); ?>:</b>
	<a href="<?php echo Utility::build_url(Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_SET_DEVMODE_ON); ?>" class="button litespeed-btn-warning">
		<?php echo __('Turn ON', 'litespeed-cache'); ?>
	</a>
	<a href="<?php echo Utility::build_url(Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_SET_DEVMODE_OFF); ?>" class="button litespeed-btn-warning">
		<?php echo __('Turn OFF', 'litespeed-cache'); ?>
	</a>
	<a href="<?php echo Utility::build_url(Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_GET_DEVMODE); ?>" class="button litespeed-btn-success">
		<?php echo __('Check Status', 'litespeed-cache'); ?>
	</a>

	<?php if ($curr_status) : ?>
		<span class="litespeed-desc">
			<?php
			if (time() >= $curr_status['devmode_expired']) {
				$expired_at = date('m/d/Y H:i:s', $curr_status['devmode_expired'] + LITESPEED_TIME_OFFSET);
				$curr_status['devmode'] = 'OFF';
				echo sprintf(__('Current status is %1$s since %2$s.', 'litespeed-cache'), '<code>' . strtoupper($curr_status['devmode']) . '</code>', '<code>' . $expired_at . '</code>');
			} else {
				$expired_at = $curr_status['devmode_expired'] - time();
				$expired_at = Utility::readable_time($expired_at, 3600 * 3, true);
			?>
				<?php echo sprintf(__('Current status is %s.', 'litespeed-cache'), '<code>' . strtoupper($curr_status['devmode']) . '</code>'); ?>
				<?php echo sprintf(__('Development mode will be automatically turned off in %s.', 'litespeed-cache'), '<code>' . $expired_at . '</code>'); ?>
			<?php
			}
			?>
		</span>
	<?php endif; ?>

<p class="litespeed-desc">
	<?php echo __('Temporarily bypass Cloudflare cache. This allows changes to the origin server to be seen in realtime.', 'litespeed-cache'); ?>
	<?php echo __('Development Mode will be turned off automatically after three hours.', 'litespeed-cache'); ?>
	<a href="https://support.cloudflare.com/hc/en-us/articles/200168246" target="_blank"><?php echo __('Learn More', 'litespeed-cache'); ?></a>
</p>
</p>

<p>
	<b><?php echo __('Cloudflare Cache', 'litespeed-cache'); ?>:</b>
	<?php if (!$cf_on) : ?>
		<a href="#" class="button button-secondary disabled">
		<?php else : ?>
			<a href="<?php echo Utility::build_url(Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_PURGE_ALL); ?>" class="button litespeed-btn-danger">
			<?php endif; ?>
			<?php echo __('Purge Everything', 'litespeed-cache'); ?>
			</a>
</p>cdn/entry.tpl.php000064400000002002151540355030007753 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$menu_list = array(
	'qc'		=> __('QUIC.cloud', 'litespeed-cache'),
	'cf'		=> __('Cloudflare', 'litespeed-cache'),
	'other'	=> __('Other Static CDN', 'litespeed-cache'),
);

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __('LiteSpeed Cache CDN', 'litespeed-cache'); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">
	<h2 class="litespeed-header nav-tab-wrapper">
		<?php
		$i = 1;
		foreach ($menu_list as $tab => $val) {
			$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
			$i++;
		}
		?>
	</h2>

	<div class="litespeed-body">
		<?php

		// include all tpl for faster UE
		foreach ($menu_list as $tab => $val) {
			echo "<div data-litespeed-layout='$tab'>";
			require LSCWP_DIR . "tpl/cdn/$tab.tpl.php";
			echo "</div>";
		}

		?>
	</div>

</div>cdn/other.tpl.php000064400000014666151540355030007756 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;
$home_url = home_url('/');
$parsed = parse_url($home_url);
$home_url = str_replace($parsed['scheme'] . ':', '', $home_url);

$cdn_mapping = $this->conf(Base::O_CDN_MAPPING);
// Special handler: Append one row if somehow the DB default preset value got deleted
if (!$cdn_mapping) {
	$this->load_default_vals();
	$cdn_mapping = self::$_default_options[Base::O_CDN_MAPPING];
}

$this->form_action();
?>
<h3 class="litespeed-title-short">
	<?php echo __('CDN Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cdn/'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th>
				<?php $id = Base::O_CDN; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Turn this setting %1$s if you are using a traditional Content Delivery Network (CDN) or a subdomain for static content with QUIC.cloud CDN.', 'litespeed-cache'), '<code>' . __('ON', 'litespeed-cache') . '</code>'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cdn/#use-cdn-mapping'); ?>
				</div>

				<div class="litespeed-desc">
					<?php echo sprintf(__('NOTE: QUIC.cloud CDN and Cloudflare do not use CDN Mapping. If you are are only using QUIC.cloud or Cloudflare, leave this setting %1$s.', 'litespeed-cache'), '<code>' . __('OFF', 'litespeed-cache') . '</code>'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th class="litespeed-padding-left"></th>
			<td>
				<?php $this->enroll(Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_URL . '][]'); ?>
				<?php $this->enroll(Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_INC_IMG . '][]'); ?>
				<?php $this->enroll(Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_INC_CSS . '][]'); ?>
				<?php $this->enroll(Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_INC_JS . '][]'); ?>
				<?php $this->enroll(Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_FILETYPE . '][]'); ?>

				<div id="litespeed_cdn_mapping_div"></div>

				<script type="text/babel">
					ReactDOM.render(
					<CDNMapping list={ <?php echo json_encode($cdn_mapping); ?> } />,
					document.getElementById( 'litespeed_cdn_mapping_div' )
				);
			</script>

				<div class="litespeed-warning">
					<?php echo __('NOTE', 'litespeed-cache'); ?>:
					<?php echo __('To randomize CDN hostname, define multiple hostnames for the same resources.', 'litespeed-cache'); ?>
				</div>

				<div class="litespeed-desc">
					<b><?php $this->title(Base::CDN_MAPPING_INC_IMG); ?></b>:
					<?php echo sprintf(__('Serve all image files through the CDN. This will affect all attachments, HTML %s tags, and CSS %s attributes.', 'litespeed-cache'), '<code>&lt;img</code>', '<code>url()</code>'); ?>

					<br />
					<b><?php $this->title(Base::CDN_MAPPING_INC_CSS); ?></b>:
					<?php echo __('Serve all CSS files through the CDN. This will affect all enqueued WP CSS files.', 'litespeed-cache'); ?>

					<br />
					<b><?php $this->title(Base::CDN_MAPPING_INC_JS); ?></b>:
					<?php echo __('Serve all JavaScript files through the CDN. This will affect all enqueued WP JavaScript files.', 'litespeed-cache'); ?>

					<br />
					<b><?php $this->title(Base::CDN_MAPPING_FILETYPE); ?></b>:
					<?php echo __('Static file type links to be replaced by CDN links.', 'litespeed-cache'); ?>
					<?php Doc::one_per_line(); ?>
					<?php echo sprintf(__('This will affect all tags containing attributes: %s %s %s.', 'litespeed-cache'), '<code>src=""</code>', '<code>data-src=""</code>', '<code>href=""</code>'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cdn/#include-file-types', __('Default value', 'litespeed-cache')); ?>

					<br />
					<?php echo sprintf(__('If you turn any of the above settings OFF, please remove the related file types from the %s box.', 'litespeed-cache'), '<b>' . __('Include File Types', 'litespeed-cache') . '</b>'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cdn/#include-file-types'); ?>
				</div>

			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CDN_ATTR; ?>
				<?php $this->title($id); ?>
			</th>
			<td>

				<div class="litespeed-textarea-recommended">
					<div>
						<?php $this->build_textarea($id, 40); ?>
					</div>
					<div>
						<?php $this->recommended($id); ?>
					</div>
				</div>

				<div class="litespeed-desc">
					<?php echo __('Specify which HTML element attributes will be replaced with CDN Mapping.', 'litespeed-cache'); ?>
					<?php echo __('Only attributes listed here will be replaced.', 'litespeed-cache'); ?>
					<br /><?php echo sprintf(__('Use the format %1$s or %2$s (element is optional).', 'litespeed-cache'), '<code>element.attribute</code>', '<code>.attribute</code>'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th class="litespeed-padding-left">
				<?php $id = Base::O_CDN_ORI; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Site URL to be served through the CDN. Beginning with %1$s. For example, %2$s.', 'litespeed-cache'), '<code>//</code>', '<code>' . $home_url . '</code>'); ?>
					<br /><?php echo sprintf(__('Wildcard %1$s supported (match zero or more characters). For example, to match %2$s and %3$s, use %4$s.', 'litespeed-cache'), '<code>*</code>', '<code>//www.aa.com</code>', '<code>//aa.com</code>', '<code>//*aa.com</code>'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th class="litespeed-padding-left">
				<?php $id = Base::O_CDN_ORI_DIR; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<div class="litespeed-textarea-recommended">
					<div>
						<?php $this->build_textarea($id, 40); ?>
					</div>
					<div>
						<?php $this->recommended($id); ?>
					</div>
				</div>

				<div class="litespeed-desc">
					<?php echo __('Only files within these directories will be pointed to the CDN.', 'litespeed-cache'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th class="litespeed-padding-left">
				<?php $id = Base::O_CDN_EXC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Paths containing these strings will not be served from the CDN.', 'litespeed-cache'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

	</tbody>
</table>

<?php
$this->form_end();
cdn/qc.tpl.php000064400000017410151540355030007226 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$__cloud = Cloud::cls();
$__cloud->finish_qc_activation('cdn');
$cloud_summary = Cloud::get_summary();
?>

<div class="litespeed-flex-container litespeed-column-with-boxes">

	<div class="litespeed-width-7-10 litespeed-column-left litespeed-cdn-summary-wrapper">
		<div class="litespeed-column-left-inside">

			<h3>
				<?php if ($__cloud->activated()) : ?>
					<a class="button button-small litespeed-right litespeed-learn-more" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_SYNC_STATUS); ?>">
						<span class="dashicons dashicons-update"></span> <?php echo __('Refresh Status', 'litespeed-cache'); ?>
					</a>
				<?php endif; ?>
				<span class="litespeed-quic-icon"></span> <?php echo __('QUIC.cloud CDN Status Overview', 'litespeed-cache'); ?>
			</h3>
			<p class="litespeed-desc"><?php echo __('Check the status of your most important settings and the health of your CDN setup here.', 'litespeed-cache'); ?></p>

			<?php if (!$__cloud->activated()) : ?>
				<div class="litespeed-dashboard-unlock litespeed-dashboard-unlock--inline">
					<div>
						<h3 class="litespeed-dashboard-unlock-title"><strong class="litespeed-qc-text-gradient"><?php echo __('Accelerate, Optimize, Protect', 'litespeed-cache'); ?></strong></h3>
						<p class="litespeed-dashboard-unlock-desc"><?php echo __('Speed up your WordPress site even further with <strong>QUIC.cloud Online Services and CDN</strong>.', 'litespeed-cache'); ?></p>
						<p><?php echo __('Free monthly quota available.', 'litespeed-cache'); ?></p>
						<p><a class="button button-primary" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE, false, null, array('ref' => 'cdn')); ?>"><span class="dashicons dashicons-yes"></span><?php echo __('Enable QUIC.cloud services', 'litespeed-cache'); ?></a></p>
						<p class="litespeed-dashboard-unlock-footer">
							<?php echo __('QUIC.cloud provides CDN and online optimization services, and is not required. You may use many features of this plugin without QUIC.cloud.', 'litespeed-cache'); ?><br>
							<a href="https://www.quic.cloud/" target="_blank"><?php echo __('Learn More about QUIC.cloud', 'litespeed-cache'); ?></a>
						</p>
					</div>
				</div>
			<?php elseif (empty($cloud_summary['qc_activated']) || $cloud_summary['qc_activated'] != 'cdn') : ?>
				<div class="litespeed-top20">
					<?php if (!empty($cloud_summary['qc_activated']) && $cloud_summary['qc_activated'] == 'linked') : ?>
						<p><?php echo __('QUIC.cloud CDN is currently <strong>fully disabled</strong>.', 'litespeed-cache'); ?></p>
					<?php else : ?>
						<p><?php echo __('QUIC.cloud CDN is <strong>not available</strong> for anonymous (unlinked) users.', 'litespeed-cache'); ?></p>
					<?php endif; ?>
					<p>
						<?php
						$btn_title = __('Link & Enable QUIC.cloud CDN', 'litespeed-cache');
						if (!empty($cloud_summary['qc_activated']) && $cloud_summary['qc_activated'] == 'linked') {
							$btn_title = __('Enable QUIC.cloud CDN', 'litespeed-cache');
						}
						?>
						<?php Doc::learn_more(
							Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ENABLE_CDN, false, null, array('ref' => 'cdn')),
							'<span class="dashicons dashicons-yes"></span>' . $btn_title,
							true,
							'button button-primary litespeed-button-cta'
						); ?>
					</p>
					<h3 class="litespeed-title-section"><?php echo __('Content Delivery Network Service', 'litespeed-cache'); ?></h3>
					<p class="litespeed-text-md">Serve your visitors fast <strong class="litespeed-qc-text-gradient"><?php echo __('no matter where they live.', 'litespeed-cache'); ?></strong>
					<p>
						<?php echo sprintf(__('Best available WordPress performance, globally fast TTFB, easy setup, and <a %s>more</a>!', 'litespeed-cache'), ' href="https://www.quic.cloud/quic-cloud-services-and-features/litespeed-cache-service/" target="_blank"'); ?>
					</p>
				</div>
			<?php else : ?>
				<?php echo $__cloud->load_qc_status_for_dash('cdn_dash'); ?>
			<?php endif; ?>
		</div>
	</div>

	<div class="litespeed-width-3-10 litespeed-column-right">

		<div class="postbox litespeed-postbox">
			<div class="inside">
				<h3 class="litespeed-title">
					<?php echo __('QUIC.cloud CDN Options', 'litespeed-cache'); ?>
				</h3>
				<?php if (!empty($cloud_summary['partner']) && !empty($cloud_summary['partner']['disable_qc_login'])) : ?>
					<?php if (!empty($cloud_summary['partner']['logo'])) : ?>
						<?php if (!empty($cloud_summary['partner']['url'])) : ?>
							<a href="<?php echo $cloud_summary['partner']['url']; ?>" target="_blank"><img src="<?php echo $cloud_summary['partner']['logo']; ?>" alt="<?php echo $cloud_summary['partner']['name']; ?>"></a>
						<?php else : ?>
							<img src="<?php echo $cloud_summary['partner']['logo']; ?>" alt="<?php echo $cloud_summary['partner']['name']; ?>">
						<?php endif; ?>
					<?php elseif (!empty($cloud_summary['partner']['name'])) : ?>
						<?php if (!empty($cloud_summary['partner']['url'])) : ?>
							<a href="<?php echo $cloud_summary['partner']['url']; ?>" target="_blank"><span class="postbox-partner-name"><?php echo $cloud_summary['partner']['name']; ?></span></a>
						<?php else : ?>
							<span class="postbox-partner-name"><?php echo $cloud_summary['partner']['name']; ?></span>
						<?php endif; ?>
					<?php endif; ?>

					<?php if (!$__cloud->activated()) : ?>
						<p><?php echo __('To manage your QUIC.cloud options, go to your hosting provider\'s portal.', 'litespeed-cache'); ?></p>
					<?php else : ?>
						<p><?php echo __('To manage your QUIC.cloud options, please contact your hosting provider.', 'litespeed-cache'); ?></p>
					<?php endif; ?>
				<?php else : ?>
					<?php if (!$__cloud->activated()) : ?>
						<p><?php echo __('To manage your QUIC.cloud options, go to QUIC.cloud Dashboard.', 'litespeed-cache'); ?></p>
						<p class="litespeed-top20"><button type="button" class="button button-primary disabled"><?php echo __('Link to QUIC.cloud', 'litespeed-cache'); ?> <span class="dashicons dashicons-external"></span></button></p>
					<?php elseif ($cloud_summary['qc_activated'] == 'anonymous') : ?>
						<p><?php echo __('You are currently using services as an anonymous user. To manage your QUIC.cloud options, use the button below to create an account and link to the QUIC.cloud Dashboard.', 'litespeed-cache'); ?></p>
						<p class="litespeed-top20"><a href="<?php echo $__cloud->qc_link(); ?>" target="qc" class="button button-<?php echo ((empty($cloud_summary['qc_activated']) || $cloud_summary['qc_activated'] != 'cdn') ? 'secondary' : 'primary'); ?>"><?php echo __('Link to QUIC.cloud', 'litespeed-cache'); ?> <span class="dashicons dashicons-external"></span></a></p>
					<?php elseif ($cloud_summary['qc_activated'] == 'linked') : ?>
						<p class="litespeed-top20"><a href="<?php echo $__cloud->qc_link(); ?>" target="qc" class="button button-<?php echo ((empty($cloud_summary['qc_activated']) || $cloud_summary['qc_activated'] != 'cdn') ? 'secondary' : 'primary'); ?>"><?php echo __('My QUIC.cloud Dashboard', 'litespeed-cache'); ?> <span class="dashicons dashicons-external"></span></a></p>
					<?php else : ?>
						<p><?php echo __('To manage your QUIC.cloud options, go to QUIC.cloud Dashboard.', 'litespeed-cache'); ?></p>
						<p class="litespeed-top20"><a href="<?php echo $__cloud->qc_link(); ?>" target="qc" class="button button-<?php echo ((empty($cloud_summary['qc_activated']) || $cloud_summary['qc_activated'] != 'cdn') ? 'secondary' : 'primary'); ?>"><?php echo __('My QUIC.cloud Dashboard', 'litespeed-cache'); ?> <span class="dashicons dashicons-external"></span></a></p>
					<?php endif; ?>
				<?php endif; ?>
			</div>
		</div>


		<?php $promo_mini = $__cloud->load_qc_status_for_dash('promo_mini'); ?>
		<?php if ($promo_mini) : ?>
			<?php echo $promo_mini; ?>
		<?php endif; ?>


	</div>

</div>crawler/blacklist.tpl.php000064400000005156151540355030011472 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$crawler_summary = Crawler::get_summary();

$__map = Crawler_Map::cls();

$list = $__map->list_blacklist( 30 );
$count = $__map->count_blacklist();
$pagination = Utility::pagination( $count, 30 );

?>
<p class="litespeed-right">
<a href="<?php echo Utility::build_url( Router::ACTION_CRAWLER, Crawler::TYPE_BLACKLIST_EMPTY ); ?>" class="button litespeed-btn-warning" data-litespeed-cfm="<?php echo __( 'Are you sure to delete all existing blocklist items?', 'litespeed-cache' ) ; ?>" >
	<?php echo __( 'Empty blocklist', 'litespeed-cache' ); ?>
</a>
</p>

<h3 class="litespeed-title">
	<?php echo __( 'Blocklist', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/crawler/#blacklist-tab' ); ?>
</h3>

<?php echo __( 'Total', 'litespeed-cache' ) . ': ' . $count; ?>

<?php echo $pagination; ?>

<div class="litespeed-table-responsive">
	<table class="wp-list-table widefat striped">
		<thead><tr >
			<th scope="col">#</th>
			<th scope="col"><?php echo __( 'URL', 'litespeed-cache' ); ?></th>
			<th scope="col"><?php echo __( 'Status', 'litespeed-cache' ); ?></th>
			<th scope="col"><?php echo __( 'Operation', 'litespeed-cache' ); ?></th>
		</tr></thead>
		<tbody>
			<?php foreach ( $list as $i => $v ) : ?>
			<tr>
				<td><?php echo $i + 1; ?></td>
				<td>
					<?php echo $v[ 'url' ]; ?>
				</td>
				<td>
					<?php echo Crawler::cls()->display_status( $v[ 'res' ], $v[ 'reason' ] ); ?>
				</td>
				<td>
					<a href="<?php echo Utility::build_url( Router::ACTION_CRAWLER, Crawler::TYPE_BLACKLIST_DEL, false, null, array( 'id' => $v[ 'id' ] ) ); ?>" class="button button-secondary"><?php echo __( 'Remove from Blocklist', 'litespeed-cache' ); ?></a>
				</td>
			</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
</div>

<?php echo $pagination; ?>
<p>
<font class="litespeed-success">API: <?php echo sprintf( __( 'PHP Constant %s available to disable blocklist.', 'litespeed-cache' ), "<code>LITESPEED_CRAWLER_DISABLE_BLOCKLIST</code>" ); ?></font>
</p>
<p>
<font class="litespeed-success">API: <?php echo sprintf( __( 'Filter %s available to disable blocklist.', 'litespeed-cache' ), "<code>add_filter( 'litespeed_crawler_disable_blocklist', '__return_true' );</code>" ); ?></font>
</p>
<p>
	<i class="litespeed-dot litespeed-bg-default"></i> = <?php echo __( 'Not blocklisted', 'litespeed-cache' ); ?><br>
	<i class="litespeed-dot litespeed-bg-warning"></i> = <?php echo __( 'Blocklisted due to not cacheable', 'litespeed-cache' ); ?><br>
	<i class="litespeed-dot litespeed-bg-danger"></i> = <?php echo __( 'Blocklisted', 'litespeed-cache' ); ?><br>
</p>
crawler/entry.tpl.php000064400000002224151540355030010654 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$menu_list = array(
	'summary'		=> __('Summary', 'litespeed-cache'),
	'map'			=> __('Map', 'litespeed-cache'),
	'blacklist'		=> __('Blocklist', 'litespeed-cache'),
	'settings'		=> __('Settings', 'litespeed-cache'),
);

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __('LiteSpeed Cache Crawler', 'litespeed-cache'); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">
	<h2 class="litespeed-header nav-tab-wrapper">
		<?php
		$i = 1;
		foreach ($menu_list as $tab => $val) {
			$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
			$i++;
		}
		?>
	</h2>

	<div class="litespeed-body">
		<?php

		// include all tpl for faster UE
		foreach ($menu_list as $tab => $val) {
			echo "<div data-litespeed-layout='$tab'>";
			require LSCWP_DIR . "tpl/crawler/$tab.tpl.php";
			echo "</div>";
		}

		?>
	</div>

</div>

<iframe name="litespeedHiddenIframe" src="" width="0" height="0" frameborder="0"></iframe>crawler/map.tpl.php000064400000006760151540355030010301 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$crawler_summary = Crawler::get_summary();

$__map = Crawler_Map::cls();

$list = $__map->list_map(30);
$count = $__map->count_map();
$pagination = Utility::pagination($count, 30);

?>

<p class="litespeed-right">
	<a href="<?php echo Utility::build_url(Router::ACTION_CRAWLER, Crawler::TYPE_EMPTY); ?>" class="button litespeed-btn-warning">
		<?php echo __('Clean Crawler Map', 'litespeed-cache'); ?>
	</a>

	<a href="<?php echo Utility::build_url(Router::ACTION_CRAWLER, Crawler::TYPE_REFRESH_MAP); ?>" class="button button-secondary">
		<?php echo __('Refresh Crawler Map', 'litespeed-cache'); ?>
	</a>
</p>

<p>
	<?php
	if (!empty($crawler_summary['sitemap_time'])) {
		echo sprintf(__('Generated at %s', 'litespeed-cache'), Utility::readable_time($crawler_summary['sitemap_time']));
	}
	?>
</p>

<h3 class="litespeed-title">
	<?php echo __('Sitemap List', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/crawler/#map-tab'); ?>
</h3>

<?php echo __('Sitemap Total', 'litespeed-cache') . ': ' . $count; ?>

<div style="display: flex; justify-content: space-between;">
	<div style="margin-top:10px;">
		<form action="<?php echo admin_url('admin.php?page=litespeed-crawler'); ?>" method="post">
			<input type="text" name="kw" value="<?php echo !empty($_POST['kw']) ? esc_html($_POST['kw']) : ''; ?>" placeholder="<?php echo __('URL Search'); ?>" style="width: 600px;" />
		</form>
	</div>

	<div class="">

		<a style="padding-right:10px;" href="<?php echo admin_url('admin.php?page=litespeed-crawler&' . Router::TYPE . '=hit'); ?>"><?php echo __('Cache Hit', 'litespeed-cache'); ?></a>
		<a style="padding-right:10px;" href="<?php echo admin_url('admin.php?page=litespeed-crawler&' . Router::TYPE . '=miss'); ?>"><?php echo __('Cache Miss', 'litespeed-cache'); ?></a>
		<a style="padding-right:10px;" href="<?php echo admin_url('admin.php?page=litespeed-crawler&' . Router::TYPE . '=blacklisted'); ?>"><?php echo __('Blocklisted', 'litespeed-cache'); ?></a>

	</div>

	<div class="">
		<?php echo $pagination; ?>
	</div>
</div>

<div class="litespeed-table-responsive">
	<table class="wp-list-table widefat striped">
		<thead>
			<tr>
				<th scope="col">#</th>
				<th scope="col"><?php echo __('URL', 'litespeed-cache'); ?></th>
				<th scope="col"><?php echo __('Crawler Status', 'litespeed-cache'); ?></th>
				<th scope="col"><?php echo __('Operation', 'litespeed-cache'); ?></th>
			</tr>
		</thead>
		<tbody>
			<?php foreach ($list as $i => $v) : ?>
				<tr>
					<td><?php echo $i + 1; ?></td>
					<td>
						<?php echo $v['url']; ?>
					</td>
					<td>
						<?php echo Crawler::cls()->display_status($v['res'], $v['reason']); ?>
					</td>
					<td>
						<a href="<?php echo Utility::build_url(Router::ACTION_CRAWLER, Crawler::TYPE_BLACKLIST_ADD, false, null, array('id' => $v['id'])); ?>" class="button button-secondary"><?php echo __('Add to Blocklist', 'litespeed-cache'); ?></a>
					</td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
</div> 

<?php echo $pagination; ?>

<p>
	<i class="litespeed-dot litespeed-bg-success"></i> = <?php echo __('Cache Hit', 'litespeed-cache'); ?><br>
	<i class="litespeed-dot litespeed-bg-primary"></i> = <?php echo __('Cache Miss', 'litespeed-cache'); ?><br>
	<i class="litespeed-dot litespeed-bg-warning"></i> = <?php echo __('Blocklisted due to not cacheable', 'litespeed-cache'); ?><br>
	<i class="litespeed-dot litespeed-bg-danger"></i> = <?php echo __('Blocklisted', 'litespeed-cache'); ?><br>
</p>crawler/settings.tpl.php000064400000012332151540355030011354 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$this->form_action();
?>

<h3 class="litespeed-title-short">
	<?php echo __('Crawler General Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/crawler/#general-settings-tab'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th>
				<?php $id = Base::O_CRAWLER; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('This will enable crawler cron.', 'litespeed-cache'); ?>
					<br /><?php Doc::notice_htaccess(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CRAWLER_CRAWL_INTERVAL; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id); ?> <?php echo __('seconds', 'litespeed-cache'); ?>
				<div class="litespeed-desc">
					<?php echo __('Specify how long in seconds before the crawler should initiate crawling the entire sitemap again.', 'litespeed-cache'); ?>
					<?php $this->recommended($id); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CRAWLER_SITEMAP; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('The crawler will use your XML sitemap or sitemap index. Enter the full URL to your sitemap here.', 'litespeed-cache'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CRAWLER_LOAD_LIMIT; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id); ?>
				<div class="litespeed-desc">
					<?php echo __('The maximum average server load allowed while crawling. The number of crawler threads in use will be actively reduced until average server load falls under this limit. If this cannot be achieved with a single thread, the current crawler run will be terminated.', 'litespeed-cache');
					?>

					<?php if (!empty($_SERVER[Base::ENV_CRAWLER_LOAD_LIMIT_ENFORCE])) : ?>
						<font class="litespeed-warning">
							<?php echo __('NOTE', 'litespeed-cache'); ?>:
							<?php echo __('Server enforced value', 'litespeed-cache'); ?>: <code><?php echo $_SERVER[Base::ENV_CRAWLER_LOAD_LIMIT_ENFORCE]; ?></code>
						</font>
					<?php elseif (!empty($_SERVER[Base::ENV_CRAWLER_LOAD_LIMIT])) : ?>
						<font class="litespeed-warning">
							<?php echo __('NOTE', 'litespeed-cache'); ?>:
							<?php echo __('Server allowed max value', 'litespeed-cache'); ?>: <code><?php echo $_SERVER[Base::ENV_CRAWLER_LOAD_LIMIT]; ?></code>
						</font>
					<?php endif; ?>

					<br />
					<?php $this->_api_env_var(Base::ENV_CRAWLER_LOAD_LIMIT, Base::ENV_CRAWLER_LOAD_LIMIT_ENFORCE); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CRAWLER_ROLES; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id, 20); ?>

				<div class="litespeed-desc">
					<?php echo __('To crawl the site as a logged-in user, enter the user ids to be simulated.', 'litespeed-cache'); ?>
					<?php Doc::one_per_line(); ?>

					<?php if (empty($this->conf(Base::O_SERVER_IP))) : ?>
						<div class="litespeed-danger litespeed-text-bold">
							🚨
							<?php echo __('NOTICE', 'litespeed-cache'); ?>:
							<?php echo sprintf(__('You must set %s before using this feature.', 'litespeed-cache'), Lang::title(Base::O_SERVER_IP)); ?>
							<?php echo Doc::learn_more(admin_url('admin.php?page=litespeed-general#settings'), __('Click here to set.', 'litespeed-cache'), true, false, true); ?>
						</div>
					<?php endif; ?>

					<?php if (empty($this->conf(Base::O_ESI))) : ?>
						<div class="litespeed-danger litespeed-text-bold">
							🚨
							<?php echo __('NOTICE', 'litespeed-cache'); ?>:
							<?php echo sprintf(__('You must set %1$s to %2$s before using this feature.', 'litespeed-cache'), Lang::title(Base::O_ESI), __('ON', 'litespeed-cache')); ?>
							<?php echo Doc::learn_more(admin_url('admin.php?page=litespeed-cache#esi'), __('Click here to set.', 'litespeed-cache'), true, false, true); ?>
						</div>
					<?php endif; ?>
				</div>

			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_CRAWLER_COOKIES; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->enroll($id . '[name][]'); ?>
				<?php $this->enroll($id . '[vals][]'); ?>

				<div id="litespeed_crawler_simulation_div"></div>

				<script type="text/babel">
					ReactDOM.render(
					<CrawlerSimulate list={ <?php echo json_encode($this->conf($id)); ?> } />,
					document.getElementById( 'litespeed_crawler_simulation_div' )
				);
			</script>

				<div class="litespeed-desc">
					<?php echo __('To crawl for a particular cookie, enter the cookie name, and the values you wish to crawl for. Values should be one per line. There will be one crawler created per cookie value, per simulated role.', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/crawler/#cookie-simulation'); ?>
					<p><?php echo sprintf(__('Use %1$s in %2$s to indicate this cookie has not been set.', 'litespeed-cache'), '<code>_null</code>', __('Cookie Values', 'litespeed-cache')); ?></p>
				</div>

			</td>
		</tr>


	</tbody>
</table>

<?php
$this->form_end();
crawler/summary.tpl.php000064400000024706151540355030011221 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$__crawler = Crawler::cls();
$crawler_list = $__crawler->list_crawlers();

$summary = Crawler::get_summary();
if ($summary['curr_crawler'] >= count($crawler_list)) {
	$summary['curr_crawler'] = 0;
}

$is_running = time() - $summary['is_running'] <= 900;

$disabled = Router::can_crawl() ? '' : 'disabled';
$disabled_tip = '';
if (!$this->conf(Base::O_CRAWLER_SITEMAP)) {
	$disabled = 'disabled';
	$disabled_tip = '<span class="litespeed-callout notice notice-error inline litespeed-left20">' . sprintf(__('You need to set the %s in Settings first before using the crawler', 'litespeed-cache'), '<code>' . Lang::title(Base::O_CRAWLER_SITEMAP) . '</code>') . '</span>';
}

$CRAWLER_RUN_INTERVAL = defined('LITESPEED_CRAWLER_RUN_INTERVAL') ? LITESPEED_CRAWLER_RUN_INTERVAL : 600;
if ($CRAWLER_RUN_INTERVAL > 0) :
	$recurrence = '';
	$hours = (int)floor($CRAWLER_RUN_INTERVAL / 3600);
	if ($hours) {
		if ($hours > 1) {
			$recurrence .= sprintf(__('%d hours', 'litespeed-cache'), $hours);
		} else {
			$recurrence .= sprintf(__('%d hour', 'litespeed-cache'), $hours);
		}
	}
	$minutes = (int)floor(($CRAWLER_RUN_INTERVAL % 3600) / 60);
	if ($minutes) {
		$recurrence .= ' ';
		if ($minutes > 1) {
			$recurrence .= sprintf(__('%d minutes', 'litespeed-cache'), $minutes);
		} else {
			$recurrence .= sprintf(__('%d minute', 'litespeed-cache'), $minutes);
		}
	}
?>

	<h3 class="litespeed-title litespeed-relative">
		<?php echo __('Crawler Cron', 'litespeed-cache'); ?>
		<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/crawler/'); ?>
	</h3>

	<?php if (!Router::can_crawl()) : ?>
		<div class="litespeed-callout notice notice-error inline">
			<h4><?php echo __('WARNING', 'litespeed-cache'); ?></h4>
			<p><?php echo __('The crawler feature is not enabled on the LiteSpeed server. Please consult your server admin or hosting provider.', 'litespeed-cache'); ?></p>
			<p><?php echo sprintf(__('See <a %s>Introduction for Enabling the Crawler</a> for detailed information.', 'litespeed-cache'), 'href="https://docs.litespeedtech.com/lscache/lscwp/admin/#enabling-and-limiting-the-crawler" target="_blank"'); ?></p>
		</div>
	<?php endif; ?>


	<?php if ($summary['this_full_beginning_time']) : ?>
		<p>
			<b><?php echo __('Current sitemap crawl started at', 'litespeed-cache'); ?>:</b>
			<?php echo Utility::readable_time($summary['this_full_beginning_time']); ?>
		</p>

		<?php if (!$is_running) : ?>
			<p>
				<b><?php echo __('The next complete sitemap crawl will start at', 'litespeed-cache'); ?>:</b>
				<?php echo date('m/d/Y H:i:s', $summary['this_full_beginning_time'] + LITESPEED_TIME_OFFSET + $summary['last_full_time_cost'] + $this->conf(Base::O_CRAWLER_CRAWL_INTERVAL)); ?>
			<?php endif; ?>
			</p>

		<?php endif; ?>
		<?php if ($summary['last_full_time_cost']) : ?>
			<p>
				<b><?php echo __('Last complete run time for all crawlers', 'litespeed-cache'); ?>:</b>
				<?php echo sprintf(__('%d seconds', 'litespeed-cache'), $summary['last_full_time_cost']); ?>
			</p>
		<?php endif; ?>

		<?php if ($summary['last_crawler_total_cost']) : ?>
			<p>
				<b><?php echo __('Run time for previous crawler', 'litespeed-cache'); ?>:</b>
				<?php echo sprintf(__('%d seconds', 'litespeed-cache'), $summary['last_crawler_total_cost']); ?>
			</p>
		<?php endif; ?>

		<?php if ($summary['curr_crawler_beginning_time']) : ?>
			<p>
				<b><?php echo __('Current crawler started at', 'litespeed-cache'); ?>:</b>
				<?php echo Utility::readable_time($summary['curr_crawler_beginning_time']); ?>
			</p>
		<?php endif; ?>

		<p>
			<b><?php echo __('Current server load', 'litespeed-cache'); ?>:</b>
			<?php echo $__crawler->get_server_load(); ?>
		</p>

		<?php if ($summary['last_start_time']) : ?>
			<p class='litespeed-desc'>
				<b><?php echo __('Last interval', 'litespeed-cache'); ?>:</b>
				<?php echo Utility::readable_time($summary['last_start_time']); ?>
			</p>
		<?php endif; ?>

		<?php if ($summary['end_reason']) : ?>
			<p class='litespeed-desc'>
				<b><?php echo __('Ended reason', 'litespeed-cache'); ?>:</b>
				<?php echo esc_html($summary['end_reason']); ?>
			</p>
		<?php endif; ?>

		<?php if ($summary['last_crawled']) : ?>
			<p class='litespeed-desc'>
				<?php echo sprintf(__('<b>Last crawled:</b> %s item(s)', 'litespeed-cache'), $summary['last_crawled']); ?>
			</p>
		<?php endif; ?>

		<p>
			<?php echo " <a href='" . Utility::build_url(Router::ACTION_CRAWLER, Crawler::TYPE_RESET) . "' class='button litespeed-btn-warning'>" . __('Reset position', 'litespeed-cache') . "</a>";

			$href = Router::can_crawl() ? Utility::build_url(Router::ACTION_CRAWLER, Crawler::TYPE_START) : 'javascript:;';
			echo " <a href='$href' id='litespeed_manual_trigger' class='button litespeed-btn-success' litespeed-accesskey='R' $disabled>" . __('Manually run', 'litespeed-cache') . "</a>";

			echo $disabled_tip;
			?>
		</p>

		<div class="litespeed-table-responsive">
			<table class="wp-list-table widefat striped" data-crawler-list>
				<thead>
					<tr>
						<th scope="col">#</th>
						<th scope="col"><?php echo __('Cron Name', 'litespeed-cache'); ?></th>
						<th scope="col"><?php echo __('Run Frequency', 'litespeed-cache'); ?></th>
						<th scope="col"><?php echo __('Status', 'litespeed-cache'); ?></th>
						<th scope="col"><?php echo __('Activate', 'litespeed-cache'); ?></th>
						<th scope="col"><?php echo __('Running', 'litespeed-cache'); ?></th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($crawler_list as $i => $v) :
						$hit = !empty($summary['crawler_stats'][$i][Crawler::STATUS_HIT]) ? $summary['crawler_stats'][$i][Crawler::STATUS_HIT] : 0;
						$miss = !empty($summary['crawler_stats'][$i][Crawler::STATUS_MISS]) ? $summary['crawler_stats'][$i][Crawler::STATUS_MISS] : 0;

						$blacklisted = !empty($summary['crawler_stats'][$i][Crawler::STATUS_BLACKLIST]) ? $summary['crawler_stats'][$i][Crawler::STATUS_BLACKLIST] : 0;
						$blacklisted += !empty($summary['crawler_stats'][$i][Crawler::STATUS_NOCACHE]) ? $summary['crawler_stats'][$i][Crawler::STATUS_NOCACHE] : 0;

						if (isset($summary['crawler_stats'][$i][Crawler::STATUS_WAIT])) {
							$waiting = $summary['crawler_stats'][$i][Crawler::STATUS_WAIT] ?: 0;
						} else {
							$waiting = $summary['list_size'] - $hit - $miss - $blacklisted;
						}
					?>
						<tr>
							<td>
								<?php
								echo $i + 1;
								if ($i == $summary['curr_crawler']) {
									echo "<img class='litespeed-crawler-curr' src='" . LSWCP_PLUGIN_URL . "assets/img/Litespeed.icon.svg' />";
								}
								?>
							</td>
							<td>
								<?php echo $v['title']; ?>
							</td>
							<td><?php echo $recurrence; ?></td>
							<td>
								<?php echo '<i class="litespeed-badge litespeed-bg-default" data-balloon-pos="up" aria-label="' . __('Waiting', 'litespeed-cache') . '">' . ($waiting ?: '-') . '</i> '; ?>
								<?php echo '<i class="litespeed-badge litespeed-bg-success" data-balloon-pos="up" aria-label="' . __('Hit', 'litespeed-cache') . '">' . ($hit ?: '-') . '</i> '; ?>
								<?php echo '<i class="litespeed-badge litespeed-bg-primary" data-balloon-pos="up" aria-label="' . __('Miss', 'litespeed-cache') . '">' . ($miss ?: '-') . '</i> '; ?>
								<?php echo '<i class="litespeed-badge litespeed-bg-danger" data-balloon-pos="up" aria-label="' . __('Blocklisted', 'litespeed-cache') . '">' . ($blacklisted ?: '-') . '</i> '; ?>
							</td>
							<td>
								<?php $this->build_toggle('litespeed-crawler-' . $i,  $__crawler->is_active($i)); ?>

								<?php if (!empty($v['uid']) && empty($this->conf(Base::O_SERVER_IP))) : ?>
									<div class="litespeed-danger litespeed-text-bold">
										🚨
										<?php echo __('NOTICE', 'litespeed-cache'); ?>:
										<?php echo sprintf(__('You must set %s before using this feature.', 'litespeed-cache'), Lang::title(Base::O_SERVER_IP)); ?>
										<?php echo Doc::learn_more(admin_url('admin.php?page=litespeed-general#settings'), __('Click here to set.', 'litespeed-cache'), true, false, true); ?>
									</div>
								<?php endif; ?>

							</td>
							<td>
								<?php
								if ($i == $summary['curr_crawler']) {
									echo "Position: " . ($summary['last_pos'] + 1);
									if ($is_running) {
										echo " <span class='litespeed-label-success'>" . __('running', 'litespeed-cache') . "</span>";
									}
								}
								?>
							</td>
						</tr>
					<?php endforeach; ?>
				</tbody>
			</table>
		</div>

		<p>
			<i class="litespeed-badge litespeed-bg-default"></i> = <?php echo __('Waiting to be Crawled', 'litespeed-cache'); ?><br>
			<i class="litespeed-badge litespeed-bg-success"></i> = <?php echo __('Already Cached', 'litespeed-cache'); ?><br>
			<i class="litespeed-badge litespeed-bg-primary"></i> = <?php echo __('Successfully Crawled', 'litespeed-cache'); ?><br>
			<i class="litespeed-badge litespeed-bg-danger"></i> = <?php echo __('Blocklisted', 'litespeed-cache'); ?><br>
		</p>

		<div class="litespeed-desc">
			<div><?php echo __('Run frequency is set by the Interval Between Runs setting.', 'litespeed-cache'); ?></div>
			<div><?php echo __('Crawlers cannot run concurrently.', 'litespeed-cache')
						. __('&nbsp;If both the cron and a manual run start at similar times, the first to be started will take precedence.', 'litespeed-cache'); ?></div>
			<div><?php echo sprintf(__('Please see <a %s>Hooking WP-Cron Into the System Task Scheduler</a> to learn how to create the system cron task.', 'litespeed-cache'), ' href="https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/" target="_blank" '); ?></div>
		</div>
	<?php endif; ?>


	<h3 class="litespeed-title"><?php echo __('Watch Crawler Status', 'litespeed-cache'); ?></h3>

	<?php
	$ajaxUrl = $__crawler->json_path();
	if ($ajaxUrl) :
	?>

		<input type="button" id="litespeed-crawl-url-btn" value="<?php echo __('Show crawler status', 'litespeed-cache'); ?>" class="button button-secondary" data-url="<?php echo $ajaxUrl; ?>" />

		<div class="litespeed-shell litespeed-hide">
			<div class="litespeed-shell-header-bar"></div>
			<div class="litespeed-shell-header">
				<div class="litespeed-shell-header-bg"></div>
				<div class="litespeed-shell-header-icon-container">
					<img id="litespeed-shell-icon" src="<?php echo LSWCP_PLUGIN_URL . 'assets/img/Litespeed.icon.svg'; ?>" />
				</div>
			</div>
			<ul class="litespeed-shell-body">
				<li>Start watching...</li>
				<li id="litespeed-loading-dot"></li>
			</ul>
		</div>

	<?php else : ?>
		<p>
			<?php echo __('No crawler meta file generated yet', 'litespeed-cache'); ?>
		</p>
	<?php endif; ?>dash/dashboard.tpl.php000064400000115525151540355030010733 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$health_scores = Health::cls()->scores();

$crawler_summary = Crawler::get_summary();

// Image related info
$img_optm_summary = Img_Optm::get_summary();
$img_count = Img_Optm::cls()->img_count();
$img_finished_percentage = 0;
if ($img_count['groups_all']) $img_finished_percentage = 100 - floor($img_count['groups_new'] * 100 / $img_count['groups_all']);
if ($img_finished_percentage == 100 && $img_count['groups_new']) {
	$img_finished_percentage = 99;
}

$__cloud = Cloud::cls();
$__cloud->finish_qc_activation();

$cloud_summary = Cloud::get_summary();
$css_summary = CSS::get_summary();
$ucss_summary = UCSS::get_summary();
$placeholder_summary = Placeholder::get_summary();
$vpi_summary = VPI::get_summary();

$ccss_count = count($this->load_queue('ccss'));
$ucss_count = count($this->load_queue('ucss'));
$placeholder_queue_count = count($this->load_queue('lqip'));
$vpi_queue_count = count($this->load_queue('vpi'));

$can_page_load_time = defined('LITESPEED_SERVER_TYPE') && LITESPEED_SERVER_TYPE !== 'NONE';
?>

<div class="litespeed-dashboard">

	<?php if (!$__cloud->activated() && !Admin_Display::has_qc_hide_banner()) : ?>
		<div class="litespeed-dashboard-group">
			<div class="litespeed-flex-container">

				<div class="postbox litespeed-postbox litespeed-postbox-cache">
					<div class="inside">
						<h3 class="litespeed-title">
							<?php echo __('Cache Status', 'litespeed-cache'); ?>
							<a href="<?php echo admin_url('admin.php?page=litespeed-cache'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
						</h3>

						<?php
						$cache_list = array(
							Base::O_CACHE			=> __('Public Cache', 'litespeed-cache'),
							Base::O_CACHE_PRIV		=> __('Private Cache', 'litespeed-cache'),
							Base::O_OBJECT			=> __('Object Cache', 'litespeed-cache'),
							Base::O_CACHE_BROWSER	=> __('Browser Cache', 'litespeed-cache'),
						);
						foreach ($cache_list as $id => $title) :
						?>
							<p>
								<?php if ($this->conf($id)) : ?>
									<span class="litespeed-label-success litespeed-label-dashboard">ON</span>
								<?php else : ?>
									<span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
								<?php endif; ?>
								<?php echo esc_html($title); ?>
							</p>
						<?php endforeach; ?>
					</div>
				</div>

				<div class="postbox litespeed-postbox litespeed-postbox-crawler">
					<div class="inside">
						<h3 class="litespeed-title">
							<?php echo __('Crawler Status', 'litespeed-cache'); ?>
							<a href="<?php echo admin_url('admin.php?page=litespeed-crawler'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
						</h3>

						<p>
							<code><?php echo count(Crawler::cls()->list_crawlers()); ?></code> <?php echo __('Crawler(s)', 'litespeed-cache'); ?>
						</p>
						<p>
							<?php echo __('Currently active crawler', 'litespeed-cache'); ?>: <code><?php echo esc_html($crawler_summary['curr_crawler']); ?></code>
						</p>

						<?php if ($crawler_summary['curr_crawler_beginning_time']) : ?>
							<p>
								<b><?php echo __('Current crawler started at', 'litespeed-cache'); ?>:</b>
								<?php echo Utility::readable_time($crawler_summary['curr_crawler_beginning_time']); ?>
							</p>
						<?php endif; ?>

						<?php if ($crawler_summary['last_start_time']) : ?>
							<p class='litespeed-desc'>
								<b><?php echo __('Last interval', 'litespeed-cache'); ?>:</b>
								<?php echo Utility::readable_time($crawler_summary['last_start_time']); ?>
							</p>
						<?php endif; ?>

						<?php if ($crawler_summary['end_reason']) : ?>
							<p class='litespeed-desc'>
								<b><?php echo __('Ended reason', 'litespeed-cache'); ?>:</b>
								<?php echo esc_html($crawler_summary['end_reason']); ?>
							</p>
						<?php endif; ?>

						<?php if ($crawler_summary['last_crawled']) : ?>
							<p class='litespeed-desc'>
								<?php echo sprintf(__('<b>Last crawled:</b> %d item(s)', 'litespeed-cache'), $crawler_summary['last_crawled']); ?>
							</p>
						<?php endif; ?>

					</div>
				</div>

				<?php $news = $__cloud->load_qc_status_for_dash('news_dash_guest'); ?>
				<?php if ($news) : ?>
					<div class="postbox litespeed-postbox">
						<div class="inside litespeed-text-center">
							<h3 class="litespeed-title">
								<?php echo __('News', 'litespeed-cache'); ?>
							</h3>
							<div class="litespeed-top20">
								<?php echo $news; ?>
							</div>
						</div>
					</div>
				<?php endif; ?>
			</div>

		</div>

	<?php endif; ?>

	<div class="litespeed-dashboard-qc">
		<?php if (!$__cloud->activated() && !Admin_Display::has_qc_hide_banner()) : ?>
			<div class="litespeed-dashboard-unlock">
				<div>
					<h3 class="litespeed-dashboard-unlock-title">
						<strong class="litespeed-qc-text-gradient">
							<?php _e('Accelerate, Optimize, Protect', 'litespeed-cache'); ?>
						</strong>
					</h3>
					<p class="litespeed-dashboard-unlock-desc"><?php _e('Speed up your WordPress site even further with <strong>QUIC.cloud Online Services and CDN</strong>.', 'litespeed-cache'); ?></p>
					<p>
						<?php _e('Free monthly quota available. Can also be used anonymously (no email required).', 'litespeed-cache'); ?>
					</p>
					<p>
						<a class="button button-primary" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE); ?>">
							<span class="dashicons dashicons-yes"></span>
							<?php _e('Enable QUIC.cloud services', 'litespeed-cache'); ?>
						</a>
						<br><a class="button button-link litespeed-top10" href="<?php echo Utility::build_url(Router::ACTION_ADMIN_DISPLAY, Admin_Display::TYPE_QC_HIDE_BANNER); ?>"><?php _e('Do not show this again', 'litespeed-cache'); ?></a>

					</p>
					<p class="litespeed-dashboard-unlock-footer">
						<?php _e('QUIC.cloud provides CDN and online optimization services, and is not required. You may use many features of this plugin without QUIC.cloud.', 'litespeed-cache'); ?><br>
						<a href="https://www.quic.cloud/" target="_blank">
							<?php _e('Learn More about QUIC.cloud', 'litespeed-cache'); ?>
						</a>
						<br>
					</p>
				</div>
			</div>
		<?php endif; ?>

		<div class="litespeed-dashboard-qc-enable">

			<div class="litespeed-dashboard-header">
				<h3 class="litespeed-dashboard-title litespeed-dashboard-title--w-btn">
					<span class="litespeed-right10"><?php echo __('QUIC.cloud Service Usage Statistics', 'litespeed-cache'); ?></span>
					<a href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_SYNC_USAGE); ?>" class="button button-secondary button-small">
						<span class="dashicons dashicons-update"></span> <?php echo __('Refresh Usage', 'litespeed-cache'); ?>
						<span class="screen-reader-text"><?php echo __('Sync data from Cloud', 'litespeed-cache'); ?></span>
					</a>
				</h3>
				<hr>
				<a href="https://docs.litespeedtech.com/lscache/lscwp/dashboard/#usage-statistics" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache'); ?></a>
			</div>

			<?php if (!$__cloud->activated() && Admin_Display::has_qc_hide_banner()) : ?>
				<p class="litespeed-desc litespeed-margin-top-remove"><?php echo __('The features below are provided by', 'litespeed-cache'); ?> <a href="<?php echo admin_url('admin.php?page=litespeed-general'); ?>">QUIC.cloud</a></p>
			<?php endif; ?>


			<div class="litespeed-dashboard-stats-wrapper">
				<?php
				$cat_list = array(
					'img_optm'	=> __('Image Optimization', 'litespeed-cache'),
					'page_optm'	=> __('Page Optimization', 'litespeed-cache'),
					'cdn'		=> __('CDN Bandwidth', 'litespeed-cache'),
					'lqip'		=> __('Low Quality Image Placeholder', 'litespeed-cache'),
				);

				foreach ($cat_list as $svc => $title) :
					$finished_percentage = 0;
					$total_used = $used = $quota = $pag_used = $pag_total = '-';
					$pag_width = 0;
					$percentage_bg = 'success';
					$pag_txt_color = '';
					$usage = false;

					if (!empty($cloud_summary['usage.' . $svc])) {
						$usage = $cloud_summary['usage.' . $svc];
						$finished_percentage = floor($usage['used'] * 100 / $usage['quota']);
						$used = (int)$usage['used'];
						$quota = (int)$usage['quota'];
						$pag_used = !empty($usage['pag_used']) ? (int)$usage['pag_used'] : 0;
						$pag_bal = !empty($usage['pag_bal']) ? (int)$usage['pag_bal'] : 0;
						$pag_total = $pag_used + $pag_bal;
						if (!empty($usage['total_used'])) {
							$total_used = (int)$usage['total_used'];
						}

						if ($pag_total) {
							// $finished_percentage = floor( ($pag_used+$usage[ 'used' ]) * 100 / ($usage[ 'quota' ]+$pag_total) );
							$pag_width = round($pag_used / $pag_total * 100) . '%';
						}

						if ($finished_percentage > 85) {
							$percentage_bg = 'warning';
							if ($finished_percentage > 95) {
								$percentage_bg = 'danger';
								if ($pag_bal) { // is using PAG quota
									$percentage_bg = 'warning';
									$pag_txt_color = 'litespeed-success';
								}
							}
						}

						if ($svc == 'cdn') {
							// $used = Utility::real_size( $used * 1000000 * 100, true );
							// $quota = Utility::real_size( $quota * 1000000 * 100, true );
							// $pag_used = Utility::real_size( $pag_used * 1000000 * 100, true );
							// $pag_bal = Utility::real_size( $pag_bal * 1000000 * 100, true );
						}
					}

				?>
					<div class="postbox litespeed-postbox">
						<div class="inside">
							<h3 class="litespeed-title"><?php echo $title; ?></h3>

							<div class="litespeed-flex-container">
								<div class="litespeed-icon-vertical-middle litespeed-pie-<?php echo $percentage_bg; ?>">
									<?php echo GUI::pie($finished_percentage, 60, false); ?>
								</div>
								<div>
									<div class="litespeed-dashboard-stats">
										<h3><?php echo ($svc == 'img_optm' ? __('Fast Queue Usage', 'litespeed-cache') : __('Usage', 'litespeed-cache')); ?></h3>
										<p>
											<strong><?php echo $used; ?></strong>
											<?php if ($used != $quota) { ?>
												<span class="litespeed-desc"> of <?php echo $quota; ?></span>
											<?php } ?>
										</p>
									</div>
								</div>
							</div>

							<?php if ($pag_total > 0) { ?>
								<p class="litespeed-dashboard-stats-payg <?php echo $pag_txt_color; ?>">
									<?php echo __('PAYG Balance', 'litespeed-cache'); ?>: <strong><?php echo $pag_bal; ?></strong>
									<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo __('PAYG used this month', 'litespeed-cache'); ?>: <?php echo $pag_used; ?>. <?php echo __('PAYG balance and usage not included in above quota calculation.', 'litespeed-cache'); ?>">
										<span class="dashicons dashicons-info"></span>
										<span class="screen-reader-text"><?php echo __('Pay as You Go Usage Statistics', 'litespeed-cache'); ?></span>
									</button>
								</p>
							<?php } ?>

							<?php if ($svc == 'page_optm') : ?>
								<?php if (!empty($usage['sub_svc'])) : ?>
									<p class="litespeed-dashboard-stats-total">
										<?php $i = 0;
										foreach ($usage['sub_svc'] as $sub_svc => $sub_usage) : ?>
											<span class="<?php if ($i++ > 0) echo 'litespeed-left10'; ?>"><?php echo strtoupper(esc_html($sub_svc)); ?>: <strong><?php echo (int)$sub_usage; ?></strong></span>
										<?php endforeach; ?>
									</p>
								<?php endif; ?>
							<?php endif; ?>

							<?php if ($svc == 'img_optm') { ?>
								<p class="litespeed-dashboard-stats-total">
									<?php echo __('Total Usage', 'litespeed-cache'); ?>: <strong><?php echo $total_used; ?> / ∞</strong>
									<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo __('Total images optimized in this month', 'litespeed-cache'); ?>">
										<span class="dashicons dashicons-info"></span>
									</button>
								</p>
								<div class="clear"></div>
							<?php } ?>

							<?php if (isset($usage['remaining_daily_quota']) && $usage['remaining_daily_quota'] >= 0 && isset($usage['daily_quota']) && $usage['daily_quota'] >= 0) { ?>
								<p class="litespeed-dashboard-stats-total">
									<?php echo __('Remaining Daily Quota', 'litespeed-cache'); ?>: <strong><?php echo $usage['remaining_daily_quota']; ?> / <?php echo $usage['daily_quota']; ?></strong>
								</p>
								<div class="clear"></div>
							<?php } ?>
						</div>
					</div>
				<?php endforeach; ?>

				<?php if (!empty($cloud_summary['partner'])) : ?>
					<div class="litespeed-postbox litespeed-postbox-partner">
						<div class="inside">
							<h3 class="litespeed-title"><?php echo __('Partner Benefits Provided by', 'litespeed-cache'); ?></h3>
							<div>

								<?php if (!empty($cloud_summary['partner']['logo'])) : ?>
									<?php if (!empty($cloud_summary['partner']['url'])) : ?>
										<a href="<?php echo $cloud_summary['partner']['url']; ?>" target="_blank"><img src="<?php echo $cloud_summary['partner']['logo']; ?>" alt="<?php echo $cloud_summary['partner']['name']; ?>"></a>
									<?php else : ?>
										<img src="<?php echo $cloud_summary['partner']['logo']; ?>" alt="<?php echo $cloud_summary['partner']['name']; ?>">
									<?php endif; ?>
								<?php elseif (!empty($cloud_summary['partner']['name'])) : ?>
									<?php if (!empty($cloud_summary['partner']['url'])) : ?>
										<a href="<?php echo $cloud_summary['partner']['url']; ?>" target="_blank"><span class="postbox-partner-name"><?php echo $cloud_summary['partner']['name']; ?></span></a>
									<?php else : ?>
										<span class="postbox-partner-name"><?php echo $cloud_summary['partner']['name']; ?></span>
									<?php endif; ?>
								<?php endif; ?>

							</div>
						</div>
					</div>
				<?php endif; ?>
			</div>

			<p class="litespeed-right litespeed-qc-dashboard-link">

				<?php if (!empty($cloud_summary['partner']) && !empty($cloud_summary['partner']['login_title']) && !empty($cloud_summary['partner']['login_link'])) : ?>
					<?php Doc::learn_more($cloud_summary['partner']['login_link'], $cloud_summary['partner']['login_title'], true, 'button litespeed-btn-warning'); ?>
				<?php elseif (!empty($cloud_summary['partner']) && !empty($cloud_summary['partner']['disable_qc_login'])) : ?>
				<?php else : ?>
					<?php if (!$__cloud->activated()) : ?>
						<?php Doc::learn_more(
							Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE),
							__('Enable QUIC.cloud Services', 'litespeed-cache'),
							true,
							'button litespeed-btn-warning'
						); ?>
					<?php elseif (!empty($cloud_summary['qc_activated']) && $cloud_summary['qc_activated'] != 'anonymous') : ?>
						<a href="<?php echo $__cloud->qc_link(); ?>" class="litespeed-link-with-icon" target="qc"><?php echo __('Go to QUIC.cloud dashboard', 'litespeed-cache'); ?> <span class="dashicons dashicons-external"></span></a>
					<?php else : ?>
						<?php Doc::learn_more(
							Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_LINK),
							__('Link to QUIC.cloud', 'litespeed-cache'),
							true,
							'button litespeed-btn-warning'
						); ?>
					<?php endif; ?>
				<?php endif; ?>
			</p>

			<div class="litespeed-dashboard-group">
				<hr>
				<div class="litespeed-flex-container">

					<div class="postbox litespeed-postbox litespeed-postbox-pagetime">
						<div class="inside">
							<h3 class="litespeed-title">
								<?php echo __('Page Load Time', 'litespeed-cache'); ?>

								<?php if ($can_page_load_time) : ?>
									<?php $closest_server = Cloud::get_summary('server.' . CLoud::SVC_HEALTH); ?>
									<?php if ($closest_server) : ?>
										<a href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array('svc' => Cloud::SVC_HEALTH)); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo sprintf(__('Current closest Cloud server is %s.&#10;Click to redetect.', 'litespeed-cache'), $closest_server); ?>' data-litespeed-cfm="<?php echo __('Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache'); ?>" class="litespeed-title-right-icon"><i class='litespeed-quic-icon'></i> <small><?php echo __('Redetect', 'litespeed-cache'); ?></small></a>
									<?php endif; ?>
								<?php endif; ?>
							</h3>

							<div>
								<div class="litespeed-flex-container">
									<?php if ($can_page_load_time) : ?>
										<?php if ($health_scores['speed_before']) : ?>
											<div class="litespeed-score-col">
												<p class="litespeed-text-grey">
													<?php echo __('Before', 'litespeed-cache'); ?>
												</p>
												<div class="litespeed-text-md litespeed-text-grey">
													<?php echo $health_scores['speed_before']; ?><span class="litespeed-text-large">s</span>
												</div>

											</div>
											<div class="litespeed-score-col">
												<p class="litespeed-text-grey">
													<?php echo __('After', 'litespeed-cache'); ?>
												</p>
												<div class="litespeed-text-md litespeed-text-success">
													<?php echo $health_scores['speed_after']; ?><span class="litespeed-text-large">s</span>
												</div>
											</div>
											<div class="litespeed-score-col litespeed-score-col--imp">
												<p class="litespeed-text-grey" style="white-space: nowrap;">
													<?php echo __('Improved by', 'litespeed-cache'); ?>
												</p>
												<div class="litespeed-text-jumbo litespeed-text-success">
													<?php echo $health_scores['speed_improved']; ?><span class="litespeed-text-large">%</span>
												</div>
											</div>
										<?php endif; ?>
									<?php else : ?>
										<div>
											<p><?php _e('You must be using one of the following products in order to measure Page Load Time:', 'litespeed-cache'); ?></p>
											<a href="https://www.litespeedtech.com/products/litespeed-web-server" target="_blank">LiteSpeed Web Server</a>
											<br />
											<a href="https://openlitespeed.org/" target="_blank">OpenLiteSpeed Web Server</a>
											<br />
											<a href="https://www.litespeedtech.com/products/litespeed-web-adc" target="_blank">LiteSpeed Web ADC</a>
											<br />
											<a href="https://quic.cloud" target="_blank">QUIC.cloud CDN</a>
										</div>
									<?php endif; ?>

								</div>
							</div>
						</div>

						<?php if ($can_page_load_time) : ?>
							<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
								<?php if (!empty($cloud_summary['last_request.health-speed'])) : ?>
									<span class="litespeed-right10">
										<?php echo __('Last requested', 'litespeed-cache') . ': <span data-balloon-pos="up" aria-label="' . Utility::readable_time($cloud_summary['last_request.health-speed']) . '">' . sprintf(__(' %s ago', 'litespeed-cache'), human_time_diff($cloud_summary['last_request.health-speed'])) . '</span>'; ?>
									</span>
								<?php endif; ?>

								<a href="<?php echo Utility::build_url(Router::ACTION_HEALTH, Health::TYPE_SPEED); ?>" class="button button-secondary button-small">
									<span class="dashicons dashicons-update"></span>
									<?php echo __('Refresh', 'litespeed-cache'); ?>
									<span class="screen-reader-text"><?php echo __('Refresh page load time', 'litespeed-cache'); ?></span>
								</a>
							</div>
						<?php endif; ?>
					</div>

					<div class="postbox litespeed-postbox litespeed-postbox-pagespeed">
						<div class="inside">
							<h3 class="litespeed-title">
								<?php echo __('PageSpeed Score', 'litespeed-cache'); ?>

								<?php $id = Base::O_GUEST; ?>
								<a href="<?php echo admin_url('admin.php?page=litespeed-general'); ?>" class="litespeed-title-right-icon"><?php echo Lang::title($id); ?></a>
								<?php if ($this->conf($id)) : ?>
									<span class="litespeed-label-success litespeed-label-dashboard">ON</span>
								<?php else : ?>
									<span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
								<?php endif; ?>

							</h3>

							<div>

								<div class="litespeed-margin-bottom20">
									<div class="litespeed-row-flex" style="margin-left: -10px;">

										<?php if (!empty($health_scores['score_before'])) : ?>
											<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
												<p class="litespeed-text-grey litespeed-text-center">
													<?php echo __('Before', 'litespeed-cache'); ?>
												</p>
												<div class="litespeed-promo-score">
													<?php echo GUI::pie($health_scores['score_before'], 45, false, true, 'litespeed-pie-' . GUI::cls()->get_cls_of_pagescore($health_scores['score_before'])); ?>
												</div>
											</div>
											<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
												<p class="litespeed-text-grey litespeed-text-center">
													<?php echo __('After', 'litespeed-cache'); ?>
												</p>
												<div class="litespeed-promo-score">
													<?php echo GUI::pie($health_scores['score_after'], 45, false, true, 'litespeed-pie-' . GUI::cls()->get_cls_of_pagescore($health_scores['score_after'])); ?>
												</div>
											</div>
											<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
												<p class="litespeed-text-grey" style="white-space: nowrap;">
													<?php echo __('Improved by', 'litespeed-cache'); ?>
												</p>
												<div class="litespeed-postbox-score-improve litespeed-text-fern">
													<?php echo $health_scores['score_improved']; ?><span class="litespeed-text-large">%</span>
												</div>
											</div>
										<?php endif; ?>

									</div>

								</div>
							</div>
						</div>

						<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
							<?php if (!empty($cloud_summary['last_request.health-score'])) : ?>
								<span class="litespeed-right10">
									<?php echo __('Last requested', 'litespeed-cache') . ': <span data-balloon-pos="up" aria-label="' . Utility::readable_time($cloud_summary['last_request.health-score']) . '">' . sprintf(__(' %s ago', 'litespeed-cache'), human_time_diff($cloud_summary['last_request.health-score'])) . '</span>'; ?>
								</span>
							<?php endif; ?>
							<a href="<?php echo Utility::build_url(Router::ACTION_HEALTH, Health::TYPE_SCORE); ?>" class="button button-secondary button-small">
								<span class="dashicons dashicons-update"></span>
								<?php echo __('Refresh', 'litespeed-cache'); ?>
								<span class="screen-reader-text"><?php echo __('Refresh page score', 'litespeed-cache'); ?></span>
							</a>
						</div>

					</div>

					<div class="postbox litespeed-postbox litespeed-postbox-double litespeed-postbox-imgopt">
						<div class="inside">
							<h3 class="litespeed-title">
								<?php echo __('Image Optimization Summary', 'litespeed-cache'); ?>
								<a href="<?php echo admin_url('admin.php?page=litespeed-img_optm'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
							</h3>
							<div class="litespeed-postbox-double-content">
								<div class="litespeed-postbox-double-col">
									<div class="litespeed-flex-container">
										<div class="litespeed-icon-vertical-middle">
											<?php echo GUI::pie($img_finished_percentage, 70, true); ?>
										</div>
										<div>
											<div class="litespeed-dashboard-stats">
												<a data-litespeed-onlyonce class="button button-primary" <?php if (!empty($img_count['groups_new']) || !empty($img_count['groups.' . Img_Optm::STATUS_RAW])) : ?> href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_NEW_REQ); ?>" <?php else : ?> href='javascript:;' disabled <?php endif; ?>>
													<span class="dashicons dashicons-images-alt2"></span>&nbsp;<?php echo __('Send Optimization Request', 'litespeed-cache'); ?>
												</a>
											</div>
										</div>
									</div>
									<p>
										<?php echo __('Total Reduction', 'litespeed-cache'); ?>: <code><?php echo isset($img_optm_summary['reduced']) ? Utility::real_size($img_optm_summary['reduced']) : '-'; ?></code>
									</p>
									<p>
										<?php echo __('Images Pulled', 'litespeed-cache'); ?>: <code><?php echo isset($img_optm_summary['img_taken']) ? $img_optm_summary['img_taken'] : '-'; ?></code>
									</p>


								</div>
								<div class="litespeed-postbox-double-col">
									<?php if (!empty($img_count['group.' . Img_Optm::STATUS_REQUESTED])) : ?>
										<p class="litespeed-success">
											<?php echo __('Images requested', 'litespeed-cache'); ?>:
											<code>
												<?php echo Admin_Display::print_plural($img_count['group.' . Img_Optm::STATUS_REQUESTED]); ?>
												(<?php echo Admin_Display::print_plural($img_count['img.' . Img_Optm::STATUS_REQUESTED], 'image'); ?>)
											</code>
										</p>
									<?php endif; ?>

									<?php if (!empty($img_count['group.' . Img_Optm::STATUS_NOTIFIED])) : ?>
										<p class="litespeed-success">
											<?php echo __('Images notified to pull', 'litespeed-cache'); ?>:
											<code>
												<?php echo Admin_Display::print_plural($img_count['group.' . Img_Optm::STATUS_NOTIFIED]); ?>
												(<?php echo Admin_Display::print_plural($img_count['img.' . Img_Optm::STATUS_NOTIFIED], 'image'); ?>)
											</code>

										</p>
									<?php endif; ?>

									<p>
										<?php echo __('Last Request', 'litespeed-cache'); ?>: <code><?php echo !empty($img_optm_summary['last_requested']) ? Utility::readable_time($img_optm_summary['last_requested']) : '-'; ?></code>
									</p>
									<p>
										<?php echo __('Last Pull', 'litespeed-cache'); ?>: <code><?php echo !empty($img_optm_summary['last_pull']) ? Utility::readable_time($img_optm_summary['last_pull']) : '-'; ?></code>
									</p>

									<?php
									$cache_list = array(
										Base::O_IMG_OPTM_AUTO	=> Lang::title(Base::O_IMG_OPTM_AUTO),
									);
									foreach ($cache_list as $id => $title) :
									?>
										<p>
											<?php if ($this->conf($id)) : ?>
												<span class="litespeed-label-success litespeed-label-dashboard">ON</span>
											<?php else : ?>
												<span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
											<?php endif; ?>
											<a href="<?php echo admin_url('admin.php?page=litespeed-img_optm#settings'); ?>"><?php echo $title; ?></a>
										</p>
									<?php endforeach; ?>
								</div>
							</div>

						</div>
					</div>

					<div class="postbox litespeed-postbox litespeed-postbox-cache">
						<div class="inside">
							<h3 class="litespeed-title">
								<?php echo __('Cache Status', 'litespeed-cache'); ?>
								<a href="<?php echo admin_url('admin.php?page=litespeed-cache'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
							</h3>

							<?php
							$cache_list = array(
								Base::O_CACHE			=> __('Public Cache', 'litespeed-cache'),
								Base::O_CACHE_PRIV		=> __('Private Cache', 'litespeed-cache'),
								Base::O_OBJECT			=> __('Object Cache', 'litespeed-cache'),
								Base::O_CACHE_BROWSER	=> __('Browser Cache', 'litespeed-cache'),
							);
							foreach ($cache_list as $id => $title) :
							?>
								<p>
									<?php if ($this->conf($id)) : ?>
										<span class="litespeed-label-success litespeed-label-dashboard">ON</span>
									<?php else : ?>
										<span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
									<?php endif; ?>
									<?php echo esc_html($title); ?>
								</p>
							<?php endforeach; ?>
						</div>
					</div>

					<div class="postbox litespeed-postbox litespeed-postbox-ccss">
						<div class="inside">
							<h3 class="litespeed-title">
								<?php echo __('Critical CSS', 'litespeed-cache'); ?>
								<a href="<?php echo admin_url('admin.php?page=litespeed-page_optm#settings_css'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
							</h3>

							<?php if (!empty($css_summary['last_request_ccss'])) : ?>
								<p>
									<?php echo __('Last generated', 'litespeed-cache') . ': <code>' . Utility::readable_time($css_summary['last_request_ccss']) . '</code>'; ?>
								</p>
								<p>
									<?php echo __('Time to execute previous request', 'litespeed-cache') . ': <code>' . esc_html($css_summary['last_spent_ccss']) . 's</code>'; ?>
								</p>
							<?php endif; ?>

							<p>
								<?php echo __('Requests in queue', 'litespeed-cache'); ?>: <code><?php echo $ccss_count ?: '-'; ?></code>
								<a href="<?php echo $ccss_count ? Utility::build_url(Router::ACTION_CSS, CSS::TYPE_GEN_CCSS) : 'javascript:;'; ?>" class="button button-secondary button-small <?php if (!$ccss_count) echo 'disabled'; ?>">
									<?php echo __('Force cron', 'litespeed-cache'); ?>
								</a>
							</p>

						</div>

						<?php if (!empty($cloud_summary['last_request.ccss'])) : ?>
							<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
								<?php echo __('Last requested', 'litespeed-cache') . ': ' . Utility::readable_time($cloud_summary['last_request.ccss']) ?>
							</div>
						<?php endif; ?>
					</div>

					<div class="postbox litespeed-postbox litespeed-postbox-ucss">
						<div class="inside">
							<h3 class="litespeed-title">
								<?php echo __('Unique CSS', 'litespeed-cache'); ?>
								<a href="<?php echo admin_url('admin.php?page=litespeed-page_optm#settings_css'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
							</h3>

							<?php if (!empty($ucss_summary['last_request'])) : ?>
								<p>
									<?php echo __('Last generated', 'litespeed-cache') . ': <code>' . Utility::readable_time($ucss_summary['last_request']) . '</code>'; ?>
								</p>
								<p>
									<?php echo __('Time to execute previous request', 'litespeed-cache') . ': <code>' . esc_html($ucss_summary['last_spent']) . 's</code>'; ?>
								</p>
							<?php endif; ?>

							<p>
								<?php echo __('Requests in queue', 'litespeed-cache'); ?>: <code><?php echo $ucss_count ?: '-' ?></code>
								<a href="<?php echo $ucss_count ? Utility::build_url(Router::ACTION_UCSS, UCSS::TYPE_GEN) : 'javascript:;'; ?>" class="button button-secondary button-small <?php if (!$ucss_count) echo 'disabled'; ?>">
									<?php echo __('Force cron', 'litespeed-cache'); ?>
								</a>
							</p>

						</div>

						<?php if (!empty($cloud_summary['last_request.ucss'])) : ?>
							<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
								<?php echo __('Last requested', 'litespeed-cache') . ': ' . Utility::readable_time($cloud_summary['last_request.ucss']) ?>
							</div>
						<?php endif; ?>
					</div>

					<div class="postbox litespeed-postbox litespeed-postbox-lqip">
						<div class="inside">
							<h3 class="litespeed-title">
								<?php echo __('Low Quality Image Placeholder', 'litespeed-cache'); ?>
								<a href="<?php echo admin_url('admin.php?page=litespeed-page_optm#settings_media'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
							</h3>

							<?php if (!empty($placeholder_summary['last_request'])) : ?>
								<p>
									<?php echo __('Last generated', 'litespeed-cache') . ': <code>' . Utility::readable_time($placeholder_summary['last_request']) . '</code>'; ?>
								</p>
								<p>
									<?php echo __('Time to execute previous request', 'litespeed-cache') . ': <code>' . esc_html($placeholder_summary['last_spent']) . 's</code>'; ?>
								</p>
							<?php endif; ?>

							<p>
								<?php echo __('Requests in queue', 'litespeed-cache'); ?>: <code><?php echo $placeholder_queue_count ?: '-' ?></code>
								<a href="<?php echo $placeholder_queue_count ? Utility::build_url(Router::ACTION_PLACEHOLDER, Placeholder::TYPE_GENERATE) : 'javascript:;'; ?>" class="button button-secondary button-small <?php if (!$placeholder_queue_count) echo 'disabled'; ?>">
									<?php echo __('Force cron', 'litespeed-cache'); ?>
								</a>
							</p>

						</div>

						<?php if (!empty($cloud_summary['last_request.lqip'])) : ?>
							<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
								<?php echo __('Last requested', 'litespeed-cache') . ': ' . Utility::readable_time($cloud_summary['last_request.lqip']) ?>
							</div>
						<?php endif; ?>
					</div>

					<div class="postbox litespeed-postbox litespeed-postbox-vpi">
						<div class="inside">
							<h3 class="litespeed-title">
								<?php echo __('Viewport Image', 'litespeed-cache'); ?> (VPI)
								<a href="<?php echo admin_url('admin.php?page=litespeed-page_optm#settings_vpi'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
							</h3>

							<?php if (!empty($vpi_summary['last_request'])) : ?>
								<p>
									<?php echo __('Last generated', 'litespeed-cache') . ': <code>' . Utility::readable_time($vpi_summary['last_request']) . '</code>'; ?>
								</p>
								<p>
									<?php echo __('Time to execute previous request', 'litespeed-cache') . ': <code>' . esc_html($vpi_summary['last_spent']) . 's</code>'; ?>
								</p>
							<?php endif; ?>

							<p>
								<?php echo __('Requests in queue', 'litespeed-cache'); ?>: <code><?php echo $vpi_queue_count ?: '-' ?></code>
								<a href="<?php echo $vpi_queue_count ? Utility::build_url(Router::ACTION_VPI, VPI::TYPE_GEN) : 'javascript:;'; ?>" class="button button-secondary button-small <?php if (!$vpi_queue_count) echo 'disabled'; ?>">
									<?php echo __('Force cron', 'litespeed-cache'); ?>
								</a>
							</p>

						</div>

						<?php if (!empty($cloud_summary['last_request.vpi'])) : ?>
							<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
								<?php echo __('Last requested', 'litespeed-cache') . ': ' . Utility::readable_time($cloud_summary['last_request.vpi']) ?>
							</div>
						<?php endif; ?>
					</div>

					<div class="postbox litespeed-postbox litespeed-postbox-crawler">
						<div class="inside">
							<h3 class="litespeed-title">
								<?php echo __('Crawler Status', 'litespeed-cache'); ?>
								<a href="<?php echo admin_url('admin.php?page=litespeed-crawler'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
							</h3>

							<p>
								<code><?php echo count(Crawler::cls()->list_crawlers()); ?></code> <?php echo __('Crawler(s)', 'litespeed-cache'); ?>
							</p>
							<p>
								<?php echo __('Currently active crawler', 'litespeed-cache'); ?>: <code><?php echo esc_html($crawler_summary['curr_crawler']); ?></code>
							</p>

							<?php if ($crawler_summary['curr_crawler_beginning_time']) : ?>
								<p>
									<b><?php echo __('Current crawler started at', 'litespeed-cache'); ?>:</b>
									<?php echo Utility::readable_time($crawler_summary['curr_crawler_beginning_time']); ?>
								</p>
							<?php endif; ?>

							<?php if ($crawler_summary['last_start_time']) : ?>
								<p class='litespeed-desc'>
									<b><?php echo __('Last interval', 'litespeed-cache'); ?>:</b>
									<?php echo Utility::readable_time($crawler_summary['last_start_time']); ?>
								</p>
							<?php endif; ?>

							<?php if ($crawler_summary['end_reason']) : ?>
								<p class='litespeed-desc'>
									<b><?php echo __('Ended reason', 'litespeed-cache'); ?>:</b>
									<?php echo esc_html($crawler_summary['end_reason']); ?>
								</p>
							<?php endif; ?>

							<?php if ($crawler_summary['last_crawled']) : ?>
								<p class='litespeed-desc'>
									<?php echo sprintf(__('<b>Last crawled:</b> %d item(s)', 'litespeed-cache'), $crawler_summary['last_crawled']); ?>
								</p>
							<?php endif; ?>

						</div>
					</div>

					<div class="postbox litespeed-postbox litespeed-postbox-quiccloud<?php if (empty($cloud_summary['qc_activated']) || $cloud_summary['qc_activated'] != 'cdn') : ?> litespeed-postbox--quiccloud<?php endif; ?>">
						<div class="inside">
							<h3 class="litespeed-title litespeed-dashboard-title--w-btn">
								<span class="litespeed-quic-icon"></span>QUIC.cloud CDN
								<?php if (empty($cloud_summary['qc_activated']) || $cloud_summary['qc_activated'] != 'cdn') : ?>
									<a href="https://www.quic.cloud/quic-cloud-services-and-features/litespeed-cache-service/" class="litespeed-title-right-icon" target="_blank"><?php echo __('Learn More', 'litespeed-cache'); ?></a>
								<?php else : ?>
									<a href="<?php echo admin_url('admin.php?page=litespeed-cdn'); ?>" class="litespeed-title-right-icon"><?php echo __('More', 'litespeed-cache'); ?></a>
								<?php endif; ?>
							</h3>
							<?php if (empty($cloud_summary['qc_activated']) || $cloud_summary['qc_activated'] != 'cdn') : ?>
								<div class="litespeed-text-center litespeed-empty-space-medium">
									<p class="litespeed-margin-bottom20">
										<?php Doc::learn_more(
											Utility::build_url(Router::ACTION_CLOUD, $__cloud->activated() ? Cloud::TYPE_ENABLE_CDN : Cloud::TYPE_ACTIVATE),
											'<span class="dashicons dashicons-saved"></span>' . __('Enable QUIC.cloud CDN', 'litespeed-cache'),
											true,
											'button button-primary litespeed-button-cta'
										); ?>
									</p>
									<p class="litespeed-margin-bottom10 litespeed-top20 litespeed-text-md">
										<strong class="litespeed-qc-text-gradient"><?php echo __('Best available WordPress performance', 'litespeed-cache'); ?></strong>
									</p>
									<p class="litespeed-margin-bottom20 litespeed-margin-top-remove">
										<?php echo sprintf(__('Globally fast TTFB, easy setup, and <a %s>more</a>!', 'litespeed-cache'), ' href="https://www.quic.cloud/quic-cloud-services-and-features/litespeed-cache-service/" target="_blank"'); ?>
									</p>
								</div>
							<?php else : ?>
								<?php echo $__cloud->load_qc_status_for_dash('cdn_dash_mini'); ?>
							<?php endif; ?>
						</div>
						<?php if ($__cloud->activated()) : ?>
							<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
								<a href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_SYNC_STATUS); ?>" class="button button-<?php echo ($cloud_summary['qc_activated'] != 'cdn' ? 'link' : 'secondary'); ?> button-small">
									<?php if ($cloud_summary['qc_activated'] == 'cdn') : ?>
										<span class="dashicons dashicons-update"></span>
									<?php endif; ?>
									<?php echo __('Refresh Status', 'litespeed-cache'); ?>
									<span class="screen-reader-text"><?php echo __('Refresh QUIC.cloud status', 'litespeed-cache'); ?></span>
								</a>
							</div>
						<?php endif; ?>
					</div>

					<?php $promo_mini = $__cloud->load_qc_status_for_dash('promo_mini'); ?>
					<?php if ($promo_mini) : ?>
						<?php echo $promo_mini; ?>
					<?php endif; ?>

					<?php if ($__cloud->activated()) : ?>
						<?php $news = $__cloud->load_qc_status_for_dash('news_dash'); ?>
						<?php if ($news) : ?>
							<div class="postbox litespeed-postbox">
								<div class="inside litespeed-text-center">
									<h3 class="litespeed-title">
										<?php echo __('News', 'litespeed-cache'); ?>
									</h3>
									<div class="litespeed-top20">
										<?php echo $news; ?>
									</div>
								</div>
							</div>
						<?php endif; ?>
					<?php endif; ?>

				</div>

			</div>

		</div>
	</div>
</div>dash/entry.tpl.php000064400000001265151540355030010140 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$menu_list = array(
	'dashboard'	=> __( 'Dashboard', 'litespeed-cache' ),
);

if ( $this->_is_network_admin ) {
	$menu_list = array(
		'network_dash' => __( 'Network Dashboard', 'litespeed-cache' ),
	);
}


?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __( 'LiteSpeed Cache Dashboard', 'litespeed-cache' ); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">
	<?php
	foreach ($menu_list as $tab => $val) {
		echo "<div data-litespeed-layout='$tab'>";
		require LSCWP_DIR . "tpl/dash/$tab.tpl.php";
		echo "</div>";
	}
	?>
</div>
dash/network_dash.tpl.php000064400000010446151540355030011470 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$cloud_summarys = array();
$blogs = Activation::get_network_ids();
foreach ( $blogs as $blog_id ) {
	switch_to_blog( $blog_id );
	$cloud_summarys[ home_url() ] = Cloud::get_summary();
}

?>

<div class="litespeed-dashboard">
<?php foreach ( $cloud_summarys as $home_url => $cloud_summary ) : ?>

	<div class="litespeed-dashboard-header">
		<h3 class="litespeed-dashboard-title">
			<?php echo __( 'Usage Statistics', 'litespeed-cache' ) . ': ' . $home_url; ?>
		</h3>
		<hr>
	</div>

	<div class="litespeed-dashboard-stats-wrapper">
		<?php
			$cat_list = array(
				'img_optm'	=> __('Image Optimization', 'litespeed-cache'),
				'page_optm'	=> __('Page Optimization', 'litespeed-cache'),
				'cdn'		=> __('CDN Bandwidth', 'litespeed-cache'),
				'lqip'		=> __('Low Quality Image Placeholder', 'litespeed-cache'),
			);

			foreach ( $cat_list as $svc => $title ) :
				$finished_percentage = 0;
				$total_used = $used = $quota = $pag_used = $pag_total = '-';
				$used = $quota = $pag_used = $pag_total = '-';
				$pag_width = 0;
				if ( ! empty( $cloud_summary[ 'usage.' . $svc ] ) ) {
					$finished_percentage = floor( $cloud_summary[ 'usage.' . $svc ][ 'used' ] * 100 / $cloud_summary[ 'usage.' . $svc ][ 'quota' ] );
					$used = $cloud_summary[ 'usage.' . $svc ][ 'used' ];
					$quota = $cloud_summary[ 'usage.' . $svc ][ 'quota' ];
					$pag_used = ! empty( $cloud_summary[ 'usage.' . $svc ][ 'pag_used' ] ) ? $cloud_summary[ 'usage.' . $svc ][ 'pag_used' ] : 0;
					$pag_bal = ! empty( $cloud_summary[ 'usage.' . $svc ][ 'pag_bal' ] ) ? $cloud_summary[ 'usage.' . $svc ][ 'pag_bal' ] : 0;
					$pag_total = $pag_used + $pag_bal;

					if ( $pag_total ) {
						$pag_width = round( $pag_used / $pag_total * 100 ) . '%';
					}

					if ( $svc == 'cdn' ) {
						$used = Utility::real_size( $used * 1024 * 1024 );
						$quota = Utility::real_size( $quota * 1024 * 1024 );
						$pag_used = Utility::real_size( $pag_used * 1024 * 1024 );
						$pag_total = Utility::real_size( $pag_total * 1024 * 1024 );
					}
				}

				$percentage_bg = 'success';
				if( $finished_percentage > 95 ){
					$percentage_bg = 'danger';
				} elseif ( $finished_percentage > 85 ){
					$percentage_bg = 'warning';
				}

			?>


				<div class="postbox litespeed-postbox">
					<div class="inside">
						<h3 class="litespeed-title"><?php echo $title; ?></h3>

						<div class="litespeed-flex-container">
							<div class="litespeed-icon-vertical-middle litespeed-pie-<?php echo $percentage_bg;?>">
								<?php echo GUI::pie( $finished_percentage, 60, false ); ?>
							</div>
							<div>
								<div class="litespeed-dashboard-stats">
									<h3><?php echo ( $svc == 'img_optm' ? __('Fast Queue Usage','litespeed-cache') : __( 'Usage', 'litespeed-cache' ) ); ?></h3>
									<p>
										<strong><?php echo esc_html( $used ); ?></strong>
										<?php if( $used != $quota ) { ?>
											<span class="litespeed-desc"> of <?php echo esc_html( $quota ); ?></span>
										<?php } ?>
									</p>
								</div>
							</div>
						</div>
						<?php if ( $pag_total > 0 ) { ?>
							<p class="litespeed-dashboard-stats-payg" data-balloon-pos="up" aria-label="<?php echo __('Pay as You Go','litespeed-cache'); ?>">
								<?php echo __('PAYG Balance','litespeed-cache'); ?>: <strong><?php echo esc_html( $pag_bal ); ?></strong>
								<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo __('This Month Usage','litespeed-cache'); ?>: <?php echo esc_html( $pag_used );?>">
									<span class="dashicons dashicons-info"></span>
									<span class="screen-reader-text"><?php echo __( 'Pay as You Go Usage Statistics', 'litespeed-cache' );?></span>
								</button>
							</p>
						<?php } ?>

						<?php if ( $svc == 'img_optm' ) { ?>
							<p class="litespeed-dashboard-stats-total">
								<?php echo __('Total Usage','litespeed-cache'); ?>: <strong><?php echo esc_html( $total_used ); ?> / ∞</strong>
								<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo __('Total images optimized in this month','litespeed-cache'); ?>">
									<span class="dashicons dashicons-info"></span>
								</button>
							</p>
							<div class="clear"></div>
						<?php } ?>
					</div>
				</div>

			<?php endforeach; ?>
	</div>

<?php endforeach; ?>
</div>db_optm/entry.tpl.php000064400000002054151540355030010642 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$menu_list = array(
	'manage'			=> __( 'Manage', 'litespeed-cache' ),
);

if ( ! $this->_is_network_admin ) {
	$menu_list[ 'settings' ] = __( 'DB Optimization Settings', 'litespeed-cache' );
}

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __( 'LiteSpeed Cache Database Optimization', 'litespeed-cache' ); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">
	<h2 class="litespeed-header nav-tab-wrapper">
	<?php
		$i = 1;
		foreach ($menu_list as $tab => $val){
			$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
			$i ++;
		}
	?>
	</h2>

	<div class="litespeed-body">
	<?php

		// include all tpl for faster UE
		foreach ($menu_list as $tab => $val) {
			echo "<div data-litespeed-layout='$tab'>";
			require LSCWP_DIR . "tpl/db_optm/$tab.tpl.php";
			echo "</div>";
		}

	?>
	</div>

</div>
db_optm/manage.tpl.php000064400000014025151540355030010732 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$_panels = array(
	'all' => array(
		'title'	=> __('Clean All', 'litespeed-cache'),
		'desc'	=> '',
	),
	'revision' => array(
		'title'	=> __('Post Revisions', 'litespeed-cache'),
		'desc'	=> __('Clean all post revisions', 'litespeed-cache'),
	),
	'orphaned_post_meta' => array(
		'title'	=> __('Orphaned Post Meta', 'litespeed-cache'),
		'desc'	=> __('Clean all orphaned post meta records', 'litespeed-cache'),
	),
	'auto_draft' => array(
		'title'	=> __('Auto Drafts', 'litespeed-cache'),
		'desc'	=> __('Clean all auto saved drafts', 'litespeed-cache'),
	),
	'trash_post' => array(
		'title'	=> __('Trashed Posts', 'litespeed-cache'),
		'desc'	=> __('Clean all trashed posts and pages', 'litespeed-cache'),
	),
	'spam_comment' => array(
		'title'	=> __('Spam Comments', 'litespeed-cache'),
		'desc'	=> __('Clean all spam comments', 'litespeed-cache'),
	),
	'trash_comment' => array(
		'title'	=> __('Trashed Comments', 'litespeed-cache'),
		'desc'	=> __('Clean all trashed comments', 'litespeed-cache'),
	),
	'trackback-pingback' => array(
		'title'	=> __('Trackbacks/Pingbacks', 'litespeed-cache'),
		'desc'	=> __('Clean all trackbacks and pingbacks', 'litespeed-cache'),
	),
	'expired_transient' => array(
		'title'	=> __('Expired Transients', 'litespeed-cache'),
		'desc'	=> __('Clean expired transient options', 'litespeed-cache'),
	),
	'all_transients' => array(
		'title'	=> __('All Transients', 'litespeed-cache'),
		'desc'	=> __('Clean all transient options', 'litespeed-cache'),
	),
	'optimize_tables' => array(
		'title'	=> __('Optimize Tables', 'litespeed-cache'),
		'desc'	=> __('Optimize all tables in your database', 'litespeed-cache'),
	),
);

$rev_max = $this->conf(Base::O_DB_OPTM_REVISIONS_MAX);
$rev_age = $this->conf(Base::O_DB_OPTM_REVISIONS_AGE);
if ($rev_max || $rev_age) {
	$_panels['revision']['desc'] = sprintf(__('Clean revisions older than %1$s day(s), excluding %2$s latest revisions', 'litespeed-cache'), '<strong>' . $rev_age . '</strong>', '<strong>' . $rev_max . '</strong>');
}

$total = 0;
foreach ($_panels as $tag => $v) {
	if ($tag != 'all') {
		$_panels[$tag]['count'] = $this->cls('DB_Optm')->db_count($tag);
		if (!in_array($tag, array('optimize_tables'))) {
			$total += $_panels[$tag]['count'];
		}
	}
	$_panels[$tag]['link'] = Utility::build_url(Router::ACTION_DB_OPTM, $tag);
}

$_panels['all']['count'] = $total;

$autoload_summary = DB_Optm::cls()->autoload_summary();

?>

<h3 class="litespeed-title">
	<?php echo __('Database Optimizer', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/database/'); ?>
</h3>

<div class="litespeed-panel-wrapper litespeed-cards-wrapper">

	<?php foreach ($_panels as $tag => $v) : ?>

		<a href="<?php echo $v['link']; ?>" class="litespeed-panel postbox">
			<section class="litespeed-panel-wrapper-icon">
				<span class="litespeed-panel-icon-<?php echo $tag; ?>"></span>
			</section>
			<section class="litespeed-panel-content">
				<div class="litespeed-h3">
					<?php echo $v['title']; ?>
					<span class="litespeed-panel-counter<?php if ($v['count'] > 0) echo '-red'; ?>">(<?php echo $v['count']; ?><?php echo DB_Optm::hide_more() ? '+' : ''; ?>)</span>
				</div>
				<span class="litespeed-panel-para"><?php echo $v['desc']; ?></span>
			</section>
			<section class="litespeed-panel-wrapper-top-right">
				<span class="litespeed-panel-top-right-icon<?php echo $v['count'] > 0 ? '-cross' : '-tick'; ?>"></span>
			</section>
		</a>
	<?php endforeach; ?>

</div>

<h3 class="litespeed-title"><?php echo __('Database Table Engine Converter', 'litespeed-cache'); ?></h3>

<div class="litespeed-panel-wrapper">

	<table class="wp-list-table widefat striped">
		<thead>
			<tr>
				<th scope="col">#</th>
				<th scope="col"><?php echo __('Table', 'litespeed-cache'); ?></th>
				<th scope="col"><?php echo __('Engine', 'litespeed-cache'); ?></th>
				<th scope="col"><?php echo __('Tool', 'litespeed-cache'); ?></th>
			</tr>
		</thead>
		<tbody>
			<?php
			$list = DB_Optm::cls()->list_myisam();
			if ($list) :
				foreach ($list as $k => $v) :
			?>
					<tr>
						<td><?php echo $k + 1; ?></td>
						<td><?php echo $v->TABLE_NAME; ?></td>
						<td><?php echo $v->ENGINE; ?></td>
						<td>
							<a href="<?php echo Utility::build_url(Router::ACTION_DB_OPTM, DB_Optm::TYPE_CONV_TB, false, false, array('tb' => $v->TABLE_NAME)); ?>">
								<?php echo __('Convert to InnoDB', 'litespeed-cache'); ?>
							</a>
						</td>
					</tr>
				<?php endforeach; ?>
			<?php else : ?>
				<tr>
					<td colspan="4" class="litespeed-success litespeed-text-center">
						<?php echo __('We are good. No table uses MyISAM engine.', 'litespeed-cache'); ?>
					</td>
				</tr>
			<?php endif; ?>
		</tbody>
	</table>

</div>

<style type="text/css">
	.litespeed-body .field-col {
		display: inline-block;
		vertical-align: top;
		margin-left: 20px;
		margin-right: 20px;
	}

	.litespeed-body .field-col:first-child {
		margin-left: 0;
	}
</style>

<h3 class="litespeed-title"><?php echo __('Database Summary', 'litespeed-cache'); ?></h3>
<div>
	<div class="field-col">
		<p>
			Autoload size: <strong><?php echo Utility::real_size($autoload_summary->autoload_size); ?></strong></p>
		<p>Autoload entries: <strong><?php echo $autoload_summary->autload_entries; ?></strong></p>


	</div>

	<div class="field-col">
		<p>Autoload top list:</p>
		<table class="wp-list-table widefat striped litespeed-width-auto litespeed-table-compact">
			<thead>
				<tr>
					<th scope="col">#</th>
					<th scope="col"><?php echo __('Option Name', 'litespeed-cache'); ?></th>
					<th scope="col"><?php echo __('Autoload', 'litespeed-cache'); ?></th>
					<th scope="col"><?php echo __('Size', 'litespeed-cache'); ?></th>
				</tr>
			</thead>
			<tbody>
				<?php foreach ($autoload_summary->autoload_toplist as $k => $v) : ?>
					<tr>
						<td><?php echo $k + 1; ?></td>
						<td><?php echo $v->option_name; ?></td>
						<td><?php echo $v->autoload; ?></td>
						<td><?php echo $v->option_value_length; ?></td>
					</tr>
				<?php endforeach; ?>
			</tbody>
		</table>

	</div>
</div>db_optm/settings.tpl.php000064400000002412151540355030011337 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$this->form_action();
?>


<h3 class="litespeed-title-short">
	<?php echo __( 'DB Optimization Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/database/#db-optimization-settings-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>
	<tr>
		<th>
			<?php $id = Base::O_DB_OPTM_REVISIONS_MAX; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id, 'litespeed-input-short' ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Specify the number of most recent revisions to keep when cleaning revisions.', 'litespeed-cache' ); ?>
				<?php $this->_validate_ttl( $id, 1, 100, true ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_DB_OPTM_REVISIONS_AGE; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id, 'litespeed-input-short' ); ?> <?php echo __( 'Day(s)', 'litespeed-cache' ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Revisions newer than this many days will be kept when cleaning revisions.', 'litespeed-cache' ); ?>
				<?php $this->_validate_ttl( $id, 1, 600, true ); ?>
			</div>
		</td>
	</tr>

</tbody></table>

<?php

$this->form_end();








esi.tpl.php000064400000000131151540355030006627 0ustar00<?php defined( 'WPINC' ) || exit ; ?>
<?php

\LiteSpeed\ESI::cls()->load_esi_block() ;


esi_widget_edit.php000064400000004136151540355030010412 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;

// $widget, $return, $instance

$options = ! empty( $instance[ Base::OPTION_NAME ] ) ? $instance[ Base::OPTION_NAME ] : array() ;

if ( empty( $options ) ) {
	$options = array(
		ESI::WIDGET_O_ESIENABLE => Base::VAL_OFF,
		ESI::WIDGET_O_TTL => '28800'
	) ;

	add_filter('litespeed_widget_default_options', 'LiteSpeed\ESI::widget_default_options', 10, 2) ;

	$options = apply_filters( 'litespeed_widget_default_options', $options, $widget ) ;
}

if ( empty( $options ) ) {
	$esi = Base::VAL_OFF ;
	$ttl = '28800' ;
}
else {
	$esi = $options[ ESI::WIDGET_O_ESIENABLE ] ;
	$ttl = $options[ ESI::WIDGET_O_TTL ] ;
}

$display = Admin_Display::cls() ;

?>
<div class="litespeed-widget-setting">

	<h4>LiteSpeed Cache:</h4>

	<b><?php echo __( 'Enable ESI', 'litespeed-cache' ) ; ?>:</b>
	&nbsp;&nbsp;
	<div class="litespeed-inline">
		<div class="litespeed-switch litespeed-mini">
		<?php

			$id = ESI::WIDGET_O_ESIENABLE ;
			$name = $widget->get_field_name( $id ) ;

			$cache_status_list = array(
				array( Base::VAL_ON, __( 'Public', 'litespeed-cache' ) ),
				array( Base::VAL_ON2, __( 'Private', 'litespeed-cache' ) ),
				array( Base::VAL_OFF, __( 'Disable', 'litespeed-cache' ) ),
			) ;

			foreach ( $cache_status_list as $v ) {
				list( $v, $txt ) = $v ;
				$id_attr = $widget->get_field_id( $id ) . '_' . $v ;
				$checked = $esi === $v ? 'checked' : '' ;
				echo "<input type='radio' autocomplete='off' name='$name' id='$id_attr' value='$v' $checked /> <label for='$id_attr'>$txt</label>" ;
			}
		?>

		</div>
	</div>
	<br /><br />

	<b><?php echo __( 'Widget Cache TTL:', 'litespeed-cache' ) ; ?></b>
	&nbsp;&nbsp;
	<?php
		$id = ESI::WIDGET_O_TTL ;
		$name = $widget->get_field_name( $id ) ;
		echo "<input type='text' class='regular-text litespeed-reset' name='$name' value='$ttl' size='7' />" ;
	?>
	<?php echo __( 'seconds', 'litespeed-cache' ) ; ?>

	<p class="install-help">
		<?php echo __( 'Recommended value: 28800 seconds (8 hours).', 'litespeed-cache' ) ; ?>
		<?php echo __( 'A TTL of 0 indicates do not cache.', 'litespeed-cache' ) ; ?>
	</p>
</div>

<br />general/entry.tpl.php000064400000002245151540355030010635 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$menu_list = array(
	'online'	=> __('Online Services', 'litespeed-cache'),
	'settings'	=> __('General Settings', 'litespeed-cache'),
	'settings_tuning' => __('Tuning', 'litespeed-cache'),
);

if ($this->_is_network_admin) {
	$menu_list = array(
		'network_settings' => __('General Settings', 'litespeed-cache'),
	);
}

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __('LiteSpeed Cache General Settings', 'litespeed-cache'); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">
	<h2 class="litespeed-header nav-tab-wrapper">
		<?php
		$i = 1;
		foreach ($menu_list as $tab => $val) {
			$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
			$i++;
		}
		?>
	</h2>

	<div class="litespeed-body">
		<?php

		// include all tpl for faster UE
		foreach ($menu_list as $tab => $val) {
			echo "<div data-litespeed-layout='$tab'>";
			require LSCWP_DIR . "tpl/general/$tab.tpl.php";
			echo "</div>";
		}

		?>
	</div>

</div>general/network_settings.tpl.php000064400000002015151540355030013100 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$this->form_action();
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'General Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/' ); ?>
</h3>

<?php
$this->form_action( Router::ACTION_SAVE_SETTINGS_NETWORK );
?>

<table class="wp-list-table striped litespeed-table"><tbody>
	<?php require LSCWP_DIR . 'tpl/general/settings_inc.auto_upgrade.tpl.php'; ?>

	<tr>
		<th><?php echo __('Use Primary Site Configuration', 'litespeed-cache'); ?></th>
		<td>
			<?php $this->build_switch( Base::NETWORK_O_USE_PRIMARY ); ?>
			<div class="litespeed-desc">
				<?php echo __("Check this option to use the primary site's configuration for all subsites.", 'litespeed-cache'); ?>
				<?php echo __('This will disable the settings page on all subsites.', 'litespeed-cache'); ?>
			</div>
		</td>
	</tr>

	<?php require LSCWP_DIR . 'tpl/general/settings_inc.guest.tpl.php'; ?>

</tbody></table>

<?php
$this->form_end( true );
general/online.tpl.php000064400000026000151540355030010753 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$cloud_summary = Cloud::get_summary();

$__cloud = Cloud::cls();
$__cloud->finish_qc_activation('online');

?>

<h3 class="litespeed-title-short">
	<?php echo __('QUIC.cloud Online Services', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://www.quic.cloud/quic-cloud-services-and-features/'); ?>
</h3>

<div class="litespeed-desc"><?php echo __('QUIC.cloud provides CDN and online optimization services, and is not required. You may use many features of this plugin without QUIC.cloud.', 'litespeed-cache'); ?></div>

<?php if ($__cloud->activated()) : ?>
	<div class="litespeed-callout notice notice-success inline">
		<h4><?php echo __('Current Cloud Nodes in Service', 'litespeed-cache'); ?>
			<a class="litespeed-right litespeed-redetect" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_CLEAR_CLOUD, false, null, array('ref' => 'online')); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo __('Click to clear all nodes for further redetection.', 'litespeed-cache'); ?>' data-litespeed-cfm="<?php echo __('Are you sure you want to clear all cloud nodes?', 'litespeed-cache'); ?>"><i class='litespeed-quic-icon'></i> <?php echo __('Redetect', 'litespeed-cache'); ?></a>
		</h4>
		<p>
			<?php
			$has_service = false;
			foreach (Cloud::$SERVICES as $svc) {
				if (isset($cloud_summary['server.' . $svc])) {
					$has_service = true;
					echo '<p><strong>Service:</strong> <code>' . $svc . '</code> <strong>Node:</strong> <code>' . $cloud_summary['server.' . $svc] . '</code> <strong>Connected Date:</strong> <code>' . Utility::readable_time($cloud_summary['server_date.' . $svc]) . '</code></p>';
				}
			}
			if (!$has_service) {
				echo __('No cloud services currently in use', 'litespeed-cache');
			}
			?>
		</p>
	</div>
<?php endif; ?>

<?php if (!$__cloud->activated()) : ?>
	<h4 class="litespeed-text-md litespeed-top30"><span class="dashicons dashicons-no-alt litespeed-danger"></span>&nbsp;<?php echo __('QUIC.cloud Integration Disabled', 'litespeed-cache'); ?></h4>
	<p><?php echo __('Speed up your WordPress site even further with QUIC.cloud Online Services and CDN.', 'litespeed-cache'); ?></p>
	<div class="litespeed-desc"><?php echo __('Free monthly quota available.', 'litespeed-cache'); ?></div>
	<p><a class="button button-primary" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE, false, null, array('ref' => 'online')); ?>">
			<span class="dashicons dashicons-yes"></span>
			<?php _e('Enable QUIC.cloud services', 'litespeed-cache'); ?>
		</a></p>


	<div>
		<h3 class="litespeed-title-section"><?php echo __('Online Services', 'litespeed-cache'); ?></h3>
		<p><?php echo __('QUIC.cloud\'s Online Services improve your site in the following ways:', 'litespeed-cache'); ?></p>
		<ul>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('<strong>Image Optimization</strong> gives you smaller image file sizes that transmit faster.', 'litespeed-cache'); ?></li>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('<strong>Page Optimization</strong> streamlines page styles and visual elements for faster loading.', 'litespeed-cache'); ?></li>
		</ul>

		<h4 class="litespeed-text-md litespeed-margin-bottom-remove">Image Optimization</h4>
		<p><?php echo __('QUIC.cloud\'s Image Optimization service does the following:', 'litespeed-cache'); ?></p>
		<ul>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('Processes your uploaded PNG and JPG images to produce smaller versions that don\'t sacrifice quality.', 'litespeed-cache'); ?></li>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('Optionally creates next-generation WebP or AVIF image files.', 'litespeed-cache'); ?></li>
		</ul>
		<p><?php echo __('Processing for PNG, JPG, and WebP image formats is free. AVIF is available for a fee.', 'litespeed-cache'); ?> <a href="https://www.quic.cloud/quic-cloud-services-and-features/image-optimization-service/" target="_blank"><?php echo __('Learn More', 'litespeed-cache'); ?></a></p>

		<h4 class="litespeed-text-md litespeed-margin-bottom-remove">Page Optimization</h4>
		<p><?php echo __('QUIC.cloud\'s Page Optimization services address CSS bloat, and improve the user experience during page load, which can lead to improved page speed scores.', 'litespeed-cache'); ?></p>
		<ul>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('<strong>Critical CSS (CCSS)</strong> loads visible above-the-fold content faster and with full styling.', 'litespeed-cache'); ?></li>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('<strong>Unique CSS (UCSS)</strong> removes unused style definitions for a speedier page load overall.', 'litespeed-cache'); ?></li>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('<strong>Low Quality Image Placeholder (LQIP)</strong> gives your imagery a more pleasing look as it lazy loads.', 'litespeed-cache'); ?></li>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('<strong>Viewport Images (VPI)</strong> provides a well-polished fully-loaded view above the fold.', 'litespeed-cache'); ?></li>
		</ul>

		<div>
			<a href="https://www.quic.cloud/quic-cloud-services-and-features/page-optimization/"><?php echo __('Learn More', 'litespeed-cache'); ?></a>
		</div>
	</div>

	<div>
		<h3 class="litespeed-title-section"><?php echo __('Content Delivery Network', 'litespeed-cache'); ?></h3>

		<h4 class="litespeed-text-md litespeed-margin-bottom-remove">QUIC.cloud CDN:</h4>
		<ul>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('Caches your entire site, including dynamic content and <strong>ESI blocks</strong>.', 'litespeed-cache'); ?></li>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('Delivers global coverage with a growing <strong>network of 80+ PoPs</strong>.', 'litespeed-cache'); ?></li>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('Provides <strong>security at the CDN level</strong>, protecting your server from attack.', 'litespeed-cache'); ?></li>
			<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo __('Offers optional <strong>built-in DNS service</strong> to simplify CDN onboarding.', 'litespeed-cache'); ?></li>
		</ul>

		<div>
			<a href="https://www.quic.cloud/quic-cloud-services-and-features/quic-cloud-cdn-service/"><?php echo __('Learn More', 'litespeed-cache'); ?></a>
		</div>

		<hr class="litespeed-hr-with-space">

		<p class="litespeed-desc"><?php echo __('In order to use most QUIC.cloud services, you need quota. QUIC.cloud gives you free quota every month, but if you need more, you can purchase it.', 'litespeed-cache'); ?> <a href="https://docs.quic.cloud/billing/services/" target="_blank">Learn More</a></p>

		<div class="litespeed-flex litespeed-flex-align-center">
			<a class="button button-secondary litespeed-right20" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE, false, null, array('ref' => 'online')); ?>">
				<span class="dashicons dashicons-yes"></span>
				<?php _e('Enable QUIC.cloud services', 'litespeed-cache'); ?>
			</a>
		</div>
	</div>


<?php elseif (!empty($cloud_summary['qc_activated']) && ($cloud_summary['qc_activated'] == 'linked' || $cloud_summary['qc_activated'] == 'cdn')) : ?>
	<h4 class="litespeed-text-md litespeed-top30"><span class="dashicons dashicons-saved litespeed-success"></span>&nbsp;<?php echo __('QUIC.cloud Integration Enabled', 'litespeed-cache'); ?></h4>
	<p><?php echo __('Your site is connected and ready to use QUIC.cloud Online Services.', 'litespeed-cache'); ?>
		<?php if (empty($cloud_summary['partner'])) : ?>
			<a href="<?php echo $__cloud->qc_link(); ?>" class="litespeed-link-with-icon" target="_blank"><?php echo __('Go to QUIC.cloud dashboard', 'litespeed-cache'); ?> <span class="dashicons dashicons-external"></span></a>
		<?php endif; ?>
	</p>

	<ul>
		<li><span class="dashicons dashicons-yes litespeed-success"></span> <?php echo __('Page Optimization', 'litespeed-cache'); ?></li>
		<li><span class="dashicons dashicons-yes litespeed-success"></span> <?php echo __('Image Optimization', 'litespeed-cache'); ?></li>
		<?php if ($cloud_summary['qc_activated'] == 'cdn') : ?>
			<li><span class="dashicons dashicons-yes litespeed-success"></span> CDN - <?php echo __('Enabled', 'litespeed-cache'); ?></li>
		<?php else : ?>
			<li><span class="dashicons dashicons-no-alt litespeed-default"></span> CDN - <span class="litespeed-default"><?php echo __('Disabled', 'litespeed-cache'); ?></span></li>
		<?php endif; ?>
	</ul>

<?php else : ?>
	<h4 class="litespeed-text-md litespeed-top30"><span class="dashicons dashicons-saved litespeed-success"></span>&nbsp;<?php echo __('QUIC.cloud Integration Enabled with limitations', 'litespeed-cache'); ?></h4>
	<p><?php echo __('Your site is connected and using QUIC.cloud Online Services as an <strong>anonymous user</strong>. The CDN function and certain features of optimization services are not available for anonymous users. Link to QUIC.cloud to use the CDN and all available Online Services features.', 'litespeed-cache'); ?></p>
	<div class="litespeed-desc"><?php echo __('Free monthly quota available.', 'litespeed-cache'); ?></div>

	<ul>
		<li><span class="dashicons dashicons-yes litespeed-success"></span> <?php echo __('Page Optimization', 'litespeed-cache'); ?></li>
		<li><span class="dashicons dashicons-yes litespeed-success"></span> <?php echo __('Image Optimization', 'litespeed-cache'); ?></li>
		<li><span class="dashicons dashicons-no-alt litespeed-danger"></span> CDN - <?php echo __('not available for anonymous users', 'litespeed-cache'); ?></li>
	</ul>

	<p><a class="button button-primary" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE, false, null, array('ref' => 'online')); ?>"><span class="dashicons dashicons-yes"></span><?php _e('Link to QUIC.cloud', 'litespeed-cache'); ?></a></p>
<?php endif; ?>


<?php if ($__cloud->activated()) : ?>
	<div class="litespeed-empty-space-medium"></div>
	<div class="litespeed-column-with-boxes-footer">
		<a href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_RESET, false, null, array('ref' => 'online')); ?>" class="litespeed-link-with-icon litespeed-danger" data-litespeed-cfm="<?php echo __('Are you sure you want to disconnect from QUIC.cloud? This will not remove any data from the QUIC.cloud dashboard.', 'litespeed-cache'); ?>"><span class="dashicons dashicons-dismiss"></span><?php echo __('Disconnect from QUIC.cloud', 'litespeed-cache'); ?></a>
		<div class="litespeed-desc litespeed-margin-bottom-remove"><?php echo __('Remove QUIC.cloud integration from this site. Note: QUIC.cloud data will be preserved so you can re-enable services at any time. If you want to fully remove your site from QUIC.cloud, delete the domain through the QUIC.cloud Dashboard first.', 'litespeed-cache'); ?></div>
	</div>
<?php endif; ?>general/settings.tpl.php000064400000010560151540355030011333 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$__cloud = Cloud::cls();

$cloud_summary = Cloud::get_summary();

$this->form_action();
?>

<h3 class="litespeed-title-short">
	<?php echo __('General Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/general/'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<?php if (!$this->_is_multisite) : ?>
			<?php require LSCWP_DIR . 'tpl/general/settings_inc.auto_upgrade.tpl.php'; ?>
		<?php endif; ?>

		<?php if (!$this->_is_multisite) : ?>
			<?php require LSCWP_DIR . 'tpl/general/settings_inc.guest.tpl.php'; ?>
		<?php endif; ?>

		<tr>
			<th>
				<?php $id = Base::O_GUEST_OPTM; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<span class="litespeed-danger litespeed-text-bold">
						🚨
						<?php echo __('This option enables maximum optimization for Guest Mode visitors.', 'litespeed-cache'); ?>
						<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/general/#guest-optimization', __('Please read all warnings before enabling this option.', 'litespeed-cache'), false, 'litespeed-danger'); ?>
					</span>

					<?php
					$typeList = array();
					if ($this->conf(Base::O_GUEST) && !$this->conf(Base::O_OPTM_UCSS)) {
						$typeList[] = 'UCSS';
					}
					if ($this->conf(Base::O_GUEST) && !$this->conf(Base::O_OPTM_CSS_ASYNC)) {
						$typeList[] = 'CCSS';
					}
					if (!empty($typeList)) {
						$theType = implode('/', $typeList);
						echo '<br />';
						echo '<font class="litespeed-info">';
						echo '⚠️ ' . sprintf(__('Your %1s quota on %2s will still be in use.', 'litespeed-cache'), $theType, 'QUIC.cloud');
						echo '</font>';
					}
					?>

					<?php if (!$this->conf(Base::O_GUEST)) : ?>
						<br />
						<font class="litespeed-warning litespeed-left10">
							⚠️ <?php echo __('Notice', 'litespeed-cache'); ?>: <?php echo sprintf(__('%s must be turned ON for this setting to work.', 'litespeed-cache'),  '<code>' . Lang::title(Base::O_GUEST) . '</code>'); ?>
						</font>
					<?php endif; ?>

					<?php if (!$this->conf(Base::O_CACHE_MOBILE)) : ?>
						<br />
						<font class="litespeed-primary litespeed-left10">
							⚠️ <?php echo __('Notice', 'litespeed-cache'); ?>: <?php echo sprintf(__('You need to turn %s on to get maximum result.', 'litespeed-cache'),  '<code>' . Lang::title(Base::O_CACHE_MOBILE) . '</code>'); ?>
						</font>
					<?php endif; ?>

					<?php if (!$this->conf(Base::O_IMG_OPTM_WEBP)) : ?>
						<br />
						<font class="litespeed-primary litespeed-left10">
							⚠️ <?php echo __('Notice', 'litespeed-cache'); ?>: <?php echo sprintf(__('You need to turn %s on and finish all WebP generation to get maximum result.', 'litespeed-cache'),  '<code>' . Lang::title(Base::O_IMG_OPTM_WEBP) . '</code>'); ?>
						</font>
					<?php endif; ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_SERVER_IP; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Enter this site\'s IP address to allow cloud services directly call IP instead of domain name. This eliminates the overhead of DNS and CDN lookups.', 'litespeed-cache'); ?>
					<br /><?php echo __('Your server IP', 'litespeed-cache'); ?>: <code id='litespeed_server_ip'>-</code> <a href="javascript:;" class="button button-link" id="litespeed_get_ip"><?php echo __('Check my public IP from', 'litespeed-cache'); ?> CyberPanel.sh</a>
					⚠️ <?php echo __('Notice', 'litespeed-cache'); ?>: <?php echo __('the auto-detected IP may not be accurate if you have an additional outgoing IP set, or you have multiple IPs configured on your server.', 'litespeed-cache'); ?>
					<br /><?php echo __('Please make sure this IP is the correct one for visiting your site.', 'litespeed-cache'); ?>

					<?php $this->_validate_ip($id); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_NEWS; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Turn this option ON to show latest news automatically, including hotfixes, new releases, available beta versions, and promotions.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

	</tbody>
</table>

<?php $this->form_end(); ?>general/settings_inc.auto_upgrade.tpl.php000064400000000735151540355030014645 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>

	<!-- build_setting_auto_upgrade -->
	<tr>
		<th>
			<?php $id = Base::O_AUTO_UPGRADE; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Turn this option ON to have LiteSpeed Cache updated automatically, whenever a new version is released. If OFF, update manually as usual.', 'litespeed-cache' ); ?>
			</div>
		</td>
	</tr>
general/settings_inc.guest.tpl.php000064400000003555151540355030013320 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$guest_update_url = parse_url( LSWCP_PLUGIN_URL . GUI::PHP_GUEST, PHP_URL_PATH );

?>
	<tr>
		<th>
			<?php $id = Base::O_GUEST; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Guest Mode provides an always cacheable landing page for an automated guest\'s first time visit, and then attempts to update cache varies via AJAX.', 'litespeed-cache' ); ?>
				<?php echo __( 'This option can help to correct the cache vary for certain advanced mobile or tablet visitors.', 'litespeed-cache' ); ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#guest-mode' ); ?>
				<br /><?php Doc::notice_htaccess(); ?>
				<br /><?php Doc::crawler_affected(); ?>
			</div>
			<?php if ( $this->conf( $id ) ) : ?>
				<div class="litespeed-desc">
					<?php echo __( 'Guest Mode testing result', 'litespeed-cache' ); ?>:
					<font id='litespeed_gm_status'><?php echo __( 'Testing', 'litespeed-cache' ); ?>...</font>
				</div>
				<script>
					(function ($) {
						jQuery(document).ready(function () {
							$.post( '<?php echo $guest_update_url; ?>', function(data){
								if ( data == '[]' || $data == '{"reload":"yes"}' ) {
									$('#litespeed_gm_status').html('<font class="litespeed-success"><?php echo __( 'Guest Mode passed testing.', 'litespeed-cache' ); ?></font>');
								}
								else {
									$('#litespeed_gm_status').html('<font class="litespeed-danger"><?php echo __( 'Guest Mode failed to test.', 'litespeed-cache' ); ?></font>');
								}
							}).fail( function(){
								$('#litespeed_gm_status').html('<font class="litespeed-danger"><?php echo __( 'Guest Mode failed to test.', 'litespeed-cache' ); ?></font>');
							})
						});
					})(jQuery);
				</script>
			<?php endif; ?>
		</td>
	</tr>

general/settings_tuning.tpl.php000064400000002511151540355030012714 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$this->form_action();
?>
<h3 class="litespeed-title-short">
	<?php echo __( 'Tuning Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#tuning-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>
	<tr>
		<th>
			<?php $id = Base::O_GUEST_UAS; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<div class="litespeed-textarea-recommended">
				<div>
					<?php $this->build_textarea( $id, 30 ); ?>
				</div>
				<div>
					<?php $this->recommended( $id ); ?>
				</div>
			</div>

			<div class="litespeed-desc">
				<?php echo __( 'Listed User Agents will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
				<?php Doc::one_per_line(); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_GUEST_IPS; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<div class="litespeed-textarea-recommended">
				<div>
					<?php $this->build_textarea( $id, 50 ); ?>
				</div>
				<div>
					<?php $this->recommended( $id ); ?>
				</div>
			</div>

			<div class="litespeed-desc">
				<?php echo __( 'Listed IPs will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
				<?php Doc::one_per_line(); ?>
			</div>
		</td>
	</tr>
</tbody></table>

<?php $this->form_end(); ?>
img_optm/entry.tpl.php000064400000002226151540355030011032 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$menu_list = array(
	'summary'		=> __('Image Optimization Summary', 'litespeed-cache'),
	'settings'		=> __('Image Optimization Settings', 'litespeed-cache'),
);


if ($this->_is_network_admin) {
	$menu_list = array(
		'network_settings' => __('Image Optimization Settings', 'litespeed-cache'),
	);
}

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __('LiteSpeed Cache Image Optimization', 'litespeed-cache'); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">
	<h2 class="litespeed-header nav-tab-wrapper">
		<?php
		$i = 1;
		foreach ($menu_list as $tab => $val) {
			$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
			$i++;
		}
		?>
	</h2>

	<div class="litespeed-body">
		<?php

		// include all tpl for faster UE
		foreach ($menu_list as $tab => $val) {
			echo "<div data-litespeed-layout='$tab'>";
			require LSCWP_DIR . "tpl/img_optm/$tab.tpl.php";
			echo "</div>";
		}

		?>
	</div>

</div>img_optm/network_settings.tpl.php000064400000001032151540355030013274 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$this->form_action( Router::ACTION_SAVE_SETTINGS_NETWORK );
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'Image Optimization Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/imageopt/#image-optimization-settings-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>
	<?php require LSCWP_DIR . 'tpl/img_optm/settings.media_webp.tpl.php'; ?>

</tbody></table>

<?php
$this->form_end( true );

img_optm/settings.media_webp.tpl.php000064400000002417151540355030013626 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;
?>

<tr>
	<th>
		<?php $id = Base::O_IMG_OPTM_WEBP; ?>
		<?php $this->title($id); ?>
	</th>
	<td>
		<?php $this->build_switch($id, array(__('OFF', 'litespeed-cache'), 'WebP', 'AVIF')); ?>
		<?php Doc::maybe_on_by_gm($id); ?>
		<div class="litespeed-desc">
			<?php echo __('Request WebP/AVIF versions of original images when doing optimization.', 'litespeed-cache'); ?>
			<?php echo sprintf(__('Significantly improve load time by replacing images with their optimized %s versions.', 'litespeed-cache'), '.webp/.avif'); ?>
			<br /><?php Doc::notice_htaccess(); ?>
			<br /><?php Doc::crawler_affected(); ?>
			<br />
			<font class="litespeed-warning">
				⚠️ <?php echo sprintf(__('%1$s is a %2$s paid feature.', 'litespeed-cache'), 'AVIF', 'QUIC.cloud'); ?></font>
			<br />
			<font class="litespeed-warning">
				⚠️ <?php echo sprintf(__('When switching formats, please %1$s or %2$s to apply this new choice to previously optimized images.', 'litespeed-cache'), __('Destroy All Optimization Data', 'litespeed-cache'), __('Soft Reset Optimization Counter', 'litespeed-cache')); ?></font>
			<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/imageopt/#soft-reset-optimization-counter'); ?>
		</div>
	</td>
</tr>img_optm/settings.tpl.php000064400000007475151540355030011544 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$this->form_action();
?>

<h3 class="litespeed-title-short">
	<?php echo __('Image Optimization Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/imageopt/#image-optimization-settings-tab'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>

		<tr>
			<th>
				<?php $id = Base::O_IMG_OPTM_AUTO; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Automatically request optimization via cron job.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_IMG_OPTM_ORI; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Optimize images and save backups of the originals in the same folder.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_IMG_OPTM_RM_BKUP; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Automatically remove the original image backups after fetching optimized images.', 'litespeed-cache'); ?>

					<br />
					<font class="litespeed-danger">
						🚨
						<?php echo __('This is irreversible.', 'litespeed-cache'); ?>
						<?php echo __('You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache'); ?>
					</font>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_IMG_OPTM_LOSSLESS; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Optimize images using lossless compression.', 'litespeed-cache'); ?>
					<?php echo __('This can improve quality but may result in larger images than lossy compression will.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_IMG_OPTM_EXIF; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Preserve EXIF data (copyright, GPS, comments, keywords, etc) when optimizing.', 'litespeed-cache'); ?>
					<?php echo __('This will increase the size of optimized files.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<?php
		if (!is_multisite()) :
			// webp
			require LSCWP_DIR . 'tpl/img_optm/settings.media_webp.tpl.php';

		endif;
		?>

		<tr>
			<th>
				<?php $id = Base::O_IMG_OPTM_WEBP_ATTR; ?>
				<?php $this->title($id); ?>
			</th>
			<td>

				<div class="litespeed-textarea-recommended">
					<div>
						<?php $this->build_textarea($id, 40); ?>
					</div>
					<div>
						<?php $this->recommended($id); ?>
					</div>
				</div>

				<div class="litespeed-desc">
					<?php echo __('Specify which element attributes will be replaced with WebP/AVIF.', 'litespeed-cache'); ?>
					<?php echo __('Only attributes listed here will be replaced.', 'litespeed-cache'); ?>
					<br /><?php echo sprintf(__('Use the format %1$s or %2$s (element is optional).', 'litespeed-cache'), '<code>element.attribute</code>', '<code>.attribute</code>'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_IMG_OPTM_WEBP_REPLACE_SRCSET; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Enable replacement of WebP/AVIF in %s elements that were generated outside of WordPress logic.', 'litespeed-cache'), '<code>srcset</code>'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/imageopt/#webp-for-extra-srcset'); ?>
				</div>
			</td>
		</tr>

	</tbody>
</table>

<?php

$this->form_end();
img_optm/summary.tpl.php000064400000042540151540355030011371 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$closest_server = Cloud::get_summary('server.' . Cloud::SVC_IMG_OPTM);
$usage_cloud = Cloud::get_summary('usage.' . Cloud::SVC_IMG_OPTM);
$allowance = Cloud::cls()->allowance(Cloud::SVC_IMG_OPTM);

$__img_optm = Img_Optm::cls();

$wet_limit = $__img_optm->wet_limit();
$img_count = $__img_optm->img_count();

$optm_summary = Img_Optm::get_summary();

list($last_run, $is_running) = $__img_optm->cron_running(false);
$finished_percentage = 0;
if ($img_count['groups_all']) $finished_percentage = 100 - floor($img_count['groups_new'] * 100 / $img_count['groups_all']);
if ($finished_percentage == 100 && $img_count['groups_new']) {
	$finished_percentage = 99;
}

$unfinished_num = 0;
if (!empty($img_count['img.' . Img_Optm::STATUS_REQUESTED])) {
	$unfinished_num += $img_count['img.' . Img_Optm::STATUS_REQUESTED];
}
if (!empty($img_count['img.' . Img_Optm::STATUS_NOTIFIED])) {
	$unfinished_num += $img_count['img.' . Img_Optm::STATUS_NOTIFIED];
}
if (!empty($img_count['img.' . Img_Optm::STATUS_ERR_FETCH])) {
	$unfinished_num += $img_count['img.' . Img_Optm::STATUS_ERR_FETCH];
}

$imgoptm_service_hot = $this->cls('Cloud')->service_hot(Cloud::SVC_IMG_OPTM . '-' . Img_Optm::CLOUD_ACTION_NEW_REQ);
?>
<div class="litespeed-flex-container litespeed-column-with-boxes">
	<div class="litespeed-width-7-10 litespeed-column-left litespeed-image-optim-summary-wrapper">
		<div class="litespeed-image-optim-summary">

			<h3>
				<?php if ($closest_server) : ?>
					<a href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array('svc' => Cloud::SVC_IMG_OPTM)); ?>" class="litespeed-info-button  litespeed-redetect" data-balloon-pos="right" data-balloon-break aria-label="<?php echo sprintf(__('Current closest Cloud server is %s.&#10; Click to redetect.', 'litespeed-cache'), $closest_server); ?>" data-litespeed-cfm="<?php echo __('Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache'); ?>"><span class="litespeed-quic-icon"></span> <?php echo __('Redetect', 'litespeed-cache'); ?></a>
				<?php else : ?>
					<span class="litespeed-quic-icon"></span> <?php echo __('Redetect', 'litespeed-cache'); ?>
				<?php endif; ?>
				<?php echo __('Optimize images with our QUIC.cloud server', 'litespeed-cache'); ?>
				<a href="https://docs.litespeedtech.com/lscache/lscwp/imageopt/#image-optimization-summary-tab" target="_blank" class="litespeed-right litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache'); ?></a>
			</h3>

			<p>
				<?php echo sprintf(__('You can request a maximum of %s images at once.', 'litespeed-cache'), '<strong>' . intval($allowance) . '</strong>'); ?>
			</p>

			<?php if ($wet_limit) : ?>
				<p class="litespeed-desc">
					<?php echo __('To make sure our server can communicate with your server without any issues and everything works fine, for the few first requests the number of image groups allowed in a single request is limited.', 'litespeed-cache'); ?>
					<?php echo __('Current limit is', 'litespeed-cache') . ': <strong>' . $wet_limit . '</strong>'; ?>
				</p>
			<?php endif; ?>

			<div class="litespeed-img-optim-actions">
				<?php if ($imgoptm_service_hot) : ?>
					<button class="button button-secondary" disabled>
						<span class="dashicons dashicons-images-alt2"></span>&nbsp;<?php echo __('Send Optimization Request', 'litespeed-cache'); ?>
						- <?php echo sprintf(__('Available after %d second(s)', 'litespeed-cache'), $imgoptm_service_hot); ?>
					</button>
				<?php else : ?>
					<a data-litespeed-onlyonce class="button button-primary" <?php if (!empty($img_count['groups_new']) || !empty($img_count['group.' . Img_Optm::STATUS_RAW])) : ?> href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_NEW_REQ); ?>" <?php else : ?> href='javascript:;' disabled <?php endif; ?>>
						<span class="dashicons dashicons-images-alt2"></span>&nbsp;<?php echo __('Send Optimization Request', 'litespeed-cache'); ?>
					</a>
				<?php endif; ?>

				<a data-litespeed-onlyonce class="button button-secondary" data-balloon-length="large" data-balloon-pos="right" aria-label="<?php echo __('Only press the button if the pull cron job is disabled.', 'litespeed-cache'); ?> <?php echo __('Images will be pulled automatically if the cron job is running.', 'litespeed-cache'); ?>" <?php if (!empty($img_count['img.' . Img_Optm::STATUS_NOTIFIED]) && !$is_running) : ?> href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_PULL); ?>" <?php else : ?> href='javascript:;' disabled <?php endif; ?>>
					<?php echo __('Pull Images', 'litespeed-cache'); ?>
				</a>
			</div>

			<div>
				<h3 class="litespeed-title-section">
					<?php echo __('Optimization Status', 'litespeed-cache'); ?>
				</h3>

				<div class="litespeed-light-code">

					<?php if (!empty($img_count['group.' . Img_Optm::STATUS_NEW])) : ?>
						<p class="litespeed-success">
							<?php echo Lang::img_status(Img_Optm::STATUS_NEW); ?>:
							<code>
								<?php echo Admin_Display::print_plural($img_count['group_new']); ?>
							</code>
						</p>
					<?php endif; ?>

					<?php if (!empty($img_count['group.' . Img_Optm::STATUS_RAW])) : ?>
						<p class="litespeed-success">
							<?php echo Lang::img_status(Img_Optm::STATUS_RAW); ?>:
							<code>
								<?php echo Admin_Display::print_plural($img_count['group.' . Img_Optm::STATUS_RAW]); ?>
								(<?php echo Admin_Display::print_plural($img_count['img.' . Img_Optm::STATUS_RAW], 'image'); ?>)
							</code>
						</p>
					<?php endif; ?>

					<?php if (!empty($img_count['group.' . Img_Optm::STATUS_REQUESTED])) : ?>
						<p class="litespeed-success">
							<?php echo Lang::img_status(Img_Optm::STATUS_REQUESTED); ?>:
							<code>
								<?php echo Admin_Display::print_plural($img_count['group.' . Img_Optm::STATUS_REQUESTED]); ?>
								(<?php echo Admin_Display::print_plural($img_count['img.' . Img_Optm::STATUS_REQUESTED], 'image'); ?>)
							</code>
						</p>
						<p class="litespeed-desc">
							<?php echo __('After the QUIC.cloud Image Optimization server finishes optimization, it will notify your site to pull the optimized images.', 'litespeed-cache'); ?>
							<?php echo __('This process is automatic.', 'litespeed-cache'); ?>
						</p>
					<?php endif; ?>

					<?php if (!empty($img_count['group.' . Img_Optm::STATUS_NOTIFIED])) : ?>
						<p class="litespeed-success">
							<?php echo Lang::img_status(Img_Optm::STATUS_NOTIFIED); ?>:
							<code>
								<?php echo Admin_Display::print_plural($img_count['group.' . Img_Optm::STATUS_NOTIFIED]); ?>
								(<?php echo Admin_Display::print_plural($img_count['img.' . Img_Optm::STATUS_NOTIFIED], 'image'); ?>)
							</code>

						</p>
						<?php if ($last_run) : ?>
							<p class="litespeed-desc">
								<?php echo sprintf(__('Last pull initiated by cron at %s.', 'litespeed-cache'), '<code>' . Utility::readable_time($last_run) . '</code>'); ?>
							</p>
						<?php endif; ?>
					<?php endif; ?>

					<?php if (!empty($img_count['group.' . Img_Optm::STATUS_PULLED])) : ?>
						<p class="litespeed-success">
							<?php echo Lang::img_status(Img_Optm::STATUS_PULLED); ?>:
							<code>
								<?php echo Admin_Display::print_plural($img_count['group.' . Img_Optm::STATUS_PULLED]); ?>
								(<?php echo Admin_Display::print_plural($img_count['img.' . Img_Optm::STATUS_PULLED], 'image'); ?>)
							</code>
						</p>
					<?php endif; ?>

					<p><?php echo sprintf(
							'<a href="%1$s" class="button button-secondary litespeed-btn-warning" data-balloon-pos="right" aria-label="%2$s" %3$s><span class="dashicons dashicons-editor-removeformatting"></span>&nbsp;%4$s</a>',
							($unfinished_num ? Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_CLEAN) : 'javascript:;'),
							__('Remove all previous unfinished image optimization requests.', 'litespeed-cache'),
							($unfinished_num ? '' : ' disabled'),
							__('Clean Up Unfinished Data', 'litespeed-cache') . ($unfinished_num ? ': ' . Admin_Display::print_plural($unfinished_num, 'image') : '')
						);
						?></p>

					<h3 class="litespeed-title-section">
						<?php echo __('Storage Optimization', 'litespeed-cache'); ?>
					</h3>

					<p>
						<?php echo __('A backup of each image is saved before it is optimized.', 'litespeed-cache'); ?>
					</p>


					<?php if (!empty($optm_summary['bk_summary'])) : ?>
						<div class="">
							<p>
								<?php echo __('Last calculated', 'litespeed-cache') . ': <code>' . Utility::readable_time($optm_summary['bk_summary']['date']) . '</code>'; ?>
							</p>
							<?php if ($optm_summary['bk_summary']['count']) : ?>
								<p>
									<?php echo __('Files', 'litespeed-cache') . ': <code>' . intval($optm_summary['bk_summary']['count']) . '</code>'; ?>
								</p>
								<p>
									<?php echo __('Total', 'litespeed-cache') . ': <code>' . Utility::real_size($optm_summary['bk_summary']['sum']) . '</code>'; ?>
								</p>
							<?php endif; ?>
						</div>
					<?php endif; ?>

					<div>

						<a class="button button-secondary" data-balloon-pos="up" aria-label="<?php echo __('Calculate Original Image Storage', 'litespeed-cache'); ?>" <?php if ($finished_percentage > 0) : ?> href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_CALC_BKUP); ?>" <?php else : ?> href='javascript:;' disabled <?php endif; ?>>
							<span class="dashicons dashicons-update"></span> <?php echo __('Calculate Backups Disk Space', 'litespeed-cache'); ?>
						</a>
					</div>

				</div>

				<div>
					<h4><?php echo __('Image Thumbnail Group Sizes', 'litespeed-cache'); ?></h4>
					<div class="litespeed-desc litespeed-left20">
						<?php foreach (Media::cls()->get_image_sizes() as $title => $size) {
							echo "<div>$title ( " . ($size['width'] ? $size['width'] . 'px' : '*') . ' x ' . ($size['height'] ? $size['height'] . 'px' : '*') . ' )</div>';
						}; ?>
					</div>

				</div>

				<hr class="litespeed-hr-with-space">
				<div>
					<h4><?php echo __('Delete all backups of the original images', 'litespeed-cache'); ?></h4>
					<div class="notice notice-error litespeed-callout-bg inline">
						<p>
							🚨&nbsp;<?php echo __('This is irreversible.', 'litespeed-cache'); ?>
							<?php echo __('You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache'); ?>
						</p>
					</div>

				</div>
				<?php if (!empty($optm_summary['rmbk_summary'])) : ?>
					<div class="">
						<p>
							<?php echo __('Last ran', 'litespeed-cache') . ': <code>' . Utility::readable_time($optm_summary['rmbk_summary']['date']) . '</code>'; ?>
						</p>
						<p>
							<?php echo __('Files', 'litespeed-cache') . ': <code>' . $optm_summary['rmbk_summary']['count'] . '</code>'; ?>
						</p>
						<p>
							<?php echo __('Saved', 'litespeed-cache') . ': <code>' . Utility::real_size($optm_summary['rmbk_summary']['sum']) . '</code>'; ?>
						</p>
					</div>
				<?php endif; ?>
				<div class="litespeed-image-optim-summary-footer"><a href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_RM_BKUP); ?>" data-litespeed-cfm="<?php echo __('Are you sure you want to remove all image backups?', 'litespeed-cache'); ?>" class="litespeed-link-with-icon litespeed-danger">
						<span class="dashicons dashicons-trash"></span><?php echo __('Remove Original Image Backups', 'litespeed-cache'); ?>
					</a></div>
			</div>
		</div>
	</div>

	<div class="litespeed-width-3-10 litespeed-column-right">
		<div class="postbox litespeed-postbox litespeed-postbox-imgopt-info">
			<div class="inside">

				<h3 class="litespeed-title">
					<?php echo __('Image Information', 'litespeed-cache'); ?>
				</h3>

				<div class="litespeed-flex-container">
					<div class="litespeed-icon-vertical-middle">
						<?php echo GUI::pie($finished_percentage, 70, true); ?>
					</div>
					<div>
						<p>
							<?php echo __('Image groups total', 'litespeed-cache'); ?>:

							<?php if ($img_count['groups_new']) : ?>
								<code><?php echo Admin_Display::print_plural($img_count['groups_new'], 'group'); ?></code>
							<?php else : ?>
								<font class="litespeed-congratulate"><?php echo __('Congratulations, all gathered!', 'litespeed-cache'); ?></font>
							<?php endif; ?>

							<a href="https://docs.litespeedtech.com/lscache/lscwp/imageopt/#what-is-an-image-group" target="_blank" class="litespeed-desc litespeed-help-btn-icon" data-balloon-pos="up" aria-label="<?php echo __('What is a group?', 'litespeed-cache'); ?>">
								<span class="dashicons dashicons-editor-help"></span>
								<span class="screen-reader-text"><?php echo __('What is an image group?', 'litespeed-cache'); ?></span>
							</a>
						</p>
						<p>
							<?php echo __('Current image post id position', 'litespeed-cache'); ?>: <?php echo !empty($optm_summary['next_post_id']) ? $optm_summary['next_post_id'] : '-'; ?><br>
							<?php echo __('Maximum image post id', 'litespeed-cache'); ?>: <?php echo $img_count['max_id']; ?>
						</p>
					</div>
				</div>
			</div>
			<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact" style="display: none;">
				<a href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_RESCAN); ?>" class="" data-balloon-pos="up" data-balloon-length="large" aria-label="<?php echo __('Scan for any new unoptimized image thumbnail sizes and resend necessary image optimization requests.', 'litespeed-cache'); ?>">
					<?php echo __('Rescan New Thumbnails', 'litespeed-cache'); ?>
				</a>
			</div>
		</div>

		<div class="postbox litespeed-postbox">
			<div class="inside">
				<h3 class="litespeed-title">
					<?php echo __('Optimization Summary', 'litespeed-cache'); ?>
				</h3>
				<p>
					<?php echo __('Total Reduction', 'litespeed-cache'); ?>: <code><?php echo isset($optm_summary['reduced']) ? Utility::real_size($optm_summary['reduced']) : '-'; ?></code>
				</p>
				<p>
					<?php echo __('Images Pulled', 'litespeed-cache'); ?>: <code><?php echo isset($optm_summary['img_taken']) ? $optm_summary['img_taken'] : '-'; ?></code>
				</p>
				<p>
					<?php echo __('Last Request', 'litespeed-cache'); ?>: <code><?php echo isset($optm_summary['last_requested']) ? Utility::readable_time($optm_summary['last_requested']) : '-'; ?></code>
				</p>
				<p>
					<?php echo __('Last Pulled', 'litespeed-cache'); ?>: <code><?php echo isset($optm_summary['last_pulled']) ? Utility::readable_time($optm_summary['last_pulled']) : '-'; ?></code>
					<?php if (isset($optm_summary['last_pulled_by_cron']) && $optm_summary['last_pulled_by_cron']) echo '(Cron)'; ?>
				</p>
			</div>
			<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact litespeed-desc">
				<?php echo sprintf(__('Results can be checked in <a %s>Media Library</a>.', 'litespeed-cache'), 'href="upload.php?mode=list"'); ?>
			</div>
		</div>

		<div class="postbox litespeed-postbox">
			<div class="inside">
				<h3 class="litespeed-title"><?php echo __('Optimization Tools', 'litespeed-cache'); ?></h3>

				<p>
					<?php echo __('You can quickly switch between using original (unoptimized versions) and optimized image files. It will affect all images on your website, both regular and webp versions if available.', 'litespeed-cache'); ?>
				</p>

				<div class="litespeed-links-group">
					<span>
						<a href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_BATCH_SWITCH_ORI); ?>" class="litespeed-link-with-icon" data-balloon-pos="up" aria-label="<?php echo __('Use original images (unoptimized) on your site', 'litespeed-cache'); ?>">
							<span class="dashicons dashicons-undo"></span><?php echo __('Use Original Files', 'litespeed-cache'); ?>
						</a>
					</span><span>
						<a href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_BATCH_SWITCH_OPTM); ?>" class="litespeed-link-with-icon litespeed-icon-right" data-balloon-pos="up" aria-label="<?php echo __('Switch back to using optimized images on your site', 'litespeed-cache'); ?>">
							<?php echo __('Use Optimized Files', 'litespeed-cache'); ?><span class="dashicons dashicons-redo"></span>
						</a>
					</span>
				</div>

			</div>
			<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
				<p><a href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_RESET_COUNTER); ?>" class="litespeed-link-with-icon litespeed-warning">
						<span class="dashicons dashicons-dismiss"></span><?php echo __('Soft Reset Optimization Counter', 'litespeed-cache'); ?>
					</a></p>

				<div class="litespeed-desc">
					<?php echo sprintf(__('This will reset the %1$s. If you changed WebP/AVIF settings and want to generate %2$s for the previously optimized images, use this action.', 'litespeed-cache'), '<code>' . __('Current image post id position', 'litespeed-cache') . '</code>', 'WebP/AVIF'); ?>
				</div>
			</div>
			<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
				<p><a href="<?php echo Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_DESTROY); ?>" class="litespeed-link-with-icon litespeed-danger" data-litespeed-cfm="<?php echo __('Are you sure to destroy all optimized images?', 'litespeed-cache'); ?>">
						<span class="dashicons dashicons-dismiss"></span><?php echo __('Destroy All Optimization Data', 'litespeed-cache'); ?>
					</a></p>

				<div class="litespeed-desc">
					<?php echo __('Remove all previous image optimization requests/results, revert completed optimizations, and delete all optimization files.', 'litespeed-cache'); ?>
				</div>
			</div>
		</div>
	</div>
</div>inc/admin_footer.php000064400000003044151540355030010476 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

// &#10030;&#10030;&#10030;&#10030;&#10030;
$stars =
	'<span class="wporg-ratings rating-stars"><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span></span>';
$rate_us =
	'<a href="https://wordpress.org/support/plugin/litespeed-cache/reviews/?filter=5#new-post" rel="noopener noreferer" target="_blank">' .
	sprintf(__('Rate %s on %s', 'litespeed-cache'), '<strong>' . __('LiteSpeed Cache', 'litespeed-cache') . $stars . '</strong>', 'WordPress.org') .
	'</a>';

$wiki = '<a href="https://docs.litespeedtech.com/lscache/lscwp/" target="_blank">' . __('Read LiteSpeed Documentation', 'litespeed-cache') . '</a>';

$forum = '<a href="https://wordpress.org/support/plugin/litespeed-cache" target="_blank">' . __('Visit LSCWP support forum', 'litespeed-cache') . '</a>';

$community = '<a href="https://litespeedtech.com/slack" target="_blank">' . __('Join LiteSpeed Slack community', 'litespeed-cache') . '</a>';

// Change the footer text
if (!is_multisite() || is_network_admin()) {
	$footer_text = $rate_us . ' | ' . $wiki . ' | ' . $forum . ' | ' . $community;
} else {
	$footer_text = $wiki . ' | ' . $forum . ' | ' . $community;
}
inc/check_cache_disabled.php000064400000003072151540355030012060 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;

$reasons = array() ;

if ( ! defined( 'LITESPEED_ALLOWED' ) ) {
	if ( defined( 'LITESPEED_SERVER_TYPE' ) && LITESPEED_SERVER_TYPE == 'NONE' ) {
		$reasons[] = array(
			'title' => __( 'To use the caching functions you must have a LiteSpeed web server or be using QUIC.cloud CDN.', 'litespeed-cache' ),
			'link'	=> 'https://docs.litespeedtech.com/lscache/lscwp/faq/#why-do-the-cache-features-require-a-litespeed-server',
		) ;
	} else {
		$reasons[] = array(
			'title' => __( 'Please enable the LSCache Module at the server level, or ask your hosting provider.', 'litespeed-cache' ),
			'link'	=> 'https://docs.litespeedtech.com/lscache/lscwp/#server-level-prerequisites',
		) ;
	}
}
elseif ( ! defined( 'LITESPEED_ON' ) ) {
	$reasons[] = array(
		'title' => __( 'Please enable LiteSpeed Cache in the plugin settings.', 'litespeed-cache' ) ,
		'link'	=> 'https://docs.litespeedtech.com/lscache/lscwp/cache/#enable-cache',
	) ;
}

if ( $reasons ) :
?>
	<div class="litespeed-callout notice notice-error inline">

		<h4><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?></h4>

		<p>
			<?php echo __( 'LSCache caching functions on this page are currently unavailable!', 'litespeed-cache' ) ; ?>
		</p>

		<ul class="litespeed-list">
		<?php foreach ( $reasons as $v ) : ?>
			<li>
				<?php echo esc_html( $v[ 'title' ] ); ?>

				<a href="<?php echo $v[ 'link' ] ; ?>" target="_blank" class="litespeed-learn-more"><?php echo __( 'Learn More', 'litespeed-cache' ) ; ?></a>
			</li>
		<?php endforeach ; ?>
		</ul>

	</div>
<?php endif ;
inc/check_if_network_disable_all.php000064400000001157151540355030013652 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

if ( ! is_multisite() ) {
	return;
}

if ( get_current_blog_id() === BLOG_ID_CURRENT_SITE ) {
	return;
}

if ( ! $this->network_conf( Base::NETWORK_O_USE_PRIMARY ) ) {
	return;
}
?>
		<div class="litespeed-callout notice notice-error inline">
			<h4><?php echo __( 'WARNING', 'litespeed-cache' ); ?></h4>
			<p>
				<?php echo __('The network admin selected use primary site configs for all subsites.', 'litespeed-cache'); ?>
				<?php echo __('The following options are selected, but are not editable in this settings page.', 'litespeed-cache'); ?>
			</p>
		</div>
inc/disabled_all.php000064400000000403151540355030010423 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

$err = __('Disable All Features', 'litespeed-cache');

// other plugin left cache expired rules in .htaccess which will cause conflicts
echo Admin_Display::build_notice(Admin_Display::NOTICE_RED, $err);
inc/in_upgrading.php000064400000000361151540355030010475 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

$msg = __('LiteSpeed cache plugin upgraded. Please refresh the page to complete the configuration data upgrade.', 'litespeed-cache');

echo self::build_notice(self::NOTICE_BLUE, $msg);
inc/metabox.php000064400000002272151540355030007471 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit();

wp_nonce_field(self::POST_NONCE_ACTION, Router::NONCE);

$post_id = get_the_ID();

foreach ($this->_postmeta_settings as $k => $v) {
	$existing_val = get_post_meta($post_id, $k, true);

	if (in_array($k, array('litespeed_vpi_list', 'litespeed_vpi_list_mobile'))) {
		if (is_array($existing_val)) {
			$existing_val = implode(PHP_EOL, $existing_val);
		}
		echo '<div style="margin-bottom:10px;"><label for="' . Str::trim_quotes($k) . '">' . $v . '</label>';
		echo '<textarea style="width:100%" rows="5" id="' . Str::trim_quotes($k) . '" name="' . Str::trim_quotes($k) . '">' . $existing_val . '</textarea>';
		echo '</div>';
	} else {
		echo '<div style="display:flex;margin-bottom:10px;align-items: center;gap: 2ch;justify-content: space-between;"><label for="' . $k . '">' . $v . '</label>';
		echo '<input class="litespeed-tiny-toggle" id="' .
			Str::trim_quotes($k) .
			'" name="' .
			Str::trim_quotes($k) .
			'" type="checkbox" value="1" ' .
			($existing_val ? 'checked' : '') .
			' />';
		echo '</div>';
	}
}

echo '<div style="text-align:right;">';
Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/metabox/');
echo '</div>';
inc/modal.footer.php000064400000000021151540355030010411 0ustar00
</div>
<?php
//
inc/modal.header.php000064400000000766151540355030010363 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;
?>

<link rel="stylesheet" href="<?php echo LSWCP_PLUGIN_URL ; ?>assets/css/litespeed.css" />

<div class="litespeed litespeed-modal">

	<?php if ( $_progress ) : ?>
	<div class="litespeed-progress">
		<div class="litespeed-progress-bar" role="progressbar" style="width: <?php echo $_progress ; ?>%" aria-valuenow="<?php echo $_progress ; ?>" aria-valuemin="0" aria-valuemax="100"></div>
	</div>
	<?php endif ; ?>

	<div class="litespeed-wrap">
inc/show_display_installed.php000064400000002530151540355030012573 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

$buf =
	'<h3>' .
	__('LiteSpeed Cache plugin is installed!', 'litespeed-cache') .
	'</h3>' .
	' ' .
	__('This message indicates that the plugin was installed by the server admin.', 'litespeed-cache') .
	' ' .
	__('The LiteSpeed Cache plugin is used to cache pages - a simple way to improve the performance of the site.', 'litespeed-cache') .
	' ' .
	__('However, there is no way of knowing all the possible customizations that were implemented.', 'litespeed-cache') .
	' ' .
	__('For that reason, please test the site to make sure everything still functions properly.', 'litespeed-cache') .
	'<br /><br />' .
	__('Examples of test cases include:', 'litespeed-cache') .
	'<ul>' .
	'<li>' .
	__('Visit the site while logged out.', 'litespeed-cache') .
	'</li>' .
	'<li>' .
	__('Create a post, make sure the front page is accurate.', 'litespeed-cache') .
	'</li>' .
	'</ul>' .
	sprintf(
		__('If there are any questions, the team is always happy to answer any questions on the <a %s>support forum</a>.', 'litespeed-cache'),
		'href="https://wordpress.org/support/plugin/litespeed-cache" rel="noopener noreferrer" target="_blank"'
	) .
	'<br />' .
	__('If you would rather not move at litespeed, you can deactivate this plugin.', 'litespeed-cache');

self::add_notice(self::NOTICE_BLUE . ' lscwp-whm-notice', $buf);
inc/show_error_cookie.php000064400000001252151540355030011551 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

$err =
	__('NOTICE: Database login cookie did not match your login cookie.', 'litespeed-cache') .
	' ' .
	__('If the login cookie was recently changed in the settings, please log out and back in.', 'litespeed-cache') .
	' ' .
	sprintf(__('If not, please verify the setting in the <a href="%1$s">Advanced tab</a>.', 'litespeed-cache'), admin_url('admin.php?page=litespeed-cache#advanced'));

if (LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_OLS') {
	$err .= ' ' . __('If using OpenLiteSpeed, the server must be restarted once for the changes to take effect.', 'litespeed-cache');
}

self::add_notice(self::NOTICE_YELLOW, $err);
inc/show_rule_conflict.php000064400000001257151540355030011724 0ustar00<?php
namespace LiteSpeed;
defined('WPINC') || exit();

$err = sprintf(
	__(
		'Unexpected cache rule %2$s found in %1$s file. This rule may cause visitors to see old versions of pages due to the browser caching HTML pages. If you are sure that HTML pages are not being browser cached, this message can be dismissed. (<a %3$s>Learn More</a>)',
		'litespeed-cache'
	),
	'.htaccess',
	'`ExpiresDefault`',
	'href="https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#browser-displays-stale-content" target="_blank"'
);

// other plugin left cache expired rules in .htaccess which will cause conflicts
echo self::build_notice(self::NOTICE_YELLOW . ' lscwp-notice-ruleconflict', $err);
page_optm/entry.tpl.php000064400000003502151540355030011170 0ustar00<?php
namespace LiteSpeed ;
defined( 'WPINC' ) || exit ;

$menu_list = array(
	'settings_css' 				=> __( 'CSS Settings', 'litespeed-cache' ),
	'settings_js'				=> __( 'JS Settings', 'litespeed-cache' ),
	'settings_html' 			=> __( 'HTML Settings', 'litespeed-cache' ),
	'settings_media' 			=> __( 'Media Settings', 'litespeed-cache' ),
	'settings_vpi' 				=> __( 'VPI', 'litespeed-cache' ),
	'settings_media_exc'		=> __( 'Media Excludes', 'litespeed-cache' ),
	'settings_localization'		=> __( 'Localization', 'litespeed-cache' ),
	'settings_tuning' 			=> __( 'Tuning', 'litespeed-cache' ),
	'settings_tuning_css' 			=> __( 'Tuning', 'litespeed-cache' ) . ' - CSS',
);

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __( 'LiteSpeed Cache Page Optimization', 'litespeed-cache' ) ; ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER ; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">

	<div class="litespeed-callout notice notice-warning inline">
		<h4><?php echo __( 'NOTICE', 'litespeed-cache' ) ; ?></h4>
		<p><?php echo __( 'Please test thoroughly when enabling any option in this list. After changing Minify/Combine settings, please do a Purge All action.', 'litespeed-cache' ) ; ?></p>
	</div>

	<h2 class="litespeed-header nav-tab-wrapper">
	<?php
		$i = 1 ;
		foreach ($menu_list as $tab => $val){
			$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '' ;
			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>" ;
			$i ++ ;
		}
	?>
	</h2>

	<div class="litespeed-body">
	<?php
		$this->form_action() ;

		// include all tpl for faster UE
		foreach ($menu_list as $tab => $val) {
			echo "<div data-litespeed-layout='$tab'>" ;
			require LSCWP_DIR . "tpl/page_optm/$tab.tpl.php" ;
			echo "</div>" ;
		}

		$this->form_end() ;

	?>
	</div>

</div>
page_optm/settings_css.tpl.php000064400000033664151540355030012553 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

// CSS::cls()->test_url( '' );
// exit;

$css_summary = CSS::get_summary();
$ucss_summary = UCSS::get_summary();
$closest_server_ucss = Cloud::get_summary('server.' . Cloud::SVC_UCSS);
$closest_server = Cloud::get_summary('server.' . Cloud::SVC_CCSS);

$ccss_queue = $this->load_queue('ccss');
$ucss_queue = $this->load_queue('ucss');

$next_gen = '<code class="litespeed-success">' . $this->cls('Media')->next_gen_image_title() . '</code>';

$ucss_service_hot = $this->cls('Cloud')->service_hot(Cloud::SVC_UCSS);
$ccss_service_hot = $this->cls('Cloud')->service_hot(Cloud::SVC_CCSS);
?>

<h3 class="litespeed-title-short">
	<?php echo __('CSS Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_CSS_MIN; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<?php Doc::maybe_on_by_gm($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Minify CSS files and inline CSS code.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_CSS_COMB; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<?php Doc::maybe_on_by_gm($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Combine CSS files and inline CSS code.', 'litespeed-cache'); ?>
					<a href="https://docs.litespeedtech.com/lscache/lscwp/ts-optimize/" target="_blank"><?php echo __('How to Fix Problems Caused by CSS/JS Optimization.', 'litespeed-cache'); ?></a>
				</div>
			</td>
		</tr>

		<tr>
			<th class="litespeed-padding-left">
				<?php $id = Base::O_OPTM_UCSS; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<?php Doc::maybe_on_by_gm($id); ?>
				<div class="litespeed-desc">
					<?php if (!$this->cls('Cloud')->activated()) : ?>
						<div class="litespeed-callout notice notice-error inline">
							<h4><?php echo __('WARNING', 'litespeed-cache'); ?></h4>
							<?php echo Error::msg('qc_setup_required'); ?>
						</div>
					<?php endif; ?>

					<?php echo __('Use QUIC.cloud online service to generate unique CSS.', 'litespeed-cache'); ?>
					<?php echo __('This will drop the unused CSS on each page from the combined file.', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#generate-ucss'); ?>
					<br /><?php echo __('Automatic generation of unique CSS is in the background via a cron-based queue.', 'litespeed-cache'); ?>
					<br />
					<font class="litespeed-success">API: <?php echo sprintf(__('Filter %s available for UCSS per page type generation.', 'litespeed-cache'), "<code>add_filter( 'litespeed_ucss_per_pagetype', '__return_true' );</code>"); ?></font>

					<?php if ($this->conf(Base::O_OPTM_UCSS) && !$this->conf(Base::O_OPTM_CSS_COMB)) : ?>
						<br />
						<font class="litespeed-warning">
							<?php echo sprintf(__('This option is bypassed because %1$s option is %2$s.', 'litespeed-cache'), '<code>' . Lang::title(Base::O_OPTM_CSS_COMB) . '</code>', '<code>' . __('OFF', 'litespeed-cache') . '</code>'); ?>
						</font>
					<?php endif; ?>

				</div>

				<div class="litespeed-desc litespeed-left20">
					<?php if ($ucss_summary) : ?>
						<?php if (!empty($ucss_summary['last_request'])) : ?>
							<p>
								<?php echo __('Last generated', 'litespeed-cache') . ': <code>' . Utility::readable_time($ucss_summary['last_request']) . '</code>'; ?>
							</p>
							<p>
								<?php echo __('Last requested cost', 'litespeed-cache') . ': <code>' . $ucss_summary['last_spent'] . 's</code>'; ?>
							</p>
						<?php endif; ?>
					<?php endif; ?>

					<?php if ($closest_server_ucss) : ?>
						<a class='litespeed-redetect' href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array('svc' => Cloud::SVC_UCSS)); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo sprintf(__('Current closest Cloud server is %s.&#10; Click to redetect.', 'litespeed-cache'), $closest_server_ucss); ?>' data-litespeed-cfm="<?php echo __('Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache'); ?>"><i class='litespeed-quic-icon'></i> <?php echo __('Redetect', 'litespeed-cache'); ?></a>
					<?php endif; ?>

					<?php if (!empty($ucss_queue)) : ?>
						<div class="litespeed-callout notice notice-warning inline">
							<h4>
								<?php echo sprintf(__('URL list in %s queue waiting for cron', 'litespeed-cache'), 'UCSS'); ?> ( <?php echo count($ucss_queue); ?> )
								<a href="<?php echo Utility::build_url(Router::ACTION_UCSS, UCSS::TYPE_CLEAR_Q); ?>" class="button litespeed-btn-warning litespeed-right">Clear</a>
							</h4>
							<p>
								<?php $i = 0;
								foreach ($ucss_queue as $k => $v) : ?>
									<?php if ($i++ > 20) : ?>
										<?php echo '...'; ?>
										<?php break; ?>
									<?php endif; ?>
									<?php if (!is_array($v)) continue; ?>
									<?php if (!empty($v['_status'])) : ?><span class="litespeed-success"><?php endif; ?>
										<?php echo esc_html($v['url']); ?>
										<?php if (!empty($v['_status'])) : ?></span><?php endif; ?>
									<?php if ($pos = strpos($k, ' ')) echo ' (' . __('Vary Group', 'litespeed-cache') . ':' . esc_html(substr($k, 0, $pos)) . ')'; ?>
									<?php if ($v['is_mobile']) echo ' <span data-balloon-pos="up" aria-label="mobile">📱</span>'; ?>
									<?php if (!empty($v['is_webp'])) echo ' ' . $next_gen; ?>
									<br />
								<?php endforeach; ?>
							</p>
						</div>
						<?php if ($ucss_service_hot) : ?>
							<button class="button button-secondary" disabled>
								<?php echo sprintf(__('Run %s Queue Manually', 'litespeed-cache'), 'UCSS'); ?>
								- <?php echo sprintf(__('Available after %d second(s)', 'litespeed-cache'), $ucss_service_hot); ?>
							</button>
						<?php else : ?>
							<a href="<?php echo Utility::build_url(Router::ACTION_UCSS, UCSS::TYPE_GEN); ?>" class="button litespeed-btn-success">
								<?php echo sprintf(__('Run %s Queue Manually', 'litespeed-cache'), 'UCSS'); ?>
							</a>
						<?php endif; ?>
						<?php Doc::queue_issues(); ?>
					<?php endif; ?>
				</div>

			</td>
		</tr>

		<tr>
			<th class="litespeed-padding-left">
				<?php $id = Base::O_OPTM_UCSS_INLINE; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<?php Doc::maybe_on_by_gm($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Inline UCSS to reduce the extra CSS file loading. This option will not be automatically turned on for %1$s pages. To use it on %1$s pages, please set it to ON.', 'litespeed-cache'), '<code>' . Lang::title(Base::O_GUEST) . '</code>'); ?>
					<br />
					<font class="litespeed-info">
						<?php echo sprintf(__('This option will automatically bypass %s option.', 'litespeed-cache'), '<code>' . Lang::title(Base::O_OPTM_CSS_ASYNC) . '</code>'); ?>
					</font>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_CSS_COMB_EXT_INL; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Include external CSS and inline CSS in combined file when %1$s is also enabled. This option helps maintain the priorities of CSS, which should minimize potential errors caused by CSS Combine.', 'litespeed-cache'), '<code>' . Lang::title(Base::O_OPTM_CSS_COMB) . '</code>'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_CSS_ASYNC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<?php Doc::maybe_on_by_gm($id); ?>
				<div class="litespeed-desc">
					<?php if (!$this->cls('Cloud')->activated()) : ?>
						<div class="litespeed-callout notice notice-error inline">
							<h4><?php echo __('WARNING', 'litespeed-cache'); ?></h4>
							<?php echo Error::msg('qc_setup_required'); ?>
						</div>
					<?php endif; ?>
					<?php echo __('Optimize CSS delivery.', 'litespeed-cache'); ?>
					<?php echo __('This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache'); ?><br />
					<?php echo __('Use QUIC.cloud online service to generate critical CSS and load remaining CSS asynchronously.', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-css-asynchronously'); ?><br />
					<?php echo __('Automatic generation of critical CSS is in the background via a cron-based queue.', 'litespeed-cache'); ?><br />
					<?php echo sprintf(__('When this option is turned %s, it will also load Google Fonts asynchronously.', 'litespeed-cache'), '<code>' . __('ON', 'litespeed-cache') . '</code>'); ?>
					<br />
					<font class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('Elements with attribute %s in HTML code will be excluded.', 'litespeed-cache'), '<code>data-no-async="1"</code>'); ?>
					</font>

					<?php if ($this->conf(Base::O_OPTM_CSS_ASYNC) && $this->conf(Base::O_OPTM_CSS_COMB) && $this->conf(Base::O_OPTM_UCSS) && $this->conf(Base::O_OPTM_UCSS_INLINE)) : ?>
						<br />
						<font class="litespeed-warning">
							<?php echo sprintf(__('This option is bypassed due to %s option.', 'litespeed-cache'), '<code>' . Lang::title(Base::O_OPTM_UCSS_INLINE) . '</code>'); ?>
						</font>
					<?php endif; ?>

				</div>

				<div class="litespeed-desc litespeed-left20">
					<?php if ($css_summary) : ?>
						<?php if (!empty($css_summary['last_request_ccss'])) : ?>
							<p>
								<?php echo __('Last generated', 'litespeed-cache') . ': <code>' . Utility::readable_time($css_summary['last_request_ccss']) . '</code>'; ?>
							</p>
							<p>
								<?php echo __('Last requested cost', 'litespeed-cache') . ': <code>' . $css_summary['last_spent_ccss'] . 's</code>'; ?>
							</p>
						<?php endif; ?>
					<?php endif; ?>

					<?php if ($closest_server) : ?>
						<a class='litespeed-redetect' href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array('svc' => Cloud::SVC_CCSS)); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo sprintf(__('Current closest Cloud server is %s.&#10; Click to redetect.', 'litespeed-cache'), $closest_server); ?>' data-litespeed-cfm="<?php echo __('Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache'); ?>"><i class='litespeed-quic-icon'></i> <?php echo __('Redetect', 'litespeed-cache'); ?></a>
					<?php endif; ?>

					<?php if (!empty($ccss_queue)) : ?>
						<div class="litespeed-callout notice notice-warning inline">
							<h4>
								<?php echo sprintf(__('URL list in %s queue waiting for cron', 'litespeed-cache'), 'CCSS'); ?> ( <?php echo count($ccss_queue); ?> )
								<a href="<?php echo Utility::build_url(Router::ACTION_CSS, CSS::TYPE_CLEAR_Q_CCSS); ?>" class="button litespeed-btn-warning litespeed-right">Clear</a>
							</h4>
							<p>
								<?php $i = 0;
								foreach ($ccss_queue as $k => $v) : ?>
									<?php if ($i++ > 20) : ?>
										<?php echo '...'; ?>
										<?php break; ?>
									<?php endif; ?>
									<?php if (!is_array($v)) continue; ?>
									<?php if (!empty($v['_status'])) : ?><span class="litespeed-success"><?php endif; ?>
										<?php echo esc_html($v['url']); ?>
										<?php if (!empty($v['_status'])) : ?></span><?php endif; ?>
									<?php if ($pos = strpos($k, ' ')) echo ' (' . __('Vary Group', 'litespeed-cache') . ':' . esc_html(substr($k, 0, $pos)) . ')'; ?>
									<?php if ($v['is_mobile']) echo ' <span data-balloon-pos="up" aria-label="mobile">📱</span>'; ?>
									<?php if (!empty($v['is_webp'])) echo ' ' . $next_gen; ?>
									<br />
								<?php endforeach; ?>
							</p>
						</div>
						<?php if ($ccss_service_hot) : ?>
							<button class="button button-secondary" disabled>
								<?php echo sprintf(__('Run %s Queue Manually', 'litespeed-cache'), 'CCSS'); ?>
								- <?php echo sprintf(__('Available after %d second(s)', 'litespeed-cache'), $ccss_service_hot); ?>
							</button>
						<?php else : ?>
							<a href="<?php echo Utility::build_url(Router::ACTION_CSS, CSS::TYPE_GEN_CCSS); ?>" class="button litespeed-btn-success">
								<?php echo sprintf(__('Run %s Queue Manually', 'litespeed-cache'), 'CCSS'); ?>
							</a>
						<?php endif; ?>
						<?php Doc::queue_issues(); ?>
					<?php endif; ?>
				</div>
			</td>
		</tr>

		<tr>
			<th class="litespeed-padding-left">
				<?php $id = Base::O_OPTM_CCSS_PER_URL; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Disable this option to generate CCSS per Post Type instead of per page. This can save significant CCSS quota, however it may result in incorrect CSS styling if your site uses a page builder.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th class="litespeed-padding-left">
				<?php $id = Base::O_OPTM_CSS_ASYNC_INLINE; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('This will inline the asynchronous CSS library to avoid render blocking.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_CSS_FONT_DISPLAY; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id, array(__('Default', 'litespeed-cache'), 'Swap')); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Set this to append %1$s to all %2$s rules before caching CSS to specify how fonts should be displayed while being downloaded.', 'litespeed-cache'), '<code>font-display</code>', '<code>@font-face</code>'); ?>
					<br /><?php echo sprintf(__('%s is recommended.', 'litespeed-cache'), '<code>' . __('Swap', 'litespeed-cache') . '</code>'); ?>
				</div>
			</td>
		</tr>

	</tbody>
</table>page_optm/settings_html.tpl.php000064400000013423151540355030012716 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __('HTML Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#html-settings-tab'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th>
				<?php $id = Base::O_OPTM_HTML_MIN; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Minify HTML content.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_DNS_PREFETCH; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Prefetching DNS can reduce latency for visitors.', 'litespeed-cache'); ?>
					<?php echo __('For example', 'litespeed-cache'); ?>: <code>//www.example.com</code>
					<?php Doc::one_per_line(); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#dns-prefetch'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_DNS_PREFETCH_CTRL; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Automatically enable DNS prefetching for all URLs in the document, including images, CSS, JavaScript, and so forth.', 'litespeed-cache'); ?>
					<?php echo __('This can improve the page loading speed.', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_DNS_PRECONNECT; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Preconnecting speeds up future loads from a given origin.', 'litespeed-cache'); ?>
					<?php echo __('For example', 'litespeed-cache'); ?>: <code>https://example.com</code>
					<?php Doc::one_per_line(); ?>
					<?php Doc::learn_more('https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preconnect'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_HTML_LAZY; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Delay rendering off-screen HTML elements by its selector.', 'litespeed-cache'); ?>
					<?php Doc::one_per_line(); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#html-lazyload-selectors'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_HTML_SKIP_COMMENTS; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('When minifying HTML do not discard comments that match a specified pattern.', 'litespeed-cache'); ?>
					<br />
					<?php echo sprintf( __('If comment to be kept is like: %s write: %s', 'litespeed-cache'), '<code>&lt;!-- A comment that needs to be here --&gt;</code>', '<code>A comment that needs to be here</code>'); ?>
					<br />
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_QS_RM; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Remove query strings from internal static resources.', 'litespeed-cache'); ?>
					<br />
					<font class="litespeed-warning">
						⚠️
						<?php echo __('Google reCAPTCHA will be bypassed automatically.', 'litespeed-cache'); ?>
					</font>
					<br />
					<font class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('Append query string %s to the resources to bypass this action.', 'litespeed-cache'), '<code>&_litespeed_rm_qs=0</code>'); ?>
					</font>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_GGFONTS_ASYNC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Use Web Font Loader library to load Google Fonts asynchronously while leaving other CSS intact.', 'litespeed-cache'); ?>
					<?php echo __('This will also add a preconnect to Google Fonts to establish a connection earlier.', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-google-fonts-asynchronously'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_GGFONTS_RM; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Prevent Google Fonts from loading on all pages.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_EMOJI_RM; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Stop loading WordPress.org emoji. Browser default emoji will be displayed instead.', 'litespeed-cache'); ?>
					<?php echo __('This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_NOSCRIPT_RM; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('This option will remove all %s tags from HTML.', 'litespeed-cache'), '<code>&lt;noscript&gt;</code>'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#remove-noscript-tags'); ?>
				</div>
			</td>
		</tr>

	</tbody>
</table>page_optm/settings_js.tpl.php000064400000006046151540355030012371 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __('JS Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#js-settings-tab'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_JS_MIN; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<?php Doc::maybe_on_by_gm($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Minify JS files and inline JS codes.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_JS_COMB; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<?php Doc::maybe_on_by_gm($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Combine all local JS files into a single file.', 'litespeed-cache'); ?>
					<a href="https://docs.litespeedtech.com/lscache/lscwp/ts-optimize/" target="_blank"><?php echo __('How to Fix Problems Caused by CSS/JS Optimization.', 'litespeed-cache'); ?></a>
					<br />
					<font class="litespeed-danger">
						🚨 <?php echo __('This option may result in a JS error or layout issue on frontend pages with certain themes/plugins.', 'litespeed-cache'); ?>
						<?php echo __('JS error can be found from the developer console of browser by right clicking and choosing Inspect.', 'litespeed-cache'); ?>
					</font>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_JS_COMB_EXT_INL; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Include external JS and inline JS in combined file when %1$s is also enabled. This option helps maintain the priorities of JS execution, which should minimize potential errors caused by JS Combine.', 'litespeed-cache'), '<code>' . Lang::title(Base::O_OPTM_JS_COMB) . '</code>'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_JS_DEFER; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id, array(__('OFF', 'litespeed-cache'), __('Deferred', 'litespeed-cache'), __('Delayed', 'litespeed-cache'))); ?>
				<div class="litespeed-desc">
					<?php echo __('Deferring until page is parsed or delaying till interaction can help reduce resource contention and improve performance causing a lower FID (Core Web Vitals metric).', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-js-deferred'); ?><br />
					<?php echo __('This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://web.dev/fid/#what-is-fid'); ?>
					<br />
					<font class="litespeed-danger">
						🚨 <?php echo __('This option may result in a JS error or layout issue on frontend pages with certain themes/plugins.', 'litespeed-cache'); ?>
					</font>
				</div>
			</td>
		</tr>

	</tbody>
</table>page_optm/settings_localization.tpl.php000064400000011311151540355030014434 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$last_generated = Avatar::get_summary();
$avatar_queue = Avatar::cls()->queue_count();
?>

<?php if ( $this->cls( 'Avatar' )->need_db() && ! $this->cls( 'Data' )->tb_exist( 'avatar' ) ) : ?>
<div class="litespeed-callout notice notice-error inline">
	<h4><?php echo __( 'WARNING', 'litespeed-cache' ); ?></h4>
	<p><?php echo sprintf( __( 'Failed to create Avatar table. Please follow <a %s>Table Creation guidance from LiteSpeed Wiki</a> to finish setup.', 'litespeed-cache' ), 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:installation" target="_blank"' ); ?></p>
</div>
<?php endif; ?>

<h3 class="litespeed-title-short">
	<?php echo __( 'Localization Settings', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#localization-settings-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>
	<tr>
		<th>
			<?php $id = Base::O_DISCUSS_AVATAR_CACHE; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Store Gravatar locally.', 'litespeed-cache' ); ?>
				<?php echo __( 'Accelerates the speed by caching Gravatar (Globally Recognized Avatars).', 'litespeed-cache' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th class="litespeed-padding-left">
			<?php $id = Base::O_DISCUSS_AVATAR_CRON; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Refresh Gravatar cache by cron.', 'litespeed-cache' ); ?>
			</div>

			<?php if ( $last_generated ) : ?>
			<div class="litespeed-desc">
				<?php if ( ! empty( $last_generated[ 'last_request' ] ) ) : ?>
					<p>
						<?php echo __( 'Last ran', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $last_generated[ 'last_request' ] ) . '</code>'; ?>
					</p>
				<?php endif; ?>
				<?php if ( $avatar_queue ) : ?>
					<div class="litespeed-callout notice notice-warning inline">
						<h4>
							<?php echo __( 'Avatar list in queue waiting for update','litespeed-cache' ); ?>:
							<?php echo $avatar_queue; ?>
						</h4>
					</div>
					<a href="<?php echo Utility::build_url( Router::ACTION_AVATAR, Avatar::TYPE_GENERATE ); ?>" class="button litespeed-btn-success">
						<?php echo __( 'Run Queue Manually', 'litespeed-cache' ); ?>
					</a>
				<?php endif; ?>
			</div>
			<?php endif; ?>

		</td>
	</tr>

	<tr>
		<th class="litespeed-padding-left">
			<?php $id = Base::O_DISCUSS_AVATAR_CACHE_TTL; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id ); ?> <?php $this->readable_seconds(); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Specify how long, in seconds, Gravatar files are cached.', 'litespeed-cache' ); ?>
				<?php $this->recommended( $id ); ?>
				<?php $this->_validate_ttl( $id, 3600 ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OPTM_LOCALIZE; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Localize external resources.', 'litespeed-cache' ); ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#localize' ); ?>

				<br /><font class="litespeed-danger">
					🚨 <?php echo sprintf( __( 'Please thoroughly test all items in %s to ensure they function as expected.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_OPTM_LOCALIZE_DOMAINS ) . '</code>' ); ?>
				</font>
			</div>
		</td>
	</tr>

	<tr>
		<th class="litespeed-padding-left">
			<?php $id = Base::O_OPTM_LOCALIZE_DOMAINS; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<div class="litespeed-textarea-recommended">
				<div>
					<?php $this->build_textarea( $id ); ?>
				</div>
				<div>
					<?php $this->recommended( $id, true ); ?>
				</div>
			</div>

			<div class="litespeed-desc">
				<?php echo __( 'Resources listed here will be copied and replaced with local URLs.', 'litespeed-cache' ); ?>
				<?php echo __( 'HTTPS sources only.', 'litespeed-cache' ); ?>

				<?php Doc::one_per_line(); ?>

				<br /><?php echo sprintf( __( 'Comments are supported. Start a line with a %s to turn it into a comment line.', 'litespeed-cache' ), '<code>#</code>' ); ?>

				<br /><?php echo __( 'Example', 'litespeed-cache' ); ?>: <code>https://www.example.com/one.js</code>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#localization-files' ); ?>

				<br /><font class="litespeed-danger">
					🚨 <?php echo __( 'Please thoroughly test each JS file you add to ensure it functions as expected.', 'litespeed-cache' ); ?>
				</font>

			</div>
		</td>
	</tr>

</tbody></table>
page_optm/settings_media.tpl.php000064400000025520151540355030013032 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$placeholder_summary = Placeholder::get_summary();

$closest_server = Cloud::get_summary('server.' . Cloud::SVC_LQIP);

$lqip_queue = $this->load_queue('lqip');

?>

<h3 class="litespeed-title-short">
	<?php echo __('Media Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#media-settings-tab'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th>
				<?php $id = Base::O_MEDIA_LAZY; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Load images only when they enter the viewport.', 'litespeed-cache'); ?>
					<?php echo __('This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache'); ?>
					<br />
					<font class="litespeed-success">
						💡
						<a href="https://docs.litespeedtech.com/lscache/lscwp/pageopt/#lazy-load-images" target="_blank"><?php echo __('Adding Style to Your Lazy-Loaded Images', 'litespeed-cache'); ?></a>
					</font>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_LAZY_PLACEHOLDER; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id, 'litespeed-input-long'); ?>
				<div class="litespeed-desc">
					<?php echo __('Specify a base64 image to be used as a simple placeholder while images finish loading.', 'litespeed-cache'); ?>
					<br /><?php echo sprintf(__('This can be predefined in %2$s as well using constant %1$s, with this setting taking priority.', 'litespeed-cache'), '<code>LITESPEED_PLACEHOLDER</code>', '<code>wp-config.php</code>'); ?>
					<br /><?php echo sprintf(__('By default a gray image placeholder %s will be used.', 'litespeed-cache'), '<code>data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=</code>'); ?>
					<br /><?php echo sprintf(__('For example, %s can be used for a transparent placeholder.', 'litespeed-cache'), '<code>data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7</code>'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_PLACEHOLDER_RESP; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<?php Doc::maybe_on_by_gm($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Responsive image placeholders can help to reduce layout reshuffle when images are loaded.', 'litespeed-cache'); ?>
					<?php echo __('This will generate the placeholder with same dimensions as the image if it has the width and height attributes.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_PLACEHOLDER_RESP_SVG; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id, 'litespeed-input-long'); ?>
				<div class="litespeed-desc">
					<?php echo __('Specify an SVG to be used as a placeholder when generating locally.', 'litespeed-cache'); ?>
					<?php echo __('It will be converted to a base64 SVG placeholder on-the-fly.', 'litespeed-cache'); ?>
					<br /><?php echo sprintf(__('Variables %s will be replaced with the corresponding image properties.', 'litespeed-cache'), '<code>{width} {height}</code>'); ?>
					<br /><?php echo sprintf(__('Variables %s will be replaced with the configured background color.', 'litespeed-cache'), '<code>{color}</code>'); ?>
					<br /><?php $this->recommended($id); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_PLACEHOLDER_RESP_COLOR; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id, null, null, 'color'); ?>
				<div class="litespeed-desc">
					<?php echo __('Specify the responsive placeholder SVG color.', 'litespeed-cache'); ?>
					<?php $this->recommended($id); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_LQIP; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<?php Doc::maybe_on_by_gm($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Use QUIC.cloud LQIP (Low Quality Image Placeholder) generator service for responsive image previews while loading.', 'litespeed-cache'); ?>
					<br /><?php echo __('Keep this off to use plain color placeholders.', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#lqip-cloud-generator'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_LQIP_QUAL; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id, 'litespeed-input-short'); ?>
				<div class="litespeed-desc">
					<?php echo __('Specify the quality when generating LQIP.', 'litespeed-cache'); ?>
					<br /><?php echo __('Larger number will generate higher resolution quality placeholder, but will result in larger files which will increase page size and consume more points.', 'litespeed-cache'); ?>
					<?php $this->recommended($id); ?>
					<?php $this->_validate_ttl($id, 1, 20); ?>
					<br />💡 <?php echo sprintf(__('Changes to this setting do not apply to already-generated LQIPs. To regenerate existing LQIPs, please %s first from the admin bar menu.', 'litespeed-cache'), '<code>' . __('Purge All', 'litespeed-cache') . ' - ' . __('LQIP Cache', 'litespeed-cache') . '</code>'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_LQIP_MIN_W; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id, 'litespeed-input-short'); ?> x
				<?php $this->build_input(Base::O_MEDIA_LQIP_MIN_H, 'litespeed-input-short'); ?>
				<?php echo __('pixels', 'litespeed-cache'); ?>
				<div class="litespeed-desc">
					<?php echo __('LQIP requests will not be sent for images where both width and height are smaller than these dimensions.', 'litespeed-cache'); ?>
					<?php $this->recommended($id); ?>
					<?php $this->_validate_ttl($id, 10, 800); ?>
					<?php $this->_validate_ttl(Base::O_MEDIA_LQIP_MIN_H, 10, 800); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_PLACEHOLDER_RESP_ASYNC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Automatically generate LQIP in the background via a cron-based queue.', 'litespeed-cache'); ?>
					<?php echo sprintf(
						__('If set to %1$s, before the placeholder is localized, the %2$s configuration will be used.', 'litespeed-cache'),
						'<code>' . __('ON', 'litespeed-cache') . '</code>',
						'<code>' . Lang::title(Base::O_MEDIA_PLACEHOLDER_RESP_SVG) . '</code>'
					); ?>
					<?php echo sprintf(__('If set to %s this is done in the foreground, which may slow down page load.', 'litespeed-cache'), '<code>' . __('OFF', 'litespeed-cache') . '</code>'); ?>
					<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#generate-lqip-in-background'); ?>
				</div>

				<div class="litespeed-desc">
					<?php if ($placeholder_summary) : ?>
						<?php if (!empty($placeholder_summary['last_request'])) : ?>
							<p>
								<?php echo __('Last generated', 'litespeed-cache') . ': <code>' . Utility::readable_time($placeholder_summary['last_request']) . '</code>'; ?>
							</p>
						<?php endif; ?>
					<?php endif; ?>

					<?php if ($closest_server) : ?>
						<a class="litespeed-redetect" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array('svc' => Cloud::SVC_LQIP)); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo sprintf(__('Current closest Cloud server is %s.&#10; Click to redetect.', 'litespeed-cache'), $closest_server); ?>' data-litespeed-cfm="<?php echo __('Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache'); ?>"><i class='litespeed-quic-icon'></i> <?php echo __('Redetect', 'litespeed-cache'); ?></a>
					<?php endif; ?>

					<?php if (!empty($lqip_queue)) : ?>
						<div class="litespeed-callout notice notice-warning inline">
							<h4>
								<?php echo __('Size list in queue waiting for cron', 'litespeed-cache'); ?> ( <?php echo count($lqip_queue); ?> )
								<a href="<?php echo Utility::build_url(Router::ACTION_PLACEHOLDER, Placeholder::TYPE_CLEAR_Q); ?>" class="button litespeed-btn-warning litespeed-right">Clear</a>
							</h4>
							<p>
								<?php $i = 0;
								foreach ($lqip_queue as $k => $v) : ?>
									<?php if ($i++ > 20) : ?>
										<?php echo '...'; ?>
										<?php break; ?>
									<?php endif; ?>

									<?php echo $v; ?>
									<br />
								<?php endforeach; ?>
							</p>
						</div>
						<a href="<?php echo Utility::build_url(Router::ACTION_PLACEHOLDER, Placeholder::TYPE_GENERATE); ?>" class="button litespeed-btn-success">
							<?php echo __('Run Queue Manually', 'litespeed-cache'); ?>
						</a>
						<?php Doc::queue_issues(); ?>
					<?php endif; ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_IFRAME_LAZY; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Load iframes only when they enter the viewport.', 'litespeed-cache'); ?>
					<?php echo __('This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_ADD_MISSING_SIZES; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Set an explicit width and height on image elements to reduce layout shifts and improve CLS (a Core Web Vitals metric).', 'litespeed-cache'); ?>
					<?php Doc::learn_more('https://web.dev/optimize-cls/#images-without-dimensions'); ?>

					<br />
					<font class="litespeed-warning litespeed-left10">
						⚠️ <?php echo __('Notice', 'litespeed-cache'); ?>: <?php echo sprintf(__('%s must be turned ON for this setting to work.', 'litespeed-cache'), '<code>' . Lang::title(Base::O_MEDIA_LAZY) . '</code>'); ?>
					</font>

					<br />
					<font class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('Use %1$s to bypass remote image dimension check when %2$s is ON.', 'litespeed-cache'), '<code>add_filter( "litespeed_media_ignore_remote_missing_sizes", "__return_true" );</code>', '<code>' . Lang::title(Base::O_MEDIA_ADD_MISSING_SIZES) . '</code>'); ?>
					</font>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_IMG_OPTM_JPG_QUALITY; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id, 'litespeed-input-short'); ?>
				<div class="litespeed-desc">
					<?php echo __('The image compression quality setting of WordPress out of 100.', 'litespeed-cache'); ?>
					<?php $this->recommended($id); ?>
					<?php $this->_validate_ttl($id, 0, 100); ?>
				</div>
			</td>
		</tr>
	</tbody>
</table>page_optm/settings_media_exc.tpl.php000064400000006745151540355030013701 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'Media Excludes', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#media-excludes-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>

	<tr>
		<th>
			<?php $id = Base::O_MEDIA_LAZY_EXC; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Listed images will not be lazy loaded.', 'litespeed-cache' ); ?>
				<?php Doc::full_or_partial_url(); ?>
				<?php Doc::one_per_line(); ?>
                <br /><?php echo __( 'Useful for above-the-fold images causing CLS (a Core Web Vitals metric).', 'litespeed-cache' ); ?>
				<br /><font class="litespeed-success">
					<?php echo __( 'API', 'litespeed-cache' ); ?>:
					<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_media_lazy_img_excludes</code>' ); ?>
					<?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-lazy="1"</code>' ); ?>
				</font>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MEDIA_LAZY_CLS_EXC; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<div class="litespeed-textarea-recommended">
				<div>
					<?php $this->build_textarea( $id ); ?>
				</div>
				<div>
					<?php $this->recommended( $id ); ?>
				</div>
			</div>

			<div class="litespeed-desc">
				<?php echo __( 'Images containing these class names will not be lazy loaded.', 'litespeed-cache' ); ?>
				<?php Doc::full_or_partial_url( true ); ?>
				<?php Doc::one_per_line(); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MEDIA_LAZY_PARENT_CLS_EXC; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Images having these parent class names will not be lazy loaded.', 'litespeed-cache' ); ?>
				<?php Doc::one_per_line(); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MEDIA_IFRAME_LAZY_CLS_EXC; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Iframes containing these class names will not be lazy loaded.', 'litespeed-cache' ); ?>
				<?php Doc::full_or_partial_url( true ); ?>
				<?php Doc::one_per_line(); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MEDIA_IFRAME_LAZY_PARENT_CLS_EXC; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Iframes having these parent class names will not be lazy loaded.', 'litespeed-cache' ); ?>
				<?php Doc::one_per_line(); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MEDIA_LAZY_URI_EXC; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Prevent any lazy load of listed pages.', 'litespeed-cache' ); ?>
				<?php $this->_uri_usage_example(); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MEDIA_LQIP_EXC; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'These images will not generate LQIP.', 'litespeed-cache' ); ?>
				<?php Doc::full_or_partial_url(); ?>
			</div>
		</td>
	</tr>

</tbody></table>page_optm/settings_tuning.tpl.php000064400000012722151540355030013257 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

global $wp_roles;
if (!isset($wp_roles)) {
	$wp_roles = new \WP_Roles();
}

$roles = array();
foreach ($wp_roles->roles as $k => $v) {
	$roles[$k] = $v['name'];
}
ksort($roles);

?>
<h3 class="litespeed-title-short">
	<?php echo __('Tuning Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#tuning-settings-tab'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th>
				<?php $id = Base::O_OPTM_JS_DELAY_INC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Listed JS files or inline JS code will be delayed.', 'litespeed-cache'); ?>
					<?php Doc::full_or_partial_url(); ?>
					<?php Doc::one_per_line(); ?>
					<br />
					<font class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('Filter %s is supported.', 'litespeed-cache'), '<code>litespeed_optm_js_delay_inc</code>'); ?>
					</font>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_JS_EXC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Listed JS files or inline JS code will not be minified/combined.', 'litespeed-cache'); ?>
					<?php Doc::full_or_partial_url(); ?>
					<?php Doc::one_per_line(); ?>
					<br />
					<font class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('Filter %s is supported.', 'litespeed-cache'), '<code>litespeed_optimize_js_excludes</code>'); ?>
						<?php echo sprintf(__('Elements with attribute %s in html code will be excluded.', 'litespeed-cache'), '<code>data-no-optimize="1"</code>'); ?>
						<br /><?php echo __('Predefined list will also be combined w/ the above settings', 'litespeed-cache'); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_excludes.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_excludes.txt</a>
					</font>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_JS_DEFER_EXC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Listed JS files or inline JS code will not be deferred or delayed.', 'litespeed-cache'); ?>
					<?php Doc::full_or_partial_url(); ?>
					<?php Doc::one_per_line(); ?>
					<br /><span class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('Filter %s is supported.', 'litespeed-cache'), '<code>litespeed_optm_js_defer_exc</code>'); ?>
						<?php echo sprintf(__('Elements with attribute %s in html code will be excluded.', 'litespeed-cache'), '<code>data-no-defer="1"</code>'); ?>
						<br /><?php echo __('Predefined list will also be combined w/ the above settings', 'litespeed-cache'); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_defer_excludes.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_defer_excludes.txt</a>
					</span>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_GM_JS_EXC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo sprintf(__('Listed JS files or inline JS code will not be optimized by %s.', 'litespeed-cache'), '<code>' . Lang::title(Base::O_GUEST) . '</code>'); ?>
					<?php Doc::full_or_partial_url(); ?>
					<?php Doc::one_per_line(); ?>
					<br /><span class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('Filter %s is supported.', 'litespeed-cache'), '<code>litespeed_optm_gm_js_exc</code>'); ?>
						<?php echo sprintf(__('Elements with attribute %s in html code will be excluded.', 'litespeed-cache'), '<code>data-no-defer="1"</code>'); ?>
					</span>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_EXC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Prevent any optimization of listed pages.', 'litespeed-cache'); ?>
					<?php $this->_uri_usage_example(); ?>
					<br /><span class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('Filter %s is supported.', 'litespeed-cache'), '<code>litespeed_optm_uri_exc</code>'); ?>
					</span>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_GUEST_ONLY; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Only optimize pages for guest (not logged in) visitors. If turned this OFF, CSS/JS/CCSS files will be doubled by each user group.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_OPTM_EXC_ROLES; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<div class="litespeed-desc">
					<?php echo __('Selected roles will be excluded from all optimizations.', 'litespeed-cache'); ?>
				</div>
				<div class="litespeed-tick-list">
					<?php foreach ($roles as $role => $title) : ?>
						<?php $this->build_checkbox($id . '[]', $title, $this->cls('Conf')->in_optm_exc_roles($role), $role); ?>
					<?php endforeach; ?>
				</div>

			</td>
		</tr>

	</tbody>
</table>page_optm/settings_tuning_css.tpl.php000064400000015601151540355030014126 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

?>
<h3 class="litespeed-title-short">
	<?php echo __( 'Tuning Settings', 'litespeed-cache' ); ?> - CSS
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#tuning-css-settings-tab' ); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>
	<tr>
		<th>
			<?php $id = Base::O_OPTM_CSS_EXC; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Listed CSS files or inline CSS code will not be minified/combined.', 'litespeed-cache' ); ?>
				<?php Doc::full_or_partial_url(); ?>
				<?php Doc::one_per_line(); ?>
				<br /><font class="litespeed-success">
					<?php echo __( 'API', 'litespeed-cache' ); ?>:
					<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_optimize_css_excludes</code>' ); ?>
					<?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-optimize="1"</code>' ); ?>
					<br /><?php echo __( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/css_excludes.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/css_excludes.txt</a>
				</font>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OPTM_UCSS_FILE_EXC_INLINE; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Listed CSS files will be excluded from UCSS and saved to inline.', 'litespeed-cache' ); ?>
				<?php Doc::full_or_partial_url(); ?>
				<?php Doc::one_per_line(); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OPTM_UCSS_SELECTOR_WHITELIST; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'List the CSS selectors whose styles should always be included in UCSS.', 'litespeed-cache' ); ?>
				<?php Doc::one_per_line(); ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#ucss-selector-allowlist', __( 'Learn more', 'litespeed-cache' ) ); ?>.
				<br /><?php echo sprintf( __( 'Wildcard %s supported.', 'litespeed-cache' ), '<code>*</code>' ); ?>
				<div class="litespeed-callout notice notice-warning inline">
					<h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
					<p>
						<?php echo __( 'The selector must exist in the CSS. Parent classes in the HTML will not work.', 'litespeed-cache' ); ?>
					</p>
				</div>
				<font class="litespeed-success">
					<?php echo __( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/ucss_whitelist.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/ucss_whitelist.txt</a>
				</font>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OPTM_UCSS_EXC; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Listed URI will not generate UCSS.', 'litespeed-cache' ); ?>
				<?php Doc::full_or_partial_url(); ?>
				<?php Doc::one_per_line(); ?>
				<br /><span class="litespeed-success">
					<?php echo __( 'API', 'litespeed-cache' ); ?>:
					<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_ucss_exc</code>' ); ?>
				</span>
				<br /><font class="litespeed-success">API: <?php echo sprintf( __( 'Use %1$s to generate one single UCSS for the pages which page type is %2$s while other page types still per URL.', 'litespeed-cache' ), "<code>add_filter( 'litespeed_ucss_per_pagetype', function(){return get_post_type() == 'page';} );</code>", '<code>page</code>' ); ?></font>
				<br /><font class="litespeed-success">API: <?php echo sprintf( __( 'Use %1$s to bypass UCSS for the pages which page type is %2$s.', 'litespeed-cache' ), "<code>add_action( 'litespeed_optm', function(){get_post_type() == 'page' && do_action( 'litespeed_conf_force', 'optm-ucss', false );});</code>", '<code>page</code>' ); ?></font>

			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OPTM_CCSS_SEP_POSTTYPE; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __('List post types where each item of that type should have its own CCSS generated.', 'litespeed-cache'); ?>
				<?php echo sprintf( __( 'For example, if every Page on the site has different formatting, enter %s in the box. Separate critical CSS files will be stored for every Page on the site.', 'litespeed-cache' ), '<code>page</code>' ); ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#separate-ccss-cache-post-types_1' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OPTM_CCSS_SEP_URI; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Separate critical CSS files will be generated for paths containing these strings.', 'litespeed-cache' ); ?>
				<?php $this->_uri_usage_example(); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OPTM_CCSS_SELECTOR_WHITELIST; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'List the CSS selectors whose styles should always be included in CCSS.', 'litespeed-cache' ); ?>
				<?php Doc::one_per_line(); ?>
				<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#ccss-selector-allowlist', __( 'Learn more', 'litespeed-cache' ) ); ?>.
				<br /><?php echo sprintf( __( 'Wildcard %s supported.', 'litespeed-cache' ), '<code>*</code>' ); ?>
				<div class="litespeed-callout notice notice-warning inline">
					<h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
					<p>
						<?php echo __( 'Selectors must exist in the CSS. Parent classes in the HTML will not work.', 'litespeed-cache' ); ?>
					</p>
				</div>
				<font class="litespeed-success">
					<?php echo __( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/ccss_whitelist.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/ccss_whitelist.txt</a>
				</font>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_OPTM_CCSS_CON; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_textarea( $id ); ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Specify critical CSS rules for above-the-fold content when enabling %s.', 'litespeed-cache' ), __( 'Load CSS Asynchronously', 'litespeed-cache' ) ); ?>
			</div>
		</td>
	</tr>

</tbody></table>
page_optm/settings_vpi.tpl.php000064400000011041151540355030012542 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$summary = VPI::get_summary();
$closest_server = Cloud::get_summary('server.' . Cloud::SVC_VPI);

$queue = $this->load_queue('vpi');
$vpi_service_hot = $this->cls('Cloud')->service_hot(Cloud::SVC_VPI);
?>

<h3 class="litespeed-title-short">
	<?php echo __('Viewport Images', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/pageopt/#vpi-settings-tab'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_VPI; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('When you use Lazy Load, it will delay the loading of all images on a page.', 'litespeed-cache'); ?>
					<br /><?php echo __('The Viewport Images service detects which images appear above the fold, and excludes them from lazy load.', 'litespeed-cache'); ?>
					<br /><?php echo __('This enables the page\'s initial screenful of imagery to be fully displayed without delay.', 'litespeed-cache'); ?>

					<?php if (!$this->conf(Base::O_MEDIA_LAZY)) : ?>
						<br />
						<font class="litespeed-warning litespeed-left10">
							⚠️ <?php echo __('Notice', 'litespeed-cache'); ?>: <?php echo sprintf(__('%s must be turned ON for this setting to work.', 'litespeed-cache'),  '<code>' . Lang::title(Base::O_MEDIA_LAZY) . '</code>'); ?>
						</font>
					<?php endif; ?>

				</div>

				<div class="litespeed-desc litespeed-left20">
					<?php if ($summary) : ?>
						<?php if (!empty($summary['last_request'])) : ?>
							<p>
								<?php echo __('Last generated', 'litespeed-cache') . ': <code>' . Utility::readable_time($summary['last_request']) . '</code>'; ?>
							</p>
						<?php endif; ?>
					<?php endif; ?>

					<?php if ($closest_server) : ?>
						<a class='litespeed-redetect' href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array('svc' => Cloud::SVC_VPI)); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo sprintf(__('Current closest Cloud server is %s.&#10; Click to redetect.', 'litespeed-cache'), $closest_server); ?>' data-litespeed-cfm="<?php echo __('Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache'); ?>"><i class='litespeed-quic-icon'></i> <?php echo __('Redetect', 'litespeed-cache'); ?></a>
					<?php endif; ?>

					<?php if (!empty($queue)) : ?>
						<div class="litespeed-callout notice notice-warning inline">
							<h4>
								<?php echo sprintf(__('URL list in %s queue waiting for cron', 'litespeed-cache'), 'VPI'); ?> ( <?php echo count($queue); ?> )
								<a href="<?php echo Utility::build_url(Router::ACTION_VPI, VPI::TYPE_CLEAR_Q); ?>" class="button litespeed-btn-warning litespeed-right">Clear</a>
							</h4>
							<p>
								<?php $i = 0;
								foreach ($queue as $k => $v) : ?>
									<?php if ($i++ > 20) : ?>
										<?php echo '...'; ?>
										<?php break; ?>
									<?php endif; ?>
									<?php if (!is_array($v)) continue; ?>
									<?php if (!empty($v['_status'])) : ?><span class="litespeed-success"><?php endif; ?>
										<?php echo esc_html($v['url']); ?>
										<?php if (!empty($v['_status'])) : ?></span><?php endif; ?>
									<?php if ($pos = strpos($k, ' ')) echo ' (' . __('Vary Group', 'litespeed-cache') . ':' . esc_html(substr($k, 0, $pos)) . ')'; ?>
									<?php if ($v['is_mobile']) echo ' <span data-balloon-pos="up" aria-label="mobile">📱</span>'; ?>
									<br />
								<?php endforeach; ?>
							</p>
						</div>
						<?php if ($vpi_service_hot) : ?>
							<button class="button button-secondary" disabled>
								<?php echo sprintf(__('Run %s Queue Manually', 'litespeed-cache'), 'VPI'); ?>
								- <?php echo sprintf(__('Available after %d second(s)', 'litespeed-cache'), $vpi_service_hot); ?>
							</button>
						<?php else : ?>
							<a href="<?php echo Utility::build_url(Router::ACTION_VPI, VPI::TYPE_GEN); ?>" class="button litespeed-btn-success">
								<?php echo sprintf(__('Run %s Queue Manually', 'litespeed-cache'), 'VPI'); ?>
							</a>
						<?php endif; ?>
						<?php Doc::queue_issues(); ?>
					<?php endif; ?>
				</div>

			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_MEDIA_VPI_CRON; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Enable Viewport Images auto generation cron.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

	</tbody>
</table>presets/entry.tpl.php000064400000002147151540355030010706 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$menu_list = array(
	'standard' => __( 'Standard Presets', 'litespeed-cache' ),
	'import_export' => __( 'Import / Export', 'litespeed-cache' ),
);

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __( 'LiteSpeed Cache Configuration Presets', 'litespeed-cache' ); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">
	<h2 class="litespeed-header nav-tab-wrapper">
	<?php
		$i = 1;
		foreach ($menu_list as $tab => $val){
			$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
			$i ++;
		}
	?>
	</h2>

	<div class="litespeed-body">
	<?php

		// include all tpl for faster UE
		foreach ($menu_list as $tab => $val) {
			echo "<div data-litespeed-layout='$tab'>";
			if ('import_export' === $tab) {
				require LSCWP_DIR . "tpl/toolbox/$tab.tpl.php";
			} else {
				require LSCWP_DIR . "tpl/presets/$tab.tpl.php";
			}
			echo "</div>";
		}

	?>
	</div>

</div>
presets/standard.tpl.php000064400000017162151540355030011350 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$presets = array();

$presets['essentials'] = array(
	'title' => __( 'Essentials', 'litespeed-cache' ),
	'body' => array(
		__( 'Default Cache', 'litespeed-cache' ),
		__( 'Higher TTL', 'litespeed-cache' ),
		__( 'Browser Cache', 'litespeed-cache' )
	),
	'footer' => array(
		__( 'This no-risk preset is appropriate for all websites. Good for new users, simple websites, or cache-oriented development.', 'litespeed-cache' ),
		__( 'A Domain Key is not required to use this preset. Only basic caching features are enabled.', 'litespeed-cache' )
	)
);

$presets['basic'] = array(
	'title' => __( 'Basic', 'litespeed-cache' ),
	'body' => array(
		__( 'Everything in Essentials, Plus', 'litespeed-cache' ),
		__( 'Image Optimization', 'litespeed-cache' ),
		__( 'Mobile Cache', 'litespeed-cache' )
	),
	'footer' => array(
		__( 'This low-risk preset introduces basic optimizations for speed and user experience. Appropriate for enthusiastic beginners.', 'litespeed-cache' ),
		__( 'A Domain Key is required to use this preset. Includes optimizations known to improve site score in page speed measurement tools.', 'litespeed-cache' )
	)
);

$presets['advanced'] = array(
	'title' => __( 'Advanced (Recommended)', 'litespeed-cache' ),
	'body' => array(
		__( 'Everything in Basic, Plus', 'litespeed-cache' ),
		__( 'Guest Mode and Guest Optimization', 'litespeed-cache' ),
		__( 'CSS, JS and HTML Minification', 'litespeed-cache' ),
		__( 'Font Display Optimization', 'litespeed-cache' ),
		__( 'JS Defer for both external and inline JS', 'litespeed-cache' ),
		__( 'DNS Prefetch for static files', 'litespeed-cache' ),
		__( 'Gravatar Cache', 'litespeed-cache' ),
		__( 'Remove Query Strings from Static Files', 'litespeed-cache' ),
		__( 'Remove WordPress Emoji', 'litespeed-cache' ),
		__( 'Remove Noscript Tags', 'litespeed-cache' )
	),
	'footer' => array(
		__( 'This preset is good for most websites, and is unlikely to cause conflicts. Any CSS or JS conflicts may be resolved with Page Optimization > Tuning tools.', 'litespeed-cache' ),
		__( 'A Domain Key is required to use this preset. Includes many optimizations known to improve page speed scores.', 'litespeed-cache' )
	)
);

$presets['aggressive'] = array(
	'title' => __( 'Aggressive', 'litespeed-cache' ),
	'body' => array(
		__( 'Everything in Advanced, Plus', 'litespeed-cache' ),
		__( 'CSS & JS Combine', 'litespeed-cache' ),
		__( 'Asynchronous CSS Loading with Critical CSS', 'litespeed-cache' ),
		__( 'Removed Unused CSS for Users', 'litespeed-cache' ),
		__( 'Lazy Load for Iframes', 'litespeed-cache' )
	),
	'footer' => array(
		__( 'This preset might work out of the box for some websites, but be sure to test! Some CSS or JS exclusions may be necessary in Page Optimization > Tuning.', 'litespeed-cache' ),
		__( 'A Domain Key is required to use this preset. Includes many optimizations known to improve page speed scores.', 'litespeed-cache' )
	)
);

$presets['extreme'] = array(
	'title' => __( 'Extreme', 'litespeed-cache' ),
	'body' => array(
		__( 'Everything in Aggressive, Plus', 'litespeed-cache' ),
		__( 'Lazy Load for Images', 'litespeed-cache' ),
		__( 'Viewport Image Generation', 'litespeed-cache' ),
		__( 'JS Delayed', 'litespeed-cache' ),
		__( 'Inline JS added to Combine', 'litespeed-cache' ),
		__( 'Inline CSS added to Combine', 'litespeed-cache' )
	),
	'footer' => array(
		__( 'This preset almost certainly will require testing and exclusions for some CSS, JS and Lazy Loaded images. Pay special attention to logos, or HTML-based slider images.', 'litespeed-cache' ),
		__( 'A Domain Key is required to use this preset. Enables the maximum level of optimizations for improved page speed scores.', 'litespeed-cache' )
	)
);

?>

<h3 class="litespeed-title-short">
	<?php _e( 'LiteSpeed Cache Standard Presets', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/presets/#standard-tab' ); ?>
</h3>

<p><?php _e( 'Use an official LiteSpeed-designed Preset to configure your site in one click. Try no-risk caching essentials, extreme optimization, or something in between.', 'litespeed-cache' ); ?></p>

<div class="litespeed-comparison-cards">
	<?php
	foreach ( array_keys( $presets ) as $name ) :
		$title = $presets[ $name ]['title'];
		$recommend = 'advanced' === $name;
		$card_class = $recommend ? 'litespeed-comparison-card-rec' : '';
		$button_class = $recommend ? 'button-primary' : 'button-secondary';
	?>
	<div class="litespeed-comparison-card postbox <?php echo $card_class; ?>">
		<div class="litespeed-card-content">
			<div class="litespeed-card-header">
				<h3 class="litespeed-h3">
					<?php echo esc_html( $title ); ?>
				</h3>
			</div>
			<div class="litespeed-card-body">
				<ul>
					<?php foreach ( $presets[ $name ]['body'] as $line ) : ?>
					<li><?php echo esc_html( $line ); ?></li>
					<?php endforeach; ?>
				</ul>
			</div>
			<div class="litespeed-card-footer">
				<h4><?php _e( 'Who should use this preset?', 'litespeed-cache' ); ?></h4>
				<?php foreach ( $presets[ $name ]['footer'] as $line ) : ?>
				<p><?php echo esc_html( $line ); ?></p>
				<?php endforeach; ?>
			</div>
		</div>
		<div class="litespeed-card-action">
			<a
				href="<?php echo Utility::build_url( Router::ACTION_PRESET, Preset::TYPE_APPLY, false, null, array( 'preset' => $name ) ); ?>"
				class="button <?php echo $button_class; ?>"
				data-litespeed-cfm="<?php printf( __( 'This will back up your current settings and replace them with the %1$s preset settings. Do you want to continue?', 'litespeed-cache' ), $title ); ?>"
			>
				<?php _e( 'Apply Preset', 'litespeed-cache' ); ?>
			</a>
		</div>
	</div>
	<?php endforeach; ?>
</div>

<?php
$summary = Preset::get_summary();
$backups = array();
foreach ( Preset::get_backups() as $backup ) {
	$backup = explode( '-', $backup );
	if ( empty( $backup[1] ) ) {
		continue;
	}
	$timestamp = $backup[1];
	$time = trim( Utility::readable_time( $timestamp ) );
	$name = empty( $backup[3] ) ? null : $backup[3];
	$title = empty( $presets[ $name ]['title'] ) ? $name : $presets[ $name ]['title'];
	$title = null === $title ? __( 'unknown', 'litespeed-cache' ) : $title;
	$backups[] = array(
		'timestamp' => $timestamp,
		'time' => $time,
		'title' => $title
	);
}

if ( ! empty( $summary['preset'] ) || ! empty( $backups ) ) :
?>
<h3 class="litespeed-title-short">
	<?php _e( 'History', 'litespeed-cache' ); ?>
</h3>
<?php endif; ?>

<?php if ( ! empty( $summary['preset'] ) ) : ?>
<p>
	<?php
	$name = strtolower( $summary['preset'] );
	$time = trim( Utility::readable_time( $summary['preset_timestamp'] ) );
	if ( 'error' === $name ) {
		printf( __( 'Error: Failed to apply the settings %1$s', 'litespeed-cache' ), $time );
	} elseif ( 'backup' === $name ) {
		printf( __( 'Restored backup settings %1$s', 'litespeed-cache' ), $time );
	} else {
		printf(
			__( 'Applied the %1$s preset %2$s', 'litespeed-cache' ),
			'<strong>' . esc_html( $presets[ $name ]['title'] ) . '</strong>',
			$time
		);
	}
	?>
</p>
<?php endif; ?>

<?php foreach ( $backups as $backup ) : ?>
<p>
	<?php printf( __( 'Backup created %1$s before applying the %2$s preset', 'litespeed-cache' ), $backup['time'], $backup['title'] ); ?>
	<a
		href="<?php echo Utility::build_url( Router::ACTION_PRESET, Preset::TYPE_RESTORE, false, null, array( 'timestamp' => $backup['timestamp'] ) ); ?>"
		class="litespeed-left10"
		data-litespeed-cfm="<?php printf( __( 'This will restore the backup settings created %1$s before applying the %2$s preset. Any changes made since then will be lost. Do you want to continue?', 'litespeed-cache' ), $backup['time'], $backup['title'] ); ?>"
	>
		<?php _e( 'Restore Settings', 'litespeed-cache' ); ?>
	</a>
</p>
<?php
endforeach;
toolbox/beta_test.tpl.php000064400000006241151540355030011517 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

// Existing public version list
$v_list = array(
	'7.1',
	'7.0.1',
	'6.5.4',
	'5.7.0.1',
	'4.6',
	'3.6.4',
);

?>

<?php $this->form_action(Router::ACTION_DEBUG2, Debug2::TYPE_BETA_TEST); ?>

<h3 class="litespeed-title">
	<?php echo __('Try GitHub Version', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/toolbox/#beta-test-tab'); ?>
</h3>

<div class="litespeed-desc"><?php echo __('Use this section to switch plugin versions. To beta test a GitHub commit, enter the commit URL in the field below.', 'litespeed-cache'); ?></div>
<div class="litespeed-desc"><?php echo __('Example', 'litespeed-cache'); ?>: <code>https://github.com/litespeedtech/lscache_wp/commit/example_comment_hash_d3ebec0535aaed5c932c0</code></div>

<input type="text" name="<?php echo Debug2::BETA_TEST_URL; ?>" class="litespeed-input-long" id='litespeed-beta-test'>

<p><a href="javascript:;" class="button litespeed-btn-success" onclick="document.getElementById('litespeed-beta-test').value='dev';"><?php echo __('Use latest GitHub Dev commit', 'litespeed-cache'); ?></a> <code>dev</code></p>

<p><a href="javascript:;" class="button litespeed-btn-success" onclick="document.getElementById('litespeed-beta-test').value='master';"><?php echo __('Use latest GitHub Master commit', 'litespeed-cache'); ?></a> <code>master</code></p>

<p><a href="javascript:;" class="button litespeed-btn-success" onclick="document.getElementById('litespeed-beta-test').value='latest';"><?php echo __('Use latest WordPress release version', 'litespeed-cache'); ?></a> <code><?php echo Debug2::BETA_TEST_URL_WP; ?></code> <?php echo __('OR', 'litespeed-cache') ?> <code>latest</code></p>

<p>
	<?php foreach ($v_list as $v) : ?>

		<a href="javascript:;" class="button litespeed-btn-success" onclick="document.getElementById('litespeed-beta-test').value='<?php echo $v; ?>';"><?php echo $v; ?></a>

	<?php endforeach; ?>

	<a href="javascript:;" class="button litespeed-btn-danger" onclick="document.getElementById('litespeed-beta-test').value='3.6.4';">3.6.4</a>
	<span class="litespeed-danger">
		🚨 <?php echo __('Downgrade not recommended. May cause fatal error due to refactored code.', 'litespeed-cache'); ?>
	</span>
</p>

<div class="litespeed-desc"><?php echo sprintf(__('Press the %s button to use the most recent GitHub commit. Master is for release candidate & Dev is for experimental testing.', 'litespeed-cache'), '<code>' . __('Use latest GitHub Dev/Master commit', 'litespeed-cache') . '</code>'); ?></div>
<div class="litespeed-desc"><?php echo sprintf(__('Press the %s button to stop beta testing and go back to the current release from the WordPress Plugin Directory.', 'litespeed-cache'), '<code>' . __('Use latest WordPress release version', 'litespeed-cache') . '</code>'); ?></div>



<p class="litespeed-danger">
	🚨 <?php echo sprintf(__('In order to avoid an upgrade error, you must be using %1$s or later before you can upgrade to %2$s versions.', 'litespeed-cache'), '<code>v3.6.4</code>', '<code>dev/master/v4+</code>'); ?>
</p>

<button type="submit" class="button button-primary"><?php echo __('Upgrade', 'litespeed-cache'); ?></button>
</form>toolbox/edit_htaccess.tpl.php000064400000006564151540355030012357 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$content = null;
try {
	$content = Htaccess::cls()->htaccess_read();
} catch (\Exception $e) {
	echo '<div class="notice notice-error is-dismissible"><p>' . $e->getMessage() . '</p></div>';
}

$htaccess_path = Htaccess::get_frontend_htaccess();

// Check if there is `ExpiresDefault` in .htaccess
if (defined('LITESPEED_ON')) {
	if ($content && stripos($content, "\nExpiresDefault") !== false) {
		$is_dismissed = GUI::get_option(self::DB_DISMISS_MSG);
		if ($is_dismissed !== self::RULECONFLICT_DISMISSED) {
			// Need to add a notice for browser cache compatibility
			if ($is_dismissed !== self::RULECONFLICT_ON) {
				GUI::update_option(self::DB_DISMISS_MSG, self::RULECONFLICT_ON);
			}
			require_once LSCWP_DIR . 'tpl/inc/show_rule_conflict.php';
		}
	}
	// don't dismiss the msg automatically
	// elseif ( $is_dismissed === Cache_Admin_Display::RULECONFLICT_ON ) {
	// 	update_option( self::DISMISS_MSG, Cache_Admin_Display::RULECONFLICT_DISMISSED );
	// }
}


?>

<h3 class="litespeed-title">
	<?php echo __('LiteSpeed Cache View .htaccess', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/toolbox/#view-htaccess-tab'); ?>
</h3>

<h3 class="litespeed-title-short">
	<?php echo __('.htaccess Path', 'litespeed-cache'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th>
				<?php echo __('Frontend .htaccess Path', 'litespeed-cache'); ?>
			</th>
			<td>
				<code><?php echo $htaccess_path; ?></code>
				<div class="litespeed-desc">
					<?php echo __('Default path is', 'litespeed-cache'); ?>: <code><?php echo Htaccess::get_frontend_htaccess(true); ?></code>
					<br />
					<font class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('PHP Constant %s is supported.', 'litespeed-cache'), '<code>LITESPEED_CFG_HTACCESS</code>'); ?>
						<?php echo sprintf(__('You can use this code %1$s in %2$s to specify the htaccess file path.', 'litespeed-cache'), '<code>defined("LITESPEED_CFG_HTACCESS") || define("LITESPEED_CFG_HTACCESS", "your path on server");</code>', '<code>wp-config.php</code>'); ?>
					</font>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php echo __('Backend .htaccess Path', 'litespeed-cache'); ?>
			</th>
			<td>
				<?php echo Htaccess::get_backend_htaccess(); ?>
				<div class="litespeed-desc">
					<?php echo __('Default path is', 'litespeed-cache'); ?>: <code><?php echo Htaccess::get_backend_htaccess(true); ?></code>
					<br />
					<font class="litespeed-success">
						<?php echo __('API', 'litespeed-cache'); ?>:
						<?php echo sprintf(__('PHP Constant %s is supported.', 'litespeed-cache'), '<code>LITESPEED_CFG_HTACCESS_BACKEND</code>'); ?>
						<?php echo sprintf(__('You can use this code %1$s in %2$s to specify the htaccess file path.', 'litespeed-cache'), '<code>defined("LITESPEED_CFG_HTACCESS_BACKEND") || define("LITESPEED_CFG_HTACCESS_BACKEND", "your path on server");</code>', '<code>wp-config.php</code>'); ?>
					</font>
				</div>
			</td>
		</tr>
	</tbody>
</table>

<?php if ($content !== null) : ?>

	<h3 class="litespeed-title"><?php echo sprintf(__('Current %s Contents', 'litespeed-cache'), '.htaccess'); ?></h3>

	<h4><?php echo $htaccess_path; ?></h4>

	<textarea readonly wrap="off" rows="50" class="large-text"><?php echo esc_textarea($content); ?></textarea>

<?php endif; ?>toolbox/entry.tpl.php000064400000003222151540355030010702 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$menu_list = array(
	'purge'	=> __( 'Purge', 'litespeed-cache' ),
);

if ( ! $this->_is_network_admin ) {
	$menu_list[ 'import_export' ] = __( 'Import / Export', 'litespeed-cache' );
}

if ( ! $this->_is_multisite || $this->_is_network_admin ) {
	$menu_list[ 'edit_htaccess' ] = __( 'View .htaccess', 'litespeed-cache' );
}

if ( ! $this->_is_network_admin ) {
	$menu_list[ 'heartbeat' ] 		= __( 'Heartbeat', 'litespeed-cache' ); // todo: will add this to network level later
	$menu_list[ 'report' ] 			= __( 'Report', 'litespeed-cache' );
}

if ( ! $this->_is_multisite || $this->_is_network_admin ) {
	$menu_list[ 'settings-debug' ] 	= __( 'Debug Settings', 'litespeed-cache' );
	$menu_list[ 'log_viewer' ] 		= __( 'Log View', 'litespeed-cache' );
	$menu_list[ 'beta_test' ] 		= __( 'Beta Test', 'litespeed-cache' );
}

?>

<div class="wrap">
	<h1 class="litespeed-h1">
		<?php echo __( 'LiteSpeed Cache Toolbox', 'litespeed-cache' ); ?>
	</h1>
	<span class="litespeed-desc">
		v<?php echo Core::VER; ?>
	</span>
	<hr class="wp-header-end">
</div>

<div class="litespeed-wrap">
	<h2 class="litespeed-header nav-tab-wrapper">
	<?php
		$i = 1;
		foreach ($menu_list as $tab => $val){
			$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
			echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
			$i ++;
		}
	?>
	</h2>

	<div class="litespeed-body">
	<?php

		// include all tpl for faster UE
		foreach ($menu_list as $tab => $val) {
			echo "<div data-litespeed-layout='$tab'>";
			require LSCWP_DIR . "tpl/toolbox/$tab.tpl.php";
			echo "</div>";
		}

	?>
	</div>

</div>
toolbox/heartbeat.tpl.php000064400000007576151540355030011520 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$this->form_action();
?>

<h3 class="litespeed-title-short">
	<?php echo __( 'Heartbeat Control', 'litespeed-cache' ); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#heartbeat-tab' ); ?>
</h3>

<div class="litespeed-callout notice notice-warning inline">
	<h4><?php echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4>
	<p><?php echo __( 'Disable WordPress interval heartbeat to reduce server load.', 'litespeed-cache' ); ?>
	<span class="litespeed-warning">
		🚨
		<?php echo __( 'Disabling this may cause WordPress tasks triggered by AJAX to stop working.', 'litespeed-cache' ); ?>
</span></p>
</div>


<table class="wp-list-table striped litespeed-table"><tbody>

	<tr>
		<th>
			<?php $id = Base::O_MISC_HEARTBEAT_FRONT; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">

				<?php echo __( 'Turn ON to control heartbeat on frontend.', 'litespeed-cache' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MISC_HEARTBEAT_FRONT_TTL; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id, 'litespeed-input-short'); ?> <?php $this->readable_seconds(); ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Specify the %s heartbeat interval in seconds.', 'litespeed-cache' ), 'frontend' ); ?>
				<?php echo sprintf( __( 'WordPress valid interval is %s seconds.', 'litespeed-cache' ), '<code>15</code> - <code>120</code>' ); ?><br />
				<?php echo sprintf( __( 'Set to %1$s to forbid heartbeat on %2$s.', 'litespeed-cache' ), '<code>0</code>', 'frontend' ); ?><br />
				<?php $this->recommended( $id ); ?>
				<?php $this->_validate_ttl( $id, 15, 120, true ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MISC_HEARTBEAT_BACK; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Turn ON to control heartbeat on backend.', 'litespeed-cache' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MISC_HEARTBEAT_BACK_TTL; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id, 'litespeed-input-short'); ?> <?php $this->readable_seconds(); ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Specify the %s heartbeat interval in seconds.', 'litespeed-cache' ), 'backend' ); ?>
				<?php echo sprintf( __( 'WordPress valid interval is %s seconds', 'litespeed-cache' ), '<code>15</code> ~ <code>120</code>' ); ?><br />
				<?php echo sprintf( __( 'Set to %1$s to forbid heartbeat on %2$s.', 'litespeed-cache' ), '<code>0</code>', 'backend' ); ?><br />
				<?php $this->recommended( $id ); ?>
				<?php $this->_validate_ttl( $id, 15, 120, true ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MISC_HEARTBEAT_EDITOR; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_switch( $id ); ?>
			<div class="litespeed-desc">
				<?php echo __( 'Turn ON to control heartbeat in backend editor.', 'litespeed-cache' ); ?>
			</div>
		</td>
	</tr>

	<tr>
		<th>
			<?php $id = Base::O_MISC_HEARTBEAT_EDITOR_TTL; ?>
			<?php $this->title( $id ); ?>
		</th>
		<td>
			<?php $this->build_input( $id, 'litespeed-input-short'); ?> <?php $this->readable_seconds(); ?>
			<div class="litespeed-desc">
				<?php echo sprintf( __( 'Specify the %s heartbeat interval in seconds.', 'litespeed-cache' ), 'backend editor' ); ?>
				<?php echo sprintf( __( 'WordPress valid interval is %s seconds', 'litespeed-cache' ), '<code>15</code> ~ <code>120</code>' ); ?><br />
				<?php echo sprintf( __( 'Set to %1$s to forbid heartbeat on %2$s.', 'litespeed-cache' ), '<code>0</code>', 'frontend' ); ?><br />
				<?php $this->recommended( $id ); ?>
				<?php $this->_validate_ttl( $id, 15, 120, true ); ?>
			</div>
		</td>
	</tr>

</tbody></table>

<?php $this->form_end(); ?>
toolbox/import_export.tpl.php000064400000004457151540355030012467 0ustar00<?php
namespace LiteSpeed;
defined( 'WPINC' ) || exit;

$summary = Import::get_summary();
?>

<h3 class="litespeed-title">
	<?php echo __('Export Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#importexport-tab' ); ?>
</h3>

<div><a href="<?php echo Utility::build_url( Router::ACTION_IMPORT, Import::TYPE_EXPORT ); ?>" class="button button-primary">
	<?php echo __( 'Export', 'litespeed-cache' ); ?>
</a></div>

<?php if ( ! empty( $summary[ 'export_file' ] ) ) : ?>
<div class="litespeed-desc">
	<?php echo __( 'Last exported', 'litespeed-cache' ); ?>: <code><?php echo $summary[ 'export_file' ]; ?></code> <?php echo Utility::readable_time( $summary[ 'export_time' ]); ?>
</div>
<?php endif; ?>

<div class="litespeed-desc">
	<?php echo __( 'This will export all current LiteSpeed Cache settings and save them as a file.', 'litespeed-cache' ); ?>
</div>

<h3 class="litespeed-title"><?php echo __('Import Settings', 'litespeed-cache'); ?></h3>

<?php $this->form_action( Router::ACTION_IMPORT, Import::TYPE_IMPORT, true ); ?>

	<div class="litespeed-div">
		<input type="file" name="ls_file" class="litespeed-input" />
	</div>
	<div class="litespeed-div">
		<?php submit_button(__('Import', 'litespeed-cache'), 'button button-primary', 'litespeed-submit'); ?>
	</div>
</form>

<?php if ( ! empty( $summary[ 'import_file' ] ) ) : ?>
<div class="litespeed-desc">
	<?php echo __( 'Last imported', 'litespeed-cache' ); ?>: <code><?php echo $summary[ 'import_file' ]; ?></code> <?php echo Utility::readable_time( $summary[ 'import_time' ]); ?>
</div>
<?php endif; ?>

<div class="litespeed-desc">
	<?php echo __( 'This will import settings from a file and override all current LiteSpeed Cache settings.', 'litespeed-cache' ); ?>
</div>

<h3 class="litespeed-title"><?php echo __('Reset All Settings', 'litespeed-cache'); ?></h3>
<div><p>🚨 <?php echo __( 'This will reset all settings to default settings.', 'litespeed-cache' ); ?></p>
</div>
<div><a href="<?php echo Utility::build_url( Router::ACTION_IMPORT, Import::TYPE_RESET ); ?>" data-litespeed-cfm="<?php echo __( 'Are you sure you want to reset all settings back to the default settings?', 'litespeed-cache' ); ?>" class="button litespeed-btn-danger-bg">
	<?php echo __( 'Reset Settings', 'litespeed-cache' ); ?>
</a></div>



toolbox/log_viewer.tpl.php000064400000005661151540355030011714 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$logs =
	array(
		array(
			'name' => 'debug',
			'label' => __('Debug Log', 'litespeed-cache'),
			'accesskey' => 'A',
		),
		array(
			'name' => 'purge',
			'label' => __('Purge Log', 'litespeed-cache'),
			'accesskey' => 'B',
		),
		array(
			'name' => 'crawler',
			'label' => __('Crawler Log', 'litespeed-cache'),
			'accesskey' => 'C',
		),
	);

/**
 * Return a subnav button (subtab)
 * @since  4.7
 */
function subnav_link($item)
{
	$class = 'button ';
	$subtab = '';

	if (!isset($item['url'])) {
		$class .= 'button-secondary';
		$subtab_name = "{$item['name']}_log";
		$subtab = "data-litespeed-subtab='{$subtab_name}'";
		$url = "#{$subtab_name}";
	} else {
		$class .= 'button-primary';
		$url = $item['url'];
	}

	$accesskey =
		isset($item['accesskey'])
		? "litespeed-accesskey='{$item['accesskey']}'"
		: '';
	$label = isset($item['label']) ? $item['label'] : $item['name'];

	$on_click = isset($item['onClick']) ? ' onClick="' . $item['onClick'].'"' : '';

	return "<a href='{$url}' class='{$class}' {$subtab} {$accesskey} {$on_click}>{$label}</a>";
}

/**
 * Print a button to clear all logs
 * @since  4.7
 */
function clear_logs_link($accesskey = null)
{
	$item =
		array(
			'label' => __('Clear Logs', 'litespeed-cache'),
			'url' => Utility::build_url(Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG),
		);
	if (null !== $accesskey) {
		$item['accesskey'] = $accesskey;
	}
	echo subnav_link($item);
}

/**
 * Print a button to copy current log
 * @since  7.0
 */
function copy_logs_link($id_to_copy)
{
	$item = array(
			'name' => 'copy_links',
			'label' => __('Copy Log', 'litespeed-cache'),
			'cssClass' => 'litespeed-info-button',
			'onClick' => "litespeed_copy_to_clipboard('".$id_to_copy."')"
		);
	return subnav_link($item);
}

$subnav_links = array();
$log_views = array();

foreach ($logs as $log) {
	$subnav_links[] = subnav_link($log);

	$file = $this->cls('Debug2')->path($log['name']);
	$lines = File::count_lines($file);
	$max_lines = apply_filters('litespeed_debug_show_max_lines', 1000);
	$start = $lines > $max_lines ? $lines - $max_lines : 0;
	$lines = File::read($file, $start);
	$lines = $lines ? trim(implode("\n", $lines)) : '';
	
	$log_body_id = 'litespeed-log-' . $log['name'];

	$log_views[] =
		"<div class='litespeed-log-view-wrapper' data-litespeed-sublayout='{$log['name']}_log'>"
		. "<h3 class='litespeed-title'>{$log['label']}" . copy_logs_link($log_body_id) ."</h3>"
		. '<div class="litespeed-log-body" id="' . $log_body_id . '">'
		. nl2br(htmlspecialchars($lines))
		. '</div>'
		. '</div>';
}
?>

<h3 class="litespeed-title">
	<?php _e('LiteSpeed Logs', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/toolbox/#log-view-tab'); ?>
</h3>

<div class="litespeed-log-subnav-wrapper">
	<?php echo implode("\n", $subnav_links); ?>
	<?php clear_logs_link('D'); ?>
</div>

<?php echo implode("\n", $log_views); ?>

<?php
clear_logs_link();
toolbox/purge.tpl.php000064400000023274151540355030010674 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$_panels = array(
	array(
		'title'	=> __('Purge Front Page', 'litespeed-cache'),
		'desc'	=> __('This will Purge Front Page only', 'litespeed-cache'),
		'icon'	=> 'purge-front',
		'append_url'	=> Purge::TYPE_PURGE_FRONTPAGE,
	),
	array(
		'title'	=> __('Purge Pages', 'litespeed-cache'),
		'desc'	=> __('This will Purge Pages only', 'litespeed-cache'),
		'icon'	=> 'purge-pages',
		'append_url'	=> Purge::TYPE_PURGE_PAGES,
	),
);
foreach (Tag::$error_code_tags as $code) {
	$_panels[] = array(
		'title'	=> sprintf(__('Purge %s Error', 'litespeed-cache'), $code),
		'desc'	=> sprintf(__('Purge %s error pages', 'litespeed-cache'), $code),
		'icon'	=> 'purge-' . $code,
		'append_url'	=> Purge::TYPE_PURGE_ERROR . $code,
	);
}
$_panels[] = array(
	'title'	=> __('Purge All', 'litespeed-cache') . ' - LSCache',
	'desc'	=> __('Purge the LiteSpeed cache entries created by this plugin', 'litespeed-cache'),
	'icon'	=> 'purge-all',
	'append_url'	=> Purge::TYPE_PURGE_ALL_LSCACHE,
);
$_panels[] = 	array(
	'title'	=> __('Purge All', 'litespeed-cache') . ' - ' . __('CSS/JS Cache', 'litespeed-cache'),
	'desc'	=> __('This will purge all minified/combined CSS/JS entries only', 'litespeed-cache'),
	'icon'	=> 'purge-cssjs',
	'append_url'	=> Purge::TYPE_PURGE_ALL_CSSJS,
);

if (defined('LSCWP_OBJECT_CACHE')) {
	$_panels[] = array(
		'title'	=> __('Purge All', 'litespeed-cache') . ' - ' . __('Object Cache', 'litespeed-cache'),
		'desc'	=> __('Purge all the object caches', 'litespeed-cache'),
		'icon'	=> 'purge-object',
		'append_url'	=> Purge::TYPE_PURGE_ALL_OBJECT,
	);
}

if (Router::opcache_enabled()) {
	$_panels[] = array(
		'title'	=> __('Purge All', 'litespeed-cache') . ' - ' . __('Opcode Cache', 'litespeed-cache'),
		'desc'	=> __('Reset the entire opcode cache', 'litespeed-cache'),
		'icon'	=> 'purge-opcache',
		'append_url'	=> Purge::TYPE_PURGE_ALL_OPCACHE,
	);
}

if ($this->has_cache_folder('ccss')) {
	$_panels[] = array(
		'title'	=> __('Purge All', 'litespeed-cache') . ' - ' . __('Critical CSS', 'litespeed-cache'),
		'desc'	=> __('This will delete all generated critical CSS files', 'litespeed-cache'),
		'icon'	=> 'purge-cssjs',
		'append_url'	=> Purge::TYPE_PURGE_ALL_CCSS,
	);
}

if ($this->has_cache_folder('ucss')) {
	$_panels[] = array(
		'title'	=> __('Purge All', 'litespeed-cache') . ' - ' . __('Unique CSS', 'litespeed-cache'),
		'desc'	=> __('This will delete all generated unique CSS files', 'litespeed-cache'),
		'icon'	=> 'purge-cssjs',
		'append_url'	=> Purge::TYPE_PURGE_ALL_UCSS,
	);
}

if ($this->has_cache_folder('localres')) {
	$_panels[] = array(
		'title'		=> __('Purge All', 'litespeed-cache') . ' - ' . __('Localized Resources', 'litespeed-cache'),
		'desc'	=> __('This will delete all localized resources', 'litespeed-cache'),
		'icon'	=> 'purge-cssjs',
		'append_url'	=> Purge::TYPE_PURGE_ALL_LOCALRES,
	);
}

if ($this->has_cache_folder('lqip')) {
	$_panels[] = array(
		'title'	=> __('Purge All', 'litespeed-cache') . ' - ' . __('LQIP Cache', 'litespeed-cache'),
		'desc'	=> __('This will delete all generated image LQIP placeholder files', 'litespeed-cache'),
		'icon'	=> 'purge-front',
		'append_url'	=> Purge::TYPE_PURGE_ALL_LQIP,
	);
}

if ($this->has_cache_folder('avatar')) {
	$_panels[] = array(
		'title'	=> __('Purge All', 'litespeed-cache') . ' - ' . __('Gravatar Cache', 'litespeed-cache'),
		'desc'	=> __('This will delete all cached Gravatar files', 'litespeed-cache'),
		'icon'	=> 'purge-cssjs',
		'append_url'	=> Purge::TYPE_PURGE_ALL_AVATAR,
	);
}


$_panels[] = array(
	'title'	=> __('Purge All', 'litespeed-cache'),
	'desc'	=> __('Purge the cache entries created by this plugin except for Critical CSS & Unique CSS & LQIP caches', 'litespeed-cache'),
	'icon'	=> 'purge-all',
	'title_cls'	=> 'litespeed-warning',
	'newline'	=> true,
	'append_url'	=> Purge::TYPE_PURGE_ALL,
);

if (!is_multisite() || is_network_admin()) {
	$_panels[] = array(
		'title'	=> __('Empty Entire Cache', 'litespeed-cache'),
		'desc'	=> __('Clears all cache entries related to this site, <i>including other web applications</i>.', 'litespeed-cache') . ' <b>' .
			__('This action should only be used if things are cached incorrectly.', 'litespeed-cache') . '</b>',
		'tag'	=> Core::ACTION_PURGE_EMPTYCACHE,
		'icon'	=> 'empty-cache',
		'title_cls'	=> 'litespeed-danger',
		'cfm'	=>  esc_html(__('This will clear EVERYTHING inside the cache.', 'litespeed-cache')) . ' ' .
			esc_html(__('This may cause heavy load on the server.', 'litespeed-cache')) . ' ' .
			esc_html(__('If only the WordPress site should be purged, use Purge All.', 'litespeed-cache'))
	);
}

?>

<?php include_once LSCWP_DIR . "tpl/inc/check_cache_disabled.php"; ?>

<h3 class="litespeed-title">
	<?php echo __('Purge', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/toolbox/#purge-tab'); ?>
</h3>

<div class="litespeed-panel-wrapper litespeed-cards-wrapper">

	<?php foreach ($_panels as $v) : ?>
		<?php $tag = !empty($v['tag']) ? $v['tag'] : Router::ACTION_PURGE; ?>
		<?php $append_url = !empty($v['append_url']) ? $v['append_url'] : false; ?>

		<?php if (!empty($v['newline'])) : ?>
			<div class='litespeed-col-br'></div>
		<?php endif; ?>

		<a class="litespeed-panel postbox" href="<?php echo Utility::build_url($tag, $append_url); ?>" <?php if (!empty($v['cfm'])) echo 'data-litespeed-cfm="' . Str::trim_quotes($v['cfm']) . '"'; ?>>
			<section class="litespeed-panel-wrapper-icon">
				<span class="litespeed-panel-icon-<?php echo $v['icon']; ?>"></span>
			</section>
			<section class="litespeed-panel-content">
				<div class="litespeed-h3 <?php if (!empty($v['title_cls'])) echo $v['title_cls']; ?>">
					<?php echo $v['title']; ?>
				</div>
				<span class="litespeed-panel-para"><?php echo $v['desc']; ?></span>
			</section>
		</a>

	<?php endforeach; ?>

</div>

<?php if (!is_multisite() || !is_network_admin()) : ?>

	<h3 class="litespeed-title"><?php echo __('Purge By...', 'litespeed-cache'); ?></h3>
	<p class="litespeed-description">
		<?php echo __('Select below for "Purge by" options.', 'litespeed-cache'); ?>
		<?php Doc::one_per_line(); ?>
	</p>

	<?php
	$purgeby_option = false;
	$_option_field = Admin_Display::PURGEBYOPT_SELECT;
	if (!empty($_REQUEST[$_option_field])) {
		$purgeby_option = $_REQUEST[$_option_field];
	}
	if (!in_array($purgeby_option, array(
		Admin_Display::PURGEBY_CAT,
		Admin_Display::PURGEBY_PID,
		Admin_Display::PURGEBY_TAG,
		Admin_Display::PURGEBY_URL,
	))) {
		$purgeby_option = Admin_Display::PURGEBY_CAT;
	}
	?>

	<?php $this->form_action(Core::ACTION_PURGE_BY); ?>
	<div class="litespeed-row">
		<div class="litespeed-switch litespeed-mini litespeed-right20 litespeed-margin-bottom10">
			<?php $val = Admin_Display::PURGEBY_CAT; ?>
			<input type="radio" autocomplete="off" name="<?php echo $_option_field; ?>" id="purgeby_option_category" value="<?php echo $val; ?>" <?php if ($purgeby_option == $val) echo 'checked'; ?> />
			<label for="purgeby_option_category"><?php echo __('Category', 'litespeed-cache'); ?></label>

			<?php $val = Admin_Display::PURGEBY_PID; ?>
			<input type="radio" autocomplete="off" name="<?php echo $_option_field; ?>" id="purgeby_option_postid" value="<?php echo $val; ?>" <?php if ($purgeby_option == $val) echo 'checked'; ?> />
			<label for="purgeby_option_postid"><?php echo __('Post ID', 'litespeed-cache'); ?></label>

			<?php $val = Admin_Display::PURGEBY_TAG; ?>
			<input type="radio" autocomplete="off" name="<?php echo $_option_field; ?>" id="purgeby_option_tag" value="<?php echo $val; ?>" <?php if ($purgeby_option == $val) echo 'checked'; ?> />
			<label for="purgeby_option_tag"><?php echo __('Tag', 'litespeed-cache'); ?></label>

			<?php $val = Admin_Display::PURGEBY_URL; ?>
			<input type="radio" autocomplete="off" name="<?php echo $_option_field; ?>" id="purgeby_option_url" value="<?php echo $val; ?>" <?php if ($purgeby_option == $val) echo 'checked'; ?> />
			<label for="purgeby_option_url"><?php echo __('URL', 'litespeed-cache'); ?></label>
		</div>

		<div class="litespeed-cache-purgeby-text litespeed-desc">
			<div class="<?php if ($purgeby_option != Admin_Display::PURGEBY_CAT) echo 'litespeed-hide'; ?>" data-purgeby="<?php echo Admin_Display::PURGEBY_CAT; ?>">
				<?php echo sprintf(
					__('Purge pages by category name - e.g. %2$s should be used for the URL %1$s.', "litespeed-cache"),
					'<code>http://example.com/category/category-name/</code>',
					'<code>category-name</code>'
				); ?>
			</div>
			<div class="<?php if ($purgeby_option != Admin_Display::PURGEBY_PID) echo 'litespeed-hide'; ?>" data-purgeby="<?php echo Admin_Display::PURGEBY_PID; ?>">
				<?php echo __("Purge pages by post ID.", "litespeed-cache"); ?>
			</div>
			<div class="<?php if ($purgeby_option != Admin_Display::PURGEBY_TAG) echo 'litespeed-hide'; ?>" data-purgeby="<?php echo Admin_Display::PURGEBY_TAG; ?>">
				<?php echo sprintf(
					__('Purge pages by tag name - e.g. %2$s should be used for the URL %1$s.', "litespeed-cache"),
					'<code>http://example.com/tag/tag-name/</code>',
					'<code>tag-name</code>'
				); ?>
			</div>
			<div class="<?php if ($purgeby_option != Admin_Display::PURGEBY_URL) echo 'litespeed-hide'; ?>" data-purgeby="<?php echo Admin_Display::PURGEBY_URL; ?>">
				<?php echo __('Purge pages by relative or full URL.', 'litespeed-cache'); ?>
				<?php echo sprintf(
					__('e.g. Use %s or %s.', 'litespeed-cache'),
					'<code>/2016/02/24/hello-world/</code>',
					'<code>http://www.myexamplesite.com/2016/02/24/hello-world/</code>'
				); ?>
			</div>
		</div>

	</div>

	<p>
		<textarea name="<?php echo Admin_Display::PURGEBYOPT_LIST; ?>" rows="5" class="litespeed-textarea"></textarea>
	</p>

	<p>
		<button type="submit" class="button button-primary"><?php echo __('Purge List', 'litespeed-cache'); ?></button>
	</p>
	</form>
<?php endif; ?>toolbox/report.tpl.php000064400000012461151540355030011061 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$_report = Report::cls();
$report = $_report->generate_environment_report();

$env_ref = Report::get_summary();

// Detect password less plugin
$link = '';
$has_pswdless_plugin = false;
if (function_exists('dologin_gen_link')) {
	$has_pswdless_plugin = true;
	if (!empty($_GET['dologin_gen_link'])) {
		unset($_GET['dologin_gen_link']);
		$link = dologin_gen_link('Litespeed Report');
?>
		<script>
			window.history.pushState('remove_gen_link', document.title, window.location.href.replace('&dologin_gen_link=1', ''));
		</script>
<?php
	}
}

$install_link = Utility::build_url(Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array('plugin' => 'dologin'));

$btn_title = __('Send to LiteSpeed', 'litespeed-cache');
if (!empty($env_ref['num'])) {
	$btn_title = __('Regenerate and Send a New Report', 'litespeed-cache');
}
?>

<?php if (!$has_pswdless_plugin) : ?>
	<div class="litespeed-callout notice notice-warning inline">
		<h4><?php echo __('NOTICE:', 'litespeed-cache'); ?></h4>
		<p>
			<?php echo sprintf(__('To generate a passwordless link for LiteSpeed Support Team access, you must install %s.', 'litespeed-cache'), '<a href="https://wordpress.org/plugins/dologin/" target="_blank">DoLogin Security</a>'); ?>
		</p>
		<p>
			<a href="<?php echo $install_link; ?>" class="button litespeed-btn litespeed-right20"><?php echo __('Install DoLogin Security', 'litespeed-cache'); ?></a>
			<a href="plugin-install.php?s=dologin+security&tab=search&type=term" target="_blank"><?php echo __('Go to plugins list', 'litespeed-cache'); ?></a>
		</p>
	</div>
<?php endif; ?>

<h3 class="litespeed-title">
	<?php echo __('LiteSpeed Report', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/toolbox/#report-tab'); ?>
</h3>

<p><?php echo __('Last Report Number', 'litespeed-cache'); ?>: <b><?php echo !empty($env_ref['num']) ? $env_ref['num'] : '-'; ?></b></p>
<p><?php echo __('Last Report Date', 'litespeed-cache'); ?>: <b><?php echo !empty($env_ref['dateline']) ? date('m/d/Y H:i:s', $env_ref['dateline']) : '-'; ?></b></p>

<p class="litespeed-desc">
	<?php echo __('The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache'); ?>
	<br />
	<?php echo __('If you run into any issues, please refer to the report number in your support message.', 'litespeed-cache'); ?>
</p>

<form action="<?php echo Utility::build_url(Router::ACTION_REPORT, Report::TYPE_SEND_REPORT); ?>" method="post" class="litespeed-relative">
	<table class="wp-list-table striped litespeed-table">
		<tbody>
			<tr>
				<th><?php echo __('System Information', 'litespeed-cache'); ?></th>
				<td>
					<textarea id="litespeed-report" rows="20" cols="100" readonly><?php echo esc_textarea($report); ?></textarea>
				</td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td>
					<?php
					$this->build_checkbox(
						'attach_php',
						sprintf(
							__(
								'Attach PHP info to report. Check this box to insert relevant data from %s.',
								'litespeed-cache'
							),
							'<a href="https://www.php.net/manual/en/function.phpinfo.php" target="__blank">phpinfo()</a>'
						),
						false
					);
					?>
				</td>
			</tr>
			<tr>
				<th><?php echo __('Passwordless Link', 'litespeed-cache'); ?></th>
				<td>
					<input type="text" class="litespeed-regular-text" id="litespeed-report-link" name="link" value="<?php echo $link; ?>" style="width:500px;" />
					<?php if ($has_pswdless_plugin) : ?>
						<a href="<?php echo admin_url('admin.php?page=litespeed-toolbox&dologin_gen_link=1'); ?>" class="button button-secondary"><?php echo __('Generate Link for Current User', 'litespeed-cache'); ?></a>
					<?php else : ?>
						<button type="button" class="button button-secondary" disabled><?php echo __('Generate Link for Current User', 'litespeed-cache'); ?></button>
					<?php endif; ?>
					<div class="litespeed-desc">
						<?php echo __('To grant wp-admin access to the LiteSpeed Support Team, please generate a passwordless link for the current logged-in user to be sent with the report.', 'litespeed-cache'); ?>
						<?php if ($link) : ?>
							<br /><strong>🚨 <?php echo __('Please do NOT share the above passwordless link with anyone.', 'litespeed-cache'); ?></strong>
							<strong><?php echo sprintf(__('Generated links may be managed under <a %s>Settings</a>.', 'litespeed-cache'), 'href="' . menu_page_url('dologin', 0) . '"'); ?></strong>
						<?php endif; ?>
					</div>
				</td>
			</tr>
			<tr>
				<th><?php echo __('Notes', 'litespeed-cache'); ?></th>
				<td>
					<textarea name="notes" rows="10" cols="100"></textarea>
					<div class="litespeed-desc">
						<?php echo __('Optional', 'litespeed-cache'); ?>:
						<?php echo __('provide more information here to assist the LiteSpeed team with debugging.', 'litespeed-cache'); ?>
					</div>
				</td>
			</tr>
		</tbody>
	</table>

	<div class='litespeed-top20'></div>
	<button class="button button-primary" type="submit"><?php echo $btn_title; ?></button>
	<button class="button button-primary litespeed-float-submit" type="submit"><?php echo $btn_title; ?></button>

	<p class="litespeed-top30 litespeed-left10 litespeed-desc">
		<?php echo __('Send this report to LiteSpeed. Refer to this report number when posting in the WordPress support forum.', 'litespeed-cache'); ?>
	</p>
</form>toolbox/settings-debug.tpl.php000064400000011362151540355030012471 0ustar00<?php

namespace LiteSpeed;

defined('WPINC') || exit;

$this->form_action($this->_is_network_admin ? Router::ACTION_SAVE_SETTINGS_NETWORK : false);
?>

<h3 class="litespeed-title-short">
	<?php echo __('Debug Helpers', 'litespeed-cache'); ?>
</h3>

<a href="<?php echo home_url('/') . '?' . Router::ACTION . '=before_optm'; ?>" class="button button-success" target="_blank">
	<?php echo __('View Site Before Optimization', 'litespeed-cache'); ?>
</a>

<a href="<?php echo home_url('/') . '?' . Router::ACTION . '=' . Core::ACTION_QS_NOCACHE; ?>" class="button button-success" target="_blank">
	<?php echo __('View Site Before Cache', 'litespeed-cache'); ?>
</a>


<h3 class="litespeed-title-short">
	<?php echo __('Debug Settings', 'litespeed-cache'); ?>
	<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/toolbox/#debug-settings-tab'); ?>
</h3>

<table class="wp-list-table striped litespeed-table">
	<tbody>
		<tr>
			<th>
				<?php $id = Base::O_DEBUG_DISABLE_ALL; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('This will disable LSCache and all optimization features for debug purpose.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_DEBUG; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id, array(__('OFF', 'litespeed-cache'), __('ON', 'litespeed-cache'), __('Admin IP Only', 'litespeed-cache'))); ?>
				<div class="litespeed-desc">
					<?php printf(__('Outputs to a series of files in the %s directory.', 'litespeed-cache'), '<code>wp-content/litespeed/debug</code>'); ?>
					<?php echo __('To prevent filling up the disk, this setting should be OFF when everything is working.', 'litespeed-cache'); ?>
					<?php echo __('The Admin IP option will only output log messages on requests from admin IPs listed below.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_DEBUG_IPS; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id, 50); ?>
				<div class="litespeed-desc">
					<?php echo __('Allows listed IPs (one per line) to perform certain actions from their browsers.', 'litespeed-cache'); ?>
					<?php echo __('Your IP', 'litespeed-cache'); ?>: <code><?php echo Router::get_ip(); ?></code>
					<?php $this->_validate_ip($id); ?>
					<br />
					<?php Doc::learn_more(
						'https://docs.litespeedtech.com/lscache/lscwp/admin/#admin-ip-commands',
						__('More information about the available commands can be found here.', 'litespeed-cache')
					); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_DEBUG_LEVEL; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id, array(__('Basic', 'litespeed-cache'), __('Advanced', 'litespeed-cache'))); ?>
				<div class="litespeed-desc">
					<?php echo __('Advanced level will log more details.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_DEBUG_FILESIZE; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_input($id, 'litespeed-input-short'); ?> <?php echo __('MB', 'litespeed-cache'); ?>
				<div class="litespeed-desc">
					<?php echo __('Specify the maximum size of the log file.', 'litespeed-cache'); ?>
					<?php $this->recommended($id); ?>
					<?php $this->_validate_ttl($id, 3, 3000); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_DEBUG_COLLAPSE_QS; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_switch($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Shorten query strings in the debug log to improve readability.', 'litespeed-cache'); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_DEBUG_INC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Only log listed pages.', 'litespeed-cache'); ?>
					<?php $this->_uri_usage_example(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_DEBUG_EXC; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Prevent any debug log of listed pages.', 'litespeed-cache'); ?>
					<?php $this->_uri_usage_example(); ?>
				</div>
			</td>
		</tr>

		<tr>
			<th>
				<?php $id = Base::O_DEBUG_EXC_STRINGS; ?>
				<?php $this->title($id); ?>
			</th>
			<td>
				<?php $this->build_textarea($id); ?>
				<div class="litespeed-desc">
					<?php echo __('Prevent writing log entries that include listed strings.', 'litespeed-cache'); ?>
					<?php Doc::one_per_line(); ?>
				</div>
			</td>
		</tr>

	</tbody>
</table>

<?php

$this->form_end();
admin.php000064400000010652151540403160006350 0ustar00<div class="wrap siteorigin-installer-wrap">
	<div class="siteorigin-installer-header">
		<h1 class="siteorigin-logo">
			<img src="<?php echo esc_url( plugin_dir_url( __FILE__ ) ) . '../img/siteorigin.svg'; ?>" />
			<?php esc_html_e( 'SiteOrigin Installer', 'so-widgets-bundle' ); ?>
		</h1>

		<ul class="page-sections">
			<li><a href="#" data-section="plugins"><?php esc_html_e( 'Plugins', 'so-widgets-bundle' ); ?></a></li>
			<li><a href="#" data-section="themes"><?php esc_html_e( 'Themes', 'so-widgets-bundle' ); ?></a></li>
			<li class="active-section"><a href="#" data-section="all"><?php esc_html_e( 'All', 'so-widgets-bundle' ); ?></a></li>
		</ul>
	</div>

	<ul class="siteorigin-products">
		<?php
		foreach ( $products as $slug => $item ) {
			$classes = array();
			$classes[] = $slug == 'siteorigin-premium' || empty( $item['status'] ) ? 'active' : 'inactive';

			if ( ! empty( $highlight ) && $slug == $highlight ) {
				$classes[] = 'highlight-item';
			}
			?>
			<li class="siteorigin-installer-item siteorigin-<?php echo esc_attr( $item['type'] ); ?> siteorigin-installer-item-<?php echo sanitize_html_class( implode( ' ', $classes ) ); ?>">
				<div
					class="siteorigin-installer-item-body"
					data-slug="<?php echo esc_attr( $slug ); ?>"
					data-version="<?php echo esc_attr( $item['version'] ); ?>"
				>
					<?php if ( ! empty( $item['screenshot'] ) ) { ?>
						<img class="siteorigin-installer-item-banner" src="<?php echo esc_url( $item['screenshot'] ); ?>" />
					<?php } ?>

					<div class="siteorigin-product-content">

						<h3>
							<?php echo esc_html( $item['name'] ); ?>
						</h3>
						<p class="so-description">
							<?php
							if ( ! empty( $highlight ) && $slug == $highlight ) {
								echo '<span class="siteorigin-required">';
								printf(
									esc_html__( 'Required %s', 'so-widgets-bundle' ),
									$item['type'] == 'plugins' ? esc_html__( 'Plugin', 'so-widgets-bundle' ) : esc_html__( 'Theme', 'so-widgets-bundle' )
								);
								echo '</span>';
							}
							echo esc_html( $item['description'] );
							?>
						</p>

						<div class="so-type-indicator">
							<?php
							if ( $item['type'] == 'plugins' ) {
								esc_html_e( 'Plugin', 'so-widgets-bundle' );
							} else {
								esc_html_e( 'Theme', 'so-widgets-bundle' );
							}
							?>
						</div>

						<div class="so-buttons <?php
						echo $slug != 'siteorigin-premium' && ! empty( $item['status'] ) && ! empty( $item['update'] ) ? 'so-buttons-force-wrap' : ''; ?>">
							<?php
							if (
								$slug == 'siteorigin-premium' ||
								! empty( $item['status'] ) ||
								! empty( $item['update'] ) ||
								$item['type'] == 'themes'
							) {
								if ( $slug == 'siteorigin-premium' ) {
									$premium_url = 'https://siteorigin.com/downloads/premium/';
									$affiliate_id = apply_filters( 'siteorigin_premium_affiliate_id', '' );
									if ( $affiliate_id && is_numeric( $affiliate_id ) ) {
										$premium_url = add_query_arg( 'ref', urlencode( $affiliate_id ), $premium_url );
									}
									?>
									<a href="<?php echo esc_url( $premium_url ); ?>" target="_blank" rel="noopener noreferrer" class="button-primary">
										<?php esc_html_e( 'Get SiteOrigin Premium', 'so-widgets-bundle' ); ?>
									</a>
									<?php
								} elseif ( ! empty( $item['status'] ) || $item['type'] == 'themes' ) {
									if ( $item['status'] == 'install' ) {
										$text = __( 'Install', 'so-widgets-bundle' );
									} else {
										$text = __( 'Activate', 'so-widgets-bundle' );
									}
									require 'action-btn.php';
								}

								if ( ! empty( $item['update'] ) ) {
									$text = __( 'Update', 'so-widgets-bundle' );
									$item['status'] = 'update';
									require 'action-btn.php';
								}
							}


							if (
								$item['type'] == 'themes' &&
								! empty( $item['demo'] )
							) {
								?>
								<a href="<?php echo esc_url( $item['demo'] ); ?>" target="_blank" rel="noopener noreferrer" class="siteorigin-demo">
									<?php esc_html_e( 'Demo', 'so-widgets-bundle' ); ?>
								</a>
							<?php } ?>

							<?php if ( ! empty( $item['documentation'] ) ) { ?>
								<a href="<?php echo esc_url( $item['documentation'] ); ?>" target="_blank" rel="noopener noreferrer" class="siteorigin-docs">
									<?php esc_html_e( 'Documentation', 'so-widgets-bundle' ); ?>
								</a>
							<?php } ?>
						</div>
					</div>
				</div>
			</li>
			<?php
		}
		?>
	</ul>

</div>
default.php000064400000000221151541455700006703 0ustar00<img src="<?php echo esc_url($instance['image']) ?>" style="visibility:hidden" data-animation="<?php echo esc_attr($instance['animation']) ?>" />alternate.php000064400000001172151542201640007235 0ustar00<article id="post-<?php the_ID(); ?>" <?php post_class( 'sow-blog-columns' ); ?> style="display: flex; justify-content: space-between; margin-bottom: 30px;">
	<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings ); ?>
	<?php SiteOrigin_Widget_Blog_Widget::content_wrapper( $settings ); ?>
		<header class="sow-entry-header">
			<?php SiteOrigin_Widget_Blog_Widget::generate_post_title( $settings ); ?>
			<div class="sow-entry-meta">
				<?php SiteOrigin_Widget_Blog_Widget::post_meta( $settings ); ?>
			</div>
		</header>

		<?php SiteOrigin_Widget_Blog_Widget::output_content( $settings, 18 ); ?>
	</div>
</article>
base.php000064400000001047151542201640006171 0ustar00<?php if ( ! empty( $settings['posts'] ) && $settings['posts']->have_posts() ) { ?>
	<div
		class="sow-post-carousel-wrapper <?php echo ! empty( $settings['theme'] ) ? 'sow-post-carousel-theme-' . esc_attr( $settings['theme'] ) : ''; ?>"
		style="overflow: hidden; max-width: 100%; <?php echo ! empty( $settings['height'] ) ? esc_attr( $settings['height'] ) : ''; ?>"
	>
		<?php $this->render_template( $settings, $args, $instance ); ?>
		<input type="hidden" name="instance_hash" value="<?php echo esc_attr( $storage_hash ); ?>"/>
	</div>
<?php } ?>
grid.php000064400000001145151542201640006203 0ustar00<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> style="margin: 0 0 30px;">
	<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings ); ?>
	<?php
	SiteOrigin_Widget_Blog_Widget::content_wrapper(
		$settings,
		array(
			'padding' => '25px 30px 33px',
		)
	);
	?>
		<header class="sow-entry-header">
			<?php SiteOrigin_Widget_Blog_Widget::generate_post_title( $settings ); ?>
			<div class="sow-entry-meta">
				<?php SiteOrigin_Widget_Blog_Widget::post_meta( $settings ); ?>
			</div>
		</header>

		<?php SiteOrigin_Widget_Blog_Widget::output_content( $settings ); ?>
	</div>
</article>
masonry.php000064400000001137151542201640006747 0ustar00<article id="post-<?php the_ID(); ?>" <?php post_class( 'sow-masonry-item' ); ?>>
	<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings ); ?>
	<?php
	SiteOrigin_Widget_Blog_Widget::content_wrapper(
		$settings,
		array(
			'padding' => '25px 30px 33px',
		)
	);
	?>
		<header class="sow-entry-header">
			<?php SiteOrigin_Widget_Blog_Widget::generate_post_title( $settings ); ?>
			<div class="sow-entry-meta">
				<?php SiteOrigin_Widget_Blog_Widget::post_meta( $settings ); ?>
			</div>
		</header>

		<?php SiteOrigin_Widget_Blog_Widget::output_content( $settings ); ?>
	</div>
</article>
offset.php000064400000007200151542201640006542 0ustar00<article id="post-<?php the_ID(); ?>" <?php post_class( 'sow-blog-columns' ); ?> style="display: flex; flex-wrap: wrap; justify-content: space-between; margin: 0 0 40px;">
	<div class="sow-blog-entry-offset" style="box-sizing: border-box; padding-right: 30px; width: 22%;">
		<?php if ( $settings['author'] ) { ?>
			<?php if ( function_exists( 'coauthors_posts_links' ) ) { ?>
				<?php $coauthors = get_coauthors(); ?>
				<span class="sow-meta-text">
					<?php echo esc_html( _n( 'Author', 'Authors', count( $coauthors ), 'so-widgets-bundle' ) ); ?>
				</span>
				<?php foreach ( $coauthors as $author ) { ?>
					<div class="sow-entry-author-avatar">
						<a href="<?php echo esc_url( get_author_posts_url( $author->ID ) ); ?>">
							<?php echo get_avatar( $author->ID, 140 ); ?>
						</a>
					</div>
					<div class="sow-entry-author-link">
						<?php echo coauthors_posts_links_single( $author ); ?>
					</div>
				<?php } ?>
			<?php } else { ?>
				<div class="sow-entry-author-avatar">
					<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>">
						<?php echo get_avatar( get_the_author_meta( 'ID' ), 140 ); ?>
					</a>
				</div>
				<div class="sow-entry-author-link">
					<span class="sow-meta-text"><?php esc_html_e( 'Written by', 'so-widgets-bundle' ); ?></span>
					<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>">
						<?php echo esc_html( get_the_author() ) ?>
					</a>
				</div>
			<?php } ?>
		<?php } ?>

		<?php if ( $settings['categories'] ) { ?>
			<div class="sow-entry-categories">
				<span class="sow-meta-text"><?php esc_html_e( 'Posted in', 'so-widgets-bundle' ); ?></span>
				<?php the_category( ', ', '', '' ); ?>
			</div>
		<?php } ?>

		<?php if ( ! empty( $settings['tags'] ) && has_tag() ) { ?>
			<div class="sow-entry-tags">
				<span class="sow-meta-text"><?php esc_html_e( 'Tags', 'so-widgets-bundle' ); ?></span>
				<?php the_tags( '' ); ?>
			</div>
		<?php } ?>

		<?php if ( comments_open() && $settings['comment_count'] ) { ?>
			<div class="sow-entry-comments">
				<span class="sow-meta-text"><?php esc_html_e( 'Comments', 'so-widgets-bundle' ); ?></span>
				<?php
				echo comments_popup_link(
					esc_html__( 'Post a comment', 'so-widgets-bundle' ),
					esc_html__( '1 Comment', 'so-widgets-bundle' ),
					esc_html__( '% Comments', 'so-widgets-bundle' )
				);
				?>
			</div>
		<?php } ?>
	</div>
	<div class="sow-blog-entry" style="width: 78%;">
		<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings ); ?>
		<?php
		SiteOrigin_Widget_Blog_Widget::content_wrapper(
			$settings,
			array(
				'padding' => '25px 30px 33px',
			)
		);
		?>
			<header class="sow-entry-header">
				<?php
				SiteOrigin_Widget_Blog_Widget::generate_post_title( $settings );
				if ( ! empty( $template_settings['time_string'] ) ) {
					$time_string = sprintf(
						$template_settings['time_string'],
						esc_attr( get_the_date( DATE_W3C ) ),
						esc_html( get_the_date( $template_settings['date_output_format'] ) ),
						esc_attr( get_the_modified_date( DATE_W3C ) ),
						esc_html( get_the_modified_date( $template_settings['date_output_format'] ) )
					);
					?>
					<div class="sow-entry-meta">
						<?php
						echo '<span class="sow-posted-on">';
						printf(
							/* translators: %s: post date. */
							esc_html_x( 'Posted on %s', 'post date', 'so-widgets-bundle' ),
							'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
						);
						echo '</span>';
						?>
					</div>
				<?php } ?>
			</header>

			<?php SiteOrigin_Widget_Blog_Widget::output_content( $settings ); ?>
		</div>
	</div>
</article>
portfolio.php000064400000003262151542201640007275 0ustar00<?php
$types = null;

if ( $settings['categories'] || $template_settings['filter_categories'] ) {
	$terms = SiteOrigin_Widget_Blog_Widget::get_query_terms( $instance, $query, get_the_ID() );

	if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
		$filtering_links = array();

		foreach ( $terms as $term ) {
			$filtering_links[] = sanitize_html_class(
				is_object( $term ) ? $term->slug : $term
			);
		}
		$filtering = join( ', ', $filtering_links );
		$types = $filtering ? join( ' ', $filtering_links ) : ' ';
	}
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'sow-portfolio-item ' . $types ); ?>>
	<div class="sow-entry-thumbnail">
		<a href="<?php the_permalink(); ?>" class="sow-entry-link-overlay">&nbsp;</a>
		<span class="sow-entry-overlay">&nbsp;</span>
		<div class="sow-entry-content">
			<?php
			$tag = siteorigin_widget_valid_tag(
				$settings['tag'],
				'h2'
			);

			the_title(
				'<' . $tag . ' class="sow-entry-title" style="margin: 0 0 5px;">',
				'</' . $tag . '>'
			);

			if ( $settings['categories'] ) {
				?>
				<div class="sow-entry-divider"></div>
				<span class="sow-entry-project-type"><?php echo esc_html( $filtering ); ?></span>
			<?php } ?>
		</div>
		<?php
		if ( ! has_post_thumbnail() ) {
			echo apply_filters( 'siteorigin_widgets_blog_featured_image_fallback', false, $settings );
		} else {
			if ( ! empty( $settings['featured_image_size'] ) ) {
				$size = $settings['featured_image_size'] == 'custom_size' ? array( $settings['featured_image_size_width'], $settings['featured_image_size_height'] ) : $settings['featured_image_size'];
			} else {
				$size = 'sow-blog-portfolio';
			}
			the_post_thumbnail( $size );
		}
		?>
	</div>
</article>
standard.php000064400000001144151542201640007055 0ustar00<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> style="margin: 0 0 40px">
	<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings ); ?>
	<?php
	SiteOrigin_Widget_Blog_Widget::content_wrapper(
		$settings,
		array(
			'padding' => '25px 30px 38px',
		)
	);
	?>
		<header class="sow-entry-header">
			<?php SiteOrigin_Widget_Blog_Widget::generate_post_title( $settings ); ?>
			<div class="sow-entry-meta">
				<?php SiteOrigin_Widget_Blog_Widget::post_meta( $settings ); ?>
			</div>
		</header>

		<?php SiteOrigin_Widget_Blog_Widget::output_content( $settings ); ?>
	</div>
</article>
item.php000064400000000740151542673530006227 0ustar00<?php foreach ( $settings['items'] as $item ) { ?>
	<div class="sow-carousel-item" tabindex="-1">
		<?php if ( ! empty( $item['title'] ) ) { ?>
			<<?php echo esc_html( $settings['item_title_tag'] ); ?> class="sow-carousel-item-title">
				<?php echo esc_html( $item['title'] ); ?>
			</<?php echo esc_html( $settings['item_title_tag'] ); ?>>
		<?php } ?>

		<div class="sow-carousel-content">
			<?php $this->render_item_content( $item, $instance ); ?>
		</div>
	</div>
	<?php
}
js-map.php000064400000001535151545265350006463 0ustar00<?php
/**
 * @var $map_id
 * @var $map_data
 * @var $height
 * @var $fallback_image_data
 */
?>
<?php if ( $map_consent ) { ?>
	<div class="sow-google-map-consent" style="<?php echo 'background-image: url(' . sow_esc_url( $consent_background_image ) . ')'; ?>">
		<div class="sow-google-map-consent-prompt">
			<div class="sow-google-map-consent-prompt-inner">
				<?php echo wp_kses_post( $map_consent_notice ); ?>

				<button class="btn button"><?php echo esc_html( $map_consent_btn_text ); ?></button>
			</div>
		</div>
	</div>
<?php } ?>

<div class="sow-google-map-canvas"
	style="<?php echo ( $map_consent ) ? 'display: none;' : ''; ?>"
	id="map-canvas-<?php echo esc_attr( $map_id ); ?>"
	data-options="<?php echo esc_attr( wp_json_encode( $map_data ) ); ?>"
	data-fallback-image="<?php echo esc_attr( json_encode( $fallback_image_data ) ); ?>"></div>
static-map.php000064400000001226151545265350007333 0ustar00<?php
/**
 * @var $destination_url
 * @var $new_window
 * @var $src_url
 * @var $fallback_image_data
 * @var $breakpoint
 */
?>

<?php if ( ! empty( $destination_url ) ) { ?>
	<a href="<?php echo sow_esc_url( $destination_url ); ?>" <?php echo $new_window ? 'target="_blank" rel="noopener noreferrer"' : ''; ?>>
<?php } ?>

<img
	class="sowb-google-map-static"
	border="0"
	src="<?php echo sow_esc_url( $src_url ); ?>"
	data-fallback-image="<?php echo esc_attr( json_encode( $fallback_image_data ) ); ?>"
	data-breakpoint="<?php echo esc_attr( $breakpoint ); ?>"
	onerror="this.sowbLoadError = true;">

<?php
if ( ! empty( $destination_url ) ) {
	echo '</a>';
}
settings.php000064400000005617151545432550007137 0ustar00<div class="wrap" id="panels-settings-page">
	<div class="settings-banner">

		<span class="icon">
			<img src="<?php echo siteorigin_panels_url( 'settings/images/icon-layer.png' ) ?>" class="layer-3" />
			<img src="<?php echo siteorigin_panels_url( 'settings/images/icon-layer.png' ) ?>" class="layer-2" />
			<img src="<?php echo siteorigin_panels_url( 'settings/images/icon-layer.png' ) ?>" class="layer-1" />
		</span>
		<h1><?php _e('SiteOrigin Page Builder', 'siteorigin-panels') ?></h1>

		<div id="panels-settings-search">
			<input type="search" placeholder="<?php esc_attr_e('Search Settings', 'siteorigin-panels') ?>" />

			<ul class="results">
			</ul>
		</div>
	</div>

	<ul class="settings-nav">
		<?php
		foreach($settings_fields as $section_id => $section) {
			?><li><a href="#<?php echo esc_attr( $section_id ) ?>"><?php echo esc_html( $section['title'] ) ?></a></li><?php
		}
		?>
		<li><a href="#welcome"><?php esc_html_e( 'Welcome', 'siteorigin-panels' ) ?></a></li>
	</ul>

	<?php if( $this->settings_saved ) : ?>
		<div id="setting-error-settings_updated" class="updated settings-error">
			<p><strong><?php _e('Settings Saved', 'siteorigin-panels') ?></strong></p>
		</div>
	<?php endif; ?>

	<form action="<?php echo admin_url('options-general.php?page=siteorigin_panels') ?>" method="post" >

		<div id="panels-settings-sections">
			<?php
			foreach($settings_fields as $section_id => $section) {
				?>
				<div id="panels-settings-section-<?php echo esc_attr($section_id) ?>" class="panels-settings-section" data-section="<?php echo esc_attr($section_id) ?>">
					<table class="form-table">
						<tbody>
							<?php foreach( $section['fields'] as $field_id => $field ) : ?>
								<tr class="panels-setting">
									<th scope="row"><label><?php echo esc_html($field['label']) ?></label></th>
									<td>
										<?php
										$this->display_field( $field_id, $field );
										if( !empty($field['description']) ) {
											?>
											<small class="description" data-keywords="<?php if(!empty($field['keywords'])) echo esc_attr($field['keywords']) ?>">
												<?php
												echo wp_kses( $field['description'], array(
													'a' => array(
														'href' => array(),
														'title' => array()
													),
													'em' => array(),
													'strong' => array(),
												) );
												?>
											</small>
											<?php
										}
										?>
									</td>
								</tr>
							<?php endforeach; ?>
						</tbody>
					</table>
				</div>
				<?php
			}
			?>

			<div id="panels-settings-section-welcome" class="panels-settings-section" data-section="welcome">
				<?php include( plugin_dir_path(__FILE__) . 'welcome.php' ) ?>
			</div>
			
		</div>

		<div class="submit">
			<?php wp_nonce_field( 'panels-settings' ) ?>
			<input type="submit" value="<?php _e('Save Settings', 'siteorigin-panels') ?>" class="button-primary" />
		</div>
	</form>

</div>
welcome.php000064400000006115151545432550006724 0ustar00<h1><?php esc_html_e( 'Welcome To SiteOrigin Page Builder', 'siteorigin-panels' ); ?></h1>

<p>
	<?php esc_html_e( 'Page Builder by SiteOrigin makes it easy to create responsive column based content, using the widgets you know and love. Your content will accurately adapt to all mobile devices, ensuring your site is mobile-ready.', 'siteorigin-panels' ); ?>
</p>

<p>
	<?php printf( esc_html__( "Page Builder works with standard WordPress widgets, so you’ll always find the widget you need. We've also created the %s to give you a wide range of additional functionality. All the widgets are built on our powerful framework, giving you advanced forms, unlimited colours and 1500+ icons.", 'siteorigin-panels' ), '<a href="https://wordpress.org/plugins/so-widgets-bundle/" target="_blank">SiteOrigin Widgets Bundle</a>' ); ?>
</p>

<h2><?php esc_html_e( 'Simple Drag and Drop', 'siteorigin-panels' ); ?></h2>

<p>
	<?php esc_html_e( "Reorder rows, move widgets, resize columns and build your page, all with your mouse. Page Builder makes it easy to nudge every detail into place, no matter how often you change your mind. We've meticulously crafted each and every interaction to make sure they all feel natural. It's intuitive content editing that doesn't sacrifice on functionality.", 'siteorigin-panels' ); ?>
</p>

<h2><?php esc_html_e( 'Live Editing', 'siteorigin-panels' ); ?></h2>

<p>
	<?php esc_html_e( 'The live editor gives you an exact preview of your content, that you can edit in real-time. You can use this to pin-point the sections and widgets you want to edit, then see those edits without leaving the page. Create content in a fraction of the time.', 'siteorigin-panels' ); ?>
</p>

<h2><?php esc_html_e( 'History Browser', 'siteorigin-panels' ); ?></h2>

<p>
	<?php esc_html_e( 'Worry free editing is having the freedom to experiment without fearing mistakes. The History Browser lets you roll forward and back through your changes. Preview changes, then roll back to that version without skipping a beat. Your personal safety net.', 'siteorigin-panels' ); ?>
</p>

<h2><?php esc_html_e( 'Row and Widget Styles', 'siteorigin-panels' ); ?></h2>

<p>
	<?php esc_html_e( 'Row and widget styles give you all the control you need to make your content uniquely your own. Change attributes like paddings, background colours and column spacing. You can also enter custom CSS and CSS classes if you need even finer grained control.', 'siteorigin-panels' ); ?>
</p>

<h2><?php esc_html_e( 'Get More Features', 'siteorigin-panels' ); ?></h2>

<p>
	<?php printf( esc_html__( '%s is a single plugin that adds additional settings and functionality to Page Builder, SiteOrigin widgets and SiteOrign themes. SiteOrigin Premium also includes our next level email support service. If you need expert advice and quick replies, consider SiteOrigin Premium.', 'siteorigin-panels' ), '<a href="https://siteorigin.com/downloads/premium/" target="_blank">SiteOrigin Premium</a>' ); ?>
</p>

<iframe src="https://player.vimeo.com/video/314964526" width="800" height="450" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
atom.php000064400000007144151545626230006234 0ustar00<?php
/**
 * @var $title string
 * @var $columns array
 * @var $before_title string
 * @var $after_title string
 * @var $button_attrs boolean
 * @var $equalize_row_heights boolean
 * @var $any_column_has_image boolean
 */

$initial_button_attrs = $button_attrs;
?>

<?php if ( ! empty( $title ) ) {
	echo $before_title . $title . $after_title;
} ?>

<div class="ow-pt-columns-atom<?php echo (bool) $equalize_row_heights ? ' sow-equalize-row-heights' : ''; ?>">

	<?php foreach ( $columns as $i => $column ) { ?>
		<div class="ow-pt-column <?php echo $this->get_column_classes( $column, $i, $columns ); ?>"
			 style="width: <?php echo round( 100 / count( $columns ), 3 ); ?>%">
			<div class="ow-pt-title">
				<?php echo wp_kses_post( $column['title'] ); ?>
				<?php if ( ! empty( $column['subtitle'] ) ) { ?>
					<div class="ow-pt-subtitle">
						<?php echo wp_kses_post( $column['subtitle'] ); ?>
					</div>
				<?php } ?>
			</div>

            <div class="ow-pt-details">
                <div class="ow-pt-price">
					<?php echo wp_kses_post( $column['price'] ); ?>
				</div>
				<?php if ( ! empty( $column['sale_price'] ) ) { ?>
					<span class="ow-pt-sale-price">
						<?php echo wp_kses_post( $column['sale_price'] ); ?>
					</span>
				<?php } ?>
                <div class="ow-pt-per"><?php echo wp_kses_post( $column['per'] ); ?></div>
            </div>

			<?php if ( ( $equalize_row_heights && $any_column_has_image ) || ! ( $equalize_row_heights || empty( $column['image'] ) ) ) { ?>
				<div class="ow-pt-image">
					<?php $this->column_image( $column ); ?>
				</div>
			<?php } ?>

			<div class="ow-pt-features">
				<?php foreach ( $column['features'] as $i => $feature ) { ?>
					<div class="ow-pt-feature ow-pt-feature-<?php echo $i % 2 == 0 ? 'even' : 'odd'; ?> ow-pt-feature-index-<?php echo $i; ?>" title="<?php echo ! empty( $feature['hover'] ) ? esc_attr( $feature['hover'] ) : ''; ?>">

						<?php
						if ( ! empty( $feature['icon_new'] ) ) { ?>
							<div class="sow-feature-icon">
								<?php
								$icon_styles = array();

							if ( ! empty( $feature['icon_color'] ) ) {
								$icon_styles[] = 'color: ' . $feature['icon_color'];
							}
							echo siteorigin_widget_get_icon( $feature['icon_new'], $icon_styles );
							?>
							</div>
						<?php } ?>
						<div class="sow-feature-text">
							<p>
								<?php echo wp_kses_post( $feature['text'] ); ?>
							</p>
						</div>
					</div>
				<?php } ?>
			</div>

			<?php if ( ! empty( $column['button'] ) ) { ?>
				<div class="ow-pt-button">
					<a
						href="<?php echo sow_esc_url( $column['url'] ); ?>"
						<?php
						$button_attrs = apply_filters(
							'siteorigin_widgets_price_table_button_attributes',
							$initial_button_attrs,
							$column
						);

						foreach ( $button_attrs as $attr => $val ) {
							echo siteorigin_sanitize_attribute_key( $attr ) . '="' . esc_attr( $val ) . '" ';
						}
						?>
					><?php echo esc_html( $column['button'] ); ?></a>
				</div>
			<?php } ?>
		</div>
	<?php
	}

	global $siteorigin_price_table_icons;

	if ( empty( $siteorigin_price_table_icons ) ) {
		$siteorigin_price_table_icons = array();
	}

	foreach ( $columns as $i => $column ) {
		foreach ( $column['features'] as $feature ) {
			if ( ! empty( $feature['icon'] ) && empty( $siteorigin_price_table_icons[ $feature['icon'] ] ) ) {
				$siteorigin_price_table_icons[ $feature['icon'] ] = true;
				echo '<div style="display:none" id="so-pt-icon-' . esc_url( $feature['icon'] ) . '">';
				readfile( plugin_dir_path( __FILE__ ) . '../fontawesome/' . sanitize_file_name( $feature['icon'] ) . '.svg' );
				echo '</div>';
			}
		}
	}
	?>
</div>
email.php000064400000000543151545756060006364 0ustar00<!DOCTYPE html>
<html lang="<?php echo esc_attr( get_bloginfo( 'language' ) ); ?>">
<head>
	<meta charset="<?php esc_attr( get_bloginfo( 'charset' ) ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>
		<?php echo esc_html( $subject ); ?>
	</title>
</head>
<body>
	<?php echo wp_kses_post( $body ); ?>
</body>
</html>
simple.php000064400000000301151545756060006556 0ustar00<a href="<?php echo esc_url($instance['url']) ?>" <?php if(!empty($instance['new_window'])) echo 'target="_blank" rel="noopener noreferrer"'; ?>>
	<?php echo esc_html($instance['text']) ?>
</a>hizmetlerimiz-template.php000064400000001231151547151750011772 0ustar00<?php 
if(wp_is_mobile() && $instance['mobilgizle']) { 

} else {
	echo '<div class="row">';

foreach($instance['hizmetler'] as $hizmet) {
	echo '<div class="hizmetler col">';
	if($hizmet['url']) {
		echo '<a href="'.$hizmet['url'].'">';
	}
	if($hizmet['baslik']) {
		echo '<div class="hizmet-title">'.$hizmet['baslik'].'</div>';
	}
		echo '<div class="hizmet-icon pt-4 py-lg-4" style="color:'.$instance['color'].';"><i class="'.$hizmet['resim'].'"></i></div>';

	if($hizmet['altbaslik']) {
		echo '<div class="hizmet-desc">'.$hizmet['altbaslik'].'</div>';
	}
	if($hizmet['url']) {
		echo '</a>';
	}
	echo '</div>';
}
	echo '</div>';
} 
?>carousel.php000064400000004410151551050510007067 0ustar00<div class="sow-carousel-title<?php if ( ! empty( $settings['title'] ) ) {
	echo ' has-title';
} ?>">
	<?php
	if ( ! empty( $settings['title'] ) ) {
		echo $args['before_title'] . esc_html( $settings['title'] ) . $args['after_title'];
	}

	if ( $settings['navigation'] == 'title' ) {
		?>
		<div class="sow-carousel-navigation <?php echo ! $settings['navigation_arrows'] ? 'sow-carousel-navigation-hidden' : ''; ?>">
			<?php $this->render_navigation( 'both' ); ?>
		</div>
	<?php } ?>
</div>

<div class="sow-carousel-container <?php echo ! empty( $container_classes ) ? esc_attr( $container_classes ) : ''; ?>">
	<?php if ( $settings['navigation'] == 'side' || $settings['navigation'] == 'full' ) { ?>
		<div class="sow-carousel-navigation sow-carousel-navigation-prev <?php echo ! $settings['navigation_arrows'] ? 'sow-carousel-navigation-hidden' : ''; ?>">
			<?php $this->render_navigation( 'prev' ); ?>
		</div>
	<?php } ?>
	<div class="sow-carousel-wrapper"
		data-dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"
		style="opacity: 0;"
		<?php
		foreach ( $settings['attributes'] as $n => $v ) {
			if ( ! empty( $n ) ) {
				echo 'data-' . siteorigin_sanitize_attribute_key( $n ) . '="' . esc_attr( $v ) . '" ';
			}
		}
		?>
	>
		<div
			class="sow-carousel-items"
			<?php
			if ( ! empty( $settings['item_overflow'] ) ) {
				echo 'style="width: 200vw; opacity: 0;"';
			}
			?>
		>
			<?php include $settings['item_template']; ?>
		</div>
		<?php if ( $settings['navigation'] == 'container' || $settings['navigation'] == 'full' ) { ?>
			<div class="sow-carousel-nav" <?php echo ! $settings['navigation_arrows'] && empty( $settings['navigation_dots'] ) ? 'style="display: none;"' : ''; ?>>
				<?php if ( $settings['navigation'] !== 'full' ) { ?>
					<div class="sow-carousel-nav-arrows" <?php echo ! $settings['navigation_arrows'] ? 'style="display: none;"' : ''; ?>>
						<?php $this->render_navigation( 'both' ); ?>
					</div>
				<?php } ?>
			</div>
		<?php } ?>
	</div>

	<?php if ( $settings['navigation'] == 'side' || $settings['navigation'] == 'full' ) { ?>
		<div class="sow-carousel-navigation sow-carousel-navigation-next <?php echo ! $settings['navigation_arrows'] ? 'sow-carousel-navigation-hidden' : ''; ?>">
			<?php $this->render_navigation( 'next' ); ?>
		</div>
	<?php } ?>
</div>
urunler-tabs-template.php000064400000002371151551214110011510 0ustar00<?php 
if(wp_is_mobile() && $instance['mobilgizle']) { 

} else {
	echo '<div class="urunler-tabs">';
	
	if($instance['baslik']) {
		echo '<div class="wbaslik d-flex w-100">';
		echo '<div class="wh2">'.$instance['baslik'].'</div>';
		echo '</div>';
	}
		echo '<div class="tab">';

		foreach($instance['kategoriler'] as $kategori) {

			echo '<a href="javascript:;" class="tablinks" id="'.sanitize_title($kategori["kbaslik"]).'-widget-tabs">'.$kategori["kbaslik"].'</a>';

		}
		echo '</div>';

		foreach($instance['kategoriler'] as $kategori) {
			echo '<div id="'.sanitize_title($kategori["kbaslik"]).'-widget-tabsC" class="tabcontent wslide">';
			$args['post_type'] 	= 'product';
			$args['orderby'] = 'date';
			$args['order'] = 'desc';
			$args['posts_per_page'] = $instance['urunsayisi'];
			$args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => $kategori['kategori'], 'field' => 'slug'));

		$loop = new WP_Query( $args );
		if ( $loop->have_posts() ) {
			while ( $loop->have_posts() ) : $loop->the_post();
				get_template_part('/parts/wc/type3');
			endwhile;
		} else {
			echo __( 'Gösterilecek ürün bulunamadı','temavadisi' );
		}
		wp_reset_postdata();
		echo '</div>';
		}
	echo '</div>';
}
?>cok-satanlar-template.php000064400000004223151551505200011445 0ustar00<?php 
if(wp_is_mobile() && $instance['mobilgizle']) { 

} else {
	echo '<div class="cok-satanlar">';
	$tumulink2 = get_term_by('slug', $instance['kategori'], 'product_cat');
	$tumulink = get_category_link($tumulink2->term_id);
	
	if($instance['baslik']) {
		echo '<div class="wbaslik d-flex w-100">';
		echo '<div class="wh2">'.$instance['baslik'].'</div>';
		echo '<div class="wl"><a href="'.$tumulink.'">'.__('Tümü','temavadisi').'<i class="icon-right-open-big"></i></a></div>';
		echo '</div>';
	}

if($instance['slide']) {
echo '<script>
	$(document).ready(function(){
		$(".'.$args['widget_id'].'.wslide").slick({
			dots: false,
			infinite: true,
			autoplay: true,
			autoplaySpeed: 5000,
			speed: 300,
			slidesToShow: 5,
			slidesToScroll: 5,
			prevArrow: \'<i class="icon-left-open-big"></i>\',
			nextArrow: \'<i class="icon-right-open-big"></i>\',
			responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 5,
        slidesToScroll: 5,
      }
    },
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    }
  ]
		});
	});
</script>';

		echo '<div class="'.$args['widget_id'].' wslide">';
} else {
	echo '<div class="row row-cols-5 mobscroll">';
}
		$args['post_type'] 	= 'product';
		$args['orderby'] = 'meta_value_num';
		$args['meta_key'] = 'total_sales';
		$args['posts_per_page'] = $instance['urunsayisi'];
		$args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => $instance['kategori'], 'field' => 'slug'));

		$loop = new WP_Query( $args );
		if ( $loop->have_posts() ) {
			while ( $loop->have_posts() ) : $loop->the_post();
				get_template_part('/parts/wc/type2');
			endwhile;
		} else {
			echo __( 'Gösterilecek ürün bulunamadı','temavadisi' );
		}
		wp_reset_postdata();
	echo '</div></div>';
}
?>gunun-firsatlari-template.php000064400000004156151551563440012377 0ustar00<?php 
if(wp_is_mobile() && $instance['mobilgizle']) { 

} else {
	echo '<div class="gunun-firsatlari">';
	$tumulink2 = get_term_by('slug', $instance['kategori'], 'product_cat');
	$tumulink = get_category_link($tumulink2->term_id);
	
	if($instance['baslik']) {
		echo '<div class="wbaslik d-flex w-100">';
		echo '<div class="wh2">'.$instance['baslik'].'</div>';
		echo '<div class="wl"><a href="'.$tumulink.'">'.__('Tümü','temavadisi').'<i class="icon-right-open-big"></i></a></div>';
		echo '</div>';
	}

if($instance['slide']) {
echo '<script>
	$(document).ready(function(){
		$(".'.$args['widget_id'].'.wslide").slick({
			dots: false,
			infinite: true,
			autoplay: true,
			autoplaySpeed: 5000,
			speed: 300,
			slidesToShow: 4,
			slidesToScroll: 4,
			prevArrow: \'<i class="icon-left-open-big"></i>\',
			nextArrow: \'<i class="icon-right-open-big"></i>\',
			responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 4,
        slidesToScroll: 4,
      }
    },
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1,
		arrows:false
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1,
		arrows:false
      }
    }
  ]
		});
	});
</script>';

		echo '<div class="'.$args['widget_id'].' wslide">';
} else {
	echo '<div class="row">';
}
		$args['post_type'] 	= 'product';
		$args['orderby'] = 'date';
		$args['order'] = 'desc';
		$args['posts_per_page'] = $instance['urunsayisi'];
		$args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => $instance['kategori'], 'field' => 'slug'));

		$loop = new WP_Query( $args );
		if ( $loop->have_posts() ) {
			while ( $loop->have_posts() ) : $loop->the_post();
				get_template_part('/parts/wc/type1');
			endwhile;
		} else {
			echo __( 'Gösterilecek ürün bulunamadı','temavadisi' );
		}
		wp_reset_postdata();
	echo '</div></div>';
}
?>yeni-eklenenler-template.php000064400000003414151553002610012154 0ustar00<?php 
if(wp_is_mobile() && $instance['mobilgizle']) { 

} else {
	echo '<div class="yeni-eklenenler">';
	
	if($instance['baslik']) {
		echo '<div class="wbaslik d-flex w-100">';
		echo '<div class="wh2">'.$instance['baslik'].'</div>';
		echo '</div>';
	}

if($instance['slide']) {
echo '<script>
	$(document).ready(function(){
		$(".'.$args['widget_id'].'.wslide").slick({
			dots: false,
			infinite: true,
			autoplay: true,
			autoplaySpeed: 5000,
			speed: 300,
			slidesToShow: 5,
			slidesToScroll: 5,
			prevArrow: \'<i class="icon-left-open-big"></i>\',
			nextArrow: \'<i class="icon-right-open-big"></i>\',
			responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 5,
        slidesToScroll: 5,
      }
    },
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    }
  ]
		});
	});
</script>';

		echo '<div class="'.$args['widget_id'].' wslide">';
} else {
	echo '<div class="row row-cols-5 mobscroll">';
}
		$args['post_type'] 	= 'product';
		$args['orderby'] = 'date';
		$args['order'] = 'desc';
		$args['posts_per_page'] = $instance['urunsayisi'];

		$loop = new WP_Query( $args );
		if ( $loop->have_posts() ) {
			while ( $loop->have_posts() ) : $loop->the_post();
				get_template_part('/parts/wc/type2');
			endwhile;
		} else {
			echo __( 'Gösterilecek ürün bulunamadı','temavadisi' );
		}
		wp_reset_postdata();
	echo '</div></div>';
}
?>onerilen-urunler-template.php000064400000004372151553077250012413 0ustar00<?php 
if(wp_is_mobile() && $instance['mobilgizle']) { 

} else {
	echo '<div class="onerilen-urunler">';
	$tumulink2 = get_term_by('slug', $instance['kategori'], 'product_cat');
	$tumulink = get_category_link($tumulink2->term_id);
	
	if($instance['baslik']) {
		echo '<div class="wbaslik d-flex w-100">';
		echo '<div class="wh2">'.$instance['baslik'].'</div>';
		echo '<div class="wl"><a href="'.$tumulink.'">'.__('Tümü','temavadisi').'<i class="icon-right-open-big"></i></a></div>';
		echo '</div>';
	}

if($instance['slide']) {
echo '<script>
	$(document).ready(function(){
		$(".'.$args['widget_id'].'.wslide").slick({
			dots: false,
			infinite: true,
			autoplay: true,
			autoplaySpeed: 5000,
			speed: 300,
			slidesToShow: 5,
			slidesToScroll: 5,
			prevArrow: \'<i class="icon-left-open-big"></i>\',
			nextArrow: \'<i class="icon-right-open-big"></i>\',
			responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 5,
        slidesToScroll: 5,
      }
    },
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    }
  ]
		});
	});
</script>';

		echo '<div class="'.$args['widget_id'].' wslide">';
} else {
	echo '<div class="row row-cols-5 mobscroll">';
}
		$args['post_type'] 	= 'product';
		$args['orderby'] = 'date';
		$args['order'] = 'desc';
		$args['posts_per_page'] = $instance['urunsayisi'];
		$args['tax_query'] = array(
			array('taxonomy' => 'product_cat', 'terms' => $instance['kategori'], 'field' => 'slug'),
			array('taxonomy' => 'product_visibility', 'terms' => 'featured', 'field' => 'name', 'operator' => 'IN'),
		);

		$loop = new WP_Query( $args );
		if ( $loop->have_posts() ) {
			while ( $loop->have_posts() ) : $loop->the_post();
				get_template_part('/parts/wc/type2');
			endwhile;
		} else {
			echo __( 'Gösterilecek ürün bulunamadı','temavadisi' );
		}
		wp_reset_postdata();
	echo '</div></div>';
}
?>resimurl-template.php000064400000003336151553636000010741 0ustar00<?php 
if(wp_is_mobile() && $instance['mobilgizle']) { 

} else {
	if($instance['baslik']) {
		echo '<div class="wbaslik d-flex w-100">';
		echo '<div class="wh2">'.$instance['baslik'].'</div>';
		echo '</div>';
	}
if($instance['slide']) {
echo '<script>
	$(document).ready(function(){
		$(".'.$args['widget_id'].'.wslide").slick({
			dots: false,
			infinite: true,
			autoplay: true,
			autoplaySpeed: 5000,
			speed: 300,
			slidesToShow: '.$instance['slidesayisi'].',
			slidesToScroll: '.$instance['slidesayisi'].',
			prevArrow: \'<i class="icon-left-open-big"></i>\',
			nextArrow: \'<i class="icon-right-open-big"></i>\',
			responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: '.$instance['slidesayisi'].',
        slidesToScroll: '.$instance['slidesayisi'].',
      }
    },
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1,
		arrows:false
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1,
		arrows:false
      }
    }
  ]
		});
	});
</script>';

		echo '<div class="'.$args['widget_id'].' wslide">';
} else {
	echo '<div class="row mobscroll">';
}
foreach($instance['resimler'] as $resim) {
	echo '<div class="resimurl col">';
		echo '<a href="'.$resim['url'].'">';
		echo '<div class="bresim">'.wp_get_attachment_image($resim['resim'], 'full').'</div>';
	if($resim['altbaslik']) {
		echo '<div class="bbaslik">'.$resim['altbaslik'].'</div>';
	}
		echo '</a>';
	echo '</div>';
}
echo '</div>';
} 
?>magaza-kategorileri-template.php000064400000004150151553646030013015 0ustar00<?php 
if(wp_is_mobile() && $instance['mobilgizle']) { 

} else {
	echo '<div class="magaza-kategorileri">';

	if($instance['baslik']) {
		echo '<div class="wbaslik d-flex w-100">';
		echo '<div class="wh2">'.$instance['baslik'].'</div>';
		echo '</div>';
	}

if($instance['slide']) {
echo '<script>
	$(document).ready(function(){
		$(".'.$args['widget_id'].'.wslide").slick({
			dots: false,
			speed: 300,
			slidesToShow: 5,
			slidesToScroll: 1,
			prevArrow: \'<i class="icon-left-open-big"></i>\',
			nextArrow: \'<i class="icon-right-open-big"></i>\',
			responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 5,
        slidesToScroll: 1,
      }
    },
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    }
  ]
		});
	});
</script>';

		echo '<div class="'.$args['widget_id'].' wslide">';
} else {
	echo '<div class="row row-cols-5 mobscroll">';
}
	foreach($instance['kategoriler'] as $kategori) {
		$kat_term = get_term_by('slug', $kategori['kategori'], 'product_cat');
		$kat_link = get_category_link($kat_term->term_id);
	echo '<div class="col- col-6 col-sm-4 col-md-4 col-lg-4 col-x5 px-0">';
		echo '<a href="'.$kat_link.'" class="d-flex flex-column justify-content-start align-items-center px-2 py-4 h-100" style="text-align:center;background-color:'.hex_rgba($kategori['backcolor'],0.7).'">';
			echo '<div class="kat-title" style="background-color:'.$kategori['backcolor'].'">'.$kategori['baslik'].'</div>';
			echo '<div class="kat-image h-100 d-flex flex-column justify-content-center align-items-center">'.wp_get_attachment_image($kategori['resim'], 'img208').'</div>';
			echo '<div class="kat-desc">'.$kategori['aciklama'].'</div>';
		echo '</a>';
	echo '</div>';
	}
	echo '</div></div>';
}
?>kategori-urunleri-template.php000064400000004172151554121170012544 0ustar00<?php 
if(wp_is_mobile() && $instance['mobilgizle']) { 

} else {
	echo '<div class="kategori-urunleri">';
	$tumulink2 = get_term_by('slug', $instance['kategori'], 'product_cat');
	$tumulink = get_category_link($tumulink2->term_id);
	
	if($instance['baslik']) {
		echo '<div class="wbaslik d-flex w-100">';
		echo '<div class="wh2">'.$instance['baslik'].'</div>';
		echo '<div class="wl"><a href="'.$tumulink.'">'.__('Tümü','temavadisi').'<i class="icon-right-open-big"></i></a></div>';
		echo '</div>';
	}

if($instance['slide']) {
echo '<script>
	$(document).ready(function(){
		$(".'.$args['widget_id'].'.wslide").slick({
			dots: false,
			infinite: true,
			autoplay: true,
			autoplaySpeed: 5000,
			speed: 300,
			slidesToShow: 5,
			slidesToScroll: 5,
			prevArrow: \'<i class="icon-left-open-big"></i>\',
			nextArrow: \'<i class="icon-right-open-big"></i>\',
			responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 5,
        slidesToScroll: 5,
      }
    },
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2,
		arrows:false
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1,
		arrows:false
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1,
		arrows:false
      }
    }
  ]
		});
	});
</script>';

		echo '<div class="'.$args['widget_id'].' wslide">';
} else {
	echo '<div class="row row-cols-5">';
}
		$args['post_type'] 	= 'product';
		$args['orderby'] = 'date';
		$args['order'] = 'desc';
		$args['posts_per_page'] = $instance['urunsayisi'];
		$args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => $instance['kategori'], 'field' => 'slug'));

		$loop = new WP_Query( $args );
		if ( $loop->have_posts() ) {
			while ( $loop->have_posts() ) : $loop->the_post();
				get_template_part('/parts/wc/type2');
			endwhile;
		} else {
			echo __( 'Gösterilecek ürün bulunamadı','temavadisi' );
		}
		wp_reset_postdata();
	echo '</div></div>';
}
?>action-btn.php000064400000000627151554152570007332 0ustar00<span
	class="siteorigin-installer-button siteorigin-installer"
	data-type="<?php echo esc_attr( $item['type'] ); ?>"
	data-slug="<?php echo esc_attr( $slug ); ?>"
	data-status="<?php echo esc_attr( $item['status'] ); ?>"
	data-version="<?php echo esc_attr( $item['version'] ); ?>"
	<?php if ( empty( $item['status'] ) ) { ?>
		style="display: none;"
	<?php } ?>
>
	<?php echo esc_html( $text ); ?>
</span>