Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/fluentform/app/Modules/Registerer/ReviewQuery.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
3
+
namespace FluentForm\App\Modules\Registerer;
4
+
5
+
use FluentForm\App\Models\Form;
6
+
use FluentForm\App\Helpers\Helper;
7
+
use FluentForm\App\Http\Controllers\AdminNoticeController;
8
+
9
+
class ReviewQuery
10
+
{
11
+
public static function register()
12
+
{
13
+
if (static::shouldRegister()) {
14
+
add_action('fluentform/global_menu', [static::class, 'show'], 99);
15
+
}
16
+
}
17
+
18
+
protected static function shouldRegister()
19
+
{
20
+
if (Helper::isFluentAdminPage() && !wp_doing_ajax()) {
21
+
return Form::count() > 3;
22
+
}
23
+
24
+
return false;
25
+
}
26
+
27
+
public static function show()
28
+
{
29
+
$notice = new AdminNoticeController();
30
+
$msg = static::getMessage();
31
+
$notice->addNotice($msg);
32
+
$notice->showNotice();
33
+
}
34
+
35
+
private static function getMessage()
36
+
{
37
+
return [
38
+
'name' => 'review_query',
39
+
'title' => '',
40
+
'message' => sprintf('Thank you for using Fluent Forms. We would greatly appreciate it if you could share your experience and leave a review for us on %s. Your review inspires us to keep improving the plugin and delivering a better user experience.',
41
+
'<a target="_blank" href="https://wordpress.org/support/plugin/fluentform/reviews/#new-post">WordPress.org</a>'),
42
+
'links' => [
43
+
[
44
+
'href' => 'https://wordpress.org/support/plugin/fluentform/reviews/#new-post',
45
+
'btn_text' => 'Yes',
46
+
'btn_atts' => 'class="mr-1 el-button--success el-button--mini ff_review_now" data-notice_name="review_query"',
47
+
],
48
+
[
49
+
'href' => admin_url('admin.php?page=fluent_forms'),
50
+
'btn_text' => 'Maybe Later',
51
+
'btn_atts' => 'class="mr-1 el-button--info el-button--soft el-button--mini ff_nag_cross" data-notice_type="temp" data-notice_name="review_query"',
52
+
],
53
+
[
54
+
'href' => admin_url('admin.php?page=fluent_forms'),
55
+
'btn_text' => 'Do not show again',
56
+
'btn_atts' => 'class="text-button el-button--mini ff_nag_cross" data-notice_type="permanent" data-notice_name="review_query"',
57
+
],
58
+
],
59
+
];
60
+
}
61
+
}
62
+