| @@ -6,31 +6,90 @@ | ||
| 6 | 6 | $exclude_urls = get_option('berq_exclude_js_css', []); |
| 7 | 7 | $url_lines = implode("\n", $exclude_urls); |
| 8 | 8 | |
| 9 | 9 | ?> |
| 10 | -<div id="script-manager" style="display:none"> | |
| 10 | +<div id="script-manager" <?php bwp_is_tab('script-manager'); ?>> | |
| 11 | 11 | <h2 class="berq-tab-title"> |
| 12 | 12 | <?php esc_html_e('Script Manager', 'searchpro'); ?> |
| 13 | 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> | |
| 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> | |
| 25 | 28 | </div> |
| 26 | - <?php } ?> | |
| 29 | + </div> | |
| 27 | 30 | <div class="berq-info-box"> |
| 28 | 31 | <h3 class="berq-box-title"> |
| 29 | - <?php esc_html_e('Preload font faces', 'searchpro'); ?> | |
| 32 | + <?php esc_html_e('JavaScript Optimization', 'searchpro'); ?> | |
| 30 | 33 | </h3> |
| 31 | 34 | <div class="berq-box-content"> |
| 32 | 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> | |
| 33 | 92 | <?php esc_html_e('Preload font faces along with the critical CSS upon the initial page load.', 'searchpro'); ?> |
| 34 | 93 | </p> |
| 35 | 94 | <label class="berq-check"> |
| 36 | 95 | <input type="checkbox" name="berqwp_preload_fontfaces" <?php checked(1, get_option('berqwp_preload_fontfaces'), true); ?>> |
| @@ -39,12 +98,26 @@ | ||
| 39 | 98 | </div> |
| 40 | 99 | </div> |
| 41 | 100 | <div class="berq-info-box"> |
| 42 | 101 | <h3 class="berq-box-title"> |
| 43 | - <?php esc_html_e('Disable emojis', 'searchpro'); ?> | |
| 102 | + <?php esc_html_e('Preload Cookie Banner', 'searchpro'); ?> | |
| 44 | 103 | </h3> |
| 45 | 104 | <div class="berq-box-content"> |
| 46 | 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> | |
| 47 | 120 | <?php esc_html_e('The WordPress emoji script loads on all pages, which can slow down the loading speed. |
| 48 | 121 | If |
| 49 | 122 | your website doesn\'t use emojis, it would be better to disable them.', 'searchpro'); ?> |
| 50 | 123 | </p> |
| @@ -55,67 +128,45 @@ | ||
| 55 | 128 | </div> |
| 56 | 129 | </div> |
| 57 | 130 | <div class="berq-info-box"> |
| 58 | 131 | <h3 class="berq-box-title"> |
| 59 | - <?php esc_html_e('LazyLoad YouTube embeds', 'searchpro'); ?> | |
| 132 | + <?php esc_html_e('Lazy Load YouTube Embeds', 'searchpro'); ?> | |
| 60 | 133 | </h3> |
| 61 | 134 | <div class="berq-box-content"> |
| 62 | 135 | <label class="berq-check"> |
| 63 | 136 | <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'); ?> | |
| 137 | + <?php esc_html_e('Enable lazy load for YouTube videos', 'searchpro'); ?> | |
| 65 | 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> | |
| 66 | 143 | </div> |
| 67 | 144 | </div> |
| 68 | 145 | |
| 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> | |
| 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> | |
| 91 | 166 | </div> |
| 92 | - <?php } ?> | |
| 167 | + </div> | |
| 93 | 168 | |
| 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 | 169 | <button type="submit" class="berqwp-save"><svg width="20" height="20" viewBox="0 0 20 20" fill="none" |
| 119 | 170 | xmlns="http://www.w3.org/2000/svg"> |
| 120 | 171 | <path d="M4.16663 10.8333L7.49996 14.1667L15.8333 5.83334" stroke="white" stroke-width="2" |
| 121 | 172 | stroke-linecap="round" stroke-linejoin="round" /> |