id || ! current_user_can( Installer::CAP ) || ! get_transient( self::JUST_ACTIVATED ) ) { return; } delete_transient( self::JUST_ACTIVATED ); // Show it once. ?>

  1. >

*/ private static function steps(): array { $settings_url = admin_url( 'admin.php?page=' . SettingsPage::PAGE ); $adapters = Plugin::instance()->active_adapters(); $steps = array(); if ( ! $adapters ) { $steps[] = array( 'title' => __( 'Install a form plugin', 'action-receipts' ), 'text' => __( 'Action Receipts works with Contact Form 7 and WPForms. Install one of them and create your form.', 'action-receipts' ), 'done' => false, 'url' => admin_url( 'plugin-install.php?s=contact+form&tab=search&type=term' ), 'button' => __( 'Find a form plugin', 'action-receipts' ), ); } $enabled = false; $keys = array(); foreach ( $adapters as $adapter ) { $keys[] = $adapter->key() . ':'; } foreach ( (array) Settings::get()['forms'] as $key => $cfg ) { foreach ( $keys as $prefix ) { if ( ! empty( $cfg['enabled'] ) && 0 === strpos( (string) $key, $prefix ) ) { $enabled = true; } } } $steps[] = array( 'title' => __( 'Choose your forms', 'action-receipts' ), 'text' => __( 'Tick the forms that should give visitors a reference number. You can also choose how the numbers start, for example APP-2026-00001.', 'action-receipts' ), 'done' => $enabled, 'url' => $settings_url, 'button' => __( 'Choose forms', 'action-receipts' ), ); $page_id = (int) Settings::get()['status_page_id']; $page_ok = $page_id && 'publish' === get_post_status( $page_id ); $steps[] = array( 'title' => __( 'Check your status page', 'action-receipts' ), 'text' => $page_ok ? __( 'This is the page where visitors check their submission. We created it for you. You can change its title or add your own text.', 'action-receipts' ) : __( 'Visitors need a page to check their submission. Choose one in the settings.', 'action-receipts' ), 'done' => $page_ok, 'url' => $page_ok ? get_permalink( $page_id ) : $settings_url, 'button' => $page_ok ? __( 'View the page', 'action-receipts' ) : __( 'Choose a page', 'action-receipts' ), 'new_tab' => $page_ok, ); $steps[] = array( 'title' => __( 'Send a test submission', 'action-receipts' ), 'text' => __( 'Fill in your form on your website, just like a visitor would. Use your own email address to receive the confirmation email. Your test will then appear here.', 'action-receipts' ), 'done' => false, ); return $steps; } public function handle_dismiss(): void { if ( ! current_user_can( Installer::CAP ) ) { wp_die( esc_html__( 'You do not have permission to do this.', 'action-receipts' ) ); } check_admin_referer( self::DISMISS_ACTION ); update_user_meta( get_current_user_id(), self::USER_META, 1 ); wp_safe_redirect( admin_url( 'admin.php?page=' . Admin::PAGE ) ); exit; } }