Skip to content

Commit f6f750a

Browse files
committed
Update RTL styles and improve alert color schemes
- Added color to the section count in RTL styles. - Enhanced focus styles for search input fields. - Updated color and background for various alert types to improve visibility and consistency. - Adjusted border colors for alert components to align with new design standards. - Minified CSS files to reflect the changes made in the main styles.
1 parent 8252583 commit f6f750a

File tree

10 files changed

+173
-84
lines changed

10 files changed

+173
-84
lines changed

includes/admin/class-admin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use WebberZone\Knowledge_Base\Util\Cache;
1313
use WebberZone\Knowledge_Base\Util\Hook_Registry;
14-
use WebberZone\Knowledge_Base\Admin\Setup_Wizard;
1514

1615
// If this file is called directly, abort.
1716
if ( ! defined( 'WPINC' ) ) {

includes/admin/class-settings.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ public static function settings_pro() {
750750
'type' => 'text',
751751
'default' => __( 'Help', 'knowledgebase' ),
752752
'field_class' => 'regular-text',
753+
'pro' => true,
753754
),
754755
'beacon_color' => array(
755756
'id' => 'beacon_color',
@@ -821,6 +822,7 @@ public static function settings_pro() {
821822
'type' => 'text',
822823
'default' => __( 'Hi! How can we help you?', 'knowledgebase' ),
823824
'field_class' => 'large-text',
825+
'pro' => true,
824826
),
825827
'beacon_search_placeholder' => array(
826828
'id' => 'beacon_search_placeholder',
@@ -829,6 +831,7 @@ public static function settings_pro() {
829831
'type' => 'text',
830832
'default' => __( 'Search for answers...', 'knowledgebase' ),
831833
'field_class' => 'large-text',
834+
'pro' => true,
832835
),
833836
'beacon_contact_enabled' => array(
834837
'id' => 'beacon_contact_enabled',

includes/admin/class-setup-wizard.php

Lines changed: 78 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Setup_Wizard {
2626
* Wizard steps.
2727
*
2828
* @since 3.0.0
29-
29+
*
3030
* @var array
3131
*/
3232
private $steps = array();
@@ -35,17 +35,29 @@ class Setup_Wizard {
3535
* Current step.
3636
*
3737
* @since 3.0.0
38-
38+
*
3939
* @var string
4040
*/
4141
private $current_step = '';
4242

43+
/**
44+
* Whether Pro is active.
45+
*
46+
* @since 3.0.0
47+
*
48+
* @var bool
49+
*/
50+
private bool $is_pro_active = false;
51+
4352
/**
4453
* Constructor.
4554
*
4655
* @since 3.0.0
4756
*/
4857
public function __construct() {
58+
$main = \WebberZone\Knowledge_Base\wzkb();
59+
$this->is_pro_active = ! empty( $main->pro );
60+
4961
Hook_Registry::add_action( 'admin_menu', array( $this, 'admin_menus' ), PHP_INT_MAX );
5062
Hook_Registry::add_action( 'admin_init', array( $this, 'setup_wizard' ), PHP_INT_MAX );
5163
Hook_Registry::add_action( 'admin_init', array( $this, 'redirect_on_activation' ) );
@@ -374,7 +386,7 @@ public function structure_step() {
374386
);
375387
?>
376388
</p>
377-
<?php if ( class_exists( 'WebberZone\\Knowledge_Base\\Pro\\Pro' ) ) : ?>
389+
<?php if ( $this->is_pro_active ) : ?>
378390
<p class="wzkb-setup-pro-enabled">
379391
<span class="dashicons dashicons-yes-alt"></span>
380392
<span>
@@ -685,7 +697,7 @@ public function pro_features_step() {
685697
$rating_system = $settings['rating_system'] ?? 'disabled';
686698
$tracking_method = $settings['rating_tracking_method'] ?? 'cookie';
687699
$show_rating_stats = $settings['show_rating_stats'] ?? 1;
688-
$is_pro = class_exists( 'WebberZone\\Knowledge_Base\\Pro\\Pro' );
700+
$is_pro = $this->is_pro_active;
689701

690702
// Beacon settings for Pro.
691703
$beacon_enabled = $settings['beacon_enabled'] ?? 0;
@@ -785,69 +797,110 @@ public function pro_features_step() {
785797
</tr>
786798
</table>
787799

788-
<?php if ( $is_pro ) : ?>
789800
<h2><?php esc_html_e( 'Beacon Help Widget', 'knowledgebase' ); ?></h2>
790801
<table class="form-table">
791802
<tr>
792-
<th scope="row"><label for="beacon_enabled"><?php esc_html_e( 'Enable Beacon', 'knowledgebase' ); ?></label></th>
803+
<th scope="row">
804+
<label for="beacon_enabled">
805+
<?php esc_html_e( 'Enable Beacon', 'knowledgebase' ); ?>
806+
<?php if ( ! $is_pro ) : ?>
807+
<span class="wzkb-pro-badge"><?php esc_html_e( 'PRO', 'knowledgebase' ); ?></span>
808+
<?php endif; ?>
809+
</label>
810+
</th>
793811
<td>
794812
<input type="hidden" name="beacon_enabled" value="0" />
795-
<input type="checkbox" id="beacon_enabled" name="beacon_enabled" value="1" <?php checked( $beacon_enabled, 1 ); ?> />
813+
<input type="checkbox" id="beacon_enabled" name="beacon_enabled" value="1" <?php checked( $beacon_enabled, 1 ); ?> <?php disabled( ! $is_pro ); ?> />
796814
<p class="description"><?php esc_html_e( 'Display the floating help widget with search, suggested articles, and contact form.', 'knowledgebase' ); ?></p>
815+
<?php if ( ! $is_pro ) : ?>
816+
<p class="description wzkb-pro-feature-desc">
817+
<?php esc_html_e( '✨ Engage visitors with a modern floating help widget featuring instant search, context-aware article suggestions, and an integrated contact form—all beautifully designed and mobile-responsive.', 'knowledgebase' ); ?>
818+
</p>
819+
<?php endif; ?>
797820
</td>
798821
</tr>
799822
<tr>
800-
<th scope="row"><label for="beacon_display_location"><?php esc_html_e( 'Display Location', 'knowledgebase' ); ?></label></th>
823+
<th scope="row">
824+
<label for="beacon_display_location">
825+
<?php esc_html_e( 'Display Location', 'knowledgebase' ); ?>
826+
<?php if ( ! $is_pro ) : ?>
827+
<span class="wzkb-pro-badge"><?php esc_html_e( 'PRO', 'knowledgebase' ); ?></span>
828+
<?php endif; ?>
829+
</label>
830+
</th>
801831
<td>
802-
<select id="beacon_display_location" name="beacon_display_location">
832+
<select id="beacon_display_location" name="beacon_display_location" <?php disabled( ! $is_pro ); ?>>
803833
<option value="kb_only" <?php selected( $beacon_display_location, 'kb_only' ); ?>><?php esc_html_e( 'Knowledge Base Only', 'knowledgebase' ); ?></option>
804834
<option value="sitewide" <?php selected( $beacon_display_location, 'sitewide' ); ?>><?php esc_html_e( 'Entire Site', 'knowledgebase' ); ?></option>
805835
</select>
806836
<p class="description"><?php esc_html_e( 'Control where the beacon button appears.', 'knowledgebase' ); ?></p>
807837
</td>
808838
</tr>
809839
<tr>
810-
<th scope="row"><label for="beacon_position"><?php esc_html_e( 'Button Position', 'knowledgebase' ); ?></label></th>
840+
<th scope="row">
841+
<label for="beacon_position">
842+
<?php esc_html_e( 'Button Position', 'knowledgebase' ); ?>
843+
<?php if ( ! $is_pro ) : ?>
844+
<span class="wzkb-pro-badge"><?php esc_html_e( 'PRO', 'knowledgebase' ); ?></span>
845+
<?php endif; ?>
846+
</label>
847+
</th>
811848
<td>
812-
<select id="beacon_position" name="beacon_position">
849+
<select id="beacon_position" name="beacon_position" <?php disabled( ! $is_pro ); ?>>
813850
<option value="right" <?php selected( $beacon_position, 'right' ); ?>><?php esc_html_e( 'Bottom Right', 'knowledgebase' ); ?></option>
814851
<option value="left" <?php selected( $beacon_position, 'left' ); ?>><?php esc_html_e( 'Bottom Left', 'knowledgebase' ); ?></option>
815852
</select>
816853
</td>
817854
</tr>
818855
<tr>
819-
<th scope="row"><label for="beacon_color"><?php esc_html_e( 'Primary Color', 'knowledgebase' ); ?></label></th>
856+
<th scope="row">
857+
<label for="beacon_color">
858+
<?php esc_html_e( 'Primary Color', 'knowledgebase' ); ?>
859+
<?php if ( ! $is_pro ) : ?>
860+
<span class="wzkb-pro-badge"><?php esc_html_e( 'PRO', 'knowledgebase' ); ?></span>
861+
<?php endif; ?>
862+
</label>
863+
</th>
820864
<td>
821-
<input type="text" id="beacon_color" name="beacon_color" value="<?php echo esc_attr( $beacon_color ); ?>" class="color-field" />
865+
<input type="text" id="beacon_color" name="beacon_color" value="<?php echo esc_attr( $beacon_color ); ?>" class="color-field" <?php disabled( ! $is_pro ); ?> />
822866
<p class="description"><?php esc_html_e( 'Main brand color for the beacon button. Other colors will be generated automatically.', 'knowledgebase' ); ?></p>
823867
</td>
824868
</tr>
825869
<tr>
826-
<th scope="row"><label for="beacon_greeting"><?php esc_html_e( 'Greeting Message', 'knowledgebase' ); ?></label></th>
870+
<th scope="row">
871+
<label for="beacon_greeting">
872+
<?php esc_html_e( 'Greeting Message', 'knowledgebase' ); ?>
873+
<?php if ( ! $is_pro ) : ?>
874+
<span class="wzkb-pro-badge"><?php esc_html_e( 'PRO', 'knowledgebase' ); ?></span>
875+
<?php endif; ?>
876+
</label>
877+
</th>
827878
<td>
828-
<input type="text" id="beacon_greeting" name="beacon_greeting" value="<?php echo esc_attr( $beacon_greeting ); ?>" class="large-text" />
879+
<input type="text" id="beacon_greeting" name="beacon_greeting" value="<?php echo esc_attr( $beacon_greeting ); ?>" class="large-text" <?php disabled( ! $is_pro ); ?> />
829880
<p class="description"><?php esc_html_e( 'Welcome message shown when users open the beacon.', 'knowledgebase' ); ?></p>
830881
</td>
831882
</tr>
832883
<tr>
833-
<th scope="row"><label for="beacon_contact_enabled"><?php esc_html_e( 'Enable Contact Form', 'knowledgebase' ); ?></label></th>
884+
<th scope="row">
885+
<label for="beacon_contact_enabled">
886+
<?php esc_html_e( 'Enable Contact Form', 'knowledgebase' ); ?>
887+
<?php if ( ! $is_pro ) : ?>
888+
<span class="wzkb-pro-badge"><?php esc_html_e( 'PRO', 'knowledgebase' ); ?></span>
889+
<?php endif; ?>
890+
</label>
891+
</th>
834892
<td>
835893
<input type="hidden" name="beacon_contact_enabled" value="0" />
836-
<input type="checkbox" id="beacon_contact_enabled" name="beacon_contact_enabled" value="1" <?php checked( $beacon_contact_enabled, 1 ); ?> />
894+
<input type="checkbox" id="beacon_contact_enabled" name="beacon_contact_enabled" value="1" <?php checked( $beacon_contact_enabled, 1 ); ?> <?php disabled( ! $is_pro ); ?> />
837895
<p class="description"><?php esc_html_e( 'Allow visitors to send messages from the beacon.', 'knowledgebase' ); ?></p>
838896
</td>
839897
</tr>
840898
</table>
841-
<?php endif; ?>
842899

843900
<p class="wzkb-setup-actions step">
844901
<?php wp_nonce_field( 'wzkb-setup' ); ?>
845902
<a href="<?php echo esc_url( $this->get_previous_step_link() ); ?>" class="button button-large"><?php esc_html_e( 'Previous', 'knowledgebase' ); ?></a>
846-
<?php if ( $is_pro ) : ?>
847-
<input type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( 'Continue', 'knowledgebase' ); ?>" name="wzkb_save_step" />
848-
<?php else : ?>
849-
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button-primary button button-large button-next"><?php esc_html_e( 'Skip to Finish', 'knowledgebase' ); ?></a>
850-
<?php endif; ?>
903+
<input type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( 'Continue', 'knowledgebase' ); ?>" name="wzkb_save_step" />
851904
</p>
852905
</form>
853906
<?php
@@ -864,7 +917,7 @@ public function pro_features_save() {
864917
check_admin_referer( 'wzkb-setup' );
865918

866919
// Only save if Pro is active.
867-
if ( ! class_exists( 'WebberZone\\Knowledge_Base\\Pro\\Pro' ) ) {
920+
if ( ! $this->is_pro_active ) {
868921
wp_safe_redirect( esc_url_raw( $this->get_next_step_link() ) );
869922
exit;
870923
}
@@ -1060,7 +1113,7 @@ public function complete_step() {
10601113
update_option( 'wzkb_setup_completed', true );
10611114
update_option( 'wzkb_setup_current_step', '' );
10621115
$multi_product = \wzkb_get_option( 'multi_product' );
1063-
$pro_active = class_exists( 'WebberZone\\Knowledge_Base\\Pro\\Pro' );
1116+
$pro_active = $this->is_pro_active;
10641117
$beacon_enabled = $pro_active && wzkb_get_option( 'beacon_enabled' );
10651118
$rating_enabled = $pro_active && 'disabled' !== wzkb_get_option( 'rating_system' );
10661119
?>

includes/admin/css/wizard-rtl.css

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@
252252

253253
/* Pro Features Preview for Free Users */
254254
.wzkb-setup-pro-preview {
255-
background: linear-gradient(-135deg, #667eea 0%, #764ba2 100%);
256-
color: #fff;
255+
background: linear-gradient(-135deg, #1e1b4b 0%, #312e81 100%);
256+
color: #f9fafb;
257257
padding: 30px;
258258
margin: 20px 0;
259259
border-radius: 8px;
@@ -277,25 +277,39 @@
277277
}
278278

279279
.wzkb-setup-pro-preview p {
280-
color: #fff;
280+
color: #f9fafb;
281281
margin: 10px 0;
282282
}
283283

284+
.wzkb-setup .wzkb-setup-content .wzkb-setup-pro-preview,
285+
.wzkb-setup .wzkb-setup-content .wzkb-setup-pro-preview p,
286+
.wzkb-setup .wzkb-setup-content .wzkb-setup-pro-preview strong,
287+
.wzkb-setup .wzkb-setup-content .wzkb-setup-pro-preview span,
288+
.wzkb-setup .wzkb-setup-content .wzkb-setup-pro-preview a:not(.button) {
289+
color: #f9fafb;
290+
}
291+
292+
.wzkb-setup .wzkb-setup-content .wzkb-setup-pro-preview a:not(.button):hover,
293+
.wzkb-setup .wzkb-setup-content .wzkb-setup-pro-preview a:not(.button):focus {
294+
color: #fde68a;
295+
}
296+
284297
.wzkb-setup-pro-preview .button {
285298
margin-left: 10px;
286299
margin-top: 10px;
287300
}
288301

289302
.wzkb-setup-pro-preview .button-primary {
290-
background: #ffd700;
291-
border-color: #ffd700;
292-
color: #000;
303+
background: #fbbf24;
304+
border-color: #d97706;
305+
color: #1f2937;
293306
font-weight: 600;
294307
}
295308

296309
.wzkb-setup-pro-preview .button-primary:hover {
297-
background: #ffed4e;
298-
border-color: #ffed4e;
310+
background: #f59e0b;
311+
border-color: #b45309;
312+
color: #111827;
299313
}
300314

301315
/* Pro Badge */

0 commit comments

Comments
 (0)