The values haven’t any hook to change this. However it is easy to identify the counter via Javascript. You can change this with short lines of Javascript.
Hook
You should hook in this page hook of the plugin page admin_footer-plugins.php
, like add_action( 'admin_footer-plugins.php', [ $this, 'change_view_values' ], 11 );
Function include javascript
As example a function below that change counter for the must-use
count, but you should only change the selector for the plugin counter. Small hint, the php variable $this->mustuse_total
is my store for the new count. You should replace this with your count, a function that get the count of plugins.
/**
* Change total count for must use values
*
* @since 01/09/2014
* @return void
*/
public function change_view_values() {
$current_screen = get_current_screen();
if ( null === $current_screen || 'plugins-network' !== $current_screen->id ) {
return;
}
$item = sprintf( _n( 'item', 'items', $this->mustuse_total ), number_format_i18n( $this->mustuse_total ) ); ?>
<script type="text/javascript">
jQuery( document ).ready( function($) {
let text,
value,
mustuse,
selector;
// replace the brackets and set int value
selector=".mustuse span";
text = $( selector ).text();
value = text.replace( '(', '' );
value = parseInt( value.replace( ')', '' ) );
// replace and add strings
mustuse = value + <?php echo $this->mustuse_total; ?>;
$( selector ).replaceWith( '(' + mustuse + ')' );
mustuse = mustuse + ' <?php echo esc_attr( $item ); ?>';
if ( document.URL.search( /plugin_status=mustuse/ ) !== - 1 ) {
$( '.tablenav .displaying-num' ).replaceWith( mustuse );
}
} );
</script>
<?php
}
The code is currently in usage in this mu-plugin loader – https://github.com/bueltge/must-use-loader/blob/master/must_use_loader.php#L290
Sreenshot say more
In my context I change the must use counter, easier to understand via the image below.