PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.12
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.12
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Modules / Registerer / StripeKeyNotice.php

StripeKeyNotice.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.12, at app/Modules/Registerer/StripeKeyNotice.php

61 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules\Registerer;
4
5 defined('ABSPATH') or die;
6
7 use FluentForm\App\Helpers\Helper;
8 use FluentForm\App\Http\Controllers\AdminNoticeController;
9
10 class StripeKeyNotice
11 {
12 public static function register()
13 {
14 if (static::shouldRegister()) {
15 add_action('fluentform/global_menu', [static::class, 'show'], 99);
16 }
17 }
18
19 protected static function shouldRegister()
20 {
21 if (!Helper::isFluentAdminPage() || wp_doing_ajax()) {
22 return false;
23 }
24
25 return get_option('fluentform_stripe_key_decrypt_failed') === 'yes';
26 }
27
28 public static function show()
29 {
30 $notice = new AdminNoticeController();
31 $notice->addNotice(self::getMessage());
32 $notice->showNotice();
33 }
34
35 private static function getMessage()
36 {
37 $message = __(
38 'Fluent Forms could not read your saved Stripe keys. This can happen after a hosting or security change that rotates WordPress security keys. Please re-enter your Stripe keys to keep accepting payments.',
39 'fluentform'
40 );
41
42 return [
43 'name' => 'stripe_key_decrypt_failed',
44 'title' => '',
45 'message' => $message,
46 'links' => [
47 [
48 'href' => admin_url('admin.php?page=fluent_forms_settings#payments/payment_methods'),
49 'btn_text' => __('Fix Stripe Keys', 'fluentform'),
50 'btn_atts' => 'class="mr-1 el-button--success el-button--mini"',
51 ],
52 [
53 'href' => admin_url('admin.php?page=fluent_forms'),
54 'btn_text' => __('Dismiss', 'fluentform'),
55 'btn_atts' => 'class="text-button el-button--mini ff_nag_cross" data-notice_type="temp" data-notice_name="stripe_key_decrypt_failed"',
56 ],
57 ],
58 ];
59 }
60 }
61