1 | <?php |
||||||
2 | namespace NirjharLo\Cgss\Src; |
||||||
3 | |||||||
4 | if ( ! defined( 'ABSPATH' ) ) exit; |
||||||
5 | |||||||
6 | |||||||
7 | /** |
||||||
8 | * Implimentation of WordPress inbuilt functions for plugin activation. |
||||||
9 | */ |
||||||
10 | |||||||
11 | final class Install { |
||||||
12 | |||||||
13 | //@string |
||||||
14 | public $textDomin; |
||||||
15 | //@string |
||||||
16 | public $phpVerAllowed; |
||||||
17 | |||||||
18 | public $pluginPageLinks; |
||||||
19 | |||||||
20 | |||||||
21 | |||||||
22 | public function execute() { |
||||||
23 | add_action( 'plugins_loaded', array( $this, 'text_domain_cb' ) ); |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
24 | add_action( 'admin_notices', array( $this, 'php_ver_incompatible' ) ); |
||||||
25 | add_filter( 'plugin_action_links', array( $this, 'menu_page_link' ), 10, 2 ); |
||||||
0 ignored issues
–
show
The function
add_filter was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
26 | } |
||||||
27 | |||||||
28 | |||||||
29 | |||||||
30 | //Load plugin cgss |
||||||
31 | public function text_domain_cb() { |
||||||
32 | |||||||
33 | load_plugin_cgss( $this->textDomin, false, CGSS_LN ); |
||||||
0 ignored issues
–
show
The function
load_plugin_cgss was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
34 | } |
||||||
35 | |||||||
36 | |||||||
37 | |||||||
38 | //Define low php verson errors |
||||||
39 | public function php_ver_incompatible() { |
||||||
40 | |||||||
41 | if ( version_compare( phpversion(), $this->phpVerAllowed, '<' ) ) : |
||||||
42 | $text = __( 'The Plugin can\'t be activated because your PHP version', 'InLinkMaster' ); |
||||||
0 ignored issues
–
show
The function
__ was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
43 | $text_last = __( 'is less than required 5.3. See more information', 'InLinkMaster' ); |
||||||
44 | $text_link = 'php.net/eol.php'; ?> |
||||||
45 | |||||||
46 | <div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $text . ' ' . phpversion() . ' ' . $text_last . ': '; ?><a href="http://php.net/eol.php/" target="_blank"><?php echo $text_link; ?></a></p></div> |
||||||
47 | <?php endif; return; |
||||||
48 | } |
||||||
49 | |||||||
50 | |||||||
51 | |||||||
52 | // Add settings link to plugin page |
||||||
53 | public function menu_page_link( $links, $file ) { |
||||||
54 | |||||||
55 | if ($this->pluginPageLinks) { |
||||||
56 | static $this_plugin; |
||||||
57 | if ( ! $this_plugin ) { |
||||||
58 | $this_plugin = CGSS_FILE; |
||||||
59 | } |
||||||
60 | if ( $file == $this_plugin ) { |
||||||
61 | $shift_link = array(); |
||||||
62 | foreach ($this->pluginPageLinks as $value) { |
||||||
63 | $shift_link[] = '<a href="'.$value['slug'].'">'.$value['label'].'</a>'; |
||||||
64 | } |
||||||
65 | foreach( $shift_link as $val ) { |
||||||
66 | array_unshift( $links, $val ); |
||||||
67 | } |
||||||
68 | } |
||||||
69 | return $links; |
||||||
70 | } |
||||||
71 | } |
||||||
72 | } ?> |
||||||
73 |