PHPackages                             arraypress/ipqualityscore - 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/ipqualityscore

ActiveLibrary[API Development](/categories/api)

arraypress/ipqualityscore
=========================

A PHP library for integrating with the IPQualityScore API in WordPress, providing proxy, VPN &amp; email validation, phone verification, dark web monitoring, URL scanning, and fraud prevention. Features comprehensive response handling and WordPress transient caching.

210PHP

Since Jan 6Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

IPQualityScore Library for WordPress
====================================

[](#ipqualityscore-library-for-wordpress)

A WordPress library for IPQualityScore API integration providing proxy &amp; VPN detection, email validation, phone verification, dark web monitoring, URL scanning, and fraud prevention with WordPress transient caching.

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

[](#installation)

Install via Composer:

```
composer require arraypress/ipqualityscore
```

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

[](#requirements)

- PHP 7.4 or later
- WordPress 6.2.2 or later
- IPQualityScore API key

Basic Usage
-----------

[](#basic-usage)

```
use ArrayPress\IPQualityScore\Client;

// Initialize with your API key
$client = new Client( 'your-api-key-here' );

// Check IP address
$response = $client->check_ip( '1.1.1.1' );

// Validate email
$response = $client->validate_email( 'test@example.com' );

// Validate phone number
$response = $client->validate_phone( '18007132618', [ 'country' => 'US' ] );

// Check for leaked data
$response = $client->check_leaked_data( 'test@example.com', 'email' );

// Scan URL
$response = $client->scan_url( 'https://example.com' );
```

Available Methods
-----------------

[](#available-methods)

### Client Methods

[](#client-methods)

```
// Initialize client with options
$client = new Client(
    'your-api-key-here',   // API key
    true,                  // Enable caching (optional, default: true)
    3600                   // Cache duration in seconds (optional, default: 3600)
);

// Set common options
$client->set_strictness( 1 );                    // Set strictness level (0-3)
$client->set_allow_public_access_points( true ); // Allow public access points
$client->set_lighter_penalties( true );          // Use lighter penalties

// IP Reputation Check
$ip_check = $client->check_ip( '1.1.1.1' );

// Email Validation
$email_check = $client->validate_email( 'test@example.com' );

// Phone Validation
$phone_check = $client->validate_phone( '18007132618', [ 'country' => 'US' ] );

// Dark Web Leak Check
$leak_check = $client->check_leaked_data( 'test@example.com', 'email' );

// URL Scanning
$url_scan = $client->scan_url( 'https://example.com' );

// Transaction Validation
$transaction = $client->validate_transaction( [
    'ip_address' => '1.1.1.1',
    // Additional transaction data
] );

// Allow & Block Lists
$client->create_allowlist_entry( '1.1.1.1', 'proxy', 'ip', 'Trusted IP') ;
$entries = $client->get_allowlist_entries();
$client->delete_allowlist_entry( '1.1.1.1', 'proxy', 'ip' );

$client->create_blocklist_entry( '8.8.8.8', 'proxy', 'ip', 'Malicious IP' );
$entries = $client->get_blocklist_entries();
$client->delete_blocklist_entry( '8.8.8.8', 'proxy', 'ip' );

// Request History
$requests = $client->get_request_list ('proxy', [
    'start_date' => '2024-01-01',
    'stop_date' => '2024-01-31'
] );

// Credit Usage
$credits = $client->get_credit_usage();

// Cache Management
$client->clear_cache();                 // Clear all cached data
$client->clear_cache( 'ip_1.1.1.1' );    // Clear specific cache
```

### IP Response Methods

[](#ip-response-methods)

```
// Basic checks
$is_proxy = $response->is_proxy();
$is_vpn = $response->is_vpn();
$is_tor = $response->is_tor();
$is_crawler = $response->is_crawler();

// Scores and risk assessment
$fraud_score = $response->get_fraud_score();
$abuse_velocity = $response->get_abuse_velocity();
$recent_abuse = $response->has_recent_abuse();

// Connection info
$connection_type = $response->get_connection_type();
$is_mobile = $response->is_mobile();
$is_bot = $response->is_bot();

// Location data
$country = $response->get_country_code();
$region = $response->get_region();
$city = $response->get_city();
$timezone = $response->get_timezone();

// Network info
$organization = $response->get_organization();
$asn = $response->get_asn();
$host = $response->get_host();
```

### Email Response Methods

[](#email-response-methods)

```
$is_valid = $response->is_valid();
$is_disposable = $response->is_disposable();
$smtp_score = $response->get_smtp_score();
$overall_score = $response->get_overall_score();
$is_deliverable = $response->get_deliverability();
$first_name = $response->get_first_name();
$domain_age = $response->get_domain_age();
$fraud_score = $response->get_fraud_score();
$suggested_domain = $response->get_suggested_domain();
$leaked = $response->is_leaked();
```

### Phone Response Methods

[](#phone-response-methods)

```
$is_valid = $response->is_valid();
$fraud_score = $response->get_fraud_score();
$formatted = $response->get_formatted();
$carrier = $response->get_carrier();
$line_type = $response->get_line_type();
$is_active = $response->is_active();
$is_risky = $response->is_risky();
$leaked = $response->is_leaked();
```

### URL Response Methods

[](#url-response-methods)

```
$is_unsafe = $response->is_unsafe();
$domain_age = $response->get_domain_age();
$risk_score = $response->get_risk_score();
$is_phishing = $response->is_phishing();
$is_malware = $response->is_malware();
$category = $response->get_category();
$dns_valid = $response->is_dns_valid();
$risk_factors = $response->get_risk_factors();
```

Response Examples
-----------------

[](#response-examples)

### IP Check Response

[](#ip-check-response)

```
[
    "success" => true,
    "message" => "Success",
    "fraud_score" => 25,
    "country_code" => "US",
    "region" => "California",
    "city" => "Los Angeles",
    "ISP" => "Cloudflare, Inc.",
    "ASN" => 13335,
    "organization" => "Cloudflare, Inc.",
    "is_crawler" => false,
    "timezone" => "America/Los_Angeles",
    "mobile" => false,
    "host" => "one.one.one.one",
    "proxy" => true,
    "vpn" => true,
    "tor" => false,
    "recent_abuse" => false,
    "bot_status" => false
]
```

### Email Response

[](#email-response)

```
[
    "success" => true,
    "valid" => true,
    "disposable" => false,
    "smtp_score" => 3,
    "overall_score" => 4,
    "first_name" => "John",
    "deliverability" => "high",
    "dns_valid" => true,
    "fraud_score" => 25,
    "leaked" => false,
    "suggested_domain" => "example.com",
    "domain_velocity" => "high",
    "domain_trust" => "trusted",
    "request_id" => "..."
]
```

Error Handling
--------------

[](#error-handling)

The library uses WordPress's `WP_Error` for error handling:

```
$response = $client->check_ip( 'invalid-ip' );

if ( is_wp_error( $response ) ) {
    echo $response->get_error_message();
    // Output: "Invalid IP address: invalid-ip"
}
```

Common error cases:

- Invalid input formats (IP, email, phone, URL)
- Invalid API key
- API request failures
- Insufficient credits
- Invalid responses

Additional Features
-------------------

[](#additional-features)

### Allow &amp; Block Lists

[](#allow--block-lists)

Manage trusted and blocked entities:

```
// Allowlist
$client->create_allowlist_entry( '1.1.1.1', 'proxy', 'ip' );
$client->get_allowlist_entries();
$client->delete_allowlist_entry( '1.1.1.1', 'proxy', 'ip' );

// Blocklist
$client->create_blocklist_entry( '8.8.8.8', 'proxy', 'ip' );
$client->get_blocklist_entries();
$client->delete_blocklist_entry( '8.8.8.8', 'proxy', 'ip' );
```

### Credit Usage Monitoring

[](#credit-usage-monitoring)

Track API usage:

```
$credits = $client->get_credit_usage();
echo "Available credits: " . $credits->get_credits();
echo "Usage this period: " . $credits->get_usage();
```

Contributions
-------------

[](#contributions)

Contributions to this library are highly appreciated. Raise issues on GitHub or submit pull requests for bug fixes or new features. Share feedback and suggestions for improvements.

License: GPLv2 or later
-----------------------

[](#license-gplv2-or-later)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

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 (13 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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