Plugin Directory


Ignore:
Timestamp:
11/26/2026 12:41:24 PM (less than one hour ago)
Author:
robskinn
Message:

Update to version 1.0.13 from GitHub

File:
1 edited

Legend:

Unmodified
Added
Removed
  • altification/trunk/includes/bulk.php

    r3826858 r3826946  
    130130    $missing_alt      = count( array_filter( $all_images, fn( $i ) => ! $i['has_alt'] && ! $i['is_svg'] && ! $i['is_decorative'] ) );
    131131    $decorative_count = count( array_filter( $all_images, fn( $i ) => $i['is_decorative'] ) );
    132     $missing_cap  = $enable_caption     ? count( array_filter( $all_images, fn( $i ) => ! $i['has_caption'] ) ) : 0;
    133     $missing_desc = $enable_description ? count( array_filter( $all_images, fn( $i ) => ! $i['has_desc'] ) )    : 0;
     132    // Same exclusions as $missing_alt, and as altification_summarise_site_images() and the JS
     133    // recounts below. These used to count decorative images and SVGs, so the cards and tabs
     134    // dropped to a different number the first time the JS recounted them.
     135    $missing_cap  = $enable_caption     ? count( array_filter( $all_images, fn( $i ) => ! $i['has_caption'] && ! $i['is_svg'] && ! $i['is_decorative'] ) ) : 0;
     136    $missing_desc = $enable_description ? count( array_filter( $all_images, fn( $i ) => ! $i['has_desc']    && ! $i['is_svg'] && ! $i['is_decorative'] ) ) : 0;
    134137    // Same exclusions as $missing_alt above, and as the JS recount in
    135138    // altificationUpdateFilterCredits(): an SVG can't be generated and a decorative image is
    … …  
    913916
    914917                var isDecorative = $row.attr('data-decorative') === '1';
     918                // The missing filters list what the counts count: decorative images and SVGs
     919                // are never missing anything (see altificationUpdateFilterCredits()).
     920                var countable    = ! isDecorative && $row.attr('data-svg') !== '1';
    915921                if      ( filter === 'all' )          show = true;
    916                 else if ( filter === 'missing_any' )  show = ( ! hasAlt && ! isDecorative ) || ( altificationEnableCaption && ! hasCap ) || ( altificationEnableDescription && ! hasDesc );
    917                 else if ( filter === 'missing_alt' )  show = ! hasAlt && ! isDecorative;
     922                else if ( filter === 'missing_any' )  show = countable && ( ! hasAlt || ( altificationEnableCaption && ! hasCap ) || ( altificationEnableDescription && ! hasDesc ) );
     923                else if ( filter === 'missing_alt' )  show = countable && ! hasAlt;
    918924                else if ( filter === 'decorative' )   show = isDecorative;
    919                 else if ( filter === 'missing_cap' )  show = ! hasCap;
    920                 else if ( filter === 'missing_desc' ) show = ! hasDesc;
     925                else if ( filter === 'missing_cap' )  show = countable && ! hasCap;
     926                else if ( filter === 'missing_desc' ) show = countable && ! hasDesc;
    921927                else if ( filter === 'improvable' )        show = $row.attr('data-improvable')       === '1';
    922928                else if ( filter === 'keyword_mismatch' )  show = $row.attr('data-keyword-mismatch') === '1';
Note: See TracChangeset for help on using the changeset viewer.