@@ -37,6 +37,20 @@ public static function showAdminNotices() : void {
37
37
return ;
38
38
}
39
39
40
+ // avoid missing table error for git users who don't re-activate plugin
41
+ global $ wpdb ;
42
+ $ table_name = $ wpdb ->prefix . 'wp2static_notices ' ;
43
+
44
+ $ check_table_query =
45
+ $ wpdb ->prepare (
46
+ 'SHOW TABLES LIKE %s ' ,
47
+ $ wpdb ->esc_like ( $ table_name )
48
+ );
49
+
50
+ if ( $ wpdb ->get_var ( $ check_table_query ) !== $ table_name ) {
51
+ return ;
52
+ }
53
+
40
54
$ notice_to_display = ( new self () )->getNoticeBasedOnRules ();
41
55
42
56
if ( ! $ notice_to_display ) {
@@ -131,7 +145,14 @@ public function getNoticeBasedOnRules() {
131
145
'secondary_button_title ' => 'Learn more ' ,
132
146
];
133
147
134
- if ( ! ( new self () )->noticeAlreadyDismissed ( 'elementor-pro ' ) &&
148
+ $ addons = Addons::getAll ();
149
+
150
+ if ( ! ( new self () )->noticeAlreadyDismissed ( 'wp2static-addons-installed ' ) &&
151
+ $ addons !== []
152
+ ) {
153
+ $ notice ['name ' ] = 'wp2static-addons-installed ' ;
154
+ $ notice = array_merge ( ( new self () )->getNoticeContents ( 'wp2static-addons-installed ' ), $ notice );
155
+ } elseif ( ! ( new self () )->noticeAlreadyDismissed ( 'elementor-pro ' ) &&
135
156
is_plugin_active ( 'elementor-pro/elementor-pro.php ' )
136
157
) {
137
158
$ notice ['name ' ] = 'elementor-pro ' ;
@@ -356,6 +377,16 @@ public function getNoticeContents( string $notice_name ) {
356
377
'secondary_button_url ' => 'https://link.strattic.com/learn-strattic-redirect ' ,
357
378
];
358
379
break ;
380
+ case 'wp2static-addons-installed ' :
381
+ $ notice_contents = [
382
+ 'title ' =>
383
+ 'Strattic by Elementor: The simplest way to publish powerful static sites! ' ,
384
+ // phpcs:disable Generic.Files.LineLength.MaxExceeded
385
+ 'message ' => "Enjoy blindingly fast, secure and simple WordPress static hosting, with dozens of dynamic features. \nGet 14 days for free. No credit card required! " ,
386
+ 'primary_button_url ' => 'https://link.strattic.com/try-strattic-publish ' ,
387
+ 'secondary_button_url ' => 'https://link.strattic.com/learn-strattic-publish ' ,
388
+ ];
389
+ break ;
359
390
}
360
391
361
392
return $ notice_contents ;
0 commit comments