PHPackages                             arraypress/abuseipdb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. arraypress/abuseipdb

ActiveLibrary[API Development](/categories/api)

arraypress/abuseipdb
====================

A PHP library for integrating with the AbuseIPDB Check API in WordPress, providing community-sourced IP abuse confidence scores (0-100) and report counts. Free tier supports ~1k checks/day. Built around WordPress's HTTP API with transient caching.

00PHP

Since May 6Pushed 1mo agoCompare

[ Source](https://github.com/arraypress/abuseipdb)[ Packagist](https://packagist.org/packages/arraypress/abuseipdb)[ RSS](/packages/arraypress-abuseipdb/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

AbuseIPDB (WordPress)
=====================

[](#abuseipdb-wordpress)

A focused PHP library for the [AbuseIPDB](https://www.abuseipdb.com/) `/check` API, built for WordPress with `wp_remote_get` and transient caching. Community-sourced IP-abuse confidence scores (0-100) and report counts. Free tier supports ~1k checks/day.

Features
--------

[](#features)

- 🎯 **One endpoint** — wraps `/api/v2/check` cleanly; no scope creep into reporting / blacklist endpoints
- 🚦 **Stable error handling** — auth / quota / transport failures come back as `WP_Error`, not a fake 0 score
- 🪶 **Zero deps** — only PHP and WordPress's HTTP API
- 🔁 **Transient caching** — per-IP, default 1-hour TTL
- 📦 **Getter-friendly response** — pull confidence score, total reports, country, usage type, Tor flag, allowlist flag without poking at raw JSON

Requirements
------------

[](#requirements)

- PHP 7.4 or later
- WordPress 5.0 or later
- AbuseIPDB account + API key (free tier available)

Installation
------------

[](#installation)

```
composer require arraypress/abuseipdb
```

Quick start
-----------

[](#quick-start)

```
use ArrayPress\AbuseIPDB\Client;

$client = new Client( 'your-api-key' );

$result = $client->check_ip( '203.0.113.42' );

if ( is_wp_error( $result ) ) {
    error_log( 'AbuseIPDB failed: ' . $result->get_error_message() );
    return;
}

if ( $result->is_abusive() ) {
    // Confidence score >= 75 — block or hold the request
}

$score        = $result->get_confidence_score();   // 0-100
$reports      = $result->get_total_reports();      // lifetime report count
$reporters    = $result->get_distinct_reporters(); // distinct community reporters
$country      = $result->get_country_code();       // ISO-2
$usage_type   = $result->get_usage_type();         // 'Data Center/Web Hosting/Transit', etc.
$is_tor       = $result->is_tor();
$allowlisted  = $result->is_whitelisted();         // Google / Cloudflare / Apple etc.
$last_seen    = $result->get_last_reported_days(); // null when no reports
```

Configuration
-------------

[](#configuration)

```
$client = new Client(
    'api-key',
    [
        'max_age_days'  => 90,        // window of reports to consider (1-365)
        'cache_enabled' => true,      // default true
        'cache_ttl'     => 3600,      // seconds; default 1 hour
        'cache_prefix'  => 'abuse_',  // transient key prefix
    ]
);
```

Threshold guidance
------------------

[](#threshold-guidance)

AbuseIPDB documents two tiers:

ScoreMeaning≥ 75High confidence the IP is abusive — typical block threshold≥ 90Very high confidence — automatic block for most setupsThe `is_abusive()` convenience boolean defaults to `>= 75`. Pass a custom threshold to use a different cutoff:

```
if ( $result->is_abusive( 90 ) ) {
    // Stricter check
}
```

Error handling
--------------

[](#error-handling)

Errors come back as `WP_Error`:

```
$result = $client->check_ip( '203.0.113.42' );

if ( is_wp_error( $result ) ) {
    $code = $result->get_error_code();
    // 'abuseipdb_missing_ip', 'abuseipdb_missing_key',
    // 'abuseipdb_api_error', 'abuseipdb_bad_response',
    // or a passed-through WordPress HTTP error
}
```

Bonus: avoiding false positives
-------------------------------

[](#bonus-avoiding-false-positives)

AbuseIPDB's `is_whitelisted()` flag covers IPs on public allowlists (Google, Cloudflare, Apple, etc.). Use it as an inverse signal so legitimate crawlers / Apple Private Relay traffic don't get blocked:

```
if ( ! $result->is_whitelisted() && $result->is_abusive() ) {
    // Only block when AbuseIPDB confirms abuse AND the IP isn't a known good actor
}
```

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance61

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd6eb8aff0903d87eb674d1ba3c5f3653899c0d7661504eb0deb7798ed86b643?d=identicon)[arraypress](/maintainers/arraypress)

---

Top Contributors

[![arraypress](https://avatars.githubusercontent.com/u/22668877?v=4)](https://github.com/arraypress "arraypress (2 commits)")

### Embed Badge

![Health badge](/badges/arraypress-abuseipdb/health.svg)

```
[![Health](https://phpackages.com/badges/arraypress-abuseipdb/health.svg)](https://phpackages.com/packages/arraypress-abuseipdb)
```

###  Alternatives

[facebook/php-business-sdk

PHP SDK for Facebook Business

90923.5M35](/packages/facebook-php-business-sdk)[exsyst/swagger

A php library to manipulate Swagger specifications

35916.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
