Skip to content

Commit 0cd547a

Browse files
committed
feat: add beacon color customization settings and spam protection features
1 parent 4ad40c2 commit 0cd547a

File tree

2 files changed

+59
-3
lines changed

2 files changed

+59
-3
lines changed

docs/BEACON-WIDGET.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Beacon Help Widget
22

3-
The Beacon is a floating help widget inspired by HelpScout's Beacon that provides self-service support with search, suggested articles, and a contact form.
3+
The Beacon is a floating help widget that provides self-service support with search, suggested articles, and a contact form.
44

55
## Features
66

@@ -10,6 +10,7 @@ The Beacon is a floating help widget inspired by HelpScout's Beacon that provide
1010
- **Self-Service Search** - Search knowledge base articles with debounced AJAX search (500ms)
1111
- **Smart Suggested Articles** - Context-aware articles using Related class for KB posts, recent articles elsewhere
1212
- **Contact Form** - HTML email contact with beautiful template when articles don't help
13+
- **Built-in Spam Protection** - Honeypot field plus anonymous rate limiting without storing IPs
1314
- **Stacked Navigation** - Mobile-app-style layered interface for smooth UX
1415
- **Responsive Design** - Works beautifully on desktop, tablet, and mobile devices
1516
- **Fixed Search Box** - Search box locked at bottom using CSS Grid for optimal UX
@@ -359,6 +360,7 @@ Add custom styles to override defaults:
359360
- Output escaping (esc_html, esc_attr, esc_url)
360361
- Email validation
361362
- XSS prevention in JavaScript
363+
- Honeypot field on the contact form and token-based rate limiting (no IP storage)
362364

363365
### Performance
364366

includes/admin/class-settings.php

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,8 @@ public static function settings_pro() {
713713
'type' => 'select',
714714
'default' => 'kb_only',
715715
'options' => array(
716-
'kb_only' => esc_html__( 'Knowledge Base Only', 'knowledgebase' ),
717-
'sitewide' => esc_html__( 'Entire Site', 'knowledgebase' ),
716+
'kb_only' => esc_html__( 'Knowledge Base Only', 'knowledgebase' ),
717+
'sitewide' => esc_html__( 'Entire Site', 'knowledgebase' ),
718718
),
719719
'pro' => true,
720720
),
@@ -760,6 +760,60 @@ public static function settings_pro() {
760760
'field_class' => 'color-field',
761761
'pro' => true,
762762
),
763+
'beacon_hover_color' => array(
764+
'id' => 'beacon_hover_color',
765+
'name' => esc_html__( 'Beacon Hover Color', 'knowledgebase' ),
766+
'desc' => esc_html__( 'Hover color for buttons and interactive elements.', 'knowledgebase' ),
767+
'type' => 'color',
768+
'default' => '#4c63d2',
769+
'field_class' => 'color-field',
770+
'pro' => true,
771+
),
772+
'beacon_text_color' => array(
773+
'id' => 'beacon_text_color',
774+
'name' => esc_html__( 'Beacon Text Color', 'knowledgebase' ),
775+
'desc' => esc_html__( 'Text color for the beacon button and interface elements.', 'knowledgebase' ),
776+
'type' => 'color',
777+
'default' => '#ffffff',
778+
'field_class' => 'color-field',
779+
'pro' => true,
780+
),
781+
'beacon_hover_text_color' => array(
782+
'id' => 'beacon_hover_text_color',
783+
'name' => esc_html__( 'Beacon Hover Text Color', 'knowledgebase' ),
784+
'desc' => esc_html__( 'Text color for the beacon button on hover.', 'knowledgebase' ),
785+
'type' => 'color',
786+
'default' => '#ffffff',
787+
'field_class' => 'color-field',
788+
'pro' => true,
789+
),
790+
'beacon_panel_bg_color' => array(
791+
'id' => 'beacon_panel_bg_color',
792+
'name' => esc_html__( 'Panel Background Color', 'knowledgebase' ),
793+
'desc' => esc_html__( 'Background color for the beacon panel.', 'knowledgebase' ),
794+
'type' => 'color',
795+
'default' => '#ffffff',
796+
'field_class' => 'color-field',
797+
'pro' => true,
798+
),
799+
'beacon_panel_text_color' => array(
800+
'id' => 'beacon_panel_text_color',
801+
'name' => esc_html__( 'Panel Text Color', 'knowledgebase' ),
802+
'desc' => esc_html__( 'Default text color within the beacon panel.', 'knowledgebase' ),
803+
'type' => 'color',
804+
'default' => '#1a1a1a',
805+
'field_class' => 'color-field',
806+
'pro' => true,
807+
),
808+
'beacon_link_hover_color' => array(
809+
'id' => 'beacon_link_hover_color',
810+
'name' => esc_html__( 'Link Hover Background', 'knowledgebase' ),
811+
'desc' => esc_html__( 'Background color when hovering over beacon links and list items.', 'knowledgebase' ),
812+
'type' => 'color',
813+
'default' => '#f3f4f6',
814+
'field_class' => 'color-field',
815+
'pro' => true,
816+
),
763817
'beacon_greeting' => array(
764818
'id' => 'beacon_greeting',
765819
'name' => esc_html__( 'Greeting Message', 'knowledgebase' ),

0 commit comments

Comments
 (0)