Fixed the validation for MaxMind license keys

This commit is contained in:
Christopher Allford 2020-01-08 22:56:24 -08:00
parent f23c26a9f9
commit 000a75c23b
2 changed files with 2 additions and 4 deletions

View File

@ -99,7 +99,7 @@ class WC_MaxMind_Geolocation_Database {
$tmp_database_path = trailingslashit( dirname( $tmp_archive_path ) ) . trailingslashit( $file->current()->getFilename() ) . self::DATABASE . self::DATABASE_EXTENSION;
$file->extractTo(
dirname( $tmp_database_path ),
dirname( $tmp_archive_path ),
trailingslashit( $file->current()->getFilename() ) . self::DATABASE . self::DATABASE_EXTENSION,
true
);

View File

@ -62,9 +62,7 @@ class WC_MaxMind_Geolocation_Integration extends WC_Integration {
}
// Check the license key by attempting to download the Geolocation database.
$database = new WC_MaxMind_Geolocation_Database( $value );
$file = $database->download_database();
$file = WC_MaxMind_Geolocation_Database::download_database( $value );
if ( is_wp_error( $file ) ) {
WC_Admin_Settings::add_error( $file->get_error_message() );