Plugin Directory

Changeset 2181080


Ignore:
Timestamp:
10/27/2019 06:17:35 PM (6 years ago)
Author:
UaMV
Message:

glance filter & site health improvement

Location:
glance-that
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • glance-that/tags/4.7/glance-that.php

    r2086452 r2181080  
    44 * Plugin URI: http://typewheel.xyz/
    55 * Description: Adds content control to At a Glance on the Dashboard
    6  * Version: 4.6
     6 * Version: 4.7
    77 * Author: Typewheel
    88 * Author URI: http://typewheel.xyz
     
    1818 *
    1919 * @package Glance That
    20  * @version 4.6
     20 * @version 4.7
    2121 * @author uamv
    2222 * @copyright Copyright (c) 2013-2019, uamv
     
    2929 */
    3030
    31 define( 'GT_VERSION', '4.6' );
     31define( 'GT_VERSION', '4.7' );
    3232define( 'GT_DIR_PATH', plugin_dir_path( __FILE__ ) );
    3333define( 'GT_DIR_URL', plugin_dir_url( __FILE__ ) );
     
    527527                                if ( $site_status_result && current_user_can( 'install_plugins' ) ) {
    528528                                    $tests_total = intval( $site_status_result['good'] ) + intval( $site_status_result['recommended'] ) + intval( $site_status_result['critical'] ) * 1.5;
    529                                     $tests_failed = intval( $site_status_result['recommended'] ) + intval( $site_status_result['critical'] ) * 1.5;
     529                                    $tests_failed = intval( $site_status_result['recommended'] ) * .5 + intval( $site_status_result['critical'] ) * 1.5;
    530530                                    $tests_result = 100 - ceil( ( $tests_failed / $tests_total ) * 100 );
    531531
    532                                     $text = $tests_result . '% Site Health';
     532                                    $text = ( 80 <= $tests_result && intval( $site_status_result['critical'] ) == 0 ) ? 'Good' : 'Check Me';
    533533
    534534                                    $site_info = '<a href="site-health.php?tab=debug" class="gt-view-info"><span class="dashicons dashicons-info" title="View Site Info"></span></a>';
     
    12291229    public function assemble_options( $options ) {
    12301230
     1231        $available = apply_filters( 'gt_glance_selection', array_keys( $options ) );
     1232
    12311233        $html = '';
    12321234
    12331235        foreach ( $options as $glance => $args ) {
     1236
     1237            if ( ! in_array( $glance, $available, true ) )
     1238                continue;
    12341239
    12351240            $glancing = $args['glancing'] ? 'data-glancing="shown"' : 'data-glancing="hidden"';
     
    12771282        unset( $post_types['acf-field'] );
    12781283        unset( $post_types['user_request'] );
     1284        unset( $post_types['gplp'] );
     1285        unset( $post_types['project-huddle'] );
     1286        unset( $post_types['scheduled-action'] );
     1287        unset( $post_types['ph_version'] );
     1288
    12791289
    12801290        return $post_types;
  • glance-that/tags/4.7/readme.txt

    r2086454 r2181080  
    66Requires PHP: 5.6
    77Requires at least: 3.1
    8 Tested up to: 5.2
    9 Stable tag: 4.6
     8Tested up to: 5.3
     9Stable tag: 4.7
    1010License: GPLv2 or later
    1111
     
    5757A slew of filters are available to fine tune integration with your site:
    5858
    59 `gt_post_type_selection` lets you limit available glances.
     59`gt_glance_selection` lets you limit available glances.
    6060
    6161`gt_labels` customizes glance labels.
     
    9999== Changelog ==
    100100
     101= 4.7 =
     102* Add `gt_glance_selection` filter
     103* Update site health to match WP 5.3 treatment
     104
    101105= 4.6 =
    102106* Toggle & style other items added to subsection
  • glance-that/trunk/glance-that.php

    r2086452 r2181080  
    44 * Plugin URI: http://typewheel.xyz/
    55 * Description: Adds content control to At a Glance on the Dashboard
    6  * Version: 4.6
     6 * Version: 4.7
    77 * Author: Typewheel
    88 * Author URI: http://typewheel.xyz
     
    1818 *
    1919 * @package Glance That
    20  * @version 4.6
     20 * @version 4.7
    2121 * @author uamv
    2222 * @copyright Copyright (c) 2013-2019, uamv
     
    2929 */
    3030
    31 define( 'GT_VERSION', '4.6' );
     31define( 'GT_VERSION', '4.7' );
    3232define( 'GT_DIR_PATH', plugin_dir_path( __FILE__ ) );
    3333define( 'GT_DIR_URL', plugin_dir_url( __FILE__ ) );
     
    527527                                if ( $site_status_result && current_user_can( 'install_plugins' ) ) {
    528528                                    $tests_total = intval( $site_status_result['good'] ) + intval( $site_status_result['recommended'] ) + intval( $site_status_result['critical'] ) * 1.5;
    529                                     $tests_failed = intval( $site_status_result['recommended'] ) + intval( $site_status_result['critical'] ) * 1.5;
     529                                    $tests_failed = intval( $site_status_result['recommended'] ) * .5 + intval( $site_status_result['critical'] ) * 1.5;
    530530                                    $tests_result = 100 - ceil( ( $tests_failed / $tests_total ) * 100 );
    531531
    532                                     $text = $tests_result . '% Site Health';
     532                                    $text = ( 80 <= $tests_result && intval( $site_status_result['critical'] ) == 0 ) ? 'Good' : 'Check Me';
    533533
    534534                                    $site_info = '<a href="site-health.php?tab=debug" class="gt-view-info"><span class="dashicons dashicons-info" title="View Site Info"></span></a>';
     
    12291229    public function assemble_options( $options ) {
    12301230
     1231        $available = apply_filters( 'gt_glance_selection', array_keys( $options ) );
     1232
    12311233        $html = '';
    12321234
    12331235        foreach ( $options as $glance => $args ) {
     1236
     1237            if ( ! in_array( $glance, $available, true ) )
     1238                continue;
    12341239
    12351240            $glancing = $args['glancing'] ? 'data-glancing="shown"' : 'data-glancing="hidden"';
     
    12771282        unset( $post_types['acf-field'] );
    12781283        unset( $post_types['user_request'] );
     1284        unset( $post_types['gplp'] );
     1285        unset( $post_types['project-huddle'] );
     1286        unset( $post_types['scheduled-action'] );
     1287        unset( $post_types['ph_version'] );
     1288
    12791289
    12801290        return $post_types;
  • glance-that/trunk/readme.txt

    r2086454 r2181080  
    66Requires PHP: 5.6
    77Requires at least: 3.1
    8 Tested up to: 5.2
    9 Stable tag: 4.6
     8Tested up to: 5.3
     9Stable tag: 4.7
    1010License: GPLv2 or later
    1111
     
    5757A slew of filters are available to fine tune integration with your site:
    5858
    59 `gt_post_type_selection` lets you limit available glances.
     59`gt_glance_selection` lets you limit available glances.
    6060
    6161`gt_labels` customizes glance labels.
     
    9999== Changelog ==
    100100
     101= 4.7 =
     102* Add `gt_glance_selection` filter
     103* Update site health to match WP 5.3 treatment
     104
    101105= 4.6 =
    102106* Toggle & style other items added to subsection
Note: See TracChangeset for help on using the changeset viewer.