Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions classes/controllers/FrmAddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ protected static function prepare_addon_link( &$link ) {
$link = $site_url . $link;
}

$link = FrmAppHelper::make_affiliate_url( $link );
$link = FrmAppHelper::make_affiliate_url( $link );

$utm = array(
'campaign' => 'addons',
Expand Down Expand Up @@ -1053,7 +1053,6 @@ protected static function maybe_show_cred_form() {
if ( $show_form ) {
$form = ob_get_clean();
$message = __( 'Sorry, your site requires FTP authentication. Please download plugins from FormidableForms.com and install them manually.', 'formidable' );
$data = $form;
$response = array(
'success' => false,
'message' => $message,
Expand Down
2 changes: 1 addition & 1 deletion classes/controllers/FrmFormTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ private static function organize_and_set_categories() {
'count' => 0,
);
}
$special_categories['all-items'] = array(
$special_categories['all-items'] = array(
'name' => __( 'All Templates', 'formidable' ),
'count' => self::get_template_count(),
);
Expand Down
7 changes: 3 additions & 4 deletions classes/controllers/FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ private static function get_css_version( $css_key, $version ) {
*/
public static function add_tags_to_css( $tag, $handle ) {
if ( ( 'formidable' === $handle || 'jquery-theme' === $handle ) && strpos( $tag, ' property=' ) === false ) {
$frm_settings = FrmAppHelper::get_settings();
$tag = str_replace( ' type="', ' property="stylesheet" type="', $tag );
$tag = str_replace( ' type="', ' property="stylesheet" type="', $tag );
}

return $tag;
Expand Down Expand Up @@ -345,7 +344,7 @@ public static function load_styler() {
$style_id = self::get_style_id_for_styler();

if ( ! $style_id ) {
$error_args = array(
$error_args = array(
'title' => __( 'No styles', 'formidable' ),
'body' => __( 'You must have a style to use the Visual Styler.', 'formidable' ),
'cancel_url' => admin_url( 'admin.php?page=formidable' ),
Expand All @@ -363,7 +362,7 @@ public static function load_styler() {
$form = FrmForm::getOne( $form_id );

if ( ! is_object( $form ) ) {
$error_args = array(
$error_args = array(
'title' => __( 'No forms', 'formidable' ),
'body' => __( 'You must have a form to use the Visual Styler.', 'formidable' ),
'cancel_url' => admin_url( 'admin.php?page=formidable' ),
Expand Down
2 changes: 1 addition & 1 deletion classes/controllers/FrmXMLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ public static function get_parent_terms_slugs( $terms ) {
return $parent_slugs;
}

$results = FrmDb::get_results( 'terms', array( 'term_id' => $parent_term_ids ), 'term_id, slug' );
$results = FrmDb::get_results( 'terms', array( 'term_id' => $parent_term_ids ), 'term_id, slug' );

return wp_list_pluck( $results, 'slug', 'term_id' );
}
Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public static function is_form_builder_page( $check_for_settings = true ) {
* @return bool
*/
public static function is_formidable_admin() {
$page = self::simple_get( 'page', 'sanitize_title' );
$page = self::simple_get( 'page', 'sanitize_title' );

if ( empty( $page ) ) {
return self::is_view_builder_page();
Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmCSVExportHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ private static function has_parent_id() {
*/
private static function prepare_next_csv_rows( $next_set ) {
if ( FrmAppHelper::pro_is_installed() ) {
$where = array(
$where = array(
'or' => 1,
'id' => $next_set,
'parent_item_id' => $next_set,
Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmDashboardHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public static function show_connect_links( $buttons = array(), $button_classes =
$buttons = self::get_license_buttons();
}

foreach ( $buttons as $i => $button ) {
foreach ( $buttons as $button ) {
$add_classes = ! empty( $button['classes'] ) ? ' ' . $button['classes'] : ' frm-button-secondary';
?>
<a href="<?php echo esc_url( $button['link'] ); ?>" target="_blank"
Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmEntriesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public static function get_posted_value( $field, &$value, $args ) {
$field_id = $field['id'];
$field_obj = FrmFieldFactory::get_field_object( $field['id'] );
} elseif ( is_object( $field ) ) {
$field_id = $field->id;
$field_id = $field->id;

if ( 'hidden' === $field->type && ! empty( $field->field_options['original_type'] ) ) {
$field_obj = FrmFieldFactory::get_field_type( $field->field_options['original_type'], $field );
Expand Down
6 changes: 3 additions & 3 deletions classes/helpers/FrmFormsListHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct( $args ) {
* @return void
*/
public function prepare_items() {
global $wpdb, $per_page, $mode;
global $per_page, $mode;

$page = $this->get_pagenum();
$per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' );
Expand All @@ -53,7 +53,7 @@ public function prepare_items() {

FrmAppController::apply_saved_sort_preference( $orderby, $order );

$start = self::get_param(
$start = self::get_param(
array(
'param' => 'start',
'default' => ( $page - 1 ) * $per_page,
Expand Down Expand Up @@ -237,7 +237,7 @@ public function pagination( $which ) {
* @return string
*/
public function single_row( $item, $style = '' ) {
global $frm_vars, $mode;
global $mode;

// Set up the hover actions for this user
$actions = array();
Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmHtmlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function echo_unit_input( $args = array() ) {
}
}

$input_number_attrs = array_merge(
$input_number_attrs = array_merge(
$args['input_number_attrs'],
array(
'type' => ! empty( $selected_unit ) ? 'number' : 'text',
Expand Down
4 changes: 2 additions & 2 deletions classes/models/FrmCreateFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ class FrmCreateFile {
/**
* @var int
*/
public $chmod_dir = 0755;
public $chmod_dir = 0755;

/**
* @var int
*/
public $chmod_file = 0644;
public $chmod_file = 0644;

/**
* @var bool
Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmField.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FrmField {
/**
* @var bool
*/
public static $use_cache = true;
public static $use_cache = true;

/**
* @var int
Expand Down
2 changes: 0 additions & 2 deletions classes/models/FrmForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,6 @@ public static function get_published_forms( $query = array(), $limit = 999, $inc
* @return object count of forms
*/
public static function get_count() {
global $wpdb;

$cache_key = 'frm_form_counts';

$counts = wp_cache_get( $cache_key, 'frm_form' );
Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmFormAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ public static function get_action_for_form( $form_id, $type = 'all', $atts = arr
* @return int The filtered limit value.
*/
public static function get_action_limit( $form_id, $limit = 99 ) {
$type = 'all';
$type = 'all';
return (int) apply_filters( 'frm_form_action_limit', (int) $limit, compact( 'type', 'form_id' ) );
}

Expand Down
4 changes: 2 additions & 2 deletions classes/models/FrmFormMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract class FrmFormMigrator {
/**
* @var array
*/
protected $fields_map = array();
protected $fields_map = array();

/**
* @var mixed
Expand All @@ -48,7 +48,7 @@ abstract class FrmFormMigrator {
/**
* @var array
*/
protected $current_section = array();
protected $current_section = array();

/**
* Define required properties.
Expand Down
2 changes: 1 addition & 1 deletion classes/models/fields/FrmFieldName.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public function show_after_default( $args ) {

$show_warning = false;

foreach ( $this->sub_fields as $name => $sub_field ) {
foreach ( $this->sub_fields as $sub_field ) {
$description = FrmField::get_option( $field, $sub_field['name'] . '_desc' );

if ( in_array( $description, array( 'First', 'Last' ), true ) ) {
Expand Down
2 changes: 1 addition & 1 deletion classes/models/fields/FrmFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ protected function auto_width_setting( $args ) {
* @return array
*/
public function get_new_field_defaults() {
$field = array(
$field = array(
'name' => $this->get_new_field_name(),
'description' => '',
'type' => $this->type,
Expand Down
2 changes: 0 additions & 2 deletions classes/views/frm-entries/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@
FrmFieldsHelper::show_fields( $fields_to_show, $errors, $form, $form_action );
}//end if

$frm_settings = FrmAppHelper::get_settings();

if ( FrmAppHelper::is_admin() && ( ! isset( $_GET['action'] ) || 'elementor' !== $_GET['action'] ) ) {
?>
<div class="frm_form_field form-field">
Expand Down
2 changes: 1 addition & 1 deletion classes/views/frm-fields/back-end/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
if ( FrmAppHelper::pro_is_connected() && ! is_callable( array( 'FrmProHtmlHelper', 'echo_radio_group' ) ) ) {
switch ( $type ) {
case 'calc':
$default_value_type['data'] = array(
$default_value_type['data'] = array(
'show' => '#calc-for-{id}',
'disable' => '#default-value-for-{id}',
);
Expand Down
2 changes: 1 addition & 1 deletion classes/views/frm-form-actions/_action_inside.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<?php

if ( ! isset( $action_control->action_options['event'] ) ) {
$events = 'create';
$action_control->action_options['event'] = 'create';
}

if ( ! is_array( $action_control->action_options['event'] ) ) {
Expand Down
1 change: 0 additions & 1 deletion classes/views/frm-form-actions/_email_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
$selected_style = 'plain';
}

$frm_settings = FrmAppHelper::get_settings();
$default_style = FrmEmailStylesController::get_default_email_style();
?>
<p class="frm-email-style-container">
Expand Down
1 change: 0 additions & 1 deletion classes/views/frm-settings/email/email-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
}

$email_styles = FrmEmailStylesController::get_email_styles();
$frm_settings = FrmAppHelper::get_settings();
$selected_style = FrmEmailStylesController::get_default_email_style();
?>
<p><?php esc_html_e( 'Customize your email template and sending preferences.', 'formidable' ); ?></p>
Expand Down
1 change: 0 additions & 1 deletion classes/views/summary-emails/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
die( 'You are not allowed to call this page directly.' );
}

$frm_settings = FrmAppHelper::get_settings();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Expand Down
1 change: 0 additions & 1 deletion classes/views/xml/posts_xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
}

$frm_inc_tax[] = $term->term_id;
$label = 'category' === $term->taxonomy || 'tag' === $term->taxonomy ? $term->taxonomy : 'term';
?>
<term><term_id><?php echo esc_html( $term->term_id ); ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php
if ( ! empty( $parent_slugs[ $term->parent ] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion square/controllers/FrmSquareLiteActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public static function load_scripts( $form_id ) {
false
);

$square_vars = array(
$square_vars = array(
'formId' => $form_id,
'nonce' => wp_create_nonce( 'frm_square_ajax' ),
'ajax' => esc_url_raw( FrmAppHelper::get_ajax_url() ),
Expand Down
2 changes: 1 addition & 1 deletion stripe/controllers/FrmStrpLiteActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public static function before_save_settings( $settings, $action ) {

// Gateway is a radio button but it should always be an array in the database for
// compatibility with the payments submodule where it is a checkbox.
$settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );
$settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );

$is_stripe = in_array( 'stripe', $settings['gateway'], true );

Expand Down
2 changes: 1 addition & 1 deletion stripe/controllers/FrmTransLiteActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ function () use ( $entry_id, &$destroy_callback ) {
* @return array
*/
public static function before_save_settings( $settings, $action ) {
$settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );
$settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );

if ( in_array( 'square', $settings['gateway'] ) ) {
$currency = FrmSquareLiteConnectHelper::get_merchant_currency();
Expand Down
2 changes: 1 addition & 1 deletion stripe/helpers/FrmStrpLiteConnectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ public static function create_plan( $plan ) {
* @return bool
*/
public static function update_intent( $intent_id, $data ) {
$data = self::post_with_authenticated_body( 'update_intent', compact( 'intent_id', 'data' ) );
$data = self::post_with_authenticated_body( 'update_intent', compact( 'intent_id', 'data' ) );
return false !== $data;
}

Expand Down
1 change: 0 additions & 1 deletion stripe/helpers/FrmTransLiteListHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ private function get_form_id_column( $item, $atts ) {
* @return string
*/
private function get_user_id_column( $item ) {
global $wpdb;
$val = FrmDb::get_var( 'frm_items', array( 'id' => $item->item_id ), 'user_id' );
return FrmTransLiteAppHelper::get_user_link( $val );
}
Expand Down
5 changes: 4 additions & 1 deletion stripe/models/FrmStrpLiteAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,10 @@ public static function get_referer_url( $entry_id, $delete_meta = true ) {
return false;
}

self::delete_temporary_referer_meta( (int) $row->id );
if ( $delete_meta ) {
self::delete_temporary_referer_meta( (int) $row->id );
}

return $meta['referer'];
}

Expand Down
2 changes: 0 additions & 2 deletions tests/phpunit/fields/test_FrmFieldValidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ public function test_empty_required_fields() {
$error_fields = array();

if ( ! empty( $errors ) ) {
$error_field_ids = array_keys( $errors );

foreach ( $fields as $field ) {
if ( ! isset( $errors[ 'field' . $field->id ] ) ) {
$error_fields[] = $field->type;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/forms/test_FrmForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function test_destroy() {
continue;
}

$id = FrmForm::destroy( $form->id );
FrmForm::destroy( $form->id );
$form_exists = FrmForm::getOne( $form->id );
$this->assertEmpty( $form_exists, 'Failed to delete form ' . $form->form_key );

Expand Down
2 changes: 0 additions & 2 deletions tests/phpunit/misc/test_FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,6 @@ private function assert_output_not_contains( $output, $substring, $message = ''
* @covers FrmAppHelper::get_unique_key
*/
public function test_get_unique_key() {
global $wpdb;

// Test field keys
$table_name = 'frm_fields';
$column = 'field_key';
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/misc/test_FrmDirectFileAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private function all_php_file_paths( $dir = false, &$results = array() ) {
$files_to_ignore = array( 'set-php-version.php', 'stubs.php', '.php-cs-fixer.php', 'rector.php' );
$folders_to_ignore = array( 'tests', 'vendor', 'languages', 'node_modules', 'js', 'phpcs-sniffs' );

foreach ( $files as $key => $value ) {
foreach ( $files as $value ) {
$path = realpath( $dir . DIRECTORY_SEPARATOR . $value );

if ( ! is_dir( $path ) ) {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/stripe/FrmStrpLiteUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ protected function get_simple_stripe_action() {
*/
protected function maybe_create_plan() {
$this->get_customer();
$plan = $this->get_plan_options();
$plan = $this->get_plan_options();
return FrmStrpLiteSubscriptionHelper::maybe_create_plan( $plan );
}
}
1 change: 0 additions & 1 deletion tests/phpunit/styles/test_FrmStylesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public function test_get_form_count_for_style() {
$default_count = 0;

foreach ( $data_for_all_published_forms as $row ) {
$form_id = $row->id;
$options = $row->options;
FrmAppHelper::unserialize_or_decode( $options );

Expand Down