'100%', 'default_height' => '600px', 'autoembed_url' => true, 'embed_attachment_pages' => true, ) ); } set_transient( 'flipset_activation_redirect', 1, 60 ); } register_activation_hook( FLIPSET_FILE, 'flipset_activate' ); /** * One-time redirect to the dashboard after activation so the welcome * checklist is the first thing a new site owner sees. */ function flipset_maybe_activation_redirect() { if ( ! get_transient( 'flipset_activation_redirect' ) ) { return; } delete_transient( 'flipset_activation_redirect' ); if ( wp_doing_ajax() || wp_doing_cron() || is_network_admin() || isset( $_GET['activate-multi'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- core bulk-activation flag; value is not read. return; } if ( ! current_user_can( 'manage_options' ) ) { return; } wp_safe_redirect( admin_url( 'admin.php?page=flipset-settings' ) ); exit; } add_action( 'admin_init', 'flipset_maybe_activation_redirect' ); /** * Deactivation hook: intentionally left free of destructive cleanup. * Data removal belongs in uninstall.php, gated behind an explicit user * confirmation, never in deactivation. */ function flipset_deactivate() { // Nothing to do yet. } register_deactivation_hook( FLIPSET_FILE, 'flipset_deactivate' ); /** * Boot the plugin once all plugins are loaded, so any add-on extension (if active) * has had a chance to register itself before we check for it. */ function flipset_run() { Flipset::instance()->run(); } add_action( 'plugins_loaded', 'flipset_run', 20 );