Skip to content
Snippets Groups Projects
Select Git revision
  • c2d6fbc52a80d5678b06260cf6f522d57a48babc
  • main default protected
  • v0.10
  • 0.10.6
  • 0.10.5
  • 0.10.4
  • 0.10.3
  • 0.10.2
  • 0.10.1
  • 0.10.0
  • 0.9.1
  • 0.9.0
12 results

I18n.php

Blame
  • Basic_Requirement_Checker.php 10.76 KiB
    <?php
    
    if ( ! interface_exists( 'WPDesk_Translatable' ) ) {
    	require_once 'Translatable.php';
    }
    
    if ( ! interface_exists( 'WPDesk_Requirement_Checker' ) ) {
    	require_once 'Requirement_Checker.php';
    }
    
    /**
     * Checks requirements for plugin
     * have to be compatible with PHP 5.2.x
     */
    class WPDesk_Basic_Requirement_Checker implements WPDesk_Translatable, WPDesk_Requirement_Checker
    {
    	const EXTENSION_NAME_OPENSSL = 'openssl';
    	const HOOK_ADMIN_NOTICES_ACTION = 'admin_notices';
    
    	/** @var string */
    	private $plugin_name;
    	/** @var string */
    	private $plugin_file;
    	/** @var string */
    	private $min_php_version;
    	/** @var string */
    	private $min_wp_version;
    	/** @var string|null */
    	private $min_wc_version = null;
    	/** @var int|null */
    	private $min_openssl_version = null;
    	/** @var array */
    	private $plugin_require;
    	/** @var array */
    	private $module_require;
    	/** @var array */
    	private $setting_require;
    	/** @var array */
    	private $notices;
    	/** @var @string */
    	private $text_domain;
    
    	/**
    	 * @param string $plugin_file
    	 * @param string $plugin_name
    	 * @param string $text_domain
    	 * @param string $php_version
    	 * @param string $wp_version
    	 */
    	public function __construct( $plugin_file, $plugin_name, $text_domain, $php_version, $wp_version ) {
    		$this->plugin_file = $plugin_file;
    		$this->plugin_name = $plugin_name;
    		$this->text_domain = $text_domain;
    
    		$this->set_min_php_require( $php_version );
    		$this->set_min_wp_require( $wp_version );
    
    		$this->plugin_require  = array();
    		$this->module_require  = array();
    		$this->setting_require = array();
    		$this->notices         = array();
    	}
    
    	/**
    	 * @param string $version
    	 *
    	 * @return $this
    	 */
    	public function set_min_php_require( $version ) {
    		$this->min_php_version = $version;