is_available() ) { $has_mm = true; $apis[] = $mm_api; } if ( ( $mm_db = new ITSEC_Geolocator_MaxMind_DB() ) && $mm_db->is_available() ) { $has_mm = true; $apis[] = $mm_db; } if ( ! $has_mm ) { $apis[] = new ITSEC_Geolocator_IP_Info(); $apis[] = new ITSEC_Geolocator_Geobytes(); $apis[] = new ITSEC_Geolocator_GeoPlugin(); $apis[] = new ITSEC_Geolocator_IPAPI(); } return $apis; } /** * Register the static map APIs. * * @param array $apis * * @return array */ public function register_static_map_apis( $apis ) { require_once( dirname( __FILE__ ) . '/static-map-apis/class-itsec-static-map-api-mapbox.php' ); require_once( dirname( __FILE__ ) . '/static-map-apis/class-itsec-static-map-api-mapquest.php' ); $apis[] = new ITSEC_Static_Map_API_MapQuest(); $apis[] = new ITSEC_Static_Map_API_Mapbox(); return $apis; } public function on_refresh( ITSEC_Job $job ) { if ( ! ITSEC_Modules::get_setting( 'fingerprinting', 'maxmind_lite_key' ) ) { return; } ITSEC_Lib::load( 'geolocation' ); require_once( dirname( __FILE__ ) . '/geolocators/class-itsec-geolocator-maxmind-db.php' ); ITSEC_Geolocator_MaxMind_DB::download(); } }