| 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" <?php bwp_is_tab('script-manager'); ?>> |
| 11 |
<h2 class="berq-tab-title"> |
| 12 |
<?php esc_html_e('Script Manager', 'searchpro'); ?> |
| 13 |
</h2> |
| 14 |
<div class="berq-info-box"> |
| 15 |
<h3 class="berq-box-title"> |
| 16 |
<?php esc_html_e('CSS Optimization', 'searchpro'); ?> |
| 17 |
</h3> |
| 18 |
<div class="berq-box-content"> |
| 19 |
<p> |
| 20 |
<?php esc_html_e("Choose how CSS files should load to improve page performance. Select one of the following options:", 'searchpro'); ?> |
| 21 |
</p> |
| 22 |
<select name="berq_css_optimization"> |
| 23 |
<option <?php selected( get_option('berq_css_optimization'), 'auto' ); ?> value="auto"><?php esc_html_e('Auto (According to optimization mode setting)', 'searchpro'); ?></option> |
| 24 |
<option <?php selected( get_option('berq_css_optimization'), 'asynchronous' ); ?> value="asynchronous"><?php esc_html_e('Asynchronous', 'searchpro'); ?></option> |
| 25 |
<option <?php selected( get_option('berq_css_optimization'), 'delay' ); ?> value="delay"><?php esc_html_e('Delay', 'searchpro'); ?></option> |
| 26 |
<option <?php selected( get_option('berq_css_optimization'), 'disable' ); ?> value="disable"><?php esc_html_e('Disable', 'searchpro'); ?></option> |
| 27 |
</select> |
| 28 |
</div> |
| 29 |
</div> |
| 30 |
<div class="berq-info-box"> |
| 31 |
<h3 class="berq-box-title"> |
| 32 |
<?php esc_html_e('JavaScript Optimization', 'searchpro'); ?> |
| 33 |
</h3> |
| 34 |
<div class="berq-box-content"> |
| 35 |
<p> |
| 36 |
<?php esc_html_e("Choose how JavaScript files should load to improve page performance. Select one of the following options:", 'searchpro'); ?> |
| 37 |
</p> |
| 38 |
<select name="berq_js_optimization"> |
| 39 |
<option <?php selected( get_option('berq_js_optimization'), 'auto' ); ?> value="auto"><?php esc_html_e('Auto (According to optimization mode setting)', 'searchpro'); ?></option> |
| 40 |
<option <?php selected( get_option('berq_js_optimization'), 'asynchronous' ); ?> value="asynchronous"><?php esc_html_e('Asynchronous', 'searchpro'); ?></option> |
| 41 |
<option <?php selected( get_option('berq_js_optimization'), 'delay' ); ?> value="delay"><?php esc_html_e('Delay', 'searchpro'); ?></option> |
| 42 |
<option <?php selected( get_option('berq_js_optimization'), 'disable' ); ?> value="disable"><?php esc_html_e('Disable', 'searchpro'); ?></option> |
| 43 |
</select> |
| 44 |
</div> |
| 45 |
</div> |
| 46 |
|
| 47 |
<div class="berq-info-box"> |
| 48 |
<h3 class="berq-box-title"> |
| 49 |
<?php esc_html_e('JavaScript Execution Mode', 'searchpro'); ?> |
| 50 |
</h3> |
| 51 |
<div class="berq-box-content"> |
| 52 |
<p> |
| 53 |
<?php printf( /* translators: %s: Plugin name */ esc_html__('%s offers different JavaScript optimization modes, so every JavaScript-heavy website can unlock its true potential.', 'searchpro'), esc_html($plugin_name) ); ?> |
| 54 |
</p> |
| 55 |
<label class="berq-check"> |
| 56 |
<input type="radio" name="berqwp_javascript_execution_mode" value="4" <?php echo get_option('berqwp_javascript_execution_mode') == 4 ? 'checked' : ''; ?>> |
| 57 |
<?php esc_html_e('Flora - High Compatibility (Default)', 'searchpro'); ?> |
| 58 |
</label> |
| 59 |
<label class="berq-check"> |
| 60 |
<input type="radio" name="berqwp_javascript_execution_mode" value="1" <?php echo get_option('berqwp_javascript_execution_mode') == 1 ? 'checked' : ''; ?>> |
| 61 |
<?php esc_html_e('Sequential Blocking Execution - High Compatibility', 'searchpro'); ?> |
| 62 |
</label> |
| 63 |
<label class="berq-check"> |
| 64 |
<input type="radio" name="berqwp_javascript_execution_mode" value="3" <?php echo get_option('berqwp_javascript_execution_mode') == 3 ? 'checked' : ''; ?>> |
| 65 |
<?php esc_html_e('Parallel Execution - High Compatibility', 'searchpro'); ?> |
| 66 |
</label> |
| 67 |
<label class="berq-check"> |
| 68 |
<input type="radio" name="berqwp_javascript_execution_mode" value="0" <?php echo get_option('berqwp_javascript_execution_mode') == 0 ? 'checked' : ''; ?>> |
| 69 |
<?php esc_html_e('Sequential Execution', 'searchpro'); ?> |
| 70 |
</label> |
| 71 |
</div> |
| 72 |
</div> |
| 73 |
|
| 74 |
<div class="berq-info-box"> |
| 75 |
<h3 class="berq-box-title"> |
| 76 |
<?php esc_html_e('Exclude JS & CSS', 'searchpro'); ?> |
| 77 |
</h3> |
| 78 |
<div class="berq-box-content"> |
| 79 |
<p> |
| 80 |
<?php esc_html_e('Enter URLs, filenames, or keywords from <script> or <link> tags to exclude from optimization, one per line. Example: /wp-includes/js/jquery/jquery.min.js or google-analytics.', 'searchpro'); ?> |
| 81 |
</p> |
| 82 |
<textarea name="berq_exclude_js_css" cols="30" rows="10"><?php echo esc_textarea($url_lines); ?></textarea> |
| 83 |
</div> |
| 84 |
</div> |
| 85 |
|
| 86 |
<div class="berq-info-box"> |
| 87 |
<h3 class="berq-box-title"> |
| 88 |
<?php esc_html_e('Preload Font Faces', 'searchpro'); ?> |
| 89 |
</h3> |
| 90 |
<div class="berq-box-content"> |
| 91 |
<p> |
| 92 |
<?php esc_html_e('Preload font faces along with the critical CSS upon the initial page load.', 'searchpro'); ?> |
| 93 |
</p> |
| 94 |
<label class="berq-check"> |
| 95 |
<input type="checkbox" name="berqwp_preload_fontfaces" <?php checked(1, get_option('berqwp_preload_fontfaces'), true); ?>> |
| 96 |
<?php esc_html_e('Enable preload font faces', 'searchpro'); ?> |
| 97 |
</label> |
| 98 |
</div> |
| 99 |
</div> |
| 100 |
<div class="berq-info-box"> |
| 101 |
<h3 class="berq-box-title"> |
| 102 |
<?php esc_html_e('Preload Cookie Banner', 'searchpro'); ?> |
| 103 |
</h3> |
| 104 |
<div class="berq-box-content"> |
| 105 |
<p> |
| 106 |
<?php esc_html_e('Preload the cookie banner on the initial page load, may sometimes cause a drop in the PageSpeed score. Currently supports Complianz, CookieYes, Real Cookie Banner, CYTRIO, GetTerms and My Agile Privacy.', 'searchpro'); ?> |
| 107 |
</p> |
| 108 |
<label class="berq-check"> |
| 109 |
<input type="checkbox" name="berqwp_preload_cookiebanner" <?php checked(1, get_option('berqwp_preload_cookiebanner'), true); ?>> |
| 110 |
<?php esc_html_e('Enable preload for cookie banner', 'searchpro'); ?> |
| 111 |
</label> |
| 112 |
</div> |
| 113 |
</div> |
| 114 |
<div class="berq-info-box"> |
| 115 |
<h3 class="berq-box-title"> |
| 116 |
<?php esc_html_e('Disable Emojis', 'searchpro'); ?> |
| 117 |
</h3> |
| 118 |
<div class="berq-box-content"> |
| 119 |
<p> |
| 120 |
<?php esc_html_e('The WordPress emoji script loads on all pages, which can slow down the loading speed. |
| 121 |
If |
| 122 |
your website doesn\'t use emojis, it would be better to disable them.', 'searchpro'); ?> |
| 123 |
</p> |
| 124 |
<label class="berq-check"> |
| 125 |
<input type="checkbox" name="berqwp_disable_emojis" <?php checked(1, get_option('berqwp_disable_emojis'), true); ?>> |
| 126 |
<?php esc_html_e('Disable WordPress emojis', 'searchpro'); ?> |
| 127 |
</label> |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
<div class="berq-info-box"> |
| 131 |
<h3 class="berq-box-title"> |
| 132 |
<?php esc_html_e('Lazy Load YouTube Embeds', 'searchpro'); ?> |
| 133 |
</h3> |
| 134 |
<div class="berq-box-content"> |
| 135 |
<label class="berq-check"> |
| 136 |
<input type="checkbox" name="berqwp_lazyload_youtube_embed" <?php checked(1, get_option('berqwp_lazyload_youtube_embed'), true); ?>> |
| 137 |
<?php esc_html_e('Enable lazy load for YouTube videos', 'searchpro'); ?> |
| 138 |
</label> |
| 139 |
<label class="berq-check" style="<?php echo get_option('berqwp_lazyload_youtube_embed') ? '' : 'display:none;'; ?>"> |
| 140 |
<input type="checkbox" name="berqwp_preload_yt_poster" <?php checked(1, get_option('berqwp_preload_yt_poster'), true); ?>> |
| 141 |
<?php esc_html_e('Preload video poster', 'searchpro'); ?> |
| 142 |
</label> |
| 143 |
</div> |
| 144 |
</div> |
| 145 |
|
| 146 |
<div class="berq-info-box"> |
| 147 |
<h3 class="berq-box-title"> |
| 148 |
<?php esc_html_e('Trigger Interaction', 'searchpro'); ?> |
| 149 |
</h3> |
| 150 |
<div class="berq-box-content"> |
| 151 |
<p> |
| 152 |
<?php esc_html_e('Trigger an interaction after the page has been loaded. The default is empty.', 'searchpro'); ?> |
| 153 |
</p> |
| 154 |
<table class="berq-image-settings"> |
| 155 |
<tr> |
| 156 |
<td> |
| 157 |
<p> |
| 158 |
<?php esc_html_e('Trigger after:', 'searchpro'); ?> |
| 159 |
</p> |
| 160 |
</td> |
| 161 |
<td><input type="number" min="0" name="berqwp_interaction_delay" |
| 162 |
value="<?php echo esc_attr(get_option('berqwp_interaction_delay')); ?>" style="width:60px"> |
| 163 |
ms</td> |
| 164 |
</tr> |
| 165 |
</table> |
| 166 |
</div> |
| 167 |
</div> |
| 168 |
|
| 169 |
<button type="submit" class="berqwp-save"><svg width="20" height="20" viewBox="0 0 20 20" fill="none" |
| 170 |
xmlns="http://www.w3.org/2000/svg"> |
| 171 |
<path d="M4.16663 10.8333L7.49996 14.1667L15.8333 5.83334" stroke="white" stroke-width="2" |
| 172 |
stroke-linecap="round" stroke-linejoin="round" /> |
| 173 |
</svg> |
| 174 |
<?php esc_html_e('Save changes', 'searchpro'); ?> |
| 175 |
</button> |
| 176 |
</div> |