Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pstoute/7e44ea197618508008f6ea306ed08275 to your computer and use it in GitHub Desktop.
Save pstoute/7e44ea197618508008f6ea306ed08275 to your computer and use it in GitHub Desktop.
Add this to your /wp-content/mu-plugins/ directory to allow the eBridge or JitterBit connections to your Fortress Secured WordPress site.
<?php
/**
* Plugin Name: GridPane Fortress - Overrrides for eBridge/JitterBit connections | APAC Region
* Description: Companion plugin to the Fortress Security module to whitelist eBridge/JitterBit connections.
* Author: Stoute Web Solutions
* Author URI: https://stoutewebsolutions.com
* Version: 1.0
*/
// This is a replication of the original whitelisted module for ManageWP found here: https://github.com/snicco/fortress/blob/beta/docs/modules/session/sudo-mode.md#skipping-the-sudo-mode-check-for-request-from-managewp
use Snicco\Enterprise\Fortress\Session\Infrastructure\Event\ShouldSudoModeCheckBeSkipped;
add_action(ShouldSudoModeCheckBeSkipped::class, function (ShouldSudoModeCheckBeSkipped $event) {
// Alloy IPs provided by the eBridge/JitterBit Technical team. Your specific IP addresses may be different and should be confirmed with your eBridge/JitterBit account rep.
$ips = [
'20.28.188.183',
'20.70.144.112',
'20.92.123.11',
'20.92.210.110',
'20.92.210.238',
'20.92.212.99',
'20.92.212.105',
'20.92.214.145',
'20.92.215.151',
'20.211.19.241',
'20.211.64.10',
'20.213.0.69',
'20.213.0.122',
'20.213.0.136',
'20.213.0.149',
'20.213.0.184',
'20.213.1.10',
'20.213.1.31',
'20.213.1.58',
'20.213.2.48',
'20.213.2.74',
'20.213.2.121',
'20.213.4.82',
'20.213.4.141',
'20.213.4.161',
'20.213.4.224',
'20.213.4.228',
'20.213.5.1',
'20.213.5.5',
'20.213.5.7',
'20.213.5.9',
'20.213.5.12',
'20.213.5.31',
'20.213.5.150',
'20.213.5.152',
'20.213.134.96'
];
if(in_array($_SERVER['REMOTE_ADDR'], $ips, true)){
$event->skip_for_current_request = true;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment