PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.14
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.14
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 +61 -17 6.306.14 View file →
@@ -14,9 +14,8 @@
14 14 * @since 4.05
15 15 * @since 6.8.4 The $filtered parameter was added.
16 16 *
17 17 * @param bool $filtered Set this to false to avoid the frm_inbox_badge filter.
18 - *
19 18 * @return string
20 19 */
21 20 public static function get_notice_count( $filtered = true ) {
22 21 FrmFormMigratorsHelper::maybe_add_to_inbox();
@@ -25,8 +24,23 @@
25 24 return $inbox->unread_html( $filtered );
26 25 }
27 26
28 27 /**
28 + * @since 4.06
29 + *
30 + * @return void
31 + */
32 + public static function dismiss_all_button( $atts ) {
33 + if ( empty( $atts['messages'] ) ) {
34 + return;
35 + }
36 +
37 + echo '<button class="frm-button-secondary" id="frm-dismiss-inbox" type="button">' .
38 + esc_html__( 'Dismiss All', 'formidable' ) .
39 + '</button>';
40 + }
41 +
42 + /**
29 43 * @since 6.8
30 44 *
31 45 * @return array
32 46 */
@@ -31,9 +45,9 @@
31 45 * @return array
32 46 */
33 47 public static function get_inbox_messages() {
34 48 self::add_tracking_request();
35 - self::remove_free_template_message();
49 + self::add_free_template_message();
36 50
37 51 $inbox = new FrmInbox();
38 52 $unread_messages = $inbox->get_messages();
39 53 $dismissed_messages = $unread_messages;
@@ -54,25 +68,18 @@
54 68 * @return void
55 69 */
56 70 public static function dismiss_message() {
57 71 check_ajax_referer( 'frm_ajax', 'nonce' );
58 - FrmAppHelper::permission_check( 'frm_view_forms' );
72 + FrmAppHelper::permission_check( 'frm_change_settings' );
59 73
60 74 $key = FrmAppHelper::get_param( 'key', '', 'post', 'sanitize_text_field' );
61 -
62 - if ( $key ) {
75 + if ( ! empty( $key ) ) {
63 76 $message = new FrmInbox();
64 77 $message->dismiss( $key );
65 -
66 78 if ( $key === 'review' ) {
67 79 $reviews = new FrmReviews();
68 80 $reviews->dismiss_review();
69 81 }
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 82 }
76 83
77 84 wp_die();
78 85 }
@@ -82,20 +89,22 @@
82 89 *
83 90 * @return void
84 91 */
85 92 private static function add_tracking_request() {
86 - if ( FrmAppHelper::get_settings()->tracking ) {
93 + $settings = FrmAppHelper::get_settings();
94 + if ( $settings->tracking ) {
87 95 return;
88 96 }
89 97
90 - $link = admin_url( 'admin.php?page=formidable-settings&t=misc_settings' );
98 + $link = admin_url( 'admin.php?page=formidable-settings&t=misc_settings' );
99 +
91 100 $message = new FrmInbox();
92 101 $message->add_message(
93 102 array(
94 103 '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
104 + '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 105 '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
106 + '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 107 'type' => 'feedback',
99 108 )
100 109 );
101 110 }
@@ -106,13 +115,48 @@
106 115 * @since 4.10.03
107 116 *
108 117 * @return void
109 118 */
110 - private static function remove_free_template_message() {
119 + private static function add_free_template_message() {
111 120 if ( FrmAppHelper::pro_is_installed() ) {
112 121 return;
113 122 }
114 123
124 + $api = new FrmFormTemplateApi();
125 + if ( $api->has_free_access() ) {
126 + return;
127 + }
128 +
129 + $link = admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG . '&free-templates=1' );
130 +
115 131 $message = new FrmInbox();
116 - $message->dismiss( 'free_templates' );
132 + $message->add_message(
133 + array(
134 + 'key' => 'free_templates',
135 + 'message' => 'Add your email address to get a code for 20+ free form templates.',
136 + 'subject' => 'Get 20+ Free Form Templates',
137 + '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>',
138 + 'type' => 'feedback',
139 + )
140 + );
141 + }
142 +
143 + /**
144 + * @since 4.05
145 + * @deprecated 6.8
146 + *
147 + * @return void
148 + */
149 + public static function menu() {
150 + _deprecated_function( __METHOD__, '6.8' );
151 + }
152 +
153 + /**
154 + * @since 4.05
155 + * @deprecated 6.8
156 + *
157 + * @return void
158 + */
159 + public static function inbox() {
160 + _deprecated_function( __METHOD__, '6.8' );
117 161 }
118 162 }