{"id":22842712,"url":"https://github.com/arraypress/proxycheck","last_synced_at":"2025-04-28T13:25:38.493Z","repository":{"id":266974910,"uuid":"899918494","full_name":"arraypress/proxycheck","owner":"arraypress","description":"A PHP library for integrating with the ProxyCheck.io API in WordPress, providing proxy \u0026 VPN detection, disposable email verification, geolocation, and risk assessment. Features comprehensive response handling and WordPress transient caching.","archived":false,"fork":false,"pushed_at":"2024-12-07T12:12:25.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-07T12:22:48.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arraypress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-07T11:26:31.000Z","updated_at":"2024-12-07T12:12:28.000Z","dependencies_parsed_at":"2024-12-07T12:33:42.546Z","dependency_job_id":null,"html_url":"https://github.com/arraypress/proxycheck","commit_stats":null,"previous_names":["arraypress/proxycheck"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fproxycheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fproxycheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fproxycheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fproxycheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arraypress","download_url":"https://codeload.github.com/arraypress/proxycheck/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229478824,"owners_count":18079381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T02:09:37.386Z","updated_at":"2024-12-13T02:09:37.882Z","avatar_url":"https://github.com/arraypress.png","language":"PHP","readme":"# ProxyCheck Library for WordPress\n\nA comprehensive WordPress library for ProxyCheck.io integration, providing proxy \u0026 VPN detection, email verification, risk assessment, and complete dashboard management with intelligent caching.\n\n## Features\n\n- 🔍 **IP Analysis**: Detect proxies, VPNs, and assess risk levels\n- ✉️ **Email Verification**: Check for disposable email services\n- 📊 **Usage Analytics**: Track and manage API usage and quotas\n- 📋 **List Management**: Handle whitelists, blocklists, and CORS origins\n- 📈 **Statistics**: Access detection history and query analytics\n- 🏷️ **Tag Management**: Track and analyze tagged queries\n- 💾 **Smart Caching**: Optimize performance and reduce API calls\n\n## Requirements\n\n- PHP 7.4 or later\n- WordPress 6.7.1 or later\n- ProxyCheck.io API key\n- Dashboard API Access enabled (for dashboard features)\n\n## Installation\n\nInstall via Composer:\n\n```bash\ncomposer require arraypress/proxycheck\n```\n\n## Basic Usage\n\n```php\nuse ArrayPress\\ProxyCheck\\Client;\n\n// Initialize with API key\n$client = new Client(\n    'your-key-here',    // API key\n    true,               // Enable caching (optional)\n    600,                // Cache duration in seconds (optional)\n    'custom_prefix_'    // Cache prefix (optional)\n);\n\n// Check single IP\n$result = $client-\u003echeck_ip( '1.1.1.1' );\n\n// Check multiple IPs\n$results = $client-\u003echeck_ips( [ '1.1.1.1', '8.8.8.8' ] );\n\n// Check email\n$email = $client-\u003echeck_email( 'test@example.com', true ); // Second param enables email masking\n```\n\n## Configuration Methods\n\n### VPN \u0026 Proxy Settings\n\n```php\n// Configure VPN detection\n$client-\u003eset_vpn( true );     // Enable VPN detection\n$client-\u003eget_vpn();           // Check if VPN detection is enabled\n\n// Configure ASN lookups\n$client-\u003eset_asn( true );     // Enable ASN data inclusion\n$client-\u003eget_asn();           // Check if ASN lookups are enabled\n\n// Configure risk assessment\n$client-\u003eset_risk( 2 );       // Set risk assessment level (0-2)\n$client-\u003eget_risk();          // Get current risk assessment level\n\n// Configure port checking\n$client-\u003eset_port( true );    // Enable port checking\n$client-\u003eget_port();          // Check if port checking is enabled\n\n// Configure time seen data\n$client-\u003eset_seen( true );    // Enable last seen data\n$client-\u003eget_seen();          // Check if last seen data is enabled\n\n// Configure history period\n$client-\u003eset_days( 7 );       // Set history period in days\n$client-\u003eget_days();          // Get current history period setting\n```\n\n## Core Features\n\n### IP \u0026 Email Detection\n\n#### Checking IPs\n\n```php\n// Basic check with default options\n$result = $client-\u003echeck_ip( '1.1.1.1' );\n\n// Check with custom options\n$result = $client-\u003echeck_ip( '1.1.1.1', [\n    'vpn'  =\u003e 1,    // Enable VPN detection\n    'asn'  =\u003e 1,    // Include ASN data\n    'risk' =\u003e 2,    // Include attack history\n    'port' =\u003e 1,    // Check port\n    'seen' =\u003e 1,    // Include last seen\n    'days' =\u003e 7     // History period\n] );\n\n// Batch check multiple IPs\n$results = $client-\u003echeck_ips( [ '1.1.1.1', '8.8.8.8' ] );\n\n// Access results\nif ( $result-\u003eis_proxy() ) {\n    echo \"Proxy detected! Type: \" . $result-\u003eget_type();\n    echo \"Risk score: \" . $result-\u003eget_risk_score();\n}\n```\n\n#### Checking Emails\n\n```php\n// Check disposable email\n$result = $client-\u003echeck_email( 'test@example.com' );\n\n// With privacy masking\n$result = $client-\u003echeck_email( 'user@example.com', true ); // Masks as anonymous@example.com\n\nif ( $result-\u003eis_disposable() ) {\n    echo \"Disposable email detected!\";\n}\n```\n\n### Dashboard Management\n\n#### Usage \u0026 Statistics\n\n```php\n// Get usage information\n$usage = $client-\u003eget_formatted_usage();\necho \"Used today: \" . $usage['used'] . \" of \" . $usage['limit'];\necho \"Plan: \" . $usage['plan'];\n\n// Quick usage checks\n$used = $client-\u003eget_used_tokens();\n$remaining = $client-\u003eget_remaining_tokens();\n$is_exceeded = $client-\u003eis_token_limit_exceeded();\n\n// Get detailed query statistics\n$stats = $client-\u003eget_formatted_queries( 7 ); // Last 7 days\nprint_r( $stats['summary'] );\n```\n\n#### List Management\n\n```php\n// Whitelist Management\n$client-\u003eget_whitelist();\n$client-\u003eadd_to_whitelist( '1.1.1.1' );\n$client-\u003eadd_to_whitelist( ['1.1.1.1', '2.2.2.2' ] );\n$client-\u003eremove_from_whitelist( '1.1.1.1' );\n$client-\u003eset_whitelist( ['1.1.1.1', '2.2.2.2' ] ); // Replace all\n$client-\u003eclear_whitelist();\n\n// Blocklist Management\n$client-\u003eget_blacklist();\n$client-\u003eadd_to_blacklist( '1.1.1.1' );\n$client-\u003eremove_from_blacklist( '1.1.1.1' );\n$client-\u003eset_blacklist( ['1.1.1.1', '2.2.2.2' ] );\n$client-\u003eclear_blacklist();\n\n// CORS Origins Management\n$client-\u003eget_cors_origins();\n$client-\u003eadd_cors_origins( 'https://example.com' );\n$client-\u003eremove_cors_origins( 'https://example.com' );\n$client-\u003eset_cors_origins( [ 'https://example.com', 'https://test.com' ] );\n$client-\u003eclear_cors_origins();\n```\n\n#### Detection Analytics\n\n```php\n// Get recent detections\n$detections = $client-\u003eget_formatted_detections( 100 ); // Last 100 entries\n\n// Get detections with pagination\n$detections = $client-\u003eget_formatted_detections( 100, 50 ); // 100 entries starting from offset 50\n\n// Force bypass cache for fresh data\n$detections = $client-\u003eget_formatted_detections( 100, 0, true ); // Bypass cache\n\n// Get tagged queries\n$tags = $client-\u003eget_formatted_tags( [\n    'limit' =\u003e 100,\n    'days' =\u003e 7,\n    'addresses' =\u003e true\n] );\n```\n\n## Response Formats\n\n### IP Check Response\n\n```php\n// Basic Information\n$ip = $result-\u003eget_ip();\n$is_proxy = $result-\u003eis_proxy();\n$type = $result-\u003eget_type();\n$risk = $result-\u003eget_risk_score();\n$is_vpn = $result-\u003eis_vpn();\n\n// Attack History\n$attacks = $result-\u003eget_attack_history();\n\n// Network Information\n$port = $result-\u003eget_port();\n$seen = $result-\u003eget_last_seen();\n$operator = $result-\u003eget_operator();\n$operator_details = $result-\u003eget_operator_details(); // Full details including protocols\n\n// Location Information\n$continent = $result-\u003eget_continent();\n$country = $result-\u003eget_country();\n$region = $result-\u003eget_region();\n$city = $result-\u003eget_city();\n$coordinates = $result-\u003eget_coordinates();\n$timezone = $result-\u003eget_timezone();\n$currency = $result-\u003eget_currency();\n\n// Block Status\n$should_block = $result-\u003eshould_block();\n$block_reason = $result-\u003eget_block_reason();\n$block_details = $result-\u003eget_block_details();\n```\n\n### Usage Statistics Response\n\n```php\n[\n    'used' =\u003e 1234,              // Queries used today\n    'limit' =\u003e 5000,             // Daily query limit\n    'total' =\u003e 50000,            // Total queries made\n    'plan' =\u003e 'Premium',         // Account tier\n    'burst_available' =\u003e 100,    // Available burst tokens\n    'burst_limit' =\u003e 1000,       // Burst token allowance\n    'percentage' =\u003e 24.68,       // Usage percentage\n    'remaining' =\u003e 3766          // Remaining queries\n]\n```\n\n### Query Statistics Response\n\n```php\n[\n    'period' =\u003e 7,               // Days included\n    'days' =\u003e [                  // Daily statistics\n        [\n            'day' =\u003e 'TODAY',\n            'proxies' =\u003e 10,\n            'vpns' =\u003e 5,\n            'undetected' =\u003e 85,\n            'total_queries' =\u003e 100\n            // ... more metrics\n        ]\n    ],\n    'totals' =\u003e [               // Period totals\n        'proxies' =\u003e 50,\n        'vpns' =\u003e 25,\n        // ... more totals\n    ],\n    'percentages' =\u003e [          // Usage percentages\n        'proxies' =\u003e 15.5,\n        'vpns' =\u003e 7.8,\n        // ... more percentages\n    ],\n    'summary' =\u003e [              // Overview\n        'period_days' =\u003e 7,\n        'active_days' =\u003e 5,\n        'total_queries' =\u003e 500,\n        'detected_threats' =\u003e 75,\n        'detection_rate' =\u003e 15.0,\n        'average_daily_queries' =\u003e 71.4\n    ]\n]\n```\n\n## Advanced Features\n\n### Error Handling\n\nThe library uses WordPress's `WP_Error` for consistent error handling:\n\n```php\n$result = $client-\u003echeck_ip( 'invalid-ip' );\n\nif ( is_wp_error( $result ) ) {\n    $code = $result-\u003eget_error_code();\n    $message = $result-\u003eget_error_message();\n    echo \"Error ($code): $message\";\n}\n```\n\n### Caching\n\nThe library implements intelligent caching to optimize performance:\n\n```php\n// Configure caching\n$client-\u003eset_cache_enabled( true );\n$client-\u003eset_cache_expiration( 3600 );  // 1 hour\n$client-\u003eset_cache_prefix( 'my_plugin_' );\n\n// Force bypass cache for specific requests\n$result = $client-\u003eexport_detections( 100, 0, true );           // Bypass cache for raw data\n$formatted = $client-\u003eget_formatted_detections( 100, 0, true ); // Bypass cache for formatted data\n\n// Clear cache\n$client-\u003eclear_cache();               // All cache\n$client-\u003eclear_cache( '1.1.1.1' );    // Specific entry\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nLicensed under the GPLv2 or later license.\n\n## Support\n\n- [Documentation](https://proxycheck.io/api/)\n- [Dashboard Access](https://proxycheck.io/dashboard/)\n- [Issue Tracker](https://github.com/arraypress/proxycheck/issues)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fproxycheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farraypress%2Fproxycheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fproxycheck/lists"}