Plugin Directory

Changeset 3292708


Ignore:
Timestamp:
05/13/2025 03:58:49 PM (9 months ago)
Author:
flexfields
Message:

Tagging version 1.0.2

Location:
flex-forms
Files:
4 edited
5 copied

Legend:

Unmodified
Added
Removed
  • flex-forms/tags/1.0.2/flex-forms.php

    r3279209 r3292708  
    44 * Plugin URI: https://flex-fields.com/forms/
    55 * Description: A modular, customizable form builder plugin for WordPress.
    6  * Version: 1.0.0
     6 * Version: 1.0.2
    77 * Requires at least: 6.6
    88 * Author: Future Systems
     
    1717}
    1818
    19 define('FLEX_FORMS_VERSION', '1.0.0');
     19define('FLEX_FORMS_VERSION', '1.0.2');
    2020define('FLEX_FORMS_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2121define('FLEX_FORMS_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    3838}
    3939add_action('plugins_loaded', 'flex_forms_init');
    40 add_action( 'wp_mail_failed', function ( $wp_error ) {
    41     error_log( 'Mail error: ' . $wp_error->get_error_message() );
    42     error_log( print_r( $wp_error, true ) );
    43 });
    4440
    4541function flex_forms_activate_or_deactivate()
  • flex-forms/tags/1.0.2/includes/class-flex-forms-frontend.php

    r3279209 r3292708  
    6262        ?>
    6363        <form id="flex-form-<?php echo esc_attr($form_id); ?>" class="flex-form" method="post"
    64               enctype="multipart/form-data">
     64                enctype="multipart/form-data">
    6565            <?php
    66             $allowed_html = [
    67                 'form' => ['action' => [], 'method' => [], 'class' => [], 'id' => []],
    68                 'input' => ['type' => [], 'name' => [], 'value' => [], 'class' => [], 'id' => [], 'placeholder' => [], 'required' => []],
    69                 'textarea' => ['name' => [], 'rows' => [], 'cols' => [], 'class' => [], 'id' => [], 'placeholder' => [], 'required' => []],
    70                 'label' => ['for' => [], 'class' => []],
    71                 'select' => ['name' => [], 'class' => [], 'id' => []],
    72                 'option' => ['value' => [], 'selected' => []],
    73                 'button' => ['type' => [], 'class' => [], 'id' => []]
    74             ];
     66            $allowed_html = array_merge_recursive(
     67                wp_kses_allowed_html('post'),
     68                [
     69                    'form' => [
     70                        'action' => true,
     71                        'method' => true,
     72                        'class' => true,
     73                        'id' => true
     74                    ],
     75                    'input' => [
     76                        'type' => true,
     77                        'name' => true,
     78                        'value' => true,
     79                        'class' => true,
     80                        'id' => true,
     81                        'placeholder' => true,
     82                        'required' => true,
     83                        'checked' => true,
     84                        'multiple' => true
     85                    ],
     86                    'textarea' => [
     87                        'name' => true,
     88                        'rows' => true,
     89                        'cols' => true,
     90                        'class' => true,
     91                        'id' => true,
     92                        'placeholder' => true,
     93                        'required' => true
     94                    ],
     95                    'label' => [
     96                        'for' => true,
     97                        'class' => true
     98                    ],
     99                    'select' => [
     100                        'name' => true,
     101                        'class' => true,
     102                        'id' => true,
     103                        'required' => true,
     104                        'multiple' => true
     105                    ],
     106                    'option' => [
     107                        'value' => true,
     108                        'selected' => true
     109                    ],
     110                    'button' => [
     111                        'type' => true,
     112                        'class' => true,
     113                        'id' => true
     114                    ]
     115                ]
     116            );
    75117
    76118            echo wp_kses($form_content, $allowed_html);
     
    183225
    184226        $submission_data = [];
    185         if ( isset( $_POST['flex_forms_all_inputs'] ) ) {
    186             $all_inputs       = sanitize_text_field( wp_unslash( $_POST['flex_forms_all_inputs'] ) );
    187             $flex_all_inputs  = explode( ',', $all_inputs );
    188             foreach ( $flex_all_inputs as $input ) {
    189                 if ( isset( $_POST[ $input ] ) ) {
    190                     $submission_data[ $input ] = wp_kses( wp_unslash( $_POST[ $input ] ), 'post' );
    191                 }
    192             }
    193         }
    194 
    195         $submission_data['_referrer_url'] = isset( $_SERVER['HTTP_REFERER'] )
    196             ? esc_url_raw( $_SERVER['HTTP_REFERER'] )
    197             : '';
     227        if (isset($_POST['flex_forms_all_inputs'])) {
     228            $all_inputs = sanitize_text_field(wp_unslash($_POST['flex_forms_all_inputs']));
     229            $flex_all_inputs = explode(',', $all_inputs);
     230            foreach ($flex_all_inputs as $input) {
     231                if (isset($_POST[$input])) {
     232                    $submission_data[$input] = wp_kses(wp_unslash($_POST[$input]), 'post');
     233                }
     234            }
     235        }
    198236
    199237        $submission_post = array(
     
    226264                $user_email_template = get_post_meta($form_id, '_flex_forms_user_email_template', true);
    227265                preg_match('/\[(.*?)\]/', $user_email_shortcode, $matches);
    228 
    229                 $user_email = '';
    230                 if ( isset($matches[1]) && isset($submission_data[$matches[1]]) ) {
    231                     $user_email = sanitize_email($submission_data[$matches[1]]);
    232                 }
    233                
     266                $user_email = isset($submission_data[$matches[1]]) ? sanitize_email($submission_data[$matches[1]]) : '';
    234267                if (!empty($user_email) && !empty($user_email_subject) && !empty($user_email_template)) {
    235268                    foreach ($submission_data as $key => $value) {
     
    284317                $phpmailer->Port       = get_option( 'flex_forms_smtp_port' );
    285318
    286                 $smtp_encryption = strtolower( get_option( 'flex_forms_smtp_encryption', 'none' ) );
    287 
    288                 if ( $smtp_encryption === 'none' ) {
     319                $smtp_encryption = get_option( 'flex_forms_smtp_encryption' );
     320                if ( 'none' === strtolower( $smtp_encryption ) ) {
    289321                    $phpmailer->SMTPSecure   = '';
    290                     $phpmailer->SMTPAutoTLS  = false;   // don’t attempt STARTTLS
     322                    $phpmailer->SMTPAutoTLS  = false;
    291323                    $phpmailer->SMTPOptions  = array(
    292324                        'ssl' => array(
     
    296328                        ),
    297329                    );
    298                 } elseif ( in_array( $smtp_encryption, [ 'ssl', 'tls' ], true ) ) {
    299                     $phpmailer->SMTPSecure   = $smtp_encryption;  // ssl or tls
    300330                } else {
    301                     $phpmailer->SMTPSecure   = '';                // fallback
     331                    $phpmailer->SMTPSecure = $smtp_encryption;
    302332                }
    303333
    304334                $phpmailer->CharSet = 'UTF-8';
    305                 $phpmailer->isHTML( true );
     335                $phpmailer->isHTML(true);
    306336                $phpmailer->setFrom($from_email, $from_name);
    307337            });
  • flex-forms/tags/1.0.2/readme.txt

    r3270373 r3292708  
    44Tags: form, field, shortcode, input, email
    55Requires at least: 5.0
    6 Tested up to: 6.7
     6Tested up to: 6.8
    77Requires PHP: 7.0
    8 Stable tag: 1.0.0
     8Stable tag: 1.0.2
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • flex-forms/trunk/flex-forms.php

    r3279209 r3292708  
    44 * Plugin URI: https://flex-fields.com/forms/
    55 * Description: A modular, customizable form builder plugin for WordPress.
    6  * Version: 1.0.0
     6 * Version: 1.0.2
    77 * Requires at least: 6.6
    88 * Author: Future Systems
     
    1717}
    1818
    19 define('FLEX_FORMS_VERSION', '1.0.0');
     19define('FLEX_FORMS_VERSION', '1.0.2');
    2020define('FLEX_FORMS_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2121define('FLEX_FORMS_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    3838}
    3939add_action('plugins_loaded', 'flex_forms_init');
    40 add_action( 'wp_mail_failed', function ( $wp_error ) {
    41     error_log( 'Mail error: ' . $wp_error->get_error_message() );
    42     error_log( print_r( $wp_error, true ) );
    43 });
    4440
    4541function flex_forms_activate_or_deactivate()
  • flex-forms/trunk/includes/class-flex-forms-frontend.php

    r3279209 r3292708  
    6262        ?>
    6363        <form id="flex-form-<?php echo esc_attr($form_id); ?>" class="flex-form" method="post"
    64               enctype="multipart/form-data">
     64                enctype="multipart/form-data">
    6565            <?php
    66             $allowed_html = [
    67                 'form' => ['action' => [], 'method' => [], 'class' => [], 'id' => []],
    68                 'input' => ['type' => [], 'name' => [], 'value' => [], 'class' => [], 'id' => [], 'placeholder' => [], 'required' => []],
    69                 'textarea' => ['name' => [], 'rows' => [], 'cols' => [], 'class' => [], 'id' => [], 'placeholder' => [], 'required' => []],
    70                 'label' => ['for' => [], 'class' => []],
    71                 'select' => ['name' => [], 'class' => [], 'id' => []],
    72                 'option' => ['value' => [], 'selected' => []],
    73                 'button' => ['type' => [], 'class' => [], 'id' => []]
    74             ];
     66            $allowed_html = array_merge_recursive(
     67                wp_kses_allowed_html('post'),
     68                [
     69                    'form' => [
     70                        'action' => true,
     71                        'method' => true,
     72                        'class' => true,
     73                        'id' => true
     74                    ],
     75                    'input' => [
     76                        'type' => true,
     77                        'name' => true,
     78                        'value' => true,
     79                        'class' => true,
     80                        'id' => true,
     81                        'placeholder' => true,
     82                        'required' => true,
     83                        'checked' => true,
     84                        'multiple' => true
     85                    ],
     86                    'textarea' => [
     87                        'name' => true,
     88                        'rows' => true,
     89                        'cols' => true,
     90                        'class' => true,
     91                        'id' => true,
     92                        'placeholder' => true,
     93                        'required' => true
     94                    ],
     95                    'label' => [
     96                        'for' => true,
     97                        'class' => true
     98                    ],
     99                    'select' => [
     100                        'name' => true,
     101                        'class' => true,
     102                        'id' => true,
     103                        'required' => true,
     104                        'multiple' => true
     105                    ],
     106                    'option' => [
     107                        'value' => true,
     108                        'selected' => true
     109                    ],
     110                    'button' => [
     111                        'type' => true,
     112                        'class' => true,
     113                        'id' => true
     114                    ]
     115                ]
     116            );
    75117
    76118            echo wp_kses($form_content, $allowed_html);
     
    183225
    184226        $submission_data = [];
    185         if ( isset( $_POST['flex_forms_all_inputs'] ) ) {
    186             $all_inputs       = sanitize_text_field( wp_unslash( $_POST['flex_forms_all_inputs'] ) );
    187             $flex_all_inputs  = explode( ',', $all_inputs );
    188             foreach ( $flex_all_inputs as $input ) {
    189                 if ( isset( $_POST[ $input ] ) ) {
    190                     $submission_data[ $input ] = wp_kses( wp_unslash( $_POST[ $input ] ), 'post' );
    191                 }
    192             }
    193         }
    194 
    195         $submission_data['_referrer_url'] = isset( $_SERVER['HTTP_REFERER'] )
    196             ? esc_url_raw( $_SERVER['HTTP_REFERER'] )
    197             : '';
     227        if (isset($_POST['flex_forms_all_inputs'])) {
     228            $all_inputs = sanitize_text_field(wp_unslash($_POST['flex_forms_all_inputs']));
     229            $flex_all_inputs = explode(',', $all_inputs);
     230            foreach ($flex_all_inputs as $input) {
     231                if (isset($_POST[$input])) {
     232                    $submission_data[$input] = wp_kses(wp_unslash($_POST[$input]), 'post');
     233                }
     234            }
     235        }
    198236
    199237        $submission_post = array(
     
    226264                $user_email_template = get_post_meta($form_id, '_flex_forms_user_email_template', true);
    227265                preg_match('/\[(.*?)\]/', $user_email_shortcode, $matches);
    228 
    229                 $user_email = '';
    230                 if ( isset($matches[1]) && isset($submission_data[$matches[1]]) ) {
    231                     $user_email = sanitize_email($submission_data[$matches[1]]);
    232                 }
    233                
     266                $user_email = isset($submission_data[$matches[1]]) ? sanitize_email($submission_data[$matches[1]]) : '';
    234267                if (!empty($user_email) && !empty($user_email_subject) && !empty($user_email_template)) {
    235268                    foreach ($submission_data as $key => $value) {
     
    284317                $phpmailer->Port       = get_option( 'flex_forms_smtp_port' );
    285318
    286                 $smtp_encryption = strtolower( get_option( 'flex_forms_smtp_encryption', 'none' ) );
    287 
    288                 if ( $smtp_encryption === 'none' ) {
     319                $smtp_encryption = get_option( 'flex_forms_smtp_encryption' );
     320                if ( 'none' === strtolower( $smtp_encryption ) ) {
    289321                    $phpmailer->SMTPSecure   = '';
    290                     $phpmailer->SMTPAutoTLS  = false;   // don’t attempt STARTTLS
     322                    $phpmailer->SMTPAutoTLS  = false;
    291323                    $phpmailer->SMTPOptions  = array(
    292324                        'ssl' => array(
     
    296328                        ),
    297329                    );
    298                 } elseif ( in_array( $smtp_encryption, [ 'ssl', 'tls' ], true ) ) {
    299                     $phpmailer->SMTPSecure   = $smtp_encryption;  // ssl or tls
    300330                } else {
    301                     $phpmailer->SMTPSecure   = '';                // fallback
     331                    $phpmailer->SMTPSecure = $smtp_encryption;
    302332                }
    303333
    304334                $phpmailer->CharSet = 'UTF-8';
    305                 $phpmailer->isHTML( true );
     335                $phpmailer->isHTML(true);
    306336                $phpmailer->setFrom($from_email, $from_name);
    307337            });
  • flex-forms/trunk/readme.txt

    r3270373 r3292708  
    44Tags: form, field, shortcode, input, email
    55Requires at least: 5.0
    6 Tested up to: 6.7
     6Tested up to: 6.8
    77Requires PHP: 7.0
    8 Stable tag: 1.0.0
     8Stable tag: 1.0.2
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.