Skip to content

Commit e0a7188

Browse files
committed
Merge branch 'master' into paypal
2 parents 3f2f56f + 0b6dcbd commit e0a7188

25 files changed

+1777
-57
lines changed

classes/controllers/FrmAppController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public static function settings_link( $links ) {
396396
$settings[] = '<a href="' . esc_url( $upgrade_link ) . '" target="_blank" rel="noopener"><b style="color:#1da867;font-weight:700;">' . esc_html( $label ) . '</b></a>';
397397
}//end if
398398

399-
$settings[] = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable' ) ) . '">' . __( 'Build a Form', 'formidable' ) . '</a>';
399+
$settings[] = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable' ) ) . '">' . esc_html__( 'Build a Form', 'formidable' ) . '</a>';
400400

401401
return array_merge( $settings, $links );
402402
}

classes/controllers/FrmUsageController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ public static function add_schedules( $schedules = array() ) {
7878
* @return bool
7979
*/
8080
public static function tracking_allowed() {
81-
$settings = FrmAppHelper::get_settings();
82-
return $settings->tracking;
81+
return (bool) FrmAppHelper::get_settings()->tracking;
8382
}
8483

8584
/**

classes/helpers/FrmEntriesListHelper.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -278,18 +278,20 @@ protected function display_tablenav( $which ) {
278278
protected function extra_tablenav( $which ) {
279279
$form_id = FrmAppHelper::simple_get( 'form', 'absint' );
280280

281-
if ( $which === 'top' && ! $form_id ) {
282-
echo '<div class="alignleft actions">';
281+
if ( $which !== 'top' || $form_id ) {
282+
return;
283+
}
283284

284-
// Override the referrer to prevent it from being used for the screen options.
285-
echo '<input type="hidden" name="_wp_http_referer" value="" />';
285+
echo '<div class="alignleft actions">';
286286

287-
echo '<label for="form" class="screen-reader-text">' . esc_html__( 'Filter by form', 'formidable' ) . '</label>';
287+
// Override the referrer to prevent it from being used for the screen options.
288+
echo '<input type="hidden" name="_wp_http_referer" value="" />';
288289

289-
FrmFormsHelper::forms_dropdown( 'form', $form_id, array( 'blank' => __( 'View all forms', 'formidable' ) ) );
290-
submit_button( __( 'Filter', 'formidable' ), 'filter_action action', '', false, array( 'id' => 'post-query-submit' ) );
291-
echo '</div>';
292-
}
290+
echo '<label for="form" class="screen-reader-text">' . esc_html__( 'Filter by form', 'formidable' ) . '</label>';
291+
292+
FrmFormsHelper::forms_dropdown( 'form', $form_id, array( 'blank' => __( 'View all forms', 'formidable' ) ) );
293+
submit_button( __( 'Filter', 'formidable' ), 'filter_action action', '', false, array( 'id' => 'post-query-submit' ) );
294+
echo '</div>';
293295
}
294296

295297
/**
@@ -500,11 +502,11 @@ private function maybe_fix_column_name( $column_name ) {
500502
* @return void
501503
*/
502504
private function get_actions( &$actions, $item, $view_link ) {
503-
$actions['view'] = '<a href="' . esc_url( $view_link ) . '">' . __( 'View', 'formidable' ) . '</a>';
505+
$actions['view'] = '<a href="' . esc_url( $view_link ) . '">' . esc_html__( 'View', 'formidable' ) . '</a>';
504506

505507
if ( current_user_can( 'frm_delete_entries' ) ) {
506508
$delete_link = '?page=formidable-entries&frm_action=destroy&id=' . $item->id . '&form=' . $this->params['form'];
507-
$actions['delete'] = '<a href="' . esc_url( wp_nonce_url( $delete_link ) ) . '" class="submitdelete" data-frmverify="' . esc_attr__( 'Permanently delete this entry?', 'formidable' ) . '" data-frmverify-btn="frm-button-red">' . __( 'Delete', 'formidable' ) . '</a>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
509+
$actions['delete'] = '<a href="' . esc_url( wp_nonce_url( $delete_link ) ) . '" class="submitdelete" data-frmverify="' . esc_attr__( 'Permanently delete this entry?', 'formidable' ) . '" data-frmverify-btn="frm-button-red">' . esc_html__( 'Delete', 'formidable' ) . '</a>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
508510
}
509511

510512
$actions = apply_filters( 'frm_row_actions', $actions, $item );

classes/helpers/FrmFormsListHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,12 @@ private function get_actions( &$actions, $item, $edit_link ) {
429429
}
430430

431431
if ( current_user_can( 'frm_edit_forms' ) ) {
432-
$actions['frm_edit'] = '<a href="' . esc_url( $edit_link ) . '">' . __( 'Edit', 'formidable' ) . '</a>';
433-
$actions['frm_settings'] = '<a href="' . esc_url( '?page=formidable&frm_action=settings&id=' . $item->id ) . '">' . __( 'Settings', 'formidable' ) . '</a>';
432+
$actions['frm_edit'] = '<a href="' . esc_url( $edit_link ) . '">' . esc_html__( 'Edit', 'formidable' ) . '</a>';
433+
$actions['frm_settings'] = '<a href="' . esc_url( '?page=formidable&frm_action=settings&id=' . $item->id ) . '">' . esc_html__( 'Settings', 'formidable' ) . '</a>';
434434
}
435435

436436
$actions = array_merge( $actions, $new_actions );
437-
$actions['view'] = '<a href="' . esc_url( FrmFormsHelper::get_direct_link( $item->form_key, $item ) ) . '" target="_blank">' . __( 'Preview', 'formidable' ) . '</a>';
437+
$actions['view'] = '<a href="' . esc_url( FrmFormsHelper::get_direct_link( $item->form_key, $item ) ) . '" target="_blank">' . esc_html__( 'Preview', 'formidable' ) . '</a>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
438438
}
439439

440440
/**

classes/helpers/FrmListHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,11 @@ protected function pagination( $which ) {
655655

656656
if ( 'bottom' === $which ) {
657657
$html_current_page = $current;
658-
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page', 'formidable' ) . '</span><span id="table-paging" class="paging-input">';
658+
$total_pages_before = '<span class="screen-reader-text">' . esc_html__( 'Current Page', 'formidable' ) . '</span><span id="table-paging" class="paging-input">';
659659
} else {
660660
$html_current_page = sprintf(
661661
"%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' />",
662-
'<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page', 'formidable' ) . '</label>',
662+
'<label for="current-page-selector" class="screen-reader-text">' . esc_html__( 'Current Page', 'formidable' ) . '</label>',
663663
$current,
664664
strlen( $total_pages )
665665
);
@@ -967,7 +967,7 @@ public function print_column_headers( $with_id = true ) { // phpcs:ignore Slevom
967967

968968
if ( ! empty( $columns['cb'] ) ) {
969969
static $cb_counter = 1;
970-
$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'formidable' ) . '</label>';
970+
$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . esc_html__( 'Select All', 'formidable' ) . '</label>';
971971
$columns['cb'] .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />';
972972
++$cb_counter;
973973
}

classes/helpers/FrmXMLHelper.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -961,16 +961,18 @@ private static function update_custom_style_setting_on_import( &$form ) {
961961
private static function update_custom_style_setting_after_import( $form_id ) {
962962
$form = FrmForm::getOne( $form_id );
963963

964-
if ( $form && isset( $form->options['old_style'] ) ) {
965-
$form = (array) $form;
966-
$saved_style = $form['options']['custom_style'];
967-
$form['options']['custom_style'] = $form['options']['old_style'];
968-
self::update_custom_style_setting_on_import( $form );
969-
$has_changed = $form['options']['custom_style'] != $saved_style && $form['options']['custom_style'] != $form['options']['old_style']; // phpcs:ignore Universal.Operators.StrictComparisons, SlevomatCodingStandard.Files.LineLength.LineTooLong
964+
if ( ! $form || ! isset( $form->options['old_style'] ) ) {
965+
return;
966+
}
970967

971-
if ( $has_changed ) {
972-
FrmForm::update( $form['id'], $form );
973-
}
968+
$form = (array) $form;
969+
$saved_style = $form['options']['custom_style'];
970+
$form['options']['custom_style'] = $form['options']['old_style'];
971+
self::update_custom_style_setting_on_import( $form );
972+
$has_changed = $form['options']['custom_style'] != $saved_style && $form['options']['custom_style'] != $form['options']['old_style']; // phpcs:ignore Universal.Operators.StrictComparisons, SlevomatCodingStandard.Files.LineLength.LineTooLong
973+
974+
if ( $has_changed ) {
975+
FrmForm::update( $form['id'], $form );
974976
}
975977
}
976978

classes/models/FrmHoneypot.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ protected function get_option_key() {
3434
* @return bool
3535
*/
3636
private static function is_enabled() {
37-
$frm_settings = FrmAppHelper::get_settings();
38-
return $frm_settings->honeypot;
37+
return (bool) FrmAppHelper::get_settings()->honeypot;
3938
}
4039

4140
/**

classes/models/FrmNotification.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ public static function hook_emails_to_action() {
6363
* @return void
6464
*/
6565
private static function print_recipients( $atts ) {
66-
if ( apply_filters( 'frm_echo_emails', false ) ) {
67-
$sent_to = array_merge( (array) $atts['to_email'], (array) $atts['cc'], (array) $atts['bcc'] );
68-
$sent_to = array_filter( $sent_to );
69-
$temp = str_replace( '<', '&lt;', $sent_to );
70-
echo ' ' . FrmAppHelper::kses( implode( ', ', $temp ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
66+
if ( ! apply_filters( 'frm_echo_emails', false ) ) {
67+
return;
7168
}
69+
70+
$sent_to = array_merge( (array) $atts['to_email'], (array) $atts['cc'], (array) $atts['bcc'] );
71+
$sent_to = array_filter( $sent_to );
72+
$temp = str_replace( '<', '&lt;', $sent_to );
73+
echo ' ';
74+
FrmAppHelper::kses_echo( implode( ', ', $temp ) );
7275
}
7376
}

classes/models/FrmPluginSearch.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,14 @@ public function insert_related_links( $links, $plugin ) {
324324
),
325325
admin_url( 'plugins.php' )
326326
);
327-
$links['frm_get_started'] = '<a href="' . esc_url( $activate_url ) . '" class="button activate-now" aria-label="Activate ' . esc_attr( $plugin['name'] ) . '">' . __( 'Activate', 'formidable' ) . '</a>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
327+
$links['frm_get_started'] = '<a href="' . esc_url( $activate_url ) . '" class="button activate-now" aria-label="Activate ' . esc_attr( $plugin['name'] ) . '">' . esc_html__( 'Activate', 'formidable' ) . '</a>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
328328
}
329329
} elseif ( ! $is_active && isset( $plugin['url'] ) ) {
330330
// Go to the add-ons page to install.
331331
$links[] = '<a
332332
class="button-secondary"
333333
href="' . esc_url( admin_url( 'admin.php?page=formidable-addons' ) ) . '"
334-
>' . __( 'Install Now', 'formidable' ) . '</a>';
334+
>' . esc_html__( 'Install Now', 'formidable' ) . '</a>';
335335
} elseif ( ! empty( $plugin['link'] ) ) {
336336
// Add link pointing to a relevant doc page in formidable.com.
337337
$links[] = '<a

classes/models/FrmSettings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class FrmSettings {
174174
public $current_form = 0;
175175

176176
/**
177-
* @var bool
177+
* @var bool|int
178178
*/
179179
public $tracking;
180180

@@ -211,7 +211,7 @@ class FrmSettings {
211211
public $custom_css;
212212

213213
/**
214-
* @var string
214+
* @var int
215215
*/
216216
public $honeypot;
217217

0 commit comments

Comments
 (0)