Disabling the X-Redirect-By response header
This line added to functions.php (ideally in a child theme, or a plugin) will remove it: add_filter( ‘x_redirect_by’, ‘__return_false’ );
This line added to functions.php (ideally in a child theme, or a plugin) will remove it: add_filter( ‘x_redirect_by’, ‘__return_false’ );
here is a function i have for that: function get_page_title($url){ if( !class_exists( ‘WP_Http’ ) ) include_once( ABSPATH . WPINC. ‘/class-http.php’ ); $request = new WP_Http; $result = $request->request( $url ); if( is_wp_error( $result ) ) return false; if( preg_match(“#<title>(.+)<\/title>#iU”, $result[‘body’], $t)) { return trim($t[1]); } else { return false; } } Usage: $title = get_page_title(‘http://www.google.com’); … Read more
In my case the cause was plugin All In One WP Security an its “Basic Firewall Settings”. The above firewall features are applied via your .htaccess file and one if these features is “Limit file upload size (10MB).” So to make upload of files larger then 10 MB working again you can do following: 1) … Read more
The code you provided could cause issues with 3rd party URLs in hyperlinks not running https. You can fix this by including your home url, e.g: $content = str_replace( set_url_scheme( home_url(), ‘http’ ), set_url_scheme( home_url(), ‘relative’ ), $content); Next, you’re applying this when you’d like to display the content, which means you need to do … Read more
<?php add_filter(‘after_setup_theme’, ‘remove_redundant_shortlink’); function remove_redundant_shortlink() { // remove HTML meta tag // <link rel=”shortlink” href=”http://example.com/?p=25″ /> remove_action(‘wp_head’, ‘wp_shortlink_wp_head’, 10); // remove HTTP header // Link: <https://example.com/?p=25>; rel=shortlink remove_action( ‘template_redirect’, ‘wp_shortlink_header’, 11); } Tested in WordPress 4.4 and up to 4.9.1
For the record, I have uninstalled curl and wordpress was working on seamlessly. So I confirm that curl is not a dependency of wordpress. However, some plugins may require curl.
If available always use https, it is securer for obvious reasons, it is better received by search engines and browsers nowadays, it is just overall preferable. 1 Backup Should go without saying, but backup your database. There is always a possibility that something goes wrong. Additionally, make sure you have access – ssh, ftp, etc … Read more
Add this code in to wp-config.php just before – require_once ABSPATH . ‘wp-settings.php’; line if ($_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’) $_SERVER[‘HTTPS’]=’on’;
http error when uploading media files
We tracked it down to content-encoding’ => string ‘deflate’ (length=7) being at fault. WP_HTTP is adding in a deflate header for no reason and un gzip compressing the results. It only happens when the body of the response is under a certain string length. Very annoying when all you want isa 1 or a 0. … Read more