Plugin Directory

Changeset 3202660


Ignore:
Timestamp:
12/04/2024 09:13:18 PM (13 months ago)
Author:
checkview
Message:

Update to version 2.0.7 from GitHub

Location:
checkview
Files:
28 edited
1 copied

Legend:

Unmodified
Added
Removed
  • checkview/tags/2.0.7/README.txt

    r3194506 r3202660  
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
    10 Stable tag: 2.0.6
     10Stable tag: 2.0.7
    1111
    1212[CheckView](https://checkview.io/) is the friendly WordPress automated testing platform for everyone, from developers, shop owners to agencies. 
     
    8686
    8787== Changelog ==
     88= 2.0.7 =
     89* Updated IP address check function to adap different server configurations.
    8890
    8991= 2.0.6 =
     
    283285
    284286== Upgrade Notice ==
     287= 2.0.7 =
     288* Updated IP address check function to adap different server configurations.
     289
    285290= 2.0.6 =
    286291* Added fix for WooCommerce order deletion global scope issue.
  • checkview/tags/2.0.7/admin/class-checkview-admin.php

    r3194506 r3202660  
    226226        // skip if visitor ip not equal to CV Bot IP.
    227227        if ( is_array( $cv_bot_ip ) && ! in_array( $visitor_ip, $cv_bot_ip ) ) {
     228            $old_settings = array();
     229            $old_settings = (array) get_option( '_fluentform_reCaptcha_details', array() );
     230            if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
     231                if ( '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' === $old_settings['siteKey'] ) {
     232                    $old_settings['siteKey']   = get_option( 'checkview_rc-site-key' );
     233                    $old_settings['secretKey'] = get_option( 'checkview_rc-secret-key' );
     234                    update_option( '_fluentform_reCaptcha_details', $old_settings );
     235                }
     236            }
     237            $old_settings = array();
     238            $old_settings = (array) get_option( '_fluentform_turnstile_details', array() );
     239            if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
     240                if ( '1x00000000000000000000AA' === $old_settings['siteKey'] ) {
     241                    $old_settings['siteKey']   = get_option( 'checkview_ff_turnstile-site-key' );
     242                    $old_settings['secretKey'] = get_option( 'checkview_ff_turnstile-secret-key' );
     243                    update_option( '_fluentform_turnstile_details', $old_settings );
     244                }
     245            }
    228246            return;
    229247        }
  • checkview/tags/2.0.7/checkview.php

    r3194506 r3202660  
    1616 * Plugin URI:        https://checkview.io
    1717 * Description:       CheckView is the #1 fully automated solution to test your WordPress forms and detect form problems fast.  Automatically test your WordPress forms to ensure you never miss a lead again.
    18  * Version:           2.0.6
     18 * Version:           2.0.7
    1919 * Author:            CheckView
    2020 * Author URI:        https://checkview.io/
     
    3737 * Rename this for your plugin and update it as you release new versions.
    3838 */
    39 define( 'CHECKVIEW_VERSION', '2.0.6' );
     39define( 'CHECKVIEW_VERSION', '2.0.7' );
    4040
    4141/**
  • checkview/tags/2.0.7/includes/API/class-checkview-api.php

    r3194506 r3202660  
    15061506            wp_die();
    15071507        }
    1508         // Temporarily suppress errors
     1508        // Temporarily suppress errors.
    15091509        $previous_error_reporting = error_reporting( 0 );
    15101510
     
    19101910    public function checkview_get_available_forms_test_results( WP_REST_Request $request ) {
    19111911        global $wpdb;
    1912         $uid          = $request->get_param( 'uid' );
    1913         $uid          = isset( $uid ) ? sanitize_text_field( $uid ) : null;
    1914         $old_settings = array();
    1915         $old_settings = (array) get_option( '_fluentform_reCaptcha_details', array() );
    1916         if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    1917             if ( '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' === $old_settings['siteKey'] ) {
    1918                 $old_settings['siteKey']   = get_option( 'checkview_rc-site-key' );
    1919                 $old_settings['secretKey'] = get_option( 'checkview_rc-secret-key' );
    1920                 update_option( '_fluentform_reCaptcha_details', $old_settings );
    1921             }
    1922         }
    1923         $old_settings = array();
    1924         $old_settings = (array) get_option( '_fluentform_turnstile_details', array() );
    1925         if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    1926             if ( '1x00000000000000000000AA' === $old_settings['siteKey'] ) {
    1927                 $old_settings['siteKey']   = get_option( 'checkview_ff_turnstile-site-key' );
    1928                 $old_settings['secretKey'] = get_option( 'checkview_ff_turnstile-secret-key' );
    1929                 update_option( '_fluentform_turnstile_details', $old_settings );
    1930             }
    1931         }
     1912        $uid     = $request->get_param( 'uid' );
     1913        $uid     = isset( $uid ) ? sanitize_text_field( $uid ) : null;
    19321914        $results = array();
    19331915        if ( '' === $uid || null === $uid ) {
     
    19401922            wp_die();
    19411923        } else {
    1942             $old_settings = array();
    1943             $old_settings = (array) get_option( '_fluentform_reCaptcha_details', array() );
    1944             if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    1945                 if ( '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' === $old_settings['siteKey'] ) {
    1946                     $old_settings['siteKey']   = get_option( 'checkview_rc-site-key' );
    1947                     $old_settings['secretKey'] = get_option( 'checkview_rc-secret-key' );
    1948                     update_option( '_fluentform_reCaptcha_details', $old_settings );
    1949                 }
    1950             }
    1951             $old_settings = array();
    1952             $old_settings = (array) get_option( '_fluentform_turnstile_details', array() );
    1953             if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    1954                 if ( '1x00000000000000000000AA' === $old_settings['siteKey'] ) {
    1955                     $old_settings['siteKey']   = get_option( 'checkview_ff_turnstile-site-key' );
    1956                     $old_settings['secretKey'] = get_option( 'checkview_ff_turnstile-secret-key' );
    1957                     update_option( '_fluentform_turnstile_details', $old_settings );
    1958                 }
    1959             }
    19601924            $tablename = $wpdb->prefix . 'cv_entry';
    19611925            $result    = $wpdb->get_row( $wpdb->prepare( 'Select * from ' . $tablename . ' where uid=%s', $uid ) );
  • checkview/tags/2.0.7/includes/checkview-functions.php

    r3194506 r3202660  
    232232     */
    233233    function checkview_get_visitor_ip() {
    234 
    235         if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
     234        if ( ! empty( $_SERVER['HTTP_X_REAL_IP'] ) ) {
     235            // check real ip.
     236            $ip = sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_REAL_IP'] ) );
     237        } elseif ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
    236238            // check ip from share internet.
    237239            $ip = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CLIENT_IP'] ) );
     
    246248            return false;
    247249        }
    248 
    249250        return $ip;
    250251    }
  • checkview/tags/2.0.7/includes/checkview-helper-functions.php

    r3194506 r3202660  
    158158    }
    159159}
     160
     161// Bypass Perfmatters.
     162add_filter(
     163    'perfmatters_rest_api_exceptions',
     164    function ( $exceptions ) {
     165        $exceptions[] = 'checkview';
     166        return $exceptions;
     167    }
     168);
  • checkview/tags/2.0.7/includes/class-checkview.php

    r3194506 r3202660  
    8080            $this->version = CHECKVIEW_VERSION;
    8181        } else {
    82             $this->version = '2.0.6';
     82            $this->version = '2.0.7';
    8383        }
    8484        $this->plugin_name = 'checkview';
  • checkview/tags/2.0.7/includes/formhelpers/class-checkview-cf7-helper.php

    r3193360 r3202660  
    265265            } else {
    266266                $args['recipient'] = TEST_EMAIL;
     267                $headers           = '';
     268                // Remove bcc and cc headers.
     269                $headers = preg_replace( '/^(bcc:|cc:).*$/mi', '', $args['additional_headers'] );
     270
     271                // Clean up any extra newlines.
     272                $headers                    = preg_replace( '/^\s*[\r\n]+/m', '', $headers );
     273                $args['additional_headers'] = $headers;
    267274            }
    268275            return $args;
  • checkview/tags/2.0.7/includes/formhelpers/class-checkview-fluent-forms-helper.php

    r3193360 r3202660  
    132132
    133133            $old_settings = (array) get_option( '_fluentform_turnstile_details', array() );
    134             if ( null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
     134            if ( ! empty( $old_settings['siteKey'] ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    135135                if ( '1x00000000000000000000AA' !== $old_settings['siteKey'] ) {
    136136                    update_option( 'checkview_ff_turnstile-site-key', $old_settings['siteKey'], true );
  • checkview/tags/2.0.7/includes/formhelpers/class-checkview-formidable-helper.php

    r3193360 r3202660  
    5252            }
    5353
     54            add_filter(
     55                'frm_email_header',
     56                array(
     57                    $this,
     58                    'checkview_remove_email_header',
     59                ),
     60                99,
     61                2
     62            );
     63
    5464            add_action(
    5565                'frm_after_create_entry',
     
    121131            return $email;
    122132        }
    123 
     133        /**
     134         * Removes email headers.
     135         *
     136         * @param array $headers email header.
     137         * @param array $atts attributes.
     138         * @return array
     139         */
     140        public function checkview_remove_email_header( array $headers, array $atts ): array {
     141            // Ensure headers are an array.
     142            if ( ! is_array( $headers ) ) {
     143                $headers = explode( "\r\n", $headers );
     144            }
     145            $filtered_headers = array_filter(
     146                $headers,
     147                function ( $header ) {
     148                    // Exclude headers that start with 'bcc:' or 'cc:'.
     149                    return stripos( $header, 'BCC:' ) !== 0 && stripos( $header, 'CC:' ) !== 0;
     150                }
     151            );
     152            return array_values( $filtered_headers );
     153        }
    124154        /**
    125155         * Logs Test entry
  • checkview/tags/2.0.7/includes/formhelpers/class-checkview-gforms-helper.php

    r3193360 r3202660  
    184184            if ( get_option( 'disable_email_receipt', false ) == false ) {
    185185                $email['to'] = TEST_EMAIL;
     186                $headers = $email['headers'];
     187                if ( ! is_array( $headers ) ) {
     188                    $headers = explode( "\r\n", $headers );
     189                }
     190                $filtered_headers = array_filter(
     191                    $headers,
     192                    function ( $header ) {
     193                        // Exclude headers that start with 'bcc:' or 'cc:'.
     194                        return stripos( $header, 'bcc:' ) !== 0 && stripos( $header, 'cc:' ) !== 0;
     195                    }
     196                );
     197                $email['headers'] = $filtered_headers;
    186198            } elseif ( is_array( $email['to'] ) ) {
    187199                $email['to'][] = TEST_EMAIL;
  • checkview/tags/2.0.7/includes/formhelpers/class-checkview-wpforms-helper.php

    r3193360 r3202660  
    4545
    4646            $old_settings = (array) get_option( 'wpforms_settings', array() );
    47             if ( null !== $old_settings['turnstile-site-key'] && null !== $old_settings['turnstile-secret-key'] ) {
     47            if ( ! empty( $old_settings['turnstile-site-key'] ) && null !== $old_settings['turnstile-site-key'] && null !== $old_settings['turnstile-secret-key'] ) {
    4848                if ( '1x00000000000000000000AA' !== $old_settings['turnstile-site-key'] ) {
    4949                    update_option( 'checkview_wpforms_turnstile-site-key', $old_settings['turnstile-site-key'], true );
     
    139139                $count = count( $email['address'] );
    140140                for ( $i = 0; $i < $count; $i++ ) {
    141                     $email['address'][ $i ] = TEST_EMAIL;
     141                    $email['address'][ $i ]    = TEST_EMAIL;
     142                    $email['carboncopy'][ $i ] = '';
    142143                }
    143144            } elseif ( is_array( $email['address'] ) ) {
     
    281282            }
    282283            $old_settings = (array) get_option( 'wpforms_settings', array() );
    283             if ( null !== $old_settings['turnstile-site-key'] && null !== $old_settings['turnstile-secret-key'] ) {
     284            if ( ! empty( $old_settings['turnstile-site-key'] ) && null !== $old_settings['turnstile-site-key'] && null !== $old_settings['turnstile-secret-key'] ) {
    284285                if ( '1x00000000000000000000AA' === $old_settings['turnstile-site-key'] ) {
    285286                    $old_settings['turnstile-site-key']   = get_option( 'checkview_wpforms_turnstile-site-key' );
  • checkview/tags/2.0.7/includes/formhelpers/class-checkview-wsf-helper.php

    r3193360 r3202660  
    8888            );
    8989
    90             // add_filter(
    91             //  'wsf_action_post_do',
    92             //  array( $this, 'checkview_disable_addons_feed' ),
    93             //  99,
    94             //  6
    95             // );
     90            add_filter(
     91                'wsf_action_post_do',
     92                array( $this, 'checkview_disable_addons_feed' ),
     93                99,
     94                6
     95            );
     96            add_filter(
     97                'wsf_action_email_headers',
     98                array(
     99                    $this,
     100                    'checkview_inject_email',
     101                ),
     102                99,
     103                4
     104            );
    96105        }
    97106
  • checkview/tags/2.0.7/includes/woocommercehelper/class-checkview-blocks-payment-gateway.php

    r3194506 r3202660  
    7070            : array(
    7171                'dependencies' => array(),
    72                 'version'      => '2.0.6',
     72                'version'      => '2.0.7',
    7373            );
    7474        $script_url        = CHECKVIEW_URI . $script_path;
  • checkview/trunk/README.txt

    r3194506 r3202660  
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
    10 Stable tag: 2.0.6
     10Stable tag: 2.0.7
    1111
    1212[CheckView](https://checkview.io/) is the friendly WordPress automated testing platform for everyone, from developers, shop owners to agencies. 
     
    8686
    8787== Changelog ==
     88= 2.0.7 =
     89* Updated IP address check function to adap different server configurations.
    8890
    8991= 2.0.6 =
     
    283285
    284286== Upgrade Notice ==
     287= 2.0.7 =
     288* Updated IP address check function to adap different server configurations.
     289
    285290= 2.0.6 =
    286291* Added fix for WooCommerce order deletion global scope issue.
  • checkview/trunk/admin/class-checkview-admin.php

    r3194506 r3202660  
    226226        // skip if visitor ip not equal to CV Bot IP.
    227227        if ( is_array( $cv_bot_ip ) && ! in_array( $visitor_ip, $cv_bot_ip ) ) {
     228            $old_settings = array();
     229            $old_settings = (array) get_option( '_fluentform_reCaptcha_details', array() );
     230            if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
     231                if ( '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' === $old_settings['siteKey'] ) {
     232                    $old_settings['siteKey']   = get_option( 'checkview_rc-site-key' );
     233                    $old_settings['secretKey'] = get_option( 'checkview_rc-secret-key' );
     234                    update_option( '_fluentform_reCaptcha_details', $old_settings );
     235                }
     236            }
     237            $old_settings = array();
     238            $old_settings = (array) get_option( '_fluentform_turnstile_details', array() );
     239            if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
     240                if ( '1x00000000000000000000AA' === $old_settings['siteKey'] ) {
     241                    $old_settings['siteKey']   = get_option( 'checkview_ff_turnstile-site-key' );
     242                    $old_settings['secretKey'] = get_option( 'checkview_ff_turnstile-secret-key' );
     243                    update_option( '_fluentform_turnstile_details', $old_settings );
     244                }
     245            }
    228246            return;
    229247        }
  • checkview/trunk/checkview.php

    r3194506 r3202660  
    1616 * Plugin URI:        https://checkview.io
    1717 * Description:       CheckView is the #1 fully automated solution to test your WordPress forms and detect form problems fast.  Automatically test your WordPress forms to ensure you never miss a lead again.
    18  * Version:           2.0.6
     18 * Version:           2.0.7
    1919 * Author:            CheckView
    2020 * Author URI:        https://checkview.io/
     
    3737 * Rename this for your plugin and update it as you release new versions.
    3838 */
    39 define( 'CHECKVIEW_VERSION', '2.0.6' );
     39define( 'CHECKVIEW_VERSION', '2.0.7' );
    4040
    4141/**
  • checkview/trunk/includes/API/class-checkview-api.php

    r3194506 r3202660  
    15061506            wp_die();
    15071507        }
    1508         // Temporarily suppress errors
     1508        // Temporarily suppress errors.
    15091509        $previous_error_reporting = error_reporting( 0 );
    15101510
     
    19101910    public function checkview_get_available_forms_test_results( WP_REST_Request $request ) {
    19111911        global $wpdb;
    1912         $uid          = $request->get_param( 'uid' );
    1913         $uid          = isset( $uid ) ? sanitize_text_field( $uid ) : null;
    1914         $old_settings = array();
    1915         $old_settings = (array) get_option( '_fluentform_reCaptcha_details', array() );
    1916         if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    1917             if ( '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' === $old_settings['siteKey'] ) {
    1918                 $old_settings['siteKey']   = get_option( 'checkview_rc-site-key' );
    1919                 $old_settings['secretKey'] = get_option( 'checkview_rc-secret-key' );
    1920                 update_option( '_fluentform_reCaptcha_details', $old_settings );
    1921             }
    1922         }
    1923         $old_settings = array();
    1924         $old_settings = (array) get_option( '_fluentform_turnstile_details', array() );
    1925         if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    1926             if ( '1x00000000000000000000AA' === $old_settings['siteKey'] ) {
    1927                 $old_settings['siteKey']   = get_option( 'checkview_ff_turnstile-site-key' );
    1928                 $old_settings['secretKey'] = get_option( 'checkview_ff_turnstile-secret-key' );
    1929                 update_option( '_fluentform_turnstile_details', $old_settings );
    1930             }
    1931         }
     1912        $uid     = $request->get_param( 'uid' );
     1913        $uid     = isset( $uid ) ? sanitize_text_field( $uid ) : null;
    19321914        $results = array();
    19331915        if ( '' === $uid || null === $uid ) {
     
    19401922            wp_die();
    19411923        } else {
    1942             $old_settings = array();
    1943             $old_settings = (array) get_option( '_fluentform_reCaptcha_details', array() );
    1944             if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    1945                 if ( '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' === $old_settings['siteKey'] ) {
    1946                     $old_settings['siteKey']   = get_option( 'checkview_rc-site-key' );
    1947                     $old_settings['secretKey'] = get_option( 'checkview_rc-secret-key' );
    1948                     update_option( '_fluentform_reCaptcha_details', $old_settings );
    1949                 }
    1950             }
    1951             $old_settings = array();
    1952             $old_settings = (array) get_option( '_fluentform_turnstile_details', array() );
    1953             if ( ! empty( $old_settings ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    1954                 if ( '1x00000000000000000000AA' === $old_settings['siteKey'] ) {
    1955                     $old_settings['siteKey']   = get_option( 'checkview_ff_turnstile-site-key' );
    1956                     $old_settings['secretKey'] = get_option( 'checkview_ff_turnstile-secret-key' );
    1957                     update_option( '_fluentform_turnstile_details', $old_settings );
    1958                 }
    1959             }
    19601924            $tablename = $wpdb->prefix . 'cv_entry';
    19611925            $result    = $wpdb->get_row( $wpdb->prepare( 'Select * from ' . $tablename . ' where uid=%s', $uid ) );
  • checkview/trunk/includes/checkview-functions.php

    r3194506 r3202660  
    232232     */
    233233    function checkview_get_visitor_ip() {
    234 
    235         if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
     234        if ( ! empty( $_SERVER['HTTP_X_REAL_IP'] ) ) {
     235            // check real ip.
     236            $ip = sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_REAL_IP'] ) );
     237        } elseif ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
    236238            // check ip from share internet.
    237239            $ip = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CLIENT_IP'] ) );
     
    246248            return false;
    247249        }
    248 
    249250        return $ip;
    250251    }
  • checkview/trunk/includes/checkview-helper-functions.php

    r3194506 r3202660  
    158158    }
    159159}
     160
     161// Bypass Perfmatters.
     162add_filter(
     163    'perfmatters_rest_api_exceptions',
     164    function ( $exceptions ) {
     165        $exceptions[] = 'checkview';
     166        return $exceptions;
     167    }
     168);
  • checkview/trunk/includes/class-checkview.php

    r3194506 r3202660  
    8080            $this->version = CHECKVIEW_VERSION;
    8181        } else {
    82             $this->version = '2.0.6';
     82            $this->version = '2.0.7';
    8383        }
    8484        $this->plugin_name = 'checkview';
  • checkview/trunk/includes/formhelpers/class-checkview-cf7-helper.php

    r3193360 r3202660  
    265265            } else {
    266266                $args['recipient'] = TEST_EMAIL;
     267                $headers           = '';
     268                // Remove bcc and cc headers.
     269                $headers = preg_replace( '/^(bcc:|cc:).*$/mi', '', $args['additional_headers'] );
     270
     271                // Clean up any extra newlines.
     272                $headers                    = preg_replace( '/^\s*[\r\n]+/m', '', $headers );
     273                $args['additional_headers'] = $headers;
    267274            }
    268275            return $args;
  • checkview/trunk/includes/formhelpers/class-checkview-fluent-forms-helper.php

    r3193360 r3202660  
    132132
    133133            $old_settings = (array) get_option( '_fluentform_turnstile_details', array() );
    134             if ( null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
     134            if ( ! empty( $old_settings['siteKey'] ) && null !== $old_settings['siteKey'] && null !== $old_settings['secretKey'] ) {
    135135                if ( '1x00000000000000000000AA' !== $old_settings['siteKey'] ) {
    136136                    update_option( 'checkview_ff_turnstile-site-key', $old_settings['siteKey'], true );
  • checkview/trunk/includes/formhelpers/class-checkview-formidable-helper.php

    r3193360 r3202660  
    5252            }
    5353
     54            add_filter(
     55                'frm_email_header',
     56                array(
     57                    $this,
     58                    'checkview_remove_email_header',
     59                ),
     60                99,
     61                2
     62            );
     63
    5464            add_action(
    5565                'frm_after_create_entry',
     
    121131            return $email;
    122132        }
    123 
     133        /**
     134         * Removes email headers.
     135         *
     136         * @param array $headers email header.
     137         * @param array $atts attributes.
     138         * @return array
     139         */
     140        public function checkview_remove_email_header( array $headers, array $atts ): array {
     141            // Ensure headers are an array.
     142            if ( ! is_array( $headers ) ) {
     143                $headers = explode( "\r\n", $headers );
     144            }
     145            $filtered_headers = array_filter(
     146                $headers,
     147                function ( $header ) {
     148                    // Exclude headers that start with 'bcc:' or 'cc:'.
     149                    return stripos( $header, 'BCC:' ) !== 0 && stripos( $header, 'CC:' ) !== 0;
     150                }
     151            );
     152            return array_values( $filtered_headers );
     153        }
    124154        /**
    125155         * Logs Test entry
  • checkview/trunk/includes/formhelpers/class-checkview-gforms-helper.php

    r3193360 r3202660  
    184184            if ( get_option( 'disable_email_receipt', false ) == false ) {
    185185                $email['to'] = TEST_EMAIL;
     186                $headers = $email['headers'];
     187                if ( ! is_array( $headers ) ) {
     188                    $headers = explode( "\r\n", $headers );
     189                }
     190                $filtered_headers = array_filter(
     191                    $headers,
     192                    function ( $header ) {
     193                        // Exclude headers that start with 'bcc:' or 'cc:'.
     194                        return stripos( $header, 'bcc:' ) !== 0 && stripos( $header, 'cc:' ) !== 0;
     195                    }
     196                );
     197                $email['headers'] = $filtered_headers;
    186198            } elseif ( is_array( $email['to'] ) ) {
    187199                $email['to'][] = TEST_EMAIL;
  • checkview/trunk/includes/formhelpers/class-checkview-wpforms-helper.php

    r3193360 r3202660  
    4545
    4646            $old_settings = (array) get_option( 'wpforms_settings', array() );
    47             if ( null !== $old_settings['turnstile-site-key'] && null !== $old_settings['turnstile-secret-key'] ) {
     47            if ( ! empty( $old_settings['turnstile-site-key'] ) && null !== $old_settings['turnstile-site-key'] && null !== $old_settings['turnstile-secret-key'] ) {
    4848                if ( '1x00000000000000000000AA' !== $old_settings['turnstile-site-key'] ) {
    4949                    update_option( 'checkview_wpforms_turnstile-site-key', $old_settings['turnstile-site-key'], true );
     
    139139                $count = count( $email['address'] );
    140140                for ( $i = 0; $i < $count; $i++ ) {
    141                     $email['address'][ $i ] = TEST_EMAIL;
     141                    $email['address'][ $i ]    = TEST_EMAIL;
     142                    $email['carboncopy'][ $i ] = '';
    142143                }
    143144            } elseif ( is_array( $email['address'] ) ) {
     
    281282            }
    282283            $old_settings = (array) get_option( 'wpforms_settings', array() );
    283             if ( null !== $old_settings['turnstile-site-key'] && null !== $old_settings['turnstile-secret-key'] ) {
     284            if ( ! empty( $old_settings['turnstile-site-key'] ) && null !== $old_settings['turnstile-site-key'] && null !== $old_settings['turnstile-secret-key'] ) {
    284285                if ( '1x00000000000000000000AA' === $old_settings['turnstile-site-key'] ) {
    285286                    $old_settings['turnstile-site-key']   = get_option( 'checkview_wpforms_turnstile-site-key' );
  • checkview/trunk/includes/formhelpers/class-checkview-wsf-helper.php

    r3193360 r3202660  
    8888            );
    8989
    90             // add_filter(
    91             //  'wsf_action_post_do',
    92             //  array( $this, 'checkview_disable_addons_feed' ),
    93             //  99,
    94             //  6
    95             // );
     90            add_filter(
     91                'wsf_action_post_do',
     92                array( $this, 'checkview_disable_addons_feed' ),
     93                99,
     94                6
     95            );
     96            add_filter(
     97                'wsf_action_email_headers',
     98                array(
     99                    $this,
     100                    'checkview_inject_email',
     101                ),
     102                99,
     103                4
     104            );
    96105        }
    97106
  • checkview/trunk/includes/woocommercehelper/class-checkview-blocks-payment-gateway.php

    r3194506 r3202660  
    7070            : array(
    7171                'dependencies' => array(),
    72                 'version'      => '2.0.6',
     72                'version'      => '2.0.7',
    7373            );
    7474        $script_url        = CHECKVIEW_URI . $script_path;
Note: See TracChangeset for help on using the changeset viewer.