Changeset 2699794
- Timestamp:
- 03/25/2022 09:41:32 PM (4 years ago)
- Location:
- better-speed/trunk
- Files:
-
- 1 added
- 1 edited
-
better-speed.php (modified) (6 diffs)
-
images/flyingpress.svg (added)
Legend:
- Unmodified
- Added
- Removed
-
better-speed/trunk/better-speed.php
r2675058 r2699794 3 3 Plugin Name: Why So Slow? 4 4 Description: Improve the loading speed of your website by removing bloat and unused features <em>(formerly named <strong>Better Speed</strong>)</em> 5 Version: 2. 05 Version: 2.1 6 6 Author: Why So Slow? 7 7 Author URI: https://whysoslow.co.uk … … 311 311 } 312 312 } 313 314 //jQuery passive event listeners 315 if(better_speed_check_other_setting('others-passive')) { 316 wp_add_inline_script('jquery', 'jQuery.event.special.touchstart={setup:function(e,t,s){this.addEventListener("touchstart",s,{passive:!t.includes("noPreventDefault")})}},jQuery.event.special.touchmove={setup:function(e,t,s){this.addEventListener("touchmove",s,{passive:!t.includes("noPreventDefault")})}},jQuery.event.special.wheel={setup:function(e,t,s){this.addEventListener("wheel",s,{passive:!0})}},jQuery.event.special.mousewheel={setup:function(e,t,s){this.addEventListener("mousewheel",s,{passive:!0})}};', 'after'); 317 } 313 318 } 314 319 add_action('wp_enqueue_scripts', 'better_speed_wp_enqueue_scripts'); … … 397 402 398 403 add_settings_section('better-speed-section-others', __('Settings', 'whysoslow'), 'better_speed_section_others', 'better-speed-others'); 399 add_settings_field('better-speed-others-timings', __('Server Timings', 'whysoslow'), 'better_speed_others_timings', 'better-speed-others', 'better-speed-section-others'); 404 add_settings_field('better-speed-others-timings', __('Add Server Timings', 'whysoslow'), 'better_speed_others_timings', 'better-speed-others', 'better-speed-section-others'); 405 add_settings_field('better-speed-others-passive', __('Use Passive Listeners', 'whysoslow'), 'better_speed_others_passive', 'better-speed-others', 'better-speed-section-others'); 400 406 401 407 add_settings_section('better-speed-section-instant', __('Instant Page', 'whysoslow'), 'better_speed_section_instant', 'better-speed-instant'); … … 423 429 $whitelist_options['better-speed'][] = 'better-speed-features-revisions'; 424 430 $whitelist_options['better-speed'][] = 'better-speed-others-timings'; 431 $whitelist_options['better-speed'][] = 'better-speed-others-passive'; 425 432 $whitelist_options['better-speed'][] = 'better-speed-instant-page'; 426 433 $whitelist_options['better-speed'][] = 'better-speed-instant-intensity'; … … 558 565 echo ' </div>'; 559 566 echo ' <div id="better-speed-tabs-recommend">'; 560 echo ' <a class="better-speed-recommendation" href="https://wp-rocket.me/?ref=dfdb22ef" target="_blank">'; 567 echo ' <a class="better-speed-recommendation" href="https://flying-press.com/?campaign=betterspeed&ref=sifz" target="_blank">'; 568 echo ' <img src="' . plugins_url('images/flyingpress.svg', __FILE__) . '" width="172px" height="28px" align="left">'; 569 echo ' <h3><u>' . __('FlyingPress', 'whysoslow') . '</u> <small><em>(plugin)</em></small></h3>'; 570 echo ' <p>' . __('FlyingPress is a lightweight, easy to use and configurable speed optimization plugin for WordPress. Boost your websites' Core Web Vitals in a few clicks.', 'whysoslow') . '</p>'; 571 echo ' </a>'; 572 echo ' <br>'; 573 echo ' <a class="better-speed-recommendation" href="https://shareasale.com/r.cfm?b=1075949&u=2391583&m=74778" target="_blank">'; 561 574 echo ' <img src="' . plugins_url('images/wprocket.png', __FILE__) . '" width="172px" height="46px" align="left">'; 562 575 echo ' <h3><u>' . __('WP Rocket', 'whysoslow') . '</u> <small><em>(plugin)</em></small></h3>'; 563 576 echo ' <p>' . __('WP Rocket is the most powerful web performance plugin in the world. It will instantly reduce your load time and boost your Google PageSpeed and Core Web Vitals scores. No coding skills needed.', 'whysoslow') . '</p>'; 577 echo ' </a>'; 578 echo ' <br>'; 579 echo ' <a class="better-speed-recommendation" href="https://rocketcdn.me/?ref=betterspeed" target="_blank">'; 580 echo ' <img src="' . plugins_url('images/wprocket.png', __FILE__) . '" width="172px" height="46px" align="left">'; 581 echo ' <h3><u>' . __('RocketCDN', 'whysoslow') . '</u> <small><em>(CDN)</em></small></h3>'; 582 echo ' <p>' . __('RocketCDN is a custom Content Delivery Network created by the WP Rocket team. It provides fast content delivery anywhere in the world and reduces website loading time, making a website faster for visitors far away from where the server is located.', 'whysoslow') . '</p>'; 564 583 echo ' </a>'; 565 584 echo ' <br>'; … … 885 904 $checked = " checked"; 886 905 } 887 echo '<label><input id="better-speed-others-timings" name="better-speed-settings[better-speed-others-timings]" type="checkbox" value="YES"' . $checked . '> ' . __('Add <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing" target="_blank" rel="noopener">Server Timing</a> headers to aid debugging', 'whysoslow'); 906 echo '<label><input id="better-speed-others-timings" name="better-speed-settings[better-speed-others-timings]" type="checkbox" value="YES"' . $checked . '> ' . __('Add <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing" target="_blank" rel="noopener">Server Timing</a> headers - this won't speed things up but can aid debugging', 'whysoslow'); 907 } 908 909 //defined output for settings 910 function better_speed_others_passive() { 911 $checked = ""; 912 if(better_speed_check_other_setting('others-passive')) { 913 $checked = " checked"; 914 } 915 echo '<label><input id="better-speed-others-passive" name="better-speed-settings[better-speed-others-passive]" type="checkbox" value="YES"' . $checked . '> ' . __('Use <a href="https://web.dev/uses-passive-event-listeners/" target="_blank" rel="noopener">passive listeners</a> to improve scrolling performance', 'whysoslow'); 888 916 } 889 917
Note: See TracChangeset
for help on using the changeset viewer.