PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.8
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.8
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmInboxController.php +64 -25 6.346.8 View file →
@@ -8,25 +8,33 @@
8 8 */
9 9 class FrmInboxController {
10 10
11 11 /**
12 - * Get the HTML for the inbox notice.
13 - *
14 12 * @since 4.05
15 - * @since 6.8.4 The $filtered parameter was added.
16 - *
17 - * @param bool $filtered Set this to false to avoid the frm_inbox_badge filter.
18 - *
19 - * @return string
20 13 */
21 - public static function get_notice_count( $filtered = true ) {
14 + public static function get_notice_count() {
22 15 FrmFormMigratorsHelper::maybe_add_to_inbox();
23 16
24 17 $inbox = new FrmInbox();
25 - return $inbox->unread_html( $filtered );
18 + return $inbox->unread_html();
26 19 }
27 20
28 21 /**
22 + * @since 4.06
23 + *
24 + * @return void
25 + */
26 + public static function dismiss_all_button( $atts ) {
27 + if ( empty( $atts['messages'] ) ) {
28 + return;
29 + }
30 +
31 + echo '<button class="frm-button-secondary" id="frm-dismiss-inbox" type="button">' .
32 + esc_html__( 'Dismiss All', 'formidable' ) .
33 + '</button>';
34 + }
35 +
36 + /**
29 37 * @since 6.8
30 38 *
31 39 * @return array
32 40 */
@@ -31,9 +39,9 @@
31 39 * @return array
32 40 */
33 41 public static function get_inbox_messages() {
34 42 self::add_tracking_request();
35 - self::remove_free_template_message();
43 + self::add_free_template_message();
36 44
37 45 $inbox = new FrmInbox();
38 46 $unread_messages = $inbox->get_messages();
39 47 $dismissed_messages = $unread_messages;
@@ -54,25 +62,18 @@
54 62 * @return void
55 63 */
56 64 public static function dismiss_message() {
57 65 check_ajax_referer( 'frm_ajax', 'nonce' );
58 - FrmAppHelper::permission_check( 'frm_view_forms' );
66 + FrmAppHelper::permission_check( 'frm_change_settings' );
59 67
60 68 $key = FrmAppHelper::get_param( 'key', '', 'post', 'sanitize_text_field' );
61 -
62 - if ( $key ) {
69 + if ( ! empty( $key ) ) {
63 70 $message = new FrmInbox();
64 71 $message->dismiss( $key );
65 -
66 72 if ( $key === 'review' ) {
67 73 $reviews = new FrmReviews();
68 74 $reviews->dismiss_review();
69 75 }
70 -
71 - if ( $key === 'onboarding_wizard' ) {
72 - // Delete the skipped option or the inbox message will continue to get added.
73 - delete_option( FrmOnboardingWizardController::ONBOARDING_SKIPPED_OPTION );
74 - }
75 76 }
76 77
77 78 wp_die();
78 79 }
@@ -82,20 +83,22 @@
82 83 *
83 84 * @return void
84 85 */
85 86 private static function add_tracking_request() {
86 - if ( FrmAppHelper::get_settings()->tracking ) {
87 + $settings = FrmAppHelper::get_settings();
88 + if ( $settings->tracking ) {
87 89 return;
88 90 }
89 91
90 - $link = admin_url( 'admin.php?page=formidable-settings&t=misc_settings' );
92 + $link = admin_url( 'admin.php?page=formidable-settings&t=misc_settings' );
93 +
91 94 $message = new FrmInbox();
92 95 $message->add_message(
93 96 array(
94 97 'key' => 'usage',
95 - 'message' => 'Gathering usage data allows us to improve Formidable. Your forms will be considered as we evaluate new features, judge the quality of an update, or determine if an improvement makes sense. You can always visit the <a href="' . esc_url( $link ) . '">Global Settings</a> and choose to stop sharing data. <a href="https://formidableforms.com/knowledgebase/global-settings-overview/#kb-usage-tracking" target="_blank" rel="noopener noreferrer">Read more about what data we collect</a>.', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
98 + 'message' => 'Gathering usage data allows us to improve Formidable. Your forms will be considered as we evaluate new features, judge the quality of an update, or determine if an improvement makes sense. You can always visit the <a href="' . esc_url( $link ) . '">Global Settings</a> and choose to stop sharing data. <a href="https://formidableforms.com/knowledgebase/global-settings-overview/#kb-usage-tracking" target="_blank" rel="noopener noreferrer">Read more about what data we collect</a>.',
96 99 'subject' => __( 'Help Formidable improve with usage tracking', 'formidable' ),
97 - 'cta' => '<a href="#" class="frm-button-secondary frm_inbox_dismiss">Dismiss</a> <a href="' . esc_url( $link ) . '" class="button-primary frm-button-primary frm_inbox_dismiss">Activate usage tracking</a>', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
100 + 'cta' => '<a href="#" class="frm-button-secondary frm_inbox_dismiss">Dismiss</a> <a href="' . esc_url( $link ) . '" class="button-primary frm-button-primary frm_inbox_dismiss">Activate usage tracking</a>',
98 101 'type' => 'feedback',
99 102 )
100 103 );
101 104 }
@@ -106,13 +109,49 @@
106 109 * @since 4.10.03
107 110 *
108 111 * @return void
109 112 */
110 - private static function remove_free_template_message() {
113 + private static function add_free_template_message() {
111 114 if ( FrmAppHelper::pro_is_installed() ) {
112 115 return;
113 116 }
114 117
118 + $api = new FrmFormTemplateApi();
119 + if ( $api->has_free_access() ) {
120 + return;
121 + }
122 +
123 + $link = admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG . '&free-templates=1' );
124 +
115 125 $message = new FrmInbox();
116 - $message->dismiss( 'free_templates' );
126 + $message->add_message(
127 + array(
128 + 'key' => 'free_templates',
129 + 'message' => 'Add your email address to get a code for 20+ free form templates.',
130 + 'subject' => 'Get 20+ Free Form Templates',
131 + 'cta' => '<a href="#" class="frm-button-secondary frm_inbox_dismiss">Dismiss</a> <a href="' . esc_url( $link ) . '" class="button-primary frm-button-primary">Get Now</a>',
132 + 'type' => 'feedback',
133 + )
134 + );
117 135 }
136 +
137 + /**
138 + * @since 4.05
139 + * @deprecated 6.8
140 + *
141 + * @return void
142 + */
143 + public static function menu() {
144 + _deprecated_function( __METHOD__, '6.8' );
145 + }
146 +
147 + /**
148 + * @since 4.05
149 + * @deprecated 6.8
150 + *
151 + * @return void
152 + */
153 + public static function inbox() {
154 + _deprecated_function( __METHOD__, '6.8' );
155 + }
156 +
118 157 }