Title: Multisite Plugin Detection Issue
Last modified: January 11, 2023

---

# Multisite Plugin Detection Issue

 *  Resolved [davethedon](https://wordpress.org/support/users/davethedon/)
 * (@davethedon)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/multisite-plugin-detection-issue/)
 * Hey,
 * I had to add a line at the top of simple-cloudflare-turnstile.php in order to
   be able to run the is_plugin_active_for_network() function on the frontend. Otherwise
   all the integrations, like WooCommerce, weren’t loading the widget onto their
   forms on the multisite.
 * // Needed for the is_plugin_active_for_network() function
   include_once(‘wp-admin/
   includes/plugin.php’);

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [davethedon](https://wordpress.org/support/users/davethedon/)
 * (@davethedon)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/multisite-plugin-detection-issue/#post-16362789)
 * Or, perhaps better yet…
 *     ```wp-block-code
       /**
        * Custom "is_plugin_active" function.
        *
        * @param string $plugin
        * @return bool
        */
       if ( !function_exists( 'cft_is_plugin_active' ) ) {
       	function cft_is_plugin_active( $plugin ) {
       		return ( in_array( $plugin, apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || ( function_exists( 'cft_is_plugin_active_for_network' ) && cft_is_plugin_active_for_network( $plugin ) ) );
       	}
       }
   
       /**
        * Custom "is_plugin_active_for_network" function.
        *
        * @param string $plugin
        * @return bool
        */
       if ( is_multisite() && !function_exists( 'cft_is_plugin_active_for_network' ) ) {
       	function cft_is_plugin_active_for_network( $plugin ) {
       		$plugins = get_site_option( 'active_sitewide_plugins' );
       		if ( isset( $plugins[ $plugin ] ) ) {
       			return true;
       		}
   
       		return false;
       	}
       }
       ```
   
    -  This reply was modified 3 years, 4 months ago by [davethedon](https://wordpress.org/support/users/davethedon/).
 *  Plugin Author [Elliot Sowersby](https://wordpress.org/support/users/elliotvs/)
 * (@elliotvs)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/multisite-plugin-detection-issue/#post-16381613)
 * Thanks, this should be fixed in the next update.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multisite Plugin Detection Issue’ is closed to new replies.

 * ![](https://ps.w.org/simple-cloudflare-turnstile/assets/icon-128x128.gif?rev=
   2937121)
 * [Simple CAPTCHA Alternative with Cloudflare Turnstile](https://wordpress.org/plugins/simple-cloudflare-turnstile/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-cloudflare-turnstile/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-cloudflare-turnstile/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-cloudflare-turnstile/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-cloudflare-turnstile/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-cloudflare-turnstile/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Elliot Sowersby](https://wordpress.org/support/users/elliotvs/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/multisite-plugin-detection-issue/#post-16381613)
 * Status: resolved