PluginProbe
Boxzilla – WordPress Popup Builder / 3.2.3
Boxzilla – WordPress Popup Builder v3.2.3
3.4.11 3.4.10 3.4.9 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 trunk 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 All 72 releases
boxzilla / src / class-plugin.php

class-plugin.php in Boxzilla – WordPress Popup Builder 3.2.3, at src/class-plugin.php

109 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Boxzilla;
4
5 class Plugin {
6
7 /**
8 * @var string The current version of the plugin
9 */
10 protected $version = '1.0';
11
12 /**
13 * @var string
14 */
15 protected $file = '';
16
17 /**
18 * @var string
19 */
20 protected $dir = '';
21
22 /**
23 * @var string
24 */
25 protected $name = '';
26
27 /**
28 * @var string
29 */
30 protected $slug = '';
31
32 /**
33 * @var int
34 */
35 protected $id = 0;
36
37 /**
38 * Constructor
39 *
40 * @param int $id
41 * @param string $name
42 * @param string $version
43 * @param string $file
44 * @param string $dir (optional)
45 */
46 public function __construct( $id, $name, $version, $file, $dir = '' ) {
47 $this->id = $id;
48 $this->name = $name;
49 $this->version = $version;
50 $this->file = $file;
51 $this->dir = $dir;
52 $this->slug = plugin_basename( $file );
53
54 if( empty( $dir ) ) {
55 $this->dir = dirname( $file );
56 }
57 }
58
59 /**
60 * @return int
61 */
62 public function id() {
63 return $this->id;
64 }
65
66 /**
67 * @return string
68 */
69 public function slug() {
70 return $this->slug;
71 }
72
73 /**
74 * @return string
75 */
76 public function name() {
77 return $this->name;
78 }
79
80 /**
81 * @return string
82 */
83 public function version() {
84 return $this->version;
85 }
86
87 /**
88 * @return string
89 */
90 public function file() {
91 return $this->file;
92 }
93
94 /**
95 * @return string
96 */
97 public function dir() {
98 return $this->dir;
99 }
100
101 /**
102 * @param string $path
103 *
104 * @return mixed
105 */
106 public function url( $path = '' ) {
107 return plugins_url( $path, $this->file() );
108 }
109 }