Plugin Directory

Changeset 2509676


Ignore:
Timestamp:
04/05/2021 09:19:32 PM (5 years ago)
Author:
andrija
Message:

v1.0.7

Location:
plugin-optimizer
Files:
78 added
18 edited

Legend:

Unmodified
Added
Removed
  • plugin-optimizer/trunk/README.txt

    r2505578 r2509676  
    44Requires at least: 5.0
    55Tested up to: 5.7
    6 Stable tag: 1.0.6
     6Stable tag: 1.0.7
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    5858== Changelog ==
    5959
     60= 1.0.7 = April 2021
     61* Bugfixes and UI polishing
     62
    6063= 1.0.6 = March 2021
    6164* The MU plugin will always be the same version as the main file
  • plugin-optimizer/trunk/admin/class-po-admin-ajax.php

    r2501831 r2509676  
    9292
    9393
    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"] ) );
    9797           
    9898            $set_categories = wp_set_object_terms( $post_id, $category_ids, "сategories_filters" );
    99            
    10099        }
    101100       
  • plugin-optimizer/trunk/admin/class-po-admin-helper.php

    r2505578 r2509676  
    55
    66class 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    }
    717
    818    static function get_filter_endpoints( $filter, $add_home = false ) {
     
    163173        if( $data["plugins"] ){
    164174           
    165             echo '<div class="plugin-wrapper">';
     175            natsort( $data["plugins"] );
     176           
     177            echo '<div class="special_grid_list">';
    166178           
    167179            foreach( $data["plugins"] as $plugin_id => $plugin_name ){
     
    229241                $turned_on_checked = $turned_off !== "1" ? ' checked="checked"' : '';
    230242               
     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               
    231252                ?>
    232253                <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 ?>">
     
    235256                    <td class="align-left normal-text"><?php echo $categories ?></td>
    236257                    <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>
    238261                    <td class="toggle_filter">
    239262                        <label>
  • plugin-optimizer/trunk/admin/class-po-admin-pages.php

    r2505578 r2509676  
    2222        // TODO SWITCH
    2323
    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' );
    2525        // add_submenu_page( 'plugin_optimizer', 'Overview',           'Overview',             'manage_options', 'plugin_optimizer',                    [ $this, 'render_overview_page'           ] );
    2626        // add_submenu_page( 'plugin_optimizer', 'Filters',            'Filters',              'manage_options', 'plugin_optimizer_filters',            [ $this, 'render_filters_page'            ] );
    2727       
    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' );
    2929        add_submenu_page( 'plugin_optimizer', 'Filters',            'Filters',              'manage_options', 'plugin_optimizer',                    [ $this, 'render_filters_page'            ] );
    3030       
  • plugin-optimizer/trunk/admin/class-po-admin.php

    r2505578 r2509676  
    119119           
    120120            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' );
    121122        }
    122123    }
     
    187188           
    188189        }
     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' );
    189194       
    190195        $version  = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/po-admin.js' ));
  • plugin-optimizer/trunk/admin/css/po-admin-public.css

    r2501831 r2509676  
    4949}
    5050
    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}
    5260/* #toplevel_page_plugin_optimizer ul li:nth-child(9), */
    5361/* #toplevel_page_plugin_optimizer ul li:nth-child(7), */
     
    9098    top: calc( 50% - 50px );
    9199    left: calc( 50% - 150px );
     100    box-sizing: border-box;
    92101    width: 300px;
    93102    height: 100px;
    94103    display: flex;
     104    flex-flow: column nowrap;
     105    align-items: flex-start;
    95106    justify-content: center;
    96     align-items: center;
    97107    border: 3px solid #369451;
    98108    border-radius: 3px;
    99109    background-color: #fff;
    100110    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}
     117body.po_is_recreating_menu #po_please_wait_message b{
     118    font-size: 16px;
     119    margin-bottom: 6px;
    101120}
    102121
     
    112131
    113132.sos-icon:before {
    114     font-family: "dashicons";
    115     content: "\f468";
     133    content: " ";
    116134    display: inline-block;
    117     line-height: 1;
    118135    width: 20px;
    119136    height: 20px;
    120     font-size: 20px;
    121137    vertical-align: top;
    122138    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;
    124143}
  • plugin-optimizer/trunk/admin/css/po-admin.css

    r2501831 r2509676  
    3939
    4040
    41 .plugin-wrapper > .content > span.close{
     41.special_grid_list > .content > span.close{
    4242    display: none;
    4343}
     
    6767    margin: 0;
    6868    margin-right: 10px;
     69    padding-left: 40px;
    6970    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;
    7075}
    7176#main_title h2{
     
    96101/*New design*/
    97102
    98 .sos-wrap {
    99     overflow-y: auto !important;
    100 }
    101 
    102103.sos-wrap * {
    103104    text-transform: uppercase;
     105}
     106
     107#the-list *{
     108    text-transform: none;
    104109}
    105110
     
    315320
    316321.sos-wrap .content-filter .header{
    317     margin-bottom: 5px;
     322    margin-bottom: 10px;
    318323    padding: 5px;
    319324    text-align: left;
     
    330335
    331336.sos-wrap .content-filter .content{
    332     margin-top: 10px;
    333     margin-bottom: 10px;
    334 }
    335 
    336 .sos-wrap .content-filter .content{
    337337    padding: 10px;
    338     margin-top: 5px;
    339     margin-bottom: 5px;
    340338    /* Style for "Validated" */
    341339    background-color: #ffffff;
     
    366364}
    367365
    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{
    387375    background-color: #ffc4c4;
    388376    color: #212529;
     
    454442}
    455443
    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}
    466496
    467497.sos-wrap.container{
     
    619649}
    620650
    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 
    640651select[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"]{
    641652    display: none;
     
    713724}
    714725
    715 .sos-wrap .plugin-wrapper .deactivate-plugin{
     726.sos-wrap .special_grid_list .deactivate-plugin{
    716727    background: gray;
    717728    color: #fff;
     
    724735}
    725736
    726 .sos-wrap .plugin-wrapper .single_plugin{
     737.sos-wrap .special_grid_list .single_plugin{
    727738    cursor: pointer;
    728739    padding: 10px;
    729     margin-top: 5px;
    730     margin-bottom: 5px;
    731740    background-color: #ffffff;
    732741    background-color: rgba(198, 185, 205, 0.1);
     
    738747    user-select: none;
    739748}
    740 .sos-wrap .plugin-wrapper .single_plugin.inactive{
     749.sos-wrap .special_grid_list .single_plugin.inactive{
    741750    /* background: gray; */
    742751    /* color: #fff; */
     
    744753    /* color: #fff; */
    745754}
    746 .sos-wrap .plugin-wrapper .single_plugin.blocked{
     755.sos-wrap .special_grid_list .single_plugin.blocked{
    747756    background-color: #ffc4c4;
    748757    background-color: rgba(255, 196, 196, 0.8);
    749758    color: #212529;
    750759}
    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{
    752761    content: "✓";
    753762    margin-right: 10px;
    754763}
    755 .sos-wrap .plugin-wrapper .single_plugin.blocked .plugin_name:before{
     764.sos-wrap .special_grid_list .single_plugin.blocked .plugin_name:before{
    756765    content: "X";
    757766    margin-right: 10px;
    758767}
    759 .sos-wrap .plugin-wrapper .single_plugin .group_name{
     768.sos-wrap .special_grid_list .single_plugin .group_name{
    760769    font-size: 12px;
    761770    font-weight: bold;
     
    766775}
    767776
    768 .sos-wrap .plugin-wrapper .single_group.blocked{
     777.sos-wrap .special_grid_list .single_group.blocked{
    769778    background-color: #ffc4c4;
    770779    background-color: rgba(255, 196, 196, 0.8);
    771780    color: #212529;
    772781}
    773 .sos-wrap .plugin-wrapper .single_group.blocked:before{
     782.sos-wrap .special_grid_list .single_group.blocked:before{
    774783    content: "X";
    775784    margin-right: 10px;
    776785}
    777786
    778 .sos-wrap .plugin-wrapper .single_category.blocked{
     787.sos-wrap .special_grid_list .single_category.blocked{
    779788    background-color: rgba(198, 255, 205, 0.5);
    780789    color: #212529;
    781790}
    782 .sos-wrap .plugin-wrapper .single_category.blocked:before{
     791.sos-wrap .special_grid_list .single_category.blocked:before{
    783792    content: "✓";
    784793    margin-right: 10px;
     
    789798}
    790799#edit_filter #endpoints_wrapper{
    791     /* display: none; */
     800    display: none;
    792801    flex-flow: row wrap;
    793802}
     
    10171026    background-color: #369451;
    10181027    background-color: #888;
     1028    margin-bottom: 10px;
    10191029}
    10201030
  • plugin-optimizer/trunk/admin/js/po-admin-menu-get.js

    r2502985 r2509676  
    11jQuery(function($){
    22   
    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>');
    44   
    55   
     
    5656    $.post( po_object.ajax_url, data, function( response ) {
    5757       
    58         $('#po_please_wait_message').html('Refreshing...');
     58        $('#po_please_wait_message').html('<b>Plugin Optimizer</b><span>Refreshing...</span>');
    5959       
    6060        window.location.href = po_object.redirect_to ? po_object.redirect_to : window.location.href;
  • plugin-optimizer/trunk/admin/js/po-admin.js

    r2505578 r2509676  
    22    'use strict';
    33   
    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
    590    // Edit Filter screen - fetch post types
    691    if( $('#set_filter_type').length >= 1 ){
     
    25110           
    26111            $('#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
    27117            $('#set_filter_type').val( selected ).change().slideDown();
    28118           
     
    139229                    </div>
    140230                `);
     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               
    141247            }
    142248           
     
    179285               
    180286                $('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                });
    181299            }
    182300           
     
    198316               
    199317                $('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                });
    200330            }
    201331           
     
    218348               
    219349                $('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                });
    220362            }
    221363           
     
    295437    $('body').on('input', '.additional_endpoint_wrapper input', function(ev){
    296438       
    297         console.log( "Event type: ", ev.type );
     439        // console.log( "Event type: ", ev.type );
    298440       
    299441        let full_url = new URL( $(this).val(), po_object.home_url );
     
    548690        let tab_id = $(this).parents('.hidden-info_overview').data('id').replace('tab_', '');
    549691       
    550         console.log( "Tab ID: ", tab_id );
     692        // console.log( "Tab ID: ", tab_id );
    551693       
    552694        $(this).parents('.hidden-info_overview').slideUp( 400, function(){
     
    561703       
    562704        $.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 );
    564706           
    565707            if( response.data.message ){
     
    582724       
    583725        $.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 );
    585727           
    586728            if( response.data.message ){
     
    593735    });
    594736   
    595     // Overview: mark tab complete
     737    // Filters List screen: turn filter on/off
    596738    $('body').on('change', '#the-list .turn_off_filter', function(){
    597739       
     
    603745       
    604746        $.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 );
    606748           
    607749            if( response.data.message ){
     
    620762    }
    621763   
     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   
    622785});
  • plugin-optimizer/trunk/admin/pages/page-categories-list.php

    r2501831 r2509676  
    66    'hide_empty' => 0,
    77] );
     8
     9if( $categories ){
     10   
     11    usort( $categories, "SOSPO_Admin_Helper::sort__by_cat_name" );
     12}
    813
    914?>
  • plugin-optimizer/trunk/admin/pages/page-filters-edit.php

    r2501831 r2509676  
    66    'numberposts' => - 1,
    77] );
     8
     9if( $groups ){
     10   
     11    usort( $groups, "SOSPO_Admin_Helper::sort__by_post_title" );
     12}
    813
    914$categories = get_categories( [
     
    1217    'hide_empty' => 0,
    1318] );
    14 
    15 // TODO If all plugins are blocked on this page, this will return only posts and pages
    16 $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 );
    2119
    2220// sospo_mu_plugin()->write_log( $categories, "page-add-filters-categories" );
     
    3129$endpoints         = [];
    3230
    33 $show_endpoints_wrapper = '';
    34 
    3531// Editing existing filter?
    3632
     
    4743    $groups_to_block    = get_post_meta( $filter->ID, "groups_used", true );
    4844    $filter_categories  = get_post_meta( $filter->ID, "categories", true );
     45    $endpoints          = SOSPO_Admin_Helper::get_filter_endpoints( $filter );
    4946   
    5047    if( ! empty( $plugins_to_block ) ){
     
    5855    if( ! empty( $filter_categories ) ){
    5956        $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;"';
    7257    }
    7358   
     
    129114                    </div>
    130115                   
    131                     <div class="row select_trigger" id="endpoints_wrapper"<?php echo $show_endpoints_wrapper ?>>
     116                    <div class="row select_trigger" id="endpoints_wrapper">
    132117                   
    133118                        <div class="col-12">
     
    164149                            <?php SOSPO_Admin_Helper::content_part__plugins( [ "plugins" => $plugins["active"],   "inactive" => [],                   "blocked" => $plugins_to_block ] ); ?>
    165150                           
    166                             <div class="header attribute-plugin">Inactive plugins</div>
     151                            <div class="header attribute-plugin" style="margin-top: 10px;">Inactive plugins</div>
    167152                           
    168153                            <?php SOSPO_Admin_Helper::content_part__plugins( [ "plugins" => $plugins["inactive"], "inactive" => $plugins["inactive"], "blocked" => $plugins_to_block ] ); ?>
     
    178163                                <span class="all-check toggle_groups">Disable All</span>
    179164                            </div>
    180                             <div class="plugin-wrapper">
     165                            <div class="special_grid_list">
    181166                                <?php
    182167                                if ( $groups ){
     
    209194                                <div class="title">Categories</div>
    210195                            </div>
    211                             <div class="plugin-wrapper">
     196                            <div class="special_grid_list">
    212197                                <?php
    213198                                if ( $categories ){
  • plugin-optimizer/trunk/admin/pages/page-filters-list.php

    r2501831 r2509676  
    55    'numberposts' => - 1,
    66) );
     7
     8if( $filters ){
     9   
     10    usort( $filters, "SOSPO_Admin_Helper::sort__by_post_title" );
     11}
     12
    713?>
    814
  • plugin-optimizer/trunk/admin/pages/page-groups-edit.php

    r2501831 r2509676  
    4949                        <div class="col-12">
    5050                           
    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>
    5656                           
    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>
    5858                               
     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                           
    5965                        </div>
    6066                    </div>
    6167                </div>
    6268                <div class="row">
    63                     <button id="save_group" class="po_green_button">Save new group</button>
     69                    <button id="save_group" class="po_green_button">Save group</button>
    6470                </div>
    6571
  • plugin-optimizer/trunk/admin/pages/page-groups-list.php

    r2501831 r2509676  
    55    'numberposts' => - 1,
    66) );
     7
     8if( $groups ){
     9   
     10    usort( $groups, "SOSPO_Admin_Helper::sort__by_post_title" );
     11}
     12
    713?>
    814
  • plugin-optimizer/trunk/admin/pages/page-overview.php

    r2501831 r2509676  
    1919                    $tabs = apply_filters( "sos_po_overview_tabs", $tabs );
    2020                   
    21                     $completed_tabs = [ 10, 20, 25 ];// TODO read the array from wp_options
    2221                    $completed_tabs = get_user_meta( get_current_user_id(), "completed_overview_tabs", true );
    2322                   
  • plugin-optimizer/trunk/includes/class-po-mu.php

    r2505578 r2509676  
    44 * Plugin URI:        https://pluginoptimizer.com
    55 * Description:       This MU plugin is required by the Plugin Optimizer plugin. It will be removed upon deactivation.
    6  * Version:           1.0.6
    7  * Author:            pluginoptimizer
     6 * Version:           1.0.7
     7 * Author:            Plugin Optimizer
    88 * Author URI:        https://pluginoptimizer.com/about/
    99 * License:           GPL-2.0+
     
    1313class SOSPO_MU {
    1414   
    15     public $version                 = "1.0.6";
     15    public $version                 = "1.0.7";
    1616   
    1717    protected static $instance      = null;
     
    223223            // If we're on the edit post screen, filter by post type
    224224           
    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 ){
    226226               
    227227                $this->use_filter( $filter );
  • plugin-optimizer/trunk/includes/class-po.php

    r2505578 r2509676  
    4444            $this->version = SOSPO_VERSION;
    4545        } else {
    46             $this->version = '1.0.6';
     46            $this->version = '1.0.7';
    4747        }
    4848        $this->plugin_name = 'plugin-optimizer';
  • plugin-optimizer/trunk/plugin-optimizer.php

    r2505578 r2509676  
    55 * Plugin URI:        https://pluginoptimizer.com
    66 * Description:       The Most Powerful Performance Plugin for WordPress is now available for FREE.
    7  * Version:           1.0.6
     7 * Version:           1.0.7
    88 * Author:            Plugin Optimizer
    99 * Author URI:        https://pluginoptimizer.com/about/
     
    4141 * Use SemVer - https://semver.org
    4242 */
    43 define( 'SOSPO_VERSION', '1.0.6' );
     43define( 'SOSPO_VERSION', '1.0.7' );
    4444
    4545/**
     
    127127    // sospo_mu_plugin()->write_log( $tabs, "test_overview_page_hook-tabs" );
    128128   
     129   
    129130    $tabs[25] = [
    130131        "title"     => "Added by a hook",
     
    152153// add_filter( "display_post_states", "test_post_state", 10, 2 );
    153154
     155function 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.