Skip to content

Instantly share code, notes, and snippets.

View paulgoodchild's full-sized avatar

Paul Goodchild paulgoodchild

View GitHub Profile
@paulgoodchild
paulgoodchild / functions.php
Created January 20, 2022 15:05
Customize whether a request is blocked in Shield
<?php declare( strict_types=1 );
/**
* Use this filter to tell Shield to block a request.
*
* By default, Shield will block requests solely based on the IP reputation for that site.
*
* With this filter, you can change these criteria.
*
* In this example we want to block all access to the WP admin and WP login areas and
@paulgoodchild
paulgoodchild / gist:e15774a5307d8f65416234b4ac61203c
Last active February 6, 2023 10:56
Easy Digital Downloads: Prevent license expiration notices being sent for licenses linked to refunded payments
<?php declare( strict_types=1 );
/**
* Easy Digital Downloads will send license expiration notices for any licenses, even if they
* have been refunded. This is not ideal.
*
* This filter will prevent such notices being sent if any payments associated with this
* license have been refunded.
*
* This may not be applicable in cases where you EDD store supports multiple products in
@paulgoodchild
paulgoodchild / functions.php
Created August 9, 2023 14:01
Triggering on-demand scans on Shield Security Pro for WordPress
<?php declare( strict_types=1 );
use FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Scan\Controller;
/**
* Launching on-demand scans for Shield Security can be done using the function outlined below.
* It requires a single array parameter that contains the so-called "slugs" of the respective scans.
*
* Shield currently has 3 distinct scan types, namely:
* - AFS: file scanner, (WordPress, plugin, themes, malware scan)
@paulgoodchild
paulgoodchild / functions.php
Created March 8, 2024 11:59
Shield Security: Prevent loading of WP Site Health Security Components
<?php declare( strict_types=1 );
/**
* Be sure to place this in your theme's functions.php or if you're including
* it within a plugin, ensure that it runs before WP's 'init' action has executed.
*
* This will prevent Shield's Site Health components from executing and populating
* WP Site Health area with Security recommendations.
*/
add_filter( 'shield/can_run_site_health_security', '__return_false' );