PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.13
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.13
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/helpers/FrmFormTemplatesHelper.php +3 -67 6.26.1 → 6.13 View file →
@@ -21,10 +21,8 @@
21 21 *
22 22 * @param array $template Template data.
23 23 * @param string $pricing Upgrade link URL.
24 24 * @param string $license_type License type.
25 - *
26 - * @return void
27 25 */
28 26 public static function prepare_template_details( &$template, $pricing, $license_type ) {
29 27 $template['is_featured'] = ! empty( $template['is_featured'] );
30 28 $template['is_favorite'] = ! empty( $template['is_favorite'] );
@@ -30,12 +28,8 @@
30 28 $template['is_favorite'] = ! empty( $template['is_favorite'] );
31 29 $template['is_custom'] = ! empty( $template['is_custom'] );
32 30 $template['plan_required'] = FrmFormsHelper::get_plan_required( $template );
33 31
34 - if ( self::needs_free_plan( $template ) ) {
35 - $template['plan_required'] = 'free';
36 - }
37 -
38 32 if ( ! empty( $template['name'] ) ) {
39 33 $template['name'] = $template['is_custom'] ? $template['name'] : preg_replace( '/(\sForm)?(\sTemplate)?$/', '', $template['name'] );
40 34 } else {
41 35 $template['name'] = '';
@@ -41,9 +35,8 @@
41 35 $template['name'] = '';
42 36 }
43 37
44 38 $template['use_template'] = '#';
45 -
46 39 if ( $template['is_custom'] ) {
47 40 $template['use_template'] = $template['url'];
48 41 } elseif ( ! $template['plan_required'] ) {
49 42 $link = FrmFormsHelper::get_template_install_link( $template, compact( 'pricing', 'license_type' ) );
@@ -58,9 +51,8 @@
58 51 * @since 6.7
59 52 *
60 53 * @param array $template The template data.
61 54 * @param bool $expired Whether the API request is expired or not.
62 - *
63 55 * @return void
64 56 */
65 57 public static function add_template_attributes( $template, $expired ) {
66 58 $attributes = array(
@@ -90,22 +82,18 @@
90 82 *
91 83 * @since 6.7
92 84 *
93 85 * @param array $template The template data.
94 - *
95 86 * @return string
96 87 */
97 88 private static function prepare_single_template_classes( $template ) {
98 89 $class_names = array( 'frm-card-item' );
99 -
100 90 if ( $template['is_featured'] ) {
101 91 $class_names[] = 'frm-form-templates-featured-item';
102 92 }
103 -
104 93 if ( $template['is_favorite'] ) {
105 94 $class_names[] = 'frm-form-templates-favorite-item';
106 95 }
107 -
108 96 if ( $template['is_custom'] ) {
109 97 $class_names[] = 'frm-form-templates-custom-item';
110 98 }
111 99
@@ -119,9 +107,8 @@
119 107 *
120 108 * @param array $template The template data.
121 109 * @param bool $expired Whether the license is expired.
122 110 * @param array $attributes The template attributes.
123 - *
124 111 * @return void
125 112 */
126 113 private static function prepare_single_template_plan( $template, $expired, &$attributes ) {
127 114 if ( ! $template['plan_required'] ) {
@@ -129,9 +116,8 @@
129 116 }
130 117
131 118 $required_plan_slug = sanitize_title( $template['plan_required'] );
132 119 $attributes['data-required-plan'] = $expired && 'free' !== $required_plan_slug ? 'renew' : $required_plan_slug;
133 -
134 120 if ( 'free' === $required_plan_slug ) {
135 121 $attributes['data-key'] = $template['key'];
136 122 }
137 123
@@ -143,9 +129,8 @@
143 129 *
144 130 * @since 6.7
145 131 *
146 132 * @param array $template The template data.
147 - *
148 133 * @return void
149 134 */
150 135 public static function add_template_link_attributes( $template ) {
151 136 $attributes = array(
@@ -177,9 +162,8 @@
177 162 *
178 163 * @type string $upgrade_link Upgrade link URL.
179 164 * @type string $renew_link Renew link URL.
180 165 * }
181 - *
182 166 * @return void
183 167 */
184 168 public static function show_upgrade_renew_cta( $args ) {
185 169 // Show 'renew' banner for expired users.
@@ -199,67 +183,19 @@
199 183 // Show 'upgrade' banner for non-elite users.
200 184 if ( ! in_array( FrmAddonsController::license_type(), array( 'elite', 'business' ), true ) ) {
201 185 FrmTipsHelper::show_admin_cta(
202 186 array(
203 - 'class' => 'frm-gradient',
204 - 'icon' => 'frmfont frm_speaker_icon',
205 187 'title' => sprintf(
206 188 /* translators: %1$s: Open span tag, %2$s: Close span tag */
207 - esc_html__( 'Upgrade to get all %1$s%2$s templates', 'formidable' ),
189 + esc_html__( 'Get Super Powers with %1$s%2$s More Pre-built Forms', 'formidable' ) . ' 🦸',
208 190 '<span class="frm-form-templates-extra-templates-count">',
209 191 '</span>'
210 192 ),
211 - 'description' => esc_html__( 'Upgrade to PRO to get access to all of our templates and unlock the full potential of your forms.', 'formidable' ),
212 - 'link_text' => esc_html__( 'Get More Templates', 'formidable' ),
193 + 'description' => esc_html__( 'Unleash the potential of hundreds of additional form templates and save precious time. Upgrade today for unparalleled form-building capabilities.', 'formidable' ),
194 + 'link_text' => esc_html__( 'Upgrade to PRO', 'formidable' ),
213 195 'link_url' => $args['upgrade_link'],
214 196 'id' => 'frm-upgrade-banner',
215 197 )
216 198 );
217 199 }
218 - }
219 -
220 - /**
221 - * Echo the get free templates banner.
222 - *
223 - * @since 6.25
224 - *
225 - * @return void
226 - */
227 - public static function echo_get_free_templates_banner() {
228 - $args = array(
229 - 'direction' => 'vertical',
230 - );
231 -
232 - ?>
233 - <div class="frm-card-item frm-px-sm">
234 - <?php require FrmAppHelper::plugin_path() . '/classes/views/shared/get-free-templates-banner.php'; ?>
235 - </div>
236 - <?php
237 - }
238 -
239 - /**
240 - * Checks if the get free templates banner should be displayed.
241 - *
242 - * @since 6.25
243 - *
244 - * @return bool
245 - */
246 - public static function needs_get_free_templates_banner() {
247 - return ! FrmAppHelper::pro_is_installed() && ! FrmFormTemplateApi::get_free_license_code();
248 - }
249 -
250 - /**
251 - * Checks if a template needs the free plan override.
252 - *
253 - * @since 6.25
254 - *
255 - * @param array $template The template data.
256 - *
257 - * @return bool
258 - */
259 - private static function needs_free_plan( $template ) {
260 - return self::needs_get_free_templates_banner()
261 - && ! empty( $template['category_slugs'] )
262 - && in_array( 'free', $template['category_slugs'], true )
263 - && ! in_array( $template['id'], FrmFormTemplatesController::FREE_TEMPLATES_IDS, true );
264 200 }
265 201 }