set_basename( false, __FILE__ ); return; } // The plugin under its name before 1.0.0 may still be active: its copy of the same classes is loaded first. This copy then // only refuses to be activated and says so on the Plugins screen (OldPlugin); the store's records stay as they are. if ( defined( 'STORESUIT_VERSION' ) ) { require_once __DIR__ . '/src/OldPlugin.php'; \StoreSuit\OldPlugin::stop( __FILE__ ); return; } define( 'STORESUIT_FILE', __FILE__ ); define( 'STORESUIT_DIR', __DIR__ . '/' ); define( 'STORESUIT_VERSION', '1.2.350' ); require_once __DIR__ . '/src/Licensing.php'; // The Freemius instance, or Licensing's stand-in while Freemius is off. Declared inside the if, so it is not hoisted. if ( !function_exists( 'storeruler_fs' ) ) { function storeruler_fs() { return \StoreSuit\Licensing::instance(); } } require_once __DIR__ . '/src/Suite.php'; register_activation_hook( __FILE__, array('\\StoreSuit\\Suite', 'activate') ); register_deactivation_hook( __FILE__, array('\\StoreSuit\\Suite', 'deactivate') ); // Before plugins_loaded, as Freemius asks; after the activation hooks, so StoreRuler's own run first as before. \StoreSuit\Licensing::boot(); storeruler_fs()->add_action( 'after_uninstall', array('\\StoreSuit\\Suite', 'uninstall_email') ); storeruler_fs()->add_action( 'after_uninstall', array('\\StoreSuit\\Suite', 'uninstall_ai') ); // The OpenAI key of the free AI text (ProductAi), in both builds. storeruler_fs()->add_action( 'after_uninstall', array('\\StoreSuit\\Suite', 'uninstall_privacy') ); // Price alerts and review photos, in both builds (StorefrontPrivacy). // Deactivation feedback is anonymous unless the person chooses otherwise (privacy policy), Freemius's notices show on // StoreRuler's own screens only (PLAN-0.63 §6.2, Q9), and its pages use StoreRuler's own icon (nothing downloaded or copied). // No trial promotion of its own (WordPress.org guideline 11): Freemius would add a notice and a counter on StoreRuler's menu // item, seen on every admin screen; the trial stays on the Upgrade page. storeruler_fs()->add_filter( 'default_to_anonymous_feedback', '__return_true' ); storeruler_fs()->add_filter( 'show_admin_notice', array('\\StoreSuit\\Licensing', 'admin_notice'), 10, 2 ); storeruler_fs()->add_filter( 'plugin_icon', array('\\StoreSuit\\Licensing', 'icon') ); storeruler_fs()->add_filter( 'show_trial', '__return_false' ); // Activated across a multisite network, the network admin stays on the network's Plugins screen: StoreRuler's own pages // belong to each store site, and each site is set up on its own first request (Suite::boot()). storeruler_fs()->add_filter( 'redirect_on_activation', static function ( $redirect ) { return $redirect && !is_network_admin(); } ); \StoreSuit\Suite::load();