Changeset 1913238
- Timestamp:
- 07/23/2018 04:32:35 AM (7 years ago)
- Location:
- wp-ssl-redirect
- Files:
-
- 2 edited
- 3 copied
-
tags/1.4 (copied) (copied from wp-ssl-redirect/trunk)
-
tags/1.4/readme.txt (copied) (copied from wp-ssl-redirect/trunk/readme.txt) (2 diffs)
-
tags/1.4/wp-ssl-redirect.php (copied) (copied from wp-ssl-redirect/trunk/wp-ssl-redirect.php) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-ssl-redirect.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-ssl-redirect/tags/1.4/readme.txt
r1786901 r1913238 19 19 20 20 = Does this plugin make any changes to the file system or database? = 21 No changes are made to file system but site url (siteurl) and home url (home) is updated in database if necessary.21 No changes are made to file system or the database. 22 22 23 23 = How does WP SSL Redirect perform the redirect? = 24 The plugin makes use of $_SERVER array to check either the URL is accessed over HTTPS or HTTP. If the request is made over HTTP, then the plugin sends a 301 redirect header and performs the redirect to the HTTPS version of same URL.24 The plugin makes use of $_SERVER array to check either the URL is accessed over HTTPS or HTTP. If the request is made over HTTP, then the plugin sends a 301 redirect header and performs the redirect to the HTTPS version of the same URL. 25 25 26 26 = 301 Redirect is Not Working = … … 40 40 == 1.3.2 == 41 41 * Fixed a major bug related to sub-directory installations 42 == 1.4 == 43 * Rewrote the redirection code to make it even simpler 44 * Disabled the website URL update in the database -
wp-ssl-redirect/tags/1.4/wp-ssl-redirect.php
r1786901 r1913238 4 4 * Plugin Name: WP SSL Redirect 5 5 * Description: A very tiny plugin to force SSL on WordPress websites (via 301 redirects for SEO purpose). 6 * Version: 1. 3.26 * Version: 1.4 7 7 * Author: Rehmat Alam 8 8 * Author URI: https://supportivehands.net/ … … 10 10 */ 11 11 12 defined( 'ABSPATH' ) or die(); // Prevents direct access to plu in dir12 defined( 'ABSPATH' ) or die(); // Prevents direct access to plugin dir 13 13 14 14 add_action('admin_menu', function() { … … 67 67 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 68 68 if(!is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php')) { 69 $request_uri = $_SERVER['REQUEST_URI']; 70 $requested_full = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 71 $wpsslredir_main_url = site_url(); 72 $wpssl_parsed = parse_url($wpsslredir_main_url); 73 $wpsslredir_requested_url = rtrim($wpsslredir_main_url, '/').str_replace($wpssl_parsed['path'], '', $request_uri); 69 $redirectUrl = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; 74 70 if(get_option('wp_ssl_redirect_protocol') == 'www') { 75 if(strpos($ wpsslredir_main_url, '//www.') === false) {76 $ wpsslredir_main_url = str_replace('//', '//www.', $wpsslredir_main_url);71 if(strpos($redirectUrl, '//www.') === false) { 72 $redirectUrl = str_replace('://', '://www.', $redirectUrl); 77 73 } 78 74 } else if(get_option('wp_ssl_redirect_protocol') == 'non-www') { 79 if(strpos($wpsslredir_main_url, '//www.') !== false) { 80 $wpsslredir_main_url = str_replace('//www.', '//', $wpsslredir_main_url); 81 } 82 } 83 84 $wpsslredir_url = str_replace('http://', 'https://', $wpsslredir_requested_url); 85 $wpsslredir_new_siteurl = str_replace('http://', 'https://', $wpsslredir_main_url); 86 if($wpsslredir_new_siteurl !== site_url()) { 87 if(home_url() === site_url()) { 88 update_option('siteurl', $wpsslredir_new_siteurl); 89 update_option('home', $wpsslredir_new_siteurl); 75 if(strpos($redirectUrl, '//www.') !== false) { 76 $redirectUrl = str_replace('//www.', '//', $redirectUrl); 90 77 } 91 78 } 92 79 93 if( $requested_full !== $wpsslredir_url) {94 header('Location: '.$ wpsslredir_url, true, 301);80 if(empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] !== "on") { 81 header('Location: '.$redirectUrl, true, 301); 95 82 exit; 96 83 } -
wp-ssl-redirect/trunk/readme.txt
r1786901 r1913238 19 19 20 20 = Does this plugin make any changes to the file system or database? = 21 No changes are made to file system but site url (siteurl) and home url (home) is updated in database if necessary.21 No changes are made to file system or the database. 22 22 23 23 = How does WP SSL Redirect perform the redirect? = 24 The plugin makes use of $_SERVER array to check either the URL is accessed over HTTPS or HTTP. If the request is made over HTTP, then the plugin sends a 301 redirect header and performs the redirect to the HTTPS version of same URL.24 The plugin makes use of $_SERVER array to check either the URL is accessed over HTTPS or HTTP. If the request is made over HTTP, then the plugin sends a 301 redirect header and performs the redirect to the HTTPS version of the same URL. 25 25 26 26 = 301 Redirect is Not Working = … … 40 40 == 1.3.2 == 41 41 * Fixed a major bug related to sub-directory installations 42 == 1.4 == 43 * Rewrote the redirection code to make it even simpler 44 * Disabled the website URL update in the database -
wp-ssl-redirect/trunk/wp-ssl-redirect.php
r1786901 r1913238 4 4 * Plugin Name: WP SSL Redirect 5 5 * Description: A very tiny plugin to force SSL on WordPress websites (via 301 redirects for SEO purpose). 6 * Version: 1. 3.26 * Version: 1.4 7 7 * Author: Rehmat Alam 8 8 * Author URI: https://supportivehands.net/ … … 10 10 */ 11 11 12 defined( 'ABSPATH' ) or die(); // Prevents direct access to plu in dir12 defined( 'ABSPATH' ) or die(); // Prevents direct access to plugin dir 13 13 14 14 add_action('admin_menu', function() { … … 67 67 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 68 68 if(!is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php')) { 69 $request_uri = $_SERVER['REQUEST_URI']; 70 $requested_full = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 71 $wpsslredir_main_url = site_url(); 72 $wpssl_parsed = parse_url($wpsslredir_main_url); 73 $wpsslredir_requested_url = rtrim($wpsslredir_main_url, '/').str_replace($wpssl_parsed['path'], '', $request_uri); 69 $redirectUrl = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; 74 70 if(get_option('wp_ssl_redirect_protocol') == 'www') { 75 if(strpos($ wpsslredir_main_url, '//www.') === false) {76 $ wpsslredir_main_url = str_replace('//', '//www.', $wpsslredir_main_url);71 if(strpos($redirectUrl, '//www.') === false) { 72 $redirectUrl = str_replace('://', '://www.', $redirectUrl); 77 73 } 78 74 } else if(get_option('wp_ssl_redirect_protocol') == 'non-www') { 79 if(strpos($wpsslredir_main_url, '//www.') !== false) { 80 $wpsslredir_main_url = str_replace('//www.', '//', $wpsslredir_main_url); 81 } 82 } 83 84 $wpsslredir_url = str_replace('http://', 'https://', $wpsslredir_requested_url); 85 $wpsslredir_new_siteurl = str_replace('http://', 'https://', $wpsslredir_main_url); 86 if($wpsslredir_new_siteurl !== site_url()) { 87 if(home_url() === site_url()) { 88 update_option('siteurl', $wpsslredir_new_siteurl); 89 update_option('home', $wpsslredir_new_siteurl); 75 if(strpos($redirectUrl, '//www.') !== false) { 76 $redirectUrl = str_replace('//www.', '//', $redirectUrl); 90 77 } 91 78 } 92 79 93 if( $requested_full !== $wpsslredir_url) {94 header('Location: '.$ wpsslredir_url, true, 301);80 if(empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] !== "on") { 81 header('Location: '.$redirectUrl, true, 301); 95 82 exit; 96 83 }
Note: See TracChangeset
for help on using the changeset viewer.