maxmind->queriesRemaining; // This seems to be approximate.
update_option('geoip-detect-precision-remaining_credits', $credits);
}
return $ret;
}
public function close() { }
}
class PrecisionDataSource extends AbstractDataSource {
protected $known_api_types = array(
'country' => array('label' => 'Country'),
'city' => array('label' => 'City'),
'insights' => array('label' => 'Insights'));
public function __construct() {
parent::__construct();
}
public function getId() { return 'precision'; }
public function getLabel() { return __('Maxmind Precision Web-API', 'geoip-detect'); }
public function getDescriptionHTML() { return __('Maxmind Precision Services', 'geoip-detect'); }
public function getStatusInformationHTML() {
$html = '';
$html .= sprintf(__('API Type: %s', 'geoip-detect'), ucfirst(get_option('geoip-detect-precision_api_type', 'city'))) . '
';
$remaining = get_option('geoip-detect-precision-remaining_credits');
if ($remaining !== false) {
$html .= sprintf(__('Remaining Credits: ca. %s', 'geoip-detect'), $remaining) . '
';
}
if (!$this->isWorking())
$html .= '