WP Manifestindependent plugin directory
manifest / security / wf-ip-whitelist-sync

WordFence IP Whitelist Sync

A plugin designed to automatically maintain certain IP ranges in the whitelist of the WordPress security plugin WordFence.

by Kris Bailey · github.com/myfykris/wf-ip-whitelist-sync · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/myfykris/wf-ip-whitelist-sync/archive/refs/heads/main.zip

Automatically fetch and sync IP ranges from various services (like Google crawlers) to the WordFence whitelist.

Description

This plugin automatically maintains IP ranges in your WordFence whitelist by fetching the latest published IP range files from various services. It includes built-in support for Google's crawler IPs and can be extended to support any service that publishes their IPs in JSON, XML, or CSV format.

Features

  • Automatic Syncing: Schedule automatic updates of IP ranges on hourly, daily, weekly, or monthly intervals
  • Manual Sync: Run syncs manually with full preview and control
  • Multiple Sources: Pre-configured with Google crawler IPs, easily add custom sources
  • Format Support: Parses JSON, XML, and CSV formats
  • IP Version Control: Support for both IPv4 and IPv6 addresses
  • Global Filters: Set IPs to ignore, never add, or never remove
  • Diff Preview: Review what will be added/removed before applying changes
  • Statistics Dashboard: Track sync status and history

Requirements

  • WordPress 5.0 or higher
  • PHP 7.4 or higher
  • WordFence Security plugin (required)

Installation

  1. Upload the wf-ip-whitelist-sync folder to /wp-content/plugins/
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Navigate to "WF IP Sync" in the WordPress admin menu
  4. Configure your settings and review the pre-configured Google sources

Usage

Dashboard

View statistics about your sync sources and current settings. Quick access to:

  • Run manual sync
  • Manage sync sources
  • Configure settings

Sync Sources

Manage your IP range sources:

  • View all configured sources
  • Add new sources
  • Edit/delete existing sources
  • See last fetch status and dates

Manual Sync

Three-step process for manual synchronization:

  1. Select Sources: Choose which sources to sync
  2. Preview Changes: Review what will be added/removed, edit if needed
  3. View Results: See the outcome of applied changes

Settings

Configure global behavior:

  • Enable/disable automated syncing
  • IPv4/IPv6 support
  • Global ignore list
  • Never remove list
  • Never add list

Pre-configured Sources

The plugin comes with these Google crawler IP ranges pre-configured:

  • Google Crawler Bots
  • Google Special Case Crawlers (including ad bots)
  • Google User Triggered Fetches
  • Google Google Triggered Fetches

Adding Custom Sources

To add a custom IP source:

  1. Go to "WF IP Sync" → "Sync Sources"
  2. Click "Add New Sync Source"
  3. Fill in the details:
    • Label: Display name
    • Description: Optional details
    • Status: Manual, Automatic, or Disabled
    • URL: URL to the IP list file
    • Format: JSON, XML, or CSV
    • IP Format: CIDR notation or plain IPs
    • IP Version: IPv4, IPv6, or both
    • Remove Old Entries: Whether to remove IPs that are no longer in the source
    • Sync Interval: How often to sync (for automatic sources)

Hooks & Filters

Actions

  • wfipws_before_fetch - Before fetching data from a source
  • wfipws_after_fetch - After fetching data from a source
  • wfipws_before_apply - Before applying changes to whitelist
  • wfipws_after_apply - After applying changes to whitelist
  • wfipws_sync_completed - After full sync process completes

Filters

  • wfipws_fetch_timeout - Modify HTTP request timeout (default: 30s)
  • wfipws_parsed_ips - Modify parsed IP list before applying
  • wfipws_removal_list - Modify IPs to remove before applying
  • wfipws_addition_list - Modify IPs to add before applying

Development

File Structure

wf-ip-whitelist-sync/
├── wf-ip-whitelist-sync.php    # Main plugin file
├── uninstall.php                # Cleanup on uninstall
├── includes/                    # PHP classes
│   ├── class-database.php
│   ├── class-sync-source.php
│   ├── class-settings.php
│   ├── class-ip-normalizer.php
│   ├── class-fetcher.php
│   ├── class-parser.php
│   ├── class-diff-calculator.php
│   ├── class-whitelist-manager.php
│   ├── class-cron.php
│   └── class-admin.php
├── admin/                       # Admin page templates
│   ├── dashboard.php
│   ├── settings.php
│   ├── sync-sources.php
│   ├── sync-source-edit.php
│   ├── manual-sync-step1.php
│   ├── manual-sync-step2.php
│   └── manual-sync-step3.php
└── assets/                      # CSS and JavaScript
    ├── css/admin.css
    └── js/admin.js

License

Apache License 2.0

Author

Kris Bailey kris@krisbailey.com

Repository

https://github.com/myfykris/wf-ip-whitelist-sync

Support

For issues and feature requests, please use the GitHub issue tracker.