AdBlock Tracker & Usergroup Swap

AdBlock Tracker & Usergroup Swap v3.0.0 Release Candidate 1

No permission to buy ($45.00)
  • FIXED: Moderator/administrative tooltip added for AdBlock History reviewing
  • ADDED: Config.php option to enable guest session variable
  • ADDED: Config.php option to enable cache busting
  • UPDATED: FAQ with help information regarding template modifications
You can add an option to your config.php as follows. I recommend you use a unique variable name in your config. This example uses: isAdBlocking

Update your config.php as shown below.

Please ensure you have guest tracking enabled in the Add-On options or the following will changes will have no effect within templates for guests:

Config.php Update
PHP:
/* AdBlock Tracker and Usergroup Swap */
/* https://xenforo.com/community/resources/adblock-tracker-usergroup-swap.7530/field?field=faq */
$config['adBlockTrackerGuestSession']['enabled'] = true;
$config['adBlockTrackerGuestSession']['config'] = [
    'variable' => 'isAdBlocking', // recommend using something unique here
    'removeOnNonDetect' => true,
    'forceRemoval' => false,
];

You can access the following in your templates once this is set.

Here's an example:

Code:
<xf:if is="$xf.session.isAdBlocking">
    <div style="background-color:#f8d7da;color:#721c24;padding:20px;border-radius:8px;">
        <p>Ad Blocking Detected!</p>
        <p>Pages counted: {{ $xf.session.isAdBlocking }}</p>
    </div>
</xf:if>

By default, your variable (isAdBlocking in this example), will be the count of the number of page views AdBlocked consecutively. If the AdBlocker is disabled the session variable will be unset and cleared.

Note, depending on your caching system you may need to enable forceRemoval. This will delete the sessionId from the database directly. Use at your own risk.
  • ADDED: viewAdBlockTrackerHistory permission as a general "General Moderator Permission"
  • NOTE: Permission needs to be added to the Moderator group to allow access
  • NEW: "View AdBlock Tracker history" now available from member_tooltip

Attachments

  • Screenshot 2024-08-21 at 11.38.10 AM.webp
    Screenshot 2024-08-21 at 11.38.10 AM.webp
    23.4 KB · Views: 35
  • Screenshot 2024-08-21 at 11.38.37 AM.webp
    Screenshot 2024-08-21 at 11.38.37 AM.webp
    28.3 KB · Views: 27
  • NEW: Added Easy List selection (can select a list local to your country if needed)
  • ADDED: Bait classes are now selected from a live list
  • ADDED: Bait class creation is created hourly and cached
  • UPDATE: Changed default sort order to list AdBlock first in AdBlock Log
  • UPDATE: Remove excessive date information to keep columns thin (same as thread times)
  • UPDATE: Added break to list headers to save space
  • NOTE: Live bait classes are only available if a cache provider system is defined in config.php
  • NOTE: If no cache system is in place the system uses appropriate defaults
  • UPDATE: Default options changed for new installs only
  • NEW: Widget "AdBlock Status" for displaying AdBlock status in widget areas
    • Display criteria: Any, AdBlocking or Clear
    • Show: Requirements to clear
    • Show: Learn more link
    • Show: Thank you for not AdBlocking (depends on Clear status)

Attachments

  • Screenshot 2024-08-12 at 2.41.40 AM.webp
    Screenshot 2024-08-12 at 2.41.40 AM.webp
    41.5 KB · Views: 39
  • Screenshot 2024-08-12 at 2.42.01 AM.webp
    Screenshot 2024-08-12 at 2.42.01 AM.webp
    27.6 KB · Views: 36
  • Screenshot 2024-08-12 at 2.42.30 AM.webp
    Screenshot 2024-08-12 at 2.42.30 AM.webp
    20.1 KB · Views: 36
  • Screenshot 2024-08-12 at 2.44.00 AM.webp
    Screenshot 2024-08-12 at 2.44.00 AM.webp
    21.5 KB · Views: 37
  • FIX: Update cron SQL to be friendly with MySQL 5.7x
  • FIX: Route definition for :int<user_id,username> on user_edit
    • Resolves all issues with usernames passed through url
  • Added user-edit "AdBlock history" buttons:
  • Reset: Clears AdBlock Status, decrements swap counter, sets current nondetects and current detects to 0
  • Delete: Removes user and deletes all device history (essentially a hard reset)
  • Ignore: Resets user and removes the from tracking and log list
  • When hidden or deleted by an admin, the user will ALWAYS have their AdBlocking usergroup removed
  • When "ignored and hidden", their status will be cleared
  • When "deleted" or "reset", their status will be cleared
  • FIX: Wrapped user-edit tab/pane in "if $user" (may resolve issue with "Adblock history tab throws error")
  • UPDATE: Exit detection immediately if guest, and not tracking guests
  • UPDATE: Perform ignored usergroup check in detection API (in case page was cached or admin option was changed during page load)
  • UPDATE: Perform crawler check against user-agent ONLY when required
  • UPDATE: Perform usergroup check ONLY when required
  • Moved "AdBlock Tracker" statistics position and placed it under "Statistics" (now requires "view statistics" permission)
  • Added "Unhide all entities" button for XF 2.2x list template (was previously only available on XF 2.3+)
  • Added detected list filter: show hidden/ignored
  • Added message on user-edit screen if the user is being hidden/ignored
  • Like
Reactions: tajhay
  • Added: Browser logging with device type (limited to common 98%+)
  • Added: Link to AdBlock history from "AdBlock Tracker Log" in admin
  • Added: AdBlock History to user edit tab on user edit page of admin
  • Fix: Lightly adjusted columns on "AdBlock Tracker Log" page to make it a bit more legible
  • Added: overlay to AdBlock history for username for username (IP shows for Guest only)
  • FIX: JavaScript load issues
  • FIX: Using cache corrupts javascript and prevents tracking (redis, maybe others)
  • Update: (temporary) Caching completely disabled as it interferes with JS packer encryption
Please refer to the images posted along with this version update for a visual explanation.
  • NEW: AdBlock display for users AdBlocking [ link('account/adblock-tracker') ] (default=off)
  • NEW: AdBlock tracking details for OS and Device Type
  • NEW: Statistics available in native XenForo daily stats display
  • Added cron to delete entries older than X days for device type (default=30)
  • Added option to "Preserve last X entries per device type" (default=10)
  • Added option "flood check" to ensure users don't hammer refresh to clear AdBlock status
    • (default=8 seconds, 0 to disable)
  • Added option "Ignore the following routes from tracking"
  • Added option "Display AdBlocking information on /acccount page"
  • Added option "Display AdBlocking device information on /acccount page"
  • Added option "Maximum number of rows of device list to display"
  • Added option "Should a single AdBlock detection reset current non-detects back to zero?"
  • Added option "Do not allow users to masquerade as crawlers to avoid detection" (default=on)
  • Added option to "Cache script lifetime" minutes (default=15)
  • Added Detection\MobileDetect package from composer (Mobile/Tablet/Computer)
  • Added foroco\BrowserDetection package from composer for OS type tracking
  • Added stats Job enqueued post upgrade to back date statistics for past role changes
  • Note: Flood check only applies to "Clear" status because there's no advantage to flooding "AdBlocking"
  • Note: Set flood check to 0 to disable flood check entirely
  • Note: Only swaps statistics are back dated with an enqueue log event
    • All other statistics will need to accumulate moving forward
  • FIX: Prevent conflicts with other onload JS events
  • FIX: Running AdBlock Pro with AdBlock Tracker led to a conflict for guest tracking
  • FIX: Move JavaScript to an IIFE to prevent conflicts
  • FIX: ErrorException: [E_WARNING] Undefined array key "wutime_tracker_debug"
  • FIX: Abide by swap to AdBlocking setting (took 1 extra page view previously)
  • FIX: Abide by swap to Clear setting (also took 1 extra page view previously)

Attachments

  • Screenshot 2024-08-02 at 2.42.58 PM.webp
    Screenshot 2024-08-02 at 2.42.58 PM.webp
    66.3 KB · Views: 39
  • Screenshot 2024-08-02 at 2.43.22 PM.webp
    Screenshot 2024-08-02 at 2.43.22 PM.webp
    63.2 KB · Views: 26
  • Screenshot 2024-08-02 at 2.43.36 PM.webp
    Screenshot 2024-08-02 at 2.43.36 PM.webp
    65.3 KB · Views: 28
  • Screenshot 2024-08-02 at 2.43.50 PM.webp
    Screenshot 2024-08-02 at 2.43.50 PM.webp
    37.7 KB · Views: 22
  • Screenshot 2024-08-02 at 4.55.19 PM.webp
    Screenshot 2024-08-02 at 4.55.19 PM.webp
    37.8 KB · Views: 36
  • Like
Reactions: Stuart Wright
Back
Top Bottom