plugin (had inline styling, keeps it) * shortcode/php_snippet -> external (had none, keeps none) * * New installs take the 'plugin' default from Helper::get_defaults(). * * Idempotent: it returns early once the key is present, so it is safe on * every request. * * @return void */ public static function maybe_migrate_settings() { $settings = get_option( 'acknowledgify_settings', array() ); // Nothing configured yet: a fresh install picks up the default. if ( ! is_array( $settings ) || empty( $settings ) ) { return; } if ( array_key_exists( 'footer_style_mode', $settings ) ) { return; } // Normalise before comparing. A pre-existing sanitiser bug could store // 'Auto-insert', which should still be read as the auto-insert mode. $placement = strtolower( str_replace( '-', '_', (string) ( $settings['footer_placement_options'] ?? 'auto_insert' ) ) ); $settings['footer_style_mode'] = ( 'auto_insert' === $placement ) ? 'plugin' : 'external'; update_option( 'acknowledgify_settings', $settings ); } /** * Register Settings. */ public static function register_settings() { // Must be a resolvable callable. This previously passed the bare string // 'acknowledgify_sanitize_settings', which PHP resolves against the // global namespace only -- the function lived in Acknowledgify\Includes, // so the sanitise filter raised a TypeError on save and the option was // never written. register_setting( 'acknowledgify_options_group', 'acknowledgify_settings', array( Settings::class, 'sanitize_settings' ) ); } /** * Enqueue Admin Scripts. */ public static function enqueue_admin_scripts( $hook ) { Settings::enqueue_admin_scripts( $hook ); } /** * Add Rewrite Rules. */ public static function add_rewrite_rules() { Humans_txt::add_write_rules(); } /** * Register Query Vars. */ public static function query_vars( $vars ) { return Humans_txt::query_vars( $vars ); } /** * Output Humans.txt Content. */ public static function output_humans_txt() { Humans_txt::output_humans_txt(); } /** * Add Humans.txt Link in . */ public static function add_humans_txt_link() { Humans_txt::add_humans_txt_link(); } /** * Add Meta Tags in . */ public static function add_meta_tags() { Meta_Tags::add_meta_tags(); } /** * Output Footer Link. */ public static function footer_output() { Footer_Link::footer_output("auto_insert"); } /** * Footer Shortcode. */ public static function footer_link_shortcode() { return Footer_Link::get_markup( 'shortcode' ); } } // Initialize all hooks Hooks::init();