Check for GZIP support

This commit is contained in:
Mike Jolley 2015-02-17 16:19:33 +00:00
parent 217c3a49ff
commit d1c19d5782
3 changed files with 17 additions and 0 deletions

View File

@ -196,6 +196,17 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
$posting['dom_document']['note'] = sprintf( __( 'Your server does not have the <a href="%s">DOMDocument</a> class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'woocommerce' ), 'http://php.net/manual/en/class.domdocument.php' ) . '</mark>';
}
// GZIP
$posting['gzip']['name'] = 'GZip';
$posting['gzip']['help'] = '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'GZip (gzopen) is used to open the GEOIP database from MaxMind.', 'woocommerce' ) . '">[?]</a>';
if ( is_callable( 'gzopen' ) ) {
$posting['gzip']['success'] = true;
} else {
$posting['gzip']['success'] = false;
$posting['gzip']['note'] = sprintf( __( 'Your server does not support the <a href="%s">gzopen</a> function - this is required to use the GeoIP database from MaxMind. The API fallback will be used instead for geolocation.', 'woocommerce' ), 'http://php.net/manual/en/zlib.installation.php' ) . '</mark>';
}
// WP Remote Post Check
$posting['wp_remote_post']['name'] = __( 'Remote Post', 'woocommerce');
$posting['wp_remote_post']['help'] = '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'PayPal uses this method of communicating when sending back transaction information.', 'woocommerce' ) . '">[?]</a>';

View File

@ -139,6 +139,11 @@ class WC_Geolocation {
* Update geoip database. Adapted from https://wordpress.org/plugins/geoip-detect/.
*/
public static function update_database() {
if ( ! is_callable( 'gzopen' ) ) {
$logger->add( 'geolocation', 'Server does not support gzopen' );
return;
}
require_once( ABSPATH . 'wp-admin/includes/file.php' );
$tmp_database = download_url( self::GEOLITE_DB );

View File

@ -151,6 +151,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - When duplicating products, handle entities.
* Fix - Double shop page in breadcrumb and white space issues.
* Fix - When purchasing multiple downloadable products (same item), multiply download limit by qty purchased.
* Fix - Added checks for gzopen to prevent activation errors.
* Tweak - Added DOMDocument item in the System Status as a requirement.
* Tweak - Simplify default mode should be 'standard'.
* Tweak - Set attribte 'query_var' true when public.