simple-local-avatars icon indicating copy to clipboard operation
simple-local-avatars copied to clipboard

is_network fire call to database

Open 1ucay opened this issue 3 months ago • 1 comments

Is your enhancement related to a problem? Please describe.

Hi, install Query Monitor and activate plugin. Look at database -> you will see SELECT option_value FROM ap_options WHERE option_name = 'active_sitewide_plugins' LIMIT 1

problem is in_network

Please change it to =>

public static function is_network( $plugin ) {

	if ( ! is_multisite() )
		return false;

	$plugins = get_site_option( 'active_sitewide_plugins', array() );

	if ( isset( $plugins[ $plugin ] ) ) {
		return true;
	}

	return false;
}

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

1ucay avatar Sep 25 '25 23:09 1ucay

Also, look at register_uninstall_hook, it call get_option again

please do it like this

function simple_local_avatars_activate(){
	register_uninstall_hook( __FILE__, 'simple_local_avatars_uninstall' );
}
register_activation_hook( __FILE__, 'simple_local_avatars_activate' );

1ucay avatar Sep 30 '25 20:09 1ucay