self::id(), 'slug' => 'storeruler', 'premium_slug' => 'storeruler-premium', 'type' => 'plugin', 'public_key' => self::key(), 'is_premium' => false, 'premium_suffix' => 'Pro', 'has_addons' => false, 'has_paid_plans' => true, 'is_org_compliant' => true, 'menu' => array( 'slug' => 'storesuit', 'first-path' => 'admin.php?page=storesuit', 'support' => false, 'override_exact' => true, ), 'is_live' => true, ) ); do_action( 'storesuit_fs_loaded', self::$fs ); add_action( 'admin_init', array(self::class, 'turkish_screens') ); // Before Freemius builds its menu entries (its admin_menu step runs last): admin_init comes after the menu. add_action( 'admin_menu', array(self::class, 'turkish_menu'), 0 ); self::$fs->add_filter( 'is_pricing_page_visible', array(self::class, 'pricing_visible') ); add_action( 'admin_head', array(self::class, 'connect_style') ); } /** * Freemius ships no Turkish, so a Turkish store met its key screen half in English (owner, on a live store, 26 Oct 2026). * Its own override hook puts the key screen's and opt-in's words in Turkish; other languages keep Freemius's packs. */ public static function turkish_screens() : void { if ( !self::$fs || !function_exists( 'fs_override_i18n' ) || strpos( determine_locale(), 'tr' ) !== 0 ) { return; } // Some of the key screen's words are looked up under Freemius's shared 'freemius' name; only on StoreRuler's own screen. // phpcs:disable WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput -- Which screen this is: compared with a fixed word; nothing is stored or printed. $names = ( ($_GET['page'] ?? '') === 'storesuit' ? array('storeruler', 'freemius') : array('storeruler') ); // phpcs:enable WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput foreach ( $names as $name ) { fs_override_i18n( array( 'activate-license' => 'Lisansı etkinleştir', 'activate-free-version' => 'Ücretsiz sürümü etkinleştir', 'thanks-for-purchasing' => '%s ürününe hoş geldiniz! Başlamak için lisans anahtarınızı girin:', 'have-license-key' => 'Lisans anahtarınız var mı?', 'cant-find-license-key' => 'Lisans anahtarınızı bulamıyor musunuz?', 'license-issues' => 'Lisans sorunu mu yaşıyorsunuz?', 'greeting' => 'Merhaba %s,', 'yes' => 'Evet', 'no' => 'Hayır', 'send-updates' => 'güvenlik ve özellik güncellemeleri, eğitici içerikler ve teklifler gönderin.', 'do-not-send-updates' => 'güvenlik ve özellik güncellemeleri, eğitici içerikler ve teklifler %sgöndermeyin%s.', 'contact-for-updates' => 'Güvenlik ve özellik güncellemeleri, eğitici içerikler ve ara sıra teklifler için size e-posta gönderelim mi? Devam etmek için birini seçin:', 'license-agreement' => 'Lisans Sözleşmesi', 'privacy-policy' => 'Gizlilik Politikası', 'tos' => 'Hizmet Koşulları', 'opt-in-connect' => 'İzin ver ve devam et', 'pending-activation-message' => '%1$s için onay e-postası %2$s adresine gönderildi. %3$s için e-postadaki butona tıklayın.', 'complete-the-opt-in' => 'Onayı tamamlamak', 'resend-activation-email' => 'Onay e-postasını yeniden gönder', 'connect-header' => 'Önemli bir güncellemeyi kaçırmayın', 'license-sync-disclaimer' => 'Güvenlik ve özellik güncellemeleri ile lisans yönetimi için %s şunlara ihtiyaç duyar:', 'thanks-x' => 'Teşekkürler %s!', ), $name ); } } /** Freemius's menu entries ("Account", "Contact Us", "Pricing") in Turkish too (admin audit B8, 28 Oct 2026, a live store). */ public static function turkish_menu() : void { if ( !self::$fs || !function_exists( 'fs_override_i18n' ) || strpos( determine_locale(), 'tr' ) !== 0 ) { return; } fs_override_i18n( array( 'account' => 'Hesap', 'contact-us' => 'İletişim', 'pricing' => 'Fiyatlar', 'upgrade' => 'Yükselt', 'start-trial' => 'Denemeyi başlat', 'add-ons' => 'Eklentiler', 'support-forum' => 'Destek forumu', ), 'storeruler' ); } /** The plan with nothing above it (Business; ProPage lists every plan's id). */ private const TOP_PLAN = '73444'; /** The top plan has no plan to move up to: no pricing entry there (admin audit B8: "Pricing" showed on a Business license). */ public static function pricing_visible( $visible ) { if ( !$visible || !self::$fs || !self::$fs->is_paying() ) { return $visible; } $plan = self::$fs->get_plan(); return ( is_object( $plan ) && (string) ($plan->id ?? '') === self::TOP_PLAN ? false : $visible ); } /** * Freemius's key screen refuses to activate until the e-mail question is answered, but only marks it faintly, so "Activate * License" seemed to do nothing (owner, 26 Oct 2026). On StoreRuler's own screen the unanswered question stands out. */ public static function connect_style() : void { // phpcs:disable WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput -- Which screen this is: compared with a fixed word; nothing is stored or printed. if ( !self::$fs || ($_GET['page'] ?? '') !== 'storesuit' ) { return; } // phpcs:enable WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput echo ''; } /** The Freemius instance (null while Freemius is off). */ public static function fs() { return self::$fs; } private static $off = null; /** * What storeruler_fs() returns (0.63): the Freemius instance, or a stand-in while Freemius is off (no product ID, as on the * local QA copies, or no SDK) or not booted yet. */ public static function instance() { if ( self::$fs ) { return self::$fs; } return self::$off ?? (self::$off = new FreemiusOff()); } /** * Freemius's plugin_icon filter (the main file adds it): the icon of Freemius's opt-in and Upgrade pages is StoreRuler's * own app icon, shipped in assets/. Without it Freemius would look for an icon of its own, download one (on a local * site) and copy it into the plugin folder. */ public static function icon() : string { return STORESUIT_DIR . 'assets/app-icon-192.png'; } /** * Freemius's show_admin_notice filter (the main file adds it): Freemius's notices show on StoreRuler's own screens only, * the storesuit pages and Freemius's account, contact and pricing pages under the same menu, never across the rest of * WordPress (PLAN-0.63 §6.2, Q9). A notice Freemius already hides stays hidden. */ public static function admin_notice( $show, $msg = array() ) { if ( true !== $show ) { return $show; } // phpcs:disable WordPress.Security.NonceVerification.Recommended -- Only tells whether the admin page being shown is StoreRuler's; nothing is changed. $page = ( isset( $_GET['page'] ) && is_string( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '' ); // phpcs:enable WordPress.Security.NonceVerification.Recommended return $page === 'storesuit' || str_starts_with( $page, 'storesuit-' ); } /** Pro-only methods live under premium-suffixed names; old callers keep their names (paid build only). */ public static function __callStatic( string $name, array $args ) { throw new \BadMethodCallException(esc_html( self::class . '::' . $name )); } } /** * storeruler_fs() while Freemius is off (0.63): the few calls the code makes on the Freemius instance. The free/paid * co-existence call and Freemius's filters do nothing. In StoreRuler Pro the premium code runs, and the main file's * after_uninstall runs on uninstall as with Freemius (Licensing's premium-suffixed off_action). */ final class FreemiusOff { public function set_basename( $is_premium, $caller ) : void { } public function add_action( $tag, $callback = null, $priority = 10, $accepted_args = 1 ) : void { } public function add_filter( ... $args ) : void { } }