Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://scanfully.com
Tags: monitoring, site health, broken links, broken media, activity log
Requires at least: 6.0
Tested up to: 7.1.0
Stable tag: 1.9.0
Stable tag: 1.9.1
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Requires PHP: 7.4
Expand Down Expand Up @@ -215,7 +215,7 @@ Once connected, the plugin sends data to the Scanfully API at api.scanfully.com
* The WordPress activity described above, as it happens. It includes the display name of the person who made a change, and the old and new value of a changed setting. Content and file editor changes are sent as a short diff of the lines that changed.
* For accounts with elevated rights only: their email address with their user events, and the IP address and browser of their logins and of the first use of an application password.
* Failed logins as counts per hour, with the accounts with elevated rights that were tried, but without IP addresses or the usernames tried.
* When WooCommerce checkout monitoring is on: the shop details its test checkout needs, such as the product, shipping method and checkout page. Scanfully then places test orders, which the plugin cancels and removes.
* When WooCommerce is active: the shop details a test checkout needs, such as the product, shipping method and checkout page, on connect, once a day and when they change. Scanfully only places test orders when WooCommerce checkout monitoring is on for the site, and the plugin cancels and removes them.

Email deliverability checks are on by default: the plugin sends test emails to a Scanfully address through your site's own mail setup. You can turn them off under Settings > Scanfully.

Expand All @@ -226,6 +226,11 @@ Scanfully's [terms and conditions](https://scanfully.com/terms/) and [privacy po

== Changelog ==

= 1.9.1: October 27, 2026 =
* Fixed: the WooCommerce checkout test reported a false failure on shops with Mollie
* Fixed: test orders of the WooCommerce checkout test no longer email the shop a cancelled order notice, which WooCommerce 11 started sending, and no other WooCommerce email is sent about a test order
* Fixed: FooEvents tickets, Greyd Forms entries, WP RSS Aggregator feed items and WP User Activity log entries no longer show in the activity log as saved posts

= 1.9.0: October 19, 2026 =
* Added: the activity log reports what changed in a saved post, posts deleted permanently, categories, tags and other terms, and bulk actions as one row listing every post or term
* Added: media library changes, every setting of the core settings screens, navigation menus and widgets, Customizer theme settings, and Site Editor styles, templates, template parts and fonts in the activity log
Expand Down
4 changes: 2 additions & 2 deletions scanfully.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @wordpress-plugin
* Plugin Name: Scanfully
* Version: 1.9.0
* Version: 1.9.1
* Plugin URI: https://scanfully.com/wp-plugin
* Description: Scanfully is your favorite WordPress performance and health monitoring tool.
* Author: Scanfully
Expand Down Expand Up @@ -68,7 +68,7 @@ function Scanfully(): \Scanfully\Main { // phpcs:ignore WordPress.NamingConventi
function () {
// meta.
define( 'SCANFULLY_PLUGIN_FILE', __FILE__ );
define( 'SCANFULLY_VERSION', '1.9.0' );
define( 'SCANFULLY_VERSION', '1.9.1' );

// boot.
require __DIR__ . '/vendor/autoload.php';
Expand Down
38 changes: 34 additions & 4 deletions src/Events/PostSaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ private static function summarize_post( $post ): ?array {
'acf-field-group',
// SEOPress logs every request for a missing URL as a post.
'seopress_404',
// FooEvents saves a post for every ticket sold, and changes it when
// the ticket is checked in.
'event_magic_tickets',
// Greyd Forms saves every form entry as a post.
'tp_forms_entry',
// WP RSS Aggregator saves every item it imports from a feed as a
// post, and deletes old ones.
'wprss_feed_item',
];

/**
Expand Down Expand Up @@ -283,10 +291,10 @@ public static function is_reported( object $post ): bool {

/**
* Whether saves of this post type are reported. Skips internal types,
* types without an admin screen, and every WooCommerce order type: with
* HPOS, each order also saves a backup post (a placeholder, or a
* `shop_order` draft when sync is on), which would otherwise turn every
* checkout into a timeline event.
* types without an admin screen, the log of WP User Activity, and every
* WooCommerce order type: with HPOS, each order also saves a backup post
* (a placeholder, or a `shop_order` draft when sync is on), which would
* otherwise turn every checkout into a timeline event.
*
* @param string $post_type The post type.
*
Expand All @@ -301,8 +309,30 @@ public static function is_tracked_post_type( string $post_type ): bool {
return false;
}

if ( self::is_user_activity_log( $post_type ) ) {
return false;
}

$type_object = get_post_type_object( $post_type );

return is_object( $type_object ) && ! empty( $type_object->show_ui );
}

/**
* Whether a post type is the log of WP User Activity, another activity
* log plugin that saves every entry as a post. Its name (`activity`) is
* too common to skip while that plugin is not active.
*
* @param string $post_type The post type.
*
* @return bool
*/
private static function is_user_activity_log( string $post_type ): bool {
// Version 2.3.0 and later name the type with a filter.
if ( function_exists( 'wp_user_activity_get_post_type' ) ) {
return wp_user_activity_get_post_type() === $post_type;
}

return 'activity' === $post_type && function_exists( '_wp_user_activity' );
}
}
23 changes: 23 additions & 0 deletions src/WooCheckout/BlocksIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,29 @@ static function ( $registry ) {
}
}
);
add_action( 'woocommerce_blocks_payment_method_type_registration', [ self::class, 'keep_only_probe_method' ], PHP_INT_MAX );
}

/**
* During a validated probe request, unregister every other block payment
* method. ProbeGateway leaves only the probe gateway registered, and some
* block integrations (Mollie) throw when their own gateway is missing,
* which breaks every page that loads the payment method registry,
* product pages included.
*
* @param object $registry The WooCommerce Blocks payment method registry.
*
* @return void
*/
public static function keep_only_probe_method( $registry ): void {
if ( ! Controller::is_probe_request() || ! method_exists( $registry, 'get_all_registered' ) || ! method_exists( $registry, 'unregister' ) ) {
return;
}
foreach ( array_keys( $registry->get_all_registered() ) as $name ) {
if ( Controller::PROBE_GATEWAY_ID !== $name ) {
$registry->unregister( $name );
}
}
}

/**
Expand Down
40 changes: 30 additions & 10 deletions src/WooCheckout/ProbeGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ public static function setup(): void {
add_filter( 'woocommerce_available_payment_gateways', [ self::class, 'filter_available_gateways' ], 99 );

// Probe-only filters: suppress emails + prevent stock decrement.
add_filter( 'woocommerce_email_recipient_new_order', [ self::class, 'suppress_email_for_probe' ], 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_processing_order', [ self::class, 'suppress_email_for_probe' ], 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_on_hold_order', [ self::class, 'suppress_email_for_probe' ], 10, 2 );
// WooCommerce Subscriptions: the subscription a probe order creates
// is cancelled right away, which would otherwise email the shop.
add_filter( 'woocommerce_email_recipient_cancelled_subscription', [ self::class, 'suppress_email_for_probe' ], 10, 2 );
add_filter( 'woocommerce_email_recipient_expired_subscription', [ self::class, 'suppress_email_for_probe' ], 10, 2 );
add_filter( 'woocommerce_email_recipient_suspended_subscription', [ self::class, 'suppress_email_for_probe' ], 10, 2 );
// Every registered email is covered, not a list: WooCommerce 11 emails
// the admin on pending -> cancelled, and WooCommerce Subscriptions
// emails the shop when the probe subscription is cancelled.
add_action( 'woocommerce_email', [ self::class, 'suppress_probe_emails' ] );
if ( did_action( 'woocommerce_email' ) && function_exists( 'WC' ) ) {
self::suppress_probe_emails( WC()->mailer() );
}
add_filter( 'woocommerce_can_reduce_order_stock', [ self::class, 'skip_stock_reduction_for_probe' ], 10, 2 );
add_filter( 'woocommerce_webhook_should_deliver', [ self::class, 'skip_webhooks_for_probe' ], 10, 3 );

Expand Down Expand Up @@ -169,8 +168,9 @@ private static function probe_only_gateways( array $gateways ): array {
* plugin-owned stub PSP URL.
*
* The scan ends at the stub PSP, so the order is cancelled right away.
* Cancelling releases the stock WooCommerce reserved at checkout, and
* pending -> cancelled sends no email. Subscriptions the order created
* Cancelling releases the stock WooCommerce reserved at checkout; the
* cancelled order email it triggers is suppressed with every other email
* of a tagged order (suppress_probe_emails). Subscriptions the order created
* (WooCommerce Subscriptions) are tagged before and cancelled after, so
* their emails stay suppressed and the cleanup deletes them too.
*
Expand Down Expand Up @@ -264,6 +264,26 @@ private static function cancel_subscription( \WC_Order $subscription ): void {
}
}

/**
* Hook the probe suppression into the recipient filter of every email the
* WooCommerce mailer has registered, including those added by other
* plugins through `woocommerce_email_classes`.
*
* @param \WC_Emails|object $mailer The WooCommerce mailer.
*
* @return void
*/
public static function suppress_probe_emails( $mailer ): void {
if ( ! is_object( $mailer ) || ! method_exists( $mailer, 'get_emails' ) ) {
return;
}
foreach ( (array) $mailer->get_emails() as $email ) {
if ( is_object( $email ) && ! empty( $email->id ) ) {
add_filter( 'woocommerce_email_recipient_' . $email->id, [ self::class, 'suppress_email_for_probe' ], 10, 2 );
}
}
}

/**
* Suppress WC email recipients for probe orders.
*
Expand Down
18 changes: 18 additions & 0 deletions tests/Fixtures/wp-user-activity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Stand-in for WP User Activity (2.3.0 and later): the function it declares
* to name its post type, for tests that need the plugin active.
*
* @package Scanfully\Tests
*/

if ( ! function_exists( 'wp_user_activity_get_post_type' ) ) {
/**
* The post type WP User Activity saves its log in.
*
* @return string
*/
function wp_user_activity_get_post_type() {
return 'activity';
}
}
88 changes: 88 additions & 0 deletions tests/Integration/PostEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ protected function tearDown(): void {
delete_option( 'scanfully_connect_is_connected' );
remove_filter( 'scanfully_post_saved_events_per_minute', '__return_zero' );
unregister_post_type( 'seopress_404' );
unregister_post_type( 'event_magic_tickets' );
unregister_post_type( 'tp_forms_entry' );
unregister_post_type( 'wprss_feed_item' );
unregister_post_type( 'activity' );
unregister_post_type( 'scanfully_test_type' );
}
parent::tearDown();
Expand Down Expand Up @@ -111,6 +115,90 @@ public function test_a_seopress_404_record_queues_nothing_from_creation_to_delet
);
}

public function test_a_fooevents_ticket_queues_nothing_from_creation_to_deletion(): void {
// FooEvents registers the type with an admin screen and saves a
// published ticket for every ticket sold at checkout.
register_post_type( 'event_magic_tickets', [ 'show_ui' => true ] );

$this->assertSame(
[
'created' => 0,
'updated' => 0,
'status changed' => 0,
'trashed' => 0,
'deleted' => 0,
],
$this->jobs_queued_per_step( 'event_magic_tickets' )
);
}

public function test_a_greyd_forms_entry_queues_nothing_from_creation_to_deletion(): void {
// Greyd Forms registers the type with an admin screen and saves a
// post for every form a visitor sends.
register_post_type( 'tp_forms_entry', [ 'show_ui' => true ] );

$this->assertSame(
[
'created' => 0,
'updated' => 0,
'status changed' => 0,
'trashed' => 0,
'deleted' => 0,
],
$this->jobs_queued_per_step( 'tp_forms_entry' )
);
}

public function test_a_wp_rss_aggregator_feed_item_queues_nothing_from_creation_to_deletion(): void {
// WP RSS Aggregator registers the type with an admin screen, saves a
// post for every item it imports from a feed, and deletes old ones.
register_post_type( 'wprss_feed_item', [ 'show_ui' => true ] );

$this->assertSame(
[
'created' => 0,
'updated' => 0,
'status changed' => 0,
'trashed' => 0,
'deleted' => 0,
],
$this->jobs_queued_per_step( 'wprss_feed_item' )
);
}

/**
* Runs in its own process: the plugin's function stays declared.
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_a_wp_user_activity_entry_queues_nothing_from_creation_to_deletion(): void {
// WP User Activity registers the type with an admin screen, saves a
// post for every entry of its own activity log, and deletes old ones.
require_once dirname( __DIR__ ) . '/Fixtures/wp-user-activity.php';
register_post_type( 'activity', [ 'show_ui' => true ] );

$this->assertSame(
[
'created' => 0,
'updated' => 0,
'status changed' => 0,
'trashed' => 0,
'deleted' => 0,
],
$this->jobs_queued_per_step( 'activity' )
);
}

public function test_an_activity_type_is_still_reported_while_wp_user_activity_is_not_active(): void {
register_post_type( 'activity', [ 'show_ui' => true ] );

$queued = $this->jobs_queued_per_step( 'activity' );

$this->assertSame( 1, $queued['created'] );
$this->assertSame( 1, $queued['trashed'] );
}

public function test_a_custom_post_type_with_an_admin_screen_is_still_reported(): void {
register_post_type( 'scanfully_test_type', [ 'show_ui' => true ] );

Expand Down
55 changes: 54 additions & 1 deletion tests/Unit/Events/PostSavedFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class PostSavedFilterTest extends TestCase {
*
* @var array<int, string>
*/
private array $ui_types = [ 'post', 'page', 'product', 'shop_order', 'seopress_404' ];
private array $ui_types = [ 'post', 'page', 'product', 'shop_order', 'seopress_404', 'event_magic_tickets', 'tp_forms_entry', 'wprss_feed_item', 'activity', 'site_activity' ];

protected function setUp(): void {
parent::setUp();
Expand Down Expand Up @@ -97,11 +97,64 @@ public function provide_ignored_saves(): array {
'SEOPress 404 record' => [ 'seopress_404', 'publish' ],
'SEOPress 404 record as a draft' => [ 'seopress_404', 'draft' ],
'trashed SEOPress 404 record' => [ 'seopress_404', 'trash' ],
'FooEvents ticket' => [ 'event_magic_tickets', 'publish' ],
'trashed FooEvents ticket' => [ 'event_magic_tickets', 'trash' ],
'Greyd Forms entry' => [ 'tp_forms_entry', 'publish' ],
'trashed Greyd Forms entry' => [ 'tp_forms_entry', 'trash' ],
'WP RSS Aggregator feed item' => [ 'wprss_feed_item', 'publish' ],
'trashed WP RSS Aggregator feed item' => [ 'wprss_feed_item', 'trash' ],
'custom type without an admin screen' => [ 'my_internal_type', 'publish' ],
'pending review status' => [ 'post', 'pending' ],
];
}

public function test_an_activity_type_is_reported_while_wp_user_activity_is_not_active(): void {
$this->assertTrue( $this->fires( 'activity' ) );
}

/**
* Runs in its own process: the plugin's functions stay declared.
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_wp_user_activity_entries_do_not_fire(): void {
Functions\when( 'wp_user_activity_get_post_type' )->justReturn( 'activity' );

$this->assertFalse( $this->fires( 'activity' ) );
$this->assertFalse( $this->fires( 'activity', 'trash' ) );
$this->assertTrue( $this->fires( 'post' ) );
}

/**
* Runs in its own process: the plugin's functions stay declared.
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_a_renamed_wp_user_activity_type_does_not_fire(): void {
// The `wp_user_activity_get_post_type` filter renamed the type.
Functions\when( 'wp_user_activity_get_post_type' )->justReturn( 'site_activity' );

$this->assertFalse( $this->fires( 'site_activity' ) );
$this->assertTrue( $this->fires( 'activity' ) );
}

/**
* Before version 2.3.0 the type was always `activity`, without a
* function to name it. Runs in its own process: the plugin's functions
* stay declared.
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_wp_user_activity_entries_before_2_3_do_not_fire(): void {
Functions\when( '_wp_user_activity' )->justReturn( null );

$this->assertFalse( $this->fires( 'activity' ) );
$this->assertTrue( $this->fires( 'post' ) );
}

public function test_publishing_right_after_saving_a_draft_is_reported(): void {
$this->assertTrue( $this->fires( 'post', 'draft', 5 ) );
$this->assertTrue( $this->fires( 'post', 'publish', 5 ), 'The publish event must not be dropped as a duplicate of the draft save.' );
Expand Down
Loading
Loading