PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 3.0.2
Admin Columns v3.0.2
7.0.19 2.3.5 2.4 2.4.1 2.4.10 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.6.1 2.5.6.2 2.5.6.3 2.5.6.4 3.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.7 3.1 3.1.1 3.1.10 3.1.2 3.1.3 3.1.5 3.2.3 3.2.7 3.3.1 3.4.1 3.4.6 3.4.8 4.0.1 4.0.3 4.1.6 4.2.2 4.2.5 4.3 4.3.2 4.4.1 4.4.4 4.4.5 4.5.5 4.6.1 4.7.18 4.7.19 4.7.20 4.7.7 7.0.13 7.0.14 7.0.16 trunk 1.0 1.1 1.1.3 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.5.1 1.4.6 1.4.6.1 1.4.6.2 1.4.6.3 1.4.6.4 1.4.7 1.4.8 1.4.9 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.1.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.5.1 2.2.6 2.2.6.1 2.2.6.2 2.2.6.3 2.2.6.4 2.2.7 2.2.8 2.2.8.1 2.2.9 2.3.1 2.3.2 2.3.3
codepress-admin-columns / classes / PluginInformation.php
codepress-admin-columns / classes Last commit date
Addon 8 years ago Admin 8 years ago Column 8 years ago Helper 8 years ago ListScreen 8 years ago Meta 8 years ago Notice 8 years ago Settings 8 years ago ThirdParty 8 years ago API.php 8 years ago Addon.php 8 years ago Addons.php 8 years ago Admin.php 8 years ago Autoloader.php 8 years ago Collection.php 8 years ago Column.php 8 years ago Groups.php 8 years ago Helper.php 8 years ago ListScreen.php 8 years ago ListScreenPost.php 8 years ago PluginInformation.php 8 years ago TableScreen.php 8 years ago View.php 8 years ago ViewInterface.php 8 years ago
PluginInformation.php
98 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 class AC_PluginInformation {
8
9 /**
10 * @var string
11 */
12 private $plugin_dirname;
13
14 /**
15 * AC_Helper_Plugin constructor.
16 *
17 * @param string $plugin_dirname
18 */
19 public function __construct( $plugin_dirname ) {
20 $this->plugin_dirname = sanitize_key( $plugin_dirname );
21 }
22
23 /**
24 * @return string
25 */
26 public function get_dirname() {
27 return $this->plugin_dirname;
28 }
29
30 /**
31 * @return bool
32 */
33 public function is_installed() {
34 return $this->get_plugin_info() ? true : false;
35 }
36
37 /**
38 * @return bool
39 */
40 public function is_active() {
41 return is_plugin_active( $this->get_plugin_var( 'Basename' ) );
42 }
43
44 /**
45 * @return string|false Returns the plugin version if the plugin is installed, false otherwise
46 */
47 public function get_version() {
48 return $this->get_plugin_var( 'Version' );
49 }
50
51 /**
52 * @return string Basename
53 */
54 public function get_basename() {
55 return $this->get_plugin_var( 'Basename' );
56 }
57
58 /**
59 * @return string Name
60 */
61 public function get_name() {
62 return $this->get_plugin_var( 'Name' );
63 }
64
65 /**
66 * @return array|false
67 */
68 public function get_plugin_info() {
69 $plugins = (array) get_plugins();
70
71 foreach ( $plugins as $basename => $info ) {
72 if ( $this->plugin_dirname === dirname( $basename ) ) {
73 $info['Basename'] = $basename;
74
75 return $info;
76 }
77 }
78
79 return false;
80 }
81
82 /**
83 * @param string $var
84 *
85 * @return string|false
86 */
87 public function get_plugin_var( $var ) {
88 $info = $this->get_plugin_info();
89
90 if ( ! isset( $info[ $var ] ) ) {
91 return false;
92 }
93
94 return $info[ $var ];
95 }
96
97 }
98