PluginProbe
Remote Website Management by Watchful / trunk
Remote Website Management by Watchful vtrunk
v2.0.17 v2.0.16 v2.0.15 v2.0.14 v2.0.13 v2.0.12 v2.0.11 trunk v1.2.11 v1.2.12 v1.2.13 v1.2.14 v1.2.17 v1.2.19 v1.2.20 v1.2.9 v1.3.0 v1.3.1 v1.3.2 v1.4.1 v1.4.10 v1.4.11 v1.4.12 v1.4.2 v1.4.3 All 72 releases
watchful / lib / Main.php

Main.php in Remote Website Management by Watchful trunk, at lib/Main.php

88 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main Watchful class.
4 *
5 * @version 2016-12-20 11:41 UTC+01
6 * @package Watchful WP Client
7 * @author Watchful
8 * @authorUrl https://watchful.net
9 * @copyright Copyright (c) 2020 watchful.net
10 * @license GNU/GPL
11 */
12
13 namespace Watchful;
14
15 if (!defined('ABSPATH')) {
16 exit; // Exit if accessed directly.
17 }
18
19 /**
20 * Main Watchful class.
21 */
22 class Main
23 {
24
25 /**
26 * Plugin version, used for cache-busting of style and script file references.
27 *
28 * @since 0.1
29 *
30 * @var string
31 */
32 public $version = '0.1';
33
34 /**
35 * Plugin file.
36 *
37 * @since 0.1
38 *
39 * @var string
40 */
41 public $file = __FILE__;
42
43 /**
44 * Constructor
45 */
46 public function __construct()
47 {
48 } // end constructor
49
50 /**
51 * Initializes the plugin by setting localization, filters, and administration functions.
52 */
53 public function init()
54 {
55 // Add Message after activation.
56 add_action('admin_notices', array($this, 'watchful_admin_notice'));
57 add_action('network_admin_notices', array($this, 'watchful_admin_notice'));
58 }
59
60 /**
61 * Display admin notice.
62 *
63 * @since 0.1
64 */
65 public function watchful_admin_notice()
66 {
67 // Make sure the plugin is activated.
68 if (is_plugin_active('watchful/watchful.php')) {
69 global $pagenow;
70
71 // Only need to display this on the plugin view page.
72 if ('plugins.php' !== $pagenow || !current_user_can('install_plugins') || !get_option('watchfulMessage')) {
73 return;
74 }
75 ?>
76 <div id="message" class="updated notice is-dismissible">
77 <?php
78 $my_settings_page = new Settings();
79 $my_settings_page->print_watchful_form();
80 ?>
81 <br/>
82 </div>
83 <?php
84 }
85 }
86
87 } // end Watchful_Main Class
88