Changeset 3366125
- Timestamp:
- 09/23/2025 02:44:14 AM (6 months ago)
- Location:
- secuplug/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (2 diffs)
-
securefusion.php (modified) (2 diffs)
-
src/Lib/Main.php (modified) (2 diffs)
-
src/Lib/Middleware.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
secuplug/trunk/readme.txt
r3366081 r3366125 4 4 Requires at least: 4.9 5 5 Tested up to: 6.8 6 Stable tag: 1.4. 26 Stable tag: 1.4.3 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 97 97 98 98 == Changelog == 99 = 1.4.3 = 100 * Fixed: CSP bugs and optimized 101 * Fixed: Prevented cache plugins from corrupting header assignments 102 99 103 = 1.4.2 = 100 104 * Fixed: The issue that caused the 500 error in Apache 2.4 has been resolved. htaccess is no longer used. -
secuplug/trunk/securefusion.php
r3366081 r3366125 8 8 * Description: SecureFusion is a lightweight, robust security plugin for WordPress. 9 9 * It gives you the ability to disable specific XML-RPC services, alter the login page address, and force SSL on pages. 10 * Version: 1.4. 210 * Version: 1.4.3 11 11 * Author: codeplusdev <contact@codeplus.dev> 12 12 * Author URI: https://profiles.wordpress.org/codeplusdev/ … … 20 20 21 21 if ( ! defined( 'SECUREFUSION_VERSION' ) ) { 22 define( 'SECUREFUSION_VERSION', '1.4. 2' );22 define( 'SECUREFUSION_VERSION', '1.4.3' ); 23 23 } 24 24 -
secuplug/trunk/src/Lib/Main.php
r3366081 r3366125 49 49 add_filter( 'wp_authenticate_user', array( $this->middleware, 'track_authenticate_user' ), 30, 2 ); 50 50 add_action( 'wp_authenticate', array( $this->middleware, 'track_limit_login_attempts' ), 10, 2); 51 add_action( ' send_headers', array( $this->middleware, 'headers' ));51 add_action( 'init', array( $this->middleware, 'headers' ), 9 ); 52 52 } 53 53 … … 85 85 '\'unsafe-inline\'' . PHP_EOL . 86 86 'https://fonts.googleapis.com' . PHP_EOL . 87 'https://cdnjs.cloudflare.com' 87 'https://cdnjs.cloudflare.com' . PHP_EOL . 88 'https://www.googletagmanager.com' 88 89 , 89 90 "csp_allowed_script_sources" => '\'self\'' . PHP_EOL . 90 '\'unsafe-inline\'' 91 '\'unsafe-inline\'' . PHP_EOL . 92 'https://www.googletagmanager.com' 91 93 , 92 94 "csp_allowed_font_sources" => '\'self\'' . PHP_EOL . -
secuplug/trunk/src/Lib/Middleware.php
r3366081 r3366125 61 61 // CSP 62 62 $csp_allowed_style_sources = $this->get_settings( 'csp_allowed_style_sources' ); 63 $csp_allowed_style_sources = str_replace( array( "\r\n", "\n" ), ' ', $csp_allowed_style_sources ); 63 64 $csp_allowed_script_sources = $this->get_settings( 'csp_allowed_script_sources' ); 65 $csp_allowed_script_sources = str_replace( array( "\r\n", "\n" ), ' ', $csp_allowed_script_sources ); 64 66 $csp_allowed_font_sources = $this->get_settings( 'csp_allowed_font_sources' ); 67 $csp_allowed_font_sources = str_replace( array( "\r\n", "\n" ), ' ', $csp_allowed_font_sources ); 65 68 66 69 if ( $bad_bots ) { … … 98 101 $csp_policy = "default-src 'self'; "; 99 102 $csp_policy = "frame-src 'self' https://www.google.com/ https://google.com/;"; 100 $csp_policy .= "worker-src 'self' ; ";101 $csp_policy .= "script-src " . str_replace( PHP_EOL, ' ', $csp_allowed_script_sources ). "; ";102 $csp_policy .= "style-src " . str_replace( PHP_EOL, ' ', $csp_allowed_style_sources ). "; ";103 $csp_policy .= "worker-src 'self' blob:; "; 104 $csp_policy .= "script-src " . $csp_allowed_script_sources . "; "; 105 $csp_policy .= "style-src " . $csp_allowed_style_sources . "; "; 103 106 // Allows images from self, data URIs, and any HTTPS source. This is generally safe. 104 107 $csp_policy .= "img-src 'self' data: https:; "; 105 $csp_policy .= "font-src " . str_replace( PHP_EOL, ' ', $csp_allowed_font_sources ). "; ";108 $csp_policy .= "font-src " . $csp_allowed_font_sources . "; "; 106 109 // Disallows plugins like Flash. 107 110 $csp_policy .= "object-src 'none'; "; … … 164 167 165 168 if ( $custom_cookie_patterns ) { 166 $custom_cookie_patterns = preg_split( '/ ' . PHP_EOL . '/', $custom_cookie_patterns );169 $custom_cookie_patterns = preg_split( '/\r\n|\n/', $custom_cookie_patterns ); 167 170 $custom_cookie_patterns = array_map( function( $val ) use ( $pattern_arr, $replace_arr ) { 168 171 return preg_replace( $pattern_arr, $replace_arr, $val ); … … 171 174 172 175 if ( $custom_request_patterns ) { 173 $custom_request_patterns = preg_split( '/ ' . PHP_EOL . '/', $custom_request_patterns );176 $custom_request_patterns = preg_split( '/\r\n|\n/', $custom_request_patterns ); 174 177 $custom_request_patterns = array_map( function( $val ) use ( $pattern_arr, $replace_arr ) { 175 178 return preg_replace( $pattern_arr, $replace_arr, $val );
Note: See TracChangeset
for help on using the changeset viewer.