PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 2.6.6
Jetpack – WP Security, Backup, Speed, & Growth v2.6.6
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / modules / monitor.php

monitor.php in Jetpack – WP Security, Backup, Speed, & Growth 2.6.6, at modules/monitor.php

35 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Module Name: Monitor
4 * Module Description: Jetpack Monitor will keep tabs on your site, and alert you the moment that downtime is detected.
5 * Sort Order: 55
6 * First Introduced: 2.6
7 * Requires Connection: Yes
8 * Auto Activate: No
9 */
10
11 function jetpack_monitor_toggle() {
12 $jetpack = Jetpack::init();
13
14 if ( ! $jetpack->current_user_is_connection_owner() ) {
15 Jetpack::state( 'module', 'monitor' );
16 Jetpack::state( 'error', 'master_user_required' );
17
18 // Technically this call to `wp_safe_redirect` is not required because
19 // `Jetpack::activate_module` already sets up a redirect. However, this
20 // might not stay the case forever so it's clearer to do it here as well.
21 wp_safe_redirect( Jetpack::admin_url( 'page=jetpack' ) );
22 die;
23 }
24
25 $jetpack->sync->register( 'noop' );
26
27 if ( false !== strpos( current_filter(), 'jetpack_activate_module_' ) ) {
28 Jetpack::check_privacy( __FILE__ );
29 }
30 }
31
32 add_action( 'jetpack_activate_module_monitor', 'jetpack_monitor_toggle' );
33 add_action( 'jetpack_deactivate_module_monitor', 'jetpack_monitor_toggle' );
34
35