Is plugin in activation mode.

@author Vova Feldman (@svovaf)
@since  1.0.7

@param bool $and_on

@return bool
168185
function is_activation_mode( $and_on = true ) {
            return fs_is_network_admin() ?
                $this->is_network_activation_mode( $and_on ) :
                $this->is_site_activation_mode( $and_on );
        }
976505
public function activateUser($email, $activationKey)
    {
        if ($this->validateActivationKey($email, $activationKey)) {
            $user = $this->findByEmailAndActivationKey($email, $activationKey)->first();

            if ($user->active == 0) {
                $user->active = 1;
                $user->activation_key = null;
                if ($this->save($user)) {
                    return true;
                }
            }
        }

        return false;
    }
1163095
public function is_enabled() {
        if ($this->enabledcache === null) {
            $gradingmanager = get_grading_manager($this->assignment->get_context(), 'mod_assign', 'submissions');
            $controller = $gradingmanager->get_active_controller();
            $active = !empty($controller);

            if ($active) {
                $this->enabledcache = false;
            } else {
                $this->enabledcache = parent::is_enabled();
            }
        }
        return $this->enabledcache;
    }
1102242
def is_active(self):
    
    if not self._context.multiplexer:
      return False
    scalars_plugin = self._get_scalars_plugin()
    if not scalars_plugin or not scalars_plugin.is_active():
      return False
    return bool(self._context.multiplexer.PluginRunToTagToContent(
        metadata.PLUGIN_NAME))
995126
protected function checkInactive()
    {
        if ($this->user->status_id !== Status::INACTIVE) {
            return true;
        }

        return $this->addAction('Activate', 'check-square-o', $this->makeRoute('activate', 0));
    }
1037805
def _is_plugin_disabled(plugin):
    
    item = _registered.get(plugin.name)
    if not item:
        return False

    _, props = item
    return bool(props.get('disabled'))
895353
public function isEnabled($type, $plugin = null)
	{
		$result = $this->byType($type, $plugin);

		return (!empty($result));
	}
2331
function is_addon_connected( $id_or_slug ) {
            $this->_logger->entrance();

            $sites = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN );

            $addon_id = self::get_module_id( $id_or_slug );
            $addon    = $this->get_addon( $addon_id );
            $slug     = $addon->slug;
            if ( ! isset( $sites[ $slug ] ) ) {
                return false;
            }

            $site = $sites[ $slug ];

            $plugin = FS_Plugin_Manager::instance( $addon_id )->get();

            if ( $plugin->parent_plugin_id != $this->_plugin->id ) {
                // The given slug do NOT belong to any of the plugin's add-ons.
                return false;
            }

            return ( is_object( $site ) &&
                     is_numeric( $site->id ) &&
                     is_numeric( $site->user_id ) &&
                     FS_Plugin_Plan::is_valid_id( $site->plan_id )
            );
        }
632178
public static function on($mode = "text")
    {
        if (static::$on) {
            return;
        }
        static::$on = true;
        static::$time = microtime(true);
        static::$mode = $mode;
    }
134238
public static function is_plugin() {
		$is_plugin = false;
		if ( ! function_exists( 'get_plugins' ) ) {
			require_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
		}

		// Get all plugins.
		$plugins = get_plugins();
		$_plugin = '';
		foreach ( $plugins as $plugin => $args ) {
			if ( ! $is_plugin && isset( $args['Name'] ) && ( 'Kirki' === $args['Name'] || 'Kirki Toolkit' === $args['Name'] ) ) {
				$is_plugin = true;
				$_plugin   = $plugin;
			}
		}

		// No need to proceed any further if Kirki wasn't found in the list of plugins.
		if ( ! $is_plugin ) {
			return false;
		}

		// Make sure the is_plugins_loaded function is loaded.
		include_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude

		// Extra logic in case the plugin is installed but not activated.
		if ( $_plugin && is_plugin_inactive( $_plugin ) ) {
			return false;
		}
		return $is_plugin;
	}
632658
def is_active(self):
    
    if not self.multiplexer:
      return False

    if self._is_active:
      # We have already determined that the projector plugin should be active.
      # Do not re-compute that. We have no reason to later set this plugin to be
      # inactive.
      return True

    if self._thread_for_determining_is_active:
      # We are currently determining whether the plugin is active. Do not start
      # a separate thread.
      return self._is_active

    # The plugin is currently not active. The frontend might check again later.
    # For now, spin off a separate thread to determine whether the plugin is
    # active.
    new_thread = threading.Thread(
        target=self._determine_is_active,
        name='ProjectorPluginIsActiveThread')
    self._thread_for_determining_is_active = new_thread
    new_thread.start()
    return False
139646
public function is_plugin_activated( $slug )
	{
		$element = $this->search_plugin( $slug );
		if ( ! $element ) {
			throw new \Exception( sprintf(
				"The %s plugin is not installed.",
				$slug
			) );
		}
		$classes = preg_split( '/\s+/', trim( $element->getAttribute( "class" ) ) );
		if ( in_array( 'active', $classes ) ) {
			return true;
		} else {
			return false;
		}
	}
402298
function is_on() {
            self::$_static_logger->entrance();

            if ( isset( $this->_is_on ) ) {
                return $this->_is_on;
            }

            // If already installed or pending then sure it's on :)
            if ( $this->is_registered() || $this->is_pending_activation() ) {
                $this->_is_on = true;

                return true;
            }

            return false;
        }
164024
public function isEnabled(): bool
    {
        // Enabled flag is set to false
        if (!$this->enabled) {
            return false;
        }

        // Evaluate each one of the defined conditions
        foreach ($this->conditions as $condition) {
            $disabled = call_user_func($condition, $this);
            if ($disabled) {
                return false;
            }
        }

        // Parent menu items are enabled only and only if they have at least one child enabled
        if (!empty($this->menuItems)) {
            foreach ($this->menuItems as $menuItem) {
                Assert::isInstanceOf($menuItem, MenuItemInterface::class);
                if ($menuItem->isEnabled()) {
                    return true;
                }
            }

            return false;
        }

        return true;
    }
130808
public static function is_wp_plugin_active( $plugin_file ) {
		$active_plugins = (array) get_option( 'active_plugins', array() );

		if ( is_multisite() ) {
			$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
		}

		return in_array( $plugin_file, $active_plugins ) || array_key_exists( $plugin_file, $active_plugins );
	}
155451
public function activate($id)
    {
        $user = $this->findById($id);

        try
        {
            if ( $user->attemptActivation($user->getActivationCode()) )
            {
                $this->event->fire('users.activate',array($user));
                return true;
            }
        }
        catch (UserAlreadyActivatedException $e){}


        return false;
    }
1101943
public static function is_enabled() {
        global $CFG;

        // Check whether Inbound Message is enabled at all.
        if (!isset($CFG->messageinbound_enabled) || !$CFG->messageinbound_enabled) {
            return false;
        }

        // Check whether the outgoing mailbox and domain are configured properly.
        if (!isset($CFG->messageinbound_mailbox) || empty($CFG->messageinbound_mailbox)) {
            return false;
        }

        if (!isset($CFG->messageinbound_domain) || empty($CFG->messageinbound_domain)) {
            return false;
        }

        return true;
    }