Whether the plugin is configured and requirements are met.

@return  bool
195582
public static function are_requirements_met() {
        if (self::$requirementsmet === null) {
            $requirementsmet = self::test_unoconv_path()->status === self::UNOCONVPATH_OK;
            $requirementsmet = $requirementsmet && self::is_minimum_version_met();
            self::$requirementsmet = $requirementsmet;
        }

        return self::$requirementsmet;
    }
192093
public function isRequired()
    {
        $isRequired = false;

        // see if on the first level of fields we have a required=true in the definition
        foreach ($this->fields as $field) {
            if ($field instanceof JsonDefinitionField &&
                $field->getDef() instanceof Field &&
                $field->getDef()->getRequired() === true
            ) {
                $isRequired = true;
            }
        }

        return $isRequired;
    }
770864
public function hasPhpIniConfigIssue()
    {
        foreach ($this->requirements as $req) {
            if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) {
                return true;
            }
        }

        return false;
    }
1069676
protected function validateRequirementsInstall()
    {
        if ($this->isExcluded('requirements')) {
            return null;
        }

        if ($this->config->isInitialized()) {
            $error = $this->translation->text('System already installed');
            $this->setError('installed', $error);
            return false;
        }

        $requirements = $this->install->getRequirements();
        $errors = $this->install->getRequirementErrors($requirements);

        if (empty($errors['danger'])) {
            return true;
        }

        $messages = array();
        $messages[] = $this->translation->text('Please fix all critical errors in your environment');

        foreach ($requirements as $items) {
            foreach ($items as $name => $info) {
                if (in_array($name, $errors['danger'])) {
                    $status = empty($info['status']) ? $this->translation->text('No') : $this->translation->text('Yes');
                    $messages[] = " {$info['message']} - $status";
                }
            }
        }

        $this->setError('requirements', implode(PHP_EOL, $messages));
        return false;
    }
1260465
public function hasConfig() {
		if ($this->_configSupplied !== null) {
			return true;
		}
		
		if ($this instanceof LocatorAwareInterface && $this->hasLocator()
			&& $this->getLocator()->has($this->getConfigServiceId())) {
			return true;
		}
		
		return false;
	}
724422
public static function is_system_configured() {
        global $DB;

        // First, check if the plugin is disabled.
        $processor = $DB->get_record('message_processors', array('name' => 'airnotifier'), '*', MUST_EXIST);
        if (!$processor->enabled) {
            return 0;
        }

        // Then, check if the plugin is completly configured.
        $manager = new message_airnotifier_manager();
        return (int) $manager->is_system_configured();
    }
827669
public function verify()
    {
        if (!$this->_config['enable']) {
            return true;
        }

        $controller = $this->_registry->getController();
        if ($controller->request->getData('g-recaptcha-response')) {
            $response = json_decode($this->apiCall());

            if (isset($response->success)) {
                return $response->success;
            }
        }

        return false;
    }
710686
private function validatePlugins()
    {
        foreach (self::$cache['plugins'] as $plugin_file => $plugin_info) {
            if (!file_exists(WPMU_PLUGIN_DIR . '/' . $plugin_file)) {
                $this->updateCache();
                break;
            }
        }
    }
955415
public function isRequired(): bool
    {
        foreach ($this->validationRules as $rule) {
            if ($rule instanceof Required) {
                return true;
            }
        }

        return false;
    }
434466
public function check(): bool
    {
        return $this->installable = $this->items->filter(function ($specification) {
            return $specification->check() === false && $specification->optional() === false;
        })->isEmpty();
    }
1290394
public function checkConfig()
    {
        $slugs = [];
        if ($this->passed === null) {
            $this->passed = true;
        } else {
            return $this->passed;
        }

        foreach ($this->data['contenttypes'] as $key => $ct) {
            // Make sure that there are no hyphens in the contenttype name, advise to change to underscores
            if (strpos($key, '-') !== false) {
                $error = Trans::__(
                    'contenttypes.generic.invalid-hyphen',
                    [
                        '%contenttype%' => $key,
                    ]
                );
                $this->app['logger.flash']->error($error);
                unset($this->data['contenttypes'][$key]);

                $this->passed = false;
            }

            /**
             * Make sure any field that has a 'uses' parameter actually points to a field that exists.
             *
             * For example, this will show a notice:
             * entries:
             *   name: Entries
             *     singular_name: Entry
             *     fields:
             *       title:
             *         type: text
             *         class: large
             *       slug:
             *         type: slug
             *         uses: name
             */
            foreach ($ct['fields'] as $fieldname => $field) {
                // Verify that the contenttype doesn't try to add fields that are reserved.
                if ($fieldname != 'slug' && in_array($fieldname, $this->reservedFieldNames)) {
                    $error = Trans::__(
                        'contenttypes.generic.reserved-name',
                        ['%contenttype%' => $key, '%field%' => $fieldname]
                    );
                    $this->app['logger.flash']->danger($error);

                    $this->passed = false;
                }

                // Check 'uses'. If it's an array, split it up, and check the separate parts. We also need to check
                // for the fields that are always present, like 'id'.
                if (!empty($field['uses']) && is_array($field['uses'])) {
                    foreach ((array) $field['uses'] as $useField) {
                        if (!empty($field['uses']) && empty($ct['fields'][$useField]) && !in_array($useField, $this->reservedFieldNames)) {
                            $error = Trans::__(
                                'contenttypes.generic.wrong-use-field',
                                ['%contenttype%' => $key, '%field%' => $fieldname, '%uses%' => $useField]
                            );
                            $this->app['logger.flash']->warning($error);

                            $this->passed = false;
                        }
                    }
                }

                // Check if all the used fields are existing field types.
                // Note: Check is disabled for now, because of the load order. At this point
                // in the execution, field types added by extensions are not yet initialised,
                // giving "false positives". See https://github.com/bolt/bolt/pull/7260
                /*
                if (!isset($field['type']) || !$this->fields->has($field['type'])) {
                    $error = Trans::__(
                        'contenttypes.generic.no-proper-type',
                        [
                            '%contenttype%' => $key,
                            '%field%'       => $fieldname,
                            '%type%'        => $field['type'],
                        ]
                    );
                    $this->app['logger.flash']->warning($error);

                    unset($ct['fields'][$fieldname]);
                    $this->passed = false;
                }
                */

                // Make sure that there are no consecutive underscores in field names
                if (strpos($fieldname, '__') !== false) {
                    $error = Trans::__(
                        'contenttypes.generic.consecutive-underscores',
                        [
                            '%contenttype%' => $key,
                            '%field%'       => $fieldname,
                            '%type%'        => $field['type'],
                        ]
                    );
                    $this->app['logger.flash']->warning($error);

                    unset($ct['fields'][$fieldname]);
                    $this->passed = false;
                }
            }

            /**
             * Make sure any contenttype that has a 'relation' defined points to a contenttype that exists.
             */
            if (isset($ct['relations'])) {
                foreach ($ct['relations'] as $relKey => $relData) {
                    // For BC we check if relation uses hyphen and re-map to underscores
                    if (strpos($relKey, '-') !== false) {
                        $newRelKey = str_replace('-', '_', strtolower(Str::makeSafe($relKey, true)));
                        unset($this->data['contenttypes'][$key]['relations'][$relKey]);
                        $this->data['contenttypes'][$key]['relations'][$newRelKey] = $relData;
                        $relKey = $newRelKey;
                    }
                    if (!isset($this->data['contenttypes'][$relKey])) {
                        $error = Trans::__(
                            'contenttypes.generic.invalid-relation',
                            ['%contenttype%' => $key, '%relation%' => $relKey]
                        );
                        $this->app['logger.flash']->error($error);

                        unset($this->data['contenttypes'][$key]['relations'][$relKey]);
                        $this->passed = false;
                    }
                    if (array_key_exists($relKey, $ct['fields'])) {
                        $error = Trans::__(
                            'general.phrase.clashing-relation',
                            ['%contenttype%' => $key, '%relation%' => $relKey]
                        );
                        $this->app['logger.flash']->error($error);
                    }
                }
            }

            // Keep a running score of used slugs.
            if (!isset($slugs[$ct['slug']])) {
                $slugs[$ct['slug']] = 0;
            }
            ++$slugs[$ct['slug']];
            if (!isset($slugs[$ct['singular_slug']])) {
                $slugs[$ct['singular_slug']] = 0;
            }
            if ($ct['singular_slug'] != $ct['slug']) {
                ++$slugs[$ct['singular_slug']];
            }
        }

        // Sanity checks for taxonomy.yml
        foreach ($this->data['taxonomy'] as $key => $taxo) {
            // Show some helpful warnings if slugs or keys are not set correctly.
            if ($taxo['slug'] != $key) {
                $error = Trans::__(
                    "The identifier and slug for '%taxonomytype%' are the not the same ('%slug%' vs. '%taxonomytype%'). Please edit taxonomy.yml, and make them match to prevent inconsistencies between database storage and your templates.",
                    ['%taxonomytype%' => $key, '%slug%' => $taxo['slug']]
                );
                $this->app['logger.flash']->warning($error);

                $this->passed = false;
            }
        }

        // if there aren't any other errors, check for duplicates across contenttypes.
        if (!$this->app['logger.flash']->has('error')) {
            foreach ($slugs as $slug => $count) {
                if ($count > 1) {
                    $error = Trans::__(
                        "The slug '%slug%' is used in more than one contenttype. Please edit contenttypes.yml, and make them distinct.",
                        ['%slug%' => $slug]
                    );
                    $this->app['logger.flash']->warning($error);

                    $this->passed = false;
                }
            }
        }

        return $this->checkTaxonomy();
    }
1067105
private function isBaseConfigPropertiesSet(): bool
    {
        return isset(
            $this->config[ConfigurationInterface::KEY_APP_ROOT],
            $this->config[ConfigurationInterface::KEY_CONFIG_ROOT],
            $this->config[ConfigurationInterface::KEY_CACHE_ROOT],
            $this->config[ConfigurationInterface::KEY_THEMES_ROOT],
            $this->config[ConfigurationInterface::KEY_CONTENT_ROOT]
        );
    }
1196401
function has_installed_addons() {
            if ( ! $this->has_addons() ) {
                return false;
            }

            foreach ( self::$_instances as $instance ) {
                if ( $instance->is_addon() && is_object( $instance->_parent_plugin ) ) {
                    if ( $this->_plugin->id == $instance->_parent_plugin->id ) {
                        return true;
                    }
                }
            }

            return false;
        }
398312
public function isConfigured()
    {
        if (!empty($this->urlParts) && isset($this->solrMap[$this->className])) {
            return true;
        }
        return false;
    }
1165248
private static function isCompatable(Plugin $plugin) : bool
  {
    $frameworkVersion = substr(self::getVersion(), 0, strrpos(self::getVersion(), '*'));
    $pluginVersions   = explode('|', $plugin::FRAMEWORK);

    foreach($pluginVersions as $version) {
      $version = substr($version, 0, strrpos($version, '*'));

      return starts_with($frameworkVersion, $version);
    }

    return false;
  }
32737
protected function verifyConfiguration()
    {
        if (isset($this->options->filtered['configuration']) && !file_exists($this->options->filtered['configuration']->getPath())) {
            $this->printer->println(sprintf('Could not read "%s".', $this->options->filtered['configuration']));
            exit(1);
        }
    }
180255
private function plugins_loaded() {
		if ( $this->_plugins_loaded ) {
			return;
		}
		$this->_plugins_loaded = true;

		spl_autoload_register( function ( $class ) {
			return $this->get_main()->load_class( $class );
		} );

		$this->load_functions();
	}