Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pstoute/afb4701abb137eaa7594f11db1b64fef to your computer and use it in GitHub Desktop.
Save pstoute/afb4701abb137eaa7594f11db1b64fef 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 | NA 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 = [
'13.82.5.152',
'13.82.224.23',
'20.119.16.23',
'20.124.78.200',
'20.124.79.125',
'20.124.79.150',
'20.124.79.187',
'20.127.32.147',
'20.127.131.20',
'20.241.176.70',
'20.241.176.72',
'20.241.177.7',
'20.241.178.23',
'20.241.178.41',
'20.241.178.55',
'20.241.178.57',
'20.241.178.100',
'20.241.178.115',
'20.241.178.121',
'20.241.178.125',
'20.241.178.138',
'20.241.178.152',
'20.241.178.167',
'20.241.178.218',
'20.241.179.159',
'20.241.179.183',
'20.241.179.198',
'20.241.179.250',
'20.241.180.9',
'20.241.180.81',
'20.241.180.89',
'20.241.180.93',
'20.241.180.111',
'20.241.180.136',
'20.241.180.231',
'40.71.22.62',
'40.84.49.11',
'52.191.197.101',
'52.224.127.37',
'52.226.68.60'
];
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