PluginProbe ʕ •ᴥ•ʔ
Reviews Feed – Add Testimonials and Customer Reviews From Google Reviews, Yelp, TripAdvisor, and More / 2.6.7
Reviews Feed – Add Testimonials and Customer Reviews From Google Reviews, Yelp, TripAdvisor, and More v2.6.7
2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.7 2.6.8 2.6.5 2.6.4 2.6.3 2.6.2 2.6.0 2.5.5 2.5.4 2.5.3 2.5.2 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1 1.1.1 1.1.2 1.2.0 2.0 2.1.0 2.1.1 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.5.0 2.5.1
reviews-feed / tests / Unit / ReconcileRemovalTest.php
reviews-feed / tests / Unit Last commit date
Doubles 2 months ago Providers 2 months ago BulkReviewsUpdateStuckStateTest.php 2 months ago ClearCacheRelayResetTest.php 2 months ago DeleteSourceRelayFailureTest.php 2 months ago ErrorHandlerFalsyOptionTest.php 2 months ago FeedCacheUpdateServiceTest.php 2 months ago FeedMalformedPayloadTest.php 2 months ago ForceKeylessRefetchTest.php 2 months ago LicenseDeactivateStaleStateTest.php 2 months ago MediaFinderMemoTest.php 2 months ago MultiSourceAggregationTest.php 2 months ago ReconcileMigratedLicenseRoutineTest.php 2 months ago ReconcileRemovalTest.php 2 months ago RegisterWebsiteRoutineTest.php 2 months ago RemoteRequestMemoTest.php 2 months ago ReviewAlertHeaderTotalsTest.php 2 months ago ReviewAlertPageTargetingTest.php 2 months ago ReviewAlertStarFillTest.php 2 months ago ShortcodeNeutralizationTest.php 2 months ago SiteMigrationRecoveryTest.php 2 months ago Smash1583HeaderParityTest.php 2 months ago SourceIdLookupTest.php 2 months ago WpmlGetCurrentLanguageTest.php 2 months ago WpmlLanguageMappingTest.php 2 months ago
ReconcileRemovalTest.php
60 lines
1 <?php
2
3 namespace SmashBalloon\Reviews\Tests\Unit;
4
5 use PHPUnit\Framework\TestCase;
6
7 /**
8 * Regression guard for the REMOVAL of the destructive relay source
9 * reconciliation (SMASH-1585 follow-up, 2026-06-24).
10 *
11 * The relay's source-reconcile endpoint treated an empty `place_ids` keep-list
12 * as "remove all". A single false-empty from the plugin (e.g. a transient
13 * `$wpdb` read error returning an empty set) on a routine Clear All Caches could
14 * therefore wipe EVERY relay-side source for a paying customer. The feature was
15 * non-essential — the SMASH-1585 migration fix is the bearer-aware register
16 * rebind, and the per-source delete path already keeps the relay in sync — so it
17 * was removed outright rather than guarded.
18 *
19 * These tests fail if anyone reintroduces the destructive call, forcing a
20 * deliberate re-review (explicit confirmed remove-all signal + cross-repo
21 * place_id/provider pinning) before a keep-list/diff reconcile can return.
22 */
23 final class ReconcileRemovalTest extends TestCase
24 {
25 private static function saverSource(): string
26 {
27 $path = __DIR__ . '/../../class/Common/Builder/SBR_Feed_Saver_Manager.php';
28 self::assertFileExists($path, 'SBR_Feed_Saver_Manager.php not found at expected path');
29
30 return (string) file_get_contents($path);
31 }
32
33 public function test_reconcile_relay_sources_method_is_removed(): void
34 {
35 $this->assertStringNotContainsString(
36 'function reconcile_relay_sources',
37 self::saverSource(),
38 'The destructive reconcile_relay_sources() method must stay removed.'
39 );
40 }
41
42 public function test_plugin_never_posts_to_sources_reconcile(): void
43 {
44 $this->assertStringNotContainsString(
45 "->call('sources/reconcile'",
46 self::saverSource(),
47 'The plugin must not POST to sources/reconcile — an empty keep-list wipes all relay sources.'
48 );
49 }
50
51 public function test_clear_all_caches_does_not_invoke_reconcile(): void
52 {
53 $this->assertStringNotContainsString(
54 'self::reconcile_relay_sources()',
55 self::saverSource(),
56 'clear_all_caches() must not call reconcile_relay_sources().'
57 );
58 }
59 }
60