Changeset 2509676
- Timestamp:
- 04/05/2021 09:19:32 PM (5 years ago)
- Location:
- plugin-optimizer
- Files:
-
- 78 added
- 18 edited
-
tags/1.0.7 (added)
-
tags/1.0.7/README.txt (added)
-
tags/1.0.7/admin (added)
-
tags/1.0.7/admin/class-po-admin-ajax.php (added)
-
tags/1.0.7/admin/class-po-admin-helper.php (added)
-
tags/1.0.7/admin/class-po-admin-pages.php (added)
-
tags/1.0.7/admin/class-po-admin.php (added)
-
tags/1.0.7/admin/css (added)
-
tags/1.0.7/admin/css/po-admin-public.css (added)
-
tags/1.0.7/admin/css/po-admin.css (added)
-
tags/1.0.7/admin/css/simplebar.css (added)
-
tags/1.0.7/admin/img (added)
-
tags/1.0.7/admin/img/check_mark.png (added)
-
tags/1.0.7/admin/img/noimage.png (added)
-
tags/1.0.7/admin/index.php (added)
-
tags/1.0.7/admin/js (added)
-
tags/1.0.7/admin/js/po-admin-menu-fix.js (added)
-
tags/1.0.7/admin/js/po-admin-menu-get.js (added)
-
tags/1.0.7/admin/js/po-admin.js (added)
-
tags/1.0.7/admin/js/simplebar.min.js (added)
-
tags/1.0.7/admin/pages (added)
-
tags/1.0.7/admin/pages/page-categories-edit.php (added)
-
tags/1.0.7/admin/pages/page-categories-list.php (added)
-
tags/1.0.7/admin/pages/page-filters-edit.php (added)
-
tags/1.0.7/admin/pages/page-filters-list.php (added)
-
tags/1.0.7/admin/pages/page-groups-edit.php (added)
-
tags/1.0.7/admin/pages/page-groups-list.php (added)
-
tags/1.0.7/admin/pages/page-overview-content.php (added)
-
tags/1.0.7/admin/pages/page-overview.php (added)
-
tags/1.0.7/admin/pages/page-settings.php (added)
-
tags/1.0.7/admin/pages/page-support.php (added)
-
tags/1.0.7/admin/pages/page-worklist.php (added)
-
tags/1.0.7/assets (added)
-
tags/1.0.7/assets/icon-128x128-white.png (added)
-
tags/1.0.7/assets/icon-128x128.png (added)
-
tags/1.0.7/includes (added)
-
tags/1.0.7/includes/class-po-activator.php (added)
-
tags/1.0.7/includes/class-po-deactivator.php (added)
-
tags/1.0.7/includes/class-po-i18n.php (added)
-
tags/1.0.7/includes/class-po-mu.php (added)
-
tags/1.0.7/includes/class-po-woocommerce.php (added)
-
tags/1.0.7/includes/class-po.php (added)
-
tags/1.0.7/includes/index.php (added)
-
tags/1.0.7/index.php (added)
-
tags/1.0.7/languages (added)
-
tags/1.0.7/languages/plugin-optimizer.pot (added)
-
tags/1.0.7/licence.txt (added)
-
tags/1.0.7/plugin-optimizer.php (added)
-
tags/1.0.7/uninstall.php (added)
-
tags/1.0.7/vendor (added)
-
tags/1.0.7/vendor/appsero (added)
-
tags/1.0.7/vendor/appsero/client (added)
-
tags/1.0.7/vendor/appsero/client/.gitignore (added)
-
tags/1.0.7/vendor/appsero/client/composer.json (added)
-
tags/1.0.7/vendor/appsero/client/readme.md (added)
-
tags/1.0.7/vendor/appsero/client/src (added)
-
tags/1.0.7/vendor/appsero/client/src/Client.php (added)
-
tags/1.0.7/vendor/appsero/client/src/Insights.php (added)
-
tags/1.0.7/vendor/appsero/client/src/License.php (added)
-
tags/1.0.7/vendor/appsero/client/src/Updater.php (added)
-
tags/1.0.7/vendor/autoload.php (added)
-
tags/1.0.7/vendor/composer (added)
-
tags/1.0.7/vendor/composer/ClassLoader.php (added)
-
tags/1.0.7/vendor/composer/InstalledVersions.php (added)
-
tags/1.0.7/vendor/composer/LICENSE (added)
-
tags/1.0.7/vendor/composer/autoload_classmap.php (added)
-
tags/1.0.7/vendor/composer/autoload_namespaces.php (added)
-
tags/1.0.7/vendor/composer/autoload_psr4.php (added)
-
tags/1.0.7/vendor/composer/autoload_real.php (added)
-
tags/1.0.7/vendor/composer/autoload_static.php (added)
-
tags/1.0.7/vendor/composer/installed.json (added)
-
tags/1.0.7/vendor/composer/installed.php (added)
-
tags/1.0.7/vendor/composer/platform_check.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-po-admin-ajax.php (modified) (1 diff)
-
trunk/admin/class-po-admin-helper.php (modified) (4 diffs)
-
trunk/admin/class-po-admin-pages.php (modified) (1 diff)
-
trunk/admin/class-po-admin.php (modified) (2 diffs)
-
trunk/admin/css/po-admin-public.css (modified) (3 diffs)
-
trunk/admin/css/po-admin.css (modified) (15 diffs)
-
trunk/admin/css/simplebar.css (added)
-
trunk/admin/js/po-admin-menu-get.js (modified) (2 diffs)
-
trunk/admin/js/po-admin.js (modified) (13 diffs)
-
trunk/admin/js/simplebar.min.js (added)
-
trunk/admin/pages/page-categories-list.php (modified) (1 diff)
-
trunk/admin/pages/page-filters-edit.php (modified) (9 diffs)
-
trunk/admin/pages/page-filters-list.php (modified) (1 diff)
-
trunk/admin/pages/page-groups-edit.php (modified) (1 diff)
-
trunk/admin/pages/page-groups-list.php (modified) (1 diff)
-
trunk/admin/pages/page-overview.php (modified) (1 diff)
-
trunk/assets (added)
-
trunk/assets/icon-128x128-white.png (added)
-
trunk/assets/icon-128x128.png (added)
-
trunk/includes/class-po-mu.php (modified) (3 diffs)
-
trunk/includes/class-po.php (modified) (1 diff)
-
trunk/plugin-optimizer.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugin-optimizer/trunk/README.txt
r2505578 r2509676 4 4 Requires at least: 5.0 5 5 Tested up to: 5.7 6 Stable tag: 1.0. 66 Stable tag: 1.0.7 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 58 58 == Changelog == 59 59 60 = 1.0.7 = April 2021 61 * Bugfixes and UI polishing 62 60 63 = 1.0.6 = March 2021 61 64 * The MU plugin will always be the same version as the main file -
plugin-optimizer/trunk/admin/class-po-admin-ajax.php
r2501831 r2509676 92 92 93 93 94 if( ! empty( $data[" categories"] ) ){95 96 $category_ids = array_map( 'intval', array_keys( $data[" categories"] ) );94 if( ! empty( $data["meta"]["categories"] ) ){ 95 96 $category_ids = array_map( 'intval', array_keys( $data["meta"]["categories"] ) ); 97 97 98 98 $set_categories = wp_set_object_terms( $post_id, $category_ids, "сategories_filters" ); 99 100 99 } 101 100 -
plugin-optimizer/trunk/admin/class-po-admin-helper.php
r2505578 r2509676 5 5 6 6 class SOSPO_Admin_Helper { 7 8 static function sort__by_post_title( $a, $b ){ 9 10 return strnatcasecmp( $a->post_title, $b->post_title ); 11 } 12 13 static function sort__by_cat_name( $a, $b ){ 14 15 return strnatcasecmp( $a->cat_name, $b->cat_name ); 16 } 7 17 8 18 static function get_filter_endpoints( $filter, $add_home = false ) { … … 163 173 if( $data["plugins"] ){ 164 174 165 echo '<div class="plugin-wrapper">'; 175 natsort( $data["plugins"] ); 176 177 echo '<div class="special_grid_list">'; 166 178 167 179 foreach( $data["plugins"] as $plugin_id => $plugin_name ){ … … 229 241 $turned_on_checked = $turned_off !== "1" ? ' checked="checked"' : ''; 230 242 243 $has_tooltip_class = ""; 244 $tooltip_list = ""; 245 246 if( count( $blocking_plugins ) > 0 ){ 247 248 $has_tooltip_class = "has_tooltip"; 249 $tooltip_list = 'class="tooltip_trigger" data-tooltip-list="' . htmlspecialchars( json_encode( $blocking_plugins ), ENT_QUOTES, 'UTF-8' ) . '"'; 250 } 251 231 252 ?> 232 253 <tr class="block_info" id="filter-<?php echo $filter->ID ?>" data-status="<?php echo $filter->post_status ?>" data-date="<?php echo $date ?>" data-type="<?php echo $type ?>"> … … 235 256 <td class="align-left normal-text"><?php echo $categories ?></td> 236 257 <td class="data-trigger align-left normal-text"><?php echo $trigger ?></td> 237 <td class="expandable list_of_plugins"><span class="no_hover"><?php echo count( $blocking_plugins ) ?></span><span class="yes_hover"><?php echo implode( ',<br/>', $blocking_plugins ); ?></span></td> 258 <td class="list_of_plugins <?php echo $has_tooltip_class; ?>"> 259 <span <?php echo $tooltip_list; ?>><?php echo count( $blocking_plugins ) ?></span> 260 </td> 238 261 <td class="toggle_filter"> 239 262 <label> -
plugin-optimizer/trunk/admin/class-po-admin-pages.php
r2505578 r2509676 22 22 // TODO SWITCH 23 23 24 // add_menu_page( 'Plugin Optimizer', 'Plugin Optimizer', 'manage_options', 'plugin_optimizer', [ $this, 'render_overview_page' ], ' dashicons-sos' );24 // add_menu_page( 'Plugin Optimizer', 'Plugin Optimizer', 'manage_options', 'plugin_optimizer', [ $this, 'render_overview_page' ], 'none' ); 25 25 // add_submenu_page( 'plugin_optimizer', 'Overview', 'Overview', 'manage_options', 'plugin_optimizer', [ $this, 'render_overview_page' ] ); 26 26 // add_submenu_page( 'plugin_optimizer', 'Filters', 'Filters', 'manage_options', 'plugin_optimizer_filters', [ $this, 'render_filters_page' ] ); 27 27 28 add_menu_page( 'Plugin Optimizer', 'Plugin Optimizer', 'manage_options', 'plugin_optimizer', [ $this, 'render_filters_page' ], ' dashicons-sos' );28 add_menu_page( 'Plugin Optimizer', 'Plugin Optimizer', 'manage_options', 'plugin_optimizer', [ $this, 'render_filters_page' ], 'none' ); 29 29 add_submenu_page( 'plugin_optimizer', 'Filters', 'Filters', 'manage_options', 'plugin_optimizer', [ $this, 'render_filters_page' ] ); 30 30 -
plugin-optimizer/trunk/admin/class-po-admin.php
r2505578 r2509676 119 119 120 120 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/po-admin.css', array(), $this->version, 'all' ); 121 wp_enqueue_style( $this->plugin_name . '-simplebar', plugin_dir_url( __FILE__ ) . 'css/simplebar.css', array(), $this->version, 'all' ); 121 122 } 122 123 } … … 187 188 188 189 } 190 191 $version = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/simplebar.min.js' )); 192 wp_register_script( $this->plugin_name . '-simplebar', plugin_dir_url( __FILE__ ) . 'js/simplebar.min.js', array( 'jquery' ), $version, true ); 193 wp_enqueue_script( $this->plugin_name . '-simplebar' ); 189 194 190 195 $version = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/po-admin.js' )); -
plugin-optimizer/trunk/admin/css/po-admin-public.css
r2501831 r2509676 49 49 } 50 50 51 51 #toplevel_page_plugin_optimizer .wp-menu-image{ 52 background-image: url('../../assets/icon-128x128.png'); 53 background-size: 20px auto; 54 background-repeat: no-repeat; 55 background-position: center; 56 } 57 #toplevel_page_plugin_optimizer.wp-menu-open .wp-menu-image{ 58 background-image: url('../../assets/icon-128x128-white.png'); 59 } 52 60 /* #toplevel_page_plugin_optimizer ul li:nth-child(9), */ 53 61 /* #toplevel_page_plugin_optimizer ul li:nth-child(7), */ … … 90 98 top: calc( 50% - 50px ); 91 99 left: calc( 50% - 150px ); 100 box-sizing: border-box; 92 101 width: 300px; 93 102 height: 100px; 94 103 display: flex; 104 flex-flow: column nowrap; 105 align-items: flex-start; 95 106 justify-content: center; 96 align-items: center;97 107 border: 3px solid #369451; 98 108 border-radius: 3px; 99 109 background-color: #fff; 100 110 text-align: center; 111 padding-left: 100px; 112 background-image: url('../../assets/icon-128x128.png'); 113 background-size: 60px auto; 114 background-repeat: no-repeat; 115 background-position: 20px center; 116 } 117 body.po_is_recreating_menu #po_please_wait_message b{ 118 font-size: 16px; 119 margin-bottom: 6px; 101 120 } 102 121 … … 112 131 113 132 .sos-icon:before { 114 font-family: "dashicons"; 115 content: "\f468"; 133 content: " "; 116 134 display: inline-block; 117 line-height: 1;118 135 width: 20px; 119 136 height: 20px; 120 font-size: 20px;121 137 vertical-align: top; 122 138 margin-top: 6px; 123 color: #fff; 139 background-image: url('../../assets/icon-128x128.png'); 140 background-size: 16px auto; 141 background-repeat: no-repeat; 142 background-position: center; 124 143 } -
plugin-optimizer/trunk/admin/css/po-admin.css
r2501831 r2509676 39 39 40 40 41 . plugin-wrapper> .content > span.close{41 .special_grid_list > .content > span.close{ 42 42 display: none; 43 43 } … … 67 67 margin: 0; 68 68 margin-right: 10px; 69 padding-left: 40px; 69 70 line-height: 36px; 71 background-image: url('../../assets/icon-128x128.png'); 72 background-size: 30px auto; 73 background-repeat: no-repeat; 74 background-position: left 4px; 70 75 } 71 76 #main_title h2{ … … 96 101 /*New design*/ 97 102 98 .sos-wrap {99 overflow-y: auto !important;100 }101 102 103 .sos-wrap * { 103 104 text-transform: uppercase; 105 } 106 107 #the-list *{ 108 text-transform: none; 104 109 } 105 110 … … 315 320 316 321 .sos-wrap .content-filter .header{ 317 margin-bottom: 5px;322 margin-bottom: 10px; 318 323 padding: 5px; 319 324 text-align: left; … … 330 335 331 336 .sos-wrap .content-filter .content{ 332 margin-top: 10px;333 margin-bottom: 10px;334 }335 336 .sos-wrap .content-filter .content{337 337 padding: 10px; 338 margin-top: 5px;339 margin-bottom: 5px;340 338 /* Style for "Validated" */ 341 339 background-color: #ffffff; … … 366 364 } 367 365 368 .sos-wrap .content-filter .plugin-wrapper, .select-filter{ 369 display: grid; 370 grid-template-columns: repeat(3, 1fr); 371 column-gap: 10px; 372 } 373 374 .sos-wrap .content-filter .plugin-wrapper.no-plugins{ 375 /* display: grid; */ 376 /* grid-template-columns: 1fr; */ 377 /* column-gap: 0; */ 378 } 379 .sos-wrap .content-filter .plugin-wrapper.no-plugins *{ 380 /* text-align: center; */ 381 } 382 383 .select-filter .block{ 384 background-color: #ffc4c4; 385 } 386 .sos-wrap .content-filter .plugin-wrapper .block{ 366 .sos-wrap .content-filter .special_grid_list{ 367 display: grid; 368 grid-auto-flow: column; 369 grid-gap: 10px; 370 grid-template-columns: repeat(3, 1fr); 371 grid-template-rows: repeat(5, auto); 372 } 373 374 .sos-wrap .content-filter .special_grid_list .block{ 387 375 background-color: #ffc4c4; 388 376 color: #212529; … … 454 442 } 455 443 456 457 td.expandable:hover .no_hover, 458 td.expandable:not(:hover) .yes_hover{ 459 display: none; 460 } 461 462 td.expandable.list_of_plugins *{ 463 text-transform: none; 464 } 465 444 .list_of_plugins{ 445 position: relative; 446 } 447 .list_of_plugins.has_tooltip{ 448 padding: 5px 15px; 449 cursor: default; 450 } 451 .list_of_plugins.has_tooltip .tooltip_trigger{ 452 position: relative; 453 display: inner-block; 454 padding: 10px; 455 } 456 .list_of_plugins.has_tooltip .active_tooltip{ 457 position: absolute; 458 top: 0; 459 max-height: 208px; 460 z-index: 1; 461 padding: 0; 462 463 background: #555; 464 color: #fff; 465 border: 10px solid #555; 466 border-radius: 4px; 467 468 overflow: visible; 469 overflow-x: hidden; 470 white-space: nowrap; 471 } 472 .list_of_plugins.has_tooltip .active_tooltip .active_tooltip_inner{ 473 display: flex; 474 flex-flow: column nowrap; 475 white-space: nowrap; 476 } 477 .list_of_plugins.has_tooltip.tooltip_is_active:hover .tooltip_trigger:after{ 478 content: " "; 479 position: absolute; 480 left: -20px; 481 top: calc( 50% - 10px ); 482 width: 0; 483 height: 0; 484 border-top: 10px solid transparent; 485 border-bottom: 10px solid transparent; 486 border-left: 10px solid #555; 487 z-index: 1; 488 } 489 .list_of_plugins.has_tooltip .simplebar-content:before, 490 .list_of_plugins.has_tooltip .simplebar-content:after{ 491 display: none; 492 } 493 .list_of_plugins.has_tooltip .simplebar-scrollbar:before{ 494 background: #fff; 495 } 466 496 467 497 .sos-wrap.container{ … … 619 649 } 620 650 621 .select-filter{622 margin-bottom: 5px;623 }624 .select-filter span {625 padding: 10px;626 /*background-color: #ffffff;*/627 text-align: left;628 cursor: pointer;629 border: 1px solid rgba(99, 99, 99, 0.2);630 border-radius: 5px;631 margin: 2px;632 }633 634 .select-filter span:hover{635 box-shadow: rgba(99, 99, 99, 0.2) 0 2px 8px 0;636 /* transform: scale(1.03, 1.03); */637 transition: box-shadow, transform 0.35s ease-in-out;638 }639 640 651 select[name="block_plugins"], select[name="block_group_plugins"], select[name="post_type"], select[name="category_filter"], select[name="cat_parents"], select[name="group_parents"], select[name="group_plugins"]{ 641 652 display: none; … … 713 724 } 714 725 715 .sos-wrap . plugin-wrapper.deactivate-plugin{726 .sos-wrap .special_grid_list .deactivate-plugin{ 716 727 background: gray; 717 728 color: #fff; … … 724 735 } 725 736 726 .sos-wrap . plugin-wrapper.single_plugin{737 .sos-wrap .special_grid_list .single_plugin{ 727 738 cursor: pointer; 728 739 padding: 10px; 729 margin-top: 5px;730 margin-bottom: 5px;731 740 background-color: #ffffff; 732 741 background-color: rgba(198, 185, 205, 0.1); … … 738 747 user-select: none; 739 748 } 740 .sos-wrap . plugin-wrapper.single_plugin.inactive{749 .sos-wrap .special_grid_list .single_plugin.inactive{ 741 750 /* background: gray; */ 742 751 /* color: #fff; */ … … 744 753 /* color: #fff; */ 745 754 } 746 .sos-wrap . plugin-wrapper.single_plugin.blocked{755 .sos-wrap .special_grid_list .single_plugin.blocked{ 747 756 background-color: #ffc4c4; 748 757 background-color: rgba(255, 196, 196, 0.8); 749 758 color: #212529; 750 759 } 751 .sos-wrap . plugin-wrapper.single_plugin:not(.inactive) .plugin_name:before{760 .sos-wrap .special_grid_list .single_plugin:not(.inactive) .plugin_name:before{ 752 761 content: "✓"; 753 762 margin-right: 10px; 754 763 } 755 .sos-wrap . plugin-wrapper.single_plugin.blocked .plugin_name:before{764 .sos-wrap .special_grid_list .single_plugin.blocked .plugin_name:before{ 756 765 content: "X"; 757 766 margin-right: 10px; 758 767 } 759 .sos-wrap . plugin-wrapper.single_plugin .group_name{768 .sos-wrap .special_grid_list .single_plugin .group_name{ 760 769 font-size: 12px; 761 770 font-weight: bold; … … 766 775 } 767 776 768 .sos-wrap . plugin-wrapper.single_group.blocked{777 .sos-wrap .special_grid_list .single_group.blocked{ 769 778 background-color: #ffc4c4; 770 779 background-color: rgba(255, 196, 196, 0.8); 771 780 color: #212529; 772 781 } 773 .sos-wrap . plugin-wrapper.single_group.blocked:before{782 .sos-wrap .special_grid_list .single_group.blocked:before{ 774 783 content: "X"; 775 784 margin-right: 10px; 776 785 } 777 786 778 .sos-wrap . plugin-wrapper.single_category.blocked{787 .sos-wrap .special_grid_list .single_category.blocked{ 779 788 background-color: rgba(198, 255, 205, 0.5); 780 789 color: #212529; 781 790 } 782 .sos-wrap . plugin-wrapper.single_category.blocked:before{791 .sos-wrap .special_grid_list .single_category.blocked:before{ 783 792 content: "✓"; 784 793 margin-right: 10px; … … 789 798 } 790 799 #edit_filter #endpoints_wrapper{ 791 /* display: none; */800 display: none; 792 801 flex-flow: row wrap; 793 802 } … … 1017 1026 background-color: #369451; 1018 1027 background-color: #888; 1028 margin-bottom: 10px; 1019 1029 } 1020 1030 -
plugin-optimizer/trunk/admin/js/po-admin-menu-get.js
r2502985 r2509676 1 1 jQuery(function($){ 2 2 3 $('body').append('<div id="po_please_wait"><div id="po_please_wait_message"> Please wait...</div></div>');3 $('body').append('<div id="po_please_wait"><div id="po_please_wait_message"><b>Plugin Optimizer</b><span>Please wait...</span></div></div>'); 4 4 5 5 … … 56 56 $.post( po_object.ajax_url, data, function( response ) { 57 57 58 $('#po_please_wait_message').html(' Refreshing...');58 $('#po_please_wait_message').html('<b>Plugin Optimizer</b><span>Refreshing...</span>'); 59 59 60 60 window.location.href = po_object.redirect_to ? po_object.redirect_to : window.location.href; -
plugin-optimizer/trunk/admin/js/po-admin.js
r2505578 r2509676 2 2 'use strict'; 3 3 4 4 recalculate__special_grid_lists(); 5 6 7 // Edit screen - Hover a tooltip - Start 8 $('#the-list').on('mouseenter', '.has_tooltip > .tooltip_trigger[data-tooltip-list]', function(){ 9 10 if( $(this).parents(".has_tooltip").hasClass("tooltip_is_active") ){ 11 12 return; 13 } 14 15 $(this).parents(".has_tooltip").addClass("tooltip_is_active"); 16 17 $('#the-list .active_tooltip').remove(); 18 19 20 let list = $(this).data("tooltip-list"); 21 22 if( ! list || list.length == 0 ){ 23 24 return; 25 } 26 27 // console.log( "list: ", list ); 28 // list = list.concat( list, list, list, list, list, list ); 29 // console.log( "list: ", list ); 30 31 32 33 let $tooltip = $('<div class="active_tooltip"><div class="active_tooltip_inner"></div></div>'); 34 let $tooltip_inner = $tooltip.find('.active_tooltip_inner'); 35 36 37 38 $tooltip.css("opacity", 0 ); 39 40 let html = ''; 41 42 $.each( list, function( index, value ){ 43 html += '<div>' + value + '</div>'; 44 }); 45 46 $tooltip_inner.html( html ); 47 48 $(this).after( $tooltip ); 49 50 51 let tooltip_inner__width = $tooltip_inner.outerWidth(); 52 $tooltip.css("width", tooltip_inner__width + 40 ); 53 // console.log( "tooltip_inner__width: ", tooltip_inner__width ); 54 55 let tooltip_height = $tooltip.outerHeight(); 56 let tooltip_width = $tooltip.outerWidth(); 57 let trigger_position = $(this).position(); 58 let trigger_height = $(this).outerHeight(); 59 60 // console.log( "trigger_position_left: " + trigger_position.left + ", trigger_position_top: " + trigger_position.top ); 61 // console.log( "tooltip_height: ", tooltip_height ); 62 // console.log( "tooltip_width: ", tooltip_width ); 63 64 $tooltip.css("left", trigger_position.left - tooltip_width - 20 ); 65 $tooltip.css("top", trigger_position.top + ( trigger_height / 2 ) - ( tooltip_height / 2 ) ); 66 67 $tooltip.hide(); 68 $tooltip.css("opacity", 1 ); 69 70 // https://github.com/Grsmto/simplebar/tree/master/packages/simplebar 71 let simplebar = new SimpleBar( $tooltip[0], { 72 autoHide: false 73 }); 74 75 $tooltip.show(); 76 77 }); 78 79 // Edit screen - Hover a tooltip - End 80 $('#the-list').on('mouseleave', '.has_tooltip', function(){ 81 82 $(this).removeClass("tooltip_is_active"); 83 $(this).parent().find(".active_tooltip").remove(); 84 85 // console.log( "Over and out" ); 86 87 }); 88 89 5 90 // Edit Filter screen - fetch post types 6 91 if( $('#set_filter_type').length >= 1 ){ … … 25 110 26 111 $('#loading_post_types').hide(); 112 113 // TODO It's possible that this 'selected' post_type doesn't exist anymore, so we should: 114 // a) switch to default, or 115 // b) notify the user that there might be an error 116 // it's not necessary an error if the plugin that creates that post type is temporary disabled 27 117 $('#set_filter_type').val( selected ).change().slideDown(); 28 118 … … 139 229 </div> 140 230 `); 231 232 // sort categories alphabetically 233 let $categories_list = $('#add_category').parent(); 234 235 $categories_list.children('.single_category').sort( function( a, b ){ 236 237 let a_title = $(a).children('span').text().trim().toLowerCase(); 238 let b_title = $(b).children('span').text().trim().toLowerCase(); 239 240 return a_title.localeCompare( b_title ); 241 242 }).prependTo( $categories_list ); 243 244 // recalculate rows and columns 245 recalculate__special_grid_lists(); 246 141 247 } 142 248 … … 179 285 180 286 $('input[name="SOSPO_filter_data[ID]"]').val( response.data.id ); 287 288 const url = new URL( window.location.href ); 289 url.searchParams.set( 'filter_id', response.data.id ); 290 window.history.replaceState( null, null, url ); 291 292 $('#name_page').html( 'Editing filter: ' + $('#set_title').val() ); 293 294 window.scroll({ 295 top: 0, 296 left: 0, 297 behavior: 'smooth' 298 }); 181 299 } 182 300 … … 198 316 199 317 $('input[name="SOSPO_filter_data[ID]"]').val( response.data.id ); 318 319 const url = new URL( window.location.href ); 320 url.searchParams.set( 'group_id', response.data.id ); 321 window.history.replaceState( null, null, url ); 322 323 $('#name_page').html( 'Editing group: ' + $('#set_title').val() ); 324 325 window.scroll({ 326 top: 0, 327 left: 0, 328 behavior: 'smooth' 329 }); 200 330 } 201 331 … … 218 348 219 349 $('input[name="SOSPO_filter_data[ID]"]').val( response.data.id ); 350 351 const url = new URL( window.location.href ); 352 url.searchParams.set( 'cat_id', response.data.id ); 353 window.history.replaceState( null, null, url ); 354 355 $('#name_page').html( 'Editing category: ' + $('#set_title').val() ); 356 357 window.scroll({ 358 top: 0, 359 left: 0, 360 behavior: 'smooth' 361 }); 220 362 } 221 363 … … 295 437 $('body').on('input', '.additional_endpoint_wrapper input', function(ev){ 296 438 297 console.log( "Event type: ", ev.type );439 // console.log( "Event type: ", ev.type ); 298 440 299 441 let full_url = new URL( $(this).val(), po_object.home_url ); … … 548 690 let tab_id = $(this).parents('.hidden-info_overview').data('id').replace('tab_', ''); 549 691 550 console.log( "Tab ID: ", tab_id );692 // console.log( "Tab ID: ", tab_id ); 551 693 552 694 $(this).parents('.hidden-info_overview').slideUp( 400, function(){ … … 561 703 562 704 $.post( po_object.ajax_url, { action : 'po_mark_tab_complete', tab_id : tab_id, user_id : po_object.user_id }, function( response ) { 563 console.log( "po_mark_tab_complete: ", response );705 // console.log( "po_mark_tab_complete: ", response ); 564 706 565 707 if( response.data.message ){ … … 582 724 583 725 $.post( po_object.ajax_url, { action : 'po_save_option_alphabetize_menu', should_alphabetize : should }, function( response ) { 584 console.log( "po_save_option_alphabetize_menu: ", response );726 // console.log( "po_save_option_alphabetize_menu: ", response ); 585 727 586 728 if( response.data.message ){ … … 593 735 }); 594 736 595 // Overview: mark tab complete737 // Filters List screen: turn filter on/off 596 738 $('body').on('change', '#the-list .turn_off_filter', function(){ 597 739 … … 603 745 604 746 $.post( po_object.ajax_url, { action : 'po_turn_off_filter', turned_off : turned_off, post_id : post_id }, function( response ) { 605 console.log( "po_save_option_alphabetize_menu: ", response );747 // console.log( "po_save_option_alphabetize_menu: ", response ); 606 748 607 749 if( response.data.message ){ … … 620 762 } 621 763 764 // we need to calculate the rows and columns of .special_grid_list 765 function recalculate__special_grid_lists( columns = 3 ){ 766 767 $('.special_grid_list').each(function( index ){ 768 769 let $grid_list = $(this); 770 771 let items_no = $grid_list.children().length; 772 773 let rows = Math.ceil( items_no / columns ); 774 775 // console.log( "Items: ", items_no ); 776 // console.log( "rows: ", rows ); 777 778 $grid_list.css("grid-template-columns", "repeat(" + columns + ", 1fr )" ); 779 $grid_list.css("grid-template-rows", "repeat(" + rows + ", auto )" ); 780 781 }); 782 783 } 784 622 785 }); -
plugin-optimizer/trunk/admin/pages/page-categories-list.php
r2501831 r2509676 6 6 'hide_empty' => 0, 7 7 ] ); 8 9 if( $categories ){ 10 11 usort( $categories, "SOSPO_Admin_Helper::sort__by_cat_name" ); 12 } 8 13 9 14 ?> -
plugin-optimizer/trunk/admin/pages/page-filters-edit.php
r2501831 r2509676 6 6 'numberposts' => - 1, 7 7 ] ); 8 9 if( $groups ){ 10 11 usort( $groups, "SOSPO_Admin_Helper::sort__by_post_title" ); 12 } 8 13 9 14 $categories = get_categories( [ … … 12 17 'hide_empty' => 0, 13 18 ] ); 14 15 // TODO If all plugins are blocked on this page, this will return only posts and pages16 $post_types = get_post_types( [ 'publicly_queryable' => 1 ] );17 $post_types['page'] = 'page';18 unset( $post_types[ 'attachment' ], $post_types[ 'sos_filter' ], $post_types[ 'sos_group' ], $post_types[ 'sos_work' ] );19 20 natcasesort( $post_types );21 19 22 20 // sospo_mu_plugin()->write_log( $categories, "page-add-filters-categories" ); … … 31 29 $endpoints = []; 32 30 33 $show_endpoints_wrapper = '';34 35 31 // Editing existing filter? 36 32 … … 47 43 $groups_to_block = get_post_meta( $filter->ID, "groups_used", true ); 48 44 $filter_categories = get_post_meta( $filter->ID, "categories", true ); 45 $endpoints = SOSPO_Admin_Helper::get_filter_endpoints( $filter ); 49 46 50 47 if( ! empty( $plugins_to_block ) ){ … … 58 55 if( ! empty( $filter_categories ) ){ 59 56 $filter_categories = array_keys( $filter_categories ); 60 }61 62 // sospo_mu_plugin()->write_log( $filter_type, "page-filters-edit-filter_type" );63 64 if( $filter_type == "_endpoint" || ! in_array( $filter_type, $post_types ) ){65 66 $filter_type = "_endpoint";67 $endpoints = SOSPO_Admin_Helper::get_filter_endpoints( $filter );68 69 } else {70 71 $show_endpoints_wrapper = ' style="display: none;"';72 57 } 73 58 … … 129 114 </div> 130 115 131 <div class="row select_trigger" id="endpoints_wrapper" <?php echo $show_endpoints_wrapper ?>>116 <div class="row select_trigger" id="endpoints_wrapper"> 132 117 133 118 <div class="col-12"> … … 164 149 <?php SOSPO_Admin_Helper::content_part__plugins( [ "plugins" => $plugins["active"], "inactive" => [], "blocked" => $plugins_to_block ] ); ?> 165 150 166 <div class="header attribute-plugin" >Inactive plugins</div>151 <div class="header attribute-plugin" style="margin-top: 10px;">Inactive plugins</div> 167 152 168 153 <?php SOSPO_Admin_Helper::content_part__plugins( [ "plugins" => $plugins["inactive"], "inactive" => $plugins["inactive"], "blocked" => $plugins_to_block ] ); ?> … … 178 163 <span class="all-check toggle_groups">Disable All</span> 179 164 </div> 180 <div class=" plugin-wrapper">165 <div class="special_grid_list"> 181 166 <?php 182 167 if ( $groups ){ … … 209 194 <div class="title">Categories</div> 210 195 </div> 211 <div class=" plugin-wrapper">196 <div class="special_grid_list"> 212 197 <?php 213 198 if ( $categories ){ -
plugin-optimizer/trunk/admin/pages/page-filters-list.php
r2501831 r2509676 5 5 'numberposts' => - 1, 6 6 ) ); 7 8 if( $filters ){ 9 10 usort( $filters, "SOSPO_Admin_Helper::sort__by_post_title" ); 11 } 12 7 13 ?> 8 14 -
plugin-optimizer/trunk/admin/pages/page-groups-edit.php
r2501831 r2509676 49 49 <div class="col-12"> 50 50 51 <div class="header">52 <div class="title">Select plugins <span class="disabled">- <?php echo count( $plugins["all"] ); ?></span></div>53 <span class="all-check toggle_plugins">Disable All</span>54 <span class="count-plugin">( Active: <?php echo count( $plugins["active"] ); ?> | Inactive: <?php echo count( $plugins["inactive"] ); ?> )</span>55 </div>51 <div class="header"> 52 <div class="title">Plugins <span class="disabled">- <?php echo count( $plugins["all"] ); ?></span></div> 53 <span class="count-plugin">( Active: <?php echo count( $plugins["active"] ); ?> | Inactive: <?php echo count( $plugins["inactive"] ); ?> )</span> 54 <span class="all-check toggle_plugins">Disable All</span> 55 </div> 56 56 57 < ?php SOSPO_Admin_Helper::content_part__plugins( [ "plugins" => $plugins["all"], "inactive" => $plugins["inactive"], "blocked" => $plugins_to_block ] ); ?>57 <div class="header attribute-plugin">Active plugins</div> 58 58 59 <?php SOSPO_Admin_Helper::content_part__plugins( [ "plugins" => $plugins["active"], "inactive" => [], "blocked" => $plugins_to_block ] ); ?> 60 61 <div class="header attribute-plugin" style="margin-top: 10px;">Inactive plugins</div> 62 63 <?php SOSPO_Admin_Helper::content_part__plugins( [ "plugins" => $plugins["inactive"], "inactive" => $plugins["inactive"], "blocked" => $plugins_to_block ] ); ?> 64 59 65 </div> 60 66 </div> 61 67 </div> 62 68 <div class="row"> 63 <button id="save_group" class="po_green_button">Save newgroup</button>69 <button id="save_group" class="po_green_button">Save group</button> 64 70 </div> 65 71 -
plugin-optimizer/trunk/admin/pages/page-groups-list.php
r2501831 r2509676 5 5 'numberposts' => - 1, 6 6 ) ); 7 8 if( $groups ){ 9 10 usort( $groups, "SOSPO_Admin_Helper::sort__by_post_title" ); 11 } 12 7 13 ?> 8 14 -
plugin-optimizer/trunk/admin/pages/page-overview.php
r2501831 r2509676 19 19 $tabs = apply_filters( "sos_po_overview_tabs", $tabs ); 20 20 21 $completed_tabs = [ 10, 20, 25 ];// TODO read the array from wp_options22 21 $completed_tabs = get_user_meta( get_current_user_id(), "completed_overview_tabs", true ); 23 22 -
plugin-optimizer/trunk/includes/class-po-mu.php
r2505578 r2509676 4 4 * Plugin URI: https://pluginoptimizer.com 5 5 * Description: This MU plugin is required by the Plugin Optimizer plugin. It will be removed upon deactivation. 6 * Version: 1.0. 67 * Author: pluginoptimizer6 * Version: 1.0.7 7 * Author: Plugin Optimizer 8 8 * Author URI: https://pluginoptimizer.com/about/ 9 9 * License: GPL-2.0+ … … 13 13 class SOSPO_MU { 14 14 15 public $version = "1.0. 6";15 public $version = "1.0.7"; 16 16 17 17 protected static $instance = null; … … 223 223 // If we're on the edit post screen, filter by post type 224 224 225 if( $filter-> type_filter !== '_endpoint' && $editing_post_type && $editing_post_type == $filter->type_filter){225 if( $filter->filter_type !== '_endpoint' && $editing_post_type && $editing_post_type == $filter->filter_type ){ 226 226 227 227 $this->use_filter( $filter ); -
plugin-optimizer/trunk/includes/class-po.php
r2505578 r2509676 44 44 $this->version = SOSPO_VERSION; 45 45 } else { 46 $this->version = '1.0. 6';46 $this->version = '1.0.7'; 47 47 } 48 48 $this->plugin_name = 'plugin-optimizer'; -
plugin-optimizer/trunk/plugin-optimizer.php
r2505578 r2509676 5 5 * Plugin URI: https://pluginoptimizer.com 6 6 * Description: The Most Powerful Performance Plugin for WordPress is now available for FREE. 7 * Version: 1.0. 67 * Version: 1.0.7 8 8 * Author: Plugin Optimizer 9 9 * Author URI: https://pluginoptimizer.com/about/ … … 41 41 * Use SemVer - https://semver.org 42 42 */ 43 define( 'SOSPO_VERSION', '1.0. 6' );43 define( 'SOSPO_VERSION', '1.0.7' ); 44 44 45 45 /** … … 127 127 // sospo_mu_plugin()->write_log( $tabs, "test_overview_page_hook-tabs" ); 128 128 129 129 130 $tabs[25] = [ 130 131 "title" => "Added by a hook", … … 152 153 // add_filter( "display_post_states", "test_post_state", 10, 2 ); 153 154 155 function test_temp(){ 156 157 sospo_mu_plugin()->write_log( print_r( $GLOBALS['wp_scripts']->registered, true ), "test_temp-globals-wp_scripts" ); 158 } 159 // add_action( "shutdown", "test_temp" ); 160 161
Note: See TracChangeset
for help on using the changeset viewer.