151 lines
6.1 KiB
PHP
151 lines
6.1 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Coaching Admin Setup Guide
|
|
* Description: Adds a visible WordPress admin onboarding guide for booking and payments.
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
class Coaching_Admin_Setup_Guide {
|
|
const PAGE_SLUG = 'coaching-admin-setup-guide';
|
|
|
|
public function __construct() {
|
|
add_action( 'admin_menu', array( $this, 'register_admin_page' ) );
|
|
add_action( 'wp_dashboard_setup', array( $this, 'register_dashboard_widget' ) );
|
|
}
|
|
|
|
public function register_admin_page() {
|
|
add_dashboard_page(
|
|
__( 'Coaching Setup Guide', 'coaching-admin-setup-guide' ),
|
|
__( 'Coaching Setup Guide', 'coaching-admin-setup-guide' ),
|
|
'manage_options',
|
|
self::PAGE_SLUG,
|
|
array( $this, 'render_admin_page' )
|
|
);
|
|
}
|
|
|
|
public function register_dashboard_widget() {
|
|
wp_add_dashboard_widget(
|
|
'coaching_admin_setup_guide',
|
|
__( 'Coaching Template Setup Guide', 'coaching-admin-setup-guide' ),
|
|
array( $this, 'render_dashboard_widget' )
|
|
);
|
|
}
|
|
|
|
public function render_dashboard_widget() {
|
|
$this->render_intro();
|
|
$this->render_booking_section();
|
|
$this->render_payments_section();
|
|
$this->render_next_steps_section();
|
|
echo '<p><a class="button button-primary" href="' . esc_url( $this->setup_guide_url() ) . '">Open full setup guide</a></p>';
|
|
$this->render_styles();
|
|
}
|
|
|
|
public function render_admin_page() {
|
|
echo '<div class="wrap">';
|
|
echo '<h1>Coaching Template Setup Guide</h1>';
|
|
echo '<p>Use this page to finish the built-in booking and payment setup after the project has been generated.</p>';
|
|
$this->render_intro();
|
|
$this->render_booking_section();
|
|
$this->render_payments_section();
|
|
$this->render_next_steps_section();
|
|
$this->render_styles();
|
|
echo '</div>';
|
|
}
|
|
|
|
private function render_intro() {
|
|
echo '<div class="coaching-setup-guide__panel">';
|
|
echo '<p><strong>This template already includes the booking and payments plugins.</strong> You usually do not need to install anything else. Finish the remaining business-specific setup here and then test the full lead-to-booking-to-payment flow.</p>';
|
|
echo '</div>';
|
|
}
|
|
|
|
private function render_booking_section() {
|
|
echo '<div class="coaching-setup-guide__panel">';
|
|
echo '<h2>Simply Schedule Appointments</h2>';
|
|
echo '<p>Use the Appointments menu to review the booking flow, appointment types, and general scheduling behavior.</p>';
|
|
echo '<ul>';
|
|
echo '<li><a href="' . esc_url( $this->ssa_main_url() ) . '">Open Appointments dashboard</a></li>';
|
|
echo '<li><a href="' . esc_url( $this->ssa_types_url() ) . '">Open Appointment Types</a></li>';
|
|
echo '<li><a href="' . esc_url( $this->ssa_settings_url() ) . '">Open Settings</a></li>';
|
|
echo '</ul>';
|
|
echo '<ol>';
|
|
echo '<li>Review the main appointment type title, duration, and confirmation behavior.</li>';
|
|
echo '<li>Check availability windows, timezone, and any blackout dates that should apply to the coach.</li>';
|
|
echo '<li>Confirm the booking form asks for the right lead details for your coaching workflow.</li>';
|
|
echo '<li>Make one test booking and verify the confirmation screen and admin-side appointment record.</li>';
|
|
echo '</ol>';
|
|
echo '</div>';
|
|
}
|
|
|
|
private function render_payments_section() {
|
|
echo '<div class="coaching-setup-guide__panel">';
|
|
echo '<h2>Accept Stripe Payments</h2>';
|
|
echo '<p>Use the Stripe Payments admin screens to connect the site to the correct Stripe account and verify product/payment configuration.</p>';
|
|
echo '<ul>';
|
|
echo '<li><a href="' . esc_url( $this->stripe_products_url() ) . '">Open Stripe Products</a></li>';
|
|
echo '<li><a href="' . esc_url( $this->stripe_settings_url() ) . '">Open Stripe Settings</a></li>';
|
|
echo '<li><a href="' . esc_url( $this->stripe_email_settings_url() ) . '">Open Stripe Email Settings</a></li>';
|
|
echo '</ul>';
|
|
echo '<ol>';
|
|
echo '<li>Go to <strong>Stripe Settings</strong> and paste the correct <strong>Publishable Key</strong> and <strong>Secret Key</strong> from your Stripe dashboard.</li>';
|
|
echo '<li>Verify the site is using the right Stripe mode for launch.</li>';
|
|
echo '<li>Review the payment products/buttons already included in the template and update names, prices, and success copy as needed.</li>';
|
|
echo '<li>Run one real or test payment end-to-end and confirm the order appears in WordPress admin.</li>';
|
|
echo '</ol>';
|
|
echo '</div>';
|
|
}
|
|
|
|
private function render_next_steps_section() {
|
|
echo '<div class="coaching-setup-guide__panel">';
|
|
echo '<h2>Final Manual Checklist</h2>';
|
|
echo '<ul>';
|
|
echo '<li>Replace any demo coach name, offer text, and testimonials with the real business content.</li>';
|
|
echo '<li>Check all CTA buttons and forms on the public site.</li>';
|
|
echo '<li>Verify the booking and payment flows on both desktop and mobile.</li>';
|
|
echo '<li>Only go live after both booking and payment test flows succeed.</li>';
|
|
echo '</ul>';
|
|
echo '</div>';
|
|
}
|
|
|
|
private function render_styles() {
|
|
echo '<style>';
|
|
echo '.coaching-setup-guide__panel{background:#fff;border:1px solid #dcdcde;border-radius:8px;padding:16px 18px;margin:0 0 16px;}';
|
|
echo '.coaching-setup-guide__panel h2{margin-top:0;margin-bottom:8px;}';
|
|
echo '.coaching-setup-guide__panel ul,.coaching-setup-guide__panel ol{margin-left:18px;}';
|
|
echo '.coaching-setup-guide__panel li{margin-bottom:6px;}';
|
|
echo '</style>';
|
|
}
|
|
|
|
private function setup_guide_url() {
|
|
return admin_url( 'index.php?page=' . self::PAGE_SLUG );
|
|
}
|
|
|
|
private function ssa_main_url() {
|
|
return admin_url( 'admin.php?page=simply-schedule-appointments' );
|
|
}
|
|
|
|
private function ssa_types_url() {
|
|
return admin_url( 'admin.php?page=simply-schedule-appointments-types' );
|
|
}
|
|
|
|
private function ssa_settings_url() {
|
|
return admin_url( 'admin.php?page=simply-schedule-appointments-settings' );
|
|
}
|
|
|
|
private function stripe_products_url() {
|
|
return admin_url( 'edit.php?post_type=asp-products' );
|
|
}
|
|
|
|
private function stripe_settings_url() {
|
|
return admin_url( 'edit.php?post_type=asp-products&page=stripe-payments-settings#general' );
|
|
}
|
|
|
|
private function stripe_email_settings_url() {
|
|
return admin_url( 'edit.php?post_type=asp-products&page=stripe-payments-settings#email' );
|
|
}
|
|
}
|
|
|
|
new Coaching_Admin_Setup_Guide();
|