PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 4.4.7
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v4.4.7
4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / EmbedPress / Includes / Classes / README_FEATURE_NOTICES.md
embedpress / EmbedPress / Includes / Classes Last commit date
Analytics 7 months ago Database 9 months ago Elementor_Enhancer.php 1 year ago EmbedPress_Core_Installer.php 6 years ago EmbedPress_Notice.php 2 years ago EmbedPress_Plugin_Usage_Tracker.php 1 year ago Extend_CustomPlayer_Controls.php 1 year ago Extend_Elementor_Controls.php 1 year ago FeatureNoticeManager.php 8 months ago FeatureNotices.php 8 months ago Feature_Enhancer.php 9 months ago Helper.php 6 months ago PermalinkHelper.php 10 months ago README_FEATURE_NOTICES.md 8 months ago
README_FEATURE_NOTICES.md
190 lines
1 # Feature Notices - Quick Guide
2
3 ## 📍 Location
4
5 All feature notices are now registered in a **single, dedicated file**:
6
7 ```
8 wp-content/plugins/embedpress/EmbedPress/Includes/Classes/FeatureNotices.php
9 ```
10
11 ## 🚀 How to Add a New Notice
12
13 1. Open `FeatureNotices.php`
14 2. Find the `register_all_notices()` method
15 3. Add your notice using the `register_notice()` method
16
17 ### Basic Example
18
19 ```php
20 $notice_manager->register_notice('my_unique_notice_id', [
21 'title' => 'New Features',
22 'icon' => '🎉',
23 'message' => '<strong>Exciting Update!</strong> Check out our new features.',
24 'button_text' => 'Learn More',
25 'button_url' => admin_url('admin.php?page=embedpress'),
26 'skip_text' => 'Skip',
27 ]);
28 ```
29
30 ## 📋 Available Parameters
31
32 | Parameter | Type | Required | Default | Description |
33 |-----------|------|----------|---------|-------------|
34 | `title` | string | No | 'New Features' | Notice title |
35 | `icon` | string | No | '🎉' | Emoji icon |
36 | `message` | string | Yes | - | Notice message (HTML allowed) |
37 | `button_text` | string | No | 'Learn More' | Primary button text |
38 | `button_url` | string | No | '' | Primary button URL |
39 | `button_target` | string | No | '_self' | Link target (`_self` or `_blank`) |
40 | `skip_text` | string | No | 'Skip' | Skip button text |
41 | `screens` | array | No | [] | Show on specific screens (empty = all pages) |
42 | `capability` | string | No | 'manage_options' | Required user capability |
43 | `start_date` | string | No | null | Start showing from this date (Y-m-d) |
44 | `end_date` | string | No | null | Stop showing after this date (Y-m-d) |
45 | `priority` | int | No | 10 | Display priority (lower = higher priority) |
46 | `type` | string | No | 'info' | Notice type: `info`, `success`, `warning`, `error` |
47
48 ## 🎨 Notice Types
49
50 - **info** - Blue theme (default)
51 - **success** - Green theme
52 - **warning** - Orange/yellow theme
53 - **error** - Red theme
54
55 ## �
56 Date-Based Notices
57
58 Show notices only during specific time periods:
59
60 ```php
61 $notice_manager->register_notice('black_friday_2024', [
62 'title' => 'Limited Time Offer',
63 'icon' => '🎁',
64 'message' => '<strong>Black Friday Sale!</strong> Get 50% off.',
65 'button_text' => 'Claim Discount',
66 'button_url' => 'https://embedpress.com/pricing',
67 'start_date' => '2024-11-25',
68 'end_date' => '2024-12-02',
69 'priority' => 1,
70 ]);
71 ```
72
73 ## 🎯 Screen-Specific Notices
74
75 Show notices only on specific admin pages:
76
77 ```php
78 $notice_manager->register_notice('settings_update', [
79 'title' => 'Update Required',
80 'message' => 'Please update your settings.',
81 'screens' => ['toplevel_page_embedpress'], // Only on EmbedPress main page
82 ]);
83 ```
84
85 ### Common Screen IDs
86
87 - `toplevel_page_embedpress` - EmbedPress main page
88 - `dashboard` - WordPress dashboard
89 - `plugins` - Plugins page
90 - Leave empty `[]` to show on all admin pages
91
92 ## 🔔 Priority System
93
94 Lower numbers = higher priority (shown first):
95
96 ```php
97 // High priority (shown first)
98 $notice_manager->register_notice('urgent_notice', [
99 'priority' => 1,
100 // ...
101 ]);
102
103 // Normal priority
104 $notice_manager->register_notice('normal_notice', [
105 'priority' => 10,
106 // ...
107 ]);
108
109 // Low priority (shown last)
110 $notice_manager->register_notice('low_priority', [
111 'priority' => 20,
112 // ...
113 ]);
114 ```
115
116 ## 🎭 User Capabilities
117
118 Control who can see the notice:
119
120 ```php
121 $notice_manager->register_notice('admin_only', [
122 'capability' => 'manage_options', // Only admins
123 // ...
124 ]);
125
126 $notice_manager->register_notice('editor_and_above', [
127 'capability' => 'edit_pages', // Editors and admins
128 // ...
129 ]);
130 ```
131
132 ## 💡 Tips
133
134 1. **Unique IDs**: Always use unique notice IDs to avoid conflicts
135 2. **HTML in Messages**: You can use HTML in the message field
136 3. **External Links**: Set `button_target` to `'_blank'` for external URLs
137 4. **Testing**: Comment out old notices instead of deleting them
138 5. **Organization**: Keep active notices at the top, examples at the bottom
139
140 ## 🔄 User Actions
141
142 Users can interact with notices in two ways:
143
144 1. **Dismiss** (X button) - Permanently hides the notice
145 2. **Skip** - Hides for 7 days, then shows again
146
147 ## 📝 Complete Example
148
149 ```php
150 $notice_manager->register_notice('analytics_launch_2024', [
151 'title' => 'New Features',
152 'icon' => '📊',
153 'message' => '<strong>New In EmbedPress:</strong> Introducing Analytics dashboard to track every embed performance; see total counts, views, clicks, geo insights, etc.',
154 'button_text' => 'View Analytics',
155 'button_url' => admin_url('admin.php?page=embedpress&page_type=analytics'),
156 'button_target' => '_self',
157 'skip_text' => 'Maybe Later',
158 'screens' => [], // Show on all admin pages
159 'capability' => 'manage_options',
160 'start_date' => '2024-01-01',
161 'end_date' => '2025-12-31',
162 'priority' => 10,
163 'type' => 'info',
164 ]);
165 ```
166
167 ## 🛠️ Helper Method
168
169 Use the built-in helper for EmbedPress URLs:
170
171 ```php
172 // Instead of:
173 'button_url' => admin_url('admin.php?page=embedpress&page_type=analytics'),
174
175 // You can use:
176 'button_url' => $this->get_embedpress_url('analytics'),
177 ```
178
179 ## 📚 More Information
180
181 For detailed documentation, see:
182 - `docs/README_FEATURE_NOTICES.md` - Full documentation
183 - `docs/feature-notice-system.md` - System architecture
184 - `FeatureNoticeManager.php` - Core implementation
185
186 ---
187
188 **Need Help?** Check the commented examples in `FeatureNotices.php` for more use cases!
189
190