Changeset 3457283
- Timestamp:
- 02/09/2026 04:51:55 PM (7 weeks ago)
- Location:
- wp-killswitch
- Files:
-
- 14 added
- 7 edited
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
tags/0.1.3 (added)
-
tags/0.1.3/api (added)
-
tags/0.1.3/api/callbacks (added)
-
tags/0.1.3/api/callbacks/remote.php (added)
-
tags/0.1.3/api/remote.php (added)
-
tags/0.1.3/inc (added)
-
tags/0.1.3/inc/admin-notice.php (added)
-
tags/0.1.3/inc/frontend.php (added)
-
tags/0.1.3/inc/hide-plugin.php (added)
-
tags/0.1.3/inc/local-killswitch.php (added)
-
tags/0.1.3/readme.txt (added)
-
tags/0.1.3/wp-killswitch.php (added)
-
trunk/api/callbacks/remote.php (modified) (1 diff)
-
trunk/inc/admin-notice.php (modified) (1 diff)
-
trunk/inc/frontend.php (modified) (1 diff)
-
trunk/inc/hide-plugin.php (modified) (1 diff)
-
trunk/inc/local-killswitch.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-killswitch.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-killswitch/trunk/api/callbacks/remote.php
r2542245 r3457283 1 1 <?php 2 2 function wpkillswitch_remote(WP_REST_Request $request) { 3 if (!$request['api_key']) { 4 return new WP_Error( "no_key", "API Key is missing!", array("status" => 400) ); 3 $api_key = $request->get_param( 'api_key' ); 4 $state = $request->get_param( 'state' ); 5 6 if ( ! $api_key ) { 7 return new WP_Error( "no_key", "API Key is missing!", array( "status" => 400 ) ); 5 8 } 6 if ( !$request['state']) {7 return new WP_Error( "no_state", "State variable is missing!", array( "status" => 400) );9 if ( ! $state ) { 10 return new WP_Error( "no_state", "State variable is missing!", array( "status" => 400 ) ); 8 11 } 9 if ( $request['api_key'] !== WP_KILLSWITCH_API_KEY) {10 return new WP_Error( "invalid_key", "API Key is invalid!", array( "status" => 400) );12 if ( $api_key !== WP_KILLSWITCH_API_KEY ) { 13 return new WP_Error( "invalid_key", "API Key is invalid!", array( "status" => 400 ) ); 11 14 } 12 $response = [];15 $response = array(); 13 16 14 if ( $request['state']) {17 if ( $state ) { 15 18 $current_state = get_option( 'wpkillswitch_state' ); 16 if ( $current_state) {17 update_option( 'wpkillswitch_state', $ request['state']);19 if ( $current_state ) { 20 update_option( 'wpkillswitch_state', $state ); 18 21 } else { 19 add_option( 'wpkillswitch_state', $ request['state']);22 add_option( 'wpkillswitch_state', $state ); 20 23 } 21 24 $new_state = get_option( 'wpkillswitch_state' ); 22 25 $response['update'] = 'State updated successfully'; 23 $response['state'] = 'wpkillswitch is now ' . $new_state;26 $response['state'] = 'wpkillswitch is now ' . $new_state; 24 27 } 25 28 26 return new WP_REST_Response( $response, 200);29 return new WP_REST_Response( $response, 200 ); 27 30 } -
wp-killswitch/trunk/inc/admin-notice.php
r2542245 r3457283 5 5 if ($current_state === 'on') { 6 6 ?> 7 <div class=" error">7 <div class="notice notice-error"> 8 8 <?php echo '<p>Warning: Your website is currently inaccessible, please contact your webmaster as soon as possible.</p> '; ?> 9 9 </div> -
wp-killswitch/trunk/inc/frontend.php
r2542245 r3457283 1 1 <?php 2 2 /* Hides all content on the frontend when activated */ 3 add_action( 'wp_ head', 'wp_killswitch_frontend' );3 add_action( 'wp_enqueue_scripts', 'wp_killswitch_frontend' ); 4 4 5 function wp_killswitch_frontend() 6 { 5 function wp_killswitch_frontend() { 7 6 $current_state = get_option( 'wpkillswitch_state' ); 8 if ($current_state == 'on') { 9 $output="<style>body { background-color: #fff !important; } body * { display: none !important; }</style>"; 10 echo $output; 7 if ( $current_state !== 'on' ) { 8 return; 11 9 } 10 $handle = 'wp-killswitch-frontend'; 11 wp_register_style( $handle, false ); 12 wp_enqueue_style( $handle ); 13 wp_add_inline_style( $handle, 'body { background-color: #fff !important; } body * { display: none !important; }' ); 12 14 } -
wp-killswitch/trunk/inc/hide-plugin.php
r2542245 r3457283 2 2 function wp_killswitch_hide_plugin() { 3 3 global $wp_list_table; 4 $hidearr = array('wp-killswitch/wp-killswitch.php'); 4 if ( ! isset( $wp_list_table->items ) || ! is_array( $wp_list_table->items ) ) { 5 return; 6 } 7 $hidearr = array( 'wp-killswitch/wp-killswitch.php' ); 5 8 $myplugins = $wp_list_table->items; 6 foreach ( $myplugins as $key => $val) {7 if ( in_array($key,$hidearr)) {8 unset( $wp_list_table->items[$key]);9 foreach ( $myplugins as $key => $val ) { 10 if ( in_array( $key, $hidearr ) ) { 11 unset( $wp_list_table->items[ $key ] ); 9 12 } 10 13 } -
wp-killswitch/trunk/inc/local-killswitch.php
r2542369 r3457283 2 2 if (!defined( 'WP_KILLSWITCH_API_KEY' )) { 3 3 /* Hides all content on the frontend when activated */ 4 add_action( 'wp_head','hook_killswitch');4 add_action( 'wp_enqueue_scripts', 'hook_killswitch' ); 5 5 6 6 function hook_killswitch() { 7 $output="<style>body { background-color: #fff !important; } body * { display: none !important; }</style>"; 8 echo $output; 7 $handle = 'wp-killswitch-local'; 8 wp_register_style( $handle, false ); 9 wp_enqueue_style( $handle ); 10 wp_add_inline_style( $handle, 'body { background-color: #fff !important; } body * { display: none !important; }' ); 9 11 } 10 12 11 13 /* Adds an administration notice for the client to contact the webmaster */ 12 14 function client_notice() { ?> 13 <div class=" error">15 <div class="notice notice-error"> 14 16 <p>Warning: Your website is currently inaccessible, please contact your webmaster as soon as possible.</p> 15 17 </div> -
wp-killswitch/trunk/readme.txt
r3457245 r3457283 5 5 Requires at least: 4.0 6 6 Tested up to: 6.9 7 Stable tag: 0.1. 27 Stable tag: 0.1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 == Changelog == 34 34 35 = 0.1.3 = 36 * Added License in plugin header 37 * Duplicate line removed 38 * Switched hook from wp_head to wp_enqueue_scripts 39 * Exit files if accessed directly 40 * Fixed extraneous plugin assets file 41 35 42 = 0.1.2 = 36 43 * Updated compatible version number -
wp-killswitch/trunk/wp-killswitch.php
r2542369 r3457283 3 3 Plugin URI: https://wpkillswitch.io 4 4 GitHub Plugin URI: https://github.com/graphicscove/wp-killswitch 5 GitHub Plugin URI: https://github.com/graphicscove/wp-killswitch6 5 Description: WP Killswitch lets you non-destructively white out a Wordpress website. 7 Version: 0.1. 16 Version: 0.1.3 8 7 Author: Steven Noble 9 8 Author URI: https://graphicscove.com 9 License: GPLv2 or later 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 11 */ 11 12
Note: See TracChangeset
for help on using the changeset viewer.