Prefix Gate - Thread Prefix Interstitial

Prefix Gate - Thread Prefix Interstitial 1.0.16

No permission to download

latropa

Member
Licensed customer
latropa submitted a new resource:

Prefix Gate - Thread Prefix Interstitial - Shows configurable warning interstitial to guests before they can view threads with selected prefix.

Prefix Gate is a lightweight XenForo 2.3 add-on that displays a configurable interstitial to guests before they can view threads containing a selected thread prefix.

It was originally created for forums that want to place a warning in front of threads marked with an NSFW or similar prefix, but it can be used with any thread prefix.

Features
  • Select any existing thread prefix to trigger the interstitial.
  • Guests must acknowledge the warning before viewing gated...

Read more about this resource...
 
latropa updated Prefix Gate - Thread Prefix Interstitial with a new update entry:

1.0.5 - Gated thread hover preview protection

Prefix Gate 1.0.5 prevents unacknowledged guests from seeing the first-post content of gated threads through XenForo's stock thread hover previews.

Before a guest has acknowledged the Prefix Gate content notice, hovering a gated thread now displays:

Content preview unavailable until you open this thread and acknowledge the content notice.

After the guest clicks Continue, normal thread previews are restored for the remainder of the configured acknowledgment period...

Read the rest of this update entry...
 
latropa updated Prefix Gate - Thread Prefix Interstitial with a new update entry:

1.0.6 - Gate Unconfirmed Users

Added
  • Added a new "Gate users awaiting email confirmation" option, enabled by default.
  • When enabled, logged-in users in XenForo's email-confirmation states are required to acknowledge Prefix Gate like guests.

Behavior
  • The new option covers both XenForo email-confirmation states: email_confirm and email_confirm_edit.
  • Fully confirmed registered members continue to bypass Prefix Gate.
  • Other non-valid user states are not newly gated by this option...

Read the rest of this update entry...
 
latropa updated Prefix Gate - Thread Prefix Interstitial with a new update entry:

1.0.7 - Expanded Media Exposure Protection

Added:
  • Added lightweight alternate-media protection for gated threads before acknowledgment.
  • Added centralized gate-decision logic so thread views and alternate output paths use the same guest/unconfirmed-user, prefix, and acknowledgment checks.
  • Protected direct post "show" rendering and thread new-posts AJAX rendering.
  • Prevented gated post/thread embeds from rendering before acknowledgment, including a gated thread/post embedded inside otherwise ungated content and...

Read the rest of this update entry...
 
latropa updated Prefix Gate - Thread Prefix Interstitial with a new update entry:

1.0.10 - Notification Email Media Suppression

Added:​

  • Added optional gated-thread media suppression for watched thread/forum notification emails.
  • When enabled, images, attachments, embedded media, and embedded content are omitted from notification emails for threads using the configured gated prefix.
  • Normal message text, quotes, formatting, and ordinary links remain included in the email.
  • Suppressed attachments remain available as readable text links back to the originating post rather than...

Read the rest of this update entry...
 
latropa updated Prefix Gate - Thread Prefix Interstitial with a new update entry:

1.0.12 – Canonical URL fixes and notification email improvements

This release improves canonical URL handling, notification email compatibility, and navigation from gated content.

Changes:
  • Fixed canonical URL handling for gated threads accessed through bare thread IDs or outdated title slugs. The requested page is preserved when continuing.
  • Added canonical metadata and a generic content-warning description to the interstitial without exposing post content.
  • Added native thread prefix formatting and forum breadcrumbs to the warning...

Read the rest of this update entry...
 
latropa updated Prefix Gate - Thread Prefix Interstitial with a new update entry:

1.0.14 - Multiple gated prefixes and reliability improvements

This release adds support for gating multiple thread prefixes, improves prefix selection in the Admin CP, and includes several reliability improvements.

Changes:

  • Select one, several, or all existing thread prefixes using a grouped checkbox list. A thread triggers the warning when any selected prefix matches, including any prefix applied by Xon’s Multi Prefix, regardless of its position.
  • Added prefix IDs beside each name to distinguish prefixes with identical names.
  • Added a...

Read the rest of this update entry...
 
latropa updated Prefix Gate - Thread Prefix Interstitial with a new update entry:

1.0.15 - Activity summary email media suppression

This release extends gated-thread media suppression to XenForo’s activity-summary emails.

Changes:
  • Fixed gated-thread media appearing in the Latest threads and Latest posts sections of activity-summary emails.
  • Each excerpt is checked independently against the selected gated prefixes, including any prefix applied by Xon’s Multi Prefix, regardless of its position.
  • Gated media is suppressed using the existing media-omission notice, while ordinary text and links remain...

Read the rest of this update entry...
 
The phrase text can be modified to act as a spoiler warning 'walled garden', which is pretty neat - all things considered. 👍

While testing, there is a slight issue: if the forum is configured-for and enforces caching of content, in particular guest-viewing caching, the continue button doesn't exactly 'work'. Guests get stuck into a continue button pressing loop until the cache is revalidated/expired. Some sort of override should be considered with guests and the caching mechanisms active on a forum when this addon is activated with threads utilizing configured prefixes.
 
The phrase text can be modified to act as a spoiler warning 'walled garden', which is pretty neat - all things considered. 👍

While testing, there is a slight issue: if the forum is configured-for and enforces caching of content, in particular guest-viewing caching, the continue button doesn't exactly 'work'. Guests get stuck into a continue button pressing loop until the cache is revalidated/expired. Some sort of override should be considered with guests and the caching mechanisms active on a forum when this addon is activated with threads utilizing configured prefixes.
Which XenForo version and Prefix Gate version are you using? Is this happening with XenForo’s built-in guest page caching, or are you using something else to cache pages?

Does it also happen in a fresh incognito/private browser window? I haven’t been able to reproduce the loop on my forum, so knowing which caching setup you’re using would help me look into it.
 
Which XenForo version and Prefix Gate version are you using? Is this happening with XenForo’s built-in guest page caching, or are you using something else to cache pages?

Does it also happen in a fresh incognito/private browser window? I haven’t been able to reproduce the loop on my forum, so knowing which caching setup you’re using would help me look into it.
1.0.14, just updated to 1.0.15. Issue persists for guests. Likely related to the caching settings I have active.

Caching settings are shown as below:

PHP:
$config['pageCache']['enabled']  = true;
$config['pageCache']['cleanThreshold'] = 500;
$config['pageCache']['lifetime'] = 30;
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;

$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = ['host' => 'REMOVED','password' => 'REMOVED','database' => '60','timeout' => '1','compress_threshold' => 2048,'compress_lib' => 'zstd'];
$config['cache']['context']['page']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['context']['page']['config'] = ['host' => 'REMOVED','password' => 'REMOVED','database' => '59','timeout' => '1','compress_threshold' => 2048,'compress_lib' => 'zstd'];

The above config uses @Xon 's Redis Cache addon running version 2.18.12 here: https://xenforo.com/community/resources/redis-cache-by-xon.5562/

All seems to revolve around $config['pageCache']['lifetime'] = 30; when used in conjunction with $config['cache']['context']['page'] for guest-thread viewing with the addon. Which is where the continue 'button mashing' / looping comes into play.

When one guest then finally gains access to the thread with the continue button bypass active for their session, other guests can then see the same threads content, bypassing the continue / warning interstitial. Which is directly related to the caching settings above.
 
latropa updated Prefix Gate - Thread Prefix Interstitial with a new update entry:

1.0.16 - Guest page caching compatibility fixes

This release addresses two issues affecting forums using XenForo’s guest page caching.

Changes:
  • Fixed cached warning pages causing guests to return to the warning after clicking Continue.
  • Fixed cached thread content allowing other guests to bypass the warning without acknowledging it.
  • Guest page caching now keeps separate copies for guests who have acknowledged the warning and those who have not.
  • Changes to the selected gated prefixes or acknowledgment duration use...

Read the rest of this update entry...
 
1.0.14, just updated to 1.0.15. Issue persists for guests. Likely related to the caching settings I have active.

Caching settings are shown as below:

PHP:
$config['pageCache']['enabled']  = true;
$config['pageCache']['cleanThreshold'] = 500;
$config['pageCache']['lifetime'] = 30;
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;

$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = ['host' => 'REMOVED','password' => 'REMOVED','database' => '60','timeout' => '1','compress_threshold' => 2048,'compress_lib' => 'zstd'];
$config['cache']['context']['page']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['context']['page']['config'] = ['host' => 'REMOVED','password' => 'REMOVED','database' => '59','timeout' => '1','compress_threshold' => 2048,'compress_lib' => 'zstd'];

The above config uses @Xon 's Redis Cache addon running version 2.18.12 here: https://xenforo.com/community/resources/redis-cache-by-xon.5562/

All seems to revolve around $config['pageCache']['lifetime'] = 30; when used in conjunction with $config['cache']['context']['page'] for guest-thread viewing with the addon. Which is where the continue 'button mashing' / looping comes into play.

When one guest then finally gains access to the thread with the continue button bypass active for their session, other guests can then see the same threads content, bypassing the continue / warning interstitial. Which is directly related to the caching settings above.
1.0.16 should fix that... I hope. 🤞 I tested what I could on my end but I don't have the redis add-on so I can't be sure.
 
1.0.16 should fix that... I hope. 🤞 I tested what I could on my end but I don't have the redis add-on so I can't be sure.
Just updated and gave it a whirl, the issue is still persisting.

I may need to see if this is somehow being caused by PHP 8's OpCache as well.
 
After more testing, PHPs OpCache does not affect it. Turning off all caching makes the addon function correctly, so it is related to guest-view caching settings on redis/valkey (and probably other caching implementations).

Checking thru the docs, it appears to be recommended to use the pageCache onSetup bit to declare some sort of override for a thread prefix match:

PHP:
$config['pageCache']['onSetup'] = function (\XF\PageCache $pageCache) {
    // custom checks here (e.g. inspect request params or load the thread)
    // return false to disable caching for a request....
};

Might be an option? I have yet to delve into the source code to gain insight with what you have going on. :)
 
I'm not sure. I'll keep it in mind and maybe test using redis or valkey in the future to see if I can figure it out.
 
Back
Top Bottom