PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.16
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.16
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/FrmFormActionsController.php +6 -96 6.256.16 View file →
@@ -72,9 +72,8 @@
72 72 'googlespreadsheet' => 'FrmDefGoogleSpreadsheetAction',
73 73 );
74 74
75 75 $action_classes = apply_filters( 'frm_registered_form_actions', $action_classes );
76 - $action_classes = self::maybe_unset_highrise( $action_classes );
77 76
78 77 include_once FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php';
79 78 include_once FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php';
80 79
@@ -83,23 +82,8 @@
83 82 }
84 83 }
85 84
86 85 /**
87 - * Remove the Highrise action if it is not registered.
88 - *
89 - * @since 6.23
90 - *
91 - * @param array $action_classes
92 - * @return array
93 - */
94 - private static function maybe_unset_highrise( $action_classes ) {
95 - if ( 'FrmDefHighriseAction' === ( $action_classes['highrise'] ?? '' ) ) {
96 - unset( $action_classes['highrise'] );
97 - }
98 - return $action_classes;
99 - }
100 -
101 - /**
102 86 * @since 4.0
103 87 *
104 88 * @param array $values
105 89 */
@@ -183,15 +167,18 @@
183 167 'constantcontact',
184 168 'getresponse',
185 169 'aweber',
186 170 'mailpoet',
187 - 'convertkit',
188 171 ),
189 172 ),
190 173 'crm' => array(
191 174 'name' => __( 'CRM', 'formidable' ),
192 175 'icon' => 'frm_icon_font frm_address_card_icon',
193 - 'actions' => self::get_crm_actions(),
176 + 'actions' => array(
177 + 'salesforce',
178 + 'hubspot',
179 + 'highrise',
180 + ),
194 181 ),
195 182 );
196 183
197 184 return apply_filters( 'frm_action_groups', $groups );
@@ -197,30 +184,8 @@
197 184 return apply_filters( 'frm_action_groups', $groups );
198 185 }
199 186
200 187 /**
201 - * Get the actions to include in the CRM section.
202 - *
203 - * @since 6.23
204 - *
205 - * @return array
206 - */
207 - private static function get_crm_actions() {
208 - $crm_actions = array(
209 - 'salesforce',
210 - 'hubspot',
211 - );
212 -
213 - // Only include Highrise when the add-on is active.
214 - // This is because Highrise is deprecated. We don't want to show it in Lite.
215 - if ( class_exists( 'FrmHrsSettings' ) ) {
216 - $crm_actions[] = 'highrise';
217 - }
218 -
219 - return $crm_actions;
220 - }
221 -
222 - /**
223 188 * Get the number of currently active form actions.
224 189 *
225 190 * @since 4.0
226 191 *
@@ -350,10 +315,8 @@
350 315 foreach ( $action_controls as $key => $control ) {
351 316 $action_map[ $control->id_base ] = $key;
352 317 }
353 318
354 - self::maybe_show_limit_warning( $form->id, $form_actions );
355 -
356 319 foreach ( $form_actions as $action ) {
357 320 if ( ! isset( $action_map[ $action->post_excerpt ] ) ) {
358 321 // don't try and show settings if action no longer exists
359 322 continue;
@@ -362,42 +325,8 @@
362 325 self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values );
363 326 }
364 327 }
365 328
366 - /**
367 - * Show a warning before the form actions list if there are 99 actions, and the limit is set to 99.
368 - * If it is filtered, the warning is still shown when applicable, just using the new limit.
369 - *
370 - * @since 6.17
371 - *
372 - * @param int|string $form_id
373 - * @param array $form_actions
374 - * @return void
375 - */
376 - private static function maybe_show_limit_warning( $form_id, $form_actions ) {
377 - $count = count( $form_actions );
378 - if ( $count < 99 ) {
379 - return;
380 - }
381 -
382 - $limit = FrmFormAction::get_action_limit( $form_id );
383 - if ( $limit < 99 || $count < $limit ) {
384 - return;
385 - }
386 -
387 - $documentation_url = 'https://formidableforms.com/knowledgebase/frm_form_action_limit/#kb-increase-limit-of-form-actions';
388 -
389 - echo '<div class="frm_warning_style">';
390 - FrmAppHelper::icon_by_class( 'frm_icon_font frm_alert_icon' );
391 - echo '&nbsp;';
392 - printf(
393 - // translators: %s: URL to documentation
394 - esc_html__( 'You have reached your form action limit. To increase this limit, you will require additional code. Visit our documentation at %s.', 'formidable' ),
395 - '<a href="' . esc_url( $documentation_url ) . '" target="_blank">' . esc_html( $documentation_url ) . '</a>'
396 - );
397 - echo '</div>';
398 - }
399 -
400 329 public static function action_control( $form_action, $form, $action_key, $action_control, $values ) {
401 330 $action_control->_set( $action_key );
402 331
403 332 $use_logging = self::should_show_log_message( $form_action->post_excerpt );
@@ -583,11 +512,8 @@
583 512 return;
584 513 }
585 514
586 515 FrmForm::maybe_get_form( $form );
587 - if ( ! is_object( $form ) ) {
588 - return;
589 - }
590 516
591 517 $link_settings = self::get_form_actions( $type );
592 518 if ( 'all' !== $type ) {
593 519 $link_settings = array( $type => $link_settings );
@@ -617,9 +543,9 @@
617 543 if ( empty( $entry ) || ( FrmEntriesHelper::DRAFT_ENTRY_STATUS === (int) $entry->is_draft && 'draft' !== $event ) ) {
618 544 continue;
619 545 }
620 546
621 - $child_entry = ( is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( $entry->form_id != $form->id || $entry->parent_item_id ) ) || ! empty( $args['is_child'] );
547 + $child_entry = ( ( is_object( $form ) && is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( $entry->form_id != $form->id || $entry->parent_item_id ) ) || ( isset( $args['is_child'] ) && $args['is_child'] ) );
622 548
623 549 if ( $child_entry ) {
624 550 // maybe trigger actions for sub forms
625 551 $trigger_children = apply_filters( 'frm_use_embedded_form_actions', false, compact( 'form', 'entry' ) );
@@ -700,24 +626,8 @@
700 626
701 627 $where .= $wpdb->prepare( ' AND post_excerpt = %s ', $frm_vars['action_type'] );
702 628
703 629 return $where;
704 - }
705 -
706 - /**
707 - * Prevent WPML from filtering form actions based on the active language.
708 - *
709 - * @since 6.20
710 - *
711 - * @param bool|null $null
712 - * @param string $post_type
713 - * @return bool|null
714 - */
715 - public static function prevent_wpml_translations( $null, $post_type ) {
716 - if ( self::$action_post_type === $post_type ) {
717 - return false;
718 - }
719 - return $null;
720 630 }
721 631 }
722 632
723 633 class Frm_Form_Action_Factory {