src/abstract-plugin.php
protected function configure_defaults() {
		$this->modules        = new \stdClass();
		$this->modules->count = 0;
		$this->installed_dir  = static::dirname( static::$current_file, 1 );
		$this->plugin_basedir = static::dirname( static::$current_file, 2 );
		$assumed_plugin_name  = basename( $this->plugin_basedir );
		$this->plugin_file    = $this->plugin_basedir . '/' . $assumed_plugin_name . '.php';
		$this->wp_plugin_slug = $assumed_plugin_name . '/' . $assumed_plugin_name . '.php';

		if ( is_callable( 'is_plugin_active_for_network' ) ) {
			$this->is_network_active = is_plugin_active_for_network( $this->wp_plugin_slug );
		}

		if ( file_exists( $this->plugin_file ) ) {
			$this->installed_url = plugins_url( '/', $this->plugin_file );
			// Ensure get_plugin_data is available.
			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
			$this->plugin_data = get_plugin_data( $this->plugin_file, $markup = true, $translate = true );
			if ( is_array( $this->plugin_data ) && isset( $this->plugin_data['Version'] ) ) {
				$this->version = $this->plugin_data['Version'];
			}
		} else {
			$this->installed_url = plugins_url( '/', static::$current_file );
		}
		// Setup network url and fallback in case siteurl is not defined.
		if ( ! defined( 'WP_NETWORKURL' ) && is_multisite() ) {
			define( 'WP_NETWORKURL', network_site_url() );
		} elseif ( ! defined( 'WP_NETWORKURL' ) ) {
			define( 'WP_NETWORKURL', get_site_url() );
		}
		$this->network_url = WP_NETWORKURL;
	}
protected function configure_defaults() {
		$this->modules        = new \stdClass();
		$this->modules->count = 0;
		$this->installed_dir  = static::dirname( static::$current_file, 1 );
		$this->plugin_basedir = static::dirname( static::$current_file, 2 );
		$assumed_plugin_name  = basename( $this->plugin_basedir );
		$this->plugin_file    = $this->plugin_basedir . '/' . $assumed_plugin_name . '.php';
		$this->wp_plugin_slug = $assumed_plugin_name . '/' . $assumed_plugin_name . '.php';

		if ( is_callable( 'is_plugin_active_for_network' ) ) {
			$this->is_network_active = is_plugin_active_for_network( $this->wp_plugin_slug );
		}

		if ( file_exists( $this->plugin_file ) ) {
			$this->installed_url = plugins_url( '/', $this->plugin_file );
			// Ensure get_plugin_data is available.
			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
			$this->plugin_data = get_plugin_data( $this->plugin_file, $markup = true, $translate = true );
			if ( is_array( $this->plugin_data ) && isset( $this->plugin_data['Version'] ) ) {
				$this->version = $this->plugin_data['Version'];
			}
		} else {
			$this->installed_url = plugins_url( '/', static::$current_file );
		}
		// Setup network url and fallback in case siteurl is not defined.
		if ( ! defined( 'WP_NETWORKURL' ) && is_multisite() ) {
			define( 'WP_NETWORKURL', network_site_url() );
		} elseif ( ! defined( 'WP_NETWORKURL' ) ) {
			define( 'WP_NETWORKURL', get_site_url() );
		}
		$this->network_url = WP_NETWORKURL;
	}
protected function configure_defaults ( ) { $ this -> modules = new \ stdClass ( ) ; $ this -> modules -> count = 0 ; $ this -> installed_dir = static :: dirname ( static :: $ current_file , 1 ) ; $ this -> plugin_basedir = static :: dirname ( static :: $ current_file , 2 ) ; $ assumed_plugin_name = basename ( $ this -> plugin_basedir ) ; $ this -> plugin_file = $ this -> plugin_basedir . '/' . $ assumed_plugin_name . '.php' ; $ this -> wp_plugin_slug = $ assumed_plugin_name . '/' . $ assumed_plugin_name . '.php' ; if ( is_callable ( 'is_plugin_active_for_network' ) ) { $ this -> is_network_active = is_plugin_active_for_network ( $ this -> wp_plugin_slug ) ; } if ( file_exists ( $ this -> plugin_file ) ) { $ this -> installed_url = plugins_url ( '/' , $ this -> plugin_file ) ; // Ensure get_plugin_data is available. require_once ( ABSPATH . 'wp-admin/includes/plugin.php' ) ; $ this -> plugin_data = get_plugin_data ( $ this -> plugin_file , $ markup = true , $ translate = true ) ; if ( is_array ( $ this -> plugin_data ) && isset ( $ this -> plugin_data [ 'Version' ] ) ) { $ this -> version = $ this -> plugin_data [ 'Version' ] ; } } else { $ this -> installed_url = plugins_url ( '/' , static :: $ current_file ) ; } // Setup network url and fallback in case siteurl is not defined. if ( ! defined ( 'WP_NETWORKURL' ) && is_multisite ( ) ) { define ( 'WP_NETWORKURL' , network_site_url ( ) ) ; } elseif ( ! defined ( 'WP_NETWORKURL' ) ) { define ( 'WP_NETWORKURL' , get_site_url ( ) ) ; } $ this -> network_url = WP_NETWORKURL ; }
Setup plugins global params.
Setup plugins global params .