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 +36 -11 6.336.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' ) {
@@ -82,20 +80,22 @@
82 80 *
83 81 * @return void
84 82 */
85 83 private static function add_tracking_request() {
86 - if ( FrmAppHelper::get_settings()->tracking ) {
84 + $settings = FrmAppHelper::get_settings();
85 + if ( $settings->tracking ) {
87 86 return;
88 87 }
89 88
90 - $link = admin_url( 'admin.php?page=formidable-settings&t=misc_settings' );
89 + $link = admin_url( 'admin.php?page=formidable-settings&t=misc_settings' );
90 +
91 91 $message = new FrmInbox();
92 92 $message->add_message(
93 93 array(
94 94 '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
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>.',
96 96 '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
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>',
98 98 'type' => 'feedback',
99 99 )
100 100 );
101 101 }
@@ -106,13 +106,38 @@
106 106 * @since 4.10.03
107 107 *
108 108 * @return void
109 109 */
110 - private static function remove_free_template_message() {
110 + private static function add_free_template_message() {
111 111 if ( FrmAppHelper::pro_is_installed() ) {
112 112 return;
113 113 }
114 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 +
115 122 $message = new FrmInbox();
116 - $message->dismiss( 'free_templates' );
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 }