Version Description
Release Date: XX September 2021
- NEW: You can now disable Speed Booster Pack for certain user roles.
-
NEW: You can now add
<link rel="preload">
tags for featured images. - Improved: Advisor works better now!
Download this release
Release Info
Developer | optimocha |
Plugin | Speed Booster Pack |
Version | 4.3.2 |
Comparing to | |
See all releases |
Code changes from version 4.3.1 to 4.3.2
- README.txt +9 -1
- admin/class-speed-booster-pack-admin.php +215 -235
- admin/css/speed-booster-pack-admin.css +44 -4
- admin/js/speed-booster-pack-admin.js +17 -0
- includes/class-speed-booster-pack.php +1 -1
- includes/classes/class-sbp-abstract-module.php +17 -0
- includes/classes/class-sbp-advisor.php +63 -46
- includes/classes/class-sbp-cdn.php +12 -4
- includes/classes/class-sbp-critical-css.php +9 -1
- includes/classes/class-sbp-css-minifier.php +12 -3
- includes/classes/class-sbp-custom-code-manager.php +9 -1
- includes/classes/class-sbp-font-optimizer.php +17 -9
- includes/classes/class-sbp-html-minifier.php +9 -1
- includes/classes/class-sbp-image-dimensions.php +9 -1
- includes/classes/class-sbp-js-optimizer.php +9 -1
- includes/classes/class-sbp-lazy-loader.php +12 -4
- includes/classes/class-sbp-localize-tracker.php +10 -2
- includes/classes/class-sbp-preboost.php +27 -2
- includes/classes/class-sbp-special.php +11 -3
- includes/classes/class-sbp-tweaks.php +9 -1
- includes/sbp-helpers.php +0 -14
- speed-booster-pack.php +2 -2
- vendor/codestar-framework/composer/ClassLoader.php +0 -445
- vendor/codestar-framework/composer/LICENSE +0 -21
- vendor/codestar-framework/composer/autoload_classmap.php +0 -15
- vendor/codestar-framework/composer/autoload_namespaces.php +0 -9
- vendor/codestar-framework/composer/autoload_psr4.php +0 -9
- vendor/codestar-framework/composer/autoload_real.php +0 -55
- vendor/codestar-framework/composer/autoload_static.php +0 -25
- vendor/codestar-framework/composer/installed.json +0 -114
README.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: speed, pagespeed, optimization, core web vitals, cache
|
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.8
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 4.3.
|
9 |
License: GPLv3 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -104,6 +104,14 @@ All the time! We're always looking for new ways to get this plugin to a better s
|
|
104 |
|
105 |
== Changelog ==
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
= 4.3.1 =
|
108 |
|
109 |
*Release Date: 11 September 2021*
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.8
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 4.3.2
|
9 |
License: GPLv3 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
104 |
|
105 |
== Changelog ==
|
106 |
|
107 |
+
= 4.3.2 =
|
108 |
+
|
109 |
+
*Release Date: XX September 2021*
|
110 |
+
|
111 |
+
* **NEW**: You can now disable Speed Booster Pack for certain user roles.
|
112 |
+
* **NEW**: You can now add `<link rel="preload">` tags for featured images.
|
113 |
+
* **Improved**: Advisor works better now!
|
114 |
+
|
115 |
= 4.3.1 =
|
116 |
|
117 |
*Release Date: 11 September 2021*
|
admin/class-speed-booster-pack-admin.php
CHANGED
@@ -11,7 +11,6 @@
|
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
14 |
-
use SpeedBooster\SBP_Advisor;
|
15 |
use SpeedBooster\SBP_Notice_Manager;
|
16 |
|
17 |
if ( ! defined( 'WPINC' ) ) {
|
@@ -226,9 +225,6 @@ class Speed_Booster_Pack_Admin {
|
|
226 |
]
|
227 |
);
|
228 |
/* END Section: Dashboard */
|
229 |
-
|
230 |
-
$advisor = new SBP_Advisor();
|
231 |
-
$advisor_messages = $advisor->get_messages();
|
232 |
$advisor_fields = [
|
233 |
[
|
234 |
'id' => 'advisor_heading',
|
@@ -242,23 +238,10 @@ class Speed_Booster_Pack_Admin {
|
|
242 |
],
|
243 |
];
|
244 |
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
'type' => 'content',
|
250 |
-
'content' => '<div class="notice notice-' . $message['style'] . ' ' . $dismissible . ' sbp-advice" data-message-id="' . $message_id . '">
|
251 |
-
<p>' . $message['content'] . '</p>
|
252 |
-
</div>',
|
253 |
-
];
|
254 |
-
}
|
255 |
-
} else {
|
256 |
-
$advisor_fields[] = [
|
257 |
-
'type' => 'submessage',
|
258 |
-
'style' => 'success',
|
259 |
-
'content' => '<p>' . __( 'No recommendations for now.', 'speed-booster-pack' ) . '</p>',
|
260 |
-
];
|
261 |
-
}
|
262 |
|
263 |
/* BEGIN Section: Speed Advisor */
|
264 |
CSF::createSection(
|
@@ -273,6 +256,209 @@ class Speed_Booster_Pack_Admin {
|
|
273 |
);
|
274 |
/* END Section: Speed Advisor */
|
275 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
/* BEGIN Section: Caching */
|
277 |
$cache_fields = [
|
278 |
[
|
@@ -945,6 +1131,14 @@ class Speed_Booster_Pack_Admin {
|
|
945 |
'settings' => [ 'lineWrapping' => true ],
|
946 |
'sanitize' => 'sbp_sanitize_strip_tags',
|
947 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
948 |
],
|
949 |
'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
|
950 |
],
|
@@ -1091,220 +1285,6 @@ class Speed_Booster_Pack_Admin {
|
|
1091 |
);
|
1092 |
/* END Section: Special */
|
1093 |
|
1094 |
-
/* BEGIN Section: Tweaks */
|
1095 |
-
// $user_roles = [];
|
1096 |
-
// $editable_roles = sbp_get_editable_roles();
|
1097 |
-
//
|
1098 |
-
// if ( $editable_roles ) {
|
1099 |
-
// foreach ( $editable_roles as $role_key => $role ) {
|
1100 |
-
// $user_roles[ $role_key ] = $role['name'];
|
1101 |
-
// }
|
1102 |
-
// }
|
1103 |
-
|
1104 |
-
CSF::createSection(
|
1105 |
-
$prefix,
|
1106 |
-
[
|
1107 |
-
'title' => __( 'General', 'speed-booster-pack' ),
|
1108 |
-
'id' => 'tweaks',
|
1109 |
-
'icon' => 'fa fa-sliders-h',
|
1110 |
-
'fields' => [
|
1111 |
-
|
1112 |
-
|
1113 |
-
[
|
1114 |
-
/* translators: used like "Enable/Disable XXX" where "XXX" is the module name. */
|
1115 |
-
'title' => __( 'Enable/Disable', 'speed-booster-pack' ) . ' ' . __( 'General', 'speed-booster-pack' ),
|
1116 |
-
'id' => 'module_tweaks',
|
1117 |
-
'class' => 'module-tweaks',
|
1118 |
-
'type' => 'switcher',
|
1119 |
-
'label' => __( 'Enables or disables the whole module without resetting its settings.', 'speed-booster-pack' ),
|
1120 |
-
'default' => true,
|
1121 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1122 |
-
],
|
1123 |
-
[
|
1124 |
-
'title' => __( 'Enable instant.page', 'speed-booster-pack' ),
|
1125 |
-
'id' => 'instant_page',
|
1126 |
-
'type' => 'switcher',
|
1127 |
-
/* translators: %s = hyperlink to the instant.page website */
|
1128 |
-
'desc' => sprintf( __( 'Enqueues %s (locally), which basically boosts the speed of navigating through your whole website.', 'speed-booster-pack' ), '<a href="https://instant.page/" rel="external noopener" target="_blank">instant.page</a>' ),
|
1129 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1130 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1131 |
-
],
|
1132 |
-
[
|
1133 |
-
'title' => __( 'Trim query strings', 'speed-booster-pack' ),
|
1134 |
-
'id' => 'trim_query_strings',
|
1135 |
-
'type' => 'switcher',
|
1136 |
-
'desc' => __( 'Removes the query strings (characters that come after the question mark) at the end of enqueued asset URLs.', 'speed-booster-pack' ),
|
1137 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1138 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1139 |
-
],
|
1140 |
-
[
|
1141 |
-
'title' => __( 'Disable self pingbacks', 'speed-booster-pack' ),
|
1142 |
-
'id' => 'disable_self_pingbacks',
|
1143 |
-
'type' => 'switcher',
|
1144 |
-
'desc' => __( 'Disabling this will prevent pinging this website to ping itself (its other posts etc.) during publishing, which will improve the speed of publishing posts or pages.', 'speed-booster-pack' ),
|
1145 |
-
'default' => true,
|
1146 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1147 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1148 |
-
],
|
1149 |
-
[
|
1150 |
-
'title' => __( 'Dequeue emoji scripts', 'speed-booster-pack' ),
|
1151 |
-
'id' => 'dequeue_emoji_scripts',
|
1152 |
-
'type' => 'switcher',
|
1153 |
-
'desc' => __( 'Removes the unnecessary emoji scripts from your website front-end. Doesn\'t remove emojis, don\'t worry.', 'speed-booster-pack' ),
|
1154 |
-
'default' => true,
|
1155 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1156 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1157 |
-
],
|
1158 |
-
[
|
1159 |
-
'title' => __( 'Dequeue the post embed script', 'speed-booster-pack' ),
|
1160 |
-
'id' => 'disable_post_embeds',
|
1161 |
-
'type' => 'switcher',
|
1162 |
-
'desc' => __( 'Disables embedding posts from WordPress-based websites (including your own) which converts URLs into heavy iframes.', 'speed-booster-pack' ),
|
1163 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1164 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1165 |
-
],
|
1166 |
-
[
|
1167 |
-
/* translators: %s: <code>comment-reply.js</code> */
|
1168 |
-
'title' => sprintf( __( 'Dequeue %s', 'speed-booster-pack' ), '<code>comment-reply.js</code>' ),
|
1169 |
-
/* translators: %s: <code>comment-reply.js</code> */
|
1170 |
-
'desc' => sprintf( __( 'Disables the %s script.', 'speed-booster-pack' ), '<code>comment-reply.js</code>' ),
|
1171 |
-
'id' => 'dequeue_comment_reply_script',
|
1172 |
-
'type' => 'switcher',
|
1173 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1174 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1175 |
-
],
|
1176 |
-
[
|
1177 |
-
'title' => __( 'Dequeue Dashicons CSS', 'speed-booster-pack' ),
|
1178 |
-
'id' => 'dequeue_dashicons',
|
1179 |
-
'type' => 'switcher',
|
1180 |
-
/* translators: 1. <strong> 2. </strong> */
|
1181 |
-
'desc' => sprintf( __( 'Removes dashicons.css from your front-end for your visitors. Since Dashicons are required for the admin bar, %1$sdashicons.css will not be removed for logged-in users%2$s.', 'speed-booster-pack' ), '<strong>', '</strong>' ),
|
1182 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1183 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1184 |
-
],
|
1185 |
-
[
|
1186 |
-
'title' => __( 'Dequeue Gutenberg CSS', 'speed-booster-pack' ),
|
1187 |
-
'id' => 'dequeue_block_library',
|
1188 |
-
'type' => 'switcher',
|
1189 |
-
'desc' => __( 'If you\'re not using the block editor (Gutenberg) in your posts/pages, this is a safe setting to enable.', 'speed-booster-pack' ),
|
1190 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1191 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1192 |
-
],
|
1193 |
-
[
|
1194 |
-
'title' => __( 'Heartbeat settings', 'speed-booster-pack' ),
|
1195 |
-
'id' => 'heartbeat_settings',
|
1196 |
-
/* translators: 1. opening tag for the hyperlink to the Heartbeat API 2. closing tag for the hyperlink */
|
1197 |
-
'desc' => sprintf( __( 'Controls the %1$sHeartbeat API%2$s, which checks if the user is still logged-in or not every 15 to 60 seconds.', 'speed-booster-pack' ), '<a href="https://developer.wordpress.org/plugins/javascript/heartbeat-api/" rel="external noopener" target="_blank">', '</a>' ) . '<br />' . __( '"Enabled" lets it run like usual, "Optimized" sets both intervals to 120 seconds, and "Disabled" disables the Heartbeat API completely.', 'speed-booster-pack' ),
|
1198 |
-
'type' => 'button_set',
|
1199 |
-
'options' => [
|
1200 |
-
'enabled' => __( 'Enabled', 'speed-booster-pack' ),
|
1201 |
-
'optimized' => __( 'Optimized', 'speed-booster-pack' ),
|
1202 |
-
'disabled' => __( 'Disabled', 'speed-booster-pack' ),
|
1203 |
-
],
|
1204 |
-
'default' => 'enabled',
|
1205 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1206 |
-
],
|
1207 |
-
[
|
1208 |
-
'title' => __( 'Limit post revisions', 'speed-booster-pack' ),
|
1209 |
-
'id' => 'post_revisions',
|
1210 |
-
'type' => 'spinner',
|
1211 |
-
'unit' => __( 'revisions', 'speed-booster-pack' ),
|
1212 |
-
/* translators: 1. opening tag for the hyperlink to the support article for revisions 2. closing tag for the hyperlink */
|
1213 |
-
'desc' => sprintf( __( 'Limits the number of %1$spost revisions%2$s saved for each post. Keeping 3 or 5 revisions for each post should be enough for most sites. Set it to 0 to disable post revisions completely.', 'speed-booster-pack' ), '<a href="https://wordpress.org/support/article/revisions/" rel="external noopener" target="_blank">', '</a>' ) . '<br />'
|
1214 |
-
/* translators: 1. WP_POST_REVISIONS 2. wp-config.php */
|
1215 |
-
. sprintf( __( 'Note: If the %1$s constant is set in your %2$s file, it will override this setting.', 'speed-booster-pack' ), '<code>WP_POST_REVISIONS</code>', '<code>wp-config.php</code>' ),
|
1216 |
-
'sanitize' => 'absint',
|
1217 |
-
'default' => '99',
|
1218 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1219 |
-
],
|
1220 |
-
[
|
1221 |
-
'title' => __( 'Autosave interval', 'speed-booster-pack' ),
|
1222 |
-
'id' => 'autosave_interval',
|
1223 |
-
'type' => 'spinner',
|
1224 |
-
'min' => '1',
|
1225 |
-
'unit' => __( 'minutes', 'speed-booster-pack' ),
|
1226 |
-
'desc' => __( 'Sets how frequent the content is saved automatically while editing. WordPress sets it to 1 minute by default, and you can\'t set it to a shorter interval.', 'speed-booster-pack' ) . '<br />'
|
1227 |
-
/* translators: 1. AUTOSAVE_INTERVAL 2. wp-config.php */
|
1228 |
-
. sprintf( __( 'Note: If the %1$s constant is set in your %2$s file, it will override this setting.', 'speed-booster-pack' ), '<code>AUTOSAVE_INTERVAL</code>', '<code>wp-config.php</code>' ),
|
1229 |
-
'sanitize' => 'sbp_posabs',
|
1230 |
-
'default' => '1',
|
1231 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1232 |
-
],
|
1233 |
-
[
|
1234 |
-
/* translators: %s = <head> */
|
1235 |
-
'title' => sprintf( __( 'Declutter %s', 'speed-booster-pack' ), '<code><head></code>' ),
|
1236 |
-
'id' => 'declutter_head',
|
1237 |
-
'class' => 'declutter-head',
|
1238 |
-
'type' => 'fieldset',
|
1239 |
-
'before' => '<p>' . __( 'Enabling these options removes corresponding elements from your HTML source code. If you don\'t know what they are, it\'s probably safer for you to keep them disabled.', 'speed-booster-pack' ) . '</p>',
|
1240 |
-
'fields' => [
|
1241 |
-
|
1242 |
-
[
|
1243 |
-
'title' => __( 'Shortlinks', 'speed-booster-pack' ),
|
1244 |
-
'id' => 'declutter_shortlinks',
|
1245 |
-
'type' => 'switcher',
|
1246 |
-
'label' => '<link rel=\'shortlink\' href=\'...\' />',
|
1247 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1248 |
-
],
|
1249 |
-
[
|
1250 |
-
'title' => __( 'Next/previous posts links', 'speed-booster-pack' ),
|
1251 |
-
'id' => 'declutter_adjacent_posts_links',
|
1252 |
-
'type' => 'switcher',
|
1253 |
-
'label' => "<link rel='next (or prev)' title='...' href='...' />",
|
1254 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1255 |
-
],
|
1256 |
-
[
|
1257 |
-
'title' => __( 'WLW Manifest link', 'speed-booster-pack' ),
|
1258 |
-
'id' => 'declutter_wlw',
|
1259 |
-
'type' => 'switcher',
|
1260 |
-
'label' => '<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="..." />',
|
1261 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1262 |
-
],
|
1263 |
-
[
|
1264 |
-
'title' => __( 'Really Simple Discovery (RSD) link', 'speed-booster-pack' ),
|
1265 |
-
'id' => 'declutter_rsd',
|
1266 |
-
'type' => 'switcher',
|
1267 |
-
'label' => '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="..." />',
|
1268 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1269 |
-
],
|
1270 |
-
[
|
1271 |
-
'title' => __( 'REST API links', 'speed-booster-pack' ),
|
1272 |
-
'id' => 'declutter_rest_api_links',
|
1273 |
-
'type' => 'switcher',
|
1274 |
-
'label' => "<link rel='https://api.w.org/' href='...' />",
|
1275 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1276 |
-
],
|
1277 |
-
[
|
1278 |
-
'title' => __( 'RSS feed links', 'speed-booster-pack' ),
|
1279 |
-
'id' => 'declutter_feed_links',
|
1280 |
-
'type' => 'switcher',
|
1281 |
-
'label' => '<link rel="alternate" type="application/rss+xml" title="..." href="..." />',
|
1282 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1283 |
-
],
|
1284 |
-
[
|
1285 |
-
'title' => __( 'WordPress version', 'speed-booster-pack' ),
|
1286 |
-
'id' => 'declutter_wp_version',
|
1287 |
-
'type' => 'switcher',
|
1288 |
-
'label' => '<meta name="generator" content="WordPress X.X" />',
|
1289 |
-
'sanitize' => 'sbp_sanitize_boolean',
|
1290 |
-
],
|
1291 |
-
],
|
1292 |
-
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
1293 |
-
],
|
1294 |
-
// [
|
1295 |
-
// 'id' => 'roles_to_disable_sbp',
|
1296 |
-
// 'type' => 'select',
|
1297 |
-
// 'title' => sprintf( __( 'Roles to disable %s features', 'speed-booster-pack' ), SBP_PLUGIN_NAME ),
|
1298 |
-
// 'chosen' => true,
|
1299 |
-
// 'multiple' => true,
|
1300 |
-
// 'placeholder' => 'Select user role',
|
1301 |
-
// 'options' => $user_roles,
|
1302 |
-
// ],
|
1303 |
-
],
|
1304 |
-
]
|
1305 |
-
);
|
1306 |
-
/* END Section: Tweaks */
|
1307 |
-
|
1308 |
/** BEGIN Section: Database Optimization */
|
1309 |
CSF::createSection(
|
1310 |
$prefix,
|
11 |
*/
|
12 |
|
13 |
// If this file is called directly, abort.
|
|
|
14 |
use SpeedBooster\SBP_Notice_Manager;
|
15 |
|
16 |
if ( ! defined( 'WPINC' ) ) {
|
225 |
]
|
226 |
);
|
227 |
/* END Section: Dashboard */
|
|
|
|
|
|
|
228 |
$advisor_fields = [
|
229 |
[
|
230 |
'id' => 'advisor_heading',
|
238 |
],
|
239 |
];
|
240 |
|
241 |
+
$advisor_fields[] = [
|
242 |
+
'type' => 'content',
|
243 |
+
'content' => '<div id="advisor-content"></div>',
|
244 |
+
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
|
246 |
/* BEGIN Section: Speed Advisor */
|
247 |
CSF::createSection(
|
256 |
);
|
257 |
/* END Section: Speed Advisor */
|
258 |
|
259 |
+
/* BEGIN Section: General */
|
260 |
+
CSF::createSection(
|
261 |
+
$prefix,
|
262 |
+
[
|
263 |
+
'title' => __( 'General', 'speed-booster-pack' ),
|
264 |
+
'id' => 'tweaks',
|
265 |
+
'icon' => 'fa fa-sliders-h',
|
266 |
+
'fields' => [
|
267 |
+
[
|
268 |
+
/* translators: used like "Enable/Disable XXX" where "XXX" is the module name. */
|
269 |
+
'title' => __( 'Enable/Disable', 'speed-booster-pack' ) . ' ' . __( 'General', 'speed-booster-pack' ),
|
270 |
+
'id' => 'module_tweaks',
|
271 |
+
'class' => 'module-tweaks',
|
272 |
+
'type' => 'switcher',
|
273 |
+
'label' => __( 'Enables or disables the whole module without resetting its settings.', 'speed-booster-pack' ),
|
274 |
+
'default' => true,
|
275 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
276 |
+
],
|
277 |
+
[
|
278 |
+
'title' => __( 'Enable instant.page', 'speed-booster-pack' ),
|
279 |
+
'id' => 'instant_page',
|
280 |
+
'type' => 'switcher',
|
281 |
+
/* translators: %s = hyperlink to the instant.page website */
|
282 |
+
'desc' => sprintf( __( 'Enqueues %s (locally), which basically boosts the speed of navigating through your whole website.', 'speed-booster-pack' ), '<a href="https://instant.page/" rel="external noopener" target="_blank">instant.page</a>' ),
|
283 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
284 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
285 |
+
],
|
286 |
+
[
|
287 |
+
'title' => __( 'Trim query strings', 'speed-booster-pack' ),
|
288 |
+
'id' => 'trim_query_strings',
|
289 |
+
'type' => 'switcher',
|
290 |
+
'desc' => __( 'Removes the query strings (characters that come after the question mark) at the end of enqueued asset URLs.', 'speed-booster-pack' ),
|
291 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
292 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
293 |
+
],
|
294 |
+
[
|
295 |
+
'title' => __( 'Disable self pingbacks', 'speed-booster-pack' ),
|
296 |
+
'id' => 'disable_self_pingbacks',
|
297 |
+
'type' => 'switcher',
|
298 |
+
'desc' => __( 'Disabling this will prevent pinging this website to ping itself (its other posts etc.) during publishing, which will improve the speed of publishing posts or pages.', 'speed-booster-pack' ),
|
299 |
+
'default' => true,
|
300 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
301 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
302 |
+
],
|
303 |
+
[
|
304 |
+
'title' => __( 'Dequeue emoji scripts', 'speed-booster-pack' ),
|
305 |
+
'id' => 'dequeue_emoji_scripts',
|
306 |
+
'type' => 'switcher',
|
307 |
+
'desc' => __( 'Removes the unnecessary emoji scripts from your website front-end. Doesn\'t remove emojis, don\'t worry.', 'speed-booster-pack' ),
|
308 |
+
'default' => true,
|
309 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
310 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
311 |
+
],
|
312 |
+
[
|
313 |
+
'title' => __( 'Dequeue the post embed script', 'speed-booster-pack' ),
|
314 |
+
'id' => 'disable_post_embeds',
|
315 |
+
'type' => 'switcher',
|
316 |
+
'desc' => __( 'Disables embedding posts from WordPress-based websites (including your own) which converts URLs into heavy iframes.', 'speed-booster-pack' ),
|
317 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
318 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
319 |
+
],
|
320 |
+
[
|
321 |
+
/* translators: %s: <code>comment-reply.js</code> */
|
322 |
+
'title' => sprintf( __( 'Dequeue %s', 'speed-booster-pack' ), '<code>comment-reply.js</code>' ),
|
323 |
+
/* translators: %s: <code>comment-reply.js</code> */
|
324 |
+
'desc' => sprintf( __( 'Disables the %s script.', 'speed-booster-pack' ), '<code>comment-reply.js</code>' ),
|
325 |
+
'id' => 'dequeue_comment_reply_script',
|
326 |
+
'type' => 'switcher',
|
327 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
328 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
329 |
+
],
|
330 |
+
[
|
331 |
+
'title' => __( 'Dequeue Dashicons CSS', 'speed-booster-pack' ),
|
332 |
+
'id' => 'dequeue_dashicons',
|
333 |
+
'type' => 'switcher',
|
334 |
+
/* translators: 1. <strong> 2. </strong> */
|
335 |
+
'desc' => sprintf( __( 'Removes dashicons.css from your front-end for your visitors. Since Dashicons are required for the admin bar, %1$sdashicons.css will not be removed for logged-in users%2$s.', 'speed-booster-pack' ), '<strong>', '</strong>' ),
|
336 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
337 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
338 |
+
],
|
339 |
+
[
|
340 |
+
'title' => __( 'Dequeue Gutenberg CSS', 'speed-booster-pack' ),
|
341 |
+
'id' => 'dequeue_block_library',
|
342 |
+
'type' => 'switcher',
|
343 |
+
'desc' => __( 'If you\'re not using the block editor (Gutenberg) in your posts/pages, this is a safe setting to enable.', 'speed-booster-pack' ),
|
344 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
345 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
346 |
+
],
|
347 |
+
[
|
348 |
+
'title' => __( 'Heartbeat settings', 'speed-booster-pack' ),
|
349 |
+
'id' => 'heartbeat_settings',
|
350 |
+
/* translators: 1. opening tag for the hyperlink to the Heartbeat API 2. closing tag for the hyperlink */
|
351 |
+
'desc' => sprintf( __( 'Controls the %1$sHeartbeat API%2$s, which checks if the user is still logged-in or not every 15 to 60 seconds.', 'speed-booster-pack' ), '<a href="https://developer.wordpress.org/plugins/javascript/heartbeat-api/" rel="external noopener" target="_blank">', '</a>' ) . '<br />' . __( '"Enabled" lets it run like usual, "Optimized" sets both intervals to 120 seconds, and "Disabled" disables the Heartbeat API completely.', 'speed-booster-pack' ),
|
352 |
+
'type' => 'button_set',
|
353 |
+
'options' => [
|
354 |
+
'enabled' => __( 'Enabled', 'speed-booster-pack' ),
|
355 |
+
'optimized' => __( 'Optimized', 'speed-booster-pack' ),
|
356 |
+
'disabled' => __( 'Disabled', 'speed-booster-pack' ),
|
357 |
+
],
|
358 |
+
'default' => 'enabled',
|
359 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
360 |
+
],
|
361 |
+
[
|
362 |
+
'title' => __( 'Limit post revisions', 'speed-booster-pack' ),
|
363 |
+
'id' => 'post_revisions',
|
364 |
+
'type' => 'spinner',
|
365 |
+
'unit' => __( 'revisions', 'speed-booster-pack' ),
|
366 |
+
/* translators: 1. opening tag for the hyperlink to the support article for revisions 2. closing tag for the hyperlink */
|
367 |
+
'desc' => sprintf( __( 'Limits the number of %1$spost revisions%2$s saved for each post. Keeping 3 or 5 revisions for each post should be enough for most sites. Set it to 0 to disable post revisions completely.', 'speed-booster-pack' ), '<a href="https://wordpress.org/support/article/revisions/" rel="external noopener" target="_blank">', '</a>' ) . '<br />'
|
368 |
+
/* translators: 1. WP_POST_REVISIONS 2. wp-config.php */
|
369 |
+
. sprintf( __( 'Note: If the %1$s constant is set in your %2$s file, it will override this setting.', 'speed-booster-pack' ), '<code>WP_POST_REVISIONS</code>', '<code>wp-config.php</code>' ),
|
370 |
+
'sanitize' => 'absint',
|
371 |
+
'default' => '99',
|
372 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
373 |
+
],
|
374 |
+
[
|
375 |
+
'title' => __( 'Autosave interval', 'speed-booster-pack' ),
|
376 |
+
'id' => 'autosave_interval',
|
377 |
+
'type' => 'spinner',
|
378 |
+
'min' => '1',
|
379 |
+
'unit' => __( 'minutes', 'speed-booster-pack' ),
|
380 |
+
'desc' => __( 'Sets how frequent the content is saved automatically while editing. WordPress sets it to 1 minute by default, and you can\'t set it to a shorter interval.', 'speed-booster-pack' ) . '<br />'
|
381 |
+
/* translators: 1. AUTOSAVE_INTERVAL 2. wp-config.php */
|
382 |
+
. sprintf( __( 'Note: If the %1$s constant is set in your %2$s file, it will override this setting.', 'speed-booster-pack' ), '<code>AUTOSAVE_INTERVAL</code>', '<code>wp-config.php</code>' ),
|
383 |
+
'sanitize' => 'sbp_posabs',
|
384 |
+
'default' => '1',
|
385 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
386 |
+
],
|
387 |
+
[
|
388 |
+
/* translators: %s = <head> */
|
389 |
+
'title' => sprintf( __( 'Declutter %s', 'speed-booster-pack' ), '<code><head></code>' ),
|
390 |
+
'id' => 'declutter_head',
|
391 |
+
'class' => 'declutter-head',
|
392 |
+
'type' => 'fieldset',
|
393 |
+
'before' => '<p>' . __( 'Enabling these options removes corresponding elements from your HTML source code. If you don\'t know what they are, it\'s probably safer for you to keep them disabled.', 'speed-booster-pack' ) . '</p>',
|
394 |
+
'fields' => [
|
395 |
+
|
396 |
+
[
|
397 |
+
'title' => __( 'Shortlinks', 'speed-booster-pack' ),
|
398 |
+
'id' => 'declutter_shortlinks',
|
399 |
+
'type' => 'switcher',
|
400 |
+
'label' => '<link rel=\'shortlink\' href=\'...\' />',
|
401 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
402 |
+
],
|
403 |
+
[
|
404 |
+
'title' => __( 'Next/previous posts links', 'speed-booster-pack' ),
|
405 |
+
'id' => 'declutter_adjacent_posts_links',
|
406 |
+
'type' => 'switcher',
|
407 |
+
'label' => "<link rel='next (or prev)' title='...' href='...' />",
|
408 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
409 |
+
],
|
410 |
+
[
|
411 |
+
'title' => __( 'WLW Manifest link', 'speed-booster-pack' ),
|
412 |
+
'id' => 'declutter_wlw',
|
413 |
+
'type' => 'switcher',
|
414 |
+
'label' => '<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="..." />',
|
415 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
416 |
+
],
|
417 |
+
[
|
418 |
+
'title' => __( 'Really Simple Discovery (RSD) link', 'speed-booster-pack' ),
|
419 |
+
'id' => 'declutter_rsd',
|
420 |
+
'type' => 'switcher',
|
421 |
+
'label' => '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="..." />',
|
422 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
423 |
+
],
|
424 |
+
[
|
425 |
+
'title' => __( 'REST API links', 'speed-booster-pack' ),
|
426 |
+
'id' => 'declutter_rest_api_links',
|
427 |
+
'type' => 'switcher',
|
428 |
+
'label' => "<link rel='https://api.w.org/' href='...' />",
|
429 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
430 |
+
],
|
431 |
+
[
|
432 |
+
'title' => __( 'RSS feed links', 'speed-booster-pack' ),
|
433 |
+
'id' => 'declutter_feed_links',
|
434 |
+
'type' => 'switcher',
|
435 |
+
'label' => '<link rel="alternate" type="application/rss+xml" title="..." href="..." />',
|
436 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
437 |
+
],
|
438 |
+
[
|
439 |
+
'title' => __( 'WordPress version', 'speed-booster-pack' ),
|
440 |
+
'id' => 'declutter_wp_version',
|
441 |
+
'type' => 'switcher',
|
442 |
+
'label' => '<meta name="generator" content="WordPress X.X" />',
|
443 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
444 |
+
],
|
445 |
+
],
|
446 |
+
'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
|
447 |
+
],
|
448 |
+
[
|
449 |
+
'id' => 'roles_to_disable_sbp',
|
450 |
+
'type' => 'select',
|
451 |
+
'title' => sprintf( __( 'Roles to disable %s features', 'speed-booster-pack' ), SBP_PLUGIN_NAME ),
|
452 |
+
'chosen' => true,
|
453 |
+
'multiple' => true,
|
454 |
+
'placeholder' => 'Select user role',
|
455 |
+
'options' => 'roles',
|
456 |
+
],
|
457 |
+
],
|
458 |
+
]
|
459 |
+
);
|
460 |
+
/* END Section: General */
|
461 |
+
|
462 |
/* BEGIN Section: Caching */
|
463 |
$cache_fields = [
|
464 |
[
|
1131 |
'settings' => [ 'lineWrapping' => true ],
|
1132 |
'sanitize' => 'sbp_sanitize_strip_tags',
|
1133 |
],
|
1134 |
+
[
|
1135 |
+
'id' => 'preboost_featured_image',
|
1136 |
+
'type' => 'switcher',
|
1137 |
+
'label' => __( 'Preload featured images.', 'speed-booster-pack' ),
|
1138 |
+
'desc' => __( 'Enable this if you want featured images to be preloaded.', 'speed-booster-pack' ),
|
1139 |
+
'dependency' => [ 'preboost_enable', '==', '1', '', 'visible' ],
|
1140 |
+
'sanitize' => 'sbp_sanitize_boolean',
|
1141 |
+
],
|
1142 |
],
|
1143 |
'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
|
1144 |
],
|
1285 |
);
|
1286 |
/* END Section: Special */
|
1287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1288 |
/** BEGIN Section: Database Optimization */
|
1289 |
CSF::createSection(
|
1290 |
$prefix,
|
admin/css/speed-booster-pack-admin.css
CHANGED
@@ -127,7 +127,7 @@
|
|
127 |
animation: rotating 2s linear infinite;
|
128 |
}
|
129 |
|
130 |
-
.js-include.csf-depend-on, .js-exclude.csf-depend-on, .js-footer-exclude.csf-depend-on {
|
131 |
display: none;
|
132 |
}
|
133 |
|
@@ -171,12 +171,52 @@
|
|
171 |
}
|
172 |
|
173 |
.sbp-advice {
|
174 |
-
padding:
|
175 |
-
|
176 |
}
|
177 |
|
178 |
.sbp-advice p {
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
}
|
181 |
|
182 |
.meta_box_critical_css_excludes.csf-depend-on {
|
127 |
animation: rotating 2s linear infinite;
|
128 |
}
|
129 |
|
130 |
+
.js-include.csf-depend-on, .js-exclude.csf-depend-on, .js-footer-exclude.csf-depend-on, .csf-depend-on[data-controller="preboost_enable"] {
|
131 |
display: none;
|
132 |
}
|
133 |
|
171 |
}
|
172 |
|
173 |
.sbp-advice {
|
174 |
+
padding: 15px 5px;
|
175 |
+
border-bottom: 1px solid #ddd;
|
176 |
}
|
177 |
|
178 |
.sbp-advice p {
|
179 |
+
display: inline-block;
|
180 |
+
position: relative;
|
181 |
+
top: -5px;
|
182 |
+
}
|
183 |
+
|
184 |
+
.sbp-advice input {
|
185 |
+
display: none;
|
186 |
+
}
|
187 |
+
|
188 |
+
.sbp-advice .circle {
|
189 |
+
display: inline-block;
|
190 |
+
width: 20px;
|
191 |
+
height: 20px;
|
192 |
+
border-radius: 100%;
|
193 |
+
margin-right: 10px;
|
194 |
+
}
|
195 |
+
|
196 |
+
.sbp-advice input[type=checkbox]:checked + .circle {
|
197 |
+
background: green;
|
198 |
+
position: relative;
|
199 |
+
}
|
200 |
+
|
201 |
+
.sbp-advice input[type=checkbox]:checked + .circle:after {
|
202 |
+
content: "✓";
|
203 |
+
color: #fff;
|
204 |
+
font-size: 22px;
|
205 |
+
position: absolute;
|
206 |
+
right: 0;
|
207 |
+
}
|
208 |
+
|
209 |
+
.sbp-advice input[type=checkbox]:not(:checked) + .circle {
|
210 |
+
border: 1px solid #ddd;
|
211 |
+
}
|
212 |
+
|
213 |
+
.sbp-advice p {
|
214 |
+
margin: 0!important;
|
215 |
+
}
|
216 |
+
|
217 |
+
.sbp-advice input[type=checkbox]:checked ~ p {
|
218 |
+
text-decoration: line-through;
|
219 |
+
color: #888;
|
220 |
}
|
221 |
|
222 |
.meta_box_critical_css_excludes.csf-depend-on {
|
admin/js/speed-booster-pack-admin.js
CHANGED
@@ -205,6 +205,10 @@
|
|
205 |
if (hash === 'database-optimization') {
|
206 |
$.scanDatabaseTables();
|
207 |
}
|
|
|
|
|
|
|
|
|
208 |
});
|
209 |
|
210 |
$.scanDatabaseTables = function() {
|
@@ -247,6 +251,19 @@
|
|
247 |
});
|
248 |
};
|
249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
$(document).on('click', '.sbp-scan-database-tables', function() {
|
251 |
$.scanDatabaseTables();
|
252 |
});
|
205 |
if (hash === 'database-optimization') {
|
206 |
$.scanDatabaseTables();
|
207 |
}
|
208 |
+
|
209 |
+
if (hash === 'advisor') {
|
210 |
+
$.getAdvisorMessages();
|
211 |
+
}
|
212 |
});
|
213 |
|
214 |
$.scanDatabaseTables = function() {
|
251 |
});
|
252 |
};
|
253 |
|
254 |
+
$.getAdvisorMessages = function() {
|
255 |
+
$.ajax({
|
256 |
+
type: 'GET',
|
257 |
+
url: ajaxurl,
|
258 |
+
data: {'action': 'sbp_get_advisor_messages', 'sbp_action': 'sbp_get_advisor_messages', 'nonce': sbp_ajax_vars.nonce},
|
259 |
+
success: function(response) {
|
260 |
+
$('#advisor-content').html(response);
|
261 |
+
},
|
262 |
+
error: function(xhr, status) {
|
263 |
+
},
|
264 |
+
});
|
265 |
+
};
|
266 |
+
|
267 |
$(document).on('click', '.sbp-scan-database-tables', function() {
|
268 |
$.scanDatabaseTables();
|
269 |
});
|
includes/class-speed-booster-pack.php
CHANGED
@@ -180,7 +180,7 @@ class Speed_Booster_Pack {
|
|
180 |
new SBP_Custom_Code_Manager();
|
181 |
new SBP_Cloudflare();
|
182 |
new SBP_Notice_Manager();
|
183 |
-
|
184 |
new SBP_Sucuri();
|
185 |
new SBP_Cache_Warmup();
|
186 |
new SBP_Cache();
|
180 |
new SBP_Custom_Code_Manager();
|
181 |
new SBP_Cloudflare();
|
182 |
new SBP_Notice_Manager();
|
183 |
+
new SBP_Advisor();
|
184 |
new SBP_Sucuri();
|
185 |
new SBP_Cache_Warmup();
|
186 |
new SBP_Cache();
|
includes/classes/class-sbp-abstract-module.php
CHANGED
@@ -9,6 +9,23 @@ if ( ! defined( 'WPINC' ) ) {
|
|
9 |
|
10 |
// Just in case. Maybe we will need it in the future
|
11 |
abstract class SBP_Abstract_Module {
|
|
|
|
|
12 |
public function __construct() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
}
|
9 |
|
10 |
// Just in case. Maybe we will need it in the future
|
11 |
abstract class SBP_Abstract_Module {
|
12 |
+
protected $should_sbp_run = true;
|
13 |
+
|
14 |
public function __construct() {
|
15 |
+
add_action( 'set_current_user', [ $this, 'check_user_roles' ] );
|
16 |
+
}
|
17 |
+
|
18 |
+
public function check_user_roles() {
|
19 |
+
$user = wp_get_current_user();
|
20 |
+
$sbp_disabled_roles = sbp_get_option( 'roles_to_disable_sbp', [] );
|
21 |
+
$roles = $user->roles;
|
22 |
+
if ( $roles && $sbp_disabled_roles ) {
|
23 |
+
foreach ( $roles as $role ) {
|
24 |
+
if ( in_array( $role, $sbp_disabled_roles ) ) {
|
25 |
+
$this->should_sbp_run = false;
|
26 |
+
break;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
}
|
30 |
}
|
31 |
}
|
includes/classes/class-sbp-advisor.php
CHANGED
@@ -9,14 +9,9 @@ if ( ! defined( 'WPINC' ) ) {
|
|
9 |
|
10 |
class SBP_Advisor {
|
11 |
private $messages = [];
|
12 |
-
private $dismissed_messages = [];
|
13 |
-
private $user_meta_key = 'sbp_dismissed_messages';
|
14 |
|
15 |
public function __construct() {
|
16 |
-
$this
|
17 |
-
$this->set_messages();
|
18 |
-
|
19 |
-
add_action( 'wp_ajax_sbp_dismiss_advisor_message', [ $this, 'dismiss_advisor_message' ] );
|
20 |
}
|
21 |
|
22 |
public function set_messages() {
|
@@ -24,61 +19,83 @@ class SBP_Advisor {
|
|
24 |
$this->check_http_protocol_version();
|
25 |
}
|
26 |
|
27 |
-
public function get_dismissed_messages() {
|
28 |
-
$dismissed_messages = get_user_meta( get_current_user_id(), $this->user_meta_key, true );
|
29 |
-
|
30 |
-
if ( ! is_array( $dismissed_messages ) ) {
|
31 |
-
$this->dismissed_messages = [];
|
32 |
-
} else {
|
33 |
-
$this->dismissed_messages = $dismissed_messages;
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
private function check_http_protocol_version() {
|
|
|
38 |
$message_id = 'update_http_protocol';
|
39 |
|
40 |
-
if ( isset( $_SERVER['SERVER_PROTOCOL'] ) && $_SERVER['SERVER_PROTOCOL']
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
];
|
50 |
-
}
|
51 |
}
|
52 |
|
53 |
private function check_php_version() {
|
|
|
54 |
$message_id = 'update_php';
|
55 |
|
56 |
-
if ( version_compare( PHP_VERSION, '7.3' ) !== -1 ) {
|
57 |
-
|
58 |
}
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
];
|
66 |
-
}
|
67 |
}
|
68 |
|
69 |
-
public function
|
70 |
-
|
71 |
-
}
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
$
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
|
|
83 |
}
|
84 |
}
|
9 |
|
10 |
class SBP_Advisor {
|
11 |
private $messages = [];
|
|
|
|
|
12 |
|
13 |
public function __construct() {
|
14 |
+
add_action( 'wp_ajax_sbp_get_advisor_messages', [ $this, 'get_messages_html' ] );
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
public function set_messages() {
|
19 |
$this->check_http_protocol_version();
|
20 |
}
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
private function check_http_protocol_version() {
|
23 |
+
$checked = false;
|
24 |
$message_id = 'update_http_protocol';
|
25 |
|
26 |
+
if ( isset( $_SERVER['SERVER_PROTOCOL'] ) && in_array( $_SERVER['SERVER_PROTOCOL'], [ 'HTTP/2', 'HTTP/3' ] ) ) {
|
27 |
+
$checked = true;
|
28 |
+
} else if ( isset( $_SERVER['SERVER_PROTOCOL'] ) && in_array( $_SERVER['SERVER_PROTOCOL'], [ 'HTTP/1.0', 'HTTP/1.1' ] ) ) {
|
29 |
+
if ( function_exists( 'curl_version' ) and defined( 'CURL_HTTP_VERSION_2_0' ) ) {
|
30 |
+
$ch = curl_init();
|
31 |
+
curl_setopt_array( $ch, [
|
32 |
+
CURLOPT_URL => get_home_url(),
|
33 |
+
CURLOPT_HEADER => true,
|
34 |
+
CURLOPT_NOBODY => true,
|
35 |
+
CURLOPT_RETURNTRANSFER => true,
|
36 |
+
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
|
37 |
+
] );
|
38 |
+
$response = curl_exec( $ch );
|
39 |
+
|
40 |
+
if ( substr( $response, 0, 6 ) === 'HTTP/2' ) {
|
41 |
+
$checked = true;
|
42 |
+
}
|
43 |
+
} else {
|
44 |
+
$this->messages[ $message_id ] = [
|
45 |
+
'type' => 'non-dismissible',
|
46 |
+
/** B_TODO: Need a text for curl disabled websites. "Use http2.pro bla bla bla" */
|
47 |
+
'content' => __( 'Curl is not active', 'speed-booster-pack' ),
|
48 |
+
'checked' => false,
|
49 |
+
];
|
50 |
+
return;
|
51 |
+
}
|
52 |
}
|
53 |
|
54 |
+
$this->messages[ $message_id ] = [
|
55 |
+
'type' => 'non-dismissible',
|
56 |
+
'content' => __( 'You\'re using HTTP/1.1. For best performance, you should upgrade to HTTP/2 or, if possible, HTTP/3.', 'speed-booster-pack' ),
|
57 |
+
'checked' => $checked,
|
58 |
+
];
|
|
|
|
|
59 |
}
|
60 |
|
61 |
private function check_php_version() {
|
62 |
+
$checked = false;
|
63 |
$message_id = 'update_php';
|
64 |
|
65 |
+
if ( version_compare( PHP_VERSION, '7.3' ) !== - 1 ) {
|
66 |
+
$checked = true;
|
67 |
}
|
68 |
|
69 |
+
$this->messages[ $message_id ] = [
|
70 |
+
'type' => 'non-dismissible',
|
71 |
+
'content' => __( 'You\'re using and old version of PHP. For best performance, you should upgrade PHP to version 7.3 or above.', 'speed-booster-pack' ),
|
72 |
+
'checked' => $checked,
|
73 |
+
];
|
|
|
|
|
74 |
}
|
75 |
|
76 |
+
public function get_messages_html() {
|
77 |
+
$this->set_messages();
|
|
|
78 |
|
79 |
+
if ( isset( $_GET['sbp_action'] ) && $_GET['sbp_action'] == 'sbp_get_advisor_messages' && current_user_can( 'manage_options' ) && isset( $_GET['nonce'] ) && wp_verify_nonce( $_GET['nonce'], 'sbp_ajax_nonce' ) ) {
|
80 |
+
|
81 |
+
usort( $this->messages, function ( $a, $b ) {
|
82 |
+
if ( $a['checked'] > $b['checked'] ) {
|
83 |
+
return 1;
|
84 |
+
} elseif ( $a['checked'] == $b['checked'] ) {
|
85 |
+
return 0;
|
86 |
+
} else {
|
87 |
+
return - 1;
|
88 |
+
}
|
89 |
+
} );
|
90 |
+
$advisor_messages_content = '';
|
91 |
+
foreach ( $this->messages as $message_id => $message ) {
|
92 |
+
$advisor_messages_content .= '<div class="sbp-advice" data-message-id="' . $message_id . '">
|
93 |
+
<input type="checkbox" disabled="disabled" ' . ( $message["checked"] ? "checked" : "" ) . ' /><span class="circle"></span> <p> ' . $message['content'] . '</p>
|
94 |
+
</div>';
|
95 |
+
}
|
96 |
+
|
97 |
+
echo $advisor_messages_content;
|
98 |
}
|
99 |
+
wp_die();
|
100 |
}
|
101 |
}
|
includes/classes/class-sbp-cdn.php
CHANGED
@@ -16,15 +16,23 @@ class SBP_CDN extends SBP_Abstract_Module {
|
|
16 |
private $site_url = null;
|
17 |
|
18 |
public function __construct() {
|
|
|
|
|
19 |
if ( ! sbp_get_option( 'cdn_url' ) ) {
|
20 |
return;
|
21 |
}
|
22 |
|
23 |
-
$this
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
-
|
|
|
28 |
}
|
29 |
|
30 |
public function run_rewriter( $html ) {
|
16 |
private $site_url = null;
|
17 |
|
18 |
public function __construct() {
|
19 |
+
parent::__construct();
|
20 |
+
|
21 |
if ( ! sbp_get_option( 'cdn_url' ) ) {
|
22 |
return;
|
23 |
}
|
24 |
|
25 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
26 |
+
}
|
27 |
+
|
28 |
+
public function run_class() {
|
29 |
+
if ( $this->should_sbp_run ) {
|
30 |
+
$this->site_url = get_site_url( get_current_blog_id() ); // For Multisite
|
31 |
+
$this->set_included_dirs();
|
32 |
+
$this->set_excluded_extensions();
|
33 |
|
34 |
+
add_filter( 'sbp_output_buffer', [ $this, 'run_rewriter' ] );
|
35 |
+
}
|
36 |
}
|
37 |
|
38 |
public function run_rewriter( $html ) {
|
includes/classes/class-sbp-critical-css.php
CHANGED
@@ -15,11 +15,19 @@ class SBP_Critical_CSS extends SBP_Abstract_Module {
|
|
15 |
];
|
16 |
|
17 |
public function __construct() {
|
|
|
|
|
18 |
if ( ! sbp_get_option( 'module_css' ) || ! sbp_get_option( 'enable_criticalcss' ) ) {
|
19 |
return;
|
20 |
}
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
public function handle_criticalcss( $html ) {
|
15 |
];
|
16 |
|
17 |
public function __construct() {
|
18 |
+
parent::__construct();
|
19 |
+
|
20 |
if ( ! sbp_get_option( 'module_css' ) || ! sbp_get_option( 'enable_criticalcss' ) ) {
|
21 |
return;
|
22 |
}
|
23 |
|
24 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function run_class() {
|
28 |
+
if ( $this->should_sbp_run ) {
|
29 |
+
add_filter( 'sbp_output_buffer', [ $this, 'handle_criticalcss' ] );
|
30 |
+
}
|
31 |
}
|
32 |
|
33 |
public function handle_criticalcss( $html ) {
|
includes/classes/class-sbp-css-minifier.php
CHANGED
@@ -18,14 +18,23 @@ class SBP_CSS_Minifier extends SBP_Abstract_Module {
|
|
18 |
private $dom = null;
|
19 |
|
20 |
public function __construct() {
|
|
|
|
|
21 |
if ( ! sbp_get_option( 'module_css' ) || ! sbp_get_option( 'css_inline' ) || sbp_get_option( 'enable_criticalcss' ) ) {
|
22 |
return;
|
23 |
}
|
24 |
-
$this->dom = new HtmlDocument();
|
25 |
|
26 |
-
$this
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
|
|
|
|
|
|
|
29 |
}
|
30 |
|
31 |
public function print_styles( $html ) {
|
18 |
private $dom = null;
|
19 |
|
20 |
public function __construct() {
|
21 |
+
parent::__construct();
|
22 |
+
|
23 |
if ( ! sbp_get_option( 'module_css' ) || ! sbp_get_option( 'css_inline' ) || sbp_get_option( 'enable_criticalcss' ) ) {
|
24 |
return;
|
25 |
}
|
|
|
26 |
|
27 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
28 |
+
}
|
29 |
+
|
30 |
+
public function run_class() {
|
31 |
+
if ( $this->should_sbp_run ) {
|
32 |
+
$this->dom = new HtmlDocument();
|
33 |
|
34 |
+
$this->set_exceptions();
|
35 |
+
|
36 |
+
add_filter( 'sbp_output_buffer', [ $this, 'print_styles' ] );
|
37 |
+
}
|
38 |
}
|
39 |
|
40 |
public function print_styles( $html ) {
|
includes/classes/class-sbp-custom-code-manager.php
CHANGED
@@ -10,11 +10,19 @@ if ( ! defined( 'WPINC' ) ) {
|
|
10 |
class SBP_Custom_Code_Manager extends SBP_Abstract_Module {
|
11 |
|
12 |
public function __construct() {
|
|
|
|
|
13 |
if ( ! sbp_get_option( 'module_special' ) ) {
|
14 |
return;
|
15 |
}
|
16 |
|
17 |
-
$this
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
|
20 |
private function add_script_tags() {
|
10 |
class SBP_Custom_Code_Manager extends SBP_Abstract_Module {
|
11 |
|
12 |
public function __construct() {
|
13 |
+
parent::__construct();
|
14 |
+
|
15 |
if ( ! sbp_get_option( 'module_special' ) ) {
|
16 |
return;
|
17 |
}
|
18 |
|
19 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
20 |
+
}
|
21 |
+
|
22 |
+
public function run_class() {
|
23 |
+
if ( $this->should_sbp_run ) {
|
24 |
+
$this->add_script_tags();
|
25 |
+
}
|
26 |
}
|
27 |
|
28 |
private function add_script_tags() {
|
includes/classes/class-sbp-font-optimizer.php
CHANGED
@@ -14,11 +14,19 @@ class SBP_Font_Optimizer extends SBP_Abstract_Module {
|
|
14 |
private $css2_families = [];
|
15 |
|
16 |
public function __construct() {
|
|
|
|
|
17 |
if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'optimize_gfonts' ) ) {
|
18 |
return;
|
19 |
}
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
public function process_google_fonts( $html ) {
|
@@ -90,8 +98,8 @@ class SBP_Font_Optimizer extends SBP_Abstract_Module {
|
|
90 |
|
91 |
$link_tag = $this->generate_css2_link_tag();
|
92 |
|
93 |
-
$html
|
94 |
-
$html
|
95 |
|
96 |
return $html;
|
97 |
}
|
@@ -131,14 +139,14 @@ class SBP_Font_Optimizer extends SBP_Abstract_Module {
|
|
131 |
$query_strings = [];
|
132 |
|
133 |
// Sort and clear arrays first
|
134 |
-
$this->css2_families = array_map(function($item) {
|
135 |
-
$item['styles'] = array_unique($item['styles']);
|
136 |
-
sort($item['styles']);
|
137 |
-
$item['weights'] = array_unique($item['weights']);
|
138 |
-
sort($item['weights']);
|
139 |
|
140 |
return $item;
|
141 |
-
}, $this->css2_families);
|
142 |
|
143 |
if ( $this->css2_families ) {
|
144 |
foreach ( $this->css2_families as $family_name => $attributes ) {
|
14 |
private $css2_families = [];
|
15 |
|
16 |
public function __construct() {
|
17 |
+
parent::__construct();
|
18 |
+
|
19 |
if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'optimize_gfonts' ) ) {
|
20 |
return;
|
21 |
}
|
22 |
|
23 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
24 |
+
}
|
25 |
+
|
26 |
+
public function run_class() {
|
27 |
+
if ( $this->should_sbp_run ) {
|
28 |
+
add_filter( 'sbp_output_buffer', [ $this, 'process_google_fonts' ], 10 );
|
29 |
+
}
|
30 |
}
|
31 |
|
32 |
public function process_google_fonts( $html ) {
|
98 |
|
99 |
$link_tag = $this->generate_css2_link_tag();
|
100 |
|
101 |
+
$html = preg_replace( "/<link[^<>\/]+href=['\"?]((https?:)?\/\/fonts\.googleapis\.com\/css2\?(.*?))['\"?].*?>/i", '', $html );
|
102 |
+
$html = str_replace( '</title>', '</title>' . PHP_EOL . $link_tag, $html );
|
103 |
|
104 |
return $html;
|
105 |
}
|
139 |
$query_strings = [];
|
140 |
|
141 |
// Sort and clear arrays first
|
142 |
+
$this->css2_families = array_map( function ( $item ) {
|
143 |
+
$item['styles'] = array_unique( $item['styles'] );
|
144 |
+
sort( $item['styles'] );
|
145 |
+
$item['weights'] = array_unique( $item['weights'] );
|
146 |
+
sort( $item['weights'] );
|
147 |
|
148 |
return $item;
|
149 |
+
}, $this->css2_families );
|
150 |
|
151 |
if ( $this->css2_families ) {
|
152 |
foreach ( $this->css2_families as $family_name => $attributes ) {
|
includes/classes/class-sbp-html-minifier.php
CHANGED
@@ -15,11 +15,19 @@ class SBP_HTML_Minifier extends SBP_Abstract_Module {
|
|
15 |
private $html;
|
16 |
|
17 |
public function __construct() {
|
|
|
|
|
18 |
if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'minify_html' ) ) {
|
19 |
return;
|
20 |
}
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
public function handle_html_minify( $html ) {
|
15 |
private $html;
|
16 |
|
17 |
public function __construct() {
|
18 |
+
parent::__construct();
|
19 |
+
|
20 |
if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'minify_html' ) ) {
|
21 |
return;
|
22 |
}
|
23 |
|
24 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function run_class() {
|
28 |
+
if ( $this->should_sbp_run ) {
|
29 |
+
add_filter( 'sbp_output_buffer', [ $this, 'handle_html_minify' ], 11 );
|
30 |
+
}
|
31 |
}
|
32 |
|
33 |
public function handle_html_minify( $html ) {
|
includes/classes/class-sbp-image-dimensions.php
CHANGED
@@ -6,11 +6,19 @@ use simplehtmldom\HtmlDocument;
|
|
6 |
|
7 |
class SBP_Image_Dimensions extends SBP_Abstract_Module {
|
8 |
public function __construct() {
|
|
|
|
|
9 |
if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'missing_image_dimensions' ) ) {
|
10 |
return;
|
11 |
}
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
|
16 |
public function specify_missing_dimensions( $html ) {
|
6 |
|
7 |
class SBP_Image_Dimensions extends SBP_Abstract_Module {
|
8 |
public function __construct() {
|
9 |
+
parent::__construct();
|
10 |
+
|
11 |
if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'missing_image_dimensions' ) ) {
|
12 |
return;
|
13 |
}
|
14 |
|
15 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
16 |
+
}
|
17 |
+
|
18 |
+
public function run_class() {
|
19 |
+
if ( $this->should_sbp_run ) {
|
20 |
+
add_filter( 'sbp_output_buffer', [ $this, 'specify_missing_dimensions' ] );
|
21 |
+
}
|
22 |
}
|
23 |
|
24 |
public function specify_missing_dimensions( $html ) {
|
includes/classes/class-sbp-js-optimizer.php
CHANGED
@@ -186,10 +186,18 @@ class SBP_JS_Optimizer extends SBP_Abstract_Module {
|
|
186 |
private $js_footer = false;
|
187 |
|
188 |
public function __construct() {
|
|
|
|
|
189 |
$this->js_optimize_strategy = sbp_get_option( 'js_optimize', 'off' );
|
190 |
$this->js_footer = sbp_get_option( 'js_footer' );
|
191 |
|
192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
}
|
194 |
|
195 |
public function optimize_scripts( $html ) {
|
186 |
private $js_footer = false;
|
187 |
|
188 |
public function __construct() {
|
189 |
+
parent::__construct();
|
190 |
+
|
191 |
$this->js_optimize_strategy = sbp_get_option( 'js_optimize', 'off' );
|
192 |
$this->js_footer = sbp_get_option( 'js_footer' );
|
193 |
|
194 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
195 |
+
}
|
196 |
+
|
197 |
+
public function run_class() {
|
198 |
+
if ( $this->should_sbp_run ) {
|
199 |
+
add_filter( 'sbp_output_buffer', [ $this, 'optimize_scripts' ] );
|
200 |
+
}
|
201 |
}
|
202 |
|
203 |
public function optimize_scripts( $html ) {
|
includes/classes/class-sbp-lazy-loader.php
CHANGED
@@ -12,16 +12,24 @@ class SBP_Lazy_Loader extends SBP_Abstract_Module {
|
|
12 |
private $noscripts = [];
|
13 |
|
14 |
public function __construct() {
|
|
|
|
|
15 |
if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'lazyload' ) || sbp_should_disable_feature( 'lazyload' ) ) {
|
16 |
return;
|
17 |
}
|
18 |
|
19 |
-
add_action( '
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
22 |
-
|
23 |
|
24 |
-
|
|
|
25 |
}
|
26 |
|
27 |
function add_lazy_load_script() {
|
12 |
private $noscripts = [];
|
13 |
|
14 |
public function __construct() {
|
15 |
+
parent::__construct();
|
16 |
+
|
17 |
if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'lazyload' ) || sbp_should_disable_feature( 'lazyload' ) ) {
|
18 |
return;
|
19 |
}
|
20 |
|
21 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
22 |
+
}
|
23 |
+
|
24 |
+
public function run_class() {
|
25 |
+
if ( $this->should_sbp_run ) {
|
26 |
+
add_action( 'wp_enqueue_scripts', [ $this, 'add_lazy_load_script' ] );
|
27 |
|
28 |
+
// We need async attribute on lazyload file
|
29 |
+
add_filter( 'script_loader_tag', [ $this, 'add_attribute_to_tag' ], 10, 2 );
|
30 |
|
31 |
+
add_filter( 'sbp_output_buffer', [ $this, 'lazy_load_handler' ] );
|
32 |
+
}
|
33 |
}
|
34 |
|
35 |
function add_lazy_load_script() {
|
includes/classes/class-sbp-localize-tracker.php
CHANGED
@@ -17,13 +17,21 @@ class SBP_Localize_Tracker extends SBP_Abstract_Module {
|
|
17 |
private $transient_name = '';
|
18 |
|
19 |
public function __construct() {
|
|
|
|
|
20 |
if ( ! sbp_get_option( 'module_special' ) || ! sbp_get_option( 'localize_tracking_scripts' ) ) {
|
21 |
return;
|
22 |
}
|
23 |
|
24 |
-
add_action( '
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
|
|
|
27 |
}
|
28 |
|
29 |
public function replace_url( $html ) {
|
17 |
private $transient_name = '';
|
18 |
|
19 |
public function __construct() {
|
20 |
+
parent::__construct();
|
21 |
+
|
22 |
if ( ! sbp_get_option( 'module_special' ) || ! sbp_get_option( 'localize_tracking_scripts' ) ) {
|
23 |
return;
|
24 |
}
|
25 |
|
26 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
27 |
+
}
|
28 |
+
|
29 |
+
public function run_class() {
|
30 |
+
if ( $this->should_sbp_run ) {
|
31 |
+
add_action( 'admin_init', [ $this, 'refresh_analytics_dir' ] );
|
32 |
|
33 |
+
add_filter( 'sbp_output_buffer', [ $this, 'replace_url' ] );
|
34 |
+
}
|
35 |
}
|
36 |
|
37 |
public function replace_url( $html ) {
|
includes/classes/class-sbp-preboost.php
CHANGED
@@ -36,11 +36,36 @@ class SBP_Preboost extends SBP_Abstract_Module {
|
|
36 |
private $appending_script = "";
|
37 |
|
38 |
public function __construct() {
|
39 |
-
|
|
|
|
|
40 |
return;
|
41 |
}
|
42 |
|
43 |
-
add_action( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
public function add_preload_tags() {
|
36 |
private $appending_script = "";
|
37 |
|
38 |
public function __construct() {
|
39 |
+
parent::__construct();
|
40 |
+
|
41 |
+
if ( is_array( sbp_get_option( 'preboost' ) ) && ( ! sbp_get_option( 'module_assets' ) ) ) {
|
42 |
return;
|
43 |
}
|
44 |
|
45 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
46 |
+
}
|
47 |
+
|
48 |
+
public function run_class() {
|
49 |
+
if ( $this->should_sbp_run ) {
|
50 |
+
$preboost = sbp_get_option( 'preboost' );
|
51 |
+
|
52 |
+
if ( isset( $preboost['preboost_enable'] ) && $preboost['preboost_enable'] ) {
|
53 |
+
add_action( 'wp_head', [ $this, 'add_preload_tags' ] );
|
54 |
+
}
|
55 |
+
|
56 |
+
if ( isset( $preboost['preboost_featured_image'] ) && $preboost['preboost_featured_image'] ) {
|
57 |
+
add_action( 'wp_head', [ $this, 'add_featured_image_preload_tag' ] );
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
public function add_featured_image_preload_tag() {
|
63 |
+
if ( is_singular() ) {
|
64 |
+
$thumbnail = get_the_post_thumbnail_url();
|
65 |
+
if ( $thumbnail ) {
|
66 |
+
echo '<link rel="preload" href="' . $thumbnail . '" as="image" />' . PHP_EOL;
|
67 |
+
}
|
68 |
+
}
|
69 |
}
|
70 |
|
71 |
public function add_preload_tags() {
|
includes/classes/class-sbp-special.php
CHANGED
@@ -11,13 +11,21 @@ if ( ! defined( 'WPINC' ) ) {
|
|
11 |
|
12 |
class SBP_Special extends SBP_Abstract_Module {
|
13 |
public function __construct() {
|
|
|
|
|
14 |
if ( ! sbp_get_option( 'module_special' ) ) {
|
15 |
return;
|
16 |
}
|
17 |
|
18 |
-
$this
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
}
|
22 |
|
23 |
/**
|
11 |
|
12 |
class SBP_Special extends SBP_Abstract_Module {
|
13 |
public function __construct() {
|
14 |
+
parent::__construct();
|
15 |
+
|
16 |
if ( ! sbp_get_option( 'module_special' ) ) {
|
17 |
return;
|
18 |
}
|
19 |
|
20 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
21 |
+
}
|
22 |
+
|
23 |
+
public function run_class() {
|
24 |
+
if ( $this->should_sbp_run ) {
|
25 |
+
$this->woocommerce_disable_cart_fragments();
|
26 |
+
$this->optimize_nonwc_pages();
|
27 |
+
$this->remove_wc_password_strength_meter();
|
28 |
+
}
|
29 |
}
|
30 |
|
31 |
/**
|
includes/classes/class-sbp-tweaks.php
CHANGED
@@ -32,11 +32,19 @@ class SBP_Tweaks extends SBP_Abstract_Module {
|
|
32 |
];
|
33 |
|
34 |
public function __construct() {
|
|
|
|
|
35 |
if ( ! sbp_get_option( 'module_tweaks' ) ) {
|
36 |
return;
|
37 |
}
|
38 |
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
42 |
private function call_option_methods( $settings, $parent = null ) {
|
32 |
];
|
33 |
|
34 |
public function __construct() {
|
35 |
+
parent::__construct();
|
36 |
+
|
37 |
if ( ! sbp_get_option( 'module_tweaks' ) ) {
|
38 |
return;
|
39 |
}
|
40 |
|
41 |
+
add_action( 'set_current_user', [ $this, 'run_class' ] );
|
42 |
+
}
|
43 |
+
|
44 |
+
public function run_class() {
|
45 |
+
if ( $this->should_sbp_run ) {
|
46 |
+
$this->call_option_methods( $this->tweak_settings );
|
47 |
+
}
|
48 |
}
|
49 |
|
50 |
private function call_option_methods( $settings, $parent = null ) {
|
includes/sbp-helpers.php
CHANGED
@@ -494,17 +494,3 @@ if ( ! function_exists( 'sbp_get_public_post_types' ) ) {
|
|
494 |
return is_array( $post_types ) ? $post_types : [];
|
495 |
}
|
496 |
}
|
497 |
-
|
498 |
-
if ( ! function_exists( 'sbp_get_editable_roles' ) ) {
|
499 |
-
function sbp_get_editable_roles() {
|
500 |
-
global $wp_roles;
|
501 |
-
|
502 |
-
if ($wp_roles) {
|
503 |
-
$all_roles = $wp_roles->roles;
|
504 |
-
|
505 |
-
return apply_filters('editable_roles', $all_roles);
|
506 |
-
}
|
507 |
-
|
508 |
-
return [];
|
509 |
-
}
|
510 |
-
}
|
494 |
return is_array( $post_types ) ? $post_types : [];
|
495 |
}
|
496 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
speed-booster-pack.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* Plugin Name: Speed Booster Pack
|
7 |
* Plugin URI: https://speedboosterpack.com
|
8 |
* Description: PageSpeed optimization is vital for SEO: A faster website equals better conversions. Optimize & cache your site with this smart plugin!
|
9 |
-
* Version: 4.3.
|
10 |
* Author: Optimocha
|
11 |
* Author URI: https://optimocha.com
|
12 |
* License: GPLv3 or later
|
@@ -32,7 +32,7 @@ define( 'SBP_PLUGIN_NAME', 'Speed Booster Pack' );
|
|
32 |
/**
|
33 |
* Current plugin version.
|
34 |
*/
|
35 |
-
define( 'SBP_VERSION', '4.3.
|
36 |
|
37 |
/**
|
38 |
* Plugin website URL.
|
6 |
* Plugin Name: Speed Booster Pack
|
7 |
* Plugin URI: https://speedboosterpack.com
|
8 |
* Description: PageSpeed optimization is vital for SEO: A faster website equals better conversions. Optimize & cache your site with this smart plugin!
|
9 |
+
* Version: 4.3.2
|
10 |
* Author: Optimocha
|
11 |
* Author URI: https://optimocha.com
|
12 |
* License: GPLv3 or later
|
32 |
/**
|
33 |
* Current plugin version.
|
34 |
*/
|
35 |
+
define( 'SBP_VERSION', '4.3.2' );
|
36 |
|
37 |
/**
|
38 |
* Plugin website URL.
|
vendor/codestar-framework/composer/ClassLoader.php
DELETED
@@ -1,445 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of Composer.
|
5 |
-
*
|
6 |
-
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
-
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
-
*
|
9 |
-
* For the full copyright and license information, please view the LICENSE
|
10 |
-
* file that was distributed with this source code.
|
11 |
-
*/
|
12 |
-
|
13 |
-
namespace Composer\Autoload;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
17 |
-
*
|
18 |
-
* $loader = new \Composer\Autoload\ClassLoader();
|
19 |
-
*
|
20 |
-
* // register classes with namespaces
|
21 |
-
* $loader->add('Symfony\Component', __DIR__.'/component');
|
22 |
-
* $loader->add('Symfony', __DIR__.'/framework');
|
23 |
-
*
|
24 |
-
* // activate the autoloader
|
25 |
-
* $loader->register();
|
26 |
-
*
|
27 |
-
* // to enable searching the include path (eg. for PEAR packages)
|
28 |
-
* $loader->setUseIncludePath(true);
|
29 |
-
*
|
30 |
-
* In this example, if you try to use a class in the Symfony\Component
|
31 |
-
* namespace or one of its children (Symfony\Component\Console for instance),
|
32 |
-
* the autoloader will first look for the class under the component/
|
33 |
-
* directory, and it will then fallback to the framework/ directory if not
|
34 |
-
* found before giving up.
|
35 |
-
*
|
36 |
-
* This class is loosely based on the Symfony UniversalClassLoader.
|
37 |
-
*
|
38 |
-
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
-
* @see http://www.php-fig.org/psr/psr-0/
|
41 |
-
* @see http://www.php-fig.org/psr/psr-4/
|
42 |
-
*/
|
43 |
-
class ClassLoader
|
44 |
-
{
|
45 |
-
// PSR-4
|
46 |
-
private $prefixLengthsPsr4 = array();
|
47 |
-
private $prefixDirsPsr4 = array();
|
48 |
-
private $fallbackDirsPsr4 = array();
|
49 |
-
|
50 |
-
// PSR-0
|
51 |
-
private $prefixesPsr0 = array();
|
52 |
-
private $fallbackDirsPsr0 = array();
|
53 |
-
|
54 |
-
private $useIncludePath = false;
|
55 |
-
private $classMap = array();
|
56 |
-
private $classMapAuthoritative = false;
|
57 |
-
private $missingClasses = array();
|
58 |
-
private $apcuPrefix;
|
59 |
-
|
60 |
-
public function getPrefixes()
|
61 |
-
{
|
62 |
-
if (!empty($this->prefixesPsr0)) {
|
63 |
-
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
64 |
-
}
|
65 |
-
|
66 |
-
return array();
|
67 |
-
}
|
68 |
-
|
69 |
-
public function getPrefixesPsr4()
|
70 |
-
{
|
71 |
-
return $this->prefixDirsPsr4;
|
72 |
-
}
|
73 |
-
|
74 |
-
public function getFallbackDirs()
|
75 |
-
{
|
76 |
-
return $this->fallbackDirsPsr0;
|
77 |
-
}
|
78 |
-
|
79 |
-
public function getFallbackDirsPsr4()
|
80 |
-
{
|
81 |
-
return $this->fallbackDirsPsr4;
|
82 |
-
}
|
83 |
-
|
84 |
-
public function getClassMap()
|
85 |
-
{
|
86 |
-
return $this->classMap;
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* @param array $classMap Class to filename map
|
91 |
-
*/
|
92 |
-
public function addClassMap(array $classMap)
|
93 |
-
{
|
94 |
-
if ($this->classMap) {
|
95 |
-
$this->classMap = array_merge($this->classMap, $classMap);
|
96 |
-
} else {
|
97 |
-
$this->classMap = $classMap;
|
98 |
-
}
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Registers a set of PSR-0 directories for a given prefix, either
|
103 |
-
* appending or prepending to the ones previously set for this prefix.
|
104 |
-
*
|
105 |
-
* @param string $prefix The prefix
|
106 |
-
* @param array|string $paths The PSR-0 root directories
|
107 |
-
* @param bool $prepend Whether to prepend the directories
|
108 |
-
*/
|
109 |
-
public function add($prefix, $paths, $prepend = false)
|
110 |
-
{
|
111 |
-
if (!$prefix) {
|
112 |
-
if ($prepend) {
|
113 |
-
$this->fallbackDirsPsr0 = array_merge(
|
114 |
-
(array) $paths,
|
115 |
-
$this->fallbackDirsPsr0
|
116 |
-
);
|
117 |
-
} else {
|
118 |
-
$this->fallbackDirsPsr0 = array_merge(
|
119 |
-
$this->fallbackDirsPsr0,
|
120 |
-
(array) $paths
|
121 |
-
);
|
122 |
-
}
|
123 |
-
|
124 |
-
return;
|
125 |
-
}
|
126 |
-
|
127 |
-
$first = $prefix[0];
|
128 |
-
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
129 |
-
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
130 |
-
|
131 |
-
return;
|
132 |
-
}
|
133 |
-
if ($prepend) {
|
134 |
-
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
135 |
-
(array) $paths,
|
136 |
-
$this->prefixesPsr0[$first][$prefix]
|
137 |
-
);
|
138 |
-
} else {
|
139 |
-
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
140 |
-
$this->prefixesPsr0[$first][$prefix],
|
141 |
-
(array) $paths
|
142 |
-
);
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
/**
|
147 |
-
* Registers a set of PSR-4 directories for a given namespace, either
|
148 |
-
* appending or prepending to the ones previously set for this namespace.
|
149 |
-
*
|
150 |
-
* @param string $prefix The prefix/namespace, with trailing '\\'
|
151 |
-
* @param array|string $paths The PSR-4 base directories
|
152 |
-
* @param bool $prepend Whether to prepend the directories
|
153 |
-
*
|
154 |
-
* @throws \InvalidArgumentException
|
155 |
-
*/
|
156 |
-
public function addPsr4($prefix, $paths, $prepend = false)
|
157 |
-
{
|
158 |
-
if (!$prefix) {
|
159 |
-
// Register directories for the root namespace.
|
160 |
-
if ($prepend) {
|
161 |
-
$this->fallbackDirsPsr4 = array_merge(
|
162 |
-
(array) $paths,
|
163 |
-
$this->fallbackDirsPsr4
|
164 |
-
);
|
165 |
-
} else {
|
166 |
-
$this->fallbackDirsPsr4 = array_merge(
|
167 |
-
$this->fallbackDirsPsr4,
|
168 |
-
(array) $paths
|
169 |
-
);
|
170 |
-
}
|
171 |
-
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
172 |
-
// Register directories for a new namespace.
|
173 |
-
$length = strlen($prefix);
|
174 |
-
if ('\\' !== $prefix[$length - 1]) {
|
175 |
-
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
176 |
-
}
|
177 |
-
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
178 |
-
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
179 |
-
} elseif ($prepend) {
|
180 |
-
// Prepend directories for an already registered namespace.
|
181 |
-
$this->prefixDirsPsr4[$prefix] = array_merge(
|
182 |
-
(array) $paths,
|
183 |
-
$this->prefixDirsPsr4[$prefix]
|
184 |
-
);
|
185 |
-
} else {
|
186 |
-
// Append directories for an already registered namespace.
|
187 |
-
$this->prefixDirsPsr4[$prefix] = array_merge(
|
188 |
-
$this->prefixDirsPsr4[$prefix],
|
189 |
-
(array) $paths
|
190 |
-
);
|
191 |
-
}
|
192 |
-
}
|
193 |
-
|
194 |
-
/**
|
195 |
-
* Registers a set of PSR-0 directories for a given prefix,
|
196 |
-
* replacing any others previously set for this prefix.
|
197 |
-
*
|
198 |
-
* @param string $prefix The prefix
|
199 |
-
* @param array|string $paths The PSR-0 base directories
|
200 |
-
*/
|
201 |
-
public function set($prefix, $paths)
|
202 |
-
{
|
203 |
-
if (!$prefix) {
|
204 |
-
$this->fallbackDirsPsr0 = (array) $paths;
|
205 |
-
} else {
|
206 |
-
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
207 |
-
}
|
208 |
-
}
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Registers a set of PSR-4 directories for a given namespace,
|
212 |
-
* replacing any others previously set for this namespace.
|
213 |
-
*
|
214 |
-
* @param string $prefix The prefix/namespace, with trailing '\\'
|
215 |
-
* @param array|string $paths The PSR-4 base directories
|
216 |
-
*
|
217 |
-
* @throws \InvalidArgumentException
|
218 |
-
*/
|
219 |
-
public function setPsr4($prefix, $paths)
|
220 |
-
{
|
221 |
-
if (!$prefix) {
|
222 |
-
$this->fallbackDirsPsr4 = (array) $paths;
|
223 |
-
} else {
|
224 |
-
$length = strlen($prefix);
|
225 |
-
if ('\\' !== $prefix[$length - 1]) {
|
226 |
-
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
227 |
-
}
|
228 |
-
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
229 |
-
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
230 |
-
}
|
231 |
-
}
|
232 |
-
|
233 |
-
/**
|
234 |
-
* Turns on searching the include path for class files.
|
235 |
-
*
|
236 |
-
* @param bool $useIncludePath
|
237 |
-
*/
|
238 |
-
public function setUseIncludePath($useIncludePath)
|
239 |
-
{
|
240 |
-
$this->useIncludePath = $useIncludePath;
|
241 |
-
}
|
242 |
-
|
243 |
-
/**
|
244 |
-
* Can be used to check if the autoloader uses the include path to check
|
245 |
-
* for classes.
|
246 |
-
*
|
247 |
-
* @return bool
|
248 |
-
*/
|
249 |
-
public function getUseIncludePath()
|
250 |
-
{
|
251 |
-
return $this->useIncludePath;
|
252 |
-
}
|
253 |
-
|
254 |
-
/**
|
255 |
-
* Turns off searching the prefix and fallback directories for classes
|
256 |
-
* that have not been registered with the class map.
|
257 |
-
*
|
258 |
-
* @param bool $classMapAuthoritative
|
259 |
-
*/
|
260 |
-
public function setClassMapAuthoritative($classMapAuthoritative)
|
261 |
-
{
|
262 |
-
$this->classMapAuthoritative = $classMapAuthoritative;
|
263 |
-
}
|
264 |
-
|
265 |
-
/**
|
266 |
-
* Should class lookup fail if not found in the current class map?
|
267 |
-
*
|
268 |
-
* @return bool
|
269 |
-
*/
|
270 |
-
public function isClassMapAuthoritative()
|
271 |
-
{
|
272 |
-
return $this->classMapAuthoritative;
|
273 |
-
}
|
274 |
-
|
275 |
-
/**
|
276 |
-
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
277 |
-
*
|
278 |
-
* @param string|null $apcuPrefix
|
279 |
-
*/
|
280 |
-
public function setApcuPrefix($apcuPrefix)
|
281 |
-
{
|
282 |
-
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
283 |
-
}
|
284 |
-
|
285 |
-
/**
|
286 |
-
* The APCu prefix in use, or null if APCu caching is not enabled.
|
287 |
-
*
|
288 |
-
* @return string|null
|
289 |
-
*/
|
290 |
-
public function getApcuPrefix()
|
291 |
-
{
|
292 |
-
return $this->apcuPrefix;
|
293 |
-
}
|
294 |
-
|
295 |
-
/**
|
296 |
-
* Registers this instance as an autoloader.
|
297 |
-
*
|
298 |
-
* @param bool $prepend Whether to prepend the autoloader or not
|
299 |
-
*/
|
300 |
-
public function register($prepend = false)
|
301 |
-
{
|
302 |
-
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
303 |
-
}
|
304 |
-
|
305 |
-
/**
|
306 |
-
* Unregisters this instance as an autoloader.
|
307 |
-
*/
|
308 |
-
public function unregister()
|
309 |
-
{
|
310 |
-
spl_autoload_unregister(array($this, 'loadClass'));
|
311 |
-
}
|
312 |
-
|
313 |
-
/**
|
314 |
-
* Loads the given class or interface.
|
315 |
-
*
|
316 |
-
* @param string $class The name of the class
|
317 |
-
* @return bool|null True if loaded, null otherwise
|
318 |
-
*/
|
319 |
-
public function loadClass($class)
|
320 |
-
{
|
321 |
-
if ($file = $this->findFile($class)) {
|
322 |
-
includeFile($file);
|
323 |
-
|
324 |
-
return true;
|
325 |
-
}
|
326 |
-
}
|
327 |
-
|
328 |
-
/**
|
329 |
-
* Finds the path to the file where the class is defined.
|
330 |
-
*
|
331 |
-
* @param string $class The name of the class
|
332 |
-
*
|
333 |
-
* @return string|false The path if found, false otherwise
|
334 |
-
*/
|
335 |
-
public function findFile($class)
|
336 |
-
{
|
337 |
-
// class map lookup
|
338 |
-
if (isset($this->classMap[$class])) {
|
339 |
-
return $this->classMap[$class];
|
340 |
-
}
|
341 |
-
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
342 |
-
return false;
|
343 |
-
}
|
344 |
-
if (null !== $this->apcuPrefix) {
|
345 |
-
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
346 |
-
if ($hit) {
|
347 |
-
return $file;
|
348 |
-
}
|
349 |
-
}
|
350 |
-
|
351 |
-
$file = $this->findFileWithExtension($class, '.php');
|
352 |
-
|
353 |
-
// Search for Hack files if we are running on HHVM
|
354 |
-
if (false === $file && defined('HHVM_VERSION')) {
|
355 |
-
$file = $this->findFileWithExtension($class, '.hh');
|
356 |
-
}
|
357 |
-
|
358 |
-
if (null !== $this->apcuPrefix) {
|
359 |
-
apcu_add($this->apcuPrefix.$class, $file);
|
360 |
-
}
|
361 |
-
|
362 |
-
if (false === $file) {
|
363 |
-
// Remember that this class does not exist.
|
364 |
-
$this->missingClasses[$class] = true;
|
365 |
-
}
|
366 |
-
|
367 |
-
return $file;
|
368 |
-
}
|
369 |
-
|
370 |
-
private function findFileWithExtension($class, $ext)
|
371 |
-
{
|
372 |
-
// PSR-4 lookup
|
373 |
-
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
374 |
-
|
375 |
-
$first = $class[0];
|
376 |
-
if (isset($this->prefixLengthsPsr4[$first])) {
|
377 |
-
$subPath = $class;
|
378 |
-
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
379 |
-
$subPath = substr($subPath, 0, $lastPos);
|
380 |
-
$search = $subPath . '\\';
|
381 |
-
if (isset($this->prefixDirsPsr4[$search])) {
|
382 |
-
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
383 |
-
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
384 |
-
if (file_exists($file = $dir . $pathEnd)) {
|
385 |
-
return $file;
|
386 |
-
}
|
387 |
-
}
|
388 |
-
}
|
389 |
-
}
|
390 |
-
}
|
391 |
-
|
392 |
-
// PSR-4 fallback dirs
|
393 |
-
foreach ($this->fallbackDirsPsr4 as $dir) {
|
394 |
-
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
395 |
-
return $file;
|
396 |
-
}
|
397 |
-
}
|
398 |
-
|
399 |
-
// PSR-0 lookup
|
400 |
-
if (false !== $pos = strrpos($class, '\\')) {
|
401 |
-
// namespaced class name
|
402 |
-
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
403 |
-
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
404 |
-
} else {
|
405 |
-
// PEAR-like class name
|
406 |
-
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
407 |
-
}
|
408 |
-
|
409 |
-
if (isset($this->prefixesPsr0[$first])) {
|
410 |
-
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
411 |
-
if (0 === strpos($class, $prefix)) {
|
412 |
-
foreach ($dirs as $dir) {
|
413 |
-
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
414 |
-
return $file;
|
415 |
-
}
|
416 |
-
}
|
417 |
-
}
|
418 |
-
}
|
419 |
-
}
|
420 |
-
|
421 |
-
// PSR-0 fallback dirs
|
422 |
-
foreach ($this->fallbackDirsPsr0 as $dir) {
|
423 |
-
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
424 |
-
return $file;
|
425 |
-
}
|
426 |
-
}
|
427 |
-
|
428 |
-
// PSR-0 include paths.
|
429 |
-
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
430 |
-
return $file;
|
431 |
-
}
|
432 |
-
|
433 |
-
return false;
|
434 |
-
}
|
435 |
-
}
|
436 |
-
|
437 |
-
/**
|
438 |
-
* Scope isolated include.
|
439 |
-
*
|
440 |
-
* Prevents access to $this/self from included files.
|
441 |
-
*/
|
442 |
-
function includeFile($file)
|
443 |
-
{
|
444 |
-
include $file;
|
445 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codestar-framework/composer/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
|
2 |
-
Copyright (c) Nils Adermann, Jordi Boggiano
|
3 |
-
|
4 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 |
-
of this software and associated documentation files (the "Software"), to deal
|
6 |
-
in the Software without restriction, including without limitation the rights
|
7 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8 |
-
copies of the Software, and to permit persons to whom the Software is furnished
|
9 |
-
to do so, subject to the following conditions:
|
10 |
-
|
11 |
-
The above copyright notice and this permission notice shall be included in all
|
12 |
-
copies or substantial portions of the Software.
|
13 |
-
|
14 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20 |
-
THE SOFTWARE.
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codestar-framework/composer/autoload_classmap.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// autoload_classmap.php @generated by Composer
|
4 |
-
|
5 |
-
$vendorDir = dirname(dirname(__FILE__));
|
6 |
-
$baseDir = dirname($vendorDir);
|
7 |
-
|
8 |
-
return array(
|
9 |
-
'WP_Async_Request' => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
|
10 |
-
'WP_Background_Process' => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
|
11 |
-
'simplehtmldom\\Debug' => $vendorDir . '/simplehtmldom/simplehtmldom/Debug.php',
|
12 |
-
'simplehtmldom\\HtmlDocument' => $vendorDir . '/simplehtmldom/simplehtmldom/HtmlDocument.php',
|
13 |
-
'simplehtmldom\\HtmlNode' => $vendorDir . '/simplehtmldom/simplehtmldom/HtmlNode.php',
|
14 |
-
'simplehtmldom\\HtmlWeb' => $vendorDir . '/simplehtmldom/simplehtmldom/HtmlWeb.php',
|
15 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codestar-framework/composer/autoload_namespaces.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// autoload_namespaces.php @generated by Composer
|
4 |
-
|
5 |
-
$vendorDir = dirname(dirname(__FILE__));
|
6 |
-
$baseDir = dirname($vendorDir);
|
7 |
-
|
8 |
-
return array(
|
9 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codestar-framework/composer/autoload_psr4.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// autoload_psr4.php @generated by Composer
|
4 |
-
|
5 |
-
$vendorDir = dirname(dirname(__FILE__));
|
6 |
-
$baseDir = dirname($vendorDir);
|
7 |
-
|
8 |
-
return array(
|
9 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codestar-framework/composer/autoload_real.php
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// autoload_real.php @generated by Composer
|
4 |
-
|
5 |
-
class ComposerAutoloaderInitc77a129bcd35be69c439b7d915bd8e6b
|
6 |
-
{
|
7 |
-
private static $loader;
|
8 |
-
|
9 |
-
public static function loadClassLoader($class)
|
10 |
-
{
|
11 |
-
if ('Composer\Autoload\ClassLoader' === $class) {
|
12 |
-
require __DIR__ . '/ClassLoader.php';
|
13 |
-
}
|
14 |
-
}
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @return \Composer\Autoload\ClassLoader
|
18 |
-
*/
|
19 |
-
public static function getLoader()
|
20 |
-
{
|
21 |
-
if (null !== self::$loader) {
|
22 |
-
return self::$loader;
|
23 |
-
}
|
24 |
-
|
25 |
-
spl_autoload_register(array('ComposerAutoloaderInitc77a129bcd35be69c439b7d915bd8e6b', 'loadClassLoader'), true, true);
|
26 |
-
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('ComposerAutoloaderInitc77a129bcd35be69c439b7d915bd8e6b', 'loadClassLoader'));
|
28 |
-
|
29 |
-
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
-
if ($useStaticLoader) {
|
31 |
-
require_once __DIR__ . '/autoload_static.php';
|
32 |
-
|
33 |
-
call_user_func(\Composer\Autoload\ComposerStaticInitc77a129bcd35be69c439b7d915bd8e6b::getInitializer($loader));
|
34 |
-
} else {
|
35 |
-
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
-
foreach ($map as $namespace => $path) {
|
37 |
-
$loader->set($namespace, $path);
|
38 |
-
}
|
39 |
-
|
40 |
-
$map = require __DIR__ . '/autoload_psr4.php';
|
41 |
-
foreach ($map as $namespace => $path) {
|
42 |
-
$loader->setPsr4($namespace, $path);
|
43 |
-
}
|
44 |
-
|
45 |
-
$classMap = require __DIR__ . '/autoload_classmap.php';
|
46 |
-
if ($classMap) {
|
47 |
-
$loader->addClassMap($classMap);
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
$loader->register(true);
|
52 |
-
|
53 |
-
return $loader;
|
54 |
-
}
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codestar-framework/composer/autoload_static.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// autoload_static.php @generated by Composer
|
4 |
-
|
5 |
-
namespace Composer\Autoload;
|
6 |
-
|
7 |
-
class ComposerStaticInitc77a129bcd35be69c439b7d915bd8e6b
|
8 |
-
{
|
9 |
-
public static $classMap = array (
|
10 |
-
'WP_Async_Request' => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
|
11 |
-
'WP_Background_Process' => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
|
12 |
-
'simplehtmldom\\Debug' => __DIR__ . '/..' . '/simplehtmldom/simplehtmldom/Debug.php',
|
13 |
-
'simplehtmldom\\HtmlDocument' => __DIR__ . '/..' . '/simplehtmldom/simplehtmldom/HtmlDocument.php',
|
14 |
-
'simplehtmldom\\HtmlNode' => __DIR__ . '/..' . '/simplehtmldom/simplehtmldom/HtmlNode.php',
|
15 |
-
'simplehtmldom\\HtmlWeb' => __DIR__ . '/..' . '/simplehtmldom/simplehtmldom/HtmlWeb.php',
|
16 |
-
);
|
17 |
-
|
18 |
-
public static function getInitializer(ClassLoader $loader)
|
19 |
-
{
|
20 |
-
return \Closure::bind(function () use ($loader) {
|
21 |
-
$loader->classMap = ComposerStaticInitc77a129bcd35be69c439b7d915bd8e6b::$classMap;
|
22 |
-
|
23 |
-
}, null, ClassLoader::class);
|
24 |
-
}
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codestar-framework/composer/installed.json
DELETED
@@ -1,114 +0,0 @@
|
|
1 |
-
[
|
2 |
-
{
|
3 |
-
"name": "deliciousbrains/wp-background-processing",
|
4 |
-
"version": "1.0.2",
|
5 |
-
"version_normalized": "1.0.2.0",
|
6 |
-
"source": {
|
7 |
-
"type": "git",
|
8 |
-
"url": "https://github.com/deliciousbrains/wp-background-processing.git",
|
9 |
-
"reference": "2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800"
|
10 |
-
},
|
11 |
-
"dist": {
|
12 |
-
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/deliciousbrains/wp-background-processing/zipball/2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800",
|
14 |
-
"reference": "2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800",
|
15 |
-
"shasum": ""
|
16 |
-
},
|
17 |
-
"require": {
|
18 |
-
"php": ">=5.2"
|
19 |
-
},
|
20 |
-
"suggest": {
|
21 |
-
"coenjacobs/mozart": "Easily wrap this library with your own prefix, to prevent collisions when multiple plugins use this library"
|
22 |
-
},
|
23 |
-
"time": "2020-07-31T07:00:11+00:00",
|
24 |
-
"type": "library",
|
25 |
-
"installation-source": "dist",
|
26 |
-
"autoload": {
|
27 |
-
"classmap": [
|
28 |
-
"classes/"
|
29 |
-
]
|
30 |
-
},
|
31 |
-
"notification-url": "https://packagist.org/downloads/",
|
32 |
-
"license": [
|
33 |
-
"GPL-2.0-or-later"
|
34 |
-
],
|
35 |
-
"authors": [
|
36 |
-
{
|
37 |
-
"name": "Delicious Brains",
|
38 |
-
"email": "nom@deliciousbrains.com"
|
39 |
-
}
|
40 |
-
],
|
41 |
-
"description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks."
|
42 |
-
},
|
43 |
-
{
|
44 |
-
"name": "simplehtmldom/simplehtmldom",
|
45 |
-
"version": "dev-master",
|
46 |
-
"version_normalized": "9999999-dev",
|
47 |
-
"source": {
|
48 |
-
"type": "git",
|
49 |
-
"url": "https://github.com/simplehtmldom/simplehtmldom.git",
|
50 |
-
"reference": "31ce157e7ba0c6ca35f94faedf031a945c3f6427"
|
51 |
-
},
|
52 |
-
"dist": {
|
53 |
-
"type": "zip",
|
54 |
-
"url": "https://api.github.com/repos/simplehtmldom/simplehtmldom/zipball/31ce157e7ba0c6ca35f94faedf031a945c3f6427",
|
55 |
-
"reference": "31ce157e7ba0c6ca35f94faedf031a945c3f6427",
|
56 |
-
"shasum": ""
|
57 |
-
},
|
58 |
-
"require": {
|
59 |
-
"ext-iconv": "*",
|
60 |
-
"php": ">=5.6"
|
61 |
-
},
|
62 |
-
"require-dev": {
|
63 |
-
"phpunit/phpunit": "^6 || ^7"
|
64 |
-
},
|
65 |
-
"suggest": {
|
66 |
-
"ext-curl": "Needed to support cURL downloads in class HtmlWeb",
|
67 |
-
"ext-mbstring": "Allows better decoding for multi-byte documents",
|
68 |
-
"ext-openssl": "Allows loading HTTPS pages when using cURL"
|
69 |
-
},
|
70 |
-
"time": "2019-12-06T18:20:19+00:00",
|
71 |
-
"type": "library",
|
72 |
-
"installation-source": "source",
|
73 |
-
"autoload": {
|
74 |
-
"classmap": [
|
75 |
-
"./"
|
76 |
-
],
|
77 |
-
"exclude-from-classmap": [
|
78 |
-
"/example/",
|
79 |
-
"/manual/",
|
80 |
-
"/testcase/",
|
81 |
-
"/tests/",
|
82 |
-
"simple_html_dom.php"
|
83 |
-
]
|
84 |
-
},
|
85 |
-
"notification-url": "https://packagist.org/downloads/",
|
86 |
-
"license": [
|
87 |
-
"MIT"
|
88 |
-
],
|
89 |
-
"authors": [
|
90 |
-
{
|
91 |
-
"name": "S.C. Chen",
|
92 |
-
"role": "Developer"
|
93 |
-
},
|
94 |
-
{
|
95 |
-
"name": "John Schlick",
|
96 |
-
"role": "Developer"
|
97 |
-
},
|
98 |
-
{
|
99 |
-
"name": "logmanoriginal",
|
100 |
-
"role": "Developer"
|
101 |
-
}
|
102 |
-
],
|
103 |
-
"description": "A fast, simple and reliable HTML document parser for PHP.",
|
104 |
-
"homepage": "https://simplehtmldom.sourceforge.io/",
|
105 |
-
"keywords": [
|
106 |
-
"Simple",
|
107 |
-
"dom",
|
108 |
-
"html",
|
109 |
-
"parser",
|
110 |
-
"php",
|
111 |
-
"simplehtmldom"
|
112 |
-
]
|
113 |
-
}
|
114 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|