PluginProbe
Boxzilla – WordPress Popup Builder / 3.2.19
Boxzilla – WordPress Popup Builder v3.2.19
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.19, at src/class-plugin.php

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