Changeset 1512862
- Timestamp:
- 10/11/2016 05:49:32 PM (9 years ago)
- Location:
- eazy-http-headers
- Files:
-
- 5 edited
-
assets/screenshot-1.jpg (modified) (previous)
-
trunk/eazy-http-headers-action.php (modified) (2 diffs)
-
trunk/eazy-http-headers-settings.php (modified) (5 diffs)
-
trunk/eazy-http-headers.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eazy-http-headers/trunk/eazy-http-headers-action.php
r1454957 r1512862 6 6 } 7 7 8 // send headers with options if option checkbox is checked 9 add_action('send_headers','eazyHTTPHeader',1); 8 10 function eazyHTTPHeader() { 9 //if x-frame options checkbox is checked 11 12 //if x-frame checkbox is checked 10 13 if (get_option( 'eazyHTTPhead_checkbox_frame' ) === '1') { 11 14 //use WP x-frame options header 12 15 send_frame_options_header(); 13 16 } 17 18 //if X-XSS protection checkbox is checked 19 if (get_option( 'eazyHTTPhead_checkbox_xss' ) === '1') { 20 //set X-XSS-Protection header 21 header("X-XSS-Protection: 1; mode=block;"); 22 } 23 14 24 //if 'X-Content-Type checkbox is checked 15 25 if (get_option( 'eazyHTTPhead_checkbox_nosniff' ) === '1') { … … 17 27 send_nosniff_header(); 18 28 } 29 19 30 } 20 21 add_action('send_headers','eazyHTTPHeader',1); -
eazy-http-headers/trunk/eazy-http-headers-settings.php
r1454957 r1512862 7 7 8 8 // Add eazy http settings section to general options page 9 add_action( 'admin_init', 'eazyHTTPhead_settings_init' ); 9 10 function eazyHTTPhead_settings_init() { 10 11 // Add the section … … 16 17 ); 17 18 18 // Add the field s19 // Add the field for X-Frame 19 20 add_settings_field( 20 21 'eazyHTTPhead_checkbox_frame', … … 25 26 ); 26 27 28 // Add the field for X-XSS Protection 29 add_settings_field( 30 'eazyHTTPhead_checkbox_xss', 31 __('X-XSS-Protection', 'ez-http-headers'), 32 'eazyHTTPhead_xss_callback', 33 'general', 34 'eazy_http_settings' 35 ); 36 37 //add the field for NoSniff 27 38 add_settings_field( 28 39 'eazyHTTPhead_checkbox_nosniff', … … 35 46 // Register the settings 36 47 register_setting( 'general', 'eazyHTTPhead_checkbox_frame' ); 48 register_setting( 'general', 'eazyHTTPhead_checkbox_xss' ); 37 49 register_setting( 'general', 'eazyHTTPhead_checkbox_nosniff' ); 38 50 } 39 51 40 add_action( 'admin_init', 'eazyHTTPhead_settings_init' ); 52 41 53 42 54 … … 44 56 function eazy_http_settings_callback_function() { 45 57 _e('<p>Check the box to apply the corresponding setting.</p>', 'ez-http-headers'); 46 //echo '<p>Check the box to apply the corresponding setting.</p>';47 58 } 48 49 59 50 // Setting fieldscallback60 // X-Frame callback 51 61 function eazyHTTPhead_frame_callback() { 52 62 _e('<input name="eazyHTTPhead_checkbox_frame" id="eazyHTTPhead_checkbox_frame" type="checkbox" value="1" class="code" ' . checked( 1, get_option( 'eazyHTTPhead_checkbox_frame' ), false ) . ' /> "SAMEORIGIN"', 'ez-http-headers'); 53 //echo '<input name="eazyHTTPhead_checkbox_frame" id="eazyHTTPhead_checkbox_frame" type="checkbox" value="1" class="code" ' . checked( 1, get_option( 'eazyHTTPhead_checkbox_frame' ), false ) . ' /> "SAMEORIGIN"';54 63 } 55 64 65 // X-XSS callback 66 function eazyHTTPhead_xss_callback() { 67 _e('<input name="eazyHTTPhead_checkbox_xss" id="eazyHTTPhead_checkbox_xss" type="checkbox" value="1" class="code" ' . checked( 1, get_option( 'eazyHTTPhead_checkbox_xss' ), false ) . ' /> "1; mode=block;"', 'ez-http-headers'); 68 } 69 70 // nosniff callback 56 71 function eazyHTTPhead_nosniff_callback() { 57 72 _e('<input name="eazyHTTPhead_checkbox_nosniff" id="eazyHTTPhead_checkbox_nosniff" type="checkbox" value="1" class="code" ' . checked( 1, get_option( 'eazyHTTPhead_checkbox_nosniff' ), false ) . ' /> "nosniff"', 'ez-http-headers'); 58 //echo '<input name="eazyHTTPhead_checkbox_nosniff" id="eazyHTTPhead_checkbox_nosniff" type="checkbox" value="1" class="code" ' . checked( 1, get_option( 'eazyHTTPhead_checkbox_nosniff' ), false ) . ' /> "nosniff"';59 73 } -
eazy-http-headers/trunk/eazy-http-headers.php
r1454957 r1512862 1 1 <?php 2 3 2 /* 4 3 Plugin Name: Eazy HTTP Headers 5 4 Plugin URI: http://robjscott.com/wordpress/plugins/eazy-http-headers 6 Description: Provides settings to activate two functions built into WordPress, send_frame_options_header() & send_nosniff_header(), allowing you to control HTTP Headers for X-Frame-Options & X-Content-Type-Options.7 Version: 1. 0.05 Description: Allows you to control the output of HTTP Headers for X-Frame-Options, X-XSS Protection & X-Content-Type-Options with checkboxes. 6 Version: 1.1.0 8 7 Author: Rob Scott, LLC 9 8 Author URI: http://robjscott.com -
eazy-http-headers/trunk/readme.txt
r1466343 r1512862 1 1 === Eazy HTTP Headers === 2 2 Contributors: r0bsc0tt 3 Tags: HTTP Headers, nosniff, x-frame, x-content 3 Tags: HTTP Headers, nosniff, x-frame, x-content, security, headers 4 4 Requires at least: 4.5 5 Tested up to: 4.6 5 Tested up to: 4.6.1 6 6 Stable tag: trunk 7 7 License: GPLv2 or any later version 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.txt 9 9 10 Provides settings to activate t wo functions built into WordPress, send_frame_options_header() & send_nosniff_header(), allowing you to control HTTP Headers for X-Frame-Options & X-Content-Type-Options.10 Provides settings to activate three HTTP header settings for X-Frame-Options, X-XSS Protection & X-Content-Type-Options. 11 11 12 12 == Description == 13 Eazy HTTP Headers provides t wocheck boxes for settings on the general settings page.14 T he check boxes activate two functions built into WordPress, send_frame_options_header() & send_nosniff_header().15 This allows you to control your sites HTTP Headers for X-Frame-Options & X-Content-Type-Options .13 Eazy HTTP Headers provides three check boxes for settings on the general settings page. 14 Two of the check boxes, activate two functions built into WordPress, send_frame_options_header() & send_nosniff_header(), while the other sets a header for X-XSS Protection. 15 This allows you to control your sites HTTP Headers for X-Frame-Options & X-Content-Type-Options using functions built into WordPress functions. 16 16 17 17 == Installation == … … 31 31 32 32 == Changelog == 33 = 1.1.0 = 34 * Added option for X-XSS Protection 35 * Added inline documentation 36 33 37 = 1.0.0 = 34 38 * Initial version of plugin. 35 39 36 40 == Upgrade Notice == 41 = 1.1.0 = 42 * Updated to include option for X-XSS Protection 43 37 44 = 1.0.0 = 38 45 * Initial version of plugin.
Note: See TracChangeset
for help on using the changeset viewer.