@@ -391,93 +391,6 @@ public function update_cloud_sites_default() {
391
391
update_option ( self ::OLD_USER_ENABLED_CL , 'yes ' );
392
392
}
393
393
394
- /**
395
- * Adds Optimole tag to admin bar
396
- */
397
- public function add_report_menu () {
398
- global $ wp_admin_bar ;
399
-
400
- $ wp_admin_bar ->add_node (
401
- [
402
- 'id ' => 'optml_report_script ' ,
403
- 'href ' => '# ' ,
404
- 'title ' => '<span class="ab-icon"></span>Optimole ' . __ ( 'debugger ' , 'optimole-wp ' ),
405
- ]
406
- );
407
- $ wp_admin_bar ->add_menu (
408
- [
409
- 'id ' => 'optml_status ' ,
410
- 'title ' => __ ( 'Troubleshoot this page ' , 'optimole-wp ' ),
411
- 'parent ' => 'optml_report_script ' ,
412
- ]
413
- );
414
- }
415
-
416
- /**
417
- * Adds Optimole css to admin bar
418
- */
419
- public function print_report_css () {
420
- ?>
421
- <style type="text/css">
422
- li#wp-admin-bar-optml_report_script > div :hover {
423
- cursor: pointer;
424
- color: #00b9eb !important;
425
- text-decoration: underline;
426
- }
427
-
428
- #wpadminbar #wp-admin-bar-optml_report_script .ab-icon:before {
429
- content: "\f227";
430
- top: 3px;
431
- }
432
-
433
- /* The Modal (background) */
434
- .optml-modal {
435
- display: none; /* Hidden by default */
436
- position: fixed; /* Stay in place */
437
- z-index: 2147483641; /* Sit on top */
438
- padding-top: 100px; /* Location of the box */
439
- left: 0;
440
- top: 0;
441
- width: 100%; /* Full width */
442
- height: 100%; /* Full height */
443
- overflow: auto; /* Enable scroll if needed */
444
- background-color: rgb(0, 0, 0); /* Fallback color */
445
- background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
446
- }
447
-
448
- /* Modal Content */
449
- .optml-modal-content {
450
- background-color: #fefefe;
451
- margin: auto;
452
- padding: 20px;
453
- border: 1px solid #888;
454
- width: 80%;
455
- }
456
-
457
- /* The Close Button */
458
- .optml-close {
459
- color: #aaaaaa;
460
- float: right;
461
- font-size: 28px;
462
- font-weight: bold;
463
- }
464
-
465
- .optml-modal-content ul {
466
- list-style: none;
467
- font-size: 80%;
468
- margin-top: 50px;
469
- }
470
-
471
- .optml-close:hover,
472
- .optml-close:focus {
473
- color: #000;
474
- text-decoration: none;
475
- cursor: pointer;
476
- }
477
- </style>
478
- <?php
479
- }
480
-
481
394
/**
482
395
* Register public actions.
483
396
*/
@@ -488,12 +401,7 @@ public function register_public_actions() {
488
401
if ( Optml_Manager::should_ignore_image_tags () ) {
489
402
return ;
490
403
}
491
- if ( ! is_admin () && $ this ->settings ->get ( 'report_script ' ) === 'enabled ' && current_user_can ( 'manage_options ' ) ) {
492
404
493
- add_action ( 'wp_head ' , [ $ this , 'print_report_css ' ] );
494
- add_action ( 'wp_before_admin_bar_render ' , [ $ this , 'add_report_menu ' ] );
495
- add_action ( 'wp_enqueue_scripts ' , [ $ this , 'add_diagnosis_script ' ] );
496
- }
497
405
if ( ! $ this ->settings ->use_lazyload ()
498
406
|| ( $ this ->settings ->get ( 'native_lazyload ' ) === 'enabled '
499
407
&& $ this ->settings ->get ( 'video_lazyload ' ) === 'disabled '
@@ -611,24 +519,6 @@ public function inline_bootstrap_script() {
611
519
echo $ output ;
612
520
}
613
521
614
- /**
615
- * Adds script for lazyload/js replacement.
616
- */
617
- public function add_diagnosis_script () {
618
-
619
- wp_enqueue_script ( 'optml-report ' , OPTML_URL . 'assets/js/report_script.js ' );
620
- $ ignored_domains = [ 'gravatar.com ' , 'instagram.com ' , 'fbcdn ' ];
621
- $ report_script = [
622
- 'optmlCdn ' => $ this ->settings ->get_cdn_url (),
623
- 'restUrl ' => untrailingslashit ( rest_url ( OPTML_NAMESPACE . '/v1 ' ) ) . '/check_redirects ' ,
624
- 'nonce ' => wp_create_nonce ( 'wp_rest ' ),
625
- 'ignoredDomains ' => $ ignored_domains ,
626
- 'wait ' => __ ( 'We are checking the current page for any issues with optimized images ... ' , 'optimole-wp ' ),
627
- 'description ' => __ ( 'Optimole page analyzer ' , 'optimole-wp ' ),
628
- ];
629
- wp_localize_script ( 'optml-report ' , 'reportScript ' , $ report_script );
630
- }
631
-
632
522
/**
633
523
* Add settings links in the plugin listing page.
634
524
*
@@ -1753,13 +1643,6 @@ private function get_dashboard_strings() {
1753
1643
),
1754
1644
'enable_noscript_title ' => __ ( 'Noscript Tag ' , 'optimole-wp ' ),
1755
1645
'enable_gif_replace_title ' => __ ( 'GIF to Video Conversion ' , 'optimole-wp ' ),
1756
- 'enable_report_title ' => __ ( 'Enable Error Diagnosis Tool ' , 'optimole-wp ' ),
1757
- 'enable_report_desc ' => sprintf (
1758
- /* translators: 1 is the starting anchor tag, 2 is the ending anchor tag */
1759
- __ ( 'Activates the Optimole debugging tool in the admin bar for reports on Optimole-related website issues using the built-in diagnostic feature. %1$sLearn more%2$s ' , 'optimole-wp ' ),
1760
- '<a class="inline-block text-purple-gray underline" target=”_blank” href="https://docs.optimole.com/article/1390-how-does-the-error-diagnosis-tool-work"> ' ,
1761
- '</a> '
1762
- ),
1763
1646
'enable_offload_media_title ' => __ ( 'Store Your Images in Optimole Cloud ' , 'optimole-wp ' ),
1764
1647
'enable_offload_media_desc ' => sprintf ( /* translators: 1 is the starting anchor tag, 2 is the ending anchor tag */ __ ( 'Free up space on your server by transferring your images to Optimole Cloud; you can transfer them back anytime. Once moved, the images will still be visible in the Media Library and can be used as before. %1$sLearn more%2$s ' , 'optimole-wp ' ), '<a class="inline-block text-purple-gray underline" target=”_blank” href="https://docs.optimole.com/article/1967-store-your-images-in-optimole-cloud"> ' , '</a> ' ),
1765
1648
'enable_cloud_images_title ' => __ ( 'Unified Image Access ' , 'optimole-wp ' ),
0 commit comments