PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / trunk
Forumax – AI Powered Advanced Community Forum Plugin vtrunk
2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 2.0.0 2.1.0 All 29 releases
bbp-core / includes / admin / menu / setup-wizard.php

setup-wizard.php in Forumax – AI Powered Advanced Community Forum Plugin trunk, at includes/admin/menu/setup-wizard.php

373 lines 16.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Forumax Setup Wizard Template
4 *
5 * Single-page multi-step wizard — all steps rendered in HTML,
6 * JavaScript handles transitions with no page reloads.
7 *
8 * @package Forumax
9 * @since 2.2.0
10 */
11
12 defined( 'ABSPATH' ) || exit;
13
14 $steps = [
15 1 => [ 'label' => __( 'Welcome', 'forumax' ) ],
16 2 => [ 'label' => __( 'Forum Setup', 'forumax' ) ],
17 3 => [ 'label' => __( 'Appearance', 'forumax' ) ],
18 4 => [ 'label' => __( 'Ready!', 'forumax' ) ],
19 ];
20 $total_steps = count( $steps );
21
22 /* Retrieve the currently saved brand color (CSF option) for the color picker default. */
23 $csf_options = get_option( 'bbp_core_settings', [] );
24 $brand_color = ! empty( $csf_options['bbpc_brand_color'] ) ? $csf_options['bbpc_brand_color'] : '#6a28ea';
25 ?>
26 <div class="wrap forumax-setup-wrap">
27
28 <?php /* ── Top Bar ── */ ?>
29 <div class="forumax-setup-topbar">
30 <div class="forumax-setup-logo">
31 <img src="<?php echo esc_url( FORUMAX_IMG . 'logo.svg' ); ?>"
32 alt="<?php esc_attr_e( 'Forumax', 'forumax' ); ?>">
33 </div>
34 <a href="<?php echo esc_url( admin_url( 'admin.php?page=forumax' ) ); ?>"
35 class="forumax-btn-skip-top forumax-btn-skip-wizard">
36 <?php esc_html_e( 'Skip Setup', 'forumax' ); ?>
37 </a>
38 </div>
39
40 <?php /* ── Step Indicator ── */ ?>
41 <div class="forumax-setup-steps-bar">
42 <div class="forumax-progress-steps">
43 <?php foreach ( $steps as $step_num => $step_data ) : ?>
44 <div class="forumax-progress-step <?php echo $step_num === 1 ? 'active' : ''; ?>"
45 data-step="<?php echo esc_attr( $step_num ); ?>">
46 <div class="forumax-step-circle">
47 <span class="frmx-step-number"><?php echo esc_html( $step_num ); ?></span>
48 <span class="frmx-step-check dashicons dashicons-yes"></span>
49 </div>
50 <span class="forumax-step-label"><?php echo esc_html( $step_data['label'] ); ?></span>
51 </div>
52 <?php endforeach; ?>
53 </div>
54 </div>
55
56 <?php /* ── Wizard Card ── */ ?>
57 <div class="forumax-setup-card" data-total-steps="<?php echo esc_attr( $total_steps ); ?>">
58
59 <div class="forumax-setup-card-body">
60
61 <?php /* ── Step 1: Welcome ── */ ?>
62 <div class="forumax-setup-step forumax-step-welcome" data-step="1">
63 <span class="forumax-welcome-emoji">🎉</span>
64 <h2 class="forumax-setup-step-title">
65 <?php esc_html_e( 'Welcome to Forumax!', 'forumax' ); ?>
66 </h2>
67 <p class="forumax-setup-step-desc">
68 <?php esc_html_e( 'Thank you for choosing Forumax — the most powerful forum plugin for WordPress. Let\'s get your community set up in just a few steps.', 'forumax' ); ?>
69 </p>
70
71 <div class="forumax-feature-grid">
72 <div class="forumax-feature-item">
73 <div class="forumax-feature-icon">
74 <span class="dashicons dashicons-admin-tools"></span>
75 </div>
76 <h3><?php esc_html_e( 'Easy Setup', 'forumax' ); ?></h3>
77 <p><?php esc_html_e( 'Configure your forum with our intuitive wizard', 'forumax' ); ?></p>
78 </div>
79 <div class="forumax-feature-item">
80 <div class="forumax-feature-icon">
81 <span class="dashicons dashicons-layout"></span>
82 </div>
83 <h3><?php esc_html_e( 'Beautiful Design', 'forumax' ); ?></h3>
84 <p><?php esc_html_e( 'Modern, responsive templates for every device', 'forumax' ); ?></p>
85 </div>
86 <div class="forumax-feature-item">
87 <div class="forumax-feature-icon">
88 <span class="dashicons dashicons-groups"></span>
89 </div>
90 <h3><?php esc_html_e( 'Community', 'forumax' ); ?></h3>
91 <p><?php esc_html_e( 'Advanced features to engage your community', 'forumax' ); ?></p>
92 </div>
93 </div>
94
95 <div class="forumax-info-box">
96 <span class="dashicons dashicons-info"></span>
97 <div>
98 <strong><?php esc_html_e( 'Note:', 'forumax' ); ?></strong>
99 <?php esc_html_e( 'You can skip this setup and configure everything later from the settings page.', 'forumax' ); ?>
100 </div>
101 </div>
102 </div>
103
104 <?php /* ── Step 2: Forum Setup (merged from old Steps 2 + 3) ── */ ?>
105 <div class="forumax-setup-step forumax-step-forum" data-step="2">
106 <h2 class="forumax-setup-step-title">
107 <?php esc_html_e( 'Create Your First Forum', 'forumax' ); ?>
108 </h2>
109 <p class="forumax-setup-step-desc">
110 <?php esc_html_e( 'Let\'s create your first forum to get the community started.', 'forumax' ); ?>
111 </p>
112
113 <div class="forumax-section">
114 <h3 class="forumax-section-heading"><?php esc_html_e( 'Forum Details', 'forumax' ); ?></h3>
115 <p class="forumax-section-subheading"><?php esc_html_e( 'Name and describe your first forum category.', 'forumax' ); ?></p>
116
117 <div class="forumax-setup-form">
118 <div class="forumax-form-group">
119 <label for="create_forum"><?php esc_html_e( 'Forum Title', 'forumax' ); ?></label>
120 <input type="text" id="create_forum" name="create_forum"
121 placeholder="<?php esc_attr_e( 'e.g., General Discussion', 'forumax' ); ?>"
122 value="<?php echo esc_attr( get_option( 'forumax_wizard_create_forum', __( 'General Discussion', 'forumax' ) ) ); ?>">
123 <p class="forumax-field-description"><?php esc_html_e( 'Name of your first forum category', 'forumax' ); ?></p>
124 </div>
125
126 <div class="forumax-form-group">
127 <label for="forum_description"><?php esc_html_e( 'Forum Description', 'forumax' ); ?></label>
128 <textarea id="forum_description" name="forum_description" rows="3"
129 placeholder="<?php esc_attr_e( 'Brief description of your community', 'forumax' ); ?>"><?php echo esc_textarea( get_option( 'forumax_wizard_forum_description', '' ) ); ?></textarea>
130 <p class="forumax-field-description"><?php esc_html_e( 'Help users understand what they can discuss here', 'forumax' ); ?></p>
131 </div>
132 </div>
133 </div>
134
135 <div class="forumax-section">
136 <h3 class="forumax-section-heading"><?php esc_html_e( 'Quick Setup', 'forumax' ); ?></h3>
137 <p class="forumax-section-subheading"><?php esc_html_e( 'Choose how you\'d like to get started.', 'forumax' ); ?></p>
138
139 <div class="forumax-option-cards">
140 <label class="forumax-option-card">
141 <input type="radio" name="setup_type" value="single" <?php checked( get_option( 'forumax_wizard_setup_type', 'single' ), 'single' ); ?>>
142 <div class="forumax-option-content">
143 <span class="dashicons dashicons-admin-post"></span>
144 <h4><?php esc_html_e( 'Single Forum', 'forumax' ); ?></h4>
145 <p><?php esc_html_e( 'Create one forum to start', 'forumax' ); ?></p>
146 </div>
147 </label>
148 <label class="forumax-option-card">
149 <input type="radio" name="setup_type" value="sample" <?php checked( get_option( 'forumax_wizard_setup_type', 'single' ), 'sample' ); ?>>
150 <div class="forumax-option-content">
151 <span class="dashicons dashicons-download"></span>
152 <h4><?php esc_html_e( 'Sample Data', 'forumax' ); ?></h4>
153 <p><?php esc_html_e( 'Import demo content', 'forumax' ); ?></p>
154 </div>
155 </label>
156 <label class="forumax-option-card">
157 <input type="radio" name="setup_type" value="skip" <?php checked( get_option( 'forumax_wizard_setup_type', 'single' ), 'skip' ); ?>>
158 <div class="forumax-option-content">
159 <span class="dashicons dashicons-controls-forward"></span>
160 <h4><?php esc_html_e( 'Skip for Now', 'forumax' ); ?></h4>
161 <p><?php esc_html_e( 'Set up manually later', 'forumax' ); ?></p>
162 </div>
163 </label>
164 </div>
165 </div>
166
167 <div class="forumax-section">
168 <h3 class="forumax-section-heading"><?php esc_html_e( 'Essential Pages', 'forumax' ); ?></h3>
169 <p class="forumax-section-subheading"><?php esc_html_e( 'Forumax needs a few WordPress pages to display your forum.', 'forumax' ); ?></p>
170
171 <div class="forumax-toggle-rows">
172 <label class="forumax-toggle-row">
173 <input type="checkbox" name="create_pages" value="1" <?php checked( get_option( 'forumax_wizard_create_pages', '1' ), '1' ); ?>>
174 <div class="frmx-row-icon"><span class="dashicons dashicons-admin-page"></span></div>
175 <div class="frmx-row-body">
176 <span class="frmx-row-title"><?php esc_html_e( 'Auto-Create Forum Pages', 'forumax' ); ?></span>
177 <span class="frmx-row-desc"><?php esc_html_e( 'Automatically create the required Forum and Topics pages if they don\'t exist yet', 'forumax' ); ?></span>
178 </div>
179 <span class="frmx-toggle-switch"></span>
180 </label>
181 </div>
182 </div>
183 </div>
184
185 <?php /* ── Step 3: Appearance ── */ ?>
186 <div class="forumax-setup-step forumax-step-appearance" data-step="3">
187 <h2 class="forumax-setup-step-title">
188 <?php esc_html_e( 'Customize Appearance', 'forumax' ); ?>
189 </h2>
190 <p class="forumax-setup-step-desc">
191 <?php esc_html_e( 'Choose the perfect look for your forum. You can change these anytime from Settings.', 'forumax' ); ?>
192 </p>
193
194 <div class="forumax-section">
195 <h3 class="forumax-section-heading"><?php esc_html_e( 'Brand Color', 'forumax' ); ?></h3>
196 <p class="forumax-section-subheading"><?php esc_html_e( 'Pick a primary color that matches your brand. This color is used throughout the forum.', 'forumax' ); ?></p>
197
198 <div class="forumax-setup-form">
199 <div class="forumax-form-group forumax-color-field">
200 <label for="brand_color"><?php esc_html_e( 'Primary Color', 'forumax' ); ?></label>
201 <div class="forumax-color-input-wrap">
202 <input type="color" id="brand_color" name="brand_color"
203 value="<?php echo esc_attr( $brand_color ); ?>">
204 <input type="text" id="brand_color_hex" name="brand_color_hex"
205 value="<?php echo esc_attr( $brand_color ); ?>"
206 class="forumax-color-hex-input"
207 maxlength="7"
208 pattern="^#([A-Fa-f0-9]{6})$"
209 placeholder="#6a28ea">
210 </div>
211 <p class="forumax-field-description"><?php esc_html_e( 'Used for buttons, links, and accents across the forum frontend', 'forumax' ); ?></p>
212 </div>
213 </div>
214 </div>
215
216 <div class="forumax-section">
217 <h3 class="forumax-section-heading"><?php esc_html_e( 'Forum Layout Style', 'forumax' ); ?></h3>
218 <p class="forumax-section-subheading"><?php esc_html_e( 'Select how forum topics and discussions are displayed.', 'forumax' ); ?></p>
219
220 <div class="forumax-layout-grid">
221 <label class="forumax-layout-option">
222 <input type="radio" name="layout_style" value="classic" <?php checked( get_option( 'forumax_wizard_layout_style', 'classic' ), 'classic' ); ?>>
223 <div class="forumax-layout-preview">
224 <div class="forumax-layout-preview-img forumax-preview-classic">
225 <span class="dashicons dashicons-menu"></span>
226 </div>
227 <div class="forumax-layout-info">
228 <span class="forumax-layout-title"><?php esc_html_e( 'Classic', 'forumax' ); ?></span>
229 <span class="forumax-layout-desc"><?php esc_html_e( 'Traditional forum layout', 'forumax' ); ?></span>
230 </div>
231 </div>
232 </label>
233 <label class="forumax-layout-option">
234 <input type="radio" name="layout_style" value="modern" <?php checked( get_option( 'forumax_wizard_layout_style', 'classic' ), 'modern' ); ?>>
235 <div class="forumax-layout-preview">
236 <div class="forumax-layout-preview-img forumax-preview-modern">
237 <span class="dashicons dashicons-grid-view"></span>
238 </div>
239 <div class="forumax-layout-info">
240 <span class="forumax-layout-title"><?php esc_html_e( 'Modern', 'forumax' ); ?></span>
241 <span class="forumax-layout-desc"><?php esc_html_e( 'Clean grid layout', 'forumax' ); ?></span>
242 </div>
243 </div>
244 </label>
245 <label class="forumax-layout-option">
246 <input type="radio" name="layout_style" value="card" <?php checked( get_option( 'forumax_wizard_layout_style', 'classic' ), 'card' ); ?>>
247 <div class="forumax-layout-preview">
248 <div class="forumax-layout-preview-img forumax-preview-card">
249 <span class="dashicons dashicons-images-alt2"></span>
250 </div>
251 <div class="forumax-layout-info">
252 <span class="forumax-layout-title"><?php esc_html_e( 'Card Style', 'forumax' ); ?></span>
253 <span class="forumax-layout-desc"><?php esc_html_e( 'Card-based design', 'forumax' ); ?></span>
254 </div>
255 </div>
256 </label>
257 </div>
258 </div>
259
260 <div class="forumax-section">
261 <div class="forumax-advanced-box">
262 <span class="frmx-adv-icon">💡</span>
263 <div class="frmx-adv-body">
264 <span class="frmx-adv-title"><?php esc_html_e( 'Advanced Configuration', 'forumax' ); ?></span>
265 <span class="frmx-adv-desc"><?php esc_html_e( 'More appearance options (colors, fonts, custom CSS) can be configured in the full Settings panel after completing this wizard.', 'forumax' ); ?></span>
266 <a href="<?php echo esc_url( admin_url( 'admin.php?page=forumax-settings' ) ); ?>" class="frmx-adv-link">
267 <?php esc_html_e( 'View Appearance Settings', 'forumax' ); ?>
268 </a>
269 </div>
270 </div>
271 </div>
272 </div>
273
274 <?php /* ── Step 4: Complete ── */ ?>
275 <div class="forumax-setup-step forumax-step-complete" data-step="4">
276 <div class="forumax-success-circle">
277 <span class="dashicons dashicons-yes"></span>
278 </div>
279 <h2 class="forumax-complete-title">
280 <?php esc_html_e( 'Setup Complete!', 'forumax' ); ?>
281 </h2>
282 <p class="forumax-complete-desc">
283 <?php esc_html_e( 'Your forum is ready to go. Here\'s what you can do next:', 'forumax' ); ?>
284 </p>
285
286 <div class="forumax-next-steps">
287 <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=forum' ) ); ?>" class="forumax-next-step-card">
288 <div class="forumax-next-step-icon">
289 <span class="dashicons dashicons-plus-alt"></span>
290 </div>
291 <div class="forumax-next-step-content">
292 <h3><?php esc_html_e( 'Create More Forums', 'forumax' ); ?></h3>
293 <p><?php esc_html_e( 'Add more forum categories to your community', 'forumax' ); ?></p>
294 </div>
295 <span class="dashicons dashicons-arrow-right-alt2"></span>
296 </a>
297
298 <a href="<?php echo esc_url( admin_url( 'admin.php?page=forumax-settings' ) ); ?>" class="forumax-next-step-card">
299 <div class="forumax-next-step-icon">
300 <span class="dashicons dashicons-admin-settings"></span>
301 </div>
302 <div class="forumax-next-step-content">
303 <h3><?php esc_html_e( 'Configure Settings', 'forumax' ); ?></h3>
304 <p><?php esc_html_e( 'Fine-tune your forum settings and appearance', 'forumax' ); ?></p>
305 </div>
306 <span class="dashicons dashicons-arrow-right-alt2"></span>
307 </a>
308
309 <a href="<?php echo esc_url( admin_url( 'admin.php?page=forumax' ) ); ?>" class="forumax-next-step-card">
310 <div class="forumax-next-step-icon">
311 <span class="dashicons dashicons-dashboard"></span>
312 </div>
313 <div class="forumax-next-step-content">
314 <h3><?php esc_html_e( 'Go to Dashboard', 'forumax' ); ?></h3>
315 <p><?php esc_html_e( 'View your forum stats and activity', 'forumax' ); ?></p>
316 </div>
317 <span class="dashicons dashicons-arrow-right-alt2"></span>
318 </a>
319
320 <a href="https://helpdesk.spider-themes.net/docs/forumax-wordpress-plugin/" target="_blank" rel="noopener noreferrer" class="forumax-next-step-card">
321 <div class="forumax-next-step-icon">
322 <span class="dashicons dashicons-book"></span>
323 </div>
324 <div class="forumax-next-step-content">
325 <h3><?php esc_html_e( 'Read Documentation', 'forumax' ); ?></h3>
326 <p><?php esc_html_e( 'Learn about all available features', 'forumax' ); ?></p>
327 </div>
328 <span class="dashicons dashicons-external"></span>
329 </a>
330 </div>
331 </div>
332
333 </div><!-- .forumax-setup-card-body -->
334
335 <?php /* ── Card Footer / Navigation ── */ ?>
336 <div class="forumax-setup-card-footer">
337 <button type="button" class="forumax-btn forumax-btn-secondary forumax-btn-prev">
338 <span class="dashicons dashicons-arrow-left-alt2"></span>
339 <?php esc_html_e( 'Back', 'forumax' ); ?>
340 </button>
341
342 <button type="button" class="forumax-btn forumax-btn-primary forumax-btn-next">
343 <?php esc_html_e( 'Continue', 'forumax' ); ?>
344 <span class="dashicons dashicons-arrow-right-alt2"></span>
345 </button>
346
347 <a href="<?php echo esc_url( admin_url( 'admin.php?page=forumax' ) ); ?>"
348 class="forumax-btn forumax-btn-primary forumax-btn-finish">
349 <?php esc_html_e( 'Go to Dashboard', 'forumax' ); ?>
350 <span class="dashicons dashicons-arrow-right-alt2"></span>
351 </a>
352 </div>
353
354 </div><!-- .forumax-setup-card -->
355
356 <?php if ( ! forumax_is_premium() ) : ?>
357 <div class="forumax-upgrade-banner">
358 <div class="forumax-upgrade-content">
359 <span class="dashicons dashicons-star-filled"></span>
360 <div>
361 <h3><?php esc_html_e( 'Unlock Premium Features', 'forumax' ); ?></h3>
362 <p><?php esc_html_e( 'Get private replies, voting system, advanced attachments, and more!', 'forumax' ); ?></p>
363 </div>
364 </div>
365 <a href="<?php echo esc_url( bc_fs()->get_upgrade_url() ); ?>" class="forumax-btn-upgrade">
366 <?php esc_html_e( 'Upgrade to Pro', 'forumax' ); ?>
367 <span class="dashicons dashicons-arrow-right-alt"></span>
368 </a>
369 </div>
370 <?php endif; ?>
371
372 </div><!-- .forumax-setup-wrap -->
373