Form Maker by WD – user-friendly drag & drop Form Builder plugin - Version 1.15.7

Version Description

  • Added: 10Web Booster integration.
  • Fixed: Special chars in exported submission.
  • Fixed: PDF link in submission.
Download this release

Release Info

Developer 10web
Plugin Icon 128x128 Form Maker by WD – user-friendly drag & drop Form Builder plugin
Version 1.15.7
Comparing to
See all releases

Code changes from version 1.15.6 to 1.15.7

Files changed (64) hide show
  1. admin/views/Manage_fm.php +959 -0
  2. admin/views/Submissions_fm.php +3 -0
  3. booster/AdminBar.php +335 -0
  4. booster/Elementor.php +240 -0
  5. booster/Gutenberg.php +32 -0
  6. booster/List.php +85 -0
  7. booster/TWBLibrary.php +279 -0
  8. booster/assets/css/elementor.css +246 -0
  9. booster/assets/css/elementor_dark.css +12 -0
  10. booster/assets/css/global.css +919 -0
  11. booster/assets/css/speed.css +1512 -0
  12. booster/assets/css/top_banner.css +80 -0
  13. booster/assets/images/button_plus.svg +1 -0
  14. booster/assets/images/check_green.jpg +0 -0
  15. booster/assets/images/check_green_bg.svg +13 -0
  16. booster/assets/images/check_grey.jpg +0 -0
  17. booster/assets/images/check_score.svg +15 -0
  18. booster/assets/images/check_white.png +0 -0
  19. booster/assets/images/close.svg +10 -0
  20. booster/assets/images/close_dark.svg +10 -0
  21. booster/assets/images/close_error.svg +12 -0
  22. booster/assets/images/close_red.svg +11 -0
  23. booster/assets/images/closed_eye.svg +13 -0
  24. booster/assets/images/desktop.svg +15 -0
  25. booster/assets/images/disc.svg +10 -0
  26. booster/assets/images/down_arrow_nav.svg +10 -0
  27. booster/assets/images/fm.svg +6 -0
  28. booster/assets/images/google_spinner.svg +8 -0
  29. booster/assets/images/green-info.svg +16 -0
  30. booster/assets/images/help.svg +1 -0
  31. booster/assets/images/information.svg +12 -0
  32. booster/assets/images/loader.svg +4 -0
  33. booster/assets/images/loader_green.svg +6 -0
  34. booster/assets/images/loader_medium.svg +4 -0
  35. booster/assets/images/loader_small.svg +4 -0
  36. booster/assets/images/loader_small_grey.svg +4 -0
  37. booster/assets/images/logo_dark.svg +6 -0
  38. booster/assets/images/logo_green.svg +13 -0
  39. booster/assets/images/logo_white.svg +8 -0
  40. booster/assets/images/mobile.svg +15 -0
  41. booster/assets/images/not_optimized.svg +6 -0
  42. booster/assets/images/optimize.svg +12 -0
  43. booster/assets/images/pg.svg +9 -0
  44. booster/assets/images/red-info.svg +20 -0
  45. booster/assets/images/reload.svg +10 -0
  46. booster/assets/images/star_grey.jpg +0 -0
  47. booster/assets/images/success.svg +13 -0
  48. booster/assets/images/up_arrow_nav.svg +10 -0
  49. booster/assets/js/circle-progress.js +552 -0
  50. booster/assets/js/global.js +266 -0
  51. booster/assets/js/gutenberg.js +82 -0
  52. booster/assets/js/gutenberg/gutenberg-compiled.asset.php +1 -0
  53. booster/assets/js/gutenberg/gutenberg-compiled.js +208 -0
  54. booster/assets/js/gutenberg/gutenberg-compiled.js.map +1 -0
  55. booster/assets/js/speed.js +452 -0
  56. booster/controller.php +641 -0
  57. booster/init.php +48 -0
  58. booster/main.php +473 -0
  59. booster/model.php +3 -0
  60. booster/view.php +472 -0
  61. form-maker.php +22 -3
  62. framework/WDW_FM_Library.php +3 -4
  63. frontend/models/form_maker.php +10 -0
  64. readme.txt +6 -1
admin/views/Manage_fm.php CHANGED
@@ -2212,6 +2212,965 @@ class FMViewManage_fm extends FMAdminView {
2212
  <?php
2213
  }
2214
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2215
  /**
2216
  * Placeholders popup.
2217
  *
2212
  <?php
2213
  }
2214
 
2215
+ /**
2216
+ * Convert Select field DB placeholder to normal label/value
2217
+ * The main target of converting to make it usable in conditional fields
2218
+ *
2219
+ * @param string $field
2220
+ *
2221
+ * @return string
2222
+ */
2223
+ public function get_label_values_from_db_own_select( $field = '' ) {
2224
+ $params_names = array(
2225
+ 'w_field_label_size',
2226
+ 'w_field_label_pos',
2227
+ 'w_size',
2228
+ 'w_choices',
2229
+ 'w_choices_checked',
2230
+ 'w_choices_disabled',
2231
+ 'w_required',
2232
+ 'w_class',
2233
+ );
2234
+ $temp = $field;
2235
+ if ( strpos($temp, 'w_choices_value') > -1 ) {
2236
+ $params_names = array(
2237
+ 'w_field_label_size',
2238
+ 'w_field_label_pos',
2239
+ 'w_size',
2240
+ 'w_choices',
2241
+ 'w_choices_checked',
2242
+ 'w_choices_disabled',
2243
+ 'w_required',
2244
+ 'w_value_disabled',
2245
+ 'w_choices_value',
2246
+ 'w_choices_params',
2247
+ 'w_class',
2248
+ );
2249
+ }
2250
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
2251
+ $params_names = array(
2252
+ 'w_field_label_size',
2253
+ 'w_field_label_pos',
2254
+ 'w_hide_label',
2255
+ 'w_size',
2256
+ 'w_choices',
2257
+ 'w_choices_checked',
2258
+ 'w_choices_disabled',
2259
+ 'w_required',
2260
+ 'w_value_disabled',
2261
+ 'w_choices_value',
2262
+ 'w_choices_params',
2263
+ 'w_class',
2264
+ );
2265
+ }
2266
+ if ( strpos($temp, 'w_use_for_submission') > -1 ) {
2267
+ $params_names = array(
2268
+ 'w_field_label_size',
2269
+ 'w_field_label_pos',
2270
+ 'w_hide_label',
2271
+ 'w_size',
2272
+ 'w_choices',
2273
+ 'w_choices_checked',
2274
+ 'w_choices_disabled',
2275
+ 'w_required',
2276
+ 'w_value_disabled',
2277
+ 'w_use_for_submission',
2278
+ 'w_choices_value',
2279
+ 'w_choices_params',
2280
+ 'w_class',
2281
+ );
2282
+ }
2283
+
2284
+ foreach ( $params_names as $params_name ) {
2285
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2286
+ $param[$params_name] = esc_html($temp[0]);
2287
+ $temp = $temp[1];
2288
+ }
2289
+
2290
+ $param['w_choices'] = explode('***', $param['w_choices']);
2291
+ $param['w_choices_value'] = explode('***', $param['w_choices_value']);
2292
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2293
+
2294
+ $return_data = $field;
2295
+ foreach ( $param['w_choices'] as $key => $choice ) {
2296
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2297
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2298
+ $where_str = $w_choices_params[0];
2299
+ $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array(
2300
+ '[',
2301
+ ']'
2302
+ ), '', $where_str) : '');
2303
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2304
+ $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2305
+ $db_info = $w_choices_params[1];
2306
+ $label_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $choice));
2307
+ $table = $label_table_and_column[0];
2308
+ $label_column = $label_table_and_column[1];
2309
+ if ( $label_column ) {
2310
+ $choices_labels = WDW_FM_Library::select_data_from_db_for_labels( $db_info, $label_column, $table, $where, $order_by );
2311
+ $temp_choices_labels = array();
2312
+ foreach ( $choices_labels as $choices_label ) {
2313
+ $temp_choices_labels[] = $choices_label[0];
2314
+ }
2315
+ $choices_labels = $temp_choices_labels;
2316
+ }
2317
+ $value_table_and_column = explode(':', str_replace(array(
2318
+ '[',
2319
+ ']'
2320
+ ), '', $param['w_choices_value'][$key]));
2321
+ $value_column = $param['w_choices_disabled'][$key] == "true" ? '' : $value_table_and_column[1];
2322
+ if ( $value_column ) {
2323
+ $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
2324
+ $temp_choices_values = array();
2325
+ foreach ( $choices_values as $choices_value ) {
2326
+ $temp_choices_values[] = $choices_value[0];
2327
+ }
2328
+ $choices_values = $temp_choices_values;
2329
+ }
2330
+
2331
+ $choices_labels = implode('***', $choices_labels);
2332
+ $choices_values = implode('***', $choices_values);
2333
+
2334
+ $return_data = str_replace(array($param['w_choices'][$key], $param['w_choices_value'][$key]), array($choices_labels, $choices_values), $return_data);
2335
+
2336
+ }
2337
+ }
2338
+ return $return_data;
2339
+ }
2340
+
2341
+
2342
+ /**
2343
+ * Convert Radio field DB placeholder to normal label/value
2344
+ * The main target of converting to make it usable in conditional fields
2345
+ *
2346
+ * @param string $field
2347
+ *
2348
+ * @return string
2349
+ */
2350
+ public function get_label_values_from_db_radio( $field = '' ) {
2351
+ $params_names = array(
2352
+ 'w_field_label_size',
2353
+ 'w_field_label_pos',
2354
+ 'w_flow',
2355
+ 'w_choices',
2356
+ 'w_choices_checked',
2357
+ 'w_rowcol',
2358
+ 'w_required',
2359
+ 'w_randomize',
2360
+ 'w_allow_other',
2361
+ 'w_allow_other_num',
2362
+ 'w_class',
2363
+ );
2364
+ $temp = $field;
2365
+ if ( strpos($temp, 'w_field_option_pos') > -1 ) {
2366
+ $params_names = array(
2367
+ 'w_field_label_size',
2368
+ 'w_field_label_pos',
2369
+ 'w_field_option_pos',
2370
+ 'w_flow',
2371
+ 'w_choices',
2372
+ 'w_choices_checked',
2373
+ 'w_rowcol',
2374
+ 'w_required',
2375
+ 'w_randomize',
2376
+ 'w_allow_other',
2377
+ 'w_allow_other_num',
2378
+ 'w_value_disabled',
2379
+ 'w_choices_value',
2380
+ 'w_choices_params',
2381
+ 'w_class',
2382
+ );
2383
+ }
2384
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
2385
+ $params_names = array(
2386
+ 'w_field_label_size',
2387
+ 'w_field_label_pos',
2388
+ 'w_field_option_pos',
2389
+ 'w_hide_label',
2390
+ 'w_flow',
2391
+ 'w_choices',
2392
+ 'w_choices_checked',
2393
+ 'w_rowcol',
2394
+ 'w_required',
2395
+ 'w_randomize',
2396
+ 'w_allow_other',
2397
+ 'w_allow_other_num',
2398
+ 'w_value_disabled',
2399
+ 'w_choices_value',
2400
+ 'w_choices_params',
2401
+ 'w_class',
2402
+ );
2403
+ }
2404
+ if ( strpos($temp, 'w_use_for_submission') > -1 ) {
2405
+ $params_names = array(
2406
+ 'w_field_label_size',
2407
+ 'w_field_label_pos',
2408
+ 'w_field_option_pos',
2409
+ 'w_hide_label',
2410
+ 'w_flow',
2411
+ 'w_choices',
2412
+ 'w_choices_checked',
2413
+ 'w_rowcol',
2414
+ 'w_required',
2415
+ 'w_randomize',
2416
+ 'w_allow_other',
2417
+ 'w_allow_other_num',
2418
+ 'w_value_disabled',
2419
+ 'w_use_for_submission',
2420
+ 'w_choices_value',
2421
+ 'w_choices_params',
2422
+ 'w_class',
2423
+ );
2424
+ }
2425
+
2426
+ foreach ( $params_names as $params_name ) {
2427
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2428
+ if ( $params_name == 'w_choices' ) {
2429
+ $param[$params_name] = strip_tags($temp[0], "<b><strong><span><a>");
2430
+ } else {
2431
+ $param[$params_name] = esc_html($temp[0]);
2432
+ }
2433
+
2434
+ $temp = $temp[1];
2435
+ }
2436
+
2437
+ $param['w_choices'] = explode('***', $param['w_choices']);
2438
+ $param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
2439
+ if ( isset($param['w_choices_value']) ) {
2440
+ $param['w_choices_value'] = explode('***', $param['w_choices_value']);
2441
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2442
+ }
2443
+
2444
+ $return_data = $field;
2445
+ foreach ( $param['w_choices'] as $key => $choice ) {
2446
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2447
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2448
+ $where_str = $w_choices_params[0];
2449
+ $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array(
2450
+ '[',
2451
+ ']',
2452
+ ), '', $where_str) : '');
2453
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2454
+ $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2455
+ $db_info = $w_choices_params[1];
2456
+ $label_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $choice));
2457
+ $table = $label_table_and_column[0];
2458
+ $label_column = $label_table_and_column[1];
2459
+ if ( $label_column ) {
2460
+ $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
2461
+ $temp_choices_labels = array();
2462
+ foreach ( $choices_labels as $choices_label ) {
2463
+ $temp_choices_labels[] = $choices_label[0];
2464
+ }
2465
+ $choices_labels = $temp_choices_labels;
2466
+ }
2467
+ $value_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $param['w_choices_value'][$key]));
2468
+ $value_column = $value_table_and_column[1];
2469
+ if ( $value_column ) {
2470
+ $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
2471
+ $temp_choices_values = array();
2472
+ foreach ( $choices_values as $choices_value ) {
2473
+ $temp_choices_values[] = $choices_value[0];
2474
+ }
2475
+ $choices_values = $temp_choices_values;
2476
+ }
2477
+ $choices_labels = implode('***', $choices_labels);
2478
+ $choices_values = implode('***', $choices_values);
2479
+ $return_data = str_replace(array(
2480
+ $param['w_choices'][$key],
2481
+ $param['w_choices_value'][$key]
2482
+ ), array( $choices_labels, $choices_values ), $return_data);
2483
+ }
2484
+ }
2485
+ return $return_data;
2486
+ }
2487
+
2488
+
2489
+ /**
2490
+ * Convert Checkbox field DB placeholder to normal label/value
2491
+ * The main target of converting to make it usable in conditional fields
2492
+ *
2493
+ * @param string $field
2494
+ *
2495
+ * @return string
2496
+ */
2497
+ public function get_label_values_from_db_checkbox( $field = '' ) {
2498
+ $params_names = array(
2499
+ 'w_field_label_size',
2500
+ 'w_field_label_pos',
2501
+ 'w_flow',
2502
+ 'w_choices',
2503
+ 'w_choices_checked',
2504
+ 'w_rowcol',
2505
+ 'w_required',
2506
+ 'w_randomize',
2507
+ 'w_allow_other',
2508
+ 'w_allow_other_num',
2509
+ 'w_class',
2510
+ );
2511
+ $temp = $field;
2512
+ if ( strpos($temp, 'w_field_option_pos') > -1 ) {
2513
+ $params_names = array(
2514
+ 'w_field_label_size',
2515
+ 'w_field_label_pos',
2516
+ 'w_field_option_pos',
2517
+ 'w_flow',
2518
+ 'w_choices',
2519
+ 'w_choices_checked',
2520
+ 'w_rowcol',
2521
+ 'w_required',
2522
+ 'w_randomize',
2523
+ 'w_allow_other',
2524
+ 'w_allow_other_num',
2525
+ 'w_value_disabled',
2526
+ 'w_choices_value',
2527
+ 'w_choices_params',
2528
+ 'w_class',
2529
+ );
2530
+ }
2531
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
2532
+ $params_names = array(
2533
+ 'w_field_label_size',
2534
+ 'w_field_label_pos',
2535
+ 'w_field_option_pos',
2536
+ 'w_hide_label',
2537
+ 'w_flow',
2538
+ 'w_choices',
2539
+ 'w_choices_checked',
2540
+ 'w_rowcol',
2541
+ 'w_required',
2542
+ 'w_randomize',
2543
+ 'w_allow_other',
2544
+ 'w_allow_other_num',
2545
+ 'w_value_disabled',
2546
+ 'w_choices_value',
2547
+ 'w_choices_params',
2548
+ 'w_class',
2549
+ );
2550
+ }
2551
+ if ( strpos($temp, 'w_limit_choice') > -1 ) {
2552
+ $params_names = array(
2553
+ 'w_field_label_size',
2554
+ 'w_field_label_pos',
2555
+ 'w_field_option_pos',
2556
+ 'w_hide_label',
2557
+ 'w_flow',
2558
+ 'w_choices',
2559
+ 'w_choices_checked',
2560
+ 'w_rowcol',
2561
+ 'w_limit_choice',
2562
+ 'w_limit_choice_alert',
2563
+ 'w_required',
2564
+ 'w_randomize',
2565
+ 'w_allow_other',
2566
+ 'w_allow_other_num',
2567
+ 'w_value_disabled',
2568
+ 'w_choices_value',
2569
+ 'w_choices_params',
2570
+ 'w_class',
2571
+ );
2572
+ }
2573
+ if ( strpos($temp, 'w_use_for_submission') > -1 ) {
2574
+ $params_names = array(
2575
+ 'w_field_label_size',
2576
+ 'w_field_label_pos',
2577
+ 'w_field_option_pos',
2578
+ 'w_hide_label',
2579
+ 'w_flow',
2580
+ 'w_choices',
2581
+ 'w_choices_checked',
2582
+ 'w_rowcol',
2583
+ 'w_limit_choice',
2584
+ 'w_limit_choice_alert',
2585
+ 'w_required',
2586
+ 'w_randomize',
2587
+ 'w_allow_other',
2588
+ 'w_allow_other_num',
2589
+ 'w_value_disabled',
2590
+ 'w_use_for_submission',
2591
+ 'w_choices_value',
2592
+ 'w_choices_params',
2593
+ 'w_class',
2594
+ );
2595
+ }
2596
+
2597
+ foreach ( $params_names as $params_name ) {
2598
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2599
+ if ( $params_name == 'w_choices' ) {
2600
+ $param[$params_name] = strip_tags($temp[0], "<b><strong><span><a>");
2601
+ } else {
2602
+ $param[$params_name] = esc_html($temp[0]);
2603
+ }
2604
+ $temp = $temp[1];
2605
+ }
2606
+
2607
+ $param['w_choices'] = explode('***', $param['w_choices']);
2608
+ if ( isset($param['w_choices_value']) ) {
2609
+ $param['w_choices_value'] = explode('***', $param['w_choices_value']);
2610
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2611
+ }
2612
+
2613
+ $return_data = $field;
2614
+ foreach ( $param['w_choices'] as $key => $choice ) {
2615
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2616
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2617
+ $where_str = $w_choices_params[0];
2618
+ $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array(
2619
+ '[',
2620
+ ']',
2621
+ ), '', $where_str) : '');
2622
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2623
+ $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2624
+ $db_info = $w_choices_params[1];
2625
+ $label_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $choice));
2626
+ $table = $label_table_and_column[0];
2627
+ $label_column = $label_table_and_column[1];
2628
+ if ( $label_column ) {
2629
+ $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
2630
+ $temp_choices_labels = array();
2631
+ foreach ( $choices_labels as $choices_label ) {
2632
+ $temp_choices_labels[] = $choices_label[0];
2633
+ }
2634
+ $choices_labels = $temp_choices_labels;
2635
+
2636
+ }
2637
+ $value_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $param['w_choices_value'][$key]));
2638
+ $value_column = $value_table_and_column[1];
2639
+ if ( $value_column ) {
2640
+ $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
2641
+ $temp_choices_values = array();
2642
+ foreach ( $choices_values as $choices_value ) {
2643
+ $temp_choices_values[] = $choices_value[0];
2644
+ }
2645
+ $choices_values = $temp_choices_values;
2646
+ }
2647
+ $choices_labels = implode('***', $choices_labels);
2648
+ $choices_values = implode('***', $choices_values);
2649
+
2650
+ $return_data = str_replace(array($param['w_choices'][$key], $param['w_choices_value'][$key]), array($choices_labels, $choices_values), $return_data);
2651
+ }
2652
+ }
2653
+ return $return_data;
2654
+ }
2655
+
2656
+ /**
2657
+ * Convert Payment Select field DB placeholder to normal label/value
2658
+ * The main target of converting to make it usable in conditional fields
2659
+ *
2660
+ * @param string $field
2661
+ *
2662
+ * @return string
2663
+ */
2664
+ public function get_label_values_from_db_paypal_select( $field = '' ) {
2665
+ $params_names = array(
2666
+ 'w_field_label_size',
2667
+ 'w_field_label_pos',
2668
+ 'w_size',
2669
+ 'w_choices',
2670
+ 'w_choices_price',
2671
+ 'w_choices_checked',
2672
+ 'w_choices_disabled',
2673
+ 'w_required',
2674
+ 'w_quantity',
2675
+ 'w_quantity_value',
2676
+ 'w_class',
2677
+ 'w_property',
2678
+ 'w_property_values',
2679
+ );
2680
+ $temp = $field;
2681
+ if ( strpos($temp, 'w_choices_params') > -1 ) {
2682
+ $params_names = array(
2683
+ 'w_field_label_size',
2684
+ 'w_field_label_pos',
2685
+ 'w_size',
2686
+ 'w_choices',
2687
+ 'w_choices_price',
2688
+ 'w_choices_checked',
2689
+ 'w_choices_disabled',
2690
+ 'w_required',
2691
+ 'w_quantity',
2692
+ 'w_quantity_value',
2693
+ 'w_choices_params',
2694
+ 'w_class',
2695
+ 'w_property',
2696
+ 'w_property_values',
2697
+ );
2698
+ }
2699
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
2700
+ $params_names = array(
2701
+ 'w_field_label_size',
2702
+ 'w_field_label_pos',
2703
+ 'w_hide_label',
2704
+ 'w_size',
2705
+ 'w_choices',
2706
+ 'w_choices_price',
2707
+ 'w_choices_checked',
2708
+ 'w_choices_disabled',
2709
+ 'w_required',
2710
+ 'w_quantity',
2711
+ 'w_quantity_value',
2712
+ 'w_choices_params',
2713
+ 'w_class',
2714
+ 'w_property',
2715
+ 'w_property_values',
2716
+ );
2717
+ }
2718
+
2719
+ foreach ( $params_names as $params_name ) {
2720
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2721
+ $param[$params_name] = esc_html($temp[0]);
2722
+ $temp = $temp[1];
2723
+ }
2724
+ $param['w_choices'] = explode('***', $param['w_choices']);
2725
+ $param['w_choices_price'] = explode('***', $param['w_choices_price']);
2726
+ $param['w_choices_disabled'] = explode('***', $param['w_choices_disabled']);
2727
+ if ( isset($param['w_choices_params']) ) {
2728
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2729
+ }
2730
+
2731
+ $return_data = $field;
2732
+ foreach ( $param['w_choices'] as $key => $choice ) {
2733
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2734
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2735
+ $where_str = $w_choices_params[0];
2736
+ $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array(
2737
+ '[',
2738
+ ']'
2739
+ ), '', $where_str) : '');
2740
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2741
+ $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2742
+ $db_info = $w_choices_params[1];
2743
+ $label_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $choice));
2744
+ $table = $label_table_and_column[0];
2745
+ $label_column = $label_table_and_column[1];
2746
+ if ( $label_column ) {
2747
+ $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
2748
+ $temp_choices_labels = array();
2749
+ foreach ( $choices_labels as $choices_label ) {
2750
+ $temp_choices_labels[] = $choices_label[0];
2751
+ }
2752
+ $choices_labels = $temp_choices_labels;
2753
+ }
2754
+ $value_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $param['w_choices_price'][$key]));
2755
+ $value_column = $param['w_choices_disabled'][$key] == "true" ? '' : $value_table_and_column[1];
2756
+ if ( $value_column ) {
2757
+ $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
2758
+ $temp_choices_values = array();
2759
+ foreach ( $choices_values as $choices_value ) {
2760
+ $temp_choices_values[] = $choices_value[0];
2761
+ }
2762
+ $choices_values = $temp_choices_values;
2763
+ }
2764
+ $choices_labels = implode('***', $choices_labels);
2765
+ $choices_values = implode('***', $choices_values);
2766
+
2767
+ $return_data = str_replace(array($param['w_choices'][$key], $param['w_choices_price'][$key]), array($choices_labels, $choices_values), $return_data);
2768
+ }
2769
+ }
2770
+
2771
+ return $return_data;
2772
+ }
2773
+
2774
+ /**
2775
+ * Convert Payment Checkbox field DB placeholder to normal label/value
2776
+ * The main target of converting to make it usable in conditional fields
2777
+ *
2778
+ * @param string $field
2779
+ *
2780
+ * @return string
2781
+ */
2782
+ public function get_label_values_from_db_paypal_checkbox( $field = '' ) {
2783
+ $params_names = array(
2784
+ 'w_field_label_size',
2785
+ 'w_field_label_pos',
2786
+ 'w_flow',
2787
+ 'w_choices',
2788
+ 'w_choices_price',
2789
+ 'w_choices_checked',
2790
+ 'w_required',
2791
+ 'w_randomize',
2792
+ 'w_allow_other',
2793
+ 'w_allow_other_num',
2794
+ 'w_class',
2795
+ 'w_property',
2796
+ 'w_property_values',
2797
+ 'w_quantity',
2798
+ 'w_quantity_value',
2799
+ );
2800
+ $temp = $field;
2801
+ if ( strpos($temp, 'w_field_option_pos') > -1 ) {
2802
+ $params_names = array(
2803
+ 'w_field_label_size',
2804
+ 'w_field_label_pos',
2805
+ 'w_field_option_pos',
2806
+ 'w_flow',
2807
+ 'w_choices',
2808
+ 'w_choices_price',
2809
+ 'w_choices_checked',
2810
+ 'w_required',
2811
+ 'w_randomize',
2812
+ 'w_allow_other',
2813
+ 'w_allow_other_num',
2814
+ 'w_choices_params',
2815
+ 'w_class',
2816
+ 'w_property',
2817
+ 'w_property_values',
2818
+ 'w_quantity',
2819
+ 'w_quantity_value',
2820
+ );
2821
+ }
2822
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
2823
+ $params_names = array(
2824
+ 'w_field_label_size',
2825
+ 'w_field_label_pos',
2826
+ 'w_field_option_pos',
2827
+ 'w_hide_label',
2828
+ 'w_flow',
2829
+ 'w_choices',
2830
+ 'w_choices_price',
2831
+ 'w_choices_checked',
2832
+ 'w_required',
2833
+ 'w_randomize',
2834
+ 'w_allow_other',
2835
+ 'w_allow_other_num',
2836
+ 'w_choices_params',
2837
+ 'w_class',
2838
+ 'w_property',
2839
+ 'w_property_values',
2840
+ 'w_quantity',
2841
+ 'w_quantity_value',
2842
+ );
2843
+ }
2844
+
2845
+ foreach ( $params_names as $params_name ) {
2846
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2847
+ $param[$params_name] = esc_html($temp[0]);
2848
+ $temp = $temp[1];
2849
+ }
2850
+
2851
+ $param['w_choices'] = explode('***', $param['w_choices']);
2852
+ $param['w_choices_price'] = explode('***', $param['w_choices_price']);
2853
+ if ( isset($param['w_choices_params']) ) {
2854
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2855
+ }
2856
+
2857
+ $return_data = $field;
2858
+ foreach ( $param['w_choices'] as $key => $choice ) {
2859
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2860
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2861
+ $where_str = $w_choices_params[0];
2862
+ $where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array('[',']'), '', $where_str) : '');
2863
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2864
+ $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2865
+ $db_info = $w_choices_params[1];
2866
+ $label_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $choice));
2867
+ $table = $label_table_and_column[0];
2868
+ $label_column = $label_table_and_column[1];
2869
+ if ( $label_column ) {
2870
+ $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
2871
+ $temp_choices_labels = array();
2872
+ foreach ( $choices_labels as $choices_label ) {
2873
+ $temp_choices_labels[] = $choices_label[0];
2874
+ }
2875
+ $choices_labels = $temp_choices_labels;
2876
+ }
2877
+ $value_table_and_column = explode(':', str_replace(array(
2878
+ '[',
2879
+ ']',
2880
+ ), '', $param['w_choices_price'][$key]));
2881
+ $value_column = $value_table_and_column[1];
2882
+ if ( $value_column ) {
2883
+ $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
2884
+ $temp_choices_values = array();
2885
+ foreach ( $choices_values as $choices_value ) {
2886
+ $temp_choices_values[] = $choices_value[0];
2887
+ }
2888
+ $choices_values = $temp_choices_values;
2889
+ }
2890
+ $choices_labels = implode('***', $choices_labels);
2891
+ $choices_values = implode('***', $choices_values);
2892
+
2893
+ $return_data = str_replace(array($param['w_choices'][$key], $param['w_choices_price'][$key]), array($choices_labels, $choices_values), $return_data);
2894
+ }
2895
+ }
2896
+ return $return_data;
2897
+ }
2898
+
2899
+ /**
2900
+ * Convert Payment Radio field DB placeholder to normal label/value
2901
+ * The main target of converting to make it usable in conditional fields
2902
+ *
2903
+ * @param string $field
2904
+ *
2905
+ * @return string
2906
+ */
2907
+ public function get_label_values_from_db_paypal_radio( $field = '' ) {
2908
+ $params_names = array(
2909
+ 'w_field_label_size',
2910
+ 'w_field_label_pos',
2911
+ 'w_flow',
2912
+ 'w_choices',
2913
+ 'w_choices_price',
2914
+ 'w_choices_checked',
2915
+ 'w_required',
2916
+ 'w_randomize',
2917
+ 'w_allow_other',
2918
+ 'w_allow_other_num',
2919
+ 'w_class',
2920
+ 'w_property',
2921
+ 'w_property_values',
2922
+ 'w_quantity',
2923
+ 'w_quantity_value',
2924
+ );
2925
+ $temp = $field;
2926
+ if ( strpos($temp, 'w_field_option_pos') > -1 ) {
2927
+ $params_names = array(
2928
+ 'w_field_label_size',
2929
+ 'w_field_label_pos',
2930
+ 'w_field_option_pos',
2931
+ 'w_flow',
2932
+ 'w_choices',
2933
+ 'w_choices_price',
2934
+ 'w_choices_checked',
2935
+ 'w_required',
2936
+ 'w_randomize',
2937
+ 'w_allow_other',
2938
+ 'w_allow_other_num',
2939
+ 'w_choices_params',
2940
+ 'w_class',
2941
+ 'w_property',
2942
+ 'w_property_values',
2943
+ 'w_quantity',
2944
+ 'w_quantity_value',
2945
+ );
2946
+ }
2947
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
2948
+ $params_names = array(
2949
+ 'w_field_label_size',
2950
+ 'w_field_label_pos',
2951
+ 'w_field_option_pos',
2952
+ 'w_hide_label',
2953
+ 'w_flow',
2954
+ 'w_choices',
2955
+ 'w_choices_price',
2956
+ 'w_choices_checked',
2957
+ 'w_required',
2958
+ 'w_randomize',
2959
+ 'w_allow_other',
2960
+ 'w_allow_other_num',
2961
+ 'w_choices_params',
2962
+ 'w_class',
2963
+ 'w_property',
2964
+ 'w_property_values',
2965
+ 'w_quantity',
2966
+ 'w_quantity_value',
2967
+ );
2968
+ }
2969
+
2970
+ foreach ( $params_names as $params_name ) {
2971
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2972
+ $param[$params_name] = esc_html($temp[0]);
2973
+ $temp = $temp[1];
2974
+ }
2975
+
2976
+ $param['w_choices'] = explode('***', $param['w_choices']);
2977
+ $param['w_choices_price'] = explode('***', $param['w_choices_price']);
2978
+ if ( isset($param['w_choices_params']) ) {
2979
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
2980
+ }
2981
+
2982
+ $return_data = $field;
2983
+ foreach ( $param['w_choices'] as $key => $choice ) {
2984
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2985
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2986
+ $where_str = $w_choices_params[0];
2987
+ $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array('[',']'), '', $where_str) : '');
2988
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2989
+ $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2990
+ $db_info = $w_choices_params[1];
2991
+ $label_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $choice));
2992
+ $table = $label_table_and_column[0];
2993
+ $label_column = $label_table_and_column[1];
2994
+ if ( $label_column ) {
2995
+ $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
2996
+ $temp_choices_labels = array();
2997
+ foreach ( $choices_labels as $choices_label ) {
2998
+ $temp_choices_labels[] = $choices_label[0];
2999
+ }
3000
+ $choices_labels = $temp_choices_labels;
3001
+ }
3002
+ $value_table_and_column = explode(':', str_replace(array(
3003
+ '[',
3004
+ ']',
3005
+ ), '', $param['w_choices_price'][$key]));
3006
+ $value_column = $value_table_and_column[1];
3007
+ if ( $value_column ) {
3008
+ $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
3009
+ $temp_choices_values = array();
3010
+ foreach ( $choices_values as $choices_value ) {
3011
+ $temp_choices_values[] = $choices_value[0];
3012
+ }
3013
+ $choices_values = $temp_choices_values;
3014
+ }
3015
+ $choices_labels = implode('***', $choices_labels);
3016
+ $choices_values = implode('***', $choices_values);
3017
+ $return_data = str_replace(array(
3018
+ $param['w_choices'][$key],
3019
+ $param['w_choices_price'][$key]
3020
+ ), array( $choices_labels, $choices_values ), $return_data); }
3021
+ }
3022
+ return $return_data;
3023
+ }
3024
+
3025
+ /**
3026
+ * Convert Payment Shipping Radio field DB placeholder to normal label/value
3027
+ * The main target of converting to make it usable in conditional fields
3028
+ *
3029
+ * @param string $field
3030
+ *
3031
+ * @return string
3032
+ */
3033
+ public function get_label_values_from_db_paypal_shipping( $field = '' ) {
3034
+ $params_names = array(
3035
+ 'w_field_label_size',
3036
+ 'w_field_label_pos',
3037
+ 'w_flow',
3038
+ 'w_choices',
3039
+ 'w_choices_price',
3040
+ 'w_choices_checked',
3041
+ 'w_required',
3042
+ 'w_randomize',
3043
+ 'w_allow_other',
3044
+ 'w_allow_other_num',
3045
+ 'w_class',
3046
+ );
3047
+ $temp = $field;
3048
+ if ( strpos($temp, 'w_field_option_pos') > -1 ) {
3049
+ $params_names = array(
3050
+ 'w_field_label_size',
3051
+ 'w_field_label_pos',
3052
+ 'w_field_option_pos',
3053
+ 'w_flow',
3054
+ 'w_choices',
3055
+ 'w_choices_price',
3056
+ 'w_choices_checked',
3057
+ 'w_required',
3058
+ 'w_randomize',
3059
+ 'w_allow_other',
3060
+ 'w_allow_other_num',
3061
+ 'w_choices_params',
3062
+ 'w_class',
3063
+ );
3064
+ }
3065
+ if ( strpos($temp, 'w_hide_label') > -1 ) {
3066
+ $params_names = array(
3067
+ 'w_field_label_size',
3068
+ 'w_field_label_pos',
3069
+ 'w_field_option_pos',
3070
+ 'w_hide_label',
3071
+ 'w_flow',
3072
+ 'w_choices',
3073
+ 'w_choices_price',
3074
+ 'w_choices_checked',
3075
+ 'w_required',
3076
+ 'w_randomize',
3077
+ 'w_allow_other',
3078
+ 'w_allow_other_num',
3079
+ 'w_choices_params',
3080
+ 'w_class',
3081
+ );
3082
+ }
3083
+
3084
+ foreach ( $params_names as $params_name ) {
3085
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
3086
+ $param[$params_name] = esc_html($temp[0]);
3087
+ $temp = $temp[1];
3088
+ }
3089
+
3090
+ $param['w_choices'] = explode('***', $param['w_choices']);
3091
+ $param['w_choices_price'] = explode('***', $param['w_choices_price']);
3092
+ if ( isset($param['w_choices_params']) ) {
3093
+ $param['w_choices_params'] = explode('***', $param['w_choices_params']);
3094
+ }
3095
+
3096
+ $return_data = $field;
3097
+ foreach ( $param['w_choices'] as $key => $choice ) {
3098
+ if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
3099
+ $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
3100
+ $where_str = $w_choices_params[0];
3101
+ $where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array('[',']'), '', $where_str) : '');
3102
+ $w_choices_params = explode('[db_info]', $w_choices_params[1]);
3103
+ $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
3104
+ $db_info = $w_choices_params[1];
3105
+ $label_table_and_column = explode(':', str_replace(array( '[', ']' ), '', $choice));
3106
+ $table = $label_table_and_column[0];
3107
+ $label_column = $label_table_and_column[1];
3108
+ if ( $label_column ) {
3109
+ $choices_labels = WDW_FM_Library::select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
3110
+ $temp_choices_labels = array();
3111
+ foreach ( $choices_labels as $choices_label ) {
3112
+ $temp_choices_labels[] = $choices_label[0];
3113
+ }
3114
+ $choices_labels = $temp_choices_labels;
3115
+ }
3116
+ $value_table_and_column = explode(':', str_replace(array('[', ']'), '', $param['w_choices_price'][$key]));
3117
+ $value_column = $value_table_and_column[1];
3118
+ if ( $value_column ) {
3119
+ $choices_values = WDW_FM_Library::select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
3120
+ $temp_choices_values = array();
3121
+ foreach ( $choices_values as $choices_value ) {
3122
+ $temp_choices_values[] = $choices_value[0];
3123
+ }
3124
+ $choices_values = $temp_choices_values;
3125
+ }
3126
+ $choices_labels = implode('***', $choices_labels);
3127
+ $choices_values = implode('***', $choices_values);
3128
+ $return_data = str_replace(array(
3129
+ $param['w_choices'][$key],
3130
+ $param['w_choices_price'][$key]
3131
+ ), array( $choices_labels, $choices_values ), $return_data);
3132
+ }
3133
+ }
3134
+ return $return_data;
3135
+ }
3136
+
3137
+
3138
+ /**
3139
+ * Get from DB and convert to label/value if used option "From Database" for select, radio, checkbox
3140
+ * The main target of converting to make it usable in conditional fields
3141
+ *
3142
+ * @param string $field
3143
+ * @param string $type
3144
+ *
3145
+ * @return string
3146
+ */
3147
+ public function get_label_values_from_db( $field = '', $type = '' ) {
3148
+ switch ( $type ) {
3149
+ case 'type_own_select':
3150
+ return $this->get_label_values_from_db_own_select( $field );
3151
+ break;
3152
+ case 'type_radio':
3153
+ return $this->get_label_values_from_db_radio( $field );
3154
+ break;
3155
+ case 'type_checkbox':
3156
+ return $this->get_label_values_from_db_checkbox( $field );
3157
+ break;
3158
+ case 'type_paypal_select':
3159
+ return $this->get_label_values_from_db_paypal_select( $field );
3160
+ break;
3161
+ case 'type_paypal_checkbox':
3162
+ return $this->get_label_values_from_db_paypal_checkbox( $field );
3163
+ break;
3164
+ case 'type_paypal_radio':
3165
+ return $this->get_label_values_from_db_paypal_radio( $field );
3166
+ break;
3167
+ case 'type_paypal_shipping':
3168
+ return $this->get_label_values_from_db_paypal_shipping( $field );
3169
+ break;
3170
+ }
3171
+ return $field;
3172
+ }
3173
+
3174
  /**
3175
  * Placeholders popup.
3176
  *
admin/views/Submissions_fm.php CHANGED
@@ -761,6 +761,9 @@ class FMViewSubmissions_fm extends FMAdminView {
761
  <img src="<?php echo $textdata['text']; ?>" style="width:50px; border: 1px solid #ddd;"/>
762
  <?php
763
  }
 
 
 
764
  else {
765
  /* Check for Stripe case */
766
  if ( $sorted_label_types[$h] == "type_paypal_payment_status" && $textdata['text'] == "requires_capture" ) {
761
  <img src="<?php echo $textdata['text']; ?>" style="width:50px; border: 1px solid #ddd;"/>
762
  <?php
763
  }
764
+ elseif ( $sorted_label_types[$h] == 'type_hidden' ) {
765
+ echo html_entity_decode($element_value);
766
+ }
767
  else {
768
  /* Check for Stripe case */
769
  if ( $sorted_label_types[$h] == "type_paypal_payment_status" && $textdata['text'] == "requires_capture" ) {
booster/AdminBar.php ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class OptimizerAdminBar
4
+ */
5
+ class TWBAdminBar
6
+ {
7
+ private $booster;
8
+
9
+ private $page_speed_status;
10
+
11
+ /* Keeping ongoing data of progresses to show notification popup*/
12
+ private $notification_data = array( 'inprogress' => array(), 'completed' => array() );
13
+ /* Set 1 if need to show notification */
14
+ private $show_notification_popup = 0;
15
+
16
+ function __construct( $wp_admin_bar, $booster ) {
17
+ $this->twb_get_notification_data();
18
+ /* No need to add adminbar menu in admin if there is no notification data to show */
19
+ if ( is_admin() && !$this->show_notification_popup ) {
20
+ return;
21
+ }
22
+ $this->booster = $booster;
23
+ /* Ajax action which checking notification status and show if response has data */
24
+ if ( isset($_POST['action']) && sanitize_text_field($_POST['action']) == "twb_notif_check" ) {
25
+ $html = '';
26
+ $clearInterval = 1;
27
+ if ( !empty($this->notification_data['completed']) ) {
28
+ $html = $this->twb_popup_notification();
29
+ $changeLogo = 1;
30
+ }
31
+ if ( !empty($this->notification_data['inprogress']) ) {
32
+ $html = $this->twb_popup_notification();
33
+ $clearInterval = 0;
34
+ $changeLogo = 0;
35
+ }
36
+ echo wp_json_encode(array('html' => $html, 'clearInterval' => $clearInterval, 'changeLogo' => $changeLogo));
37
+ die;
38
+ } else {
39
+ global $post;
40
+ if ( !empty($post) ) {
41
+ if ( get_post_status($post->ID) != 'publish' ) {
42
+ return;
43
+ }
44
+ }
45
+
46
+ $this->page_speed_status = TWBLibrary::get_page_speed_status();
47
+ $this->include_style_scripts();
48
+ $wp_admin_bar->add_menu(array(
49
+ 'id' => 'twb_adminbar_info',
50
+ 'title' => $this->twb_admin_menu(),
51
+ 'meta' => array(
52
+ 'target' => '_blank',
53
+ 'class' => $this->booster->cta_button['class'],
54
+ 'html' => $this->twb_admin_bar_menu_content(),
55
+ ),
56
+ ));
57
+ }
58
+ }
59
+
60
+ public function include_style_scripts() {
61
+ wp_enqueue_style(TenWebBooster::PREFIX . '-global');
62
+ wp_enqueue_script(TenWebBooster::PREFIX . '-global');
63
+ }
64
+
65
+ /**
66
+ * Admin bar menu.
67
+ *
68
+ * @return string
69
+ */
70
+ public function twb_admin_menu() {
71
+ if ( !is_admin() ) {
72
+ $img = '';
73
+ $className = '';
74
+ $title = '';
75
+ if ( $this->page_speed_status == 'notstarted' ) {
76
+ $img = '<img class="twb_menu_logo" src="' . $this->booster->plugin_url . '/assets/images/logo_white.svg" />';
77
+ $img .= '<img class="twb-hidden twb_not_optimized_logo" src="' . $this->booster->plugin_url . '/assets/images/not_optimized.svg" />';
78
+ $title = '<div class="twb_menu_logo">'.__("Check PageSpeed Score", 'tenweb-booster').'</div>';
79
+ $title .= '<div class="twb-hidden twb_not_optimized_logo">'.__("Not optimized", 'tenweb-booster').'</div>';
80
+ } elseif ( $this->page_speed_status == 'inprogress' ) {
81
+ $img = '<img class="twb_menu_logo" src="' . $this->booster->plugin_url . '/assets/images/logo_white.svg" />';
82
+ $img .= '<img class="twb-hidden twb_not_optimized_menu_logo" src="' . $this->booster->plugin_url . '/assets/images/not_optimized.svg" />';
83
+ $className = ' twb_score_inprogress';
84
+ $title = '<div class="twb_menu_logo">'.__("Check PageSpeed Score", 'tenweb-booster').'</div>';
85
+ $title .= '<div class="twb-hidden twb_not_optimized_logo">'.__("Not optimized", 'tenweb-booster').'</div>';
86
+ } elseif ( $this->page_speed_status == 'completed' || $this->page_speed_status == 'error' ) {
87
+ $img = '<img src="' . $this->booster->plugin_url . '/assets/images/not_optimized.svg" />';
88
+ $title = __("Not optimized", 'tenweb-booster');
89
+ $className = ' twb_not_optimized';
90
+ }
91
+ $twb_admin_bar_menu = '<div class="twb_admin_bar_menu twb_frontend' . $className . '"><div class="twb_admin_bar_menu_header' . $className . '">' . $img . " " . $title . '</div><div class="twb_vr"></div><span></span></div>';
92
+ } else {
93
+ if ( $this->show_notification_popup ) {
94
+ $className = 'twb_backend_optimizing_logo';
95
+ if( empty($this->notification_data['inprogress']) ) {
96
+ $className = "twb_backend_not_optimized_logo";
97
+ }
98
+ $twb_admin_bar_menu = '<div class="twb_admin_bar_menu twb_backend"><div class="twb_admin_bar_menu_header"><span class="'.$className.'"></span></div></div>';
99
+ }
100
+ }
101
+ return $twb_admin_bar_menu;
102
+ }
103
+
104
+ /**
105
+ * Adminbar menu content.
106
+ *
107
+ * @return string
108
+ */
109
+ public function twb_admin_bar_menu_content()
110
+ {
111
+ ob_start();
112
+ if( is_admin() ) {
113
+ /* Notification for in progress optimizing */
114
+ echo $this->twb_popup_notification();
115
+ }
116
+ ?>
117
+ <div class="twb_admin_bar_menu_main twb-hidden">
118
+ <?php
119
+
120
+ if ( !is_admin() ) {
121
+ if ( $this->page_speed_status == 'notstarted' ) {
122
+ $this->twb_front_score_not_counted_content();
123
+ } elseif ( $this->page_speed_status == 'inprogress' ) {
124
+ $this->twb_front_score_in_progress_content();
125
+ } elseif ( $this->page_speed_status == 'error' ) {
126
+ $this->twb_front_score_error_content();
127
+ } else {
128
+ $this->twb_front_score_counted_content();
129
+ }
130
+ }
131
+ ?>
132
+ </div>
133
+ <?php
134
+ return ob_get_clean();
135
+ }
136
+
137
+ /* Content of admin menu if score not counted*/
138
+ public function twb_front_score_not_counted_content() {
139
+ global $post;
140
+ if ( empty($post) ) {
141
+ return false;
142
+ }
143
+
144
+ $post_id = $post->ID;
145
+ $checkout_url = '';
146
+ ?>
147
+ <div class="twb_admin_bar_menu_content twb-notoptimized twb_not_optimized_content">
148
+ <p class="twb_status_title"><?php echo __('Check the PageSpeed score', 'tenweb-booster'); ?></p>
149
+ <p class="twb_status_description"><?php _e('PageSpeed score is an essential attribute to your website’s performance. It affects both the user experience and SEO rankings.', 'tenweb-booster') ?></p>
150
+ <div class="twb_check_score_button_cont">
151
+ <a data-post_id="<?php echo esc_attr($post_id); ?>"
152
+ data-initiator="admin-bar" target="_blank"
153
+ class="twb_check_score_button"><?php _e('Check PageSpeed Score', 'tenweb-booster') ?></a>
154
+ </div>
155
+ <?php
156
+ echo TWBLibrary::dismiss_info_content( $this->booster );
157
+ ?>
158
+ </div>
159
+ <?php
160
+ $this->twb_front_score_in_progress_content();
161
+ $this->twb_front_score_counted_content();
162
+ }
163
+
164
+ /* Content of admin menu if score counting in progress */
165
+ public function twb_front_score_in_progress_content() {
166
+ global $post;
167
+ if ( empty($post) ) {
168
+ return false;
169
+ }
170
+
171
+ $post_id = $post->ID;
172
+ $page_title = get_the_title( $post_id );
173
+ ?>
174
+ <div class="twb_admin_bar_menu_content twb-optimizing <?php echo $this->page_speed_status == 'notstarted' ? 'twb-hidden' : ''; ?>">
175
+ <p class="twb_status_title twb_status_title_inprogress twb_score_inprogress"><span></span><?php echo __('Checking...', 'tenweb-booster'); ?></p>
176
+ <p class="twb_status_description"><?php echo sprintf(__('We are checking the PageSpeed score of your %s page.', 'tenweb-booster'), $page_title); ?></p>
177
+ </div>
178
+ <?php
179
+ }
180
+
181
+ /* Content of admin menu if score counted */
182
+ public function twb_front_score_counted_content() {
183
+ global $post;
184
+ if ( empty($post) ) {
185
+ return false;
186
+ }
187
+
188
+ $post_id = $post->ID;
189
+ $page_score = get_post_meta( $post_id, 'two_page_speed' );
190
+
191
+ $score = array(
192
+ 'mobile_score' => 0,
193
+ 'mobile_tti' => 0,
194
+ 'desktop_score' => 0,
195
+ 'desktop_tti' => 0,
196
+ );
197
+
198
+ if ( !empty($page_score) ) {
199
+ $page_score = end($page_score);
200
+ if ( !empty($page_score['previous_score']) && !empty($page_score['previous_score']['mobile_score']) ) {
201
+ $page_score = $page_score['previous_score'];
202
+ $score = array(
203
+ 'mobile_score' => $page_score['mobile_score'],
204
+ 'mobile_tti' => $page_score['mobile_tti'],
205
+ 'desktop_score' => $page_score['desktop_score'],
206
+ 'desktop_tti' => $page_score['desktop_tti'],
207
+ );
208
+ }
209
+ }
210
+
211
+
212
+ $page_title = get_the_title( $post_id );
213
+ $url = $this->booster->submenu_url;
214
+ ?>
215
+ <div class="twb_admin_bar_menu_content twb-optimized twb_counted <?php echo $this->page_speed_status != 'completed' ? 'twb-hidden' : ''; ?>">
216
+ <?php
217
+ $title = sprintf(__('%s page', 'tenweb-booster'), $page_title);
218
+ TWBLibrary::score( $score, $url, $post_id, $title, 0 );
219
+ echo TWBLibrary::dismiss_info_content( $this->booster );
220
+ ?>
221
+ </div>
222
+ <?php
223
+ }
224
+
225
+ /* Content of admin menu if score counted */
226
+ public function twb_front_score_error_content() {
227
+ global $post;
228
+ if ( empty($post) ) {
229
+ return false;
230
+ }
231
+
232
+ $post_id = $post->ID;
233
+ $page_title = get_the_title( $post_id );
234
+ $url = $this->booster->submenu_url;
235
+
236
+ $score = array(
237
+ 'error' => 1,
238
+ );
239
+ ?>
240
+ <div class="twb_admin_bar_menu_content twb-optimized twb_counted <?php echo $this->page_speed_status != 'error' ? 'twb-hidden' : ''; ?>">
241
+ <?php
242
+ $title = sprintf(__('%s page', 'tenweb-booster'), $page_title);
243
+ TWBLibrary::score( $score, $url, $post_id, $title, 0 );
244
+ echo TWBLibrary::dismiss_info_content( $this->booster );
245
+ ?>
246
+ </div>
247
+ <?php
248
+ }
249
+
250
+ /* Getting data inprogress and counted scores */
251
+ public function twb_get_notification_data() {
252
+ global $wpdb;
253
+ $posts = $wpdb->get_results("SELECT * FROM `".$wpdb->postmeta."` WHERE meta_key='two_page_speed'", ARRAY_A);
254
+ if( empty($posts) ) {
255
+ return;
256
+ }
257
+ foreach ( $posts as $post ) {
258
+ $page_score = unserialize($post['meta_value']);
259
+ if( isset($page_score['previous_score']) ) {
260
+ $page_score = $page_score['previous_score'];
261
+ } else {
262
+ continue;
263
+ }
264
+
265
+ $page_title = get_the_title($post['post_id']);
266
+ $post_id = $post['post_id'];
267
+ if ( isset($page_score["status"]) && $page_score["status"] == "inprogress" ) {
268
+ $this->show_notification_popup = 1;
269
+ $this->notification_data['inprogress'][] = array(
270
+ 'post_id' => $post_id,
271
+ 'post_title' => $page_title,
272
+ );
273
+ }
274
+ $shown = isset($page_score["shown"]) ? $page_score["shown"] : 0;
275
+ if (isset($page_score["status"]) && $page_score["status"] == "completed" && !isset($page_score["error"]) && !$shown ) {
276
+ $this->show_notification_popup = 1;
277
+ $this->notification_data['completed'][] = array(
278
+ 'post_id' => $post_id,
279
+ 'post_title' => $page_title,
280
+ 'mobile_score' => $page_score['mobile_score'],
281
+ 'mobile_tti' => $page_score['mobile_tti'],
282
+ 'desktop_score' => $page_score['desktop_score'],
283
+ 'desktop_tti' => $page_score['desktop_tti'],
284
+ );
285
+ $page_score["shown"] = 1;
286
+ $data['previous_score'] = $page_score;
287
+ update_post_meta($post_id, 'two_page_speed', $data);
288
+ }
289
+
290
+ }
291
+ }
292
+
293
+ /* Show notification during the page load if there is optimizing page in progress */
294
+ public function twb_popup_notification() {
295
+ if ( !$this->show_notification_popup ) {
296
+ return '';
297
+ }
298
+ ob_start();
299
+ ?>
300
+ <div class="twb_admin_bar_menu_main twb_admin_bar_menu_main_notif">
301
+ <?php if ( !empty($this->notification_data['completed']) ) { ?>
302
+ <div class="twb_admin_bar_menu_content twb_counted">
303
+ <?php
304
+ $url = $this->booster->submenu_url;
305
+ $i = 1;
306
+ foreach ( $this->notification_data['completed'] as $score ) { ?>
307
+ <div class="twb_counted_cont">
308
+ <div class="twb_score_block_container">
309
+ <?php
310
+ $title = sprintf( __('%s page', 'tenweb-booster'), esc_html($score['post_title']) );
311
+ TWBLibrary::score( $score, $url, $score['post_id'], $title, 0 );
312
+ echo TWBLibrary::dismiss_info_content( $this->booster );
313
+ ?>
314
+ </div>
315
+ </div>
316
+ <?php
317
+ $i++;
318
+ }
319
+ ?>
320
+ </div>
321
+ <?php } ?>
322
+ <?php if ( !empty($this->notification_data['inprogress']) ) { ?>
323
+ <div class="twb_counting_container">
324
+ <?php foreach ( $this->notification_data['inprogress'] as $checking ) { ?>
325
+ <p class="twb_counting_title"><span></span><?php _e('Checking…', 'tenweb-booster'); ?></p>
326
+ <p class="twb_counting_descr"><?php echo sprintf(__('We are checking the PageSpeed score of your %s page.', 'tenweb-booster'), '<span>'.esc_html($checking['post_title']).'</span>'); ?></p>
327
+ <?php } ?>
328
+ </div>
329
+ <?php } ?>
330
+ </div>
331
+ <?php
332
+ return ob_get_clean();
333
+ }
334
+
335
+ }
booster/Elementor.php ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class TWBElementor
5
+ */
6
+ class TWBElementor {
7
+ private $booster;
8
+ private $post_published = 0;
9
+ private $post_id = 0;
10
+ private $page_speed_status;
11
+
12
+ function __construct( $booster ) {
13
+ $this->booster = $booster;
14
+ add_action('elementor/editor/after_enqueue_scripts', array( $this, 'scripts_styles' ));
15
+ add_action('elementor/documents/register_controls', array( $this,'register_document_controls' ));
16
+ }
17
+
18
+ /**
19
+ * Enqueue scripts.
20
+ *
21
+ * @return void
22
+ */
23
+ public function scripts_styles() {
24
+ if ( !$this->post_published ) {
25
+ return;
26
+ }
27
+
28
+ wp_enqueue_style('twb-open-sans', 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700,800&display=swap');
29
+ wp_enqueue_style('two_speed_dark_css', $this->booster->plugin_url . '/assets/css/elementor_dark.css', array( 'twb-open-sans', 'elementor-editor-dark-mode' ), TenWebBooster::VERSION);
30
+ if ( $this->booster->cta_button['button_color'] || $this->booster->cta_button['text_color'] ) {
31
+ wp_add_inline_style(TenWebBooster::PREFIX . '-elementor', '.twb-custom-button, .twb-custom-button:hover {background-color: ' . $this->booster->cta_button['button_color'] . ' !important; color: ' . $this->booster->cta_button['text_color'] . ' !important;}');
32
+ }
33
+ wp_enqueue_style(TenWebBooster::PREFIX . '-global', $this->booster->plugin_url . '/assets/css/global.css', array( 'twb-open-sans' ), TenWebBooster::VERSION);
34
+
35
+ $required_scripts = array( 'jquery' );
36
+ wp_enqueue_script(TenWebBooster::PREFIX . '-circle', $this->booster->plugin_url . '/assets/js/circle-progress.js', $required_scripts, '1.2.2');
37
+ wp_enqueue_script(TenWebBooster::PREFIX . '-global', $this->booster->plugin_url . '/assets/js/global.js', array('jquery'), TenWebBooster::VERSION);
38
+ wp_localize_script(TenWebBooster::PREFIX . '-global', 'twb', array(
39
+ 'title' => $this->booster->cta_button['section_label'],
40
+ 'nonce' => wp_create_nonce('twb_nonce'),
41
+ 'ajax_url' => admin_url('admin-ajax.php'),
42
+ 'plugin_url' => $this->booster->plugin_url,
43
+ 'href' => $this->booster->submenu_url,
44
+ 'checking' => __('Checking...', 'twb-hidden'),
45
+ 'notoptimized' => __('Not optimized', 'twb-hidden'),
46
+ ));
47
+ }
48
+
49
+ /**
50
+ * Register additional document controls.
51
+ *
52
+ * @param \Elementor\Core\DocumentTypes\PageBase $document The PageBase document instance.
53
+ */
54
+ public function register_document_controls( $document ) {
55
+ global $post;
56
+ if ( !empty($post) ) {
57
+ $this->post_id = $post->ID;
58
+ if ( get_post_status($this->post_id) == 'publish' ) {
59
+ $this->post_published = 1;
60
+ }
61
+ }
62
+
63
+ if ( ! $this->post_published || ! $document instanceof \Elementor\Core\DocumentTypes\PageBase || ! $document::get_property( 'has_elements' ) || !empty($document->get_section_controls('twb_optimize_section')) ) {
64
+ return;
65
+ }
66
+
67
+ $section_label = isset($this->booster->cta_button['section_label']) ? $this->booster->cta_button['section_label'] : '';
68
+
69
+ \Elementor\Controls_Manager::add_tab('twb_optimize', $section_label);
70
+
71
+ $document->start_controls_section(
72
+ 'twb_optimize_section',
73
+ [
74
+ 'tab' => 'twb_optimize',
75
+ ]
76
+ );
77
+ $this->page_speed_status = TWBLibrary::get_page_speed_status();
78
+ $classname = 'twb_elementor_settings_content twb_optimized';
79
+ if ( $this->page_speed_status == "completed" ) {
80
+ $content = $this->comleted_content();
81
+ $label_html = '<p class="twb_elementor_control_title twb_not_optimized">' . __('Not optimized', 'tenweb-booster') . '</p>';
82
+ } elseif ( $this->page_speed_status == "notstarted" ) {
83
+ $content = $this->notstarted_content();
84
+ $classname = 'twb_elementor_settings_content twb-optimized';
85
+ $label_html = '<p class="twb_elementor_control_title twb_not_optimized">' . __('PageSpeed Score', 'tenweb-booster') . '</p>';
86
+ } elseif ( $this->page_speed_status == 'error' ) {
87
+ $content = $this->error_content();
88
+ $label_html = '<p class="twb_elementor_control_title twb_not_optimized">' . __('Not optimized', 'tenweb-booster') . '</p>';
89
+ } else {
90
+ $content = $this->inprogress_content();
91
+ $label_html = '<p class="twb_elementor_control_title"><span class="twb_inprogress"></span>' . __('Checking...', 'tenweb-booster') . '</p>';
92
+ }
93
+ $content .= TWBLibrary::dismiss_info_content( $this->booster );
94
+ $document->add_control(
95
+ 'twb_raw_html',
96
+ [
97
+ 'label' => $label_html,
98
+ 'type' => \Elementor\Controls_Manager::RAW_HTML,
99
+ 'raw' => $content,
100
+ 'content_classes' => $classname,
101
+ ]
102
+ );
103
+
104
+ $document->end_controls_section();
105
+ }
106
+
107
+ /**
108
+ * Content html which score counted.
109
+ *
110
+ * @param bool $hide hide content in case of not counted
111
+ *
112
+ * @return string html content
113
+ */
114
+ public function comleted_content( $hide = 0 ) {
115
+
116
+ if ( !$this->post_id ) {
117
+ return false;
118
+ }
119
+
120
+ $post_id = $this->post_id;
121
+ $page_score = get_post_meta( $post_id, 'two_page_speed' );
122
+
123
+ $score = array(
124
+ 'mobile_score' => 0,
125
+ 'mobile_tti' => 0,
126
+ 'desktop_score' => 0,
127
+ 'desktop_tti' => 0,
128
+ );
129
+
130
+ if ( !empty($page_score) ) {
131
+ $page_score = end($page_score);
132
+ if ( !empty($page_score['previous_score']) && !empty($page_score['previous_score']['mobile_score']) ) {
133
+ $page_score = $page_score['previous_score'];
134
+ $score = array(
135
+ 'mobile_score' => $page_score['mobile_score'],
136
+ 'mobile_tti' => $page_score['mobile_tti'],
137
+ 'desktop_score' => $page_score['desktop_score'],
138
+ 'desktop_tti' => $page_score['desktop_tti'],
139
+ );
140
+ }
141
+ }
142
+
143
+
144
+ $page_title = get_the_title( $post_id );
145
+ $title = sprintf(__('%s page', 'tenweb-booster'), '<i>'.$page_title.'</i>');
146
+ $url = $this->booster->submenu_url;
147
+ ob_start(); ?>
148
+ <script>
149
+ if ( typeof twb_draw_score_circle == 'function') {
150
+ jQuery('.twb-score-circle').each(function () {
151
+ twb_draw_score_circle(this);
152
+ });
153
+ }
154
+ </script>
155
+ <?php
156
+ TWBLibrary::score($score, $url, $post_id, $title, $hide, 40);
157
+ return ob_get_clean();
158
+ }
159
+
160
+ /**
161
+ * Content html which score counted with error.
162
+ *
163
+ * @return string html content
164
+ */
165
+ public function error_content() {
166
+ if ( !$this->post_id ) {
167
+ return false;
168
+ }
169
+
170
+ $post_id = $this->post_id;
171
+ $page_title = get_the_title( $post_id );
172
+ $title = sprintf(__('%s page', 'tenweb-booster'), '<i>'.$page_title.'</i>');
173
+ $url = $this->booster->submenu_url;
174
+
175
+ $score = array(
176
+ 'error' => 1,
177
+ );
178
+
179
+ ob_start();
180
+ TWBLibrary::score($score, $url, $post_id, $title, 0, 40);
181
+ return ob_get_clean();
182
+ }
183
+
184
+ /**
185
+ * Content html which score not counted and started.
186
+ *
187
+ * @return string html content
188
+ */
189
+ public function notstarted_content() {
190
+ if ( !$this->post_id ) {
191
+ return false;
192
+ }
193
+
194
+ $post_id = $this->post_id;
195
+ ob_start();
196
+ ?>
197
+ <div class="twb-notoptimized">
198
+ <p class="twb_status_description"><?php _e('PageSpeed score is an essential attribute to your website’s performance. It affects both the user experience and SEO rankings.', 'tenweb-booster') ?></p>
199
+ <div class="twb_check_score_button_cont">
200
+ <a onclick="twb_check_score(this)" data-post_id="<?php echo esc_attr($post_id); ?>"
201
+ data-initiator="admin-bar" target="_blank"
202
+ class="twb_check_score_button"><?php _e('Check PageSpeed Score', 'tenweb-booster') ?></a>
203
+ </div>
204
+ </div>
205
+ <div class="twb-optimized twb-hidden">
206
+ <?php
207
+ echo $this->comleted_content();
208
+ ?>
209
+ </div>
210
+ <div class="twb-optimizing twb-hidden">
211
+ <?php
212
+ echo $this->inprogress_content();
213
+ ?>
214
+ </div>
215
+ <?php
216
+ return ob_get_clean();
217
+ }
218
+
219
+ /**
220
+ * Content html which score in progress.
221
+ *
222
+ * @return string html content
223
+ */
224
+ public function inprogress_content() {
225
+ if ( !$this->post_id ) {
226
+ return false;
227
+ }
228
+
229
+ $post_id = $this->post_id;
230
+ $page_title = get_the_title( $post_id );
231
+ ob_start();
232
+ ?>
233
+ <div class="twb_admin_bar_menu_content twb-optimizing <?php echo $this->page_speed_status == 'notstarted' ? 'twb-hidden' : ''; ?>">
234
+ <p class="twb_status_description"><?php echo sprintf(__('We are checking the PageSpeed score of your %s page.', 'tenweb-booster'), '<i>'.esc_html($page_title).'</i>'); ?></p>
235
+ </div>
236
+ <?php
237
+ return ob_get_clean();
238
+ }
239
+
240
+ }
booster/Gutenberg.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class TWBGutenberg
5
+ */
6
+ class TWBGutenberg {
7
+ private $booster;
8
+ function __construct($booster) {
9
+ $this->booster = $booster;
10
+ add_action('enqueue_block_editor_assets', array($this, 'register_scripts'));
11
+ }
12
+
13
+ /**
14
+ * Register scripts.
15
+ *
16
+ * @return void
17
+ */
18
+ public function register_scripts() {
19
+ wp_enqueue_script(TenWebBooster::PREFIX . '-gutenberg', $this->booster->plugin_url . '/assets/js/gutenberg/gutenberg-compiled.js', array(
20
+ 'wp-plugins',
21
+ 'wp-edit-post'
22
+ ), TenWebBooster::VERSION);
23
+ wp_localize_script(TenWebBooster::PREFIX . '-gutenberg', 'twb', array(
24
+ 'cta_button' => $this->booster->cta_button,
25
+ 'href' => $this->booster->submenu_url,
26
+ ));
27
+ wp_enqueue_style(TenWebBooster::PREFIX . '-global');
28
+ if ( $this->booster->cta_button['button_color'] || $this->booster->cta_button['text_color'] ) {
29
+ wp_add_inline_style(TenWebBooster::PREFIX . '-global', '.twb-custom-button, .twb-custom-button:hover {background-color: ' . $this->booster->cta_button['button_color'] . ' !important; color: ' . $this->booster->cta_button['text_color'] . ' !important;}');
30
+ }
31
+ }
32
+ }
booster/List.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class TWBGutenberg
5
+ */
6
+ class TWBList {
7
+ private $booster;
8
+ protected static $_instance = null;
9
+
10
+ function __construct( $booster ) {
11
+ $this->booster = $booster;
12
+ $this->booster->register_scripts();
13
+ wp_enqueue_style(TenWebBooster::PREFIX . '-global');
14
+ wp_enqueue_script(TenWebBooster::PREFIX . '-global');
15
+ // Add column to the posts list table.
16
+ add_filter('manage_post_posts_columns', array( $this, 'add_column' ));
17
+ add_filter('manage_page_posts_columns', array( $this, 'add_column' ));
18
+ add_action('manage_post_posts_custom_column', array( $this, 'manage_column' ), 10, 2);
19
+ add_action('manage_page_posts_custom_column', array( $this, 'manage_column' ), 10, 2);
20
+ }
21
+
22
+ /**
23
+ * Main Instance.
24
+ *
25
+ * Ensures only one instance is loaded or can be loaded.
26
+ *
27
+ * @static
28
+ * @return Main instance.
29
+ */
30
+ public static function instance($booster) {
31
+ if ( is_null( self::$_instance ) ) {
32
+ self::$_instance = new self($booster);
33
+ }
34
+ return self::$_instance;
35
+ }
36
+
37
+ public function add_column( $columns ) {
38
+ $offset = array_search('author', array_keys($columns));
39
+
40
+ return array_merge(array_slice($columns, 0, $offset), [ 'twb-speed-' . $this->booster->submenu['parent_slug'] => __('PageSpeed score', 'tenweb-booster') . TWBLibrary::dismiss_info_content( $this->booster, TRUE ) ], array_slice($columns, $offset, NULL));
41
+ }
42
+
43
+ public function manage_column( $column_key, $post_id ) {
44
+ if ( $column_key == 'twb-speed-' . $this->booster->submenu['parent_slug'] ) {
45
+ if ( get_post_status($post_id) != 'publish' ) {
46
+ return;
47
+ }
48
+ $this->display($post_id);
49
+ }
50
+ }
51
+
52
+ private function display( $post_id ) {
53
+ $page_score = get_post_meta($post_id, 'two_page_speed', TRUE);
54
+ $status = 'notstarted';
55
+ $score = array();
56
+ if ( isset($page_score['previous_score']['status']) ) {
57
+ $status = $page_score['previous_score']['status'];
58
+ $score = $page_score['previous_score'];
59
+ }
60
+ ?>
61
+ <span class="twb-page-speed twb-optimized <?php echo $status == 'completed' ? '' : 'twb-hidden'; ?>">
62
+ <a class="twb-see-score" target="_balnk" href="<?php echo esc_url($this->booster->submenu_url); ?>"><?php _e('Optimize images and speed', 'tenweb-booster'); ?></a>
63
+ </span>
64
+ <span data-status="<?php echo $status; ?>" class="twb-page-speed twb-notoptimized <?php echo $status == 'notstarted' ? '' : 'twb-hidden'; ?>">
65
+ <a class="twb_check_score_button" data-post_id="<?php echo esc_attr($post_id); ?>"><?php _e('Check score', 'tenweb-booster'); ?></a>
66
+ </span>
67
+ <span class="twb-page-speed twb-optimizing <?php echo $status == 'inprogress' ? '' : 'twb-hidden'; ?>">
68
+ <?php _e('Checking...', 'tenweb-booster'); ?>
69
+ <p class="twb-description"></p>
70
+ </span>
71
+ <?php echo TWBLibrary::score($score, '', $post_id); ?>
72
+ <div class="twb-score-disabled-container twb-hidden">
73
+ <div class="twb-score-title"><?php _e('Checking PageSpeed score', 'tenweb-booster'); ?></div>
74
+ <div class="twb-score-desc"><?php _e('We are checking the PageSpeed score of a different page, please wait until the process is complete to run PageSpeed check on another page.', 'tenweb-booster'); ?></div>
75
+ <div class="twb-score-bottom"><a onclick="jQuery('.twb-score-disabled-container').addClass('twb-hidden')"><?php _e('Got it', 'tenweb-booster'); ?></a></div>
76
+ </div>
77
+ <?php
78
+ }
79
+ }
80
+
81
+ function TWBList($booster) {
82
+ return TWBList::instance($booster);
83
+ }
84
+
85
+
booster/TWBLibrary.php ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TWBLibrary {
3
+
4
+ /**
5
+ * Return button template which styles user can change using arguments
6
+ *
7
+ * @param $object object of TenWebBooster class
8
+ *
9
+ * @return string html data
10
+ */
11
+ public static function twb_button_template( $object ) {
12
+ ob_start();
13
+
14
+ ?>
15
+ <a href="<?php echo esc_url($object->submenu_url); ?>" target="_blank"
16
+ class="twb-custom-button <?php echo isset($object->cta_button['class']) ? esc_attr($object->cta_button['class']) : '' ?>">
17
+ <?php echo isset($object->cta_button['label']) ? esc_html($object->cta_button['label']) : esc_html__('Optimize Now', 'tenweb-booster'); ?>
18
+ </a>
19
+ <?php
20
+ return ob_get_clean();
21
+ }
22
+
23
+ /**
24
+ * Convert bytes to B, KM, MB, GB, TB, PB.
25
+ *
26
+ * @param $bytes
27
+ * @param $precision
28
+ *
29
+ * @return string
30
+ */
31
+ public static function formatBytes( $bytes, $precision = 2 ) {
32
+ $units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB' );
33
+ $bytes = max($bytes, 0);
34
+ $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
35
+ $pow = min($pow, count($units) - 1);
36
+ $bytes /= pow(1024, $pow);
37
+
38
+ return round($bytes, $precision) . ' ' . $units[$pow];
39
+ }
40
+
41
+ /**
42
+ * Convert B, KM, MB, GB, TB, PB to bytes.
43
+ *
44
+ * @param string $from
45
+ *
46
+ * @return array|float|int|string|string[]|null
47
+ */
48
+ public static function convertToBytes( $from ) {
49
+ $units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB' );
50
+ $number = substr($from, 0, -2);
51
+ $suffix = strtoupper(substr($from, -2));
52
+ if ( is_numeric(substr($suffix, 0, 1)) ) {
53
+ return preg_replace('/[^\d]/', '', $from);
54
+ }
55
+ $flipped = array_flip($units);
56
+
57
+ if ( !isset($flipped[$suffix]) ) {
58
+ return NULL;
59
+ }
60
+
61
+ return floatval($number) * (1024 ** $flipped[$suffix]);
62
+ }
63
+
64
+ /**
65
+ * Save the page speed score in the post meta.
66
+ *
67
+ * @return void
68
+ */
69
+ public static function check_score($post_id) {
70
+ // Getting front_page placeholder instead of page ID for Home page.
71
+ $url = ($post_id == 'front_page') ? get_home_url() : get_permalink($post_id);
72
+ if ( !$url ) {
73
+ return;
74
+ }
75
+
76
+ // Get the page score from DB.
77
+ if ( $post_id == 'front_page' ) {
78
+ $page_score = get_option('two-front-page-speed');
79
+ }
80
+ else {
81
+ $page_score = get_post_meta($post_id, 'two_page_speed', TRUE);
82
+ }
83
+ if ( empty($page_score) ) {
84
+ $page_score = array();
85
+ }
86
+ if ( empty($page_score['previous_score']) ) {
87
+ $page_score['previous_score'] = array();
88
+ }
89
+ // Set the status to in progress.
90
+ $page_score['previous_score']['status'] = 'inprogress';
91
+ if ( $post_id == 'front_page' ) {
92
+ update_option('two-front-page-speed', $page_score);
93
+ }
94
+ else {
95
+ update_post_meta($post_id, 'two_page_speed', $page_score);
96
+ }
97
+
98
+ $desktop_score = TWBLibrary::google_check_score($url, 'desktop');
99
+ //$desktop_score = array('desktop_score' => 75, 'desktop_tti' => '1.1');
100
+ // $desktop_score = array('error' => 1);
101
+ $score = $desktop_score;
102
+ $mobile_score = TWBLibrary::google_check_score($url, 'mobile');
103
+ // $mobile_score = array('mobile_score' => 50, 'mobile_tti' => '1.0');
104
+ // $mobile_score = array('error' => 1);
105
+ $score = array_merge($score, $mobile_score);
106
+ $score['date'] = date('d.m.Y h:i:s a', strtotime(current_time('mysql')));
107
+ // Change the status.
108
+ $score['status'] = 'completed';
109
+ $score['shown'] = 0;
110
+ $page_score['previous_score'] = $score;
111
+
112
+ // Save the status and score in DB.
113
+ if ( $post_id == 'front_page' ) {
114
+ update_option('two-front-page-speed', $page_score);
115
+ }
116
+ else {
117
+ update_post_meta($post_id, 'two_page_speed', $page_score);
118
+ }
119
+
120
+ return json_encode($page_score['previous_score']);
121
+ }
122
+
123
+ /**
124
+ * Get the page speed from Google by URL.
125
+ *
126
+ * @param $page_url
127
+ * @param $strategy
128
+ *
129
+ * @return array
130
+ */
131
+ public static function google_check_score( $page_url, $strategy ) {
132
+ $google_api_keys = array(
133
+ 'AIzaSyCQmF4ZSbZB8prjxci3GWVK4UWc-Yv7vbw',
134
+ 'AIzaSyAgXPc9Yp0auiap8L6BsHWoSVzkSYgHdrs',
135
+ 'AIzaSyCftPiteYkBsC2hamGbGax5D9JQ4CzexPU',
136
+ 'AIzaSyC-6oKLqdvufJnysAxd0O56VgZrCgyNMHg',
137
+ 'AIzaSyB1QHYGZZ6JIuUUce4VyBt5gF_-LwI5Xsk',
138
+ );
139
+ $random_index = array_rand($google_api_keys);
140
+ $key = $google_api_keys[$random_index];
141
+ $url = "https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=" . $page_url . "&key=" . $key;
142
+ if ( $strategy == "mobile" ) {
143
+ $url .= "&strategy=mobile";
144
+ }
145
+ $response = wp_remote_get($url, array( 'timeout' => 300 ));
146
+ $data = array();
147
+ if ( is_array($response) && !is_wp_error($response) ) {
148
+ $body = $response['body'];
149
+ $body = json_decode($body);
150
+ if ( isset($body->error) ) {
151
+ $data['error'] = 1;
152
+ }
153
+ else {
154
+ $data[$strategy . '_score'] = 100 * $body->lighthouseResult->categories->performance->score;
155
+ $data[$strategy . '_tti'] = rtrim($body->lighthouseResult->audits->interactive->displayValue, 's');
156
+ }
157
+ }
158
+ else {
159
+ $data['error'] = 1;
160
+ }
161
+
162
+ return $data;
163
+ }
164
+
165
+ /**
166
+ * @param $score
167
+ * @param $url
168
+ * @param $post_id
169
+ * @param $title
170
+ * @param $hidden bool need to hidden class or no
171
+ * @param $size int size of circle in speed score
172
+ *
173
+ * @return void
174
+ */
175
+ public static function score( $score, $url = '', $post_id = 0, $title = '', $hidden = 1, $size = 30 ) {
176
+ $error = empty($score['error']) ? 0 : 1;
177
+ if (empty($score) || $error) {
178
+ $score = array(
179
+ 'desktop_score' => 0,
180
+ 'desktop_tti' => '',
181
+ 'mobile_score' => 0,
182
+ 'mobile_tti' => '',
183
+ 'date' => '',
184
+ 'status' => 'notstarted',
185
+ );
186
+ }
187
+ $title = ($title != '') ? 'of ' . $title : '';
188
+ ?>
189
+ <div class="twb-score-container <?php echo $hidden ? 'twb-hidden' : '' ?>" data-id="<?php echo esc_attr($post_id); ?>">
190
+ <div class="twb-score-title"><?php echo sprintf(__('PageSpeed score %s', 'tenweb-booster'), strip_tags($title, "<i>")); ?></div>
191
+ <div class="twb-score">
192
+ <div class="twb-score-mobile">
193
+ <div class="twb-score-circle"
194
+ data-id="mobile"
195
+ data-thickness="2"
196
+ data-size="<?php echo esc_attr($size); ?>"
197
+ data-score="<?php echo esc_attr($score['mobile_score']); ?>"
198
+ data-tti="<?php echo esc_attr($score['mobile_tti']); ?>">
199
+ <span class="twb-score-circle-animated"></span>
200
+ </div>
201
+ <div class="twb-score-text">
202
+ <span class="twb-score-text-name"><?php _e('Mobile score', 'tenweb-booster'); ?></span>
203
+ <span class="twb-load-text-time"><?php _e('Load time: ', 'tenweb-booster'); ?><span
204
+ class="twb-load-time"></span>s</span>
205
+ </div>
206
+ </div>
207
+ <div class="twb-score-mobile twb-score-mobile-overlay twb-score-overlay <?php echo esc_html($error ? '' : 'twb-hidden'); ?>">
208
+ <div class="twb-reload" onclick="twb_check_score(this)" data-post_id="<?php echo $post_id; ?>"></div>
209
+ </div>
210
+ <div class="twb-score-desktop">
211
+ <div class="twb-score-circle"
212
+ data-id="desktop"
213
+ data-thickness="2"
214
+ data-size="<?php echo esc_attr($size); ?>"
215
+ data-score="<?php echo esc_attr($score['desktop_score']); ?>"
216
+ data-tti="<?php echo esc_attr($score['desktop_tti']); ?>">
217
+ <span class="twb-score-circle-animated"></span>
218
+ </div>
219
+ <div class="twb-score-text">
220
+ <span class="twb-score-text-name"><?php _e('Desktop score', 'tenweb-booster'); ?></span>
221
+ <span class="twb-load-text-time"><?php _e('Load time: ', 'tenweb-booster'); ?><span
222
+ class="twb-load-time"></span>s</span>
223
+ </div>
224
+ </div>
225
+ <div class="twb-score-desktop twb-score-desktop-overlay twb-score-overlay <?php echo esc_html($error ? '' : 'twb-hidden'); ?>">
226
+ <div class="twb-reload" onclick="twb_check_score(this)" data-post_id="<?php echo $post_id; ?>"></div>
227
+ </div>
228
+ </div>
229
+ <?php
230
+ if ( $url ) {
231
+ ?>
232
+ <div class="twb-score-bottom"><a target="_balnk" href="<?php echo esc_url($url); ?>"><?php _e('Optimize now', 'tenweb-booster'); ?></a></div>
233
+ <?php
234
+ }
235
+ ?>
236
+ </div>
237
+ <?php
238
+ }
239
+
240
+ public static function dismiss_info_content( $booster, $hidden = FALSE ) {
241
+ $link = add_query_arg(array('twb_dismiss' => 1), $booster->submenu_url);
242
+ ob_start();
243
+ ?>
244
+ <div class="<?php echo ($hidden ? 'twb-dismiss-container twb-hidden' : 'twb-dismiss-info'); ?>">
245
+ <p><?php echo sprintf(__("You can hide this element from the %s", "tenweb-booster"), "<a href='" . esc_url($link) . "' target='_blank'>" . __('settings', "tenweb-booster") . "</a>"); ?></p>
246
+ </div>
247
+ <?php
248
+ return ob_get_clean();
249
+ }
250
+
251
+ /**
252
+ * Get status which return if score counted = 2, not counted = 0, inprogress = 1
253
+ *
254
+ * @return string
255
+ */
256
+ public static function get_page_speed_status() {
257
+ global $post;
258
+ if ( empty($post) ) {
259
+ return false;
260
+ }
261
+
262
+ $post_id = $post->ID;
263
+ $page_score = get_post_meta( $post_id, 'two_page_speed' );
264
+ $page_score = end($page_score);
265
+
266
+ if ( isset($page_score['previous_score']) ) {
267
+ if ( isset( $page_score['previous_score']['error'] ) && $page_score['previous_score']['error'] == "1" ) {
268
+ return 'error';
269
+ } elseif ( isset( $page_score['previous_score']['status'] ) && $page_score['previous_score']['status'] == "inprogress" ) {
270
+ return 'inprogress';
271
+ } elseif( isset( $page_score['previous_score']['status'] ) && $page_score['previous_score']['status'] == "completed" ) {
272
+ return 'completed';
273
+ }
274
+ }
275
+ return 'notstarted';
276
+ }
277
+ }
278
+
279
+
booster/assets/css/elementor.css ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .elementor-panel-menu-item-icon .twb-element-menu-icon:before {
2
+ display: block;
3
+ margin: auto;
4
+ width: 26px;
5
+ height: 26px;
6
+ content: " ";
7
+ background: transparent url(../images/logo_dark.svg) 0 0 no-repeat;
8
+ background-size: 26px;
9
+ }
10
+
11
+ .elementor-control-twb_optimize_section .elementor-panel-heading {
12
+ display: none;
13
+ }
14
+
15
+ .elementor-panel .elementor-tab-control-twb_optimize {
16
+ position: relative;
17
+ padding: 0 5px;
18
+ box-sizing: border-box;
19
+ min-width: 80px;
20
+ width: initial;
21
+ }
22
+
23
+ .elementor-panel .elementor-panel-navigation .elementor-panel-navigation-tab.elementor-tab-control-twb_optimize a {
24
+ top: 22px;
25
+ position: absolute;
26
+ left: 50%;
27
+ transform: translateX(-50%);
28
+ font-size: 8px;
29
+ font-weight: 600;
30
+ width: 100%;
31
+ }
32
+
33
+ .elementor-panel .elementor-panel-navigation .elementor-panel-navigation-tab.elementor-tab-control-twb_optimize a:before {
34
+ width: 26px;
35
+ position: absolute;
36
+ top: -17px;
37
+ left: calc(50% - 13px);
38
+ content: " ";
39
+ height: 26px;
40
+ background: transparent url(../images/logo_dark.svg) 0 0 no-repeat;
41
+ background-size: 26px;
42
+ }
43
+
44
+ .elementor-control .twb-score-container,
45
+ .elementor-control .twb-score-disabled-container {
46
+ display: flex;
47
+ flex-direction: column;
48
+ padding: 0;
49
+ background: transparent 0% 0% no-repeat padding-box;
50
+ border: 1px solid #FFFFFF1A;
51
+ border-radius: 6px;
52
+ color: #FFFFFF;
53
+ width: 100%;
54
+ position: relative;
55
+ }
56
+
57
+ .elementor-control .twb-score {
58
+ flex-direction: row;
59
+ display: flex;
60
+ padding: 20px 0 10px 0;
61
+ background-color: #F9F9F9;
62
+ margin: 20px 0 10px 0;
63
+ border-radius: 6px;
64
+ }
65
+
66
+ .elementor-control .twb-score-mobile,
67
+ .elementor-control .twb-score-desktop {
68
+ display: flex;
69
+ flex-direction: column;
70
+ width: 50%;
71
+ padding: 10px;
72
+ background: #FFFFFF0D 0% 0% no-repeat padding-box;
73
+ border-radius: 6px;
74
+ align-items: center;
75
+ margin: 0;
76
+ }
77
+
78
+ .elementor-control .twb-score-circle {
79
+ width: 40px;
80
+ height: 40px;
81
+ position: relative;
82
+ border-radius: 50%;
83
+ margin: 0;
84
+ background: #FD3C311A 0% 0% no-repeat padding-box;
85
+ }
86
+
87
+ .elementor-control .twb-score-text {
88
+ margin: 0;
89
+ text-align: center;
90
+ font-family: Open Sans;
91
+ font-weight: 100;
92
+ }
93
+
94
+ .elementor-control .twb-hidden,
95
+ .elementor-control .twb-score-container.twb-hidden,
96
+ .elementor-control .twb-score-overlay.twb-hidden,
97
+ .elementor-control .twb-score-disabled-container.twb-hidden {
98
+ display: none;
99
+ }
100
+
101
+ .elementor-control .twb-score-title {
102
+ font-size: 12px;
103
+ line-height: 18px;
104
+ font-weight: 400;
105
+ color:#1E1E1E;
106
+ margin-top:2px;
107
+ }
108
+
109
+ .elementor-control .twb-score-text-name {
110
+ display: block;
111
+ font: normal normal bold 10px/16px Open Sans;
112
+ letter-spacing: 0px;
113
+ opacity: 1;
114
+ color:#323A45;
115
+ }
116
+
117
+ .elementor-control .twb-load-text-time {
118
+ display: block;
119
+ font: normal normal 600 10px/16px Open Sans;
120
+ letter-spacing: 0.08px;
121
+ color: #323A45;
122
+ opacity: 0.5;
123
+ }
124
+
125
+ body .twb_elementor_control_title {
126
+ font-size: 12px;
127
+ font-weight: bold;
128
+ line-height: 18px;
129
+ vertical-align: middle;
130
+ display: flex;
131
+ align-items: center;
132
+ margin-bottom: 2px;
133
+ color:#1E1E1E
134
+ }
135
+
136
+ .elementor-control .twb_elementor_control_title.twb_not_optimized {
137
+ background: url(../images/red-info.svg) no-repeat;
138
+ background-size: 16px;
139
+ padding-left: 22px;
140
+ font-size: 12px;
141
+ font-weight: bold;
142
+ line-height: 18px;
143
+ vertical-align: middle;
144
+ display: flex;
145
+ align-items: center;
146
+ margin-bottom: 2px;
147
+ color: #1E1E1E;
148
+ }
149
+
150
+ .elementor-control .twb-score-circle .twb-score-circle-animated {
151
+ position: absolute;
152
+ left: 50%;
153
+ top: 50%;
154
+ -webkit-transform: translate(-50%, -50%);
155
+ -moz-transform: translate(-50%, -50%);
156
+ transform: translate(-50%, -50%);
157
+ text-align: center;
158
+ font: normal normal bold 12px/18px Open Sans;
159
+ letter-spacing: 0px;
160
+ }
161
+
162
+ .elementor-control .twb_elementor_control_title span.twb_inprogress {
163
+ background: transparent url(../images/loader_green.svg) 0 0 no-repeat padding-box;
164
+ animation: rotation 1s infinite linear;
165
+ background-size: 16px;
166
+ margin-right: 6px;
167
+ width: 16px;
168
+ height: 16px;
169
+ display: inline-block;
170
+ }
171
+
172
+ @keyframes rotation {
173
+ from {
174
+ transform: rotate(0deg);
175
+ }
176
+ to {
177
+ transform: rotate(359deg);
178
+ }
179
+ }
180
+
181
+ .elementor-control .twb-score-bottom {
182
+ text-align: right;
183
+ }
184
+
185
+ .elementor-control .twb-score-bottom a,
186
+ .elementor-control .twb-score-bottom a:hover {
187
+ text-decoration: underline;
188
+ font-size: 12px;
189
+ line-height: 18px;
190
+ color: #22B339;
191
+ font-weight: 600;
192
+ cursor: pointer;
193
+ border: none;
194
+ }
195
+
196
+ .elementor-control .twb_check_score_button {
197
+ width: 180px;
198
+ height: 30px;
199
+ line-height: 30px;
200
+ box-sizing: border-box;
201
+ text-decoration: none;
202
+ background-color: #22B339;
203
+ color: #FFFFFF;
204
+ border-radius: 4px;
205
+ text-align: center;
206
+ margin-top: 20px;
207
+ float: right;
208
+ cursor: pointer;
209
+ }
210
+
211
+ .elementor-control .twb_status_description {
212
+ padding-left: 21px;
213
+ font-size: 12px;
214
+ line-height: 18px;
215
+ }
216
+
217
+ .elementor-control .twb-score-overlay {
218
+ width:47%;
219
+ height: 80px;
220
+ z-index: 10;
221
+ position: absolute;
222
+ background-color: #2E3338 !important;
223
+ align-items: center;
224
+ justify-content: center;
225
+ }
226
+
227
+ .elementor-control .twb-score-desktop-overlay {
228
+ right: 2%;
229
+ }
230
+ .elementor-control .twb-score-mobile-overlay {
231
+ left: 2%;
232
+ }
233
+
234
+ .elementor-control .twb-loader {
235
+ background: transparent url(../images/loader.svg) 0% 0% no-repeat padding-box;
236
+ animation: rotation 1s infinite linear;
237
+ width: 14px;
238
+ height: 14px;
239
+ }
240
+
241
+ .elementor-control .twb-reload {
242
+ background: transparent url(../images/reload.svg) 0% 0% no-repeat padding-box;
243
+ width: 28px;
244
+ height: 28px;
245
+ cursor: pointer;
246
+ }
booster/assets/css/elementor_dark.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .elementor-control .twb_elementor_control_title.twb_not_optimized,
2
+ .elementor-control .twb-score-title,
3
+ body .twb_elementor_control_title,
4
+ .elementor-panel .twb-dismiss-info p,
5
+ .elementor-panel .twb-dismiss-info a {
6
+ color: #FFFFFF;
7
+ }
8
+
9
+ .elementor-control .twb-score-container,
10
+ .elementor-control .twb-score-disabled-container {
11
+ border: none;
12
+ }
booster/assets/css/global.css ADDED
@@ -0,0 +1,919 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .twb-cont {
2
+ display: flex;
3
+ flex-direction: column;
4
+ margin: 10px 10px 0 0 !important;
5
+ align-items: flex-end;
6
+ }
7
+
8
+ .twb-cont p,
9
+ .twb-cont p>a {
10
+ font: normal normal 600 12px/18px Open Sans;
11
+ letter-spacing: 0.1px;
12
+ color: #323A45;
13
+ opacity: 0.7;
14
+ padding-top: 10px;
15
+ }
16
+
17
+ a.twb-custom-button,
18
+ a.twb-custom-button:hover,
19
+ #wp-admin-bar-booster-top-button .ab-item,
20
+ #wp-admin-bar-booster-top-button .ab-item:hover{
21
+ margin: 3px 0 0 10px !important;
22
+ height: 26px !important;
23
+ border-radius: 2px;
24
+ font-weight: 600;
25
+ font-size: 12px;
26
+ line-height: 24px;
27
+ letter-spacing: 0.1px;
28
+ text-align: center;
29
+ cursor: pointer;
30
+ text-decoration: none;
31
+ padding: 0 8px 0 7px;
32
+ }
33
+
34
+ .twb-green-button,
35
+ .twb-green-button:hover,
36
+ .twb-green-button:focus,
37
+ #wp-admin-bar-booster-top-button .ab-item,
38
+ #wp-admin-bar-booster-top-button .ab-item:hover,
39
+ #wp-admin-bar-booster-top-button .ab-item:focus,
40
+ #wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-booster-top-button:hover>.ab-item,
41
+ #wpadminbar:not(.mobile) .ab-top-menu>li.twb-green-button>.ab-item:focus {
42
+ background: #22B339 0% 0% no-repeat padding-box;
43
+ color: #FFFFFF;
44
+ }
45
+
46
+ .twb-custom-button:before,
47
+ #wp-admin-bar-booster-top-button .ab-item:before {
48
+ content: '';
49
+ top: 4px;
50
+ left: 0px;
51
+ width: 18px;
52
+ height: 18px;
53
+ background: transparent url("../images/optimize.svg") 0% 0% no-repeat padding-box !important;
54
+ float: left;
55
+ position: relative;
56
+ margin-right: 6px;
57
+ }
58
+
59
+ .twb_elementor_control_title {
60
+ font-size: 12px;
61
+ font-weight: bold;
62
+ line-height: 18px;
63
+ vertical-align: middle;
64
+ display: flex;
65
+ align-items: center;
66
+ margin-bottom: 2px;
67
+ color:#1E1E1E
68
+ }
69
+
70
+ .elementor-control a.twb-green-button,
71
+ .elementor-control a.twb-custom-button,
72
+ .elementor-control a.twb-custom-button:hover {
73
+ display: inline-block;
74
+ margin: 10px 0 10px 0!important;
75
+ }
76
+
77
+ .elementor-control-twb_optimize_section .elementor-panel-heading {
78
+ display: none;
79
+ }
80
+
81
+ .elementor-panel .elementor-tab-control-twb_optimize {
82
+ position: relative;
83
+ padding: 0 5px;
84
+ box-sizing: border-box;
85
+ min-width: 80px;
86
+ width:initial;
87
+ }
88
+
89
+ .elementor-panel .elementor-panel-navigation .elementor-panel-navigation-tab.elementor-tab-control-twb_optimize a {
90
+ top: 22px;
91
+ position: absolute;
92
+ left: 50%;
93
+ transform: translateX(-50%);
94
+ font-size: 8px;
95
+ font-weight: 600;
96
+ width: 100%;
97
+ }
98
+
99
+ .elementor-control .twb-score-container,
100
+ .elementor-control .twb-score-disabled-container {
101
+ display: flex;
102
+ flex-direction: column;
103
+ padding: 0;
104
+ background: transparent 0% 0% no-repeat padding-box;
105
+ border: none;
106
+ color: #FFFFFF;
107
+ width: 100%;
108
+ position: relative;
109
+ }
110
+
111
+ .elementor-control .twb_elementor_control_title.twb_not_optimized {
112
+ background: url(../images/red-info.svg) no-repeat;
113
+ background-size: 16px;
114
+ padding-left: 22px;
115
+ font-size: 12px;
116
+ font-weight: bold;
117
+ line-height: 18px;
118
+ vertical-align: middle;
119
+ display: flex;
120
+ align-items: center;
121
+ margin-bottom: 2px;
122
+ color: #1E1E1E;
123
+ }
124
+
125
+ .elementor-control .twb-score-title {
126
+ font-size: 12px;
127
+ line-height: 18px;
128
+ font-weight: 400;
129
+ color: #1E1E1E;
130
+ margin-top: 2px;
131
+ }
132
+
133
+ .elementor-control .twb-score {
134
+ flex-direction: row;
135
+ display: flex;
136
+ padding: 20px 0 10px 0;
137
+ background-color: #F9F9F9;
138
+ margin: 20px 0 10px 0;
139
+ border-radius: 6px;
140
+ }
141
+
142
+ .elementor-control .twb-score-mobile,
143
+ .elementor-control .twb-score-desktop {
144
+ display: flex;
145
+ flex-direction: column;
146
+ width: 50%;
147
+ padding: 10px;
148
+ background: #FFFFFF0D 0% 0% no-repeat padding-box;
149
+ border-radius: 6px;
150
+ align-items: center;
151
+ margin: 0;
152
+ }
153
+
154
+ .elementor-control .twb-score-circle {
155
+ width: 40px;
156
+ height: 40px;
157
+ position: relative;
158
+ border-radius: 50%;
159
+ margin: 0;
160
+ background: #FD3C311A 0% 0% no-repeat padding-box;
161
+ }
162
+
163
+ .elementor-control .twb-score-text {
164
+ margin: 0;
165
+ text-align: center;
166
+ font-family: Open Sans;
167
+ font-weight: 100;
168
+ }
169
+
170
+ .elementor-control .twb-score-text-name {
171
+ display: block;
172
+ font: normal normal bold 10px/16px Open Sans;
173
+ letter-spacing: 0px;
174
+ opacity: 1;
175
+ color: #323A45;
176
+ }
177
+
178
+ .elementor-control .twb-load-text-time {
179
+ display: block;
180
+ font: normal normal 600 10px/16px Open Sans;
181
+ letter-spacing: 0.08px;
182
+ color: #323A45;
183
+ opacity: 0.5;
184
+ }
185
+
186
+ .elementor-control .twb_check_score_button {
187
+ width: 180px;
188
+ height: 30px;
189
+ line-height: 30px;
190
+ box-sizing: border-box;
191
+ text-decoration: none;
192
+ background-color: #22B339;
193
+ color: #FFFFFF;
194
+ border-radius: 4px;
195
+ text-align: center;
196
+ margin-top: 20px;
197
+ float: right;
198
+ cursor: pointer;
199
+ }
200
+
201
+ .elementor-control .twb_status_description {
202
+ padding-left: 21px;
203
+ font-size: 12px;
204
+ line-height: 18px;
205
+ }
206
+
207
+ .elementor-control .twb_elementor_control_title span.twb_inprogress {
208
+ background: transparent url(../images/loader_green.svg) 0 0 no-repeat padding-box;
209
+ animation: rotation 1s infinite linear;
210
+ background-size: 16px;
211
+ margin-right: 6px;
212
+ width: 16px;
213
+ height: 16px;
214
+ display: inline-block;
215
+ }
216
+
217
+ @keyframes rotation {
218
+ from {
219
+ transform: rotate(0deg);
220
+ }
221
+ to {
222
+ transform: rotate(359deg);
223
+ }
224
+ }
225
+
226
+ .elementor-control .twb-score-overlay {
227
+ width:47%;
228
+ height: 80px;
229
+ z-index: 10;
230
+ position: absolute;
231
+ background-color: #2E3338 !important;
232
+ align-items: center;
233
+ justify-content: center;
234
+ }
235
+
236
+ .elementor-control .twb-score-desktop-overlay {
237
+ right: 2%;
238
+ }
239
+ .elementor-control .twb-score-mobile-overlay {
240
+ left: 2%;
241
+ }
242
+
243
+ .elementor-control .twb-score-bottom a, .elementor-control .twb-score-bottom a:hover {
244
+ text-decoration: underline;
245
+ font-size: 12px;
246
+ line-height: 18px;
247
+ color: #22B339;
248
+ font-weight: 600;
249
+ cursor: pointer;
250
+ border: none;
251
+ }
252
+
253
+ .elementor-panel .elementor-tab-control-twb_optimize a:before {
254
+ width: 26px;
255
+ position: absolute;
256
+ top: -17px;
257
+ left: calc(50% - 13px);
258
+ content: " ";
259
+ height: 26px;
260
+ background: transparent url(../images/logo_dark.svg) 0 0 no-repeat;
261
+ background-size: 26px;
262
+ }
263
+
264
+ .elementor-panel-menu-item-icon .twb-element-menu-icon:before {
265
+ display: block;
266
+ margin: auto;
267
+ width: 26px;
268
+ height: 26px;
269
+ content: " ";
270
+ background: transparent url(../images/logo_dark.svg) 0 0 no-repeat;
271
+ background-size: 26px;
272
+ }
273
+
274
+ .elementor-panel .twb-dismiss-info {
275
+ justify-content: right;
276
+ margin-top: 15px;
277
+ opacity: 0.7;
278
+ }
279
+
280
+ .twb-hidden,
281
+ .twb-dismiss-container.twb-hidden,
282
+ .twb-score-container.twb-hidden,
283
+ .twb-score-overlay.twb-hidden,
284
+ .twb-score-disabled-container.twb-hidden {
285
+ display: none;
286
+ }
287
+
288
+ #twb-speed-galleries_bwg,
289
+ #twb-speed-manage_fm {
290
+ position: relative;
291
+ padding-left: 30px;
292
+ font-weight: 600;
293
+ width: 180px;
294
+ }
295
+ #twb-speed-galleries_bwg:before,
296
+ #twb-speed-manage_fm:before {
297
+ content: '';
298
+ position: absolute;
299
+ top: 18px;
300
+ left: 10px;
301
+ transform: translateY(-50%);
302
+ width: 15px;
303
+ height: 15px;
304
+ }
305
+ #twb-speed-galleries_bwg:before {
306
+ background: transparent url(../images/pg.svg) 0% 0% no-repeat padding-box;
307
+ }
308
+ #twb-speed-manage_fm:before {
309
+ background: transparent url(../images/fm.svg) 0% 0% no-repeat padding-box;
310
+ }
311
+
312
+ th[id^='twb-speed-']:after {
313
+ content: '';
314
+ position: absolute;
315
+ top: 18px;
316
+ right: 60px;
317
+ transform: translateY(-50%);
318
+ width: 15px;
319
+ height: 15px;
320
+ cursor: pointer;
321
+ }
322
+
323
+ th[id^='twb-speed-']:after {
324
+ background: transparent url(../images/closed_eye.svg) 0% 0% no-repeat padding-box;
325
+ }
326
+
327
+ .twb-page-speed {
328
+ position: relative;
329
+ padding-left: 20px;
330
+ font-size: 12px;
331
+ font-weight: 700;
332
+ font-family: Open Sans;
333
+ line-height: 18px;
334
+ color: #51575D;
335
+ }
336
+
337
+ .twb-notoptimized a,
338
+ a.twb-see-score {
339
+ color: #3A70AD;
340
+ text-decoration: underline;
341
+ cursor: pointer;
342
+ }
343
+
344
+ .twb-page-speed:before {
345
+ content: '';
346
+ position: absolute;
347
+ top: 8px;
348
+ left: 0px;
349
+ transform: translateY(-50%);
350
+ width: 16px;
351
+ height: 16px;
352
+ }
353
+
354
+ .twb-optimized:before {
355
+ background: transparent url(../images/not_optimized.svg) 0% 0% no-repeat padding-box;
356
+ }
357
+ .twb-notoptimized:before {
358
+ background: transparent url(../images/check_score.svg) 0% 0% no-repeat padding-box;
359
+ }
360
+ .twb-optimizing:before {
361
+ background: transparent url(../images/loader.svg) 0% 0% no-repeat padding-box;
362
+ margin: 8px 2px;
363
+ animation: rotation 1s infinite linear;
364
+ width: 14px;
365
+ height: 14px;
366
+ top: -6px
367
+ }
368
+ .twb-page-speed p.twb-description {
369
+ font-size: 11px;
370
+ margin: 0;
371
+ line-height: 12px;
372
+ font-weight: 600;
373
+ padding: 0;
374
+ color: #51575D;
375
+ }
376
+
377
+ .twb-score-container,
378
+ .twb-dismiss-container,
379
+ .twb-score-disabled-container {
380
+ display: flex;
381
+ flex-direction: column;
382
+ padding: 20px 25px;
383
+ background: #23282D 0% 0% no-repeat padding-box;
384
+ border: 1px solid #FFFFFF1A;
385
+ border-radius: 6px;
386
+ color: #FFFFFF;
387
+ position: absolute;
388
+ z-index: 10;
389
+ margin-top: -2px;
390
+ width: 350px;
391
+ }
392
+
393
+ #wpadminbar .twb-dismiss-info p,
394
+ .twb-dismiss-info {
395
+ display: flex;
396
+ margin: 0;
397
+ justify-content: right;
398
+ }
399
+
400
+ .twb-dismiss-container {
401
+ flex-direction: row;
402
+ width: 250px;
403
+ }
404
+
405
+ #wpadminbar .twb-dismiss-info p,
406
+ #wpadminbar .twb-dismiss-info a,
407
+ .wp-list-table .twb-dismiss-container p,
408
+ .wp-list-table .twb-dismiss-container a {
409
+ font: normal normal normal 12px/18px Open Sans;
410
+ letter-spacing: 0.1px;
411
+ color: #FFFFFFCC;
412
+ margin: 0;
413
+ }
414
+
415
+ .elementor-panel .twb-dismiss-info p,
416
+ .elementor-panel .twb-dismiss-info a {
417
+ font: normal normal 600 12px/18px Open Sans;
418
+ letter-spacing: 0.1px;
419
+ color: #323A45;
420
+ border: none;
421
+ }
422
+
423
+
424
+ #wpadminbar .twb-dismiss-info a,
425
+ .elementor-panel .twb-dismiss-info a,
426
+ .wp-list-table .twb-dismiss-container a {
427
+ text-decoration: underline;
428
+ }
429
+
430
+ #wpadminbar .twb-dismiss-info a {
431
+ padding: 0 0 0 3px;
432
+ height: auto;
433
+ }
434
+
435
+ #wpadminbar .twb-score-overlay,
436
+ .twb-score-overlay {
437
+ height: 32px;
438
+ z-index: 10;
439
+ position: absolute;
440
+ background-color: #2E3338 !important;
441
+ align-items: center;
442
+ justify-content: center;
443
+ }
444
+ #wpadminbar .twb-score-desktop-overlay,
445
+ .twb-score-desktop-overlay {
446
+ right: 20px;
447
+ }
448
+ #wpadminbar .twb-loader,
449
+ .twb-loader {
450
+ background: transparent url(../images/loader.svg) 0% 0% no-repeat padding-box;
451
+ animation: rotation 1s infinite linear;
452
+ width: 14px;
453
+ height: 14px;
454
+ }
455
+ #wpadminbar .twb-reload,
456
+ .twb-reload {
457
+ background: transparent url(../images/reload.svg) 0% 0% no-repeat padding-box;
458
+ width: 28px;
459
+ height: 28px;
460
+ cursor: pointer;
461
+ }
462
+ #wpadminbar .twb-score-title,
463
+ .twb-score-title {
464
+ font-size: 12px;
465
+ line-height: 18px;
466
+ font-weight: 600;
467
+ }
468
+ #wpadminbar .twb-score-desc,
469
+ .twb-score-desc {
470
+ font-size: 12px;
471
+ line-height: 18px;
472
+ font-weight: 400;
473
+ color: #FFFFFFCC;
474
+ }
475
+ #wpadminbar .twb-score,
476
+ .twb-score {
477
+ flex-direction: row;
478
+ display: flex;
479
+ padding: 20px 0 10px 0;
480
+ }
481
+
482
+ #wpadminbar .twb-score-bottom,
483
+ .twb-score-bottom {
484
+ text-align: right;
485
+ }
486
+ #wpadminbar .twb-score-bottom a,
487
+ #wpadminbar .twb-score-bottom a:hover,
488
+ .twb-score-bottom a,
489
+ .twb-score-bottom a:hover {
490
+ text-decoration: underline;
491
+ font-size: 12px;
492
+ line-height: 18px;
493
+ color: #22B339;
494
+ font-weight: 400;
495
+ cursor: pointer;
496
+ padding: 0px;
497
+ }
498
+
499
+ #wpadminbar .twb-score-mobile,
500
+ .twb-score-mobile {
501
+ margin-right: 10px;
502
+ }
503
+
504
+ #wpadminbar .twb-score-mobile,
505
+ #wpadminbar .twb-score-desktop,
506
+ .twb-score-mobile,
507
+ .twb-score-desktop {
508
+ display: flex;
509
+ width: 150px;
510
+ padding: 10px;
511
+ background: #FFFFFF0D 0% 0% no-repeat padding-box;
512
+ border-radius: 6px;
513
+ }
514
+
515
+ #wpadminbar .twb-score-text,
516
+ .twb-score-text {
517
+ margin-right: 16px;
518
+ text-align: left;
519
+ font-family: Open Sans;
520
+ font-weight: 100;
521
+ }
522
+
523
+ #wpadminbar .twb-score-text-name,
524
+ .twb-score-text-name {
525
+ display: block;
526
+ font: normal normal bold 10px/16px Open Sans;
527
+ letter-spacing: 0px;
528
+ opacity: 1;
529
+ }
530
+ #wpadminbar .twb-load-text-time,
531
+ .twb-load-text-time {
532
+ display: block;
533
+ font: normal normal 600 10px/16px Open Sans;
534
+ letter-spacing: 0.08px;
535
+ opacity: 0.5;
536
+ }
537
+
538
+ #wpadminbar .twb-score-circle,
539
+ .twb-score-circle {
540
+ width: 30px;
541
+ height: 30px;
542
+ position: relative;
543
+ border-radius: 50%;
544
+ margin-right: 12px;
545
+ background: #FFFFFF0D 0% 0% no-repeat padding-box;
546
+ }
547
+
548
+ #wpadminbar .twb-score0,
549
+ .twb-score0 {
550
+ background: url(../images/red-info.svg) no-repeat #FD3C310D;
551
+ background-size: 30px;
552
+ width: 30px;
553
+ height: 30px;
554
+ position: absolute;
555
+ left: -15px;
556
+ top: -15px;
557
+ border-radius: 30px;
558
+ }
559
+
560
+ #wpadminbar .twb-score-circle .twb-score-circle-animated,
561
+ .twb-score-circle .twb-score-circle-animated {
562
+ position: absolute;
563
+ left: 50%;
564
+ top: 50%;
565
+ -webkit-transform: translate(-50%, -50%);
566
+ -moz-transform: translate(-50%, -50%);
567
+ transform: translate(-50%, -50%);
568
+ text-align: center;
569
+ font: normal normal bold 12px/18px Open Sans;
570
+ letter-spacing: 0px;
571
+ }
572
+
573
+ /* Admin Bar styles start */
574
+ #wp-admin-bar-twb_adminbar_info {
575
+ height: 25px;
576
+ }
577
+
578
+ #wpadminbar .quicklinks #wp-admin-bar-twb_adminbar_info .ab-empty-item {
579
+ display: flex;
580
+ height: 25px;
581
+ }
582
+
583
+ #wpadminbar:not(.mobile) .ab-top-menu>li#wp-admin-bar-twb_adminbar_info:hover>.ab-item {
584
+ background: transparent;
585
+ }
586
+ #wpadminbar .twb_admin_bar_menu_header {
587
+ display: flex;
588
+ align-items: center;
589
+ height: 25px;
590
+ padding: 2px 8px;
591
+ box-sizing: border-box;
592
+ border-radius: 2px;
593
+ color: #FFFFFF;
594
+ font-size: 12px;
595
+ line-height: 18px;
596
+ letter-spacing: 0.1px;
597
+ font-weight: 700;
598
+ font-family: Open Sans;
599
+ background-color: #22B339;
600
+ margin-top: 3px;
601
+ }
602
+
603
+ #wpadminbar .twb_not_optimized_logo {
604
+ color: #FFFFFF;
605
+ font-size: 12px;
606
+ line-height: 18px;
607
+ letter-spacing: 0.1px;
608
+ font-weight: 700;
609
+ font-family: Open Sans;
610
+ }
611
+
612
+ #wpadminbar .twb_admin_bar_menu.twb_backend .twb_admin_bar_menu_header {
613
+ margin-top: 0;
614
+ background-color: transparent;
615
+ }
616
+
617
+ #wpadminbar .twb_admin_bar_menu_header.twb_not_optimized {
618
+ background-color: transparent;
619
+ }
620
+
621
+ #wpadminbar .twb_admin_bar_menu_header img {
622
+ width: 18px;
623
+ cursor: pointer;
624
+ margin-right: 4px;
625
+ }
626
+
627
+ #wpadminbar .twb_admin_bar_menu_header.twb_not_optimized img {
628
+ width: 12px;
629
+ cursor: pointer;
630
+ margin-right: 7px;
631
+ }
632
+
633
+ #wpadminbar .twb_admin_bar_menu.twb_frontend.twb_score_inprogress span,
634
+ #wpadminbar .twb_admin_bar_menu.twb_backend .twb_admin_bar_menu_header span {
635
+ background: transparent url(../images/loader_green.svg) 0 0 no-repeat padding-box;
636
+ animation: rotation 1s infinite linear;
637
+ width: 18px;
638
+ height: 18px;
639
+ padding: 0;
640
+ margin-left: 0px;
641
+ margin-top: 6px;
642
+ }
643
+
644
+ #wpadminbar .twb_admin_bar_menu.twb_backend .twb_admin_bar_menu_header span.twb_backend_not_optimized_logo {
645
+ background: transparent url(../images/not_optimized.svg) 0 3px no-repeat padding-box;
646
+ animation: none;
647
+ background-size: 12px;
648
+ }
649
+
650
+ #wpadminbar .twb_admin_bar_menu.twb_frontend.twb_score_inprogress .twb_vr {
651
+ display: inline-block;
652
+ width: 1px;
653
+ height: 18px;
654
+ background-color: #FFFFFF1A;
655
+ margin: 7px 10px 0 10px;
656
+ }
657
+
658
+
659
+ #wpadminbar .twb_admin_bar_menu.twb_backend .twb_admin_bar_menu_header span.twb_counted {
660
+ background: transparent url(../images/not_optimized.svg) 0 0 no-repeat padding-box;
661
+ animation:none;
662
+ }
663
+
664
+ @keyframes rotation {
665
+ from {
666
+ transform: rotate(0deg);
667
+ }
668
+ to {
669
+ transform: rotate(359deg);
670
+ }
671
+ }
672
+
673
+ #wpadminbar .twb_admin_bar_menu {
674
+ height: 100%;
675
+ cursor: pointer;
676
+ }
677
+
678
+ #wpadminbar div.twb_admin_bar_menu_main {
679
+ position: absolute;
680
+ background: transparent;
681
+ display: block;
682
+ padding-top: 10px;
683
+ left: 10px;
684
+ font-family: Open Sans;
685
+ }
686
+
687
+ #wpadminbar .twb_admin_bar_menu_content {
688
+ display: inline-block;
689
+ width: 400px;
690
+ height: auto;
691
+ padding: 25px 25px 20px 25px;
692
+ background-color: #23282D;
693
+ border: 1px solid #FFFFFF1A;
694
+ border-radius: 6px;
695
+ box-sizing: border-box;
696
+ font-family: Open Sans;
697
+ }
698
+
699
+ #wpadminbar .twb_admin_bar_menu_main_notif .twb_counted {
700
+ margin-bottom: 10px;
701
+ }
702
+
703
+ #wpadminbar .twb_admin_bar_menu_main_notif .twb_counted .twb_counted_cont {
704
+ border-bottom: 1px solid #FFFFFF1A;
705
+ }
706
+
707
+ #wpadminbar .twb_admin_bar_menu_main_notif .twb_counted .twb_counted_cont:first-child {
708
+ margin-top: 0px
709
+ }
710
+
711
+ #wpadminbar .twb_admin_bar_menu_main_notif .twb_counted .twb_counted_cont {
712
+ margin-top: 25px
713
+ }
714
+
715
+ #wpadminbar .twb_admin_bar_menu_main_notif .twb_counted .twb_counted_cont:last-child {
716
+ border: none;
717
+ }
718
+
719
+ #wpadminbar .twb_counted .twb_counted_congrats_row {
720
+ display: flex;
721
+ }
722
+
723
+ #wpadminbar .twb_counted .twb_counted_congrats_row span {
724
+ width: 18px;
725
+ height: 18px;
726
+ }
727
+
728
+ #wpadminbar .twb_admin_bar_menu_content .twb_status_title {
729
+ display: flex;
730
+ flex-grow: 1;
731
+ align-items: center;
732
+ font-size: 14px;
733
+ line-height: 20px;
734
+ color: #FFFFFF;
735
+ font-weight: bold;
736
+ margin-bottom: 4px;
737
+ }
738
+
739
+ #wpadminbar .twb_counted .twb_status_title {
740
+ background: url(../images/green-info.svg) 0 no-repeat padding-box;
741
+ background-size: 16px;
742
+ padding-left: 25px;
743
+ }
744
+
745
+ #wpadminbar .twb_admin_bar_menu.twb_frontend.twb_score_inprogress {
746
+ display: flex;
747
+ }
748
+ #wpadminbar .twb_admin_bar_menu_content .twb_score_inprogress span {
749
+ display: inline-block;
750
+ width: 16px;
751
+ height: 16px;
752
+ background-size: 16px!important;
753
+ margin-left: 0;
754
+ margin-right: 5px;
755
+ background: transparent url(../images/loader_green.svg) 0 0 no-repeat padding-box;
756
+ animation: rotation 1s infinite linear;
757
+ background-position: top 2px;
758
+ }
759
+
760
+ #wpadminbar .twb_admin_bar_menu_content .twb_status_description {
761
+ font: normal normal normal 12px/18px Open Sans;
762
+ letter-spacing: 0.1px;
763
+ color: #FFFFFF;
764
+ opacity: 0.8;
765
+ }
766
+
767
+ #wpadminbar .twb_admin_bar_menu_content.twb_counted .twb_status_description {
768
+ margin-bottom: 20px;
769
+ opacity: 1;
770
+ }
771
+ #wpadminbar .twb_admin_bar_menu_content.twb_counted .twb_status_description span {
772
+ font: italic normal bold 12px/18px Open Sans;
773
+ }
774
+
775
+ #wpadminbar .twb_admin_bar_menu_content .twb_check_score_button_cont,
776
+ .elementor-control .twb_check_score_button_cont{
777
+ display: flex;
778
+ justify-content: right;
779
+ margin-bottom: 15px;
780
+ }
781
+
782
+ #wpadminbar .twb_admin_bar_menu_content .twb_check_score_button {
783
+ width: 180px;
784
+ height: 30px;
785
+ line-height: 30px;
786
+ box-sizing: border-box;
787
+ text-decoration: none;
788
+ background-color: #22B339;
789
+ color: #FFFFFF;
790
+ border-radius: 4px;
791
+ text-align: center;
792
+ margin-top: 20px;
793
+ float: right;
794
+ cursor: pointer;
795
+ }
796
+
797
+
798
+ #wpadminbar .twb_counted .twb_counted_congrats_row span.twb_up_arrow {
799
+ background: url(../images/up_arrow_nav.svg) 0 no-repeat padding-box;
800
+ background-size: 18px;
801
+ }
802
+
803
+ #wpadminbar .twb_counted .twb_counted_congrats_row span.twb_down_arrow {
804
+ background: url(../images/down_arrow_nav.svg) 0 no-repeat padding-box;
805
+ background-size: 18px;
806
+ }
807
+
808
+ #wpadminbar .twb_score_success_container_title {
809
+ line-height: 18px;
810
+ margin-bottom: 15px;
811
+ color: #fff;
812
+ }
813
+
814
+ #wpadminbar .twb_counted .twb_counted_congrats_subtitle {
815
+ font-size: 12px;
816
+ line-height: 18px;
817
+ letter-spacing: 0.1px;
818
+ }
819
+
820
+ #wpadminbar .twb_counted .twb_counted_congrats_subtitle span {
821
+ color: #FFFFFF;
822
+ font-style: italic;
823
+ font-weight: 600;
824
+ }
825
+
826
+ #wpadminbar .twb_admin_bar_menu_main hr {
827
+ height: 1px;
828
+ background-color: #FFFFFF1A;
829
+ margin: 20px 0;
830
+ border: none;
831
+ }
832
+
833
+ #wpadminbar .twb_counting_container {
834
+ width: 400px;
835
+ height: auto;
836
+ padding: 25px 25px 20px 25px;
837
+ background-color: #23282D;
838
+ border: 1px solid #FFFFFF1A;
839
+ border-radius: 6px;
840
+ box-sizing: border-box;
841
+ font-family: Open Sans;
842
+ }
843
+
844
+ #wpadminbar .twb_counting_container p.twb_counting_title {
845
+ display: flex;
846
+ align-items: center;
847
+ font: normal normal bold 14px/20px Open Sans;
848
+ letter-spacing: 0px;
849
+ color: #FFFFFF;
850
+ opacity: 1;
851
+ margin-bottom: 4px;
852
+ }
853
+
854
+ #wpadminbar .twb_counting_container p.twb_counting_descr {
855
+ font: normal normal normal 12px/14px Open Sans;
856
+ letter-spacing: 0.1px;
857
+ color: #FFFFFFCC;
858
+ border-bottom:1px solid #FFFFFF1A;
859
+ padding-bottom: 20px;
860
+ margin-bottom: 20px;
861
+ }
862
+
863
+ #wpadminbar .twb_counting_container p.twb_counting_descr:last-child {
864
+ border-bottom: none;
865
+ padding-bottom: 0px;
866
+ margin-bottom: 0px;
867
+ }
868
+
869
+ #wpadminbar .twb_counting_container p.twb_counting_title span {
870
+ display: inline-block;
871
+ width: 14px;
872
+ height: 14px;
873
+ background: transparent url(../images/loader_green.svg) 0 0 no-repeat padding-box;
874
+ background-size: 14px;
875
+ animation: rotation 1s infinite linear;
876
+ margin-right: 5px;
877
+ }
878
+
879
+ #wpadminbar .twb-score-container{
880
+ border: none;
881
+ }
882
+
883
+ #wpadminbar .twb-score-circle .twb-score-circle-animated {
884
+ color: #ffffff!important;
885
+ }
886
+
887
+ #wpadminbar .twb-score-text-name {
888
+ font-size: 10px;
889
+ line-height: 16px;
890
+ font-weight: bold;
891
+ letter-spacing: 0;
892
+ }
893
+
894
+ #wpadminbar .twb-load-text-time {
895
+ font-size: 10px;
896
+ line-height: 16px;
897
+ font-weight: bold;
898
+ letter-spacing: 0;
899
+ opacity: 0.5;
900
+ }
901
+
902
+ #wpadminbar .twb-load-time {
903
+ line-height: 0;
904
+ }
905
+
906
+ #wpadminbar .twb-score-circle, .twb-score-circle {
907
+ margin-right: 8px;
908
+ }
909
+
910
+ #wpadminbar .twb-hidden {
911
+ display: none!important;
912
+ }
913
+ /* Admin bar styles End */
914
+
915
+ @media only screen and (max-width: 785px) {
916
+ .wp-list-table .twb-score-container {
917
+ display: none;
918
+ }
919
+ }
booster/assets/css/speed.css ADDED
@@ -0,0 +1,1512 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .twb-speed-header {
2
+ width: 714px;
3
+ height: auto;
4
+ background-color: #FFFFFF;
5
+ margin: auto;
6
+ padding: 20px 40px 20px 20px;
7
+ box-sizing: border-box;
8
+ border-radius: 4px;
9
+ font-family: 'Open Sans';
10
+ border: 1px solid #DEDEDE;
11
+ }
12
+
13
+ .twb-speed-header .twb-sign-up-dashboard-button-container {
14
+ display: flex;
15
+ gap: 15px;
16
+ }
17
+
18
+ .twb-hidden {
19
+ display: none!important;
20
+ }
21
+
22
+ .twb-speed-body {
23
+ font-family: 'Open Sans';
24
+ border: 1px solid #DEDEDE;
25
+ }
26
+
27
+ .twb-section-title,
28
+
29
+ .twb-install-booster-container p.twb-section-title,
30
+ .twb-booster-container p.twb-section-title,
31
+ .twb-speed-body-container p.twb-section-title,
32
+ .twb-connected-booster-content p.twb-section-title{
33
+ padding: 0;
34
+ margin: 0 0 2px 0;
35
+ color: #323A45;
36
+ font-size: 16px;
37
+ line-height: 26px;
38
+ font-weight: bold;
39
+ }
40
+
41
+ .twb-speed-body-container p.twb-section-title {
42
+ margin: 0 0 5px 0;
43
+ }
44
+
45
+ .twb-description {
46
+ padding: 0;
47
+ margin: 0;
48
+ font-size: 14px;
49
+ line-height: 20px;
50
+ color: #323A45;
51
+ }
52
+
53
+ ul.twb-install-booster-steps {
54
+ display: flex;
55
+ justify-content: space-between;
56
+ list-style: none; /* Remove default bullets */
57
+ margin: 45px 0 0 0;
58
+ }
59
+
60
+ ul.twb-install-booster-steps li {
61
+ margin: 0;
62
+ padding: 13px 0 0 0;
63
+ width: 211px;
64
+ font-size: 12px;
65
+ font-weight: 600;
66
+ line-height: 18px;
67
+ color: #323A45;
68
+ border-top: 12px solid #323A4510;
69
+ position: relative;
70
+ }
71
+ ul.twb-install-booster-steps li.twb_so_check_active {
72
+ border-color: #22B339;
73
+ }
74
+ ul.twb-install-booster-steps li.twb_so_check_active span{
75
+ color: #22B339;
76
+ }
77
+ ul.twb-install-booster-steps li.twb_so_check_active:after{
78
+ background-image: url(../images/check_green.jpg);
79
+ }
80
+
81
+ ul.twb-install-booster-steps li:after {
82
+ content: ".";
83
+ height: 36px;
84
+ width: 36px;
85
+ position: absolute;
86
+ top: -24px;
87
+ right: -12px;
88
+ border-radius: 50%;
89
+ box-sizing: border-box;
90
+ color: #ffffff00;
91
+ background-image: url(../images/check_grey.jpg);
92
+ background-size: contain;
93
+ z-index: 1;
94
+ }
95
+
96
+ ul.twb-install-booster-steps li span {
97
+ display: block;
98
+ font-size: 12px;
99
+ line-height: 18px;
100
+ letter-spacing: 0.1px;
101
+ color: #323A4580;
102
+
103
+ }
104
+
105
+ ul.twb-install-booster-steps li:last-child:after {
106
+ right: -2px;
107
+ top: -27px;
108
+ height: 42px;
109
+ width: 42px;
110
+ background-image: url(../images/star_grey.jpg);
111
+ }
112
+ .twb-button-container-parent {
113
+ margin-top: 30px;
114
+ display: flex;
115
+ justify-content: end;
116
+ }
117
+
118
+ .button-container {
119
+ display: inline-block;
120
+ }
121
+
122
+ .button-container p {
123
+ font-size: 10px;
124
+ line-height: 16px;
125
+ letter-spacing: 0.08px;
126
+ color: #323A45;
127
+ margin: 0;
128
+ padding: 8px 0 0 0;
129
+ text-align: center;
130
+ }
131
+
132
+ a.twb-install-booster,
133
+ a.twb-manage-booster,
134
+ a.twb-booster-button {
135
+ display: block;
136
+ height: 40px;
137
+ box-sizing: border-box;
138
+ font-size: 14px;
139
+ font-weight: 400;
140
+ line-height: 14px;
141
+ text-align: center;
142
+ padding: 13px 16px;
143
+ background-color: #2160B5;
144
+ border-radius: 4px;
145
+ color:#ffffff;
146
+ text-decoration: none;
147
+ cursor: pointer;
148
+ }
149
+
150
+ a.twb-manage-booster {
151
+ width: 210px;
152
+ }
153
+
154
+ a.twb-install-booster:hover,
155
+ a.twb-booster-button:hover,
156
+ a.twb-optimize-now-button:hover,
157
+ a.twb-optimize-add-pages,
158
+ a.twb-manage-booster {
159
+ color: #ffffff
160
+ }
161
+
162
+
163
+ a.twb-disable-link {
164
+ cursor: default;
165
+ opacity: 0.5;
166
+ }
167
+
168
+ a.twb-disable-analyze {
169
+ background-color: #ffffff;
170
+ cursor: default;
171
+ opacity: 0.5;
172
+ }
173
+
174
+ a.twb-disable-link:hover {
175
+ background-color: #2160B5;
176
+ color: #ffffff;
177
+ cursor: default;
178
+ }
179
+
180
+ .twb-loading-image {
181
+ width: 15px;
182
+ }
183
+
184
+ .twb-booster-container > div {
185
+ display: flex;
186
+ }
187
+
188
+ .twb-booster-container > div > div {
189
+ padding: 0 0 0 15px;
190
+ box-sizing: border-box;
191
+ max-width: 420px;
192
+ font-size: 12px;
193
+ line-height: 18px;
194
+ color: #323A45;
195
+ }
196
+
197
+ .twb-booster-container > div > div a {
198
+ color: #323A45;
199
+ }
200
+
201
+ .twb-sign-up-dashboard-button-container {
202
+ margin-top: 30px;
203
+ }
204
+
205
+ input.twb-sign-up-input {
206
+ display: block;
207
+ margin-top: 30px;
208
+ padding: 10px 16px;
209
+ width: 550px;
210
+ height: 40px;
211
+ box-sizing: border-box;
212
+ border: 1px solid #323A4533;
213
+ border-radius: 6px;
214
+ }
215
+
216
+ ::-webkit-input-placeholder { /* Edge */
217
+ color: #323A4580;
218
+ }
219
+
220
+ :-ms-input-placeholder { /* Internet Explorer 10-11 */
221
+ color: #323A4580;
222
+ }
223
+
224
+ ::placeholder {
225
+ color: #323A4580;
226
+ }
227
+
228
+ .twb-speed-body {
229
+ width: 714px;
230
+ height: auto;
231
+ background-color: #FFFFFF;
232
+ margin: 20px auto;
233
+ padding: 20px;
234
+ box-sizing: border-box;
235
+ border-radius: 4px;
236
+ }
237
+
238
+ .twb-speed-footer {
239
+ display: flex;
240
+ align-items: center;
241
+ width: 714px;
242
+ height: auto;
243
+ background-color: #FFFFFF;
244
+ margin: 20px auto;
245
+ padding: 20px;
246
+ box-sizing: border-box;
247
+ border-radius: 4px;
248
+ font-family: 'Open Sans';
249
+ border: 1px solid #DEDEDE;
250
+ }
251
+
252
+ .twb-speed-footer input[type=checkbox] {
253
+ padding: 0;
254
+ margin: 0 10px 0 0;
255
+ width: 14px;
256
+ height: 14px;
257
+ min-width: 14px;
258
+ border: 1px solid #8c8f94;
259
+ }
260
+ .twb-speed-footer input[type=checkbox]:checked {
261
+ border: none;
262
+ }
263
+ .twb-speed-footer input[type=checkbox]:checked::before {
264
+ content: ' ';
265
+ background: url(../images/check_white.png) 1px 3px no-repeat;
266
+ background-size: 10px;
267
+ background-color: #0A53BE;
268
+ color: #ffffff;
269
+ width: 13px;
270
+ height: 13px;
271
+ margin: 0;
272
+ border-radius: 3px;
273
+ }
274
+
275
+ .twb-speed-footer p {
276
+ padding: 0;
277
+ margin: 0;
278
+ text-align: left;
279
+ font: normal normal 600 12px/18px Open Sans;
280
+ letter-spacing: 0px;
281
+ color: #323A45;
282
+ }
283
+
284
+ .twb-analyze-input-container {
285
+ display: flex;
286
+ margin-top: 20px;
287
+ position: relative;
288
+ }
289
+
290
+ .twb-analyze-input {
291
+ width: 414px;
292
+ height: 40px;
293
+ box-sizing: border-box;
294
+ border: 1px solid #323A4533;
295
+ border-radius: 6px;
296
+ margin-right: 25px;
297
+ }
298
+
299
+ .twb-analyze-input-error,
300
+ .twb-input-error {
301
+ border-color: #FD3C31 !important;
302
+ }
303
+ .twb-analyze-input--error-message {
304
+ display: block;
305
+ margin-top: 3px;
306
+ text-align: left;
307
+ line-height: 18px;
308
+ letter-spacing: 0px;
309
+ font-family: 'Open Sans';
310
+ font-weight: normal;
311
+ font-style: italic;
312
+ font-size: 12px;
313
+ color: #FD3C31;
314
+ }
315
+
316
+
317
+ .twb-analyze-input-button {
318
+ display: block;
319
+ width:210px;
320
+ height: 40px;
321
+ text-align: center;
322
+ box-sizing: border-box;
323
+ text-decoration: none;
324
+ border: 1px solid #DEDEDE;
325
+ border-radius: 4px;
326
+ line-height: 37px;
327
+ color: #323A45;
328
+ cursor: pointer;
329
+ }
330
+
331
+ .twb-analyze-input-button:hover {
332
+ color: #323A45;
333
+ }
334
+
335
+ .twb-analyze-info-container {
336
+ display: flex;
337
+ width: 100%;
338
+ height: 204px;
339
+ margin-top: 30px;
340
+ }
341
+
342
+ .twb-analyze-info-left-cont {
343
+ display: flex;
344
+ }
345
+
346
+ .twb-analyze-mobile-score,
347
+ .twb-analyze-desktop-score {
348
+ width: 202px;
349
+ height: 158px;
350
+ background: #F9F9F9;
351
+ }
352
+
353
+ .twb-analyze-mobile-score {
354
+ margin-right: 5px;
355
+ background: url(../images/mobile.svg) no-repeat #F9F9F9;
356
+ background-size: 18px;
357
+ background-position: 10px 10px;
358
+ }
359
+
360
+ .twb-analyze-desktop-score {
361
+ margin-left: 5px;
362
+ background: url(../images/desktop.svg) no-repeat #F9F9F9;
363
+ background-size: 18px;
364
+ background-position: 10px 10px;
365
+ }
366
+
367
+ .twb-analyze-score-info {
368
+ width: 414px;
369
+ height: 38px;
370
+ background: #F9F9F9;
371
+ margin-top: 8px;
372
+ line-height: 38px;
373
+ text-align: center;
374
+ font-size: 12px;
375
+ font-weight: 600;
376
+ }
377
+
378
+ .twb-score-icon {
379
+ width: 8px;
380
+ height: 4px;
381
+ border-radius: 3px;
382
+ display: inline-block;
383
+ vertical-align: middle;
384
+ }
385
+
386
+ .twb-fast-icon {
387
+ background-color: #22B339;
388
+ margin: 0 4px 0 2px;
389
+ }
390
+
391
+ .twb-averege-icon {
392
+ background-color: #F8C332;
393
+ margin: 0 4px 0 13px;
394
+ }
395
+
396
+ .twb-slow-icon {
397
+ background-color: #FD3C31;
398
+ margin: 0 4px 0 16px;
399
+ }
400
+
401
+
402
+ .twb-analyze-info-right {
403
+ width: 250px;
404
+ height: 204px;
405
+ background: #F9F9F9;
406
+ margin-left: 10px;
407
+ padding: 0 20px;
408
+ box-sizing: border-box;
409
+ position: relative;
410
+ }
411
+
412
+ .twb-last-analyzed-date-container {
413
+ position: absolute;
414
+ padding: 0;
415
+ margin: 0;
416
+ height: 38px;
417
+ bottom: 12px;
418
+ }
419
+
420
+ .twb-analyze-info-right .twb-last-analyzed-date-container h3,
421
+ .twb-analyze-info-right .twb-last-analyzed-date-container p {
422
+ margin: 0;
423
+ padding: 0;
424
+ }
425
+
426
+ .twb-analyze-info-right p.twb-analyze-info-right-sub-title {
427
+ padding: 0;
428
+ margin: 18px 0 0 0;
429
+ font-size: 12px;
430
+ line-height: 18px;
431
+ color: #323A45;
432
+ font-weight: 600;
433
+ }
434
+
435
+ .twb-analyze-info-right a {
436
+ color: #2160B5;
437
+ font-size: 12px;
438
+ line-height: 18px;
439
+ padding: 0;
440
+ margin: 0;
441
+ font-weight: 600;
442
+ }
443
+
444
+ .twb-analyze-info-right hr {
445
+ margin: 15px 0 0 0;
446
+ color: #F1F1F1;
447
+ border: 1px solid #F1F1F1;
448
+ }
449
+
450
+ .twb-analyze-info-right h3 {
451
+ font-size: 14px;
452
+ line-height: 20px;
453
+ margin: 15px 0 0 0;
454
+ padding: 0;
455
+ letter-spacing: 0.12px;
456
+ font-weight: bold;
457
+ }
458
+
459
+ .twb-analyze-info-right p.twb-last-analyzed-page {
460
+ display: inline-block;
461
+ word-break: break-all;
462
+ max-height: 35px;
463
+ overflow: hidden;
464
+ }
465
+
466
+ .twb-analyze-info-right p {
467
+ display: block;
468
+ font-size: 12px;
469
+ line-height: 18px;
470
+ margin: 0 0 17px 0;
471
+ padding: 0;
472
+ color: #323A45;
473
+ }
474
+
475
+ .twb-error-msg {
476
+ position: absolute;
477
+ color: #FD3C31;
478
+ font-size: 12px;
479
+ line-height: 18px;
480
+ margin: 0;
481
+ padding: 0;
482
+ font-style: italic;
483
+ }
484
+
485
+ .twb-analyze-input-container .twb-error-msg {
486
+ bottom: -20px
487
+ }
488
+
489
+
490
+ .twb-connected-booster-content p.twb-section-title {
491
+ margin-top: 10px;
492
+ }
493
+
494
+ .twb-connected-booster-content {
495
+ width: 60%;
496
+ }
497
+
498
+ .twb-connected-booster-container.twb-is-free {
499
+ flex-wrap: wrap;
500
+ }
501
+
502
+ .twb-connected-booster-container.twb-is-free .twb-connected-booster-content,
503
+ .twb-connected-booster-container.twb-is-free .button-container {
504
+ width: 100%;
505
+ }
506
+
507
+ .twb-connected-booster-container.twb-is-free .button-container {
508
+ margin-top: 30px;
509
+ }
510
+
511
+ .twb-connected-booster-container .button-container {
512
+ width: 40%;
513
+ display: flex;
514
+ align-items: flex-end;
515
+ justify-content: right;
516
+ }
517
+
518
+ .twb-header-description {
519
+ margin: 0;
520
+ padding: 0;
521
+ line-height: 20px;
522
+ font-size: 14px;
523
+ }
524
+
525
+ .twb-connected-booster-done-cont {
526
+ width: 138px;
527
+ height: 30px;
528
+ box-sizing: border-box;
529
+ border: 1px solid #22B33919;
530
+ border-radius: 6px;
531
+ text-align: left;
532
+ vertical-align: middle;
533
+ line-height: 28px;
534
+ background: url(../images/check_green_bg.svg) no-repeat #22B3390D;
535
+ background-size: 18px;
536
+ background-position: 6px;
537
+ padding: 0 0 0 29px;
538
+ font-size: 12px;
539
+ color: #323A45;
540
+ letter-spacing: 0.1px;
541
+ font-weight: 600;
542
+ }
543
+
544
+ .twb-connected-booster-content p.twb-section-title {
545
+ margin-top: 10px;
546
+ }
547
+
548
+ .twb-score-name {
549
+ font-size: 10px;
550
+ line-height: 16px;
551
+ color: #323A45;
552
+ text-align: center;
553
+ font-weight: bold;
554
+ margin: 0;
555
+ padding: 0;
556
+ }
557
+
558
+ .twb-load-time {
559
+ font-size: 12px;
560
+ line-height: 18px;
561
+ color: #7E838A;
562
+ text-align: center;
563
+ font-weight: 600;
564
+ margin: 0;
565
+ padding: 0;
566
+ letter-spacing: 0.1px;
567
+ }
568
+
569
+ .speed_circle,
570
+ .speed_circle_loader {
571
+ width: 78px;
572
+ height: 78px;
573
+ position: relative;
574
+ border-radius: 50%;
575
+ margin: 18px auto 14px;
576
+ }
577
+
578
+ .speed_circle p.circle_animated {
579
+ font-size: 26px;
580
+ font-weight: bold;
581
+ line-height: 37px;
582
+ position: absolute;
583
+ color: #ffffff;
584
+ left: 50%;
585
+ top: 50%;
586
+ -webkit-transform: translate(-50%, -50%);
587
+ -moz-transform: translate(-50%, -50%);
588
+ transform: translate(-50%, -50%);
589
+ margin: 0;
590
+ padding: 0;
591
+ }
592
+
593
+ .speed_circle_loader {
594
+ animation: rotation 1s infinite linear;
595
+ background: url("../images/google_spinner.svg") no-repeat;
596
+ background-size: 100%;
597
+ }
598
+
599
+ .twb-analyze-img_optimizer-container {
600
+ padding: 20px;
601
+ box-sizing: border-box;
602
+ display: flex;
603
+ width: 100%;
604
+ background-color: #F9F9F9;
605
+ margin-top: 20px;
606
+ margin-bottom: 30px;
607
+ }
608
+
609
+ .twb-analyze-img_optimizer-container.twb-optimize_pending {
610
+ align-items: center;
611
+ position: relative;
612
+ }
613
+
614
+ .twb-analyze-img_optimizer-container.twb-optimize_pending > div:first-child {
615
+ width: 424px;
616
+ border-right: 1px solid #E4E4E4;
617
+ }
618
+
619
+ .twb-analyze-img_optimizer-container.twb-optimize_pending .twb-img-count-container {
620
+ text-align: center;
621
+ flex-grow: 1;
622
+ padding-left: 20px;
623
+ }
624
+
625
+ .twb-analyze-img_optimizer-container.twb-optimize_pending .twb-img-count-container h5 {
626
+ font-size: 50px;
627
+ line-height: 75px;
628
+ color: #323A45;
629
+ font-weight: bold;
630
+ margin: 0;
631
+ padding: 0;
632
+ }
633
+
634
+ .twb-analyze-img_optimizer-container.twb-optimize_pending .twb-img-count-container h5 span {
635
+ font-size: 20px;
636
+ line-height: 53px;
637
+ vertical-align: bottom;
638
+ }
639
+
640
+ .twb-analyze-img_optimizer-container.twb-optimize_pending .twb-img-count-container p {
641
+ font-size: 14px;
642
+ line-height: 20px;
643
+ color: #323A45;
644
+ opacity: 0.7;
645
+ margin: 4px 0 0 0;
646
+ padding: 0;
647
+ letter-spacing: 0.12px;
648
+ font-weight: 600;
649
+ }
650
+
651
+ .twb-analyze-img_optimizer-container p.twb-section-title {
652
+ margin-bottom: 2px;
653
+ }
654
+
655
+ .twb-analyze-img_optimizer-container.twb-optimize_pending ul {
656
+ margin: 18px 0 0 0;
657
+ padding: 0;
658
+ }
659
+
660
+
661
+ .twb-analyze-img_optimizer-container.twb-optimize_pending li {
662
+ text-align: left;
663
+ font: normal normal 600 12px/18px Open Sans;
664
+ letter-spacing: 0px;
665
+ color: #323A45;
666
+ font-size: 12px;
667
+ line-height: 18px;
668
+ font-weight: 600;
669
+ margin-bottom: 10px;
670
+ padding-left: 26px;
671
+ background: url(../images/close_error.svg) no-repeat #F9F9F9;
672
+ background-size: 22px;
673
+ background-position: 0 -2px;
674
+ }
675
+
676
+ .twb-optimize-now-button {
677
+ display: block;
678
+ width: 210px;
679
+ height: 40px;
680
+ box-sizing: border-box;
681
+ font-size: 14px;
682
+ line-height: 14px;
683
+ text-align: center;
684
+ padding: 13px 16px;
685
+ background-color: #2160B5;
686
+ border-radius: 4px;
687
+ color: #ffffff;
688
+ text-decoration: none;
689
+ cursor: pointer;
690
+ margin-top: 20px;
691
+ }
692
+
693
+ .twb-optimize-now-tooltip {
694
+ position: absolute;
695
+ bottom: 70px;
696
+ width: 258px;
697
+ height: 68px;
698
+ padding: 16px;
699
+ box-sizing: border-box;
700
+ background-color: #323A45;
701
+ color: #ffffff;
702
+ font-size: 12px;
703
+ line-height: 18px;
704
+ border-radius: 6px;
705
+ letter-spacing: 0;
706
+ }
707
+
708
+ .twb-optimize_on ul li span {
709
+ width: 6px;
710
+ height: 6px;
711
+ background-color: #D6D8DA;
712
+ border-radius: 3px;
713
+ display: inline-block;
714
+ margin-right: 8px;
715
+ vertical-align: middle;
716
+ }
717
+
718
+ .twb-optimize_on p.twb-section-title {
719
+ background: url(../images/success.svg) no-repeat;
720
+ background-size: 20px;
721
+ background-position: 175px 3px;
722
+ }
723
+
724
+ .twb-optimize_on p {
725
+ font-size: 14px;
726
+ line-height: 20px;
727
+ }
728
+
729
+ .twb-optimize_on ul {
730
+ margin: 18px 0 0 0;
731
+ }
732
+ .twb-optimize_on li {
733
+ font-size: 12px;
734
+ margin-bottom: 10px;
735
+ font-weight: 600;
736
+ line-height: 18px;
737
+ }
738
+
739
+ .twb-optimize_on li:last-child {
740
+ margin-bottom: 0px;
741
+ }
742
+
743
+ .twb-optimize_on-button-cont {
744
+ flex-grow: 1;
745
+ vertical-align: bottom;
746
+ align-self: flex-end;
747
+ display: flex;
748
+ justify-content: right;
749
+ }
750
+
751
+ .twb-optimize-add-pages {
752
+ display: block;
753
+ width: 210px;
754
+ height: 40px;
755
+ box-sizing: border-box;
756
+ font-size: 14px;
757
+ line-height: 14px;
758
+ text-align: center;
759
+ padding: 13px 16px;
760
+ background-color: #2160B5;
761
+ border-radius: 4px;
762
+ color: #ffffff;
763
+ text-decoration: none;
764
+ cursor: pointer;
765
+ margin-top: 20px;
766
+ }
767
+
768
+ .twb-optimize_on.twb-optimize_done p.twb-section-title {
769
+ background: url(../images/success.svg) no-repeat;
770
+ background-size: 20px;
771
+ background-position: 113px 3px;
772
+ }
773
+
774
+ @media only screen and (max-width: 730px) {
775
+
776
+ .twb-speed-header {
777
+ width: 100%;
778
+ padding: 15px 15px 20px 15px;
779
+ }
780
+
781
+ .twb-page-header,
782
+
783
+ .twb-install-booster-container {
784
+ padding: 0;
785
+ }
786
+
787
+ .twb-connected-booster-container .twb-header-description,
788
+ .twb-sign_up-booster-container .twb-description{
789
+ display: inline;
790
+ }
791
+
792
+ .twb-header-description {
793
+ font-size: 14px;
794
+ line-height: 20px;
795
+ }
796
+ .twb-speed-body{
797
+ width: 100%;
798
+ }
799
+
800
+ .twb-install-booster-container .button-container {
801
+ position: relative;
802
+ display: block;
803
+ width: 235px;
804
+ right: auto;
805
+ bottom: auto;
806
+ margin-top: 20px;
807
+ }
808
+
809
+ ul.twb-install-booster-steps {
810
+ margin: 15px 0 0 0;
811
+ padding-left: 10px;
812
+ flex-direction: column;
813
+ }
814
+
815
+ ul.twb-install-booster-steps li {
816
+ height: 50px;
817
+ padding-left: 25px;
818
+ border-top: 0;
819
+ border-left: 8px solid #323A4510;
820
+ margin: 0 0 25px 0;
821
+ }
822
+
823
+ ul.twb-install-booster-steps li:after {
824
+ top: 64px;
825
+ left: -15px;
826
+ right: unset;
827
+ width: 23px;
828
+ height: 23px;
829
+ border-width: 2px;
830
+ }
831
+ ul.twb-install-booster-steps li:last-child:after {
832
+ width: 28px;
833
+ height: 28px;
834
+ top: 62px;
835
+ left: -18px;
836
+ border-width: 3px;
837
+ }
838
+
839
+ .twb-button-container-parent {
840
+ margin-top: 10px;
841
+ justify-content: start;
842
+ }
843
+ .twb-speed-body {
844
+ padding: 15px;
845
+ }
846
+ .twb-analyze-input-container {
847
+ display:block;
848
+ }
849
+
850
+ input.twb-analyze-input {
851
+ width: 100%;
852
+ margin-bottom: 30px;
853
+ }
854
+
855
+ .twb-analyze-info-container,
856
+ .twb-analyze-info-left-cont {
857
+ display: block;
858
+ height: auto;
859
+ }
860
+
861
+ .twb-analyze-info-right,
862
+ .twb-analyze-score-info {
863
+ width: 100%;
864
+ }
865
+
866
+ .twb-analyze-mobile-score, .twb-analyze-desktop-score {
867
+ width: 100%;
868
+ height: auto;
869
+ padding: 18px 0 16px 0;
870
+ box-sizing: border-box;
871
+ margin: 0 0 10px 0;
872
+ }
873
+
874
+ .speed_circle {
875
+ margin: 0 auto 14px auto;
876
+ }
877
+
878
+ .twb-analyze-score-info {
879
+ width: auto;
880
+ margin-top: 8px;
881
+ line-height: 36px;
882
+ font-size: 10px;
883
+ height: 36px;
884
+ }
885
+
886
+ .twb-analyze-score-info>span:first-child {
887
+ display: none;
888
+ }
889
+
890
+ .twb-averege-icon,
891
+ .twb-slow-icon {
892
+ margin: 0 4px 0 11px;
893
+ }
894
+
895
+ .twb-fast-icon {
896
+ margin: 0 4px 0 0px;
897
+ }
898
+
899
+ .twb-score-icon {
900
+ width: 6px;
901
+ height: 4px;
902
+ margin-bottom: 2px;
903
+ }
904
+
905
+ .twb-analyze-info-right p.twb-last-analyzed-date {
906
+ margin-bottom: 0;
907
+ }
908
+
909
+ .twb-analyze-img_optimizer-container {
910
+ padding: 15px;
911
+ }
912
+
913
+ .twb-analyze-info-right {
914
+ margin: 10px 0 0 0;
915
+ padding: 18px 15px 12px 15px;
916
+ box-sizing: border-box;
917
+ height: auto;
918
+ }
919
+
920
+ .twb-analyze-info-right p.twb-analyze-info-right-sub-title {
921
+ margin: 0;
922
+ }
923
+
924
+ .twb-analyze-img_optimizer-container {
925
+ display: block;
926
+ }
927
+
928
+ .twb-analyze-img_optimizer-container.twb-optimize_pending > div:first-child {
929
+ width: auto;
930
+ height: auto;
931
+ border-right: none;
932
+ border-bottom: 1px solid #E4E4E4;
933
+ padding-bottom: 20px;
934
+ }
935
+
936
+ .twb-analyze-img_optimizer-container.twb-optimize_pending .twb-img-count-container {
937
+ text-align: left;
938
+ padding-left: 0;
939
+ }
940
+
941
+ .twb-optimize_on-button-cont {
942
+ display: block;
943
+ }
944
+
945
+ input.twb-sign-up-input {
946
+ width: 100%;
947
+ margin-top: 20px;
948
+ }
949
+ .twb-speed-header .twb-sign-up-dashboard-button-container {
950
+ gap: 0;
951
+ flex-direction: column;
952
+ }
953
+
954
+ .twb-booster-container > div {
955
+ display: block;
956
+ }
957
+
958
+ a.twb-booster-button {
959
+ display: block;
960
+ width: 210px;
961
+ height: 40px;
962
+ margin-bottom: 10px;
963
+ }
964
+
965
+ .twb-booster-container > div > div {
966
+ padding: 0;
967
+ }
968
+
969
+ .twb-connected-booster-container {
970
+ display: block;
971
+ }
972
+
973
+ .twb-connected-booster-content,
974
+ .twb-connected-booster-container .button-container {
975
+ width: 100%;
976
+ display: block;
977
+ }
978
+
979
+ a.twb-manage-booster {
980
+ display: block;
981
+ width: 210px;
982
+ margin-top: 20px;
983
+ }
984
+
985
+ .twb-analyze-img_optimizer-container.twb-optimize_pending .twb-img-count-container h5 {
986
+ margin-top: 20px;
987
+ }
988
+
989
+ .twb-optimize-now-tooltip {
990
+ bottom: 205px;
991
+ width: 230px;
992
+ height: 85px;
993
+ }
994
+
995
+ .twb-analyze-input-container .twb-error-msg {
996
+ top: 42px;
997
+ line-height: 13px;
998
+ }
999
+
1000
+ .twb-last-analyzed-date-container {
1001
+ position: relative;
1002
+ bottom: unset;
1003
+ }
1004
+
1005
+ .twb-analyze-info-right p.twb-last-analyzed-page {
1006
+ max-height: inherit;
1007
+ overflow: hidden;
1008
+ }
1009
+ }
1010
+
1011
+ .speed-loader-blue {
1012
+ animation: rotation 1s infinite linear;
1013
+ background: url(../images/loader_small.svg) no-repeat;
1014
+ width: 18px;
1015
+ height: 18px;
1016
+ margin: auto;
1017
+ }
1018
+
1019
+ .speed-loader-grey {
1020
+ animation: rotation 1s infinite linear;
1021
+ background: url(../images/loader_small_grey.svg) no-repeat;
1022
+ width: 18px;
1023
+ height: 18px;
1024
+ margin: auto;
1025
+ display:inline-block;
1026
+ vertical-align: middle;
1027
+ }
1028
+
1029
+ @keyframes rotation {
1030
+ from {
1031
+ transform: rotate(0deg);
1032
+ }
1033
+ to {
1034
+ transform: rotate(359deg);
1035
+ }
1036
+ }
1037
+
1038
+ .speed_circle canvas {
1039
+ border-radius: 40px;
1040
+ }
1041
+
1042
+ .twb-img_optimizer-container {
1043
+ display: flex;
1044
+ margin-bottom: 30px;
1045
+ }
1046
+
1047
+ .twb-img_optimizer-container .twb-img_optimizer-left {
1048
+ display:flex;
1049
+ flex-direction: column;
1050
+ width: 250px;
1051
+ height: auto;
1052
+ min-height: auto;
1053
+ background-color: #F9F9F9;
1054
+ margin-right: 10px;
1055
+ box-sizing: border-box;
1056
+ padding: 20px 20px 20px 19px;
1057
+ }
1058
+ .twb-img_optimizer-container .twb-img_optimizer-right {
1059
+ display: flex;
1060
+ flex-direction: column;
1061
+ width: 414px;
1062
+ height: auto;
1063
+ background-color: #F9F9F9;
1064
+ box-sizing: border-box;
1065
+ padding: 20px;
1066
+ }
1067
+
1068
+ .twb-img_optimizer-container.twb-img_optimizer-not-container .twb-img_optimizer-right {
1069
+ width: 250px;
1070
+ }
1071
+
1072
+ .twb-img_optimizer-container.twb-img_optimizer-not-container .twb-img_optimizer-left {
1073
+ width: 414px;
1074
+ }
1075
+
1076
+ .twb-img_optimizer-container .twb-section-description {
1077
+ margin: 0;
1078
+ padding: 0;
1079
+ line-height: 18px;
1080
+ font-size: 12px;
1081
+
1082
+ }
1083
+
1084
+ .twb-img_optimizer-container.twb-img_optimizer-not-container .twb-section-description {
1085
+ border-bottom: 1px solid #E4E4E4;
1086
+ margin: 0 0 18px 0;
1087
+ padding: 0 0 18px 0;
1088
+
1089
+ }
1090
+
1091
+ .twb-section-bottom {
1092
+ height: auto;
1093
+ display: flex;
1094
+ flex-direction: column;
1095
+ justify-content: end;
1096
+ flex-grow: 1;
1097
+ }
1098
+
1099
+ .twb-most-image-cont {
1100
+ display: flex;
1101
+ font-size: 12px;
1102
+ line-height: 18px;
1103
+ color:#323A45;
1104
+ font-weight: 700;
1105
+ margin-top: 10px;
1106
+ }
1107
+
1108
+ .twb-most-image-cont-path {
1109
+ flex-grow: 1;
1110
+ text-decoration: underline;
1111
+ padding-right: 10px;
1112
+ box-sizing: border-box;
1113
+ word-break: break-all;
1114
+ }
1115
+
1116
+ .twb-hompage-path {
1117
+ text-decoration: none;
1118
+ }
1119
+
1120
+ .twb-most-image-cont-img-count.twb-not-optimized {
1121
+ padding-right: 20px;
1122
+ background: url(../images/close_red.svg) no-repeat #F9F9F9;
1123
+ background-position: right center;
1124
+ background-size: 20px;
1125
+ }
1126
+
1127
+ .twb-most-image-cont-img-count.twb-optimized {
1128
+ padding-right: 20px;
1129
+ background: url(../images/success.svg) no-repeat #F9F9F9;
1130
+ background-position: right top;
1131
+ background-size: 20px;
1132
+ white-space: nowrap;
1133
+ flex-grow: 1;
1134
+ text-align: right;
1135
+ }
1136
+
1137
+ .twb-optimized-info,
1138
+ .twb-not-optimized-info {
1139
+ display: block;
1140
+ width: 125px;
1141
+ height: 28px;
1142
+ box-sizing: border-box;
1143
+ padding: 5px 6px 5px 30px;
1144
+ border-radius: 6px;
1145
+ font-size: 12px;
1146
+ line-height: 18px;
1147
+ font-weight: 600;
1148
+ }
1149
+
1150
+ .twb-optimized-info {
1151
+ width: 145px;
1152
+ background: url(../images/success.svg) no-repeat #22B3390D;
1153
+ background-position: 6px center;
1154
+ background-size: 20px;
1155
+ border: 1px solid #22B33919;
1156
+ }
1157
+
1158
+ .twb-not-optimized-info {
1159
+ background: url(../images/close_red.svg) no-repeat #FD3C310D;
1160
+ background-position: 6px center;
1161
+ background-size: 20px;
1162
+ border: 1px solid #FD3C311A;
1163
+ }
1164
+
1165
+ .twb-img_optimizer-right h5,
1166
+ .twb-img_optimizer-left h5 {
1167
+ font-size: 36px;
1168
+ line-height: 50px;
1169
+ font-weight: 800;
1170
+ margin: 10px 0 15px 0;
1171
+ height: 50px;
1172
+ }
1173
+
1174
+ .twb-img_optimizer-not-container .twb-img_optimizer-left h5 {
1175
+ font-size: 36px;
1176
+ line-height: 50px;
1177
+ height: 50px;
1178
+ }
1179
+
1180
+ .twb-img_optimizer-right h5 span,
1181
+ .twb-img_optimizer-left h5 span{
1182
+ font-size: 14px;
1183
+ line-height: 65px;
1184
+ font-weight: 700;
1185
+ padding-left: 7px;
1186
+ }
1187
+
1188
+ .twb-img_optimizer-container ul {
1189
+ margin: 0;
1190
+ list-style: none;
1191
+ }
1192
+
1193
+ .twb-img_optimizer-container li {
1194
+ background: url(../images/disc.svg) no-repeat;
1195
+ background-position: 0px center;
1196
+ background-size: 15px;
1197
+ padding-left: 22px;
1198
+ font-size: 12px;
1199
+ line-height: 18px;
1200
+ margin-bottom: 6px;
1201
+ font-weight: 600;
1202
+ }
1203
+
1204
+ .twb-img_optimizer-button-container {
1205
+ display: flex;
1206
+ align-items: flex-end;
1207
+ }
1208
+ .twb-img_optimizer-not-container .twb-img_optimizer-button-container {
1209
+ display: block;
1210
+ }
1211
+
1212
+ .twb-img_optimizer-info {
1213
+ flex-grow: 1;
1214
+ }
1215
+
1216
+ .twb-img_optimizer-info p {
1217
+ font-size: 12px;
1218
+ line-height: 18px;
1219
+ padding: 0;
1220
+ margin: 0;
1221
+ }
1222
+
1223
+ .twb-img_optimizer-info p:first-child {
1224
+ font-weight: 700;
1225
+ }
1226
+
1227
+ .twb-img_optimize-now-button,
1228
+ .twb-img_add_pages_button {
1229
+ display: block;
1230
+ width: 210px;
1231
+ text-align: center;
1232
+ height: 40px;
1233
+ background-color: #2160B5;
1234
+ color:#ffffff;
1235
+ font-size: 14px;
1236
+ line-height: 40px;
1237
+ padding: 0px 59px;
1238
+ opacity: 0.5;
1239
+ border-radius: 4px;
1240
+ box-sizing: border-box;
1241
+ text-decoration: none;
1242
+ margin-top: 20px;
1243
+ }
1244
+
1245
+ .twb-img_add_pages_button {
1246
+ opacity: 1;
1247
+ }
1248
+
1249
+ .twb-img_optimize-now-button:hover,
1250
+ .twb-img_add_pages_button:hover,
1251
+ .twb-img_add_pages_button:active {
1252
+ color:#ffffff;
1253
+ }
1254
+
1255
+ .twb-line_container {
1256
+ width: 100%;
1257
+ height: 6px;
1258
+ background-color: #E6E7E8;
1259
+ border-radius: 30px;
1260
+ margin-bottom: 10px;
1261
+ }
1262
+
1263
+ p.twb-total_size {
1264
+ font-size: 14px;
1265
+ line-height: 20px;
1266
+ color: #323A45;
1267
+ letter-spacing: 0.12px;
1268
+ font-weight: 600;
1269
+ }
1270
+
1271
+ .twb-line_container span {
1272
+ display: block;
1273
+ height: 6px;
1274
+ border-radius: 30px;
1275
+ background-color: #22B339;
1276
+ }
1277
+
1278
+ .twb-line_container span.twb-size_0 {
1279
+ width: 0;
1280
+ }
1281
+ .twb-line_container span.twb-size_1 {
1282
+ width: 16.7%;
1283
+ }
1284
+ .twb-line_container span.twb-size_2 {
1285
+ width: 33.4%;
1286
+ }
1287
+ .twb-line_container span.twb-size_3 {
1288
+ width: 50.1%;
1289
+ }
1290
+ .twb-line_container span.twb-size_4 {
1291
+ width: 66.8%;
1292
+ }
1293
+ .twb-line_container span.twb-size_5 {
1294
+ width: 83.5%;
1295
+ }
1296
+
1297
+ .twb-line_container span.twb-size_6 {
1298
+ width: 100%;
1299
+ }
1300
+
1301
+ .twb-line_info_container {
1302
+ display: flex;
1303
+ margin-top: 30px;
1304
+ margin-bottom: 9px;
1305
+ font-size: 12px;
1306
+ line-height: 18px;
1307
+ font-weight: 600;
1308
+ }
1309
+
1310
+ .twb-line_info_container span:nth-child(1) {
1311
+ flex-grow: 1;
1312
+ }
1313
+
1314
+ .twb-img_optimizer-right > p {
1315
+ margin: 101px 0 0 0;
1316
+ display: flex;
1317
+ align-items: flex-end;
1318
+ flex-grow: 1;
1319
+ }
1320
+
1321
+ @media screen and (max-width: 690px) {
1322
+ .twb-img_optimizer-container {
1323
+ display: block;
1324
+ }
1325
+
1326
+ .twb-img_optimizer-container .twb-img_optimizer-left,
1327
+ .twb-img_optimizer-container .twb-img_optimizer-right,
1328
+ .twb-img_optimizer-container.twb-img_optimizer-not-container .twb-img_optimizer-left,
1329
+ .twb-img_optimizer-container.twb-img_optimizer-not-container .twb-img_optimizer-right {
1330
+ width: 100%;
1331
+ padding: 15px;
1332
+ }
1333
+
1334
+ .twb-img_optimizer-container .twb-img_optimizer-left {
1335
+ margin-bottom: 15px;
1336
+ }
1337
+
1338
+ .twb-img_optimizer-button-container {
1339
+ display: block;
1340
+ }
1341
+
1342
+ .twb-img_add_pages_button,
1343
+ .twb-img_optimize-now-button {
1344
+ width: 210px;
1345
+ height: 40px;
1346
+ display: block;
1347
+ text-align: center;
1348
+ margin-top: 20px;
1349
+ }
1350
+
1351
+ .twb-img_optimizer-right > p {
1352
+ margin: 30px 0 15px 0;
1353
+ }
1354
+
1355
+ .twb-img_optimizer-button-container {
1356
+ height: auto;
1357
+ margin-top: 20px;
1358
+ }
1359
+
1360
+ .twb-img_optimizer-container.twb-img_optimizer-not-container .twb-img_optimizer-button-container {
1361
+ margin-top: 0px;
1362
+ }
1363
+
1364
+
1365
+ .twb-line_container {
1366
+ margin-bottom: 10px;
1367
+ }
1368
+
1369
+ .twb-section-bottom {
1370
+ margin-top: 10px;
1371
+ }
1372
+ }
1373
+
1374
+
1375
+
1376
+ .twb-popup input.twb-sign-up-input {
1377
+ width: 100%;
1378
+ }
1379
+
1380
+ .twb-popup {
1381
+ width: 500px;
1382
+ height: 298px;
1383
+ background-color: #FFFFFF;
1384
+ font-family: Open Sans;
1385
+ top: 50%;
1386
+ position: fixed;
1387
+ left: 50%;
1388
+ text-align: center;
1389
+ z-index: 100000;
1390
+ border-radius: 10px;
1391
+ margin-left: -250px;
1392
+ margin-top: -149px;
1393
+ padding: 35px 30px;
1394
+ box-sizing: border-box;
1395
+ color: #323A45;
1396
+ }
1397
+
1398
+ .twb-popup a {
1399
+ color: #323A45;
1400
+ }
1401
+
1402
+ .twb-popup-dismiss {
1403
+ width: 16px;
1404
+ height: 16px;
1405
+ position: absolute;
1406
+ top: 50%;
1407
+ right: 50%;
1408
+ background: transparent url('../images/close.svg') 0% 0% no-repeat padding-box;
1409
+ margin-top: -134px;
1410
+ margin-right: -235px;
1411
+ z-index: 1000000;
1412
+ cursor: pointer;
1413
+ }
1414
+
1415
+ .twb-popup-overlay {
1416
+ background-color: rgba(0, 0, 0, 0.75);
1417
+ position: fixed;
1418
+ top: 0;
1419
+ left: 0;
1420
+ width: 100%;
1421
+ height: 100%;
1422
+ z-index: 100000;
1423
+ }
1424
+
1425
+ .twb-popup-title {
1426
+ font-weight: 800;
1427
+ font-size: 24px;
1428
+ line-height: 34px;
1429
+ letter-spacing: 0.2px;
1430
+ }
1431
+
1432
+ .twb-popup-description {
1433
+ font-weight: 400;
1434
+ font-size: 16px;
1435
+ line-height: 22px;
1436
+ letter-spacing: 0;
1437
+ margin-top: 15px;
1438
+ }
1439
+
1440
+ .twb-popup-button {
1441
+ margin-top: 15px;
1442
+ }
1443
+
1444
+ .twb-popup-button > a,
1445
+ .twb-popup-button > span {
1446
+ display: inline-block;
1447
+ width: 210px;
1448
+ height: 40px;
1449
+ box-sizing: border-box;
1450
+ font-size: 14px;
1451
+ font-weight: 400;
1452
+ line-height: 14px;
1453
+ text-align: center;
1454
+ padding: 13px 16px;
1455
+ border-radius: 4px;
1456
+ text-decoration: none;
1457
+ cursor: pointer;
1458
+ margin-top: 15px;
1459
+ }
1460
+
1461
+ .twb-popup-button .twb-html {
1462
+ font-size: 12px;
1463
+ padding: 0;
1464
+ line-height: 18px;
1465
+ }
1466
+
1467
+ .twb-popup-button a.twb-primary {
1468
+ background-color: #2160B5;
1469
+ color: #ffffff;
1470
+ border: 1px solid #2160B5;
1471
+ }
1472
+
1473
+ .twb-popup-button a.twb-secondary {
1474
+ background-color: #FFFFFF;
1475
+ color: #323A45;
1476
+ border: 1px solid #DEDEDE;
1477
+ }
1478
+
1479
+ @media screen and (max-width: 500px) {
1480
+ .twb-popup {
1481
+ width: 100%;
1482
+ left: 0;
1483
+ margin-left: 0;
1484
+ margin-top: -175px;
1485
+ border-radius: 0;
1486
+ }
1487
+ .twb-popup-dismiss {
1488
+ top: 15px;
1489
+ right: 15px;
1490
+ margin-top: 0;
1491
+ margin-right: 0;
1492
+ }
1493
+ .twb-popup-overlay {
1494
+ background-color: rgba(255, 255, 255, 1);
1495
+ }
1496
+ .twb-popup-content,
1497
+ .twb-popup-button {
1498
+ width: 280px;
1499
+ margin: 0 auto;
1500
+ }
1501
+ .twb-popup-button {
1502
+ margin-top: 15px;
1503
+ }
1504
+ .twb-popup-button > a,
1505
+ .twb-popup-button > span {
1506
+ float: none;
1507
+ margin: 15px auto 0 auto;
1508
+ }
1509
+ }
1510
+ #adminmenu li.toplevel_page_galleries_bwg a.wp-has-current-submenu img {
1511
+ filter: brightness(0) invert(1);
1512
+ }
booster/assets/css/top_banner.css ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .twb-booster-top-banner {
2
+ border-top: 1px solid #e5e5e5;
3
+ background-color: #f6f7f7;
4
+ }
5
+ .twb-booster-top-banner * {
6
+ margin: 0px;
7
+ padding: 0px;
8
+ line-height: 18px;
9
+ font-family: 'Open Sans';
10
+ font-weight: 400;
11
+ font-size: 12px;
12
+ }
13
+ .twb-booster-top-banner-wrapper-note {
14
+ padding: 9px 16px;
15
+ background-color: #ffffff;
16
+ }
17
+ .twb-booster-top-banner-wrapper-note--text {
18
+ position: relative;
19
+ display: inline-block;
20
+ padding-left: 22px;
21
+ text-align: left;
22
+ letter-spacing: 0.1px;
23
+ font-weight: 600;
24
+ color: #323A45;
25
+ }
26
+ .twb-booster-top-banner-wrapper-note--text:before {
27
+ content: '';
28
+ position: absolute;
29
+ top: 50%;
30
+ left: 0px;
31
+ transform: translateY(-50%);
32
+ width: 14px;
33
+ height: 14px;
34
+ background: transparent url('../images/information.svg') 0% 0% no-repeat padding-box;
35
+ }
36
+ .twb-booster-top-banner-wrapper {
37
+ display: -webkit-box;
38
+ display: -ms-flexbox;
39
+ display: flex;
40
+ -webkit-box-pack: justify;
41
+ -ms-flex-pack: justify;
42
+ justify-content: space-between;
43
+ -webkit-box-align: center;
44
+ -ms-flex-align: center;
45
+ align-items: center;
46
+ padding: 18px 20px;
47
+ border-top: 1px solid #E5E5E5;
48
+ }
49
+ .twb-booster-top-banner-wrapper .twb-booster-top-banner-wrappe--images-count {
50
+ font-weight: 800;
51
+ }
52
+ .twb-booster-top-banner-wrapper .twb-booster-top-banner-wrappe--button {
53
+ display: block;
54
+ width: 210px;
55
+ background: #2160B5 0% 0% no-repeat padding-box;
56
+ border-radius: 4px;
57
+ padding: 8px 0px;
58
+ font-size: 14px;
59
+ line-height: 18px;
60
+ font-family: 'Segoe UI';
61
+ font-weight: 400;
62
+ letter-spacing: 0;
63
+ color: #FFFFFF;
64
+ text-decoration: none;
65
+ cursor: pointer;
66
+ text-align: center;
67
+ }
68
+
69
+ @media screen and (max-width: 640px) {
70
+ .twb-booster-top-banner-wrapper {
71
+ display: block;
72
+ padding: 10px 20px;
73
+ }
74
+ .twb-booster-top-banner-wrapper .twb-booster-top-banner-wrappe--images-count {
75
+ padding-bottom: 2px;
76
+ }
77
+ .twb-booster-top-banner-wrapper .twb-booster-top-banner-wrappe--button {
78
+ margin: 10px auto 0;
79
+ }
80
+ }
booster/assets/images/button_plus.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="7.758" height="7.758" viewBox="0 0 7.758 7.758"><defs><style>.a{fill:#fff;}</style></defs><path class="a" d="M8.651,3.929H5.784a.169.169,0,0,1-.169-.169V.893H3.929V3.76a.169.169,0,0,1-.169.169H.893V5.615H3.76a.169.169,0,0,1,.169.169V8.651H5.615V5.784a.169.169,0,0,1,.169-.169H8.651Zm0,0" transform="translate(-0.893 -0.893)"/></svg>
booster/assets/images/check_green.jpg ADDED
Binary file
booster/assets/images/check_green_bg.svg ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Checkmark_Icon_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="22" height="22" viewBox="0 0 22 22">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_48150" data-name="Rectangle 48150" width="22" height="22" fill="#fff"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Mask_Group_1304" data-name="Mask Group 1304" clip-path="url(#clip-path)">
8
+ <g id="Group_94669" data-name="Group 94669" transform="translate(3.667 3.667)">
9
+ <path id="Success_Done_Checkmark_Icon" d="M26.167,18.833A7.333,7.333,0,1,1,18.833,11.5,7.342,7.342,0,0,1,26.167,18.833Z" transform="translate(-11.5 -11.5)" fill="#23b536"/>
10
+ <path id="Success_Done_Checkmark_Icon-2" data-name="Success_Done_Checkmark_Icon" d="M22.176,15.662a.677.677,0,0,0-1.031,0L17.657,19.15a.59.59,0,0,1-.357.159.43.43,0,0,1-.357-.159l-1.586-1.586a.609.609,0,0,0-.515-.2.754.754,0,0,0-.515.2.742.742,0,0,0,0,1.031l2.458,2.458a.835.835,0,0,0,.515.2.754.754,0,0,0,.515-.2l4.36-4.36A.677.677,0,0,0,22.176,15.662Z" transform="translate(-10.918 -10.628)" fill="#fafafa"/>
11
+ </g>
12
+ </g>
13
+ </svg>
booster/assets/images/check_grey.jpg ADDED
Binary file
booster/assets/images/check_score.svg ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Component_289_2" data-name="Component 289 – 2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47762" data-name="Rectangle 47762" width="18" height="18" transform="translate(757 1233)" fill="#3a6fab"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Mask_Group_95145" data-name="Mask Group 95145" transform="translate(-757 -1233)" clip-path="url(#clip-path)">
8
+ <g id="noun-speed-1914448" transform="translate(758.725 1235.801)">
9
+ <g id="Group_96026" data-name="Group 96026" transform="translate(0.499 0.499)">
10
+ <path id="Path_170607" data-name="Path 170607" d="M2355.586,13110.588a6.923,6.923,0,0,1-.768-3.149,6.776,6.776,0,0,1,13.553,0,6.681,6.681,0,0,1-.773,3.156.916.916,0,0,1-.807.482.953.953,0,0,1-.418-.1l-.012-.007a.924.924,0,0,1-.381-1.224l0-.007a5.038,5.038,0,0,0,.565-2.3,4.955,4.955,0,0,0-9.91,0,5.1,5.1,0,0,0,.567,2.3l0,0a.916.916,0,0,1-.373,1.221.823.823,0,0,1-.438.114A.906.906,0,0,1,2355.586,13110.588Z" transform="translate(-2354.818 -13100.663)" fill="#3a6fab"/>
11
+ <path id="Path_170606" data-name="Path 170606" d="M297.746,209.582l-3.132,1.943a1.319,1.319,0,0,0-.614,1.112,1.29,1.29,0,0,0,2.4.639l1.879-3.17a.384.384,0,0,0-.537-.524Z" transform="translate(-289.032 -205.462)" fill="#3a6fab"/>
12
+ </g>
13
+ </g>
14
+ </g>
15
+ </svg>
booster/assets/images/check_white.png ADDED
Binary file
booster/assets/images/close.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Close_Icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <path id="Path_169840" data-name="Path 169840" d="M0,0H16V16H0Z" fill="none"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Mask_Group_1282" data-name="Mask Group 1282" clip-path="url(#clip-path)">
8
+ <path id="Path_169841" data-name="Path 169841" d="M771.045,5105.572l-2.6-2.6-2.6,2.6a1.078,1.078,0,0,1-1.841-.76,1.079,1.079,0,0,1,.312-.76l0,0,2.6-2.6-2.6-2.6a1.086,1.086,0,0,1,0-1.526l.007-.006a1.078,1.078,0,0,1,1.517,0l0,0,2.6,2.6,2.608-2.609a1.083,1.083,0,0,1,1.517,0l.007.006a1.088,1.088,0,0,1,0,1.525l-2.605,2.6,2.607,2.607a1.076,1.076,0,0,1,.312.76,1.079,1.079,0,0,1-1.844.759Z" transform="translate(-760.445 -5093.445)" fill="rgba(50,58,69,0.2)"/>
9
+ </g>
10
+ </svg>
booster/assets/images/close_dark.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Close_Error_Icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="22" height="22" viewBox="0 0 22 22">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47801" data-name="Rectangle 47801" width="22" height="22" fill="#323a45"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Close_Error_Icon-2" data-name="Close_Error_Icon" clip-path="url(#clip-path)">
8
+ <path id="Subtraction_23" data-name="Subtraction 23" d="M7.333,14.667a7.334,7.334,0,1,1,7.334-7.334A7.342,7.342,0,0,1,7.333,14.667ZM4.9,3.881a.8.8,0,0,0-.607.331A.857.857,0,0,0,4.43,5.341L6.213,7.124,4.225,9.113a.921.921,0,0,0-.25.635.924.924,0,0,0,.246.521l.047.047.035.035a.723.723,0,0,0,.458.154.922.922,0,0,0,.645-.267L7.338,8.305l1.919,1.919a.808.808,0,0,0,.6.218h.01a.846.846,0,0,0,.607-.332.888.888,0,0,0-.134-1.128L8.5,7.144l1.768-1.768a.924.924,0,0,0,.249-.634.914.914,0,0,0-.246-.521l-.053-.054-.029-.028a.712.712,0,0,0-.458-.154.915.915,0,0,0-.643.269L7.374,5.964,5.536,4.125a.91.91,0,0,0-.626-.244Z" transform="translate(3.666 3.665)" fill="#323a45"/>
9
+ </g>
10
+ </svg>
booster/assets/images/close_error.svg ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="22" height="22" viewBox="0 0 22 22">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47801" data-name="Rectangle 47801" width="22" height="22" fill="#323a45"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Close_Error_Icon" opacity="0.5">
8
+ <g id="Close_Error_Icon-2" data-name="Close_Error_Icon" clip-path="url(#clip-path)">
9
+ <path id="Subtraction_23" data-name="Subtraction 23" d="M7.333,14.667a7.334,7.334,0,1,1,7.334-7.334A7.342,7.342,0,0,1,7.333,14.667ZM4.9,3.881a.8.8,0,0,0-.607.331A.857.857,0,0,0,4.43,5.341L6.213,7.124,4.225,9.113a.921.921,0,0,0-.25.635.924.924,0,0,0,.246.521l.047.047.035.035a.723.723,0,0,0,.458.154.922.922,0,0,0,.645-.267L7.338,8.305l1.919,1.919a.808.808,0,0,0,.6.218h.01a.846.846,0,0,0,.607-.332.888.888,0,0,0-.134-1.128L8.5,7.144l1.768-1.768a.924.924,0,0,0,.249-.634.914.914,0,0,0-.246-.521l-.053-.054-.029-.028a.712.712,0,0,0-.458-.154.915.915,0,0,0-.643.269L7.374,5.964,5.536,4.125a.91.91,0,0,0-.626-.244Z" transform="translate(3.666 3.665)" fill="#323a45"/>
10
+ </g>
11
+ </g>
12
+ </svg>
booster/assets/images/close_red.svg ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Close_Error_Icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47801" data-name="Rectangle 47801" width="20" height="20" fill="#fd3c31"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Close_Error_Icon-2" data-name="Close_Error_Icon" clip-path="url(#clip-path)">
8
+ <path id="Subtraction_23" data-name="Subtraction 23" d="M13.334,6.667A6.667,6.667,0,1,1,6.667,0,6.675,6.675,0,0,1,13.334,6.667Z" transform="translate(3.333 3.332)" fill="#fd3c31"/>
9
+ <path id="design_system_icons-40" data-name="design system icons-40" d="M7.769,3.658a.807.807,0,0,0-.811-.639H4.594V.746A.841.841,0,0,0,4.347.178.839.839,0,0,0,3.854,0H3.748a.771.771,0,0,0-.635.781v2.2H.75a.83.83,0,0,0-.564.249.732.732,0,0,0-.176.6.78.78,0,0,0,.811.639H3.113V7.032A.841.841,0,0,0,3.36,7.6a.839.839,0,0,0,.494.178h.106A.771.771,0,0,0,4.594,7V4.51H7.063a.748.748,0,0,0,.529-.249A.769.769,0,0,0,7.769,3.658Z" transform="translate(9.945 4.443) rotate(45)" fill="#fff"/>
10
+ </g>
11
+ </svg>
booster/assets/images/closed_eye.svg ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Opened_Eye_Icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47767" data-name="Rectangle 47767" width="18" height="18" transform="translate(0)" fill="#323a45"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Opened_Eye_Icon-2" data-name="Opened_Eye_Icon" transform="translate(0)" clip-path="url(#clip-path)">
8
+ <g id="design_system_icons-52" data-name="design system icons-52" transform="translate(2 3.5)">
9
+ <path id="Path_169339" data-name="Path 169339" d="M13.064,26.833a2.93,2.93,0,0,1-2.921-2.921,3.184,3.184,0,0,1,.088-.76L8.478,21.4c-.088.088-.2.146-.292.234s-.175.146-.263.234c-.117.088-.2.2-.321.292-.088.088-.2.175-.292.263-.2.2-.409.409-.613.643-.088.088-.175.2-.263.292-.088.117-.2.234-.292.351a.307.307,0,0,0,0,.38c2.22,2.658,4.5,4.031,6.865,4.031h.467c.117,0,.263-.029.38-.029.058,0,.146-.029.2-.029a.422.422,0,0,0,.2-.058.422.422,0,0,0,.2-.058c.146-.029.292-.088.438-.117l-1.11-1.11A1.918,1.918,0,0,1,13.064,26.833Z" transform="translate(-6.075 -18.42)" fill="#323a45"/>
10
+ <path id="Path_169340" data-name="Path 169340" d="M23.615,16.487c-2.775-3.155-5.463-4.411-8.092-3.914a.422.422,0,0,0-.2.058.688.688,0,0,0-.234.058l-.263.088c-.058.029-.117.029-.146.058a1.424,1.424,0,0,0-.2.088c-.058.029-.117.029-.146.058-.117.058-.234.088-.38.146l-1.84-1.84a.282.282,0,0,0-.409,0l-.409.409a.282.282,0,0,0,0,.409l1.607,1.607,1.4,1.4.292.292.643.643a1.733,1.733,0,0,0-.146.672,1.633,1.633,0,0,0,1.636,1.636,1.733,1.733,0,0,0,.672-.146l.643.643.292.292,1.139,1.139,1.87,1.87a.282.282,0,0,0,.409,0l.409-.409a.282.282,0,0,0,0-.409L20.49,19.672a5.7,5.7,0,0,0,.73-.526c.38-.292.789-.643,1.2-1.022l.292-.292.234-.234c.234-.234.438-.467.672-.73A.249.249,0,0,0,23.615,16.487Zm-4.762,1.519-.643-.643c.029-.058.029-.088.058-.146s.029-.117.058-.175c0-.029.029-.088.029-.117,0-.088.029-.146.029-.234v-.2a.176.176,0,0,0-.029-.117v-.029c0-.058-.029-.088-.029-.146h0a.029.029,0,0,0-.029-.029c0-.058-.029-.088-.058-.146v-.029c-.029-.058-.058-.088-.088-.146v-.029c-.029-.029-.058-.088-.088-.117,0-.029-.029-.058-.058-.088a1.763,1.763,0,0,0-.234-.234c-.029-.029-.058-.029-.088-.058a.4.4,0,0,0-.117-.088h-.029c-.058-.029-.088-.058-.146-.058l-.029-.029c-.029-.029-.088-.029-.146-.058a.029.029,0,0,1-.029-.029h0c-.058,0-.088-.029-.146-.029h-.029A.176.176,0,0,1,16.9,15h-.2a.643.643,0,0,0-.234.029c-.058,0-.088,0-.117.029a1.046,1.046,0,0,0-.321.117l-.643-.643a2.554,2.554,0,0,1,1.315-.38,2.562,2.562,0,0,1,2.162,3.856Z" transform="translate(-9.703 -11.2)" fill="#323a45"/>
11
+ </g>
12
+ </g>
13
+ </svg>
booster/assets/images/desktop.svg ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_49884" data-name="Rectangle 49884" width="18" height="18" transform="translate(2005 389)" fill="#fff"/>
5
+ </clipPath>
6
+ <linearGradient id="linear-gradient" y1="0.5" x2="1.131" y2="0.5" gradientUnits="objectBoundingBox">
7
+ <stop offset="0" stop-color="#fff"/>
8
+ <stop offset="1" stop-color="#fff" stop-opacity="0"/>
9
+ </linearGradient>
10
+ </defs>
11
+ <g id="Mask_Group_95205" data-name="Mask Group 95205" transform="translate(-2005 -389)" opacity="0.8" clip-path="url(#clip-path)">
12
+ <path id="design_system_icons-34" data-name="design system icons-34" d="M9.419.77V13.48a.773.773,0,0,1-.77.77H.77A.773.773,0,0,1,0,13.48V.77A.773.773,0,0,1,.77,0H8.688A.766.766,0,0,1,9.419.77Z" transform="translate(2021.122 392.482) rotate(90)" fill="url(#linear-gradient)"/>
13
+ <path id="Union_721" data-name="Union 721" d="M.4,11.219a.4.4,0,0,1-.4-.4v-1a.4.4,0,0,1,.4-.4H2.6a.773.773,0,0,1-.734-.769V.77A.773.773,0,0,1,2.641,0H15.352a.773.773,0,0,1,.77.77V8.688a.765.765,0,0,1-.734.731H17.6a.4.4,0,0,1,.4.4v1a.4.4,0,0,1-.4.4ZM14.2,8.3V1.117H3.836V8.3ZM3.836,8.3H3.8Z" transform="translate(2005 392.481)" fill="#343b46"/>
14
+ </g>
15
+ </svg>
booster/assets/images/disc.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_50819" data-name="Rectangle 50819" width="18" height="18" transform="translate(96 294)" fill="#fff"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Mask_Group_95307" data-name="Mask Group 95307" transform="translate(-96 -294)" clip-path="url(#clip-path)">
8
+ <circle id="Ellipse_12738" data-name="Ellipse 12738" cx="3" cy="3" r="3" transform="translate(102 300)" fill="#323a45" opacity="0.201"/>
9
+ </g>
10
+ </svg>
booster/assets/images/down_arrow_nav.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47807" data-name="Rectangle 47807" width="18" height="18" fill="#323a45"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Navigation_Icon" clip-path="url(#clip-path)">
8
+ <path id="Path_169381" data-name="Path 169381" d="M3.778,5.637.4,2.215A1.309,1.309,0,0,1,.275.472a1.28,1.28,0,0,1,1.879-.1L4.415,2.667a.383.383,0,0,0,.51,0L7.155.407A1.267,1.267,0,0,1,8.875.278a1.321,1.321,0,0,1,.1,1.9L5.562,5.637A1.277,1.277,0,0,1,3.778,5.637Z" transform="translate(4.335 6.035)" fill="rgba(255,255,255,0.8)"/>
9
+ </g>
10
+ </svg>
booster/assets/images/fm.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
2
+ <g id="Group_104206" data-name="Group 104206" transform="translate(-529 -174)">
3
+ <rect id="Rectangle_52354" data-name="Rectangle 52354" width="15" height="15" transform="translate(529 174)" fill="none"/>
4
+ <path id="Path_171434" data-name="Path 171434" d="M14.551,0H.439A.442.442,0,0,0,0,.438V10.523a.442.442,0,0,0,.439.438H14.561A.442.442,0,0,0,15,10.523V.438A.458.458,0,0,0,14.551,0ZM4.967,1.8H9.255v.657H4.967Zm0,1.215H9.255v.657H4.967Zm0,1.1H9.255V4.77H4.967ZM1.237,1.8H4.529V4.76H1.237ZM13.743,9.588H1.237V7.278H13.743Zm0-3.066H1.237V5.536H13.743Zm0-1.762H9.574V4.1h4.169Zm0-1.1H9.574V3.017h4.169Zm0-1.195H9.574V1.832h4.169Z" transform="translate(529 176.019)" fill="#2e3336"/>
5
+ </g>
6
+ </svg>
booster/assets/images/google_spinner.svg ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36">
2
+ <g id="_1" data-name="1" transform="translate(-0.135 -0.05)">
3
+ <ellipse id="Ellipse_1" cx="15.987" cy="16.022" rx="15.987" ry="16.022" transform="translate(2.098 2.003)" fill="#fff"/>
4
+ <path id="Path_140668" data-name="Path 140668" d="M30.088,30.643a2.1,2.1,0,0,1-1.3-.5,2.035,2.035,0,0,1-.2-2.8,14.347,14.347,0,0,0,2.7-13.92A13.853,13.853,0,0,0,17.1,4.006,1.872,1.872,0,0,1,15,2.2,1.819,1.819,0,0,1,16.757.129,18,18,0,0,1,35.183,12.217a18.364,18.364,0,0,1-3.5,17.825C28.366,33,30.687,30.643,30.088,30.643Z" transform="translate(-0.012 0)" fill="#ff4e42"/>
5
+ <path id="Path_140669" data-name="Path 140669" d="M18.289,36.013A18.138,18.138,0,0,1,5.4,30.605a1.98,1.98,0,0,1,2.8-2.8,13.979,13.979,0,0,0,14.388,3.5,15.131,15.131,0,0,0,6.131-4.124,2.024,2.024,0,0,1,2.8-.2,2.082,2.082,0,0,1,.328,2.828,19.563,19.563,0,0,1-7.958,5.3A17.246,17.246,0,0,1,18.289,36.013Z" transform="translate(-0.004 0.037)" fill="#f8a738"/>
6
+ <path id="Path_140670" data-name="Path 140670" d="M6.1,30.643a1.8,1.8,0,0,1-1.5-.7A18.132,18.132,0,0,1,1.1,12.217,17.726,17.726,0,0,1,19.284.1a1.927,1.927,0,0,1,1.8,2.1,1.925,1.925,0,0,1-2.1,1.8A13.849,13.849,0,0,0,4.9,13.419a14.347,14.347,0,0,0,2.7,13.92,2.035,2.035,0,0,1-.2,2.8A1.652,1.652,0,0,1,6.1,30.643Z" transform="translate(0 0)" fill="#24cc6f"/>
7
+ </g>
8
+ </svg>
booster/assets/images/green-info.svg ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_48150" data-name="Rectangle 48150" width="20" height="20" fill="#323a45"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Group_103117" data-name="Group 103117" transform="translate(-2809 -4142)">
8
+ <path id="design_system_icons-40" data-name="design system icons-40" d="M31.5,21.5a10,10,0,1,1-10-10A10.012,10.012,0,0,1,31.5,21.5Z" transform="translate(2797.5 4130.5)" fill="#22b339" opacity="0.3"/>
9
+ <g id="Checkmark_Icon_2" transform="translate(2809 4142)">
10
+ <g id="Mask_Group_1304" data-name="Mask Group 1304" clip-path="url(#clip-path)">
11
+ <path id="Success_Done_Checkmark_Icon" d="M24.833,18.167A6.667,6.667,0,1,1,18.167,11.5,6.675,6.675,0,0,1,24.833,18.167Z" transform="translate(-8.167 -8.167)" fill="#22b339"/>
12
+ <path id="Success_Done_Checkmark_Icon-2" data-name="Success_Done_Checkmark_Icon" d="M21.443,15.641a.616.616,0,0,0-.937,0l-3.171,3.171a.537.537,0,0,1-.324.144.391.391,0,0,1-.324-.144L15.245,17.37a.553.553,0,0,0-.468-.18.685.685,0,0,0-.468.18.675.675,0,0,0,0,.937l2.234,2.234a.759.759,0,0,0,.468.18.685.685,0,0,0,.468-.18l3.964-3.964A.615.615,0,0,0,21.443,15.641Z" transform="translate(-7.876 -7.731)" fill="#fafafa"/>
13
+ </g>
14
+ </g>
15
+ </g>
16
+ </svg>
booster/assets/images/help.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 19 19"><defs><style>.a{fill:#fff;}</style></defs><g transform="translate(-64 -64)"><path class="a" d="M73.5,64A9.5,9.5,0,1,0,83,73.5,9.5,9.5,0,0,0,73.5,64Zm0,17.388A7.888,7.888,0,1,1,81.388,73.5,7.89,7.89,0,0,1,73.5,81.388Z"/><path class="a" d="M357.759,276.863a3.676,3.676,0,0,0-4.733,0A2.891,2.891,0,0,0,352,279.054v.161a.17.17,0,0,0,.17.17h1.018a.17.17,0,0,0,.17-.17v-.161a2.07,2.07,0,0,1,4.071,0,1.716,1.716,0,0,1-1.19,1.542,2.37,2.37,0,0,0-1.1.867,2.427,2.427,0,0,0-.422,1.376v.456a.17.17,0,0,0,.17.17H355.9a.17.17,0,0,0,.17-.17v-.481a1.025,1.025,0,0,1,.655-.95,3.061,3.061,0,0,0,2.059-2.81,2.882,2.882,0,0,0-1.024-2.191Zm-3.215,8.807a.848.848,0,1,0,.848-.848A.848.848,0,0,0,354.545,285.67Z" transform="translate(-281.893 -207.504)"/></g></svg>
booster/assets/images/information.svg ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Information_Icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14" viewBox="0 0 14 14">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47798" data-name="Rectangle 47798" width="14" height="14" fill="#f8c332"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Information_Icon-2" data-name="Information_Icon" clip-path="url(#clip-path)">
8
+ <g id="Info" transform="translate(0 0)">
9
+ <path id="Path_169137" data-name="Path 169137" d="M18.5,25.5a7.016,7.016,0,0,1-7-7.038,6.9,6.9,0,0,1,2.043-4.919A6.811,6.811,0,0,1,18.424,11.5a7.148,7.148,0,0,1,7.076,7,6.944,6.944,0,0,1-6.924,7Zm0-10.821a.908.908,0,1,0,.908.908h0A.947.947,0,0,0,18.5,14.678Zm0,2.8h0a.921.921,0,0,0-.908.908v2.989a.921.921,0,0,0,.908.908h0a.921.921,0,0,0,.908-.908V18.386A.921.921,0,0,0,18.5,17.478Z" transform="translate(-11.5 -11.5)" fill="#f8c332"/>
10
+ </g>
11
+ </g>
12
+ </svg>
booster/assets/images/loader.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg id="loader" xmlns="http://www.w3.org/2000/svg" width="13.846" height="13.846" viewBox="0 0 13.846 13.846">
2
+ <path id="Subtraction_1" data-name="Subtraction 1" d="M6.923,13.846a6.923,6.923,0,1,1,6.923-6.923A6.931,6.931,0,0,1,6.923,13.846Zm0-12.307a5.384,5.384,0,1,0,5.385,5.384A5.39,5.39,0,0,0,6.923,1.539Z" transform="translate(0 0)" fill="#fff"/>
3
+ <path id="Intersection_2" data-name="Intersection 2" d="M6.03,6.923h0A5.391,5.391,0,0,0,.643,1.539V1.518A.729.729,0,0,1,0,.8.805.805,0,0,1,.643,0,6.931,6.931,0,0,1,7.566,6.923H7.555a.755.755,0,0,1-.746.724H6.778A.775.775,0,0,1,6.03,6.923Z" transform="translate(6.28 0)" fill="#323a45" opacity="0.5"/>
4
+ </svg>
booster/assets/images/loader_green.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
2
+ <g id="loader" transform="translate(-281.823 -1)">
3
+ <path id="Subtraction_1" data-name="Subtraction 1" d="M9,18a9,9,0,1,1,9-9A9.01,9.01,0,0,1,9,18ZM9,2a7,7,0,1,0,7,7A7.007,7.007,0,0,0,9,2Z" transform="translate(281.823 1)" fill="#fff"/>
4
+ <path id="Intersection_2" data-name="Intersection 2" d="M7.838,9h0a7.008,7.008,0,0,0-7-7V1.973A.948.948,0,0,1,0,1.04,1.047,1.047,0,0,1,.836,0a9.01,9.01,0,0,1,9,9H9.821a.982.982,0,0,1-.969.941h-.04A1.008,1.008,0,0,1,7.838,9Z" transform="translate(289.987 1)" fill="#22b339"/>
5
+ </g>
6
+ </svg>
booster/assets/images/loader_medium.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg id="loader" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
2
+ <path id="Subtraction_1" data-name="Subtraction 1" d="M6.923,13.846a6.923,6.923,0,1,1,6.923-6.923A6.931,6.931,0,0,1,6.923,13.846Zm0-12.307a5.384,5.384,0,1,0,5.385,5.384A5.39,5.39,0,0,0,6.923,1.539Z" transform="translate(0 0)" fill="#fff"/>
3
+ <path id="Intersection_2" data-name="Intersection 2" d="M6.03,6.923h0A5.391,5.391,0,0,0,.643,1.539V1.518A.729.729,0,0,1,0,.8.805.805,0,0,1,.643,0,6.931,6.931,0,0,1,7.566,6.923H7.555a.755.755,0,0,1-.746.724H6.778A.775.775,0,0,1,6.03,6.923Z" transform="translate(6.28 0)" fill="#323a45" opacity="0.5"/>
4
+ </svg>
booster/assets/images/loader_small.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg id="Loader_Small" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
2
+ <path id="Subtraction_1" data-name="Subtraction 1" d="M180.823-1193a9.01,9.01,0,0,1-9-9,9.01,9.01,0,0,1,9-9,9.01,9.01,0,0,1,9,9A9.01,9.01,0,0,1,180.823-1193Zm0-16a7.007,7.007,0,0,0-7,7,7.008,7.008,0,0,0,7,7,7.008,7.008,0,0,0,7-7A7.008,7.008,0,0,0,180.823-1209Z" transform="translate(-171.823 1211)" fill="rgba(255,255,255,0.3)"/>
3
+ <path id="Intersection_2" data-name="Intersection 2" d="M187.826-1194h0a7.008,7.008,0,0,0-7-7v-.028a.948.948,0,0,1-.835-.933,1.047,1.047,0,0,1,.835-1.04,9.01,9.01,0,0,1,9,9h-.014a.982.982,0,0,1-.969.941h-.04A1.008,1.008,0,0,1,187.826-1194Z" transform="translate(-171.823 1203)" fill="rgba(255,255,255,0.7)"/>
4
+ </svg>
booster/assets/images/loader_small_grey.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg id="Loader_Small" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
2
+ <path id="Subtraction_1" data-name="Subtraction 1" d="M180.823-1193a9.01,9.01,0,0,1-9-9,9.01,9.01,0,0,1,9-9,9.01,9.01,0,0,1,9,9A9.01,9.01,0,0,1,180.823-1193Zm0-16a7.007,7.007,0,0,0-7,7,7.008,7.008,0,0,0,7,7,7.008,7.008,0,0,0,7-7A7.008,7.008,0,0,0,180.823-1209Z" transform="translate(-171.823 1211)" fill="rgba(50,58,69,0.1)"/>
3
+ <path id="Intersection_2" data-name="Intersection 2" d="M187.826-1194h0a7.008,7.008,0,0,0-7-7v-.028a.948.948,0,0,1-.835-.933,1.047,1.047,0,0,1,.835-1.04,9.01,9.01,0,0,1,9,9h-.014a.982.982,0,0,1-.969.941h-.04A1.008,1.008,0,0,1,187.826-1194Z" transform="translate(-171.823 1203)" fill="rgba(50,58,69,0.5)"/>
4
+ </svg>
booster/assets/images/logo_dark.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="27.102" height="26" viewBox="0 0 27.102 26">
2
+ <g id="Group_102205" data-name="Group 102205" transform="translate(0.499 -0.391)">
3
+ <path id="Union_846" data-name="Union 846" d="M-12237.115-21653.73a.127.127,0,0,1,0-.174l5.173-7.189a.138.138,0,0,0,.027-.082.134.134,0,0,0-.137-.135h-4.145a.134.134,0,0,1-.1-.055.129.129,0,0,1,.026-.18l13.2-10.029a.123.123,0,0,1,.175,0,.126.126,0,0,1,0,.174l-5.172,7.2a.127.127,0,0,0-.027.076.135.135,0,0,0,.136.137h4.139a.141.141,0,0,1,.109.055.135.135,0,0,1-.033.184l-13.2,10.023a.119.119,0,0,1-.087.037A.119.119,0,0,1-12237.115-21653.73Zm9.687-4.176a.136.136,0,0,1,.033-.18l6.733-5.135-1.725-1.686a1.5,1.5,0,0,1-.038-2.094,1.441,1.441,0,0,1,2.066-.039l2.84,2.785c.038.033.07.061.1.092l.064.072a.053.053,0,0,0,.022.021,1.43,1.43,0,0,1-.147,1.963,1.23,1.23,0,0,1-.4.25l-3.4,1.453.016-.012-6,2.551a.088.088,0,0,1-.055.016A.132.132,0,0,1-12227.429-21657.906Zm-12.221-.359-2.834-2.779c-.038-.033-.076-.064-.108-.1l-.065-.07a1.277,1.277,0,0,1-.19-.289.006.006,0,0,1-.006-.006c-.011-.021-.016-.037-.026-.059a.061.061,0,0,1-.011-.033.04.04,0,0,1-.012-.027s0-.006,0-.006c-.006-.016-.011-.037-.017-.055s0-.016-.011-.021a.107.107,0,0,0-.011-.037c-.006-.012-.006-.027-.011-.039a.05.05,0,0,0-.006-.027c0-.016,0-.031-.011-.049v-.016a1.413,1.413,0,0,1,.44-1.322,1.285,1.285,0,0,1,.4-.25l3.405-1.451-.017.016,6.016-2.557a.127.127,0,0,1,.157.039.134.134,0,0,1-.032.18l-6.744,5.139,1.719,1.682a1.511,1.511,0,0,1,.043,2.1,1.455,1.455,0,0,1-1.055.447A1.438,1.438,0,0,1-12239.649-21658.266Z" transform="translate(12243.007 21675.83)" fill="#7e8891" stroke="rgba(0,0,0,0)" stroke-width="1"/>
4
+ <rect id="Rectangle_51265" data-name="Rectangle 51265" width="25.589" height="26" transform="translate(0 0.391)" fill="none"/>
5
+ </g>
6
+ </svg>
booster/assets/images/logo_green.svg ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26">
2
+ <g id="Group_102205" data-name="Group 102205" transform="translate(0 -0.391)">
3
+ <path id="Path_171039" data-name="Path 171039" d="M.441,38.127h0a1.445,1.445,0,0,0,2.065-.037l7.924-6.038a.131.131,0,0,0,.033-.18.126.126,0,0,0-.158-.045l-9.409,4a1.426,1.426,0,0,0-.52,2.23Z" transform="translate(-0.028 -23.443)" fill="#fff"/>
4
+ <path id="Path_171040" data-name="Path 171040" d="M5.434,48.088a1.443,1.443,0,0,1-2.063.039l0,0L.462,45.274l-.034-.029-.06-.063a1.427,1.427,0,0,1,.12-1.992,1.393,1.393,0,0,1,.4-.252L4.295,41.49,3.723,42a1.571,1.571,0,0,0-.163,2.191q.045.054.095.1l1.74,1.7a1.5,1.5,0,0,1,.039,2.1" transform="translate(-0.014 -30.56)" fill="#9ea3a8"/>
5
+ <path id="Path_171041" data-name="Path 171041" d="M69.869,43.142h0a1.445,1.445,0,0,0-2.065.037l-7.911,6.038a.131.131,0,0,0-.033.18.126.126,0,0,0,.158.045l9.4-4a1.426,1.426,0,0,0,.52-2.23Z" transform="translate(-44.277 -31.469)" fill="#fff"/>
6
+ <path id="Path_171042" data-name="Path 171042" d="M78,32.276a1.443,1.443,0,0,1,2.063-.039l0,0,2.907,2.851L83,35.12l.06.063a1.427,1.427,0,0,1-.12,1.992,1.393,1.393,0,0,1-.4.252l-3.407,1.448.572-.507a1.571,1.571,0,0,0,.163-2.191q-.045-.054-.095-.1l-1.742-1.7a1.5,1.5,0,0,1-.036-2.1" transform="translate(-57.411 -23.446)" fill="#9ea3a8"/>
7
+ <rect id="Rectangle_51265" data-name="Rectangle 51265" width="25.589" height="26" transform="translate(0 0.391)" fill="none"/>
8
+ <g id="Group_103045" data-name="Group 103045" transform="translate(5.745 4.32)">
9
+ <path id="Path_171177" data-name="Path 171177" d="M31.671,23.435l5.209-7.126a.123.123,0,1,0-.175-.173L23.411,26.072a.128.128,0,0,0,.076.233h4.172a.136.136,0,0,1,.11.215L22.56,33.645a.123.123,0,0,0,.175.173l13.293-9.935a.128.128,0,0,0-.076-.233H31.781a.136.136,0,0,1-.11-.215Z" transform="translate(-22.525 -16.1)" fill="#22b339"/>
10
+ <path id="Path_171178" data-name="Path 171178" d="M36.927,16.485,28.22,25.033a.128.128,0,0,0,.089.22h3.142a.136.136,0,0,1,.094.233l-8.757,8.537a.055.055,0,0,0,.071.081L36.17,24.153a.128.128,0,0,0-.076-.23H31.9a.136.136,0,0,1-.11-.217l5.237-7.144a.065.065,0,0,0-.1-.076Z" transform="translate(-22.711 -16.371)" fill="#fff" opacity="0.2"/>
11
+ </g>
12
+ </g>
13
+ </svg>
booster/assets/images/logo_white.svg ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
2
+ <g id="Group_102623" data-name="Group 102623" transform="translate(-80 -236)">
3
+ <rect id="Rectangle_49998" data-name="Rectangle 49998" width="18" height="18" transform="translate(80 236)" fill="none"/>
4
+ <g id="Group_104194" data-name="Group 104194" transform="translate(83.358 237.916)">
5
+ <path id="Path_171177" data-name="Path 171177" d="M29.7,21.851l4.084-5.587a.1.1,0,1,0-.138-.136L23.22,23.919a.1.1,0,0,0,.06.183h3.271a.107.107,0,0,1,.086.168l-4.084,5.587a.1.1,0,0,0,.138.136L33.113,22.2a.1.1,0,0,0-.06-.183H29.783a.107.107,0,0,1-.086-.168Z" transform="translate(-22.525 -16.1)" fill="#fff"/>
6
+ </g>
7
+ </g>
8
+ </svg>
booster/assets/images/mobile.svg ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_49882" data-name="Rectangle 49882" width="18" height="18" fill="#fff"/>
5
+ </clipPath>
6
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
7
+ <stop offset="0" stop-color="#fff"/>
8
+ <stop offset="1" stop-color="#fff" stop-opacity="0"/>
9
+ </linearGradient>
10
+ </defs>
11
+ <g id="Mobile_Icon" opacity="0.8" clip-path="url(#clip-path)">
12
+ <path id="design_system_icons-34" data-name="design system icons-34" d="M27.881,12.311V25.689a.813.813,0,0,1-.811.811H19.611a.813.813,0,0,1-.811-.811V12.311a.813.813,0,0,1,.811-.811h7.5A.806.806,0,0,1,27.881,12.311Z" transform="translate(-14.3 -10)" fill="url(#linear-gradient)"/>
13
+ <path id="design_system_icons-34-2" data-name="design system icons-34" d="M27.881,12.311V25.689a.813.813,0,0,1-.811.811H19.611a.813.813,0,0,1-.811-.811V12.311a.813.813,0,0,1,.811-.811h7.5A.806.806,0,0,1,27.881,12.311ZM26.705,24.473V13.527h-6.73V24.432h6.73Z" transform="translate(-14.3 -10)" fill="#343b46"/>
14
+ </g>
15
+ </svg>
booster/assets/images/not_optimized.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
2
+ <g id="Group_104105" data-name="Group 104105" transform="translate(-3.334 -3.332)">
3
+ <path id="Subtraction_23" data-name="Subtraction 23" d="M14,7A7,7,0,1,1,7,0,7.008,7.008,0,0,1,14,7Z" transform="translate(3.334 3.332)" fill="#fd3c31"/>
4
+ <path id="design_system_icons-40" data-name="design system icons-40" d="M8.157,3.841a.848.848,0,0,0-.852-.671H4.824V.783a.883.883,0,0,0-.259-.6A.881.881,0,0,0,4.046,0H3.935a.81.81,0,0,0-.667.82V3.132H.787a.871.871,0,0,0-.593.261.769.769,0,0,0-.185.634A.819.819,0,0,0,.861,4.7H3.269V7.384a.883.883,0,0,0,.259.6.881.881,0,0,0,.519.186h.111a.81.81,0,0,0,.667-.82V4.736H7.417a.785.785,0,0,0,.556-.261A.808.808,0,0,0,8.157,3.841Z" transform="translate(10.276 4.499) rotate(45)" fill="#fff"/>
5
+ </g>
6
+ </svg>
booster/assets/images/optimize.svg ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" y1="1" x2="0.5" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#fff" stop-opacity="0.588"/>
5
+ <stop offset="1" stop-color="#fff"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <g id="Group_102623" data-name="Group 102623" transform="translate(-80 -236)">
9
+ <rect id="Rectangle_49998" data-name="Rectangle 49998" width="18" height="18" transform="translate(80 236)" fill="none"/>
10
+ <path id="Path_171097" data-name="Path 171097" d="M-9886.972-8352.187a.1.1,0,0,1,0-.135l4.061-5.555a.109.109,0,0,0,.009-.11.108.108,0,0,0-.094-.057h-3.255a.1.1,0,0,1-.095-.069.1.1,0,0,1,.037-.112l10.363-7.746a.1.1,0,0,1,.136,0,.1.1,0,0,1,0,.137l-4.061,5.555a.107.107,0,0,0-.007.108.1.1,0,0,0,.093.057h3.253a.1.1,0,0,1,.1.069.109.109,0,0,1-.036.115l-10.363,7.743a.1.1,0,0,1-.068.029A.1.1,0,0,1-9886.972-8352.187Z" transform="translate(9970.389 8604.079)" stroke="rgba(0,0,0,0)" stroke-width="1" fill="url(#linear-gradient)"/>
11
+ </g>
12
+ </svg>
booster/assets/images/pg.svg ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
2
+ <g id="Group_104205" data-name="Group 104205" transform="translate(-529 -174)">
3
+ <rect id="Rectangle_52354" data-name="Rectangle 52354" width="15" height="15" transform="translate(529 174)" fill="none"/>
4
+ <g id="Group_104203" data-name="Group 104203" transform="translate(509.158 151.942)">
5
+ <path id="Path_171432" data-name="Path 171432" d="M10.828,5.532v.1A5.543,5.543,0,0,1,9.254,9.542a5.244,5.244,0,0,1-3.822,1.583A5.237,5.237,0,0,1,1.547,9.52,5.54,5.54,0,0,1,0,5.52,5.59,5.59,0,0,1,1.6,1.583,5.36,5.36,0,0,1,10.27,3.106H6.863a1.952,1.952,0,0,0-1.4-.49,2.9,2.9,0,0,0-2.849,2.94A2.9,2.9,0,0,0,5.479,8.485a2.5,2.5,0,0,0,2.3-1.219H5.444V4.875h5.409c.012,0-.012.107,0,.215C10.863,5.269,10.828,5.353,10.828,5.532Z" transform="translate(23.986 25.057)" fill="#2e3336"/>
6
+ <path id="Path_171433" data-name="Path 171433" d="M14.557,3.8a6.148,6.148,0,0,0-4.409-2.524,6.086,6.086,0,0,0-4.771,1.69,6.614,6.614,0,0,0,.126,9.3l-.643-.024H1.314a1.223,1.223,0,0,1-1.32-1.395V4.432A2.176,2.176,0,0,1,1.808,2.155c.218-.048.415-.048.4-.369-.011-.227.173-.2.321-.2H4c.264,0,.551-.083.562.393.011.227.677.227.872-.036A10.287,10.287,0,0,0,6.2.761,1.4,1.4,0,0,1,7.522-.014c1.388.012,2.88.012,4.3,0A1.239,1.239,0,0,1,13.1.737C13.49,1.714,14.637,3.884,14.557,3.8Z" transform="translate(19.85 23.08)" fill="#2e3336"/>
7
+ </g>
8
+ </g>
9
+ </svg>
booster/assets/images/red-info.svg ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47798" data-name="Rectangle 47798" width="20" height="20" fill="#323a45"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Group_103076" data-name="Group 103076" transform="translate(-1064 -32)">
8
+ <path id="design_system_icons-40" data-name="design system icons-40" d="M31.5,21.5a10,10,0,1,1-10-10A10.012,10.012,0,0,1,31.5,21.5Z" transform="translate(1052.5 20.5)" fill="#fd3c31" opacity="0.3"/>
9
+ <g id="Information_Icon" transform="translate(1064 32)">
10
+ <g id="Information_Icon-2" data-name="Information_Icon" clip-path="url(#clip-path)">
11
+ <g id="Info" transform="translate(3.333 3.334)">
12
+ <path id="Path_169137" data-name="Path 169137" d="M18.167,24.833a6.682,6.682,0,0,1-6.667-6.7,6.569,6.569,0,0,1,1.946-4.685A6.487,6.487,0,0,1,18.094,11.5a6.808,6.808,0,0,1,6.739,6.666,6.613,6.613,0,0,1-6.594,6.667Z" transform="translate(-11.5 -11.5)" fill="#fd3c31"/>
13
+ </g>
14
+ <g id="Info-2" data-name="Info" transform="translate(9.135 6.361)">
15
+ <path id="Path_169137-2" data-name="Path 169137" d="M19.907,15.435a.865.865,0,1,0,.865.865h0A.9.9,0,0,0,19.907,15.435Zm0,2.667h0a.877.877,0,0,0-.865.865v2.847a.877.877,0,0,0,.865.865h0a.877.877,0,0,0,.865-.865V18.966A.877.877,0,0,0,19.907,18.1Z" transform="translate(-19.042 -15.435)" fill="#fff"/>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </svg>
booster/assets/images/reload.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Restore_Icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="28" height="28" viewBox="0 0 28 28">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47809" data-name="Rectangle 47809" width="28" height="28" fill="#323a45"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Restore_Icon-2" data-name="Restore_Icon" clip-path="url(#clip-path)">
8
+ <path id="Path_169383" data-name="Path 169383" d="M16.864,11.5h0A8.124,8.124,0,0,1,22.6,13.9a8.519,8.519,0,0,1,2.383,5.778h1.5a1.2,1.2,0,0,1,.53.267,1.02,1.02,0,0,1,.353.756.908.908,0,0,1-.265.667l-2.383,2.711a1.011,1.011,0,0,1-1.5,0L20.88,21.455a1.088,1.088,0,0,1-.132-1.333,1.116,1.116,0,0,1,.794-.444h1.368a6.049,6.049,0,0,0-5.957-6.044h0a6.182,6.182,0,0,0-6.134,6.089,6.262,6.262,0,0,0,1.721,4.311,5.923,5.923,0,0,0,4.236,1.778h.088a6.371,6.371,0,0,0,2.868-.711,1.025,1.025,0,0,1,1.412.444,1.039,1.039,0,0,1-.441,1.422,8.35,8.35,0,0,1-3.839.978h-.088A8.167,8.167,0,0,1,8.7,19.678,8.222,8.222,0,0,1,16.864,11.5Z" transform="translate(-4.033 -5.59)" fill="rgba(255,255,255,0.5)"/>
9
+ </g>
10
+ </svg>
booster/assets/images/star_grey.jpg ADDED
Binary file
booster/assets/images/success.svg ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Checkmark_Icon_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_48150" data-name="Rectangle 48150" width="24" height="24" fill="#fff"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Mask_Group_1304" data-name="Mask Group 1304" clip-path="url(#clip-path)">
8
+ <g id="Group_94669" data-name="Group 94669" transform="translate(4 4)">
9
+ <path id="Success_Done_Checkmark_Icon" d="M27.5,19.5a8,8,0,1,1-8-8A8.01,8.01,0,0,1,27.5,19.5Z" transform="translate(-11.5 -11.5)" fill="#23b536"/>
10
+ <path id="Success_Done_Checkmark_Icon-2" data-name="Success_Done_Checkmark_Icon" d="M22.908,15.684a.739.739,0,0,0-1.124,0l-3.805,3.805a.644.644,0,0,1-.389.173.47.47,0,0,1-.389-.173l-1.73-1.73a.664.664,0,0,0-.562-.216.822.822,0,0,0-.562.216.81.81,0,0,0,0,1.124l2.681,2.681a.911.911,0,0,0,.562.216.822.822,0,0,0,.562-.216l4.757-4.757A.738.738,0,0,0,22.908,15.684Z" transform="translate(-10.627 -10.192)" fill="#fafafa"/>
11
+ </g>
12
+ </g>
13
+ </svg>
booster/assets/images/up_arrow_nav.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <svg id="Navigation_Icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_47807" data-name="Rectangle 47807" width="18" height="18" fill="#323a45"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="Navigation_Icon-2" data-name="Navigation_Icon" clip-path="url(#clip-path)">
8
+ <path id="Path_169381" data-name="Path 169381" d="M3.778.363.4,3.785A1.309,1.309,0,0,0,.275,5.528a1.28,1.28,0,0,0,1.879.1L4.415,3.333a.383.383,0,0,1,.51,0l2.23,2.26a1.267,1.267,0,0,0,1.72.129,1.321,1.321,0,0,0,.1-1.9L5.562.363A1.277,1.277,0,0,0,3.778.363Z" transform="translate(4.335 5.965)" fill="rgba(255,255,255,0.8)"/>
9
+ </g>
10
+ </svg>
booster/assets/js/circle-progress.js ADDED
@@ -0,0 +1,552 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jquery-circle-progress - jQuery Plugin to draw animated circular progress bars:
3
+ * {@link http://kottenator.github.io/jquery-circle-progress/}
4
+ *
5
+ * @author Rostyslav Bryzgunov <kottenator@gmail.com>
6
+ * @version 1.2.2
7
+ * @licence MIT
8
+ * @preserve
9
+ */
10
+ // UMD factory - https://github.com/umdjs/umd/blob/d31bb6ee7098715e019f52bdfe27b3e4bfd2b97e/templates/jqueryPlugin.js
11
+ // Uses AMD, CommonJS or browser globals to create a jQuery plugin.
12
+ (function(factory) {
13
+ if (typeof define === 'function' && define.amd) {
14
+ // AMD - register as an anonymous module
15
+ define(['jquery'], factory);
16
+ } else if (typeof module === 'object' && module.exports) {
17
+ // Node/CommonJS
18
+ var $ = require('jquery');
19
+ factory($);
20
+ module.exports = $;
21
+ } else {
22
+ // Browser globals
23
+ factory(jQuery);
24
+ }
25
+ })(function($) {
26
+ /**
27
+ * Inner implementation of the circle progress bar.
28
+ * The class is not exposed _yet_ but you can create an instance through jQuery method call.
29
+ *
30
+ * @param {object} config - You can customize any class member (property or method).
31
+ * @class
32
+ * @alias CircleProgress
33
+ */
34
+ function CircleProgress(config) {
35
+ this.init(config);
36
+ }
37
+
38
+ CircleProgress.prototype = {
39
+ //--------------------------------------- public options ---------------------------------------
40
+ /**
41
+ * This is the only required option. It should be from `0.0` to `1.0`.
42
+ * @type {number}
43
+ * @default 0.0
44
+ */
45
+ value: 0.0,
46
+
47
+ /**
48
+ * Size of the canvas in pixels.
49
+ * It's a square so we need only one dimension.
50
+ * @type {number}
51
+ * @default 100.0
52
+ */
53
+ size: 100.0,
54
+
55
+ /**
56
+ * Initial angle for `0.0` value in radians.
57
+ * @type {number}
58
+ * @default -Math.PI
59
+ */
60
+ startAngle: -Math.PI,
61
+
62
+ /**
63
+ * Width of the arc in pixels.
64
+ * If it's `'auto'` - the value is calculated as `[this.size]{@link CircleProgress#size} / 14`.
65
+ * @type {number|string}
66
+ * @default 'auto'
67
+ */
68
+ thickness: 'auto',
69
+
70
+ /**
71
+ * Fill of the arc. You may set it to:
72
+ *
73
+ * - solid color:
74
+ * - `'#3aeabb'`
75
+ * - `{ color: '#3aeabb' }`
76
+ * - `{ color: 'rgba(255, 255, 255, .3)' }`
77
+ * - linear gradient _(left to right)_:
78
+ * - `{ gradient: ['#3aeabb', '#fdd250'], gradientAngle: Math.PI / 4 }`
79
+ * - `{ gradient: ['red', 'green', 'blue'], gradientDirection: [x0, y0, x1, y1] }`
80
+ * - `{ gradient: [["red", .2], ["green", .3], ["blue", .8]] }`
81
+ * - image:
82
+ * - `{ image: 'http://i.imgur.com/pT0i89v.png' }`
83
+ * - `{ image: imageObject }`
84
+ * - `{ color: 'lime', image: 'http://i.imgur.com/pT0i89v.png' }` -
85
+ * color displayed until the image is loaded
86
+ *
87
+ * @default {gradient: ['#3aeabb', '#fdd250']}
88
+ */
89
+ fill: {
90
+ gradient: ['#3aeabb', '#fdd250']
91
+ },
92
+
93
+ /**
94
+ * Color of the "empty" arc. Only a color fill supported by now.
95
+ * @type {string}
96
+ * @default 'rgba(0, 0, 0, .1)'
97
+ */
98
+ emptyFill: 'rgba(0, 0, 0, .1)',
99
+
100
+ /**
101
+ * jQuery Animation config.
102
+ * You can pass `false` to disable the animation.
103
+ * @see http://api.jquery.com/animate/
104
+ * @type {object|boolean}
105
+ * @default {duration: 1200, easing: 'circleProgressEasing'}
106
+ */
107
+ animation: {
108
+ duration: 1200,
109
+ easing: 'circleProgressEasing'
110
+ },
111
+
112
+ /**
113
+ * Default animation starts at `0.0` and ends at specified `value`. Let's call this _direct animation_.
114
+ * If you want to make _reversed animation_ - set `animationStartValue: 1.0`.
115
+ * Also you may specify any other value from `0.0` to `1.0`.
116
+ * @type {number}
117
+ * @default 0.0
118
+ */
119
+ animationStartValue: 0.0,
120
+
121
+ /**
122
+ * Reverse animation and arc draw.
123
+ * By default, the arc is filled from `0.0` to `value`, _clockwise_.
124
+ * With `reverse: true` the arc is filled from `1.0` to `value`, _counter-clockwise_.
125
+ * @type {boolean}
126
+ * @default false
127
+ */
128
+ reverse: false,
129
+
130
+ /**
131
+ * Arc line cap: `'butt'`, `'round'` or `'square'` -
132
+ * [read more]{@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.lineCap}.
133
+ * @type {string}
134
+ * @default 'butt'
135
+ */
136
+ lineCap: 'butt',
137
+
138
+ /**
139
+ * Canvas insertion mode: append or prepend it into the parent element?
140
+ * @type {string}
141
+ * @default 'prepend'
142
+ */
143
+ insertMode: 'prepend',
144
+
145
+ //------------------------------ protected properties and methods ------------------------------
146
+ /**
147
+ * Link to {@link CircleProgress} constructor.
148
+ * @protected
149
+ */
150
+ constructor: CircleProgress,
151
+
152
+ /**
153
+ * Container element. Should be passed into constructor config.
154
+ * @protected
155
+ * @type {jQuery}
156
+ */
157
+ el: null,
158
+
159
+ /**
160
+ * Canvas element. Automatically generated and prepended to [this.el]{@link CircleProgress#el}.
161
+ * @protected
162
+ * @type {HTMLCanvasElement}
163
+ */
164
+ canvas: null,
165
+
166
+ /**
167
+ * 2D-context of [this.canvas]{@link CircleProgress#canvas}.
168
+ * @protected
169
+ * @type {CanvasRenderingContext2D}
170
+ */
171
+ ctx: null,
172
+
173
+ /**
174
+ * Radius of the outer circle. Automatically calculated as `[this.size]{@link CircleProgress#size} / 2`.
175
+ * @protected
176
+ * @type {number}
177
+ */
178
+ radius: 0.0,
179
+
180
+ /**
181
+ * Fill of the main arc. Automatically calculated, depending on [this.fill]{@link CircleProgress#fill} option.
182
+ * @protected
183
+ * @type {string|CanvasGradient|CanvasPattern}
184
+ */
185
+ arcFill: null,
186
+
187
+ /**
188
+ * Last rendered frame value.
189
+ * @protected
190
+ * @type {number}
191
+ */
192
+ lastFrameValue: 0.0,
193
+
194
+ /**
195
+ * Init/re-init the widget.
196
+ *
197
+ * Throws a jQuery event:
198
+ *
199
+ * - `circle-inited(jqEvent)`
200
+ *
201
+ * @param {object} config - You can customize any class member (property or method).
202
+ */
203
+ init: function(config) {
204
+ $.extend(this, config);
205
+ this.radius = this.size / 2;
206
+ this.initWidget();
207
+ this.initFill();
208
+ this.draw();
209
+ this.el.trigger('circle-inited');
210
+ },
211
+
212
+ /**
213
+ * Initialize `<canvas>`.
214
+ * @protected
215
+ */
216
+ initWidget: function() {
217
+ if (!this.canvas)
218
+ this.canvas = $('<canvas>')[this.insertMode == 'prepend' ? 'prependTo' : 'appendTo'](this.el)[0];
219
+
220
+ var canvas = this.canvas;
221
+ canvas.width = this.size;
222
+ canvas.height = this.size;
223
+ this.ctx = canvas.getContext('2d');
224
+
225
+ if (window.devicePixelRatio > 1) {
226
+ var scaleBy = window.devicePixelRatio;
227
+ canvas.style.width = canvas.style.height = this.size + 'px';
228
+ canvas.width = canvas.height = this.size * scaleBy;
229
+ this.ctx.scale(scaleBy, scaleBy);
230
+ }
231
+ },
232
+
233
+ /**
234
+ * This method sets [this.arcFill]{@link CircleProgress#arcFill}.
235
+ * It could do this async (on image load).
236
+ * @protected
237
+ */
238
+ initFill: function() {
239
+ var self = this,
240
+ fill = this.fill,
241
+ ctx = this.ctx,
242
+ size = this.size;
243
+
244
+ if (!fill)
245
+ throw Error("The fill is not specified!");
246
+
247
+ if (typeof fill == 'string')
248
+ fill = {color: fill};
249
+
250
+ if (fill.color)
251
+ this.arcFill = fill.color;
252
+
253
+ if (fill.gradient) {
254
+ var gr = fill.gradient;
255
+
256
+ if (gr.length == 1) {
257
+ this.arcFill = gr[0];
258
+ } else if (gr.length > 1) {
259
+ var ga = fill.gradientAngle || 0, // gradient direction angle; 0 by default
260
+ gd = fill.gradientDirection || [
261
+ size / 2 * (1 - Math.cos(ga)), // x0
262
+ size / 2 * (1 + Math.sin(ga)), // y0
263
+ size / 2 * (1 + Math.cos(ga)), // x1
264
+ size / 2 * (1 - Math.sin(ga)) // y1
265
+ ];
266
+
267
+ var lg = ctx.createLinearGradient.apply(ctx, gd);
268
+
269
+ for (var i = 0; i < gr.length; i++) {
270
+ var color = gr[i],
271
+ pos = i / (gr.length - 1);
272
+
273
+ if ($.isArray(color)) {
274
+ pos = color[1];
275
+ color = color[0];
276
+ }
277
+
278
+ lg.addColorStop(pos, color);
279
+ }
280
+
281
+ this.arcFill = lg;
282
+ }
283
+ }
284
+
285
+ if (fill.image) {
286
+ var img;
287
+
288
+ if (fill.image instanceof Image) {
289
+ img = fill.image;
290
+ } else {
291
+ img = new Image();
292
+ img.src = fill.image;
293
+ }
294
+
295
+ if (img.complete)
296
+ setImageFill();
297
+ else
298
+ img.onload = setImageFill;
299
+ }
300
+
301
+ function setImageFill() {
302
+ var bg = $('<canvas>')[0];
303
+ bg.width = self.size;
304
+ bg.height = self.size;
305
+ bg.getContext('2d').drawImage(img, 0, 0, size, size);
306
+ self.arcFill = self.ctx.createPattern(bg, 'no-repeat');
307
+ self.drawFrame(self.lastFrameValue);
308
+ }
309
+ },
310
+
311
+ /**
312
+ * Draw the circle.
313
+ * @protected
314
+ */
315
+ draw: function() {
316
+ if (this.animation)
317
+ this.drawAnimated(this.value);
318
+ else
319
+ this.drawFrame(this.value);
320
+ },
321
+
322
+ /**
323
+ * Draw a single animation frame.
324
+ * @protected
325
+ * @param {number} v - Frame value.
326
+ */
327
+ drawFrame: function(v) {
328
+ this.lastFrameValue = v;
329
+ this.ctx.clearRect(0, 0, this.size, this.size);
330
+ this.drawEmptyArc(v);
331
+ this.drawArc(v);
332
+ },
333
+
334
+ /**
335
+ * Draw the arc (part of the circle).
336
+ * @protected
337
+ * @param {number} v - Frame value.
338
+ */
339
+ drawArc: function(v) {
340
+ if (v === 0)
341
+ return;
342
+
343
+ var ctx = this.ctx,
344
+ r = this.radius,
345
+ t = this.getThickness(),
346
+ a = this.startAngle;
347
+
348
+ ctx.save();
349
+ ctx.beginPath();
350
+
351
+ if (!this.reverse) {
352
+ ctx.arc(r, r, r - t / 2, a, a + Math.PI * 2 * v);
353
+ } else {
354
+ ctx.arc(r, r, r - t / 2, a - Math.PI * 2 * v, a);
355
+ }
356
+
357
+ ctx.lineWidth = t;
358
+ ctx.lineCap = this.lineCap;
359
+ ctx.strokeStyle = this.arcFill;
360
+ ctx.stroke();
361
+ ctx.restore();
362
+ },
363
+
364
+ /**
365
+ * Draw the _empty (background)_ arc (part of the circle).
366
+ * @protected
367
+ * @param {number} v - Frame value.
368
+ */
369
+ drawEmptyArc: function(v) {
370
+ var ctx = this.ctx,
371
+ r = this.radius,
372
+ t = this.getThickness(),
373
+ a = this.startAngle;
374
+
375
+ if (v < 1) {
376
+ ctx.save();
377
+ ctx.beginPath();
378
+
379
+ if (v <= 0) {
380
+ ctx.arc(r, r, r - t / 2, 0, Math.PI * 2);
381
+ } else {
382
+ if (!this.reverse) {
383
+ ctx.arc(r, r, r - t / 2, a + Math.PI * 2 * v, a);
384
+ } else {
385
+ ctx.arc(r, r, r - t / 2, a, a - Math.PI * 2 * v);
386
+ }
387
+ }
388
+
389
+ ctx.lineWidth = t;
390
+ ctx.strokeStyle = this.emptyFill;
391
+ ctx.stroke();
392
+ ctx.restore();
393
+ }
394
+ },
395
+
396
+ /**
397
+ * Animate the progress bar.
398
+ *
399
+ * Throws 3 jQuery events:
400
+ *
401
+ * - `circle-animation-start(jqEvent)`
402
+ * - `circle-animation-progress(jqEvent, animationProgress, stepValue)` - multiple event
403
+ * animationProgress: from `0.0` to `1.0`; stepValue: from `0.0` to `value`
404
+ * - `circle-animation-end(jqEvent)`
405
+ *
406
+ * @protected
407
+ * @param {number} v - Final value.
408
+ */
409
+ drawAnimated: function(v) {
410
+ var self = this,
411
+ el = this.el,
412
+ canvas = $(this.canvas);
413
+
414
+ // stop previous animation before new "start" event is triggered
415
+ canvas.stop(true, false);
416
+ el.trigger('circle-animation-start');
417
+
418
+ canvas
419
+ .css({animationProgress: 0})
420
+ .animate({animationProgress: 1}, $.extend({}, this.animation, {
421
+ step: function(animationProgress) {
422
+ var stepValue = self.animationStartValue * (1 - animationProgress) + v * animationProgress;
423
+ self.drawFrame(stepValue);
424
+ el.trigger('circle-animation-progress', [animationProgress, stepValue]);
425
+ }
426
+ }))
427
+ .promise()
428
+ .always(function() {
429
+ // trigger on both successful & failure animation end
430
+ el.trigger('circle-animation-end');
431
+ });
432
+ },
433
+
434
+ /**
435
+ * Get the circle thickness.
436
+ * @see CircleProgress#thickness
437
+ * @protected
438
+ * @returns {number}
439
+ */
440
+ getThickness: function() {
441
+ return $.isNumeric(this.thickness) ? this.thickness : this.size / 14;
442
+ },
443
+
444
+ /**
445
+ * Get current value.
446
+ * @protected
447
+ * @return {number}
448
+ */
449
+ getValue: function() {
450
+ return this.value;
451
+ },
452
+
453
+ /**
454
+ * Set current value (with smooth animation transition).
455
+ * @protected
456
+ * @param {number} newValue
457
+ */
458
+ setValue: function(newValue) {
459
+ if (this.animation)
460
+ this.animationStartValue = this.lastFrameValue;
461
+ this.value = newValue;
462
+ this.draw();
463
+ }
464
+ };
465
+
466
+ //----------------------------------- Initiating jQuery plugin -----------------------------------
467
+ $.circleProgress = {
468
+ // Default options (you may override them)
469
+ defaults: CircleProgress.prototype
470
+ };
471
+
472
+ // ease-in-out-cubic
473
+ $.easing.circleProgressEasing = function(x) {
474
+ if (x < 0.5) {
475
+ x = 2 * x;
476
+ return 0.5 * x * x * x;
477
+ } else {
478
+ x = 2 - 2 * x;
479
+ return 1 - 0.5 * x * x * x;
480
+ }
481
+ };
482
+
483
+ /**
484
+ * Creates an instance of {@link CircleProgress}.
485
+ * Produces [init event]{@link CircleProgress#init} and [animation events]{@link CircleProgress#drawAnimated}.
486
+ *
487
+ * @param {object} [configOrCommand] - Config object or command name.
488
+ *
489
+ * Config example (you can specify any {@link CircleProgress} property):
490
+ *
491
+ * ```js
492
+ * { value: 0.75, size: 50, animation: false }
493
+ * ```
494
+ *
495
+ * Commands:
496
+ *
497
+ * ```js
498
+ * el.circleProgress('widget'); // get the <canvas>
499
+ * el.circleProgress('value'); // get the value
500
+ * el.circleProgress('value', newValue); // update the value
501
+ * el.circleProgress('redraw'); // redraw the circle
502
+ * el.circleProgress(); // the same as 'redraw'
503
+ * ```
504
+ *
505
+ * @param {string} [commandArgument] - Some commands (like `'value'`) may require an argument.
506
+ * @see CircleProgress
507
+ * @alias "$(...).circleProgress"
508
+ */
509
+ $.fn.circleProgress = function(configOrCommand, commandArgument) {
510
+ var dataName = 'circle-progress',
511
+ firstInstance = this.data(dataName);
512
+
513
+ if (configOrCommand == 'widget') {
514
+ if (!firstInstance)
515
+ throw Error('Calling "widget" method on not initialized instance is forbidden');
516
+ return firstInstance.canvas;
517
+ }
518
+
519
+ if (configOrCommand == 'value') {
520
+ if (!firstInstance)
521
+ throw Error('Calling "value" method on not initialized instance is forbidden');
522
+ if (typeof commandArgument == 'undefined') {
523
+ return firstInstance.getValue();
524
+ } else {
525
+ var newValue = arguments[1];
526
+ return this.each(function() {
527
+ $(this).data(dataName).setValue(newValue);
528
+ });
529
+ }
530
+ }
531
+
532
+ return this.each(function() {
533
+ var el = $(this),
534
+ instance = el.data(dataName),
535
+ config = $.isPlainObject(configOrCommand) ? configOrCommand : {};
536
+
537
+ if (instance) {
538
+ instance.init(config);
539
+ } else {
540
+ var initialConfig = $.extend({}, el.data());
541
+ if (typeof initialConfig.fill == 'string')
542
+ initialConfig.fill = JSON.parse(initialConfig.fill);
543
+ if (typeof initialConfig.animation == 'string')
544
+ initialConfig.animation = JSON.parse(initialConfig.animation);
545
+ config = $.extend(initialConfig, config);
546
+ config.el = el;
547
+ instance = new CircleProgress(config);
548
+ el.data(dataName, instance);
549
+ }
550
+ });
551
+ };
552
+ });
booster/assets/js/global.js ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function () {
2
+ /* Change the CTA for pages with PG in it.*/
3
+ if (jQuery(".bwg-container").length) {
4
+ var html = '<div class="twb_admin_bar_menu_header">';
5
+ html += '<img class="twb_menu_logo" src="' + twb.plugin_url + '/assets/images/logo_white.svg" />';
6
+ html += '<div class="twb_menu_logo">Optimize Images</div>';
7
+ html += '</div>';
8
+ jQuery(".twb_admin_bar_menu").html(html).on("click", function () {
9
+ window.open(twb.href, '_blank');
10
+ });
11
+ jQuery(".twb_admin_bar_menu_main").remove();
12
+ }
13
+
14
+ /* Is score check in progress.*/
15
+ twb_inprogress = false;
16
+
17
+ /* Check if any score check is in progress.*/
18
+ jQuery(".twb-notoptimized").each(function () {
19
+ if (jQuery(this).data("status") == 'inprogress') {
20
+ /* Disable score check button.*/
21
+ twb_disable_check();
22
+ }
23
+ });
24
+
25
+ /* Add check score action to the button in page/posts list,
26
+ if there is no inprogress action.*/
27
+ jQuery(".twb-notoptimized .twb_check_score_button").on("click", function () {
28
+ if (!twb_inprogress) {
29
+ twb_check_score(this);
30
+ }
31
+ });
32
+
33
+ /* Add a hover action to show dismiss tooltip.*/
34
+ jQuery("th[id^='twb-speed-']").hover(function () {
35
+ jQuery(this).find(".twb-dismiss-container").removeClass("twb-hidden");
36
+ },
37
+ function () {
38
+ jQuery(this).find(".twb-dismiss-container").addClass("twb-hidden");
39
+ });
40
+
41
+ /* Add a hover action to show page score.*/
42
+ jQuery(".twb-see-score").hover(function () {
43
+ jQuery(this).parent().parent().find(".twb-score-container").removeClass("twb-hidden");
44
+ },
45
+ function () {
46
+ jQuery(this).parent().parent().find(".twb-score-container").addClass("twb-hidden");
47
+ });
48
+ jQuery(".twb-score-container:not(.twb_admin_bar_menu_content .twb-score-container), .twb-score-disabled-container").hover(function () {
49
+ jQuery(this).removeClass("twb-hidden");
50
+ },
51
+ function () {
52
+ jQuery(this).addClass("twb-hidden");
53
+ });
54
+
55
+ /* Draw circle on given scores.*/
56
+ jQuery(".twb-score-circle").each(function () {
57
+ twb_draw_score_circle(this);
58
+ });
59
+
60
+ /* Show/hide Image optimizer menu content container */
61
+ jQuery("#wp-admin-bar-twb_adminbar_info").mouseenter(function(){
62
+ jQuery(".twb_admin_bar_menu_main .twb-score-container").removeClass("twb-hidden");
63
+ jQuery(".twb_admin_bar_menu_main").removeClass("twb-hidden");
64
+ }).mouseleave(function() {
65
+ jQuery(".twb_admin_bar_menu_main").addClass("twb-hidden");
66
+ });
67
+
68
+
69
+ /* Draw circle on given scores.*/
70
+ jQuery('.twb-score-circle').each(function () {
71
+ twb_draw_score_circle(this);
72
+ });
73
+
74
+ if( jQuery(".twb_admin_bar_menu.twb_backend span").hasClass("twb_backend_optimizing_logo") ) {
75
+ /* Run ajax every 30 seconds to check if score counted */
76
+ twb_run_notif_check = setInterval( twb_run_notif_check, 30000 );
77
+ }
78
+ });
79
+
80
+ /* Run ajax to check score counting status and show notification */
81
+ function twb_run_notif_check() {
82
+ jQuery.ajax({
83
+ type: "POST",
84
+ url: twb.ajax_url,
85
+ data: {
86
+ action: "twb_notif_check",
87
+ twb_nonce: twb.nonce,
88
+ }
89
+ }).success(function (results) {
90
+ var result = jQuery.parseJSON(results);
91
+ if (result.html != "") {
92
+ /* Show notification popup and change menu icon and text from loading to Not optimised */
93
+ if ( result.changeLogo == 1 ) {
94
+ jQuery(".twb_admin_bar_menu_header span").addClass("twb_counted");
95
+ }
96
+ jQuery("#wp-admin-bar-twb_adminbar_info").append(result.html);
97
+ jQuery(".twb_admin_bar_menu_content .twb-score-container").removeClass("twb-hidden");
98
+ jQuery(".twb_admin_bar_menu_content .twb-score-container .twb-score-circle").each(function () {
99
+ twb_draw_score_circle(this);
100
+ });
101
+ clearInterval(twb_run_notif_check);
102
+ }
103
+ }).error(function () {
104
+ clearInterval(twb_run_notif_check);
105
+ });
106
+
107
+ }
108
+
109
+ function twb_disable_check() {
110
+ twb_inprogress = true;
111
+ /* Add a hover action to show disabled notification.*/
112
+ jQuery(".twb-notoptimized").hover(function () {
113
+ jQuery(this).parent().find(".twb-score-disabled-container").removeClass("twb-hidden");
114
+ },
115
+ function () {
116
+ jQuery(this).parent().find(".twb-score-disabled-container").addClass("twb-hidden");
117
+ });
118
+ }
119
+ /**
120
+ * Optimize the page.
121
+ * @param that
122
+ */
123
+ function twb_check_score(that) {
124
+ var post_id = jQuery(that).data("post_id");
125
+ var parent = jQuery(that).parent().parent().parent();
126
+ //var parent = jQuery(that).closest(".twb-score-container").parent();
127
+ /* Class add loading near admin bar menu */
128
+ jQuery(".twb_admin_bar_menu.twb_frontend").addClass("twb_score_inprogress");
129
+
130
+ /* If the action is not called with reload button.*/
131
+ if (parent.find(".twb-optimized").hasClass("twb-hidden")) {
132
+ /* Do not show loading in list.*/
133
+ parent.find(".twb-optimizing").removeClass("twb-hidden");
134
+ }
135
+ else {
136
+ /* Show loading on reload buttons.*/
137
+ parent.find(".twb-score-overlay").removeClass("twb-hidden");
138
+ parent.find(".twb-score-overlay div").removeClass("twb-reload").addClass("twb-loader");
139
+ }
140
+
141
+ parent.find(".twb-notoptimized").addClass("twb-hidden");
142
+
143
+ /* In case of Elementor */
144
+ if( parent.hasClass("twb_elementor_settings_content") ) {
145
+ jQuery(".twb_elementor_control_title").text(twb.checking).removeClass("twb_not_optimized").prepend("<span class='twb_inprogress'></span>");
146
+ }
147
+
148
+ /* Disable score check button.*/
149
+ twb_disable_check();
150
+
151
+ jQuery.ajax({
152
+ url: twb.ajax_url,
153
+ type: "POST",
154
+ dataType: 'json',
155
+ data: {
156
+ action: "twb_check_score",
157
+ post_id: post_id,
158
+ twb_nonce: twb.nonce
159
+ },
160
+ success: function (data) {
161
+ if (data.error) {
162
+ /* Show reload buttons on failure.*/
163
+ parent.find(".twb-score-overlay").removeClass("twb-hidden");
164
+ parent.find(".twb-score-overlay div").removeClass("twb-loader").addClass("twb-reload");
165
+ }
166
+ else {
167
+ parent.find(".twb-score-overlay").addClass("twb-hidden");
168
+ var desktop = parent.find(".twb-score-desktop").find(".twb-score-circle");
169
+ desktop.data(
170
+ {
171
+ "score": data.desktop_score,
172
+ "tti": data.desktop_tti,
173
+ });
174
+ twb_draw_score_circle(desktop);
175
+ var mobile = parent.find(".twb-score-mobile").find(".twb-score-circle");
176
+ mobile.data(
177
+ {
178
+ "score": data.mobile_score,
179
+ "tti": data.mobile_tti,
180
+ });
181
+ twb_draw_score_circle(mobile);
182
+ }
183
+ },
184
+ error: function (xhr, textStatus, errorThrown) {
185
+ /* Show reload buttons on failure.*/
186
+ parent.find(".twb-score-overlay").removeClass("twb-hidden");
187
+ parent.find(".twb-score-overlay div").removeClass("twb-loader").addClass("twb-reload");
188
+ },
189
+ complete: function (xhr, textStatus) {
190
+ /* Hide optimizing container, show See score container.*/
191
+ parent.find(".twb-optimizing").addClass("twb-hidden");
192
+ parent.find(".twb-optimized").removeClass("twb-hidden");
193
+
194
+ jQuery("#wpadminbar .twb-optimized .twb-score-container").removeClass("twb-hidden");
195
+ jQuery("#wpadminbar .twb_admin_bar_menu").removeClass("twb_score_inprogress");
196
+ jQuery("#wpadminbar .twb_menu_logo").remove();
197
+ jQuery("#wpadminbar .twb_not_optimized_logo").removeClass("twb-hidden");
198
+ jQuery("#wpadminbar .twb_admin_bar_menu_header").addClass("twb_not_optimized");
199
+
200
+ /* Remove disabled action.*/
201
+ twb_inprogress = false;
202
+ jQuery(".twb-notoptimized").hover(function () {
203
+ jQuery(this).parent().find(".twb-score-disabled-container").addClass("twb-hidden");
204
+ });
205
+
206
+ /* In case of Elementor */
207
+ if( parent.hasClass("twb_elementor_settings_content") ) {
208
+ jQuery(".twb_elementor_control_title").text(twb.notoptimized).remove("span.twb_inprogress").addClass("twb_not_optimized");
209
+ }
210
+ }
211
+ });
212
+ }
213
+
214
+ /**
215
+ * Draw circle on given score.
216
+ * @param that
217
+ */
218
+ function twb_draw_score_circle(that) {
219
+ var score = parseInt(jQuery(that).data('score'));
220
+ var size = parseInt(jQuery(that).data('size'));
221
+ var thickness = parseInt(jQuery(that).data('thickness'));
222
+ var color = score <= 49 ? "rgb(253, 60, 49)" : (score >= 90 ? "rgb(12, 206, 107)" : "rgb(255, 164, 0)");
223
+ jQuery(that).parent().find('.twb-load-time').html(jQuery(that).data('tti'));
224
+ var _this = that;
225
+ jQuery(_this).circleProgress({
226
+ value: score / 100,
227
+ size: size,
228
+ startAngle: -Math.PI / 4 * 2,
229
+ lineCap: 'round',
230
+ emptyFill: "rgba(255, 255, 255, 0)",
231
+ thickness: thickness,
232
+ fill: {
233
+ color: color
234
+ }
235
+ }).on('circle-animation-progress', function (event, progress) {
236
+ var content = '<span class="twb-score0"></span>';
237
+ if (score != 0) {
238
+ content = Math.round(score * progress);
239
+ }
240
+ jQuery(that).find('.twb-score-circle-animated').html(content).css({"color": color});
241
+ jQuery(that).find('canvas').html(Math.round(score * progress));
242
+ });
243
+ }
244
+
245
+ /* Adding button in Elementor edit panel navigation view */
246
+ function twb_add_elementor_button() {
247
+ window.elementor.modules.layouts.panel.pages.menu.Menu.addItem({
248
+ name: twb.title,
249
+ icon: "twb-element-menu-icon",
250
+ title: twb.title,
251
+ type: "page",
252
+ callback: () => {
253
+ try {
254
+ window.$e.route("panel/page-settings/twb_optimize")
255
+ } catch (e) {
256
+ window.$e.route("panel/page-settings/settings"), window.$e.route("panel/page-settings/twb_optimize")
257
+ }
258
+ }
259
+ }, "more")
260
+ }
261
+
262
+ jQuery(window).on("elementor:init", () => {
263
+ window.elementor.on("panel:init", () => {
264
+ setTimeout(twb_add_elementor_button)
265
+ })
266
+ });
booster/assets/js/gutenberg.js ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const { registerPlugin } = wp.plugins;
2
+ const { __ } = wp.i18n;
3
+ const { PluginDocumentSettingPanel, PluginSidebarMoreMenuItem, PluginSidebar } = wp.editPost;
4
+ const { PanelBody, PanelRow, Icon } = wp.components;
5
+ const { compose } = wp.compose;
6
+ const { withSelect, withDispatch } = wp.data;
7
+ const { useState, Fragment, useEffect } = wp.element;
8
+
9
+ const BoosterSidebarPanel = () => {
10
+ return(
11
+ <Fragment>
12
+ <PluginSidebarMoreMenuItem>{twb.cta_button.section_label}</PluginSidebarMoreMenuItem>
13
+ <PluginSidebar
14
+ title={twb.cta_button.section_label}>
15
+ <BoosterPanelRow/>
16
+ </PluginSidebar>
17
+ </Fragment>
18
+ );
19
+ }
20
+
21
+ const BoosterSettingPanel = () => {
22
+ return(
23
+ <Fragment>
24
+ <PluginDocumentSettingPanel
25
+ title={twb.cta_button.section_label}>
26
+ <BoosterPanelRow />
27
+ </PluginDocumentSettingPanel>
28
+ </Fragment>
29
+ );
30
+ }
31
+
32
+ const BoosterPanelRow = () => {
33
+ return (
34
+ <PanelRow className="twb-cont">
35
+ <OptimizeButton />
36
+ <Dismiss />
37
+ </PanelRow>);
38
+ }
39
+
40
+ const OptimizeButton = () => {
41
+ return (
42
+ <a href={twb.href}
43
+ target="_blank"
44
+ className={twb.cta_button.class + " twb-custom-button"}>{twb.cta_button.label}</a>
45
+ );
46
+ }
47
+
48
+ const Dismiss = () => {
49
+ return (
50
+ <div className="twb-dismiss-info">
51
+ <p>{__("You can hide this element from the ", "tenweb-booster")}
52
+ <a href={twb.href + "&twb_dismiss=1"} target="_blank">{__('settings', "tenweb-booster")}</a></p>
53
+ </div>
54
+ );
55
+ }
56
+
57
+ registerPlugin('booster-sidebar-panel', {
58
+ render: BoosterSidebarPanel,
59
+ icon: <svg class="twb-speed-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26">
60
+ <g id="Group_103139" data-name="Group 103139" transform="translate(0 -0.391)">
61
+ <path id="Path_171039" data-name="Path 171039"
62
+ d="M.441,38.127h0a1.445,1.445,0,0,0,2.065-.037l7.924-6.038a.131.131,0,0,0,.033-.18.126.126,0,0,0-.158-.045l-9.409,4a1.426,1.426,0,0,0-.52,2.23Z"
63
+ transform="translate(-0.028 -23.443)" fill="#fff"/>
64
+ <path id="Path_171040" data-name="Path 171040"
65
+ d="M5.434,48.088a1.443,1.443,0,0,1-2.063.039l0,0L.462,45.274l-.034-.029-.06-.063a1.427,1.427,0,0,1,.12-1.992,1.393,1.393,0,0,1,.4-.252L4.295,41.49,3.723,42a1.571,1.571,0,0,0-.163,2.191q.045.054.095.1l1.74,1.7a1.5,1.5,0,0,1,.039,2.1"
66
+ transform="translate(-0.014 -30.56)" fill="#9ea3a8"/>
67
+ <path id="Path_171041" data-name="Path 171041"
68
+ d="M69.869,43.142h0a1.445,1.445,0,0,0-2.065.037l-7.911,6.038a.131.131,0,0,0-.033.18.126.126,0,0,0,.158.045l9.4-4a1.426,1.426,0,0,0,.52-2.23Z"
69
+ transform="translate(-44.277 -31.469)" fill="#fff"/>
70
+ <path id="Path_171042" data-name="Path 171042"
71
+ d="M78,32.276a1.443,1.443,0,0,1,2.063-.039l0,0,2.907,2.851L83,35.12l.06.063a1.427,1.427,0,0,1-.12,1.992,1.393,1.393,0,0,1-.4.252l-3.407,1.448.572-.507a1.571,1.571,0,0,0,.163-2.191q-.045-.054-.095-.1l-1.742-1.7a1.5,1.5,0,0,1-.036-2.1"
72
+ transform="translate(-57.411 -23.446)" fill="#9ea3a8"/>
73
+ <path id="Path_171043" data-name="Path 171043"
74
+ d="M31.607,23.5l5.172-7.19a.126.126,0,0,0,0-.176.121.121,0,0,0-.173,0l-13.2,10.025a.131.131,0,0,0-.03.18.127.127,0,0,0,.106.055h4.143a.136.136,0,0,1,.134.139.138.138,0,0,1-.025.078L22.56,33.8a.126.126,0,0,0,0,.176.121.121,0,0,0,.173,0l13.2-10.025a.131.131,0,0,0,.03-.18.127.127,0,0,0-.106-.055H31.717a.136.136,0,0,1-.134-.139.138.138,0,0,1,.025-.078"
75
+ transform="translate(-16.668 -11.879)" fill="#9ea3a8"/>
76
+ </g>
77
+ </svg>
78
+ });
79
+ registerPlugin('booster-settings-panel', {
80
+ render: BoosterSettingPanel,
81
+ icon: ''
82
+ });
booster/assets/js/gutenberg/gutenberg-compiled.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('wp-element'), 'version' => 'daa06008b8e18dd41da8');
booster/assets/js/gutenberg/gutenberg-compiled.js ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ "@wordpress/element":
6
+ /*!*********************************!*\
7
+ !*** external ["wp","element"] ***!
8
+ \*********************************/
9
+ /***/ (function(module) {
10
+
11
+ module.exports = window["wp"]["element"];
12
+
13
+ /***/ })
14
+
15
+ /******/ });
16
+ /************************************************************************/
17
+ /******/ // The module cache
18
+ /******/ var __webpack_module_cache__ = {};
19
+ /******/
20
+ /******/ // The require function
21
+ /******/ function __webpack_require__(moduleId) {
22
+ /******/ // Check if module is in cache
23
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
24
+ /******/ if (cachedModule !== undefined) {
25
+ /******/ return cachedModule.exports;
26
+ /******/ }
27
+ /******/ // Create a new module (and put it into the cache)
28
+ /******/ var module = __webpack_module_cache__[moduleId] = {
29
+ /******/ // no module.id needed
30
+ /******/ // no module.loaded needed
31
+ /******/ exports: {}
32
+ /******/ };
33
+ /******/
34
+ /******/ // Execute the module function
35
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
36
+ /******/
37
+ /******/ // Return the exports of the module
38
+ /******/ return module.exports;
39
+ /******/ }
40
+ /******/
41
+ /************************************************************************/
42
+ /******/ /* webpack/runtime/compat get default export */
43
+ /******/ !function() {
44
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
45
+ /******/ __webpack_require__.n = function(module) {
46
+ /******/ var getter = module && module.__esModule ?
47
+ /******/ function() { return module['default']; } :
48
+ /******/ function() { return module; };
49
+ /******/ __webpack_require__.d(getter, { a: getter });
50
+ /******/ return getter;
51
+ /******/ };
52
+ /******/ }();
53
+ /******/
54
+ /******/ /* webpack/runtime/define property getters */
55
+ /******/ !function() {
56
+ /******/ // define getter functions for harmony exports
57
+ /******/ __webpack_require__.d = function(exports, definition) {
58
+ /******/ for(var key in definition) {
59
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
60
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
61
+ /******/ }
62
+ /******/ }
63
+ /******/ };
64
+ /******/ }();
65
+ /******/
66
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
67
+ /******/ !function() {
68
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
69
+ /******/ }();
70
+ /******/
71
+ /******/ /* webpack/runtime/make namespace object */
72
+ /******/ !function() {
73
+ /******/ // define __esModule on exports
74
+ /******/ __webpack_require__.r = function(exports) {
75
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
76
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
77
+ /******/ }
78
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
79
+ /******/ };
80
+ /******/ }();
81
+ /******/
82
+ /************************************************************************/
83
+ var __webpack_exports__ = {};
84
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
85
+ !function() {
86
+ /*!*********************************!*\
87
+ !*** ../assets/js/gutenberg.js ***!
88
+ \*********************************/
89
+ __webpack_require__.r(__webpack_exports__);
90
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
91
+ /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
92
+
93
+ const {
94
+ registerPlugin
95
+ } = wp.plugins;
96
+ const {
97
+ __
98
+ } = wp.i18n;
99
+ const {
100
+ PluginDocumentSettingPanel,
101
+ PluginSidebarMoreMenuItem,
102
+ PluginSidebar
103
+ } = wp.editPost;
104
+ const {
105
+ PanelBody,
106
+ PanelRow,
107
+ Icon
108
+ } = wp.components;
109
+ const {
110
+ compose
111
+ } = wp.compose;
112
+ const {
113
+ withSelect,
114
+ withDispatch
115
+ } = wp.data;
116
+ const {
117
+ useState,
118
+ Fragment,
119
+ useEffect
120
+ } = wp.element;
121
+
122
+ const BoosterSidebarPanel = () => {
123
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PluginSidebarMoreMenuItem, null, twb.cta_button.section_label), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PluginSidebar, {
124
+ title: twb.cta_button.section_label
125
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(BoosterPanelRow, null)));
126
+ };
127
+
128
+ const BoosterSettingPanel = () => {
129
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PluginDocumentSettingPanel, {
130
+ title: twb.cta_button.section_label
131
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(BoosterPanelRow, null)));
132
+ };
133
+
134
+ const BoosterPanelRow = () => {
135
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelRow, {
136
+ className: "twb-cont"
137
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(OptimizeButton, null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Dismiss, null));
138
+ };
139
+
140
+ const OptimizeButton = () => {
141
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
142
+ href: twb.href,
143
+ target: "_blank",
144
+ className: twb.cta_button.class + " twb-custom-button"
145
+ }, twb.cta_button.label);
146
+ };
147
+
148
+ const Dismiss = () => {
149
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
150
+ className: "twb-dismiss-info"
151
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, __("You can hide this element from the ", "tenweb-booster"), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
152
+ href: twb.href + "&twb_dismiss=1",
153
+ target: "_blank"
154
+ }, __('settings', "tenweb-booster"))));
155
+ };
156
+
157
+ registerPlugin('booster-sidebar-panel', {
158
+ render: BoosterSidebarPanel,
159
+ icon: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
160
+ class: "twb-speed-icon",
161
+ xmlns: "http://www.w3.org/2000/svg",
162
+ width: "26",
163
+ height: "26",
164
+ viewBox: "0 0 26 26"
165
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", {
166
+ id: "Group_103139",
167
+ "data-name": "Group 103139",
168
+ transform: "translate(0 -0.391)"
169
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
170
+ id: "Path_171039",
171
+ "data-name": "Path 171039",
172
+ d: "M.441,38.127h0a1.445,1.445,0,0,0,2.065-.037l7.924-6.038a.131.131,0,0,0,.033-.18.126.126,0,0,0-.158-.045l-9.409,4a1.426,1.426,0,0,0-.52,2.23Z",
173
+ transform: "translate(-0.028 -23.443)",
174
+ fill: "#fff"
175
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
176
+ id: "Path_171040",
177
+ "data-name": "Path 171040",
178
+ d: "M5.434,48.088a1.443,1.443,0,0,1-2.063.039l0,0L.462,45.274l-.034-.029-.06-.063a1.427,1.427,0,0,1,.12-1.992,1.393,1.393,0,0,1,.4-.252L4.295,41.49,3.723,42a1.571,1.571,0,0,0-.163,2.191q.045.054.095.1l1.74,1.7a1.5,1.5,0,0,1,.039,2.1",
179
+ transform: "translate(-0.014 -30.56)",
180
+ fill: "#9ea3a8"
181
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
182
+ id: "Path_171041",
183
+ "data-name": "Path 171041",
184
+ d: "M69.869,43.142h0a1.445,1.445,0,0,0-2.065.037l-7.911,6.038a.131.131,0,0,0-.033.18.126.126,0,0,0,.158.045l9.4-4a1.426,1.426,0,0,0,.52-2.23Z",
185
+ transform: "translate(-44.277 -31.469)",
186
+ fill: "#fff"
187
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
188
+ id: "Path_171042",
189
+ "data-name": "Path 171042",
190
+ d: "M78,32.276a1.443,1.443,0,0,1,2.063-.039l0,0,2.907,2.851L83,35.12l.06.063a1.427,1.427,0,0,1-.12,1.992,1.393,1.393,0,0,1-.4.252l-3.407,1.448.572-.507a1.571,1.571,0,0,0,.163-2.191q-.045-.054-.095-.1l-1.742-1.7a1.5,1.5,0,0,1-.036-2.1",
191
+ transform: "translate(-57.411 -23.446)",
192
+ fill: "#9ea3a8"
193
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
194
+ id: "Path_171043",
195
+ "data-name": "Path 171043",
196
+ d: "M31.607,23.5l5.172-7.19a.126.126,0,0,0,0-.176.121.121,0,0,0-.173,0l-13.2,10.025a.131.131,0,0,0-.03.18.127.127,0,0,0,.106.055h4.143a.136.136,0,0,1,.134.139.138.138,0,0,1-.025.078L22.56,33.8a.126.126,0,0,0,0,.176.121.121,0,0,0,.173,0l13.2-10.025a.131.131,0,0,0,.03-.18.127.127,0,0,0-.106-.055H31.717a.136.136,0,0,1-.134-.139.138.138,0,0,1,.025-.078",
197
+ transform: "translate(-16.668 -11.879)",
198
+ fill: "#9ea3a8"
199
+ })))
200
+ });
201
+ registerPlugin('booster-settings-panel', {
202
+ render: BoosterSettingPanel,
203
+ icon: ''
204
+ });
205
+ }();
206
+ /******/ })()
207
+ ;
208
+ //# sourceMappingURL=gutenberg-compiled.js.map
booster/assets/js/gutenberg/gutenberg-compiled.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"gutenberg-compiled.js","mappings":";;;;;;;;;;AAAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,eAAe,4BAA4B;WAC3C,eAAe;WACf,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;ACNA,MAAM;EAAEA;AAAF,IAAqBC,EAAE,CAACC,OAA9B;AACA,MAAM;EAAEC;AAAF,IAASF,EAAE,CAACG,IAAlB;AACA,MAAM;EAAEC,0BAAF;EAA8BC,yBAA9B;EAAyDC;AAAzD,IAA2EN,EAAE,CAACO,QAApF;AACA,MAAM;EAAEC,SAAF;EAAaC,QAAb;EAAuBC;AAAvB,IAAgCV,EAAE,CAACW,UAAzC;AACA,MAAM;EAAEC;AAAF,IAAcZ,EAAE,CAACY,OAAvB;AACA,MAAM;EAAEC,UAAF;EAAcC;AAAd,IAA+Bd,EAAE,CAACe,IAAxC;AACA,MAAM;EAAEC,QAAF;EAAYC,QAAZ;EAAsBC;AAAtB,IAAoClB,EAAE,CAACmB,OAA7C;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;EAChC,OACE,kEAAC,QAAD,QACE,kEAAC,yBAAD,QAA4BC,GAAG,CAACC,UAAJ,CAAeC,aAA3C,CADF,EAEE,kEAAC,aAAD;IACE,KAAK,EAAEF,GAAG,CAACC,UAAJ,CAAeC;EADxB,GAEE,kEAAC,eAAD,OAFF,CAFF,CADF;AASD,CAVD;;AAYA,MAAMC,mBAAmB,GAAG,MAAM;EAChC,OACE,kEAAC,QAAD,QACE,kEAAC,0BAAD;IACE,KAAK,EAAEH,GAAG,CAACC,UAAJ,CAAeC;EADxB,GAEE,kEAAC,eAAD,OAFF,CADF,CADF;AAQD,CATD;;AAWA,MAAME,eAAe,GAAG,MAAM;EAC5B,OACE,kEAAC,QAAD;IAAU,SAAS,EAAC;EAApB,GACE,kEAAC,cAAD,OADF,EAEE,kEAAC,OAAD,OAFF,CADF;AAKD,CAND;;AAQA,MAAMC,cAAc,GAAG,MAAM;EAC3B,OACE;IAAG,IAAI,EAAEL,GAAG,CAACM,IAAb;IACG,MAAM,EAAC,QADV;IAEG,SAAS,EAAEN,GAAG,CAACC,UAAJ,CAAeM,KAAf,GAAuB;EAFrC,GAE4DP,GAAG,CAACC,UAAJ,CAAeO,KAF3E,CADF;AAKD,CAND;;AAQA,MAAMC,OAAO,GAAG,MAAM;EACpB,OACE;IAAK,SAAS,EAAC;EAAf,GACE,6EAAI5B,EAAE,CAAC,qCAAD,EAAwC,gBAAxC,CAAN,EACE;IAAG,IAAI,EAAEmB,GAAG,CAACM,IAAJ,GAAW,gBAApB;IAAsC,MAAM,EAAC;EAA7C,GAAuDzB,EAAE,CAAC,UAAD,EAAa,gBAAb,CAAzD,CADF,CADF,CADF;AAMD,CAPD;;AASAH,cAAc,CAAC,uBAAD,EAA0B;EACtCgC,MAAM,EAAEX,mBAD8B;EAEtCY,IAAI,EAAE;IAAK,KAAK,EAAC,gBAAX;IAA4B,KAAK,EAAC,4BAAlC;IAA+D,KAAK,EAAC,IAArE;IAA0E,MAAM,EAAC,IAAjF;IAAsF,OAAO,EAAC;EAA9F,GACJ;IAAG,EAAE,EAAC,cAAN;IAAqB,aAAU,cAA/B;IAA8C,SAAS,EAAC;EAAxD,GACE;IAAM,EAAE,EAAC,aAAT;IAAuB,aAAU,aAAjC;IACM,CAAC,EAAC,8IADR;IAEM,SAAS,EAAC,2BAFhB;IAE4C,IAAI,EAAC;EAFjD,EADF,EAIE;IAAM,EAAE,EAAC,aAAT;IAAuB,aAAU,aAAjC;IACM,CAAC,EAAC,sOADR;IAEM,SAAS,EAAC,0BAFhB;IAE2C,IAAI,EAAC;EAFhD,EAJF,EAOE;IAAM,EAAE,EAAC,aAAT;IAAuB,aAAU,aAAjC;IACM,CAAC,EAAC,2IADR;IAEM,SAAS,EAAC,4BAFhB;IAE6C,IAAI,EAAC;EAFlD,EAPF,EAUE;IAAM,EAAE,EAAC,aAAT;IAAuB,aAAU,aAAjC;IACM,CAAC,EAAC,uOADR;IAEM,SAAS,EAAC,4BAFhB;IAE6C,IAAI,EAAC;EAFlD,EAVF,EAaE;IAAM,EAAE,EAAC,aAAT;IAAuB,aAAU,aAAjC;IACM,CAAC,EAAC,4VADR;IAEM,SAAS,EAAC,4BAFhB;IAE6C,IAAI,EAAC;EAFlD,EAbF,CADI;AAFgC,CAA1B,CAAd;AAsBAjC,cAAc,CAAC,wBAAD,EAA2B;EACvCgC,MAAM,EAAEP,mBAD+B;EAEvCQ,IAAI,EAAE;AAFiC,CAA3B,CAAd,C","sources":["webpack:///external window [\"wp\",\"element\"]","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///../assets/js/gutenberg.js"],"sourcesContent":["module.exports = window[\"wp\"][\"element\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const { registerPlugin } = wp.plugins;\r\nconst { __ } = wp.i18n;\r\nconst { PluginDocumentSettingPanel, PluginSidebarMoreMenuItem, PluginSidebar } = wp.editPost;\r\nconst { PanelBody, PanelRow, Icon } = wp.components;\r\nconst { compose } = wp.compose;\r\nconst { withSelect, withDispatch } = wp.data;\r\nconst { useState, Fragment, useEffect } = wp.element;\r\n\r\nconst BoosterSidebarPanel = () => {\r\n return(\r\n <Fragment>\r\n <PluginSidebarMoreMenuItem>{twb.cta_button.section_label}</PluginSidebarMoreMenuItem>\r\n <PluginSidebar\r\n title={twb.cta_button.section_label}>\r\n <BoosterPanelRow/>\r\n </PluginSidebar>\r\n </Fragment>\r\n );\r\n}\r\n\r\nconst BoosterSettingPanel = () => {\r\n return(\r\n <Fragment>\r\n <PluginDocumentSettingPanel\r\n title={twb.cta_button.section_label}>\r\n <BoosterPanelRow />\r\n </PluginDocumentSettingPanel>\r\n </Fragment>\r\n );\r\n}\r\n\r\nconst BoosterPanelRow = () => {\r\n return (\r\n <PanelRow className=\"twb-cont\">\r\n <OptimizeButton />\r\n <Dismiss />\r\n </PanelRow>);\r\n}\r\n\r\nconst OptimizeButton = () => {\r\n return (\r\n <a href={twb.href}\r\n target=\"_blank\"\r\n className={twb.cta_button.class + \" twb-custom-button\"}>{twb.cta_button.label}</a>\r\n );\r\n}\r\n\r\nconst Dismiss = () => {\r\n return (\r\n <div className=\"twb-dismiss-info\">\r\n <p>{__(\"You can hide this element from the \", \"tenweb-booster\")}\r\n <a href={twb.href + \"&twb_dismiss=1\"} target=\"_blank\">{__('settings', \"tenweb-booster\")}</a></p>\r\n </div>\r\n );\r\n}\r\n\r\nregisterPlugin('booster-sidebar-panel', {\r\n render: BoosterSidebarPanel,\r\n icon: <svg class=\"twb-speed-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"26\" viewBox=\"0 0 26 26\">\r\n <g id=\"Group_103139\" data-name=\"Group 103139\" transform=\"translate(0 -0.391)\">\r\n <path id=\"Path_171039\" data-name=\"Path 171039\"\r\n d=\"M.441,38.127h0a1.445,1.445,0,0,0,2.065-.037l7.924-6.038a.131.131,0,0,0,.033-.18.126.126,0,0,0-.158-.045l-9.409,4a1.426,1.426,0,0,0-.52,2.23Z\"\r\n transform=\"translate(-0.028 -23.443)\" fill=\"#fff\"/>\r\n <path id=\"Path_171040\" data-name=\"Path 171040\"\r\n d=\"M5.434,48.088a1.443,1.443,0,0,1-2.063.039l0,0L.462,45.274l-.034-.029-.06-.063a1.427,1.427,0,0,1,.12-1.992,1.393,1.393,0,0,1,.4-.252L4.295,41.49,3.723,42a1.571,1.571,0,0,0-.163,2.191q.045.054.095.1l1.74,1.7a1.5,1.5,0,0,1,.039,2.1\"\r\n transform=\"translate(-0.014 -30.56)\" fill=\"#9ea3a8\"/>\r\n <path id=\"Path_171041\" data-name=\"Path 171041\"\r\n d=\"M69.869,43.142h0a1.445,1.445,0,0,0-2.065.037l-7.911,6.038a.131.131,0,0,0-.033.18.126.126,0,0,0,.158.045l9.4-4a1.426,1.426,0,0,0,.52-2.23Z\"\r\n transform=\"translate(-44.277 -31.469)\" fill=\"#fff\"/>\r\n <path id=\"Path_171042\" data-name=\"Path 171042\"\r\n d=\"M78,32.276a1.443,1.443,0,0,1,2.063-.039l0,0,2.907,2.851L83,35.12l.06.063a1.427,1.427,0,0,1-.12,1.992,1.393,1.393,0,0,1-.4.252l-3.407,1.448.572-.507a1.571,1.571,0,0,0,.163-2.191q-.045-.054-.095-.1l-1.742-1.7a1.5,1.5,0,0,1-.036-2.1\"\r\n transform=\"translate(-57.411 -23.446)\" fill=\"#9ea3a8\"/>\r\n <path id=\"Path_171043\" data-name=\"Path 171043\"\r\n d=\"M31.607,23.5l5.172-7.19a.126.126,0,0,0,0-.176.121.121,0,0,0-.173,0l-13.2,10.025a.131.131,0,0,0-.03.18.127.127,0,0,0,.106.055h4.143a.136.136,0,0,1,.134.139.138.138,0,0,1-.025.078L22.56,33.8a.126.126,0,0,0,0,.176.121.121,0,0,0,.173,0l13.2-10.025a.131.131,0,0,0,.03-.18.127.127,0,0,0-.106-.055H31.717a.136.136,0,0,1-.134-.139.138.138,0,0,1,.025-.078\"\r\n transform=\"translate(-16.668 -11.879)\" fill=\"#9ea3a8\"/>\r\n </g>\r\n </svg>\r\n});\r\nregisterPlugin('booster-settings-panel', {\r\n render: BoosterSettingPanel,\r\n icon: ''\r\n});"],"names":["registerPlugin","wp","plugins","__","i18n","PluginDocumentSettingPanel","PluginSidebarMoreMenuItem","PluginSidebar","editPost","PanelBody","PanelRow","Icon","components","compose","withSelect","withDispatch","data","useState","Fragment","useEffect","element","BoosterSidebarPanel","twb","cta_button","section_label","BoosterSettingPanel","BoosterPanelRow","OptimizeButton","href","class","label","Dismiss","render","icon"],"sourceRoot":""}
booster/assets/js/speed.js ADDED
@@ -0,0 +1,452 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function () {
2
+ jQuery(".twb-analyze-input-button").on("click", function () {
3
+ if ( !jQuery(this).hasClass("twb-disable-analyze") ) {
4
+ twb_get_google_score(this, '', '');
5
+ }
6
+ });
7
+
8
+ jQuery(document).on('change', '.twb-analyze-input', function () {
9
+ analize_input_change();
10
+ });
11
+
12
+ /* If there is no score of home page run google score and get homepage score */
13
+ if ( twb.home_speed_status === '0' ) {
14
+ twb_get_google_score('', twb.home_url, '');
15
+ }
16
+ else {
17
+ /* Draw score circle if it is Speed Optimization page */
18
+ if( jQuery(".twb-analyze-desktop-score .speed_circle").length > 0 ) {
19
+ if (typeof twb.home_speed_status.desktop_score != "undefined") {
20
+ draw_score_circle(twb.home_speed_status.desktop_score, twb.home_speed_status.mobile_score);
21
+ }
22
+ }
23
+ }
24
+
25
+ get_total_size_of_images();
26
+ if ( twb.compressed_pages_status === "0" ) {
27
+ set_compressed_pages();
28
+ }
29
+
30
+ /* Bind an action to enable/disable CTAs.*/
31
+ jQuery("#twb-show-cta").on("click", function () {
32
+ if ( jQuery(this).attr("disabled") ) {
33
+ return;
34
+ } else {
35
+ jQuery(this).attr("disabled", true);
36
+ }
37
+ var show_cta = 0;
38
+ if ( jQuery(this).prop("checked") ){
39
+ show_cta = 1;
40
+ }
41
+ jQuery.ajax( {
42
+ url: ajaxurl,
43
+ type: "POST",
44
+ data: {
45
+ action: "twb",
46
+ task: "set_show_cta",
47
+ show_cta: show_cta,
48
+ speed_ajax_nonce: twb.speed_ajax_nonce
49
+ },
50
+ complete: function () {
51
+ jQuery("#twb-show-cta").removeAttr("disabled");
52
+ },
53
+ });
54
+ })
55
+ });
56
+
57
+ /* Count total size of images. */
58
+ function set_compressed_pages() {
59
+ jQuery.ajax( {
60
+ url: ajaxurl,
61
+ type: "POST",
62
+ data: {
63
+ action: "twb",
64
+ task: "set_compressed_pages",
65
+ speed_ajax_nonce: twb.speed_ajax_nonce
66
+ },
67
+ success: function ( result ) {
68
+ },
69
+ });
70
+ }
71
+
72
+ /* Count total size of images. */
73
+ function get_total_size_of_images() {
74
+ jQuery.ajax( {
75
+ url: ajaxurl,
76
+ type: "POST",
77
+ data: {
78
+ action: "twb",
79
+ task: "get_total_size_of_images",
80
+ speed_ajax_nonce: twb.speed_ajax_nonce
81
+ },
82
+ success: function ( result ) {
83
+ if( isValidJSONString(result) ) {
84
+ var data = JSON.parse(result);
85
+ jQuery(".twb-total_size_value").text(data.size);
86
+ }
87
+ },
88
+ });
89
+ }
90
+
91
+ function analize_input_change() {
92
+ var twb_analyze_input = jQuery(".twb-analyze-input");
93
+ twb_analyze_input.removeClass("twb-analyze-input-error");
94
+ jQuery(".twb-analyze-input-button").removeClass("twb-disable-analyze");
95
+ jQuery(".twb-analyze-input-container .twb-error-msg").remove();
96
+ var domain = twb.home_url.replace(/^https?:\/\/|www./g, '');
97
+ var url = twb_analyze_input.val();
98
+ var page_public = twb_analyze_input.data('page-public');
99
+
100
+ var error = false;
101
+ var error_msg = '';
102
+ if( url == '' ) {
103
+ error = true;
104
+ error_msg = twb.enter_page_url;
105
+ }
106
+ else if ( !isUrlValid(url) ) {
107
+ error = true;
108
+ error_msg = twb.wrong_url;
109
+ }
110
+ else if ( !url.includes(domain) ) {
111
+ error = true;
112
+ error_msg = twb.wrong_domain_url;
113
+ }
114
+ else if ( page_public === 0 ) {
115
+ error = true;
116
+ error_msg = twb.page_is_not_public;
117
+ }
118
+
119
+
120
+ if ( error === true ) {
121
+ jQuery(".twb-analyze-input-button").addClass("twb-disable-analyze");
122
+ jQuery(".twb-analyze-input").addClass("twb-analyze-input-error");
123
+ jQuery(".twb-analyze-input").after('<p class="twb-error-msg">' + error_msg + '</p>');
124
+ }
125
+
126
+ }
127
+
128
+ /**
129
+ * Install/activate the plugin.
130
+ *
131
+ * @param that object
132
+ */
133
+ function twb_install_plugin( that ) {
134
+ if ( jQuery(that).hasClass("twb-disable-link") ) {
135
+ return false;
136
+ }
137
+ jQuery(that).addClass('twb-disable-link');
138
+ jQuery(that).html('<div class="speed-loader-blue"></div>');
139
+ jQuery.ajax( {
140
+ url: ajaxurl,
141
+ type: "POST",
142
+ dataType: "text",
143
+ data: {
144
+ action: "twb",
145
+ task: "install_booster",
146
+ speed_ajax_nonce: twb.speed_ajax_nonce
147
+ },
148
+ success: function ( data ) {
149
+ jQuery(".twb-speed-header").html(data).find(".wrap").remove();
150
+ jQuery(".twb-speed-footer").remove();
151
+ }
152
+ });
153
+ }
154
+
155
+ /**
156
+ * Run ajax action and Sign Up to dashboard
157
+ *
158
+ * @param that object
159
+ */
160
+ function twb_sign_up_dashboard( that ) {
161
+ if ( jQuery(that).hasClass("twb-disable-link") ) {
162
+ return false;
163
+ }
164
+
165
+ var email_input = jQuery(that).parent().parent().find(".twb-sign-up-input");
166
+ var parent_slug = jQuery(that).data("parent_slug");
167
+ var slug = jQuery(that).data("slug");
168
+ var is_plugin = jQuery(that).data("is_plugin");
169
+
170
+ jQuery(".twb-error-msg").remove();
171
+ email_input.removeClass("twb-input-error");
172
+ jQuery(that).addClass('twb-disable-link');
173
+ jQuery(that).html('<div class="speed-loader-blue"></div>');
174
+
175
+ var email = email_input.val();
176
+ if (email === '') {
177
+ email_input.after('<p class="twb-error-msg">' + twb.empty_email + '</p>');
178
+ email_input.addClass("twb-input-error");
179
+ jQuery(that).text(twb.sign_up);
180
+ jQuery(that).removeClass('twb-disable-link');
181
+ return;
182
+ }
183
+ if (!isEmail(email)) {
184
+ email_input.after('<p class="twb-error-msg">' + twb.wrong_email + '</p>');
185
+ email_input.addClass("twb-input-error");
186
+ jQuery(that).text(twb.sign_up);
187
+ jQuery(that).removeClass('twb-disable-link');
188
+ return;
189
+ }
190
+ jQuery.ajax( {
191
+ url: ajaxurl,
192
+ type: "POST",
193
+ dataType: "text",
194
+ data: {
195
+ action: "twb",
196
+ task: "sign_up_dashboard",
197
+ twb_email: email,
198
+ parent_slug: parent_slug,
199
+ slug: slug,
200
+ is_plugin: is_plugin,
201
+ speed_ajax_nonce: twb.speed_ajax_nonce
202
+ },
203
+ success: function (result) {
204
+ if ( !isValidJSONString(result) ) {
205
+ jQuery(that).text(twb.sign_up);
206
+ jQuery(that).removeClass('twb-disable-link');
207
+ email_input.after('<p class="twb-error-msg">' + twb.something_wrong + '</p>');
208
+ return;
209
+ }
210
+ var data = JSON.parse(result);
211
+ if ( data['status'] === 'success' ) {
212
+ window.location.href = data['booster_connect_url'];
213
+ }
214
+ else {
215
+ jQuery(that).text(twb.sign_up);
216
+ jQuery(that).removeClass('twb-disable-link');
217
+ email_input.after('<p class="twb-error-msg">' + twb.something_wrong + '</p>');
218
+ return;
219
+ }
220
+ },
221
+ error: function (xhr) {
222
+ jQuery(that).text(twb.sign_up);
223
+ jQuery(that).removeClass('twb-disable-link');
224
+ email_input.after('<p class="twb-error-msg">' + twb.something_wrong + '</p>');
225
+ }
226
+ });
227
+ }
228
+
229
+ function twb_connect_to_dashboard( that ) {
230
+ if ( jQuery(that).hasClass("twb-disable-link") ) {
231
+ return false;
232
+ }
233
+
234
+ jQuery.ajax( {
235
+ url: ajaxurl,
236
+ type: "POST",
237
+ data: {
238
+ action: "twb",
239
+ task: "connect_to_dashboard",
240
+ speed_ajax_nonce: twb.speed_ajax_nonce
241
+ },
242
+ success: function ( result ) {
243
+ if ( !isValidJSONString(result) ) {
244
+ jQuery(that).text(twb.connect);
245
+ jQuery(that).removeClass('twb-disable-link');
246
+ return;
247
+ }
248
+ var data = JSON.parse(result);
249
+ if ( data['status'] === 'success' ) {
250
+ window.location.href = data['booster_connect_url'];
251
+ } else {
252
+ jQuery(that).text(twb.connect);
253
+ jQuery(that).removeClass('twb-disable-link');
254
+ return;
255
+ }
256
+ },
257
+ error: function ( xhr ) {
258
+ jQuery(that).text(twb.connect);
259
+ jQuery(that).removeClass('twb-disable-link');
260
+ }
261
+ });
262
+ }
263
+
264
+ /**
265
+ * Drawing score circle in different colors
266
+ *
267
+ * @param desktop_score int score value of desktop
268
+ * @param mobile_score int score value of desktop
269
+ */
270
+ function draw_score_circle( desktop_score, mobile_score ) {
271
+ var d = desktop_score;
272
+ var m = mobile_score;
273
+ var color_desktop = d <= 49 ? "rgb(253, 60, 49)" : (d >= 90 ? "rgb(12, 206, 107)" : "rgb(255, 164, 0)");
274
+ var color_mobile = m <= 49 ? "rgb(253, 60, 49)" : (m >= 90 ? "rgb(12, 206, 107)" : "rgb(255, 164, 0)");
275
+ var bg_color_desktop = d <= 49 ? "rgb(253, 60, 49, 0.1)" : (d >= 90 ? "rgb(12, 206, 107, 0.1)" : "rgb(255, 164, 0, 0.1)");
276
+ var bg_color_mobile = m <= 49 ? "rgb(253, 60, 49, 0.1)" : (m >= 90 ? "rgb(12, 206, 107, 0.1)" : "rgb(255, 164, 0, 0.1)");
277
+
278
+ jQuery('.speed_circle').each(function () {
279
+ var _this = this;
280
+ var val = desktop_score / 100;
281
+ var num = d;
282
+ var color = color_desktop;
283
+ var bg_color = bg_color_desktop;
284
+ if ( jQuery(this).data("id") === "mobile" ) {
285
+ val = mobile_score / 100;
286
+ num = m;
287
+ color = color_mobile;
288
+ bg_color = bg_color_mobile;
289
+ }
290
+ jQuery(_this).circleProgress({
291
+ value: val,
292
+ size: 78,
293
+ startAngle: -Math.PI / 4 * 2,
294
+ lineCap: 'round',
295
+ emptyFill: "rgba(255, 255, 255, 0)",
296
+ fill: {
297
+ color: color
298
+ }
299
+ }).on('circle-animation-progress', function ( event, progress ) {
300
+ jQuery(this).find('.circle_animated').html(Math.round(parseFloat(num) * progress)).css({"color": color});
301
+ jQuery(this).find('canvas').html(Math.round(parseFloat(num) * progress)).css({ "background": bg_color });
302
+ });
303
+ });
304
+ }
305
+
306
+ /**
307
+ * Run ajax action and count google score.
308
+ *
309
+ * @param that object
310
+ * @param url string
311
+ * @param last_api_key_index int/empty last index of array where keeped google api keys
312
+ */
313
+ function twb_get_google_score( that, url, last_api_key_index ) {
314
+ jQuery(".twb-error-msg").remove();
315
+ if (url === '') {
316
+ if (jQuery(that).hasClass("twb-disable-link")) {
317
+ return false;
318
+ }
319
+ jQuery(that).addClass('twb-disable-analyze');
320
+ jQuery(that).html('<div class="speed-loader-grey"></div>');
321
+ url = jQuery(".twb-analyze-input").val();
322
+ }
323
+
324
+ if (!isUrlValid(url)) {
325
+ jQuery(".twb-analyze-input").after('<p class="twb-error-msg">' + twb.wrong_url + '</p>');
326
+ jQuery(".twb-analyze-input-button").removeClass('twb-disable-analyze');
327
+ jQuery(".twb-analyze-input-button").text(twb.analyze_button_text);
328
+ return;
329
+ }
330
+ if ( jQuery(".speed_circle_loader").length === 0 ) {
331
+ jQuery(".speed_circle").after("<div class='speed_circle_loader'></div>");
332
+ }
333
+ jQuery(".speed_circle").addClass("twb-hidden");
334
+ jQuery(".twb-load-time-mobile span").text("-");
335
+ jQuery(".twb-load-time-desktop span").text("-");
336
+ jQuery.ajax({
337
+ url: ajaxurl,
338
+ type: "POST",
339
+ data: {
340
+ action: "twb",
341
+ task: "get_google_page_speed",
342
+ last_api_key_index: last_api_key_index,
343
+ twb_url: url,
344
+ speed_ajax_nonce: twb.speed_ajax_nonce
345
+ },
346
+ success: function (result) {
347
+ if( !isValidJSONString(result) ) {
348
+ google_speed_error_result('');
349
+ return;
350
+ } else {
351
+ var data = JSON.parse(result);
352
+ if ( data['error'] === 1 ) {
353
+ if ( typeof data['last_api_key_index'] !== 'undefined' ) {
354
+ twb_get_google_score(that, twb.home_url, data['last_api_key_index'] );
355
+ return;
356
+ }
357
+ var msg = '';
358
+ if( typeof data['msg'] !== 'undefined') {
359
+ msg = data['msg'];
360
+ }
361
+ google_speed_error_result(msg);
362
+ return;
363
+ }
364
+ }
365
+
366
+ jQuery(".speed_circle_loader").remove();
367
+ jQuery(".speed_circle").removeClass("twb-hidden");
368
+ draw_score_circle(data['desktop_score'], data['mobile_score']);
369
+ jQuery(".twb-last-analyzed-page").text(url);
370
+ jQuery(".twb-last-analyzed-date").text(data['last_analyzed_time']);
371
+ jQuery(".twb-load-time-mobile span").text(data['mobile_loading_time']);
372
+ jQuery(".twb-load-time-desktop span").text(data['desktop_loading_time']);
373
+ },
374
+ error: function (xhr) {
375
+ google_speed_error_result('');
376
+ },
377
+ complete: function () {
378
+ jQuery('.twb-analyze-input-button.twb-disable-analyze').removeClass('twb-disable-analyze');
379
+ jQuery('.twb-analyze-input-button').text(twb.analyze_button_text);
380
+ }
381
+ });
382
+ }
383
+
384
+ /* Case when counting of score returns error. */
385
+ function google_speed_error_result( msg ) {
386
+ if ( msg !== '' ) {
387
+ twb.something_wrong = msg;
388
+ }
389
+ jQuery(".twb-analyze-input").after('<p class="twb-error-msg">' + twb.something_wrong + '</p>');
390
+ jQuery('.twb-analyze-input-button.twb-disable-analyze').removeClass('twb-disable-analyze');
391
+ jQuery('.twb-analyze-input-button').text(twb.analyze_button_text);
392
+ jQuery(".speed_circle_loader").remove();
393
+ jQuery(".speed_circle").removeClass("twb-hidden");
394
+ }
395
+
396
+ /**
397
+ * Check if value is email
398
+ *
399
+ * @param email string
400
+ *
401
+ * @return bool
402
+ */
403
+ function isEmail( email ) {
404
+ var EmailRegex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
405
+ return EmailRegex.test(email);
406
+ }
407
+
408
+ /**
409
+ * Check if value is URL
410
+ *
411
+ * @param url string
412
+ *
413
+ * @return bool
414
+ */
415
+ function isUrlValid(url) {
416
+ if (typeof url == 'undefined' || url == '') {
417
+ return false;
418
+ }
419
+ if ( url.indexOf("http") !== 0 && url.indexOf("www.") !== 0) {
420
+ return false;
421
+ }
422
+ regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/;
423
+ if (regexp.test(url)) {
424
+ return true;
425
+ } else {
426
+ return false;
427
+ }
428
+ }
429
+
430
+ /**
431
+ * Check if data is valid json
432
+ *
433
+ * @param str string
434
+ *
435
+ * @return bool
436
+ */
437
+ function isValidJSONString(str) {
438
+ try {
439
+ JSON.parse(str);
440
+ } catch (e) {
441
+ return false;
442
+ }
443
+ return true;
444
+ }
445
+
446
+ //var twb_leaving_popup = false;
447
+
448
+ //jQuery(".twb-speed-body").parents(".wrap").mouseleave(function () {
449
+ // if (twb_leaving_popup == false && jQuery(".twb-sign-up-input").is(":visible")) {
450
+ // jQuery(".twb-popup-overlay").removeClass("twb-hidden");
451
+ // }
452
+ //});
booster/controller.php ADDED
@@ -0,0 +1,641 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class SpeedController_twb
5
+ */
6
+ class BoosterController {
7
+ private $booster;
8
+ private $model;
9
+ private $view;
10
+
11
+ const PlUGIN_FILE = 'tenweb-speed-optimizer/tenweb_speed_optimizer.php';
12
+
13
+ const PLUGIN_ZIP = 'https://downloads.wordpress.org/plugin/tenweb-speed-optimizer.latest-stable.zip';
14
+
15
+ private $google_api_keys = array(
16
+ 'AIzaSyCQmF4ZSbZB8prjxci3GWVK4UWc-Yv7vbw',
17
+ 'AIzaSyAgXPc9Yp0auiap8L6BsHWoSVzkSYgHdrs',
18
+ 'AIzaSyCftPiteYkBsC2hamGbGax5D9JQ4CzexPU',
19
+ 'AIzaSyC-6oKLqdvufJnysAxd0O56VgZrCgyNMHg',
20
+ 'AIzaSyB1QHYGZZ6JIuUUce4VyBt5gF_-LwI5Xsk'
21
+ );
22
+
23
+ public function __construct($booster) {
24
+ $this->booster = $booster;
25
+ }
26
+
27
+ /**
28
+ * Execute.
29
+ */
30
+ public function execute($task = '', $params = array()) {
31
+ require_once($this->booster->plugin_dir . '/model.php');
32
+ $this->model = new BoosterModel();
33
+ require_once($this->booster->plugin_dir . '/view.php');
34
+ $this->view = new BoosterView();
35
+ if ( !$task ) {
36
+ $task = isset($_GET['task']) ? sanitize_text_field($_GET['task']) : (isset($_POST['task']) ? sanitize_text_field($_POST['task']) : '');
37
+ }
38
+ if ( $task != 'display' && method_exists($this, $task) ) {
39
+ $this->$task($params);
40
+ }
41
+ else {
42
+ $this->display();
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Display.
48
+ */
49
+ public function display() {
50
+ $params = array();
51
+ $params['twb_dismiss'] = isset($_GET['twb_dismiss']) ? intval($_GET['twb_dismiss']) : 0;
52
+ $params['submenu_section_optimize_images'] = $this->booster->page['section_optimize_images'];
53
+ $params['section_booster_title'] = $this->booster->page['section_booster_title'];
54
+ $params['section_booster_desc'] = $this->booster->page['section_booster_desc'];
55
+ $params['section_booster_success_title'] = $this->booster->page['section_booster_success_title'];
56
+ $params['section_booster_success_desc'] = $this->booster->page['section_booster_success_desc'];
57
+ $params['section_analyze_desc'] = $this->booster->page['section_analyze_desc'];
58
+ $params['submenu_section_analyze'] = $this->booster->page['section_analyze'];
59
+ $params['booster_plugin_status'] = $this->booster->booster_plugin_status;
60
+ $params['status'] = $this->booster->status;
61
+ $params['booster_is_connected'] = $this->booster->booster_is_connected;
62
+ $params['tenweb_is_paid'] = $this->booster->is_paid;
63
+ $params['is_plugin'] = $this->booster->is_plugin;
64
+ $params['submenu_parent_slug'] = $this->booster->submenu['parent_slug'];
65
+ $params['slug'] = $this->booster->slug;
66
+ $params['show_cta'] = $this->booster->show_cta;
67
+ $params['show_cta_option'] = $this->booster->show_cta_option;
68
+
69
+ $params['images_count'] = $this->get_images_count();
70
+ $params['images_total_size'] = get_option('twb_images_total_size', '0 KB');
71
+
72
+ $params['page_is_public'] = TRUE;
73
+
74
+ $twb_speed_score = get_option('twb_speed_score');
75
+ $data = array(
76
+ 'url' => get_home_url(),
77
+ 'desktop_score' => 0,
78
+ 'desktop_loading_time' => 0,
79
+ 'mobile_score' => 0,
80
+ 'mobile_loading_time' => 0,
81
+ 'last_analyzed_time' => '',
82
+ );
83
+ if ( !empty($twb_speed_score) && !empty($twb_speed_score['last']) && !empty($twb_speed_score['last']['url']) ) {
84
+ $last_url = $twb_speed_score['last']['url'];
85
+ if ( !empty($twb_speed_score[$last_url]['desktop_score'])
86
+ && !empty($twb_speed_score[$last_url]['desktop_loading_time'])
87
+ && !empty($twb_speed_score[$last_url]['mobile_score'])
88
+ && !empty($twb_speed_score[$last_url]['mobile_loading_time'])
89
+ && !empty($twb_speed_score[$last_url]['last_analyzed_time']) ) {
90
+ $data = array(
91
+ 'url' => $last_url,
92
+ 'desktop_score' => $twb_speed_score[$last_url]['desktop_score'],
93
+ 'desktop_loading_time' => $twb_speed_score[$last_url]['desktop_loading_time'],
94
+ 'mobile_score' => $twb_speed_score[$last_url]['mobile_score'],
95
+ 'mobile_loading_time' => $twb_speed_score[$last_url]['mobile_loading_time'],
96
+ 'last_analyzed_time' => $twb_speed_score[$last_url]['last_analyzed_time'],
97
+ );
98
+ }
99
+ }
100
+
101
+ $params['twb_speed_score'] = $data;
102
+ $domain_id = get_site_option('tenweb_domain_id');
103
+ $params['dashboard_booster_url'] = '';
104
+ if ( defined("TENWEB_DASHBOARD") && !empty($domain_id) ) {
105
+ $params['dashboard_booster_url'] = trim(TENWEB_DASHBOARD, '/') . '/websites/' . $domain_id . '/booster/frontend';
106
+ }
107
+
108
+ $params['pages_compressed'] = $this->get_pages_compressed($params);
109
+
110
+ $params['twb_dismiss'] = (isset($_GET['twb_dismiss']) && $_GET['twb_dismiss'] == 1) ? $_GET['twb_dismiss'] : 0;
111
+
112
+ $this->view->display($params);
113
+ }
114
+
115
+ /**
116
+ * Run function as ajax action and keep optimized images data in DB option
117
+ * Endpoint work once a day to prevent page loading time
118
+ */
119
+ public function set_compressed_pages() {
120
+ $twb_optimized_pages = get_transient("twb_optimized_pages");
121
+
122
+ if ( !empty($twb_optimized_pages) || !defined('TENWEBIO_MANAGER_PREFIX') ) {
123
+ die;
124
+ }
125
+
126
+ $workspace_id = (int) get_site_option(TENWEBIO_MANAGER_PREFIX . '_workspace_id', 0);
127
+ $domain_id = (int) get_option(TENWEBIO_MANAGER_PREFIX . '_domain_id', 0);
128
+ if ( $this->booster->booster_is_connected ||
129
+ $this->booster->is_paid ||
130
+ $workspace_id == 0 ||
131
+ $domain_id == 0 ||
132
+ !defined('TENWEBIO_API_URL')) {
133
+ die;
134
+ }
135
+
136
+ $url = TENWEBIO_API_URL . "/compress/workspaces/" . $workspace_id . "/domains/" . $domain_id."/stat";
137
+ $access_token = get_site_option('tenweb_access_token');
138
+
139
+ $args = array(
140
+ 'timeout' => 50,
141
+ 'headers' => array(
142
+ "accept" => "application/x.10weboptimizer.v3+json",
143
+ "authorization" => "Bearer " . $access_token,
144
+ ),
145
+ );
146
+ $response = wp_remote_get($url, $args);
147
+ if ( is_array($response) && !is_wp_error($response) ) {
148
+ $body = json_decode( $response['body'], 1 );
149
+ if ( isset($body['status']) && $body['status'] == 200 ) {
150
+ $data = $body['data'];
151
+ $total_not_compressed_images_size = isset($data['not_compressed']['total_size']) ? $data['not_compressed']['total_size'] : 0;
152
+ $total_not_compressed_images_size = TWBLibrary::formatBytes($total_not_compressed_images_size);
153
+ $total_not_compressed_images_count = intval($data['not_compressed']['full'] + $data['not_compressed']['thumbs'] + $data['not_compressed']['other']);
154
+
155
+ $pages_compressed_api = $data['pages_compressed'];
156
+
157
+ $twb_optimized_pages = array();
158
+ if ( class_exists('\TenWebOptimizer\OptimizerUtils') ) {
159
+ $twb_optimized_pages = \TenWebOptimizer\OptimizerUtils::getCriticalPages();
160
+ }
161
+
162
+ $total_compressed_images = 0;
163
+ $i = 0;
164
+ $pages_compressed = array();
165
+ /* Adding new pages which are optimized but haven't images and endpoint doesn't have that pages in response */
166
+ foreach ( $twb_optimized_pages as $page_id => $val ) {
167
+ /* Permalink text for front_page should be Homepage */
168
+ $pages_compressed[$i]['page_id'] = $page_id;
169
+ if( $page_id == 'front_page' ) {
170
+ $pages_compressed[$i]['permalink'] = 'Homepage';
171
+ } else {
172
+ $pages_compressed[$i]['permalink'] = $val['url'];
173
+ }
174
+
175
+ /* Finding value with page_id key in the array from endpoint to get images_count */
176
+ $found = current(array_filter($pages_compressed_api, function($item) use($page_id) {
177
+ return isset($item['page_id']) && $page_id == $item['page_id'];
178
+ }));
179
+
180
+ if( !empty($found) ) {
181
+ $pages_compressed[$i]['images_count'] = $found['images_count'];
182
+ $total_compressed_images += $found['images_count'];
183
+ } else {
184
+ $pages_compressed[$i]['images_count'] = 0;
185
+ }
186
+ $i++;
187
+ }
188
+
189
+ $data['pages'] = $pages_compressed;
190
+ $data['compressed_pages_count'] = count($pages_compressed);
191
+ $data['total_compressed_images'] = (int) $total_compressed_images;
192
+ $data['total_not_compressed_images_size'] = $total_not_compressed_images_size;
193
+ $data['total_not_compressed_images_count'] = $total_not_compressed_images_count;
194
+ }
195
+
196
+ if ( $total_compressed_images != 0 || $total_not_compressed_images_size != 0 ) {
197
+ set_transient( 'twb_optimized_pages', $data, DAY_IN_SECONDS );
198
+ }
199
+ }
200
+ die;
201
+ }
202
+
203
+ /**
204
+ * Update show CTA value.
205
+ *
206
+ * @return void
207
+ */
208
+ public function set_show_cta() {
209
+ $show_cta = isset($_POST['show_cta']) ? intval($_POST['show_cta']) : 0;
210
+ update_option("twb_show_cta", $show_cta);
211
+ die();
212
+ }
213
+
214
+ /**
215
+ * Get copmpressed pages/images data from DB.
216
+ *
217
+ * @param $params array
218
+ *
219
+ * @return array
220
+ */
221
+ public function get_pages_compressed( $params ) {
222
+ $return_data = array(
223
+ 'pages' => array(),
224
+ 'total_compressed_images' => 0,
225
+ 'total_not_compressed_images_size' => '0 B',
226
+ 'total_not_compressed_images_count' => 0,
227
+ 'compressed_pages_count' => 0,
228
+ );
229
+
230
+ $twb_optimized_pages = get_transient("twb_optimized_pages");
231
+ if ( !empty($twb_optimized_pages) ) {
232
+ return $twb_optimized_pages;
233
+ } else {
234
+ /* in case of returned data is 0 just get from db last data or run PG functionality to get count/size */
235
+ $images_total_size = get_option('twb_images_total_size');
236
+ if ( !empty($images_total_size) ) {
237
+ $return_data['total_not_compressed_images_size'] = $images_total_size;
238
+ $return_data['total_not_compressed_images_count'] = $params['images_count'];
239
+ }
240
+ }
241
+
242
+ return $return_data;
243
+ }
244
+
245
+ /**
246
+ * Get total size of all images․
247
+ */
248
+ public function get_total_size_of_images() {
249
+ $total = get_option('twb_images_total_size');
250
+ if ( empty($total) ) {
251
+ $total = 0;
252
+ $allowed_types = array(
253
+ 'image/jpeg',
254
+ 'image/jpg',
255
+ 'image/png',
256
+ 'image/gif',
257
+ 'image/webp',
258
+ 'image/svg',
259
+ 'image/png'
260
+ );
261
+ $args = array(
262
+ 'post_type' => 'attachment',
263
+ 'numberposts' => -1,
264
+ 'post_status' => NULL,
265
+ 'post_parent' => NULL, // any parent
266
+ );
267
+ $attachments = get_posts($args);
268
+ if ( $attachments ) {
269
+ foreach ( $attachments as $post ) {
270
+ if ( !in_array($post->post_mime_type, $allowed_types) ) {
271
+ continue;
272
+ }
273
+ $meta = wp_get_attachment_metadata($post->ID);
274
+ if ( isset($meta['filesize']) ) {
275
+ $filesize = $meta['filesize'];
276
+ }
277
+ else {
278
+ $path = get_attached_file($post->ID);
279
+ if ( !file_exists($path) ) {
280
+ continue;
281
+ }
282
+ $filesize = filesize($path);
283
+ }
284
+ $total += $filesize;
285
+ }
286
+ }
287
+ $total = TWBLibrary::formatBytes( $total );
288
+ update_option('twb_images_total_size', $total, 1);
289
+ }
290
+
291
+ echo json_encode(array("size" => $total));
292
+ die;
293
+ }
294
+
295
+ /**
296
+ * Top banner.
297
+ */
298
+ public function top_banner($params = array()) {
299
+ if ( $this->booster->is_paid === FALSE ) {
300
+ $booster_is_active = ( $this->booster->booster_is_connected && $this->booster->booster_plugin_status == 2 ) ? TRUE : FALSE;
301
+ if ( $booster_is_active ) {
302
+ if ( !isset($params['title']) ) {
303
+ $params['title'] = __('Get 10Web Booster Pro', 'tenweb-booster');
304
+ }
305
+ if ( !isset($params['desc']) ) {
306
+ $params['desc'] = __('Automatically optimize the entire website with all images.', 'tenweb-booster');
307
+ }
308
+ if ( !isset($params['notice']) ) {
309
+ $params['notice'] = FALSE;
310
+ }
311
+ $params['button'] = array(
312
+ 'name' => __('Upgrade', 'tenweb-booster'),
313
+ 'url' => "https://my.10web.io/websites/" . get_site_option('tenweb_domain_id') . "/booster/frontend?pricing=1",
314
+ 'target' => 'target="_blank"',
315
+ );
316
+ }
317
+ else {
318
+ if ( !isset($params['title']) ) {
319
+ $single = __('%s image can be optimized', 'tenweb-booster');
320
+ $plural = __('%s images can be optimized', 'tenweb-booster');
321
+ $images_count = $this->get_images_count();
322
+ $params['title'] = wp_sprintf(_n($single, $plural, $images_count, 'tenweb-booster'), $images_count);
323
+ }
324
+ if ( !isset($params['desc']) ) {
325
+ $params['desc'] = __('Improve PageSpeed optimization by optimizing your website.', 'tenweb-booster');
326
+ }
327
+ if ( !isset($params['notice']) ) {
328
+ $params['notice'] = __('Heavy images negatively affect your website load time and PageSpeed optimization.', 'tenweb-booster');
329
+ }
330
+ $params['button'] = array(
331
+ 'name' => __('Optimize now', 'tenweb-booster'),
332
+ 'url' => add_query_arg(array( 'page' => TenWebBooster::PREFIX . '_' . $this->booster->slug ), admin_url('admin.php')),
333
+ 'target' => '',
334
+ );
335
+ }
336
+
337
+ $this->view->top_banner($params);
338
+ }
339
+ }
340
+
341
+ /**
342
+ * Install booster plugin
343
+ */
344
+ public function install_booster() {
345
+ $activated = $this->install_plugin();
346
+ // To change the plugin status on Dashboard.
347
+ if (class_exists('\Tenweb_Authorization\Helper')
348
+ && method_exists('\Tenweb_Authorization\Helper', "check_site_state") ) {
349
+ \Tenweb_Authorization\Helper::check_site_state(true);
350
+ }
351
+ // activate_plugin function returns null when the plugin activated successfully.
352
+ if ( is_null($activated) ) {
353
+ $this->booster = $this->booster->set_booster_data();
354
+ }
355
+ $params = array();
356
+ $params['booster_plugin_status'] = $this->booster->booster_plugin_status;
357
+ $params['status'] = $this->booster->status;
358
+ $params['is_plugin'] = $this->booster->is_plugin;
359
+ $params['tenweb_is_paid'] = $this->booster->is_paid;
360
+ $params['slug'] = $this->booster->slug;
361
+ $domain_id = get_site_option('tenweb_domain_id');
362
+ $params['dashboard_booster_url'] = '';
363
+ if ( defined("TENWEB_DASHBOARD") && !empty($domain_id) ) {
364
+ $params['dashboard_booster_url'] = trim(TENWEB_DASHBOARD, '/') . '/websites/' . $domain_id . '/booster/frontend';
365
+ }
366
+ $params['submenu_parent_slug'] = $this->booster->submenu['parent_slug'];
367
+ $params['section_booster_title'] = $this->booster->page['section_booster_title'];
368
+ $params['section_booster_desc'] = $this->booster->page['section_booster_desc'];
369
+ $params['section_booster_success_title'] = $this->booster->page['section_booster_success_title'];
370
+ $params['section_booster_success_desc'] = $this->booster->page['section_booster_success_desc'];
371
+ $this->view->header($params);
372
+ die;
373
+ }
374
+
375
+ /**
376
+ * Install/activate the plugin.
377
+ *
378
+ * @param $status
379
+ *
380
+ * @return bool|int|true|WP_Error|null
381
+ */
382
+ private function install_plugin() {
383
+ $activated = FALSE;
384
+ if ( $this->booster->booster_plugin_status == 0 ) {
385
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php');
386
+ wp_cache_flush();
387
+ $upgrader = new Plugin_Upgrader();
388
+ $installed = $upgrader->install(self::PLUGIN_ZIP);
389
+ }
390
+ else {
391
+ $installed = TRUE;
392
+ }
393
+
394
+ if ( !is_wp_error( $installed ) && $installed ) {
395
+ $activated = activate_plugin(self::PlUGIN_FILE);
396
+ }
397
+
398
+ return $activated;
399
+ }
400
+
401
+ /**
402
+ * Get optimized media count.
403
+ *
404
+ * @return int
405
+ */
406
+ public function get_images_count() {
407
+ $allowed_types = array('image/jpeg','image/jpg','image/png','image/gif','image/webp','image/svg');
408
+ // Get all wp-media attachments.
409
+ $attachments = wp_count_attachments();
410
+ $total = 0;
411
+ if ( !empty($attachments) ) {
412
+ foreach ( $attachments as $key => $attachment ) {
413
+ if ( in_array($key, $allowed_types) ) {
414
+ $total += $attachment;
415
+ }
416
+ }
417
+ }
418
+
419
+ // Get all Photo gallery media.
420
+ global $wpdb;
421
+ $row = $wpdb->get_row( 'SELECT count(id) AS qty FROM `' . $wpdb->prefix . 'bwg_file_paths` WHERE is_dir = 0' );
422
+ if (!empty($row) && !empty($row->qty)) {
423
+ $total += intval($row->qty);
424
+ }
425
+
426
+ return intval($total);
427
+ }
428
+
429
+ /**
430
+ * Sign up to the Dashboard.
431
+ *
432
+ * @return bool
433
+ */
434
+ public function sign_up_dashboard() {
435
+ $email = isset($_POST['twb_email']) ? sanitize_email($_POST['twb_email']) : '';
436
+ $parent_slug = isset($_POST['parent_slug']) ? sanitize_text_field($_POST['parent_slug']) : '';
437
+ $slug = isset($_POST['slug']) ? sanitize_text_field($_POST['slug']) : '';
438
+ $is_plugin = isset($_POST['is_plugin']) ? sanitize_text_field($_POST['is_plugin']) : TRUE;
439
+
440
+
441
+ $body_data = array(
442
+ 'email' => $email,
443
+ 'first_name' => '10Webber',
444
+ 'last_name' => rand( 1000, 9999 ),
445
+ 'service_key' => 'gTcjslfqqBFFwJKBnFgQYhkQEJpplLaDKfj',
446
+ );
447
+
448
+ if ( $is_plugin ) {
449
+ switch ( $parent_slug ) {
450
+ case "manage_fm":
451
+ $body_data['product_id'] = '95';
452
+ break;
453
+ case "galleries_bwg":
454
+ $body_data['product_id'] = '101';
455
+ break;
456
+ default:
457
+ $body_data['product_slug'] = "plugin_" . $slug;
458
+ }
459
+ } else {
460
+ $body_data['product_slug'] = "theme_" . $slug;
461
+ }
462
+
463
+ $args = array(
464
+ 'method' => 'POST',
465
+ 'headers' => array(
466
+ 'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',
467
+ 'Accept' => 'application/x.10webcore.v1+json'
468
+ ),
469
+ 'body' => $body_data,
470
+ );
471
+ $url = 'https://core.10web.io/api/checkout/signup-via-magic-link';
472
+ $result = wp_remote_post( $url, $args );
473
+ ob_clean();
474
+ if ( !empty($result) && isset( $result['body']) ) {
475
+ $result = $result['body'];
476
+ } else {
477
+ echo json_encode( array('status' => 'error' ) );
478
+ die;
479
+ }
480
+
481
+ $result = json_decode($result, 1);
482
+ if ( class_exists('\TenWebOptimizer\OptimizerUtils') ) {
483
+ $args = '';
484
+ if ( isset($result['status']) && isset($result['data']['magic_data']) && $result['status'] == "ok" ) {
485
+ $args = array( 'magic_data' => $result['data']['magic_data'] );
486
+ }
487
+ elseif ( isset($result['error']) && $result['error']['status_code'] == "422" ) {
488
+ $args = array( 'login_request_plugin' => $this->booster->slug );
489
+ }
490
+ if ( $args ) {
491
+ $connect_link = \TenWebOptimizer\OptimizerUtils::get_tenweb_connection_link('login', $args);
492
+ echo json_encode(array( 'status' => 'success', 'booster_connect_url' => $connect_link ));
493
+ die();
494
+ }
495
+ }
496
+ echo json_encode( array('status' => 'error') );
497
+ die();
498
+ }
499
+
500
+ /**
501
+ * Connect to dashboard.
502
+ *
503
+ * @return void
504
+ */
505
+ public function connect_to_dashboard() {
506
+ if ( class_exists('\TenWebOptimizer\OptimizerUtils') ) {
507
+ $twb_connect_link = \TenWebOptimizer\OptimizerUtils::get_tenweb_connection_link('login');
508
+ echo json_encode(array( 'status' => 'success', 'booster_connect_url' => $twb_connect_link ));
509
+ }
510
+ else {
511
+ echo json_encode(array( 'status' => 'error' ) );
512
+ }
513
+ die;
514
+ }
515
+
516
+ /**
517
+ * Get Google page speed score.
518
+ */
519
+ public function get_google_page_speed() {
520
+ $last_api_key_index = isset($_POST['last_api_key_index']) ? sanitize_text_field($_POST['last_api_key_index']) : '';
521
+
522
+ $url = isset($_POST['twb_url']) ? sanitize_url($_POST['twb_url']) : '';
523
+
524
+ /* Check if url hasn't http or https add */
525
+ if ( strpos($url, 'http') !== 0 ){
526
+ if ( isset($_SERVER['HTTPS']) ) {
527
+ $url = 'https://'.$url;
528
+ } else {
529
+ $url = 'http://'.$url;
530
+ }
531
+ }
532
+
533
+ /* Check if the url is valid */
534
+ if ( !filter_var($url, FILTER_VALIDATE_URL) ) {
535
+ echo json_encode(array('error' => 1)); die;
536
+ }
537
+
538
+ $post_id = url_to_postid($url);
539
+ $home_url = get_home_url();
540
+ if ( $post_id !== 0 && get_post_status( $post_id ) != 'publish' && rtrim($url, "/") != rtrim($home_url, "/") ) {
541
+ echo json_encode( array('error' => 1, 'msg' => esc_html__('This page is not public. Please publish the page to check the score.', 'tenweb-booster')) );
542
+ die;
543
+ }
544
+
545
+ if ( $last_api_key_index != '' ) {
546
+ /* remove array value as this key already used and no need to try again during the retry */
547
+ unset($this->google_api_keys[$last_api_key_index]);
548
+ }
549
+ $random_index = array_rand( $this->google_api_keys );
550
+ $random_api_key = $this->google_api_keys[$random_index];
551
+ $result = $this->twb_google_speed_cron( $url, 'desktop', $random_api_key );
552
+ if ( !empty($result['error']) || empty($result)) {
553
+ /* Case when retry already done and $last_api_key_index is not empty */
554
+ if ( $last_api_key_index != '' ) {
555
+ echo json_encode(array( 'error' => 1 ));
556
+ }
557
+ else {
558
+ echo json_encode(array( 'error' => 1, 'last_api_key_index' => $random_index ));
559
+ }
560
+ die;
561
+ }
562
+ $score['desktop'] = $result['score']*100;
563
+ $score['desktop_loading_time'] = $result['loading_time'];
564
+
565
+ $result = $this->twb_google_speed_cron( $url, 'mobile', $random_api_key );
566
+ if ( !empty($result['error']) || empty($result) ) {
567
+ /* Case when retry already done and $last_api_key_index is not empty */
568
+ if ( $last_api_key_index != '' ) {
569
+ echo json_encode(array( 'error' => 1 ));
570
+ }
571
+ else {
572
+ echo json_encode(array( 'error' => 1, 'last_api_key_index' => $random_index ));
573
+ }
574
+ die;
575
+ }
576
+ $score['mobile'] = $result['score']*100;
577
+ $score['mobile_loading_time'] = $result['loading_time'];
578
+
579
+ $nowdate = current_time( 'mysql' );
580
+ $nowdate = date('d.m.Y h:i:s a', strtotime($nowdate));
581
+
582
+ $data = get_option('twb_speed_score');
583
+ $data[$url] = array(
584
+ 'desktop_score' => $score['desktop'],
585
+ 'desktop_loading_time' => $score['desktop_loading_time'],
586
+ 'mobile_score' => $score['mobile'],
587
+ 'mobile_loading_time' => $score['mobile_loading_time'],
588
+ 'last_analyzed_time' => $nowdate,
589
+ 'error' => 0
590
+ );
591
+ $data['last'] = array(
592
+ 'url' => $url
593
+ );
594
+ update_option('twb_speed_score', $data, 1);
595
+
596
+ $twb_hompage_optimized = get_option('twb_hompage_optimized');
597
+ if ( rtrim($url, "/") == rtrim($home_url, "/") && !empty($twb_hompage_optimized) && $twb_hompage_optimized == 1 ) {
598
+ update_option('twb_hompage_optimized', 2);
599
+ }
600
+ ob_clean();
601
+ echo json_encode(array(
602
+ 'desktop_score' => esc_html($score['desktop']),
603
+ 'desktop_loading_time' => esc_html($score['desktop_loading_time']),
604
+ 'mobile_score' => esc_html($score['mobile']),
605
+ 'mobile_loading_time' => esc_html($score['mobile_loading_time']),
606
+ 'last_analyzed_time' => esc_html($nowdate),
607
+ ));
608
+ die;
609
+ }
610
+
611
+ /**
612
+ * Remote get action to get google speed score
613
+ *
614
+ * @param $page_url string which is url of the page which speed should counted
615
+ * @param $strategy string parameter which get desktop or mobile
616
+ *
617
+ * @return array
618
+ */
619
+ public function twb_google_speed_cron( $page_url, $strategy, $key = 'AIzaSyCQmF4ZSbZB8prjxci3GWVK4UWc-Yv7vbw') {
620
+ $url = "https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=" . $page_url . "&key=".$key;
621
+ $url = ( $strategy == "mobile" ) ? $url . "&strategy=mobile" : $url;
622
+
623
+ $response = wp_remote_get($url, array('timeout' => 300));
624
+ $data = array();
625
+
626
+ if (is_array($response) && !is_wp_error($response)) {
627
+
628
+ $body = $response['body'];
629
+ $body = json_decode($body);
630
+ if (isset($body->error) ) {
631
+ $data['error'] = 1;
632
+ } else {
633
+ $data['score'] = $body->lighthouseResult->categories->performance->score;
634
+ $data['loading_time'] = $body->lighthouseResult->audits->interactive->displayValue;
635
+ }
636
+ } else {
637
+ $data['error'] = 1;
638
+ }
639
+ return $data;
640
+ }
641
+ }
booster/init.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('init', function() {
3
+ add_filter('tenweb_booster_sdk', function($path) {
4
+ $version = '1.0.0';
5
+ if ( !isset($path['version']) || version_compare($path['version'], $version) === -1 ) {
6
+ $path['version'] = $version;
7
+ if ( FALSE ) {
8
+ $path['path'] = get_template_directory() . '/booster/';
9
+ }
10
+ else {
11
+ $path['path'] = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
12
+ }
13
+ }
14
+
15
+ return $path;
16
+ });
17
+ }, 8);
18
+ add_action('init', function() {
19
+ if (!class_exists("TenWebBooster")) {
20
+ if ( FALSE ) {
21
+ $plugin_dir = apply_filters('tenweb_booster_sdk', array(
22
+ 'version' => '1.0.0',
23
+ 'path' => get_template_directory() . '/booster/',
24
+ ));
25
+ }
26
+ else {
27
+ $plugin_dir = apply_filters('tenweb_booster_sdk', array(
28
+ 'version' => '1.0.0',
29
+ 'path' => WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)),
30
+ ));
31
+ }
32
+ require_once($plugin_dir['path'] . '/main.php');
33
+
34
+ function TWB($params = array()) {
35
+ if ( isset($params['is_plugin']) && !$params['is_plugin'] ) {
36
+ $plugin_dir = get_template_directory() . '/booster';
37
+ $plugin_url = get_template_directory_uri() . "/booster";
38
+ }
39
+ else {
40
+ $plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
41
+ $plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
42
+ }
43
+ $params['plugin_dir'] = $plugin_dir;
44
+ $params['plugin_url'] = $plugin_url;
45
+ return new TenWebBooster($params);
46
+ }
47
+ }
48
+ }, 10);
booster/main.php ADDED
@@ -0,0 +1,473 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TenWebBooster {
3
+ const VERSION = '1.0.0';
4
+ const PREFIX = 'twb';
5
+ const BOOSTER_PlUGIN_FILE = 'tenweb-speed-optimizer/tenweb_speed_optimizer.php';
6
+
7
+ public $submenu = array(
8
+ 'parent_slug' => FALSE,
9
+ 'title' => 'Speed & Image Optimization',
10
+ 'icon' => '',
11
+ );
12
+ public $page = array(
13
+ 'section_booster_title' => 'Optimize images and boost PageSpeed score',
14
+ 'section_booster_desc' => 'Use the free 10Web Booster plugin to automatically optimize your images and boost PageSpeed score.',
15
+ 'section_booster_success_title' => 'Optimize all images',
16
+ 'section_booster_success_desc' => 'Speed up the entire website',
17
+ 'section_optimize_images' => TRUE,
18
+ 'section_analyze' => TRUE,
19
+ 'section_analyze_desc' => 'Speed up your website and increase PageSpeed score by optimizing all images.',
20
+ );
21
+
22
+ public $cta_button = array(
23
+ 'section_label' => 'PageSpeed score',
24
+ 'label' => 'Check PageSpeed score',
25
+ 'button_color' => '',
26
+ 'text_color' => '',
27
+ 'class' => 'twb-green-button',
28
+ );
29
+ private $admin_bar = TRUE;
30
+ private $gutenberg = TRUE;
31
+ private $elementor = TRUE;
32
+ public $show_cta_option = TRUE;
33
+ public $show_cta = TRUE;
34
+ private $list = TRUE;
35
+
36
+ public $slug = '';
37
+ public $plugin_dir = '';
38
+ public $plugin_url = '';
39
+ public $booster_plugin_status = 0; //0-not installed, 1-not active, 2-active
40
+ public $booster_is_connected = FALSE;
41
+ public $is_paid = FALSE;
42
+ public $subscription_id = FALSE;
43
+ public $status = 'not_installed';
44
+ /* is booster SDK called from plugin or theme */
45
+ public $is_plugin = TRUE;
46
+ public $submenu_url = '';
47
+
48
+ public function __construct($params = array()) {
49
+ $this->define_params($params);
50
+ $this->change_defaults($params);
51
+ $this->set_booster_data();
52
+ $this->add_actions();
53
+ }
54
+
55
+ private function add_actions() {
56
+ add_action('init', array( $this, 'register_meta' ));
57
+ add_action('admin_enqueue_scripts', array( $this, 'register_admin_scripts' ));
58
+ add_action('wp_enqueue_scripts', array( $this, 'register_scripts' ));
59
+ if ( $this->submenu['parent_slug'] || !$this->is_plugin ) {
60
+ add_action('admin_menu', array( $this, 'add_submenu' ));
61
+ }
62
+ add_action('wp_ajax_' . self::PREFIX, array( $this, 'admin_ajax' ));
63
+ add_action('wp_ajax_twb_check_score', array( $this, 'check_score' ));
64
+ add_action('wp_ajax_twb_notif_check', array( $this, 'notif_check' ));
65
+
66
+ /* Booster is inactive and (CTAs are enabled from options or option desabled at all).*/
67
+ if ( $this->booster_plugin_status != 2 && ($this->show_cta || !$this->show_cta_option) ) {
68
+ if ( $this->admin_bar ) {
69
+ add_action('admin_bar_menu', array( $this, 'admin_bar_menu' ), 100);
70
+ }
71
+
72
+ if ( $this->elementor ) {
73
+ require_once('Elementor.php');
74
+ new TWBElementor($this);
75
+ }
76
+
77
+ if ( $this->gutenberg ) {
78
+ require_once('Gutenberg.php');
79
+ new TWBGutenberg($this);
80
+ }
81
+
82
+ if ( $this->list ) {
83
+ require_once('List.php');
84
+ $this->list = TWBList($this);
85
+ }
86
+ }
87
+ }
88
+
89
+ public function admin_ajax() {
90
+ $speed_ajax_nonce = isset($_POST['speed_ajax_nonce']) ? sanitize_text_field($_POST['speed_ajax_nonce']) : '';
91
+ if ( !wp_verify_nonce($speed_ajax_nonce, 'speed_ajax_nonce') ){
92
+ die('Permission Denied.');
93
+ }
94
+
95
+ if ( !isset($_POST['action']) ) {
96
+ return;
97
+ }
98
+ $page = sanitize_text_field($_POST['action']);
99
+ $allowed_pages = array( 'twb' );
100
+ if ( !in_array($page, $allowed_pages) ) {
101
+ return;
102
+ }
103
+ $this->admin_page();
104
+ }
105
+
106
+ public function check_score() {
107
+ $twb_nonce = isset($_POST['twb_nonce']) ? sanitize_text_field($_POST['twb_nonce']) : '';
108
+ if ( !wp_verify_nonce($twb_nonce, 'twb_nonce') ){
109
+ die('Permission Denied.');
110
+ }
111
+
112
+ if ( !isset($_POST['action']) ) {
113
+ return;
114
+ }
115
+ $page = sanitize_text_field($_POST['action']);
116
+ $allowed_pages = array( 'twb_check_score' );
117
+ if ( !in_array($page, $allowed_pages) ) {
118
+ return;
119
+ }
120
+ $post_id = isset($_POST["post_id"]) ? sanitize_text_field($_POST["post_id"]) : 0;
121
+
122
+ echo TWBLibrary::check_score($post_id);
123
+ die();
124
+ }
125
+
126
+ /* Ajax action which is checking if score count in progress/complete to show notification */
127
+ public function notif_check() {
128
+ $twb_nonce = isset($_POST['twb_nonce']) ? sanitize_text_field($_POST['twb_nonce']) : '';
129
+ if ( !wp_verify_nonce($twb_nonce, 'twb_nonce') ){
130
+ die('Permission Denied.');
131
+ }
132
+
133
+ if ( !isset($_POST['action']) ) {
134
+ return;
135
+ }
136
+ $page = sanitize_text_field($_POST['action']);
137
+ $allowed_pages = array( 'twb_notif_check' );
138
+ if ( !in_array($page, $allowed_pages) ) {
139
+ return;
140
+ }
141
+
142
+ require_once('AdminBar.php');
143
+ new TWBAdminBar('', $this);
144
+ }
145
+
146
+ private function define_params($params) {
147
+ require_once('TWBLibrary.php');
148
+ $submenu_icon_styles = array(
149
+ 'background-color: #22B339',
150
+ 'border-radius: 20px',
151
+ 'display: inline-block',
152
+ 'height: 6px',
153
+ 'margin: 0 0 1px 3px',
154
+ 'width: 6px',
155
+ );
156
+ $this->submenu['icon'] = '<span class="' . self::PREFIX . '-submenu-icon" style="' . implode(';', $submenu_icon_styles) . '"></span>';
157
+ if ( isset($params['page']['slug']) ) {
158
+ $this->slug = $params['page']['slug'];
159
+ }
160
+ else {
161
+ if ( isset($params['is_plugin']) && !$params['is_plugin'] ) {
162
+ $path = explode('/themes/', get_template_directory());
163
+ $this->slug = isset($path[1]) ? $path[1] : 'theme';
164
+ }
165
+ else {
166
+ $this->slug = str_replace(array( 'booster', '/' ), array( '', '' ), plugin_basename(dirname(__FILE__)));
167
+ }
168
+ }
169
+ $admin_page = admin_url((isset($params['is_plugin']) && !$params['is_plugin']) ? 'themes.php' : 'admin.php');
170
+ $this->submenu_url = add_query_arg( array('page' => TenWebBooster::PREFIX . '_' . $this->slug), $admin_page );
171
+ }
172
+
173
+ private function change_defaults( $params = array()) {
174
+ foreach ( $params as $key => $param ) {
175
+ if ( isset($this->$key) ) {
176
+ if ( is_array($param) ) {
177
+ foreach ( $param as $par_key => $par ) {
178
+ $param[$par_key] = sanitize_text_field($par);
179
+ }
180
+ $this->$key = array_merge($this->$key, $param);
181
+ }
182
+ else {
183
+ $this->$key = sanitize_text_field($param);
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ public function register_scripts( ) {
190
+ $required_scripts = array( 'jquery' );
191
+ $required_styles = array( 'twb-open-sans' );
192
+ wp_register_style('twb-open-sans', 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700,800&display=swap');
193
+ wp_register_style(self::PREFIX . '-global', $this->plugin_url . '/assets/css/global.css', $required_styles, self::VERSION);
194
+ if ( $this->cta_button['button_color'] || $this->cta_button['text_color'] ) {
195
+ $cutom_css = "
196
+ #wp-admin-bar-booster-top-button a.ab-item,
197
+ #wp-admin-bar-twb_adminbar_info .twb_admin_bar_menu_header:not(.twb_not_optimized),
198
+ #wp-admin-bar-booster-top-button a.ab-item:hover,
199
+ #wpadminbar:not(.mobile) .ab-top-menu>#wp-admin-bar-booster-top-button:hover>.ab-item {
200
+ background-color: " . $this->cta_button['button_color'] . " !important;
201
+ color: " . $this->cta_button['text_color'] . " !important;
202
+ }";
203
+ wp_add_inline_style(self::PREFIX . '-global', $cutom_css);
204
+ }
205
+ wp_register_script(self::PREFIX . '-circle', $this->plugin_url . '/assets/js/circle-progress.js', $required_scripts, '1.2.2');
206
+ array_push($required_scripts, self::PREFIX . '-circle');
207
+ wp_register_script(self::PREFIX . '-global', $this->plugin_url . '/assets/js/global.js', $required_scripts, self::VERSION);
208
+ wp_localize_script(self::PREFIX . '-global', 'twb', array(
209
+ 'nonce' => wp_create_nonce('twb_nonce'),
210
+ 'ajax_url' => admin_url('admin-ajax.php'),
211
+ 'plugin_url' => $this->plugin_url,
212
+ 'href' => $this->submenu_url,
213
+ ));
214
+ }
215
+
216
+ public function add_submenu() {
217
+ if ( $this->is_plugin ) {
218
+ add_submenu_page(
219
+ $this->submenu['parent_slug'],
220
+ $this->submenu['title'],
221
+ $this->submenu['title'] . $this->submenu['icon'],
222
+ 'manage_options',
223
+ self::PREFIX . '_' . $this->slug,
224
+ array($this, 'admin_page'),
225
+ 1
226
+ );
227
+ }
228
+ else {
229
+ add_theme_page(
230
+ $this->submenu['title'],
231
+ $this->submenu['title'] . $this->submenu['icon'],
232
+ 'manage_options',
233
+ self::PREFIX . '_' . $this->slug,
234
+ array($this, 'admin_page')
235
+ );
236
+ }
237
+ }
238
+
239
+ /**
240
+ * Display page.
241
+ */
242
+ public function admin_page() {
243
+ require_once($this->plugin_dir . '/controller.php');
244
+ $controller = new BoosterController($this);
245
+ $controller->execute();
246
+ }
247
+
248
+ /**
249
+ * Top banner.
250
+ *
251
+ * @param $params
252
+ */
253
+ public function top_banner($params = array()) {
254
+ require_once($this->plugin_dir . '/controller.php');
255
+ $controller = new BoosterController($this);
256
+ $controller->execute('top_banner', $params);
257
+ }
258
+
259
+ /**
260
+ * Admin bar menu.
261
+ *
262
+ * @param $wp_admin_bar
263
+ */
264
+ public function admin_bar_menu( $wp_admin_bar ) {
265
+ require_once('AdminBar.php');
266
+ new TWBAdminBar($wp_admin_bar, $this);
267
+ }
268
+
269
+ /**
270
+ * Set the data for Booster.
271
+ *
272
+ * @return void
273
+ */
274
+ public function set_booster_data() {
275
+ $this->show_cta = get_option("twb_show_cta", TRUE);
276
+ $this->subscription_id = get_transient('tenweb_subscription_id');
277
+ $this->booster_plugin_status = $this->get_booster_status();
278
+
279
+ if ( ( defined('TENWEB_CONNECTED_SPEED') &&
280
+ class_exists('\Tenweb_Authorization\Login') &&
281
+ \Tenweb_Authorization\Login::get_instance()->check_logged_in() &&
282
+ \Tenweb_Authorization\Login::get_instance()->get_connection_type() == TENWEB_CONNECTED_SPEED ) ||
283
+ ( defined('TENWEB_SO_HOSTED_ON_10WEB') && TENWEB_SO_HOSTED_ON_10WEB ) ) {
284
+ $this->booster_is_connected = TRUE;
285
+
286
+ if ( method_exists('\TenWebOptimizer\OptimizerUtils', 'is_paid_user')
287
+ && TenWebOptimizer\OptimizerUtils::is_paid_user() ) {
288
+ $this->is_paid = TRUE;
289
+ }
290
+ }
291
+
292
+ if ( $this->booster_plugin_status == 2 ) {
293
+ if ( $this->booster_is_connected ) {
294
+ $this->status = 'connected';
295
+ }
296
+ else {
297
+ if ( $this->subscription_id ) {
298
+ $this->status = 'connect';
299
+ } else {
300
+ $this->status = 'sign_up';
301
+ }
302
+ }
303
+ }
304
+ return $this;
305
+ }
306
+
307
+ /**
308
+ * Check the plugin status.
309
+ *
310
+ * @return int 0-not installed, 1-not active, 2-active
311
+ */
312
+ private function get_booster_status() {
313
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
314
+ if ( is_plugin_active(self::BOOSTER_PlUGIN_FILE) ) {
315
+ return 2;
316
+ }
317
+ elseif ( $this->is_plugin_installed() ) {
318
+ return 1;
319
+ }
320
+ else {
321
+ return 0;
322
+ }
323
+ }
324
+
325
+ /**
326
+ * Check if the plugin already installed.
327
+ *
328
+ * @param string $slug plugin's slug
329
+ *
330
+ * @return bool
331
+ */
332
+ private function is_plugin_installed() {
333
+ if ( ! function_exists( 'get_plugins' ) ) {
334
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php');
335
+ }
336
+ $all_plugins = get_plugins();
337
+
338
+ return !empty($all_plugins[self::BOOSTER_PlUGIN_FILE]);
339
+ }
340
+
341
+ public function register_admin_scripts() {
342
+ $required_scripts = array( 'jquery' );
343
+ $required_styles = array('twb-open-sans');
344
+ wp_register_style('twb-open-sans', 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700,800&display=swap');
345
+ wp_register_style(self::PREFIX . '-global', $this->plugin_url . '/assets/css/global.css', $required_styles, self::VERSION);
346
+
347
+ wp_register_script(self::PREFIX . '-circle', $this->plugin_url . '/assets/js/circle-progress.js', $required_scripts, '1.2.2');
348
+ array_push($required_scripts, self::PREFIX . '-circle');
349
+ wp_register_script(self::PREFIX . '-global', $this->plugin_url . '/assets/js/global.js', $required_scripts, self::VERSION);
350
+ wp_localize_script(self::PREFIX . '-global', 'twb', array(
351
+ 'nonce' => wp_create_nonce('twb_nonce'),
352
+ 'ajax_url' => admin_url('admin-ajax.php'),
353
+ 'cta_button' => $this->cta_button,
354
+ 'href' => $this->submenu_url,
355
+ ));
356
+ wp_register_style(self::PREFIX, $this->plugin_url . '/assets/css/speed.css', $required_styles, self::VERSION);
357
+ wp_register_style(self::PREFIX . '-top-banner', $this->plugin_url . '/assets/css/top_banner.css', $required_styles, self::VERSION);
358
+ wp_register_script(self::PREFIX . '-script', $this->plugin_url . '/assets/js/speed.js', $required_scripts, self::VERSION);
359
+ wp_localize_script(self::PREFIX . '-script', 'twb', array(
360
+ 'install_button_text' => __('Install 10Web Booster plugin', 'tenweb-booster'),
361
+ 'activate_button_text' => __('Activate 10Web Booster plugin', 'tenweb-booster'),
362
+ 'wrong_email' => __('Please enter a valid email address.', 'tenweb-booster'),
363
+ 'empty_email' => __('Email field should not be empty.', 'tenweb-booster'),
364
+ 'wrong_domain_url' => __('Please enter a URL from your domain.', 'tenweb-booster'),
365
+ 'wrong_url' => __('Please enter correct URL.', 'tenweb-booster'),
366
+ 'enter_page_url' => __('Please enter a Page URL.', 'tenweb-booster'),
367
+ 'page_is_not_public' => __('This page is not public. Please publish the page to check the score.', 'tenweb-booster'),
368
+ 'sign_up' => __('Sign up', 'tenweb-booster'),
369
+ 'connect' => __('Connect', 'tenweb-booster'),
370
+ 'home_url' => get_home_url(),
371
+ 'home_speed_status' => $this->check_home_speed_status(),
372
+ 'analyze_button_text' => __('Analyze', 'tenweb-booster'),
373
+ 'something_wrong' => __('Something went wrong, please try again.', 'tenweb-booster'),
374
+ 'speed_ajax_nonce' => wp_create_nonce('speed_ajax_nonce'),
375
+ 'compressed_pages_status' => $this->compressed_pages_status(),
376
+ 'nonce' => wp_create_nonce('twb_nonce'),
377
+ 'ajax_url' => admin_url('admin-ajax.php'),
378
+ 'cta_button' => $this->cta_button,
379
+ 'href' => $this->submenu_url,
380
+ ));
381
+ }
382
+
383
+ /**
384
+ * Check if data of optimized pages/images kept in DB
385
+ * Using to send localized status to js and run ajax if needed to get data from endpoint
386
+ *
387
+ * @return bool
388
+ */
389
+ public function compressed_pages_status() {
390
+ $data = get_transient( 'twb_optimized_pages' );
391
+ if( !empty( $data) ) {
392
+ return 1;
393
+ }
394
+ return 0;
395
+ }
396
+
397
+ public function check_home_speed_status() {
398
+ $twb_hompage_optimized = get_option('twb_hompage_optimized');
399
+ /* Case when homepage optimized but score not updated */
400
+ if ( !empty($twb_hompage_optimized) && $twb_hompage_optimized == 1 ) {
401
+ return 0;
402
+ }
403
+ $twb_speed_score = get_option('twb_speed_score');
404
+ if ( !empty($twb_speed_score) && isset($twb_speed_score['last']) && isset($twb_speed_score['last']['url']) ) {
405
+ $url = $twb_speed_score['last']['url'];
406
+ if ( isset($twb_speed_score[$url]) && $twb_speed_score[$url]['desktop_score'] && $twb_speed_score[$url]['mobile_score'] ) {
407
+ return array(
408
+ 'desktop_score' => $twb_speed_score[$url]['desktop_score'],
409
+ 'mobile_score' => $twb_speed_score[$url]['mobile_score'],
410
+ );
411
+ }
412
+ }
413
+
414
+ return 0;
415
+ }
416
+
417
+ public function register_meta() {
418
+ $allowed_post_types = array('post', 'page');
419
+ foreach ($allowed_post_types as $type) {
420
+ register_post_meta($type, 'two_page_speed', [
421
+ 'show_in_rest' => array(
422
+ 'schema' => array(
423
+ 'type' => 'object',
424
+ 'properties' => array(
425
+ 'previous_score' => array(
426
+ 'type' => 'object',
427
+ 'properties' => array(
428
+ 'desktop_score' => array(
429
+ 'type' => 'number',
430
+ ),
431
+ 'desktop_tti' => array(
432
+ 'type' => 'string',
433
+ ),
434
+ 'mobile_score' => array(
435
+ 'type' => 'number',
436
+ ),
437
+ 'mobile_tti' => array(
438
+ 'type' => 'string',
439
+ ),
440
+ 'date' => array(
441
+ 'type' => 'string',
442
+ ),
443
+ ),
444
+ ),
445
+ 'current_score' => array(
446
+ 'type' => 'object',
447
+ 'properties' => array(
448
+ 'desktop_score' => array(
449
+ 'type' => 'number',
450
+ ),
451
+ 'desktop_tti' => array(
452
+ 'type' => 'string',
453
+ ),
454
+ 'mobile_score' => array(
455
+ 'type' => 'number',
456
+ ),
457
+ 'mobile_tti' => array(
458
+ 'type' => 'string',
459
+ ),
460
+ 'date' => array(
461
+ 'type' => 'string',
462
+ ),
463
+ ),
464
+ ),
465
+ ),
466
+ ),
467
+ ),
468
+ 'single' => TRUE,
469
+ 'type' => 'object'
470
+ ]);
471
+ }
472
+ }
473
+ }
booster/model.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+
3
+ class BoosterModel {}
booster/view.php ADDED
@@ -0,0 +1,472 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class BoosterView
5
+ */
6
+ class BoosterView {
7
+
8
+ public function __construct() {
9
+ wp_enqueue_style(TenWebBooster::PREFIX);
10
+ wp_enqueue_script(TenWebBooster::PREFIX . '-script');
11
+ }
12
+
13
+ /**
14
+ * Display page.
15
+ *
16
+ * @param $params
17
+ */
18
+ public function display( $params = array() ) {
19
+ ?>
20
+ <div class="wrap">
21
+ <?php //echo $this->popup(); ?>
22
+ <?php
23
+ if ( !$params['twb_dismiss'] ) {
24
+ ?>
25
+ <div class="twb-speed-header">
26
+ <?php
27
+ $this->header( $params );
28
+ ?>
29
+ </div>
30
+ <?php
31
+ if ( $params['submenu_section_optimize_images'] || $params['submenu_section_analyze'] ) {
32
+ ?>
33
+ <div class="twb-speed-body">
34
+ <div class="twb-speed-body-container">
35
+ <?php
36
+ if ( $params['submenu_section_optimize_images'] ) {
37
+ if ( $params['booster_is_connected'] && !$params['tenweb_is_paid'] ) {
38
+ $this->optimizer_on_free_connected($params);
39
+ }
40
+ elseif ( $params['booster_is_connected'] && $params['tenweb_is_paid'] ) {
41
+ $this->optimizer_on_pro($params);
42
+ }
43
+ else {
44
+ $this->optimizer_on_free_not_connected($params);
45
+ }
46
+ }
47
+ if ( $params['submenu_section_analyze'] ) {
48
+ $this->analyzer($params);
49
+ }
50
+ ?>
51
+ </div>
52
+ </div>
53
+ <?php
54
+ }
55
+ }
56
+ // If CTAs disable option is enabled.
57
+ if ( $params['show_cta_option'] && $params['booster_plugin_status'] != 2 ) {
58
+ ?>
59
+ <div class="twb-speed-footer">
60
+ <input type="checkbox" id="twb-show-cta" <?php echo $params['show_cta'] == 1 ? 'checked' : ''; ?>>
61
+ <label for="twb-show-cta"><p><?php _e("Show all PageSpeeds score elements in WordPress admin.", "tenweb-booster"); ?></p></label>
62
+ </div>
63
+ <?php
64
+ }
65
+
66
+ ?>
67
+ </div>
68
+ <?php
69
+ }
70
+
71
+ public function analyzer( $params ) {
72
+ ?>
73
+ <div class="twb-analyze">
74
+ <p class="twb-section-title"><?php esc_html_e('PageSpeed optimization', 'tenweb-booster'); ?></p>
75
+ <p class="twb-description"><?php echo $params['section_analyze_desc']; ?></p>
76
+ <div class="twb-analyze-input-container">
77
+ <input type="url" class="twb-analyze-input <?php esc_attr_e( ( $params['page_is_public'] === 0 ) ? 'twb-analyze-input-error' : ''); ?>" placeholder="<?php esc_html_e('Page URL', 'tenweb-booster') ?>" value="" />
78
+ <?php if ( $params['page_is_public'] === 0 ) { ?>
79
+ <p class="twb-error-msg"><?php esc_html_e('This page is not public. Please publish the page to check the score.', 'tenweb-booster'); ?></p>
80
+ <?php } ?>
81
+ <a class="twb-analyze-input-button <?php esc_attr_e( ( !$params['page_is_public'] ) ? 'twb-disable-analyze' : ''); ?>"><?php esc_html_e('Analyze', 'tenweb-booster') ?></a>
82
+ </div>
83
+ <div class="twb-analyze-info-container">
84
+ <div class="twb-analyze-info-left">
85
+ <div class="twb-analyze-info-left-cont">
86
+ <div class="twb-analyze-mobile-score">
87
+ <div class="speed_circle" data-thickness="6" data-id="mobile">
88
+ <p class="circle_animated"><?php echo esc_html($params['twb_speed_score']['mobile_score']); ?></p>
89
+ </div>
90
+ <p class="twb-score-name"><?php esc_html_e('Mobile Score', 'tenweb-booster'); ?></p>
91
+ <p class="twb-load-time twb-load-time-mobile"><?php esc_html_e('Load Time:', 'tenweb-booster'); ?> <span><?php echo esc_html($params['twb_speed_score']['mobile_loading_time']); ?></span></p>
92
+ </div>
93
+ <div class="twb-analyze-desktop-score">
94
+ <div class="speed_circle" data-thickness="6" data-id="desktop">
95
+ <p class="circle_animated"><?php echo esc_html($params['twb_speed_score']['desktop_score']); ?></p>
96
+ </div>
97
+ <p class="twb-score-name"><?php esc_html_e('Desktop Score', 'tenweb-booster'); ?></p>
98
+ <p class="twb-load-time twb-load-time-desktop"><?php esc_html_e('Load Time:', 'tenweb-booster'); ?> <span><?php echo esc_html($params['twb_speed_score']['desktop_loading_time']); ?></span></p>
99
+ </div>
100
+ </div>
101
+ <div class="twb-analyze-score-info">
102
+ <span><?php esc_html_e('Scale:', 'tenweb-booster') ?></span>
103
+ <span class="twb-fast-icon twb-score-icon"></span>90-100 <?php esc_html_e('(fast)', 'tenweb-booster'); ?>
104
+ <span class="twb-averege-icon twb-score-icon"></span>50-89 <?php esc_html_e('(average)', 'tenweb-booster'); ?>
105
+ <span class="twb-slow-icon twb-score-icon"></span>0-49 <?php esc_html_e('(slow)', 'tenweb-booster'); ?>
106
+ </div>
107
+ </div>
108
+ <div class="twb-analyze-info-right">
109
+ <p class="twb-analyze-info-right-sub-title"><?php echo sprintf(__('Check your score with %s', 'tenweb-booster'), '<a href="https://pagespeed.web.dev/" target="_blank">' . __('Google PageSpeed Insights', 'tenweb-booster') . '</a>'); ?></p>
110
+ <hr>
111
+ <h3><?php esc_html_e('Analyzed page:', 'tenweb-booster'); ?></h3>
112
+ <p class="twb-last-analyzed-page" title="<?php echo esc_html($params['twb_speed_score']['url']); ?>"><?php echo esc_html($params['twb_speed_score']['url']); ?></p>
113
+ <div class="twb-last-analyzed-date-container">
114
+ <h3><?php esc_html_e('Last analyzed:', 'tenweb-booster'); ?></h3>
115
+ <p class="twb-last-analyzed-date"><?php echo esc_html($params['twb_speed_score']['last_analyzed_time']); ?></p>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ <?php
121
+ }
122
+
123
+ public function header( $params ) {
124
+ $status = $params['status'];
125
+ if ( $status == 'not_installed' ) {
126
+ $step = 1;
127
+ $connected = FALSE;
128
+ $cont_class = '';
129
+ $title = $params['section_booster_title'];
130
+ $description = $params['section_booster_desc'];
131
+ ob_start();
132
+ ?>
133
+ <div class="twb-button-container-parent">
134
+ <div class="button-container">
135
+ <a class="twb-install-booster" onclick="twb_install_plugin( this )"><?php echo sprintf(__('%s 10Web Booster plugin', 'tenweb-booster'), ($params['booster_plugin_status'] == 0 ? __('Install', 'tenweb-booster') : __('Activate', 'tenweb-booster'))); ?></a>
136
+ <p><?php esc_html_e('Installing from WordPress repository', 'tenweb-booster') ?></p>
137
+ </div>
138
+ </div>
139
+ <?php
140
+ $html = ob_get_clean();
141
+ }
142
+ elseif ( $status == 'sign_up' ) {
143
+ $step = 2;
144
+ $connected = FALSE;
145
+ $cont_class = 'twb-sign_up-booster-container';
146
+ $title = __('10Web Booster plugin is installed!', 'tenweb-booster');
147
+ $description = $params['section_booster_desc'];
148
+ ob_start();
149
+ ?>
150
+ <input type="email" class="twb-sign-up-input" placeholder="<?php esc_html_e('Email address', 'tenweb-booster'); ?>" />
151
+ <div class="twb-sign-up-dashboard-button-container">
152
+ <a class="twb-booster-button twb-sign-up-dashboard-button"
153
+ data-parent_slug="<?php echo esc_attr($params['submenu_parent_slug']); ?>"
154
+ data-slug="<?php echo esc_attr($params['slug']); ?>"
155
+ data-is_plugin="<?php echo esc_attr($params['is_plugin']); ?>"
156
+ onclick="twb_sign_up_dashboard( this )"><?php esc_html_e('Sign up', 'tenweb-booster'); ?></a>
157
+ <div>
158
+ <?php
159
+ $terms_of_services = '<br /><a href="https://10web.io/terms-of-service/" target="_blank">' . __('Terms of Services', 'tenweb-booster') . '</a>';
160
+ $privacy_policy = '<a href="https://10web.io/privacy-policy/" target="_blank">' . __('Privacy Policy', 'tenweb-booster') . '</a>';
161
+ echo sprintf(__('By signing up, you agree to 10Web’s %s and %s', 'tenweb-booster'), $terms_of_services, $privacy_policy); ?>
162
+ </div>
163
+ </div>
164
+ <?php
165
+ $html = ob_get_clean();
166
+ }
167
+ elseif ( $status == 'connect' ) {
168
+ $step = 0;
169
+ $connected = FALSE;
170
+ $cont_class = 'twb-connect-to-dashboard-container';
171
+ $title = __('10Web Booster plugin is installed!', 'tenweb-booster');
172
+ $description = __('Connect to 10Web dashboard to activate 10Web Booster on your website and start optimization process. Optimization will start automatically.', 'tenweb-booster');
173
+ ob_start();
174
+ ?>
175
+ <div class="twb-sign-up-dashboard-button-container">
176
+ <a class="twb-booster-button twb-connect-to-dashboard-button" onclick="twb_connect_to_dashboard( this )"><?php esc_html_e('Connect', 'tenweb-booster'); ?></a>
177
+ </div>
178
+ <?php
179
+ $html = ob_get_clean();
180
+ }
181
+ elseif ( $status == 'connected' ) {
182
+ $step = $params['tenweb_is_paid'] ? 0 : 2;
183
+ $connected = TRUE;
184
+ $cont_class = 'twb-connected-booster-container' . (!$params['tenweb_is_paid'] ? ' twb-is-free' : '');
185
+ $title = __('10Web Booster is active', 'tenweb-booster');
186
+ $description = __('Our plugin is now optimizing your website.', 'tenweb-booster');
187
+ $description .= __('Manage optimization settings from the 10Web dashboard.', 'tenweb-booster');
188
+ ob_start();
189
+ ?>
190
+ <div class="button-container">
191
+ <a href="<?php echo esc_url($params['dashboard_booster_url']); ?>" target="_blank" class="twb-manage-booster">
192
+ <?php esc_html_e('Manage', 'tenweb-booster'); ?>
193
+ </a>
194
+ </div>
195
+ <?php
196
+ $html = ob_get_clean();
197
+ }
198
+ ?>
199
+ <div class="twb-page-header <?php echo esc_html($cont_class); ?>">
200
+ <?php if ($connected) { ?>
201
+ <div class="twb-connected-booster-done-cont">
202
+ <?php esc_html_e('Site is connected', 'tenweb-booster'); ?>
203
+ </div>
204
+ <?php } ?>
205
+ <?php if ($title) { ?>
206
+ <p class="twb-section-title"><?php echo esc_html($title); ?></p>
207
+ <?php } ?>
208
+ <?php if ($description) { ?>
209
+ <p class="twb-header-description"><?php echo esc_html($description); ?></p>
210
+ <?php } ?>
211
+ <?php if ($step) { ?>
212
+ <ul class="twb-install-booster-steps">
213
+ <li class="<?php echo esc_html($step > 1 ? 'twb_so_check_active' : ''); ?>">
214
+ <?php esc_html_e('Install 10Web Booster', 'tenweb-booster') ?>
215
+ <span><?php esc_html_e('Activate plugin on the website', 'tenweb-booster'); ?></span>
216
+ </li>
217
+ <li class="<?php echo esc_html($step > 2 ? 'twb_so_check_active' : ''); ?>">
218
+ <?php esc_html_e('Sign up and connect', 'tenweb-booster'); ?>
219
+ <span><?php esc_html_e('Start the optimization process', 'tenweb-booster') ?></span>
220
+ </li>
221
+ <li class="<?php echo esc_html($step > 3 ? 'twb_so_check_active' : ''); ?>">
222
+ <?php echo esc_html($params['section_booster_success_title']); ?>
223
+ <span><?php echo esc_html($params['section_booster_success_desc']); ?></span>
224
+ </li>
225
+ </ul>
226
+ <?php } ?>
227
+ <?php if ($html) {
228
+ echo $html;
229
+ } ?>
230
+ </div>
231
+ <?php
232
+ }
233
+
234
+ /**
235
+ * Optimizer section view when booster connected and is pro.
236
+ *
237
+ * @param string $params
238
+ */
239
+ public function optimizer_on_pro( $params ) {
240
+ ?>
241
+ <div class="twb-analyze-img_optimizer-container twb-optimize_on twb-optimize_done">
242
+ <div>
243
+ <p class="twb-section-title"><?php esc_html_e('You’re all set!', 'tenweb-booster') ?></p>
244
+ <p class="twb-header-description"><?php esc_html_e('All images in media library are optimized.', 'tenweb-booster') ?></p>
245
+ <ul>
246
+ <li><span></span><?php esc_html_e('Auto-optimize all uploaded images.', 'tenweb-booster') ?></li>
247
+ <li><span></span><?php esc_html_e('Configure WebP format conversion', 'tenweb-booster') ?></li>
248
+ </ul>
249
+ </div>
250
+ <div class="twb-optimize_on-button-cont">
251
+ <a href="<?php echo esc_url($params['dashboard_booster_url']); ?>" target="_blank"
252
+ class="twb-optimize-add-pages"><?php esc_html_e('Manage', 'tenweb-booster') ?></a>
253
+ </div>
254
+ </div>
255
+ <?php
256
+ }
257
+
258
+ /**
259
+ * Optimizer section view when booster connected and is free.
260
+ *
261
+ * @param string $params
262
+ */
263
+ public function optimizer_on_free_not_connected( $params ) {
264
+ ?>
265
+ <div class="twb-img_optimizer-container twb-img_optimizer-not-container">
266
+ <div class="twb-img_optimizer-left">
267
+ <span class="twb-not-optimized-info"><?php esc_html_e('Not Optimized', 'tenweb-booster') ?></span>
268
+ <h5><?php echo sprintf(_n('%d <span>image</span>', '%d <span>images</span>', $params['images_count'], 'tenweb-booster'), $params['images_count']); ?></h5>
269
+ <ul>
270
+ <li><?php esc_html_e('Optimize all uploaded images', 'tenweb-booster'); ?></li>
271
+ <li><?php esc_html_e('Serve Images in WebP format', 'tenweb-booster'); ?></li>
272
+ <li><?php esc_html_e('Speed up website and reduce load time', 'tenweb-booster'); ?></li>
273
+ </ul>
274
+ </div>
275
+ <div class="twb-img_optimizer-right">
276
+ <div class="twb-img_optimizer-button-container">
277
+ <div class="twb-img_optimizer-info">
278
+ <p class="twb-section-description"><?php esc_html_e('Reduce image size by up to 40% without compromising the quality.', 'tenweb-booster'); ?></p>
279
+ <p class="twb-total_size"><?php esc_html_e('Total size:', 'tenweb-booster'); ?></p>
280
+ <p class="twb-total_size_value"><?php echo esc_html($params['images_total_size']); ?></p>
281
+ </div>
282
+ <a class="twb-img_optimize-now-button"><?php esc_html_e('Optimize Now', 'tenweb-booster'); ?></a>
283
+ </div>
284
+ </div>
285
+ </div>
286
+ <?php
287
+ }
288
+
289
+ /**
290
+ * Optimizer section view when booster connected and is free.
291
+ *
292
+ * @param string $params
293
+ */
294
+ public function optimizer_on_free_connected( $params ) {
295
+ $pages_compressed = $params['pages_compressed'];
296
+ ?>
297
+ <div class="twb-img_optimizer-container">
298
+ <div class="twb-img_optimizer-left">
299
+ <span class="twb-optimized-info"><?php esc_html_e('Optimized for free', 'tenweb-booster') ?></span>
300
+ <h5><?php echo sprintf(_n('%d <span>image</span>', '%d <span>images</span>', $pages_compressed['total_compressed_images'], 'tenweb-booster'), $pages_compressed['total_compressed_images']); ?></h5>
301
+ <p class="twb-section-description"><?php esc_html_e('Image optimization is performed only on 6 pages included in Free plan.', 'tenweb-booster') ?></p>
302
+ <div class="twb-line_info_container">
303
+ <span><?php esc_html_e('Optimized pages', 'tenweb-booster') ?></span>
304
+ <span><?php echo sprintf(__('%d of 6', 'tenweb-booster'), $pages_compressed['compressed_pages_count']); ?></span>
305
+ </div>
306
+ <div class="twb-line_container"><span class="twb-size_<?php echo esc_attr($pages_compressed['compressed_pages_count']); ?>"></span></div>
307
+ <div class="twb-section-bottom">
308
+ <?php
309
+ $home_page = '';
310
+ if ( !empty($pages_compressed['pages']) ) {
311
+ foreach ( $pages_compressed['pages'] as $page ) {
312
+ if ( $page['permalink'] == 'Homepage' ) {
313
+ $home_page = 'twb-hompage-path';
314
+ $path = $page['permalink'];
315
+ }
316
+ else {
317
+ $path = parse_url($page['permalink']);
318
+ $path["path"] = rtrim($path["path"], "/");
319
+ $explode = explode("/", $path["path"]);
320
+ if ( count($explode) > 1 ) {
321
+ $path = '.../' . end($explode);
322
+ }
323
+ else {
324
+ $path = '...' . $path['path'];
325
+ }
326
+ }
327
+ ?>
328
+ <div class="twb-most-image-cont">
329
+ <div class="twb-most-image-cont-path <?php echo esc_attr($home_page); ?>"><?php echo esc_html($path); ?></div>
330
+ <div class="twb-most-image-cont-img-count twb-optimized">
331
+ <?php
332
+ if ( $page['images_count'] ) {
333
+ echo sprintf(_n('%d image', '%d images', $page['images_count'], 'tenweb-booster'), $page['images_count']);
334
+ }
335
+ ?>
336
+ </div>
337
+ </div>
338
+ <?php
339
+ }
340
+ }
341
+ ?>
342
+ </div>
343
+ </div>
344
+ <div class="twb-img_optimizer-right">
345
+ <span class="twb-not-optimized-info"><?php esc_html_e('Not Optimized', 'tenweb-booster') ?></span>
346
+ <h5><?php echo sprintf(_n('%d <span>image</span>', '%d <span>images</span>', $pages_compressed['total_not_compressed_images_count'], 'tenweb-booster'), $pages_compressed['total_not_compressed_images_count']); ?></h5>
347
+ <ul>
348
+ <li><?php esc_html_e('Specify the most image-heavy pages', 'tenweb-booster') ?></li>
349
+ <li><?php esc_html_e('Optimize pages with photo galleries', 'tenweb-booster') ?></li>
350
+ </ul>
351
+ <p><?php esc_html_e('Add pages with images you’d like to optimize.', 'tenweb-booster') ?></p>
352
+ <div class="twb-img_optimizer-button-container">
353
+ <div class="twb-img_optimizer-info">
354
+ <p><?php esc_html_e('Total size:', 'tenweb-booster') ?></p>
355
+ <p><?php echo esc_html($pages_compressed['total_not_compressed_images_size']) ?></p>
356
+ </div>
357
+ <a class="twb-img_add_pages_button" target="_blank" href="<?php echo esc_url($params['dashboard_booster_url']); ?>"><?php esc_html_e('Add pages', 'tenweb-booster'); ?></a>
358
+ </div>
359
+ </div>
360
+ </div>
361
+ <?php
362
+ }
363
+
364
+ /**
365
+ * Top banner.
366
+ *
367
+ * @param array $params
368
+ */
369
+ public function top_banner( $params = array() ) {
370
+ wp_enqueue_style(TenWebBooster::PREFIX . '-top-banner');
371
+ $button = $params['button'];
372
+ ?>
373
+ <div class="twb-booster-top-banner">
374
+ <?php if ( $params['notice'] ) { ?>
375
+ <p class="twb-booster-top-banner-wrapper-note">
376
+ <span class="twb-booster-top-banner-wrapper-note--text">
377
+ <?php echo esc_html($params['notice']); ?>
378
+ </span>
379
+ </p>
380
+ <?php } ?>
381
+ <div class="twb-booster-top-banner-wrapper">
382
+ <div>
383
+ <p class="twb-booster-top-banner-wrappe--images-count">
384
+ <?php echo esc_html($params['title']); ?>
385
+ </p>
386
+ <p>
387
+ <?php echo esc_html($params['desc']); ?>
388
+ </p>
389
+ </div>
390
+ <div>
391
+ <a href="<?php echo esc_url($button['url']); ?>" <?php echo esc_attr($button['target']); ?> class="twb-booster-top-banner-wrappe--button"><?php echo esc_html($button['name']); ?></a>
392
+ </div>
393
+ </div>
394
+ </div>
395
+ <?php
396
+ }
397
+
398
+ /**
399
+ * @param $params
400
+ *
401
+ * @return false|string
402
+ */
403
+ protected function popup() {
404
+ $params = array(
405
+ 'title' => __('Image optimization is not active', 'tenweb-booster'),
406
+ 'description' => __('Complete the sign up process to optimize your images for better website performance.', 'tenweb-booster'),
407
+ 'html' => '<input type="email" class="twb-sign-up-input" placeholder="Email address" />',
408
+ 'button1' => array(
409
+ 'title' => __('Sign up', 'tenweb-booster'),
410
+ 'action' => 'onclick=\'twb_sign_up_dashboard( this );\'',
411
+ 'class' => 'twb-primary',
412
+ ),
413
+ 'html2' => sprintf(__('By signing up, you agree to 10Web’s. %s and %s', 'tenweb-booster'),
414
+ '<a href="https://10web.io/terms-of-service/" target="_blank">' . __('Terms of Services', 'tenweb-booster') . '</a>',
415
+ '<a href="https://10web.io/privacy-policy/" target="_blank">' . __('Privacy Policy', 'tenweb-booster') . '</a>'),
416
+ 'dismiss' => array(
417
+ 'action' => 'onclick=\'twb_leaving_popup = true; jQuery(".twb-popup-overlay").addClass("twb-hidden");\'',
418
+ ),
419
+ );
420
+ ob_start();
421
+ ?>
422
+ <div class="twb-hidden twb-popup-overlay">
423
+ <?php
424
+ if (isset($params['dismiss'])) {
425
+ ?>
426
+ <div class="twb-popup-dismiss" <?php echo $params['dismiss']['action']; ?>></div>
427
+ <?php
428
+ }
429
+ ?>
430
+ <div class="twb-popup">
431
+ <div class="twb-popup-content">
432
+ <div class="twb-popup-title"><?php echo esc_html($params['title']); ?></div>
433
+ <div class="twb-popup-description"><?php echo esc_html($params['description']); ?></div>
434
+ <?php
435
+ if (isset($params['html'])) {
436
+ ?>
437
+ <div class="twb-html"><?php echo ($params['html']); ?></div>
438
+ <?php
439
+ }
440
+ ?>
441
+ </div>
442
+ <?php
443
+ if (isset($params['button1']) || isset($params['button2'])) {
444
+ ?>
445
+ <div class="twb-popup-button">
446
+ <?php
447
+ if (isset($params['button1'])) {
448
+ ?>
449
+ <a <?php echo $params['button1']['action']; ?> class="wd-float-left <?php echo esc_html($params['button1']['class']); ?>"><?php echo esc_html($params['button1']['title']); ?></a>
450
+ <?php
451
+ }
452
+ if (isset($params['button2'])) {
453
+ ?>
454
+ <a <?php echo $params['button2']['action']; ?> class="wd-float-right <?php echo esc_html($params['button2']['class']); ?>"><?php echo esc_html($params['button2']['title']); ?></a>
455
+ <?php
456
+ }
457
+ if (isset($params['html2'])) {
458
+ ?>
459
+ <span class="twb-html"><?php echo ($params['html2']); ?></span>
460
+ <?php
461
+ }
462
+ ?>
463
+ </div>
464
+ <?php
465
+ }
466
+ ?>
467
+ </div>
468
+ </div>
469
+ <?php
470
+ return ob_get_clean();
471
+ }
472
+ }
form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://10web.io/plugins/wordpress-form-maker/?utm_source=form_maker&utm_medium=free_plugin
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
- * Version: 1.15.6
7
  * Author: 10Web Form Builder Team
8
  * Author URI: https://10web.io/plugins/?utm_source=form_maker&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -103,8 +103,8 @@ final class WDFM {
103
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
104
  $this->front_urls = $this->get_front_urls();
105
  $this->main_file = plugin_basename(__FILE__);
106
- $this->plugin_version = '1.15.6';
107
- $this->db_version = '2.15.6';
108
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
109
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
110
  $this->menu_slug = 'manage' . $this->menu_postfix;
@@ -1876,3 +1876,22 @@ function fm_add_plugin_meta_links( $meta_fields, $file ) {
1876
  if ( WDFMInstance(1)->is_free ) {
1877
  add_filter("plugin_row_meta", 'fm_add_plugin_meta_links', 10, 2);
1878
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://10web.io/plugins/wordpress-form-maker/?utm_source=form_maker&utm_medium=free_plugin
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
+ * Version: 1.15.7
7
  * Author: 10Web Form Builder Team
8
  * Author URI: https://10web.io/plugins/?utm_source=form_maker&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
103
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
104
  $this->front_urls = $this->get_front_urls();
105
  $this->main_file = plugin_basename(__FILE__);
106
+ $this->plugin_version = '1.15.7';
107
+ $this->db_version = '2.15.7';
108
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
109
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
110
  $this->menu_slug = 'manage' . $this->menu_postfix;
1876
  if ( WDFMInstance(1)->is_free ) {
1877
  add_filter("plugin_row_meta", 'fm_add_plugin_meta_links', 10, 2);
1878
  }
1879
+
1880
+ require_once(WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)) . '/booster/init.php');
1881
+ add_action('init', function() {
1882
+ TWB(array(
1883
+ 'submenu' => array(
1884
+ 'parent_slug' => 'manage_fm',
1885
+ 'title' => 'Speed Optimization',
1886
+ ),
1887
+ 'page' => array(
1888
+ 'slug' => 'form-maker',
1889
+ 'section_booster_title' => 'Optimize forms and increase your conversions',
1890
+ 'section_booster_desc' => 'Use the free 10Web Booster plugin to automatically optimize pages with forms and boost performance.',
1891
+ 'section_booster_success_title' => 'Optimize pages with forms',
1892
+ 'section_booster_success_desc' => 'Improve website performance',
1893
+ 'section_optimize_images' => FALSE,
1894
+ 'section_analyze_desc' => 'Speed up your website and increase conversions by optimizing all pages that include forms.',
1895
+ ),
1896
+ ));
1897
+ }, 11);
framework/WDW_FM_Library.php CHANGED
@@ -4596,7 +4596,8 @@ class WDW_FM_Library {
4596
  $fm_script_dir = $wp_upload_dir['basedir'] . $frontend_dir . 'js/fm-script-' . $form_id . '.js';
4597
  $fm_script_url = $front_urls['upload_url'] . $frontend_dir . 'js/fm-script-' . $form_id . '.js';
4598
 
4599
- if ( !$force_rewrite && @file_get_contents($fm_script_url) ) {
 
4600
  WDW_FM_Library(self::PLUGIN)->update_file_read_option(0);
4601
  return;
4602
  }
@@ -4605,13 +4606,11 @@ class WDW_FM_Library {
4605
  file_put_contents( $fm_script_dir, self::get_fm_js_content($form_id) );
4606
 
4607
  if ( WDFMInstance(self::PLUGIN)->fm_settings['fm_file_read'] == '0' ) {
4608
- $file_is_readable = @file_get_contents($fm_script_url);
4609
  if ( !$file_is_readable ) {
4610
  WDW_FM_Library(self::PLUGIN)->update_file_read_option(1);
4611
  }
4612
  }
4613
  else if ( WDFMInstance(self::PLUGIN)->fm_settings['fm_file_read'] == '1' ) {
4614
- $file_is_readable = @file_get_contents($fm_script_url);
4615
  if ( $file_is_readable ) {
4616
  WDW_FM_Library(self::PLUGIN)->update_file_read_option(0);
4617
  }
@@ -4858,7 +4857,7 @@ class WDW_FM_Library {
4858
  $data_temp[stripslashes($label_titles[$h])] = $matrix;
4859
  }
4860
  else {
4861
- $val = strip_tags(htmlspecialchars_decode($element_value));
4862
  $val = stripslashes(str_replace('&#039;', "'", $val));
4863
  $data_temp[stripslashes($label_titles[$h])] = $val;
4864
  }
4596
  $fm_script_dir = $wp_upload_dir['basedir'] . $frontend_dir . 'js/fm-script-' . $form_id . '.js';
4597
  $fm_script_url = $front_urls['upload_url'] . $frontend_dir . 'js/fm-script-' . $form_id . '.js';
4598
 
4599
+ $file_is_readable = file_get_contents($fm_script_dir);
4600
+ if ( !$force_rewrite && $file_is_readable ) {
4601
  WDW_FM_Library(self::PLUGIN)->update_file_read_option(0);
4602
  return;
4603
  }
4606
  file_put_contents( $fm_script_dir, self::get_fm_js_content($form_id) );
4607
 
4608
  if ( WDFMInstance(self::PLUGIN)->fm_settings['fm_file_read'] == '0' ) {
 
4609
  if ( !$file_is_readable ) {
4610
  WDW_FM_Library(self::PLUGIN)->update_file_read_option(1);
4611
  }
4612
  }
4613
  else if ( WDFMInstance(self::PLUGIN)->fm_settings['fm_file_read'] == '1' ) {
 
4614
  if ( $file_is_readable ) {
4615
  WDW_FM_Library(self::PLUGIN)->update_file_read_option(0);
4616
  }
4857
  $data_temp[stripslashes($label_titles[$h])] = $matrix;
4858
  }
4859
  else {
4860
+ $val = strip_tags(html_entity_decode($element_value));
4861
  $val = stripslashes(str_replace('&#039;', "'", $val));
4862
  $data_temp[stripslashes($label_titles[$h])] = $val;
4863
  }
frontend/models/form_maker.php CHANGED
@@ -2385,6 +2385,16 @@ class FMModelForm_maker {
2385
  case "type_hidden": {
2386
  $post_key = str_replace(' ', '_', $label_label[$key]);
2387
  $value = WDW_FM_Library(self::PLUGIN)->get($post_key);
 
 
 
 
 
 
 
 
 
 
2388
  foreach ( $key_values as $_key => $_value ) {
2389
  $value = str_replace( array( '{' . $_key . '}' ), $_value, $value );
2390
  }
2385
  case "type_hidden": {
2386
  $post_key = str_replace(' ', '_', $label_label[$key]);
2387
  $value = WDW_FM_Library(self::PLUGIN)->get($post_key);
2388
+ $pdf_data = array('attach_to_admin' => 0, 'attach_to_user' => 0, 'pdf_url' => '');
2389
+ if ( WDFMInstance(self::PLUGIN)->is_free != 2 ) {
2390
+ $pdf_data = apply_filters( 'fm_pdf_data_frontend', $pdf_data, array( 'form_id' => $id ) );
2391
+ }
2392
+ if ( !empty($pdf_data['pdf_url']) ) {
2393
+ $value = str_replace('{PDF(link)}', site_url($pdf_data['pdf_url']), $value);
2394
+ $exp = explode('/pdf/', $value);
2395
+ $title = $exp[1];
2396
+ $value = '<a href="' . $value . '" target="_blank">' . $title . '</a>';
2397
+ }
2398
  foreach ( $key_values as $_key => $_value ) {
2399
  $value = str_replace( array( '{' . $_key . '}' ), $_value, $value );
2400
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,10web,wdsupport,formmakersupport
3
  Tags: form, forms, form builder, contact form, feedback, custom form, contact, web contact form, captcha, email, form manager, survey
4
  Requires at least: 4.6
5
  Tested up to: 6.1
6
- Stable tag: 1.15.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -561,6 +561,11 @@ Where **{{field_id}}** is the ID of the field you wish to prefill. Also, **{{par
561
 
562
 
563
  == Changelog ==
 
 
 
 
 
564
  = 1.15.6 =
565
  * Fixed: Security vulnerability.
566
  * Fixed: Compatibility with Elementor latest version.
3
  Tags: form, forms, form builder, contact form, feedback, custom form, contact, web contact form, captcha, email, form manager, survey
4
  Requires at least: 4.6
5
  Tested up to: 6.1
6
+ Stable tag: 1.15.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
561
 
562
 
563
  == Changelog ==
564
+ = 1.15.7 =
565
+ * Added: 10Web Booster integration.
566
+ * Fixed: Special chars in exported submission.
567
+ * Fixed: PDF link in submission.
568
+
569
  = 1.15.6 =
570
  * Fixed: Security vulnerability.
571
  * Fixed: Compatibility with Elementor latest version.