Plugin Directory

Changeset 3450927


Ignore:
Timestamp:
01/31/2026 10:16:00 AM (2 months ago)
Author:
supportfromrichard
Message:

Version 1.3.3 - Contact Us menu, trial redirect for non-registered users, init hook for Freemius filters

Location:
sfr-book-review-showcase/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sfr-book-review-showcase/trunk/readme.txt

    r3450905 r3450927  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.3.1
     7Stable tag: 1.3.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    122122== Changelog ==
    123123
     124= 1.3.3 =
     125* Enhancement: Contact Us submenu always visible (Freemius contact form) – added contact => true and is_submenu_visible for contact.
     126* Fix: Trial/upgrade links for non-registered users now go to Connect page instead of blank pricing page (pricing_url filter).
     127* Fix: Freemius filters (pricing, contact visibility, trial redirect) now applied on init so they run every load regardless of load order.
     128* Note: Users must connect or skip to see Pricing/Contact; trial links send non-registered users to connect first so trial can complete and email is sent.
     129
     130= 1.3.2 =
     131* Fix: Ensured Freemius menu and trial behaviour apply reliably (init hook for filter registration).
     132
    124133= 1.3.1 =
    125134* Enhancement: Freemius trial methodology aligned with SFR Directory Analytics – SDK-only trial (no hardcoded trial URLs)
     
    386395== Upgrade Notice ==
    387396
     397= 1.3.3 =
     398Contact Us menu restored; trial links no longer show blank page for non-registered users (redirect to Connect). Safe to update - no action required.
     399
     400= 1.3.2 =
     401Freemius filters applied on init for reliable menu and trial behaviour. Safe to update - no action required.
     402
    388403= 1.3.1 =
    389404Freemius trial flow aligned with SDK: trial CTAs and Free Trial link only when trial is available. Account page enabled for Pro download after trial. Safe to update - no action required.
  • sfr-book-review-showcase/trunk/sfr-book-review-showcase.php

    r3450905 r3450927  
    44 * Plugin URI:        https://supportfromrichard.co.uk/plugins/sfr-book-review-showcase
    55 * Description:       Showcase book reviews from Amazon on your WordPress site with customisable layouts, easy imports, and built-in analytics.
    6  * Version:           1.3.1
     6 * Version:           1.3.3
    77 * Author:            Support From Richard
    88 * Author URI:        https://supportfromrichard.co.uk
     
    1818
    1919if ( ! defined( 'SFRBRS_VERSION' ) ) {
    20     define( 'SFRBRS_VERSION', '1.3.1' );
     20    define( 'SFRBRS_VERSION', '1.3.3' );
    2121}
    2222
     
    7070                        'account'    => true,
    7171                        'support'    => false,
     72                        'contact'    => true,
    7273                        'pricing'    => true,
    7374                    ),
     
    118119                $fs->add_filter( 'is_pricing_page_visible', '__return_true' );
    119120                $fs->add_filter( 'is_submenu_visible', function( $visible, $menu_id ) {
    120                     if ( 'pricing' === $menu_id ) {
     121                    if ( in_array( $menu_id, array( 'pricing', 'contact' ), true ) ) {
    121122                        return true;
    122123                    }
     
    125126                // Ensure has_paid_plan returns true
    126127                $fs->add_filter( 'has_paid_plans', '__return_true' );
    127                
     128
     129                // When user is not registered (never connected or skipped), trial/pricing can show blank or fail to start trial.
     130                // Send trial/upgrade links to connect first so they register; then they can start trial from Pricing and get email.
     131                $fs->add_filter( 'pricing_url', function( $url ) use ( $fs ) {
     132                    if ( ! $fs->is_registered() && method_exists( $fs, 'get_connect_url' ) ) {
     133                        return $fs->get_connect_url();
     134                    }
     135                    return $url;
     136                }, 10, 1 );
     137
    128138                // Customize deactivation feedback reasons - add "Upgraded to Pro plugin" option
    129139                $fs->add_filter( 'uninstall_reasons', function( $reasons ) {
     
    153163}
    154164
     165/**
     166 * Apply Freemius menu/visibility and trial URL filters.
     167 * Runs on init so filters are always applied when the free plugin is loaded (not only on first-definition path).
     168 */
     169function sfrbrs_apply_freemius_filters() {
     170    if ( ! function_exists( 'sfrbrs_fs' ) ) {
     171        return;
     172    }
     173    $fs = sfrbrs_fs();
     174    if ( ! $fs || ! is_object( $fs ) ) {
     175        return;
     176    }
     177    // Only apply for the free plugin instance (check slug).
     178    if ( method_exists( $fs, 'get_slug' ) && $fs->get_slug() !== 'sfr-book-review-showcase' ) {
     179        return;
     180    }
     181
     182    $plugin_admin_url = admin_url( 'admin.php?page=sfrbrs-settings' );
     183    $fs->add_filter( 'is_pricing_page_visible', '__return_true' );
     184    $fs->add_filter( 'has_paid_plans', '__return_true' );
     185    $fs->add_filter( 'is_submenu_visible', function( $visible, $menu_id ) {
     186        if ( in_array( $menu_id, array( 'pricing', 'contact' ), true ) ) {
     187            return true;
     188        }
     189        return $visible;
     190    }, 10, 2 );
     191    $fs->add_filter( 'pricing_url', function( $url ) use ( $fs ) {
     192        if ( ! $fs->is_registered() && method_exists( $fs, 'get_connect_url' ) ) {
     193            return $fs->get_connect_url();
     194        }
     195        return $url;
     196    }, 10, 1 );
     197}
     198
     199add_action( 'init', 'sfrbrs_apply_freemius_filters', 1 );
     200
    155201require_once SFRBRS_PLUGIN_DIR . 'includes/class-sfrbrs-loader.php';
    156202require_once SFRBRS_PLUGIN_DIR . 'includes/class-sfrbrs-activator.php';
Note: See TracChangeset for help on using the changeset viewer.