Check if is on test or installing WordPress
or not using themes (typically running inside Laravel)

@return bool
7143
private static function isUnableToRunPlugins()
	{
		if (defined('WELOQUENT_TEST_ENV')
			|| defined('WP_INSTALLING')
			|| (defined('WP_USE_THEMES') && WP_USE_THEMES === false)
            || (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST === true)
        )
		{
			return true;
		}

		return false;
	}
275334
private function isConfig()
    {
        if (empty($this->config['root']) || empty($this->config['files']) || empty($this->config['dst'])
            || empty($this->config['vi'])
        ) {
            $this->error('the config is error!');
            return false;
        }
        return true;
    }
1289580
protected function maybeCheck()
    {
        if ($this->checked) {
            return; // Done.
        }
        $this->checked = true;

        if (!$this->App->Config->§conflicts['§plugins']
            && !$this->App->Config->§conflicts['§themes']) {
            return; // Nothing to do; we can stop here.
        }
        if (($is_front_or_ajax = !$this->Wp->is_admin || $this->c::isAjax())
                && $this->lastOkTime() > $this->outdated_check_time) {
            return; // Had a successfull check recently.
        }
        $all_active_plugin_slugs     = $this->s::allActivePlugins();
        $network_active_plugin_slugs = $this->Wp->is_multisite ? $this->s::networkActivePlugins() : [];
        $all_active_theme_slugs      = array_unique([$this->Wp->template, $this->Wp->stylesheet]);

        $conflicting_plugin_slugs   = array_keys($this->App->Config->§conflicts['§plugins']);
        $conflicting_theme_slugs    = array_keys($this->App->Config->§conflicts['§themes']);
        $deactivatable_plugin_slugs = array_keys($this->App->Config->§conflicts['§deactivatable_plugins']);

        foreach ($all_active_plugin_slugs as $_active_plugin_basename => $_active_plugin_slug) {
            if ($_active_plugin_slug === $this->App->base_dir_basename && $this->App->Config->§specs['§type'] === 'plugin') {
                continue; // Sanity check. Cannot depend on self of the same type.
            } elseif (!in_array($_active_plugin_slug, $conflicting_plugin_slugs, true)) {
                continue; // Not a conflicting plugin.
            }
            $_conflicting_plugin_basename = &$_active_plugin_basename;
            $_conflicting_plugin_slug     = &$_active_plugin_slug;

            if ($this->Wp->is_admin && !defined('WP_UNINSTALL_PLUGIN') && in_array($_conflicting_plugin_slug, $deactivatable_plugin_slugs, true)
                && (!$this->Wp->is_multisite || !in_array($_conflicting_plugin_slug, $network_active_plugin_slugs, true))) {
                // ↑ Note that we do not deactivate network-wide plugins, as that could impact other sites.

                // Add it to the deactivatable array and enqueue automatic deactivation of this plugin.
                $this->deactivatable_plugins[$_conflicting_plugin_slug] = $this->App->Config->§conflicts['§deactivatable_plugins'][$_conflicting_plugin_slug];

                add_action('admin_init', function () use ($_conflicting_plugin_basename) {
                    deactivate_plugins($_conflicting_plugin_basename, false, false);
                }, -10000); // With a very early priority.
            } else {
                $this->plugins[$_conflicting_plugin_slug] = $this->App->Config->§conflicts['§plugins'][$_conflicting_plugin_slug];
            }
        } // unset($_active_plugin_basename, $_active_plugin_slug, $_conflicting_plugin_basename, $_conflicting_plugin_slug);

        foreach ($all_active_theme_slugs as $_active_theme_slug) { // Note that one of these could be empty.
            if ($_active_theme_slug === $this->App->base_dir_basename && $this->App->Config->§specs['§type'] === 'theme') {
                continue; // Sanity check. Cannot depend on self of the same type.
            }
            if ($_active_theme_slug && $conflicting_theme_slugs && in_array($_active_theme_slug, $conflicting_theme_slugs, true)) {
                $_conflicting_theme_slug                = &$_active_theme_slug;
                $this->themes[$_conflicting_theme_slug] = $this->App->Config->§conflicts['§themes'][$_conflicting_theme_slug];
            }
        } // unset($_active_theme_slug, $_conflicting_theme_slug); // Housekeeping.

        $conflicts_exist = $this->exist(); // Conflicts exist?

        if ($is_front_or_ajax && !$conflicts_exist) {
            $this->lastOkTime(time());
        } elseif ($conflicts_exist) {
            $this->lastOkTime(0);
            $this->maybeNotify();
        }
    }
1090516
public function maybeUpdateStylesheets() {
		// If this is ajax/cron/404, don't update right now
		if ( wp_doing_ajax() || wp_doing_cron() || is_404() ) {
			return false;
		}

		// Compare current and previous Buckram versions
		$current_buckram_version = $this->getBuckramVersion();
		$last_buckram_version = get_option( 'pressbooks_buckram_version' );
		$buckram_updated = version_compare( $current_buckram_version, $last_buckram_version ) > 0;

		// Compare current and previous theme versions
		$theme = wp_get_theme();
		$current_theme_version = $theme->get( 'Version' );
		$last_theme_version = get_option( 'pressbooks_theme_version' );
		$theme_updated = version_compare( $current_theme_version, $last_theme_version ) > 0;

		// If either Buckram or the theme were updated, rebuild the web and editor stylesheets.
		if ( $buckram_updated || $theme_updated ) {
			// Try to stop a Cache Stampede, Dog-Pile, Cascading Failure...
			if ( ! get_transient( 'pressbooks_updating_stylesheet' ) ) {
				set_transient( 'pressbooks_updating_stylesheet', 1, 5 * MINUTE_IN_SECONDS );
				( new Modules\ThemeOptions\Admin() )->clearCache();
				$this->updateWebBookStyleSheet();
				update_editor_style();
				if ( $buckram_updated ) {
					update_option( 'pressbooks_buckram_version', $current_buckram_version );
				}
				if ( $theme_updated ) {
					update_option( 'pressbooks_theme_version', $current_theme_version );
				}
				delete_transient( 'pressbooks_updating_stylesheet' );
				return true;
			}
		}

		return false;
	}
248035
public function isClean()
    {
        if ($this->getConfigFileAge() > max($this->getSassMaxAge(), $this->getStylesheetsMaxAge())) {
            return false;
        }

        return $this->getSassMaxAge() <= $this->getStylesheetsMaxAge();
    }
1148030
public function isAlive(): bool
    {
        if (false === static::$testingEnabled) {
            return false !== fsockopen($this->getHost(), $this->getPort());
        }

        return static::$testingServiceIsUp;
    }
141544
public function check()
    {

        $config = $this->getConfig();

        if (isset($config['ext'])) {
            $this->setExt($config['ext']);
        }

        if (isset($config['folder'])) {

            $folder = $config['folder'];
            $this->setFolder($folder);


            if(!$this->getFileSystem()->exists($folder))
            {
                $this->getFileSystem()->createDir($folder);
                chmod($folder, 0777);
            }
        }else{

            return false;
        }

        // we have do something else

        if (function_exists('gzcompress') && function_exists('gzuncompress')) {
            return true;
        }
    }
1337820
public function isCommentSpam()
    {
        $response = $this->http_post($this->getQueryString(), $this->wordPressAPIKey . '.rest.akismet.com', '/' . $this->akismetVersion . '/comment-check');

        return ($response[1] == 'true');
    }
948674
protected function areReposConfigured()
    {
        if (! $this->json) {
            $this->readJson();
        }
        
        return ! empty($this->json['repositories']) && $this->pregGrepRecursive('/^http(s|\?)?:\/\/wpackagist\.org\/?$/', $this->json['repositories']);
    }
146608
protected function maybeCheck()
    {
        if ($this->checked) {
            return; // Done.
        }
        $this->checked = true; // Checking now.

        if (!$this->App->Config->§dependencies['§plugins']
            && !$this->App->Config->§dependencies['§themes']
            && !$this->App->Config->§dependencies['§others']) {
            return; // Nothing to do; we can stop here.
        } elseif (($is_front_or_ajax = !$this->Wp->is_admin || $this->c::isAjax())
                && $this->lastOkTime() > $this->outdated_check_time) {
            return; // Had a successfull check recently.
        }
        $all_active_plugin_slugs = $this->s::allActivePlugins();
        $all_active_theme_slugs  = array_unique([$this->Wp->template, $this->Wp->stylesheet]);

        $plugin_dependencies = $this->App->Config->§dependencies['§plugins'];
        $theme_dependencies  = $this->App->Config->§dependencies['§themes'];
        $other_dependencies  = $this->App->Config->§dependencies['§others'];

        foreach (['plugin' => 'Plugin', 'theme' => 'Theme'] as $_type => $_ucf_type) {
            foreach (${$_type.'_dependencies'} as $_dependency_slug => $_dependency_args) {
                if ($_dependency_slug === $this->App->base_dir_basename && $this->App->Config->§specs['§type'] === $_type) {
                    continue; // Sanity check. Cannot depend on self of the same type.
                }
                if (!in_array($_dependency_slug, ${'all_active_'.$_type.'_slugs'}, true)) {
                    $this->{$_type.'s'}['inactive'][$_dependency_slug] = ['args' => $_dependency_args];

                    // Else we can run a more in-depth test if the app provides a callback.
                } elseif (!empty($_dependency_args['test']) && is_callable($_dependency_args['test'])) {
                    if (is_array($_test_result = $_dependency_args['test']($_dependency_slug)) && !empty($_test_result['reason'])) {
                        $this->{$_type.'s'}[$_test_result['reason']][$_dependency_slug] = ['args' => $_dependency_args, 'test_result' => $_test_result];
                    }
                }
            } // unset($_dependency_slug, $_dependency_args, $_test_result); // Housekeeping.
        } // unset($_type, $_ucf_type); // Housekeeping.

        foreach ($other_dependencies as $_dependency_key => $_dependency_args) {
            if (!empty($_dependency_args['test']) && is_callable($_dependency_args['test'])) {
                if (is_array($_test_result = $_dependency_args['test']($_dependency_key))) {
                    $this->others[$_dependency_key] = ['args' => $_dependency_args, 'test_result' => $_test_result];
                }
            }
        } // unset($_dependency_key, $_dependency_args, $_test_result); // Housekeeping.

        $unsatisfied_dependencies = $this->unsatisfied(); // Any unsatisfied?

        if ($is_front_or_ajax && !$unsatisfied_dependencies) {
            $this->lastOkTime(time());
        } elseif ($unsatisfied_dependencies) {
            $this->lastOkTime(0);
            $this->maybeNotify();
        }
    }
676800
public function is_logged_in()
	{
		$page = $this->getSession()->getPage();
		if ( $page->find( "css", ".logged-in" ) ) {
			return true;
		} elseif ( $page->find( "css", ".wp-admin" ) ) {
			return true;
		}

		return false;
	}
1031190
protected function checkComposerConfig() {
    // @todo specify third key Acquia\\Blt\\Custom\\.
    $this->compareComposerConfig('autoload', 'psr-4');
    // @todo specify third key Drupal\\Tests\\PHPUnit\\\.
    $this->compareComposerConfig('autoload-dev', 'psr-4');
    $this->compareComposerConfig('extra', 'installer-paths');
    $this->compareComposerConfig('extra', 'enable-patching');
    $this->compareComposerConfig('extra', 'composer-exit-on-patch-failure');
    $this->compareComposerConfig('extra', 'patchLevel');
    $this->compareComposerConfig('repositories', 'drupal');
    $this->compareComposerConfig('scripts', 'nuke');
    $this->compareComposerConfig('scripts', 'drupal-scaffold');
  }
613632
public function isDrupalInstalled() {
    $this->logger->debug("Verifying that Drupal is installed...");
    $result = $this->executor->drush("sqlq \"SHOW TABLES LIKE 'config'\"")->run();
    $output = trim($result->getMessage());
    $installed = $result->wasSuccessful() && $output == 'config';

    return $installed;
  }
80241
protected function showControls() {
        $themeService = $this->getServiceManager()->get(ThemeServiceInterface::SERVICE_ID);
        if ($themeService instanceof ThemeServiceInterface || $themeService instanceof LtiHeadless) {
            return !$themeService->isHeadless();
        }
        return false;
    }
1089948
protected function checkBrowserOmniWeb()
    {
        if (stripos($this->_agent, 'omniweb') !== false) {
            $aresult = explode('/', stristr($this->_agent, 'omniweb'));
            $aversion = explode(' ', isset($aresult[1]) ? $aresult[1] : '');
            $this->setVersion($aversion[0]);
            $this->setBrowser(self::BROWSER_OMNIWEB);
            return true;
        }
        return false;
    }
825702
function is_utilized( $is_localhost = null ) {
            if ( is_null( $is_localhost ) ) {
                $is_localhost = WP_FS__IS_LOCALHOST_FOR_SERVER;
            }

            if ( $this->is_unlimited() ) {
                return false;
            }

            return ! ( $this->is_free_localhost && $is_localhost ) &&
                   ( $this->quota <= $this->activated + ( $this->is_free_localhost ? 0 : $this->activated_local ) );
        }
84600
public function check()
    {
        $result = true;

        $configurationSettings = [
            'Database.Host',
            'Database.Username',
            'Database.Password',
            'Database.Port',
            'Database.Name',
        ];

        foreach ($configurationSettings as $setting) {
            if ($this->configuration->hasConfigurationKey($setting) === false) {
                $this->missingConfiguration[] = $setting;
                $result = false;
            }
        }

        return $result;
    }