Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassifAI NUX #411

Merged
merged 54 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
32c5961
Added plugin activation notice for start setup
iamdharmesh Mar 14, 2023
792b85d
Added initial classifai header.
iamdharmesh Mar 15, 2023
8c5c4a6
Added onboarding page and setup steps.
iamdharmesh Mar 24, 2023
8ed2bbf
Merge branch 'develop' of github.com:10up/classifai into enhancement/30
iamdharmesh Mar 24, 2023
f478e7a
Added onboarding step 1.
iamdharmesh Mar 27, 2023
0c1720d
Added Recommended content in enable features step.
iamdharmesh Mar 27, 2023
413c16f
fixed VIPCS
iamdharmesh Mar 27, 2023
9c94dcd
Added register classifAI step.
iamdharmesh Mar 28, 2023
884d702
Updated step value of hidden input.
iamdharmesh Mar 28, 2023
efc4af4
Added onboarding step 3.
iamdharmesh Mar 28, 2023
202df8b
Updated admin js for support onboarding form.
iamdharmesh Mar 28, 2023
8fb1ab7
Added handling for other providers in step 3.
iamdharmesh Mar 29, 2023
6051866
Update link to classifiAI setup in activation notice.
iamdharmesh Mar 29, 2023
7af936f
Keep settings selected for enabled features.
iamdharmesh Mar 29, 2023
8f51ddd
Added final onboarding step.
iamdharmesh Mar 29, 2023
2f5a8de
Wording updates.
iamdharmesh Mar 29, 2023
6cad9aa
Handled skip setup.
iamdharmesh Mar 29, 2023
0e05fd3
Prevent users to accessing wizard steps directly.
iamdharmesh Mar 29, 2023
686fc53
CSS improvements.
iamdharmesh Mar 30, 2023
e096077
Update feature option save logic.
iamdharmesh Mar 30, 2023
2fe286b
Don't display activation notice if onboarding is already completed.
iamdharmesh Mar 30, 2023
e92ec26
Fixed js formatting.
iamdharmesh Mar 30, 2023
7500b1c
Added header control links.
iamdharmesh Mar 30, 2023
ac50c8f
Update existing setting screens.
iamdharmesh Mar 30, 2023
5fc06f4
Updated checkbox toggle UI
iamdharmesh Mar 31, 2023
6476d8a
Updated completed step UI
iamdharmesh Mar 31, 2023
d09e6b6
Code improvements.
iamdharmesh Mar 31, 2023
4c40ac5
Utilize `render_classifai_setup_settings` in step 2 rendering
iamdharmesh Mar 31, 2023
90da9d2
Rename $page variable to $classifai_page
iamdharmesh Mar 31, 2023
e865b38
Removed unwanted js file.
iamdharmesh Mar 31, 2023
a0b276d
Eslint fixes.
iamdharmesh Mar 31, 2023
d7a3382
Added default features to be enabled.
iamdharmesh Mar 31, 2023
9914c24
Fixed PHP notice.
iamdharmesh Mar 31, 2023
ac016d9
PR feedback updates.
iamdharmesh Apr 3, 2023
2bee81a
Migrate features options to provider class.
iamdharmesh Apr 3, 2023
dae1aa5
Handle step submission with common function.
iamdharmesh Apr 3, 2023
2a9fffe
Get default feaure from default settings.
iamdharmesh Apr 3, 2023
5cd1086
Added onboarding header and footer templates.
iamdharmesh Apr 3, 2023
b540770
Merge branch 'develop' of github.com:10up/classifai into enhancement/30
iamdharmesh Apr 5, 2023
575314f
Made services menu dynamic.
iamdharmesh Apr 5, 2023
dd3a50a
Fix configured features screen.
iamdharmesh Apr 5, 2023
91950bf
Added onboarding support for DALL·E
iamdharmesh Apr 5, 2023
91e9fc6
Fix DALL-E features key.
iamdharmesh Apr 5, 2023
228f79a
PR feedback improvements.
iamdharmesh Apr 6, 2023
3796a96
Move classifai menu under Tools.
iamdharmesh Apr 10, 2023
c79451c
Update tests.
iamdharmesh Apr 10, 2023
52e6d97
Added plugin action links.
iamdharmesh Apr 10, 2023
991185b
Skip registration step if it is already configured.
iamdharmesh Apr 11, 2023
27bc46b
Always show setup link.
iamdharmesh Apr 11, 2023
6b29606
- Enable all features for new user, show X before not configured feat…
iamdharmesh Apr 14, 2023
ecd47e5
Add disable unchecked feature functionality.
iamdharmesh Apr 14, 2023
1bf4e1e
Prevent showing the default WordPress "Plugin Activated" notice.
iamdharmesh Apr 14, 2023
e60a40c
Added images to welcome and summary step.
iamdharmesh Apr 28, 2023
bf50c93
Merge branch 'develop' of github.com:10up/classifai into enhancement/30
iamdharmesh Apr 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/img/classifai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/onboarding-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/onboarding-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions classifai.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function classifai_define( $name, $value ) {
}

require_once __DIR__ . '/config.php';
classifai_define( 'CLASSIFAI_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
dkotter marked this conversation as resolved.
Show resolved Hide resolved

/**
* Loads the CLASSIFAI PHP autoloader if possible.
Expand Down
32 changes: 26 additions & 6 deletions includes/Classifai/Admin/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ public function can_register() {
*/
public function register() {
add_action( 'classifai_activation_hook', [ $this, 'add_activation_notice' ] );
add_action( 'admin_notices', [ $this, 'maybe_render_notices' ] );
add_action( 'admin_notices', [ $this, 'maybe_render_notices' ], 0 );
}

/**
* Respond to the activation hook.
*/
public function maybe_render_notices() {
$registration_settings = get_option( 'classifai_settings' );
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';

if (
'classifai_settings' === get_current_screen()->parent_base &&
'classifai' === $page &&
( ! isset( $registration_settings['valid_license'] ) || ! $registration_settings['valid_license'] )
) {
$notice_url = 'https://classifaiplugin.com/#cta';
Expand All @@ -48,10 +50,28 @@ public function maybe_render_notices() {

$needs_setup = get_transient( 'classifai_activation_notice' );
if ( $needs_setup ) {
printf(
'<div class="notice notice-warning"><p><a href="%s">' . esc_html__( 'ClassifAI requires setup', 'classifai' ) . '</a></p></div>',
esc_url( admin_url( 'admin.php?page=classifai_settings' ) )
);
if ( Onboarding::is_onboarding_completed() ) {
delete_transient( 'classifai_activation_notice' );
return;
}

// Prevent showing the default WordPress "Plugin Activated" notice.
unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification
?>
<div data-notice="plugin-activation" class="notice notice-success is-dismissible">
<div id="classifai-activation-notice">
<div class="classifai-logo">
<img src="<?php echo esc_url( CLASSIFAI_PLUGIN_URL . 'assets/img/classifai.png' ); ?>" alt="<?php esc_attr_e( 'ClassifAI', 'classifai' ); ?>" />
</div>
<h3 class="classifai-activation-message">
<?php esc_html_e( 'Congratulations, the ClassifAI plugin is now activated.', 'classifai' ); ?>
</h3>
<a class="classifai-button" href="<?php echo esc_url( admin_url( 'admin.php?page=classifai_setup' ) ); ?>">
<?php esc_html_e( 'Start setup', 'classifai' ); ?>
</a>
</div>
</div>
<?php
delete_transient( 'classifai_activation_notice' );
}
}
Expand Down
Loading