PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.19
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.19
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 +38 -13 6.276.19 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();
@@ -31,9 +30,9 @@
31 30 * @return array
32 31 */
33 32 public static function get_inbox_messages() {
34 33 self::add_tracking_request();
35 - self::remove_free_template_message();
34 + self::add_free_template_message();
36 35
37 36 $inbox = new FrmInbox();
38 37 $unread_messages = $inbox->get_messages();
39 38 $dismissed_messages = $unread_messages;
@@ -54,13 +53,12 @@
54 53 * @return void
55 54 */
56 55 public static function dismiss_message() {
57 56 check_ajax_referer( 'frm_ajax', 'nonce' );
58 - FrmAppHelper::permission_check( 'frm_view_forms' );
57 + FrmAppHelper::permission_check( 'frm_change_settings' );
59 58
60 59 $key = FrmAppHelper::get_param( 'key', '', 'post', 'sanitize_text_field' );
61 -
62 - if ( $key ) {
60 + if ( ! empty( $key ) ) {
63 61 $message = new FrmInbox();
64 62 $message->dismiss( $key );
65 63
66 64 if ( $key === 'review' ) {
@@ -83,21 +81,21 @@
83 81 * @return void
84 82 */
85 83 private static function add_tracking_request() {
86 84 $settings = FrmAppHelper::get_settings();
87 -
88 85 if ( $settings->tracking ) {
89 86 return;
90 87 }
91 88
92 - $link = admin_url( 'admin.php?page=formidable-settings&t=misc_settings' );
89 + $link = admin_url( 'admin.php?page=formidable-settings&t=misc_settings' );
90 +
93 91 $message = new FrmInbox();
94 92 $message->add_message(
95 93 array(
96 94 'key' => 'usage',
97 - '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
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>.',
98 96 'subject' => __( 'Help Formidable improve with usage tracking', 'formidable' ),
99 - '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
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>',
100 98 'type' => 'feedback',
101 99 )
102 100 );
103 101 }
@@ -108,11 +106,38 @@
108 106 * @since 4.10.03
109 107 *
110 108 * @return void
111 109 */
112 - private static function remove_free_template_message() {
113 - if ( ! FrmAppHelper::pro_is_installed() ) {
114 - $message = new FrmInbox();
115 - $message->dismiss( 'free_templates' );
110 + private static function add_free_template_message() {
111 + if ( FrmAppHelper::pro_is_installed() ) {
112 + return;
116 113 }
114 +
115 + $api = new FrmFormTemplateApi();
116 + if ( $api->has_free_access() ) {
117 + return;
118 + }
119 +
120 + $link = admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG . '&free-templates=1' );
121 +
122 + $message = new FrmInbox();
123 + $message->add_message(
124 + array(
125 + 'key' => 'free_templates',
126 + 'message' => 'Add your email address to get a code for 30+ free form templates.',
127 + 'subject' => 'Get 30+ Free Form Templates',
128 + '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>',
129 + 'type' => 'feedback',
130 + )
131 + );
132 + }
133 +
134 + /**
135 + * @since 4.06
136 + * @deprecated 6.16
137 + *
138 + * @return void
139 + */
140 + public static function dismiss_all_button( $atts ) {
141 + _deprecated_function( __METHOD__, '6.16' );
117 142 }
118 143 }