Skip to content
Merged
10 changes: 5 additions & 5 deletions classes/controllers/FrmAddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static function menu() {

add_submenu_page( 'formidable', 'Formidable | ' . __( 'Add-Ons', 'formidable' ), $label, 'frm_view_forms', 'formidable-addons', 'FrmAddonsController::list_addons' );

// remove default created subpage, make the page with highest priority as default.
// Remove default created subpage, make the page with highest priority as default.
remove_submenu_page( 'formidable', 'formidable' );

if ( ! FrmAppHelper::pro_is_installed() ) {
Expand Down Expand Up @@ -451,7 +451,7 @@ public static function get_pro_license() {
}

if ( str_contains( $license, '-' ) ) {
// this is a fix for licenses saved in the past
// This is a fix for licenses saved in the past
$license = strtoupper( $license );
}

Expand Down Expand Up @@ -571,7 +571,7 @@ public static function check_update( $transient ) {
}

if ( ! self::is_installed( $folder ) ) {
// don't show an update if the plugin isn't installed
// Don't show an update if the plugin isn't installed
continue;
}

Expand Down Expand Up @@ -634,7 +634,7 @@ protected static function fill_update_addon_info( $installed_addons ) {

foreach ( $installed_addons as $addon ) {
if ( $addon->store_url !== 'https://formidableforms.com' ) {
// check if this is a third-party addon
// Check if this is a third-party addon
continue;
}

Expand All @@ -661,7 +661,7 @@ protected static function fill_update_addon_info( $installed_addons ) {
$download_id = $plugin['id'] ?? 0;

if ( $download_id && ! isset( $version_info[ $download_id ]['package'] ) ) {
// if this addon is using its own license, get the update url
// If this addon is using its own license, get the update url
$addon_info = $api->get_api_info();

$version_info[ $download_id ] = $addon_info[ $download_id ];
Expand Down
4 changes: 2 additions & 2 deletions classes/controllers/FrmAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public static function admin_init() {
}

if ( ! FrmAppHelper::doing_ajax() ) {
// don't continue during ajax calls
// Don't continue during ajax calls
self::admin_js();
}

Expand Down Expand Up @@ -1167,7 +1167,7 @@ public static function network_upgrade_site( $blog_id = 0 ) {
}

if ( $response->is_error() ) {
// if the remove post fails, use javascript instead
// If the remove post fails, use javascript instead
add_action( 'admin_notices', 'FrmAppController::install_js_fallback' );
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/controllers/FrmApplicationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static function get_applications_data() {
if ( 'applications' !== $view ) {
FrmAppHelper::permission_check( self::get_required_capability() );

// view may be 'applications', 'templates', or empty.
// View may be 'applications', 'templates', or empty.
$data['templates'] = self::get_prepared_template_data();
$data['categories'] = FrmApplicationTemplate::get_categories();
} else {
Expand Down
2 changes: 1 addition & 1 deletion classes/controllers/FrmDashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ private static function inbox_prepare_messages( $data ) {
* @return string
*/
private static function inbox_clean_messages_cta( $cta ) {
// remove dismiss button
// Remove dismiss button
$pattern = '/<a[^>]*class="[^"]*frm_inbox_dismiss[^"]*"[^>]*>.*?<\/a>/is';
return preg_replace( $pattern, ' ', $cta );
}
Expand Down
8 changes: 4 additions & 4 deletions classes/controllers/FrmFieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function load_field() {
$field = json_decode( $field );

if ( ! isset( $field->id ) || ! is_numeric( $field->id ) ) {
// this field may have already been loaded
// This field may have already been loaded
continue;
}

Expand Down Expand Up @@ -73,7 +73,7 @@ public static function create() {

$field = self::include_new_field( $field_type, $form_id, $field_options );

// this hook will allow for multiple fields to be added at once
// This hook will allow for multiple fields to be added at once
do_action( 'frm_after_field_created', $field, $form_id );

wp_die();
Expand Down Expand Up @@ -625,7 +625,7 @@ private static function add_html_cols( $field, array &$add_html ) {
'em' => 0.544,
);

// include "col" for valid html
// Include "col" for valid html
$unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) );

if ( ! isset( $calc[ $unit ] ) ) {
Expand Down Expand Up @@ -684,7 +684,7 @@ private static function add_html_placeholder( $field, array &$add_html, array &$

// phpcs:ignore Universal.Operators.StrictComparisons
if ( $field['placeholder'] == '' || is_array( $field['placeholder'] ) ) {
// don't include a json placeholder
// Don't include a json placeholder
return;
}

Expand Down
6 changes: 3 additions & 3 deletions classes/controllers/FrmFormActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public static function list_actions( $form, $values ) {

foreach ( $form_actions as $action ) {
if ( ! isset( $action_map[ $action->post_excerpt ] ) ) {
// don't try and show settings if action no longer exists
// Don't try and show settings if action no longer exists
continue;
}

Expand Down Expand Up @@ -695,7 +695,7 @@ public static function trigger_actions( $event, $form, $entry, $type = 'all', $a
$child_entry = ( is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( (int) $entry->form_id !== (int) $form->id || $entry->parent_item_id ) ) || ! empty( $args['is_child'] ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong

if ( $child_entry ) {
// maybe trigger actions for sub forms
// Maybe trigger actions for sub forms
$trigger_children = apply_filters( 'frm_use_embedded_form_actions', false, compact( 'form', 'entry' ) );

if ( ! $trigger_children ) {
Expand Down Expand Up @@ -839,7 +839,7 @@ public function _register_actions() {
$keys = array_keys( $this->actions );

foreach ( $keys as $key ) {
// don't register new action if old action with the same id is already registered
// Don't register new action if old action with the same id is already registered
if ( ! isset( $this->actions[ $key ] ) ) {
$this->actions[ $key ]->_register();
}
Expand Down
18 changes: 9 additions & 9 deletions classes/controllers/FrmFormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ private static function fallback_when_page_template_part_is_not_supported_by_the
the_post();
self::get_template( 'header' );

// add some generic class names to the container to add some natural padding to the content.
// Add some generic class names to the container to add some natural padding to the content.
// .entry-content catches the WordPress TwentyTwenty theme.
// .container catches Customizr content.
echo '<div class="container entry-content">';
Expand Down Expand Up @@ -1068,7 +1068,7 @@ public static function insert_form_button() {

// Store the result in memory and re-use it when this function is called multiple times.
// This helps speed up the form builder when there are a lot of HTML fields, where this
// button is inserted once per HTML field.
// Button is inserted once per HTML field.
// In a form with 66 HTML fields, this saves 0.5 seconds on page load time, tested locally.
if ( ! isset( self::$formidable_tinymce_button ) ) {
FrmAppHelper::load_admin_wide_js();
Expand Down Expand Up @@ -1100,7 +1100,7 @@ public static function insert_form_popup() {
include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/insert_form_popup.php';

if ( FrmAppHelper::is_form_builder_page() && ! class_exists( '_WP_Editors', false ) ) {
// initialize a wysiwyg so we have usable settings defined in tinyMCEPreInit.mceInit
// Initialize a wysiwyg so we have usable settings defined in tinyMCEPreInit.mceInit
require ABSPATH . WPINC . '/class-wp-editor.php';
?>
<div class="frm_hidden">
Expand Down Expand Up @@ -1163,7 +1163,7 @@ public static function get_shortcode_opts() {
$opts = apply_filters( 'frm_sc_popup_opts', $opts, $shortcode );

if ( isset( $opts['form_id'] ) && is_string( $opts['form_id'] ) ) {
// allow other shortcodes to use the required form id option
// Allow other shortcodes to use the required form id option
$form_id = $opts['form_id'];
unset( $opts['form_id'] );
}
Expand Down Expand Up @@ -2100,7 +2100,7 @@ public static function route() { // phpcs:ignore Generic.Metrics.CyclomaticCompl
$json_vars = json_decode( $json_vars, true );

if ( ! $json_vars ) {
// json decoding failed so we should return an error message.
// Json decoding failed so we should return an error message.
$action = FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' );

if ( 'edit' === $action ) {
Expand Down Expand Up @@ -2447,7 +2447,7 @@ public static function show_form( $id = '', $key = '', $title = false, $descript
$frm_settings = FrmAppHelper::get_settings( array( 'current_form' => $form->id ) );

if ( self::is_viewable_draft_form( $form ) ) {
// don't show a draft form on a page
// Don't show a draft form on a page
$form = __( 'Please select a valid form', 'formidable' );
} elseif ( ! FrmForm::is_visible_to_user( $form ) ) {
$form = do_shortcode( $frm_settings->login_msg );
Expand Down Expand Up @@ -3433,7 +3433,7 @@ public static function front_head() {
add_filter( 'script_loader_tag', 'FrmFormsController::defer_script_loading', 10, 2 );

if ( FrmAppHelper::is_admin() ) {
// don't load this in back-end
// Don't load this in back-end
return;
}

Expand Down Expand Up @@ -3528,7 +3528,7 @@ public static function footer_js( $location = 'footer' ) {
FrmStylesController::enqueue_css();

if ( ! FrmAppHelper::is_admin() && $location !== 'header' && ! empty( $frm_vars['forms_loaded'] ) ) {
// load formidable js
// Load formidable js
wp_enqueue_script( 'formidable' );

FrmHoneypot::maybe_print_honeypot_js();
Expand All @@ -3544,7 +3544,7 @@ public static function footer_js( $location = 'footer' ) {
* @return void
*/
private static function maybe_minimize_form( $atts, &$content ) {
// check if minimizing is turned on
// Check if minimizing is turned on
if ( self::is_minification_on( $atts ) ) {
$content = str_replace( array( "\r\n", "\r", "\n", "\t", ' ' ), '', $content );
}
Expand Down
2 changes: 1 addition & 1 deletion classes/controllers/FrmSimpleBlocksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public static function simple_form_render( $attributes ) {
unset( $params['formId'] );

// Still pass false for title and description options if nothing is set,
// so a default doesn't overwrite the block option.
// So a default doesn't overwrite the block option.
$params['title'] = ! empty( $params['title'] );
$params['description'] = ! empty( $params['description'] );

Expand Down
4 changes: 2 additions & 2 deletions classes/controllers/FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ public static function change_styling() {
* @return void
*/
public static function add_meta_boxes() {
// setup meta boxes
// Setup meta boxes
$meta_boxes = array(
'general' => __( 'General', 'formidable' ),
'form-title' => __( 'Form Title', 'formidable' ),
Expand Down Expand Up @@ -1343,7 +1343,7 @@ public static function important_style( $important, $field ) {
public static function do_accordion_sections( $screen, $context, $data_object ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh
global $wp_meta_boxes;

// the symbol id from icons.svg
// The symbol id from icons.svg
$icon_ids = array(
'ranking-fields-style' => 'frm_chart_bar_icon',
'section-fields-style' => 'frm-form-title-style',
Expand Down
12 changes: 6 additions & 6 deletions classes/controllers/FrmXMLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public static function import_xml() {
$file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) );

if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
// allow other file types to be imported
// Allow other file types to be imported
do_action( 'frm_before_import_' . $file_type );

return;
Expand Down Expand Up @@ -604,12 +604,12 @@ private static function prepare_types_array( &$type ) {
$type = (array) $type;

if ( ! in_array( 'forms', $type, true ) && ( in_array( 'items', $type, true ) || in_array( 'posts', $type, true ) ) ) {
// make sure the form is included if there are entries
// Make sure the form is included if there are entries
$type[] = 'forms';
}

if ( in_array( 'forms', $type, true ) ) {
// include actions with forms
// Include actions with forms
$type[] = 'actions';
}
}
Expand All @@ -629,7 +629,7 @@ private static function get_file_name( $args, $records ) {
$has_one_form = ! empty( $records['forms'] ) && count( $args['ids'] ) === 1;

if ( $has_one_form ) {
// one form is being exported
// One form is being exported
$selected_form_id = reset( $args['ids'] );
$filename = 'form-' . $selected_form_id . '.xml';

Expand Down Expand Up @@ -782,12 +782,12 @@ public static function get_fields_for_csv_export( $form_id, $form ) {
*/
public static function allow_mime( $mimes ) {
if ( ! isset( $mimes['csv'] ) ) {
// allow csv files
// Allow csv files
$mimes['csv'] = 'text/csv';
}

if ( ! isset( $mimes['xml'] ) ) {
// allow xml
// Allow xml
$mimes['xml'] = 'text/xml';
}

Expand Down
2 changes: 1 addition & 1 deletion classes/factories/FrmFieldFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private static function get_field_type_class( $field_type ) {
public static function field_has_html( $type ) {
$has_html = self::field_has_property( $type, 'has_html' );

// this hook is here for reverse compatibility since 3.0
// This hook is here for reverse compatibility since 3.0
return apply_filters( 'frm_show_custom_html', $has_html, $type );
}

Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmApiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private static function is_first_30() {

if ( false === $activation_timestamp ) {
// If the option does not exist, assume that it is
// because the user was active before this option was introduced.
// Because the user was active before this option was introduced.
return false;
}

Expand Down
10 changes: 5 additions & 5 deletions classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public static function is_admin_page( $page = 'formidable' ) {
$get_page = self::simple_get( 'page', 'sanitize_title' );

if ( $pagenow ) {
// allow this to be true during ajax load i.e. ajax form builder loading
// Allow this to be true during ajax load i.e. ajax form builder loading
$is_page = ( $pagenow === 'admin.php' || $pagenow === 'admin-ajax.php' ) && $get_page === $page;

if ( $is_page ) {
Expand Down Expand Up @@ -3591,7 +3591,7 @@ public static function prepare_and_encode( $post_content ) {
// Add extra slashes for \r\n since WP strips them.
$post_content = str_replace( array( '\\r', '\\n', '\\u', '\\t' ), array( '\\\\r', '\\\\n', '\\\\u', '\\\\t' ), $post_content );

// allow for &quot
// Allow for &quot
return str_replace( '&quot;', '\\"', $post_content );
}

Expand Down Expand Up @@ -3939,7 +3939,7 @@ public static function localize_script( $location ) {
'noTitleText' => FrmFormsHelper::get_no_title_text(),

// In older versions this event listener causes the section to immediately close again
// when the h3 element is clicked. It's only required in WP 6.7+.
// When the h3 element is clicked. It's only required in WP 6.7+.
'requireAccordionTitleClickListener' => version_compare( $wp_version, '6.7', '>=' ),
);
/**
Expand Down Expand Up @@ -4187,10 +4187,10 @@ public static function locales( $type = 'date' ) {
);

if ( $type === 'captcha' ) {
// remove the languages unavailable for the captcha
// Remove the languages unavailable for the captcha
$unset = array( 'sq', 'bs', 'eo', 'fo', 'fr-CH', 'sr-SR', 'ar-DZ', 'be', 'cy-GB', 'kk', 'km', 'ky', 'lb', 'mk', 'nb', 'nn', 'rm', 'tj' );
} else {
// remove the languages unavailable for the datepicker
// Remove the languages unavailable for the datepicker
$unset = array( 'fil', 'fr-CA', 'de-AT', 'de-CH', 'iw', 'hi', 'pt', 'pt-PT', 'es-419', 'mr', 'lo', 'kn', 'si', 'gu', 'bn', 'zu', 'ur', 'te', 'sw', 'am' );
}

Expand Down
Loading