# boxzilla/3.1.17/src/class-plugin.php

Boxzilla – WordPress Popup Builder, version 3.1.17. 109 lines.

- Page: https://pluginprobe.com/plugins/boxzilla/3.1.17/code/src/class-plugin.php
- Raw: https://pluginprobe.com/plugins/boxzilla/3.1.17/raw/src/class-plugin.php
- Modified: 2016-05-11T11:35:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/boxzilla/3.1.17/code/src/class-plugin.php#L10-L20`.

```php
<?php

namespace Boxzilla;

class Plugin {

	/**
	 * @var string The current version of the plugin
	 */
	protected $version = '1.0';

	/**
	 * @var string
	 */
	protected $file = '';

	/**
	 * @var string
	 */
	protected $dir = '';

	/**
	 * @var string
	 */
	protected $name = '';

	/**
	 * @var string
	 */
	protected $slug = '';

	/**
	 * @var int
	 */
	protected $id = 0;

	/**
	 * Constructor
	 *
	 * @param int $id
	 * @param string $name
	 * @param string $version
	 * @param string $file
	 * @param string $dir (optional)
	 */
	public function __construct( $id, $name, $version, $file, $dir  = '' ) {
		$this->id = $id;
		$this->name = $name;
		$this->version = $version;
		$this->file = $file;
		$this->dir = $dir;
		$this->slug = plugin_basename( $file );

		if( empty( $dir ) ) {
			$this->dir = dirname( $file );
		}
	}

	/**
	 * @return int
	 */
	public function id() {
		return $this->id;
	}

	/**
	 * @return string
	 */
	public function slug() {
		return $this->slug;
	}

	/**
	 * @return string
	 */
	public function name() {
		return $this->name;
	}

	/**
	 * @return string
	 */
	public function version() {
		return $this->version;
	}

	/**
	 * @return string
	 */
	public function file() {
		return $this->file;
	}

	/**
	 * @return string
	 */
	public function dir() {
		return $this->dir;
	}

	/**
	 * @param string $path
	 *
	 * @return mixed
	 */
	public function url( $path = '' ) {
		return plugins_url( $path, $this->file() );
	}
}
```
