| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) |
| 3 |
exit; |
| 4 |
|
| 5 |
// JS and CSS exclusions |
| 6 |
$exclude_urls = get_option('berq_exclude_js_css', []); |
| 7 |
$url_lines = implode("\n", $exclude_urls); |
| 8 |
|
| 9 |
?> |
| 10 |
<div id="script-manager" style="display:none"> |
| 11 |
<h2 class="berq-tab-title"> |
| 12 |
<?php esc_html_e('Script Manager', 'searchpro'); ?> |
| 13 |
</h2> |
| 14 |
<?php if ($this->is_key_verified) { ?> |
| 15 |
<div class="berq-info-box"> |
| 16 |
<h3 class="berq-box-title"> |
| 17 |
<?php esc_html_e('Exclude JS & CSS', 'searchpro'); ?> |
| 18 |
</h3> |
| 19 |
<div class="berq-box-content"> |
| 20 |
<p> |
| 21 |
<?php esc_html_e('Enter external JavaScript & CSS file URLs to exclude from optimization, one URL per line. Add relative URLs or filenames with no query parameters, like /wp-includes/js/jquery/jquery.min.js', 'searchpro'); ?> |
| 22 |
</p> |
| 23 |
<textarea name="berq_exclude_js_css" cols="30" rows="10"><?php echo esc_textarea($url_lines); ?></textarea> |
| 24 |
</div> |
| 25 |
</div> |
| 26 |
<?php } ?> |
| 27 |
<div class="berq-info-box"> |
| 28 |
<h3 class="berq-box-title"> |
| 29 |
<?php esc_html_e('Preload font faces', 'searchpro'); ?> |
| 30 |
</h3> |
| 31 |
<div class="berq-box-content"> |
| 32 |
<p> |
| 33 |
<?php esc_html_e('Preload font faces along with the critical CSS upon the initial page load.', 'searchpro'); ?> |
| 34 |
</p> |
| 35 |
<label class="berq-check"> |
| 36 |
<input type="checkbox" name="berqwp_preload_fontfaces" <?php checked(1, get_option('berqwp_preload_fontfaces'), true); ?>> |
| 37 |
<?php esc_html_e('Enable preload font faces', 'searchpro'); ?> |
| 38 |
</label> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
<div class="berq-info-box"> |
| 42 |
<h3 class="berq-box-title"> |
| 43 |
<?php esc_html_e('Disable emojis', 'searchpro'); ?> |
| 44 |
</h3> |
| 45 |
<div class="berq-box-content"> |
| 46 |
<p> |
| 47 |
<?php esc_html_e('The WordPress emoji script loads on all pages, which can slow down the loading speed. |
| 48 |
If |
| 49 |
your website doesn\'t use emojis, it would be better to disable them.', 'searchpro'); ?> |
| 50 |
</p> |
| 51 |
<label class="berq-check"> |
| 52 |
<input type="checkbox" name="berqwp_disable_emojis" <?php checked(1, get_option('berqwp_disable_emojis'), true); ?>> |
| 53 |
<?php esc_html_e('Disable WordPress emojis', 'searchpro'); ?> |
| 54 |
</label> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
<div class="berq-info-box"> |
| 58 |
<h3 class="berq-box-title"> |
| 59 |
<?php esc_html_e('LazyLoad YouTube embeds', 'searchpro'); ?> |
| 60 |
</h3> |
| 61 |
<div class="berq-box-content"> |
| 62 |
<label class="berq-check"> |
| 63 |
<input type="checkbox" name="berqwp_lazyload_youtube_embed" <?php checked(1, get_option('berqwp_lazyload_youtube_embed'), true); ?>> |
| 64 |
<?php esc_html_e('Enable lazyload for YouTube videos', 'searchpro'); ?> |
| 65 |
</label> |
| 66 |
</div> |
| 67 |
</div> |
| 68 |
|
| 69 |
<?php if ($this->is_key_verified) { ?> |
| 70 |
<div class="berq-info-box"> |
| 71 |
<h3 class="berq-box-title"> |
| 72 |
<?php esc_html_e('JavaScript execution mode', 'searchpro'); ?> |
| 73 |
</h3> |
| 74 |
<div class="berq-box-content"> |
| 75 |
<p> |
| 76 |
<?php esc_html_e('BerqWP offers three JavaScript optimization modes, so every JavaScript-heavy website can unlock its true potential.', 'searchpro'); ?> |
| 77 |
</p> |
| 78 |
<label class="berq-check"> |
| 79 |
<input type="radio" name="berqwp_javascript_execution_mode" value="1" <?php echo get_option('berqwp_javascript_execution_mode') == 1 ? 'checked' : ''; ?>> |
| 80 |
<?php esc_html_e('Delay & inline first execution (Recommended)', 'searchpro'); ?> |
| 81 |
</label> |
| 82 |
<label class="berq-check"> |
| 83 |
<input type="radio" name="berqwp_javascript_execution_mode" value="0" <?php echo get_option('berqwp_javascript_execution_mode') == 0 ? 'checked' : ''; ?>> |
| 84 |
<?php esc_html_e('Sequential execution', 'searchpro'); ?> |
| 85 |
</label> |
| 86 |
<label class="berq-check"> |
| 87 |
<input type="radio" name="berqwp_javascript_execution_mode" value="2" <?php echo get_option('berqwp_javascript_execution_mode') == 2 ? 'checked' : ''; ?>> |
| 88 |
<?php esc_html_e('Defer JavaScript (Safe)', 'searchpro'); ?> |
| 89 |
</label> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
<?php } ?> |
| 93 |
|
| 94 |
<?php if ($this->is_key_verified) { ?> |
| 95 |
<div class="berq-info-box"> |
| 96 |
<h3 class="berq-box-title"> |
| 97 |
<?php esc_html_e('Trigger Interaction', 'searchpro'); ?> |
| 98 |
</h3> |
| 99 |
<div class="berq-box-content"> |
| 100 |
<p> |
| 101 |
<?php esc_html_e('Trigger an interaction after the page has been loaded. The default is empty.', 'searchpro'); ?> |
| 102 |
</p> |
| 103 |
<table class="berq-image-settings"> |
| 104 |
<tr> |
| 105 |
<td> |
| 106 |
<p> |
| 107 |
<?php esc_html_e('Trigger after:', 'searchpro'); ?> |
| 108 |
</p> |
| 109 |
</td> |
| 110 |
<td><input type="number" min="0" name="berqwp_interaction_delay" |
| 111 |
value="<?php echo esc_attr(get_option('berqwp_interaction_delay')); ?>" style="width:60px"> |
| 112 |
ms</td> |
| 113 |
</tr> |
| 114 |
</table> |
| 115 |
</div> |
| 116 |
</div> |
| 117 |
<?php } ?> |
| 118 |
<button type="submit" class="berqwp-save"><svg width="20" height="20" viewBox="0 0 20 20" fill="none" |
| 119 |
xmlns="http://www.w3.org/2000/svg"> |
| 120 |
<path d="M4.16663 10.8333L7.49996 14.1667L15.8333 5.83334" stroke="white" stroke-width="2" |
| 121 |
stroke-linecap="round" stroke-linejoin="round" /> |
| 122 |
</svg> |
| 123 |
<?php esc_html_e('Save changes', 'searchpro'); ?> |
| 124 |
</button> |
| 125 |
</div> |