Determine if the readme contains unique installation instructions.

When phrases are added here, the affected plugins will need to be reparsed to pick it up.

@return bool Whether the instructions differ from default instructions.
352502
protected function has_unique_installation_instructions() {
		if ( ! isset( $this->sections['installation'] ) ) {
			return false;
		}

		// If the plugin installation section contains any of these phrases, skip it as it's not useful.
		$common_phrases = array(
			'This section describes how to install the plugin and get it working.', // Default readme.txt content
		);
		foreach ( $common_phrases as $phrase ) {
			if ( false !== stripos( $this->sections['installation'], $phrase ) ) {
				return false;
			}
		}

		return true;
	}
986987
private function checkUpdateInput()
    {
        
        $defaults = array('language' => null,
        				  'extension' => null,
        				  'input' => dirname(__FILE__) . '/../../' . $this->options['extension'] . '/' . self::DEF_INPUT_DIR,
        				  'output' => dirname(__FILE__) . '/../../' . $this->options['extension'] . '/' . self::DEF_OUTPUT_DIR);
        
        $this->options = array_merge($defaults, $this->options);
        
        if (is_null($this->options['language'])) {
        	$this->err("Please provide a 'language' identifier such as en-US, fr-CA, IT, ...", true);
        } else {
        	// Check if the language folder exists and is readable/writable.
        	$languageDir = $this->buildLanguagePath($this->options['extension'], $this->options['language']);
        	if (!is_dir($languageDir)) {
        		$this->err("The 'language' directory ${languageDir} does not exist.", true);
        	} else if (!is_readable($languageDir)) {
        		$this->err("The 'language' directory ${languageDir} is not readable. Please check permissions on this directory.");	
        	} else if (!is_writable($languageDir)) {
        		$this->err("The 'language' directory ${languageDir} is not writable. Please check permissions on this directory.");	
        	} else {
	        	if (is_null($this->options['extension'])) {
	        		$this->err("Please provide an 'extension' for which the 'language' will be created", true);
	        	} else {
	        		// Check if the extension exists.
	        		$extensionDir = dirname(__FILE__) . '/../../' . $this->options['extension'];
	        		if (!is_dir($extensionDir)) {
	        			$this->err("The extension '" . $this->options['extension'] . "' does not exist.", true);
	        		} else if (!is_readable($extensionDir)) {
	        			$this->err("The '" . $this->options['extension'] . "' directory is not readable. Please check permissions on this directory.", true);
	        		} else if (!is_writable($extensionDir)) {
	        			$this->err("The '" . $this->options['extension'] . "' directory is not writable. Please check permissions on this directory.", true);
	        		} else {
	        			
	        			// And can we read the messages.po file ?
	        			if (!file_exists($languageDir . '/' . self::DEF_PO_FILENAME)) {
	        				$this->err("Cannot find " . self::DEF_PO_FILENAME . " for extension '" . $this->options['extension'] . "' and language '" . $this->options['language'] . "'.", true);	
	        			} else if (!is_readable($languageDir . '/' . self::DEF_PO_FILENAME)) {
	        				$this->err(self::DEF_PO_FILENAME . " is not readable for '" . $this->options['extension'] . "' and language '" . $this->options['language'] . "'. Please check permissions for this file." , true);
	        			} else {
		        			// The input 'parameter' is optional.
							$this->checkInputOption();

							// The 'output' parameter is optional.
							$this->checkOutputOption();
	        			}
	        		}
	        	}
        	}
        	
        	
        }
        
    }
765564
public function isValidConfig()
    {
        $missing = [];

        foreach ($this->required as $required) {
            if (!array_key_exists($required, $this->txpcfg)) {
                $missing[] = $required;
            }
        }

        if ($missing) {
            throw new \InvalidArgumentException(
                'Textpattern installation missing config values: '.implode(', ', $missing)
            );
        }
    }
225623
public function compiledExists()
    {
        return $this->cached === false ? false : file_exists($this->cachePath.'/'.$this->getClassName().'.php');
    }
25894
public function install()
    {
        if (! isset($this->complement['installation-files'])) {
            self::$errors[] = [
                'message' => $this->complement['path']['root']
            ];

            return false;
        }

        $this->deleteDirectory();
        $this->changeState();

        $installed = $this->installComplement(
            $this->complement['installation-files'],
            $this->complement['path']['root'],
            $this->complement['slug']
        );

        if ($installed) {
            self::load(
                $this->complement['config-file'],
                $this->complement['path']['root']
            );

            $this->changeState();

            return true;
        }

        return false;
    }
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;
	}
603875
function isInstallationAlreadyPerformed(ctx) {
  var pathToInstallFlag = path.join(ctx.opts.projectRoot, 'plugins', ctx.opts.plugin.id, INSTALLATION_FLAG_FILE_NAME);
  try {
    fs.accessSync(pathToInstallFlag, fs.F_OK);
    return true;
  } catch (err) {
    return false;
  }
}
1232930
protected function validateStoreTitleInstall()
    {
        $field = 'store.title';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if (empty($value) || mb_strlen($value) > 255) {
            $this->setErrorLengthRange($field, $this->translation->text('Title'));
            return false;
        }

        return true;
    }
1337037
protected function install()
    {
        $file = $this->download();

        if (empty($file)) {
            return false;
        }

        $result = $this->install->fromZip($file);

        if ($result !== true) {
            $this->setError($result);
            return false;
        }

        if ($this->install->isUpdate()) {
            $this->job['updated']++;
        } else {
            $this->job['inserted']++;
        }

        return true;
    }
1238594
private function isMSIE()
  {
    $is = false;
    // Versions prior to IE11 follow this format
    if ( preg_match("/MSIE (([0-9]+)\.?([0-9]*))/", $this->ua, $matches) )
    {
      $is = true;
      $version = $matches[ 1 ];
      $major = $matches[ 2 ];
      $minor = $matches[ 3 ];
    }
    // This one is for IE11 only.
    elseif ( preg_match( "/Trident\/[0-9]\.[0-9]; [^;]*[;\s]*rv:(([0-9]+)\.?([0-9]*))/", $this->ua, $matches ) )
    {
      $is = true;
      $version = $matches[ 1 ];
      $major = $matches[ 2 ];
      $minor = $matches[ 3 ];
    }

    // Excludes 'bots' that might be acting like MSIE.
    if ( $is && isset($version,$major,$minor) && stripos($this->ua,'bot') === false)
    {
      $this->browser = "msie";
      $this->version = $version;
      $this->major = $major;
      $this->minor = $minor;

      return true;
    }

    return false;
  }
935834
protected function isAcceptable()
    {
        $manifest = $this->getManifest();

        $res = $this->checkPackageType();

        //check php version
        if (isset($manifest['php'])) {
            $res &= $this->checkVersions($manifest['php'], System::getPhpVersion(), 'Your PHP version does not support this installation package.');
        }

        //check acceptableVersions
        if (isset($manifest['acceptableVersions'])) {
            $res &= $this->checkVersions($manifest['acceptableVersions'], $this->getConfig()->get('version'), 'Your EspoCRM version doesn\'t match for this installation package.');
        }

        //check dependencies
        if (!empty($manifest['dependencies'])) {
            $res &= $this->checkDependencies($manifest['dependencies']);
        }

        return (bool) $res;
    }
953963
public function isAppReadyToInstall() {
		$checkPHPversion = $this->checkPhpVersion();
		if ($checkPHPversion === false) {
			return false;
		}

		$checkPHPextensions = $this->checkPhpExtensions(true);
		if ($checkPHPextensions === false) {
			return false;
		}

		return true;
	}
196028
private function get_complete_upgrade_instructions( $plan_title = '' ) {
            $this->_logger->entrance();

            $activate_license_string = $this->get_license_network_activation_notice();

            if ( ! $this->has_premium_version() || $this->is_premium() ) {
                return '' . $activate_license_string;
            }

            if ( empty( $plan_title ) ) {
                $plan_title = $this->get_plan_title();
            }

            if ( $this->is_premium_version_installed() ) {
                /**
                 * If the premium version is already installed, instead of showing the installation instructions,
                 * tell the current user to activate it.
                 *
                 * @author Leo Fajardo (@leorw)
                 * @since 2.2.1
                 */
                $premium_plugin_basename = $this->premium_plugin_basename();

                return sprintf(
                /* translators: %1s: Product title; %2s: Plan title */
                    $this->get_text_inline( ' The paid version of %1s is already installed. Please activate it to start benefiting the %2s features. %3s', 'activate-premium-version' ),
                    sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
                    $plan_title,
                    sprintf(
                        '<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
                        wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $premium_plugin_basename, 'activate-plugin_' . $premium_plugin_basename ),
                        esc_html( sprintf(
                        /* translators: %s: Plan title */
                            $this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
                            $plan_title
                        ) )
                    )
                );
            } else {
                // @since 1.2.1.5 The free version is auto deactivated.
                $deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
                    ( '<li>' . $this->esc_html_inline( 'Deactivate the free version', 'deactivate-free-version' ) . '.</li>' ) :
                    '';

                return sprintf(
                    ' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>',
                    $this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ),
                    ( empty( $activate_license_string ) ? '' : $activate_license_string . '</li><li>' ) .
                    $this->get_latest_download_link( sprintf(
                    /* translators: %s: Plan title */
                        $this->get_text_inline( 'Download the latest %s version', 'download-latest-x-version' ),
                        $plan_title
                    ) ),
                    $deactivation_step,
                    $this->get_text_inline( 'Upload and activate the downloaded version', 'upload-and-activate' ),
                    '//bit.ly/upload-wp-' . $this->_module_type . 's',
                    $this->get_text_inline( 'How to upload and activate?', 'howto-upload-activate' )
                );
            }
        }
210020
public function isOptionalWithNoDefault(): bool
    {
        if (((string)$this->parameter['choice']) !== 'opt') {
            return false;
        }
        if (!$this->hasDefaultValue()) {
            return true;
        }

        $initializer = $this->getInitializer();
        // Some default value have weird values. For instance, first parameter of "mb_internal_encoding" has default value "mb_internal_encoding()"
        if ($initializer !== 'array()' && strpos($initializer, '(') !== false) {
            return true;
        }
        return false;
    }
577357
protected function resolveInstaller(): ?string
    {
        $value = $this->getModuleInfo()['installer'] ?? null;

        return is_string($value) ? $value : null;
    }
740993
protected function validateEditInstall()
    {
        $this->setSubmitted('settings');
        $this->setSubmitted('store.host', $this->server->httpHost());
        $this->setSubmitted('store.language', $this->install_language);
        $this->setSubmitted('store.basepath', trim($this->request->base(true), '/'));

        $this->validateComponent('install');

        return !$this->hasErrors(false);
    }
768070
protected static function hasStaleCacheFile()
    {
        $composerTravisLintCache = getcwd()
            . DIRECTORY_SEPARATOR
            . self::CTL_CACHE;

        $travisConfiguration = getcwd()
            . DIRECTORY_SEPARATOR
            . self::TRAVIS_CONFIGURATION;

        if (file_exists($composerTravisLintCache) && file_exists($travisConfiguration)) {
            $travisConfigurationContent = trim(file_get_contents($travisConfiguration));
            $composerTravisLintCacheContent = trim(file_get_contents($composerTravisLintCache));

            if (md5($travisConfigurationContent) === $composerTravisLintCacheContent) {
                return false;
            }
        }

        return true;
    }