Plugin Directory

Changeset 3359712


Ignore:
Timestamp:
09/11/2025 09:17:17 AM (6 months ago)
Author:
convertkit
Message:

Update to version 3.0.1 from GitHub

Location:
convertkit
Files:
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • convertkit/tags/3.0.1/admin/class-convertkit-wp-list-table.php

    r3357832 r3359712  
    4747     */
    4848    private $bulk_actions = array();
     49
     50    /**
     51     * Holds the supported filters.
     52     *
     53     * @since   3.0.1
     54     *
     55     * @var     array
     56     */
     57    private $filters = array();
    4958
    5059    /**
     
    287296
    288297    /**
     298     * Add a filter to the table
     299     *
     300     * @since   3.0.1
     301     *
     302     * @param string $key     Filter name.
     303     * @param string $label   Filter label.
     304     * @param array  $options Filter options.
     305     */
     306    public function add_filter( $key, $label, $options ) {
     307
     308        $this->filters[ $key ] = array(
     309            'label'   => $label,
     310            'options' => $options,
     311        );
     312
     313    }
     314
     315    /**
    289316     * Define table columns and pagination for this WP_List_Table.
    290317     *
     
    335362        <div class="tablenav <?php echo esc_attr( $which ); ?>">
    336363            <div class="alignleft actions bulkactions">
    337                 <?php $this->bulk_actions( $which ); ?>
     364                <?php
     365                $this->bulk_actions( $which );
     366                ?>
    338367            </div>
    339368            <?php
    340369            $this->extra_tablenav( $which );
    341370            $this->pagination( $which );
     371            $this->filters( $which );
    342372            ?>
    343373
    344374            <br class="clear" />
     375        </div>
     376        <?php
     377
     378    }
     379
     380    /**
     381     * Display the filters
     382     *
     383     * @since   3.0.1
     384     *
     385     * @param   string $which  The location of the bulk actions: 'top' or 'bottom'.
     386     */
     387    public function filters( $which ) {
     388
     389        // Don't output filters if not on the top.
     390        if ( 'top' !== $which ) {
     391            return;
     392        }
     393
     394        // Don't output filters if no filters are defined.
     395        if ( ! $this->filters ) {
     396            return;
     397        }
     398
     399        ?>
     400        <div class="alignleft actions filters">
     401            <?php
     402            foreach ( $this->filters as $filter_key => $filter ) {
     403                ?>
     404                <select name="filters[<?php echo esc_attr( $filter_key ); ?>]">
     405                    <option value=""><?php echo esc_html( $filter['label'] ); ?></option>
     406                    <?php
     407                    foreach ( $filter['options'] as $option_key => $option_value ) {
     408                        ?>
     409                        <option value="<?php echo esc_attr( $option_key ); ?>"<?php selected( $option_key, $this->get_filter( $filter_key ) ); ?>><?php echo esc_attr( $option_value ); ?></option>
     410                        <?php
     411                    }
     412                    ?>
     413                </select>
     414                <?php
     415            }
     416
     417            submit_button( __( 'Filter', 'convertkit' ), '', 'filter_action', false );
     418            ?>
    345419        </div>
    346420        <?php
     
    412486
    413487    /**
     488     * Get the filter requested by the user
     489     *
     490     * @since   3.0.1
     491     *
     492     * @param   string $key  Filter key.
     493     * @return  string
     494     */
     495    public function get_filter( $key ) {
     496
     497        // Bail if nonce is not valid.
     498        if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ), 'bulk-' . $this->_args['plural'] ) ) {
     499            return '';
     500        }
     501
     502        if ( ! array_key_exists( 'filters', $_REQUEST ) || ! array_key_exists( $key, $_REQUEST['filters'] ) ) {
     503            return '';
     504        }
     505
     506        return urldecode( sanitize_text_field( wp_unslash( $_REQUEST['filters'][ $key ] ) ) );
     507
     508    }
     509
     510    /**
    414511     * Get the Order By requested by the user
    415512     *
  • convertkit/tags/3.0.1/admin/section/class-convertkit-admin-section-form-entries.php

    r3357832 r3359712  
    141141        $table->add_bulk_action( 'export', __( 'Export', 'convertkit' ) );
    142142        $table->add_bulk_action( 'delete', __( 'Delete', 'convertkit' ) );
     143
     144        // Add filters to table.
     145        $table->add_filter(
     146            'api_result',
     147            __( 'All Results', 'convertkit' ),
     148            array(
     149                'success' => __( 'Success', 'convertkit' ),
     150                'error'   => __( 'Error', 'convertkit' ),
     151            )
     152        );
    143153
    144154        // Add columns to table.
     
    158168        $entries = $form_entries->search(
    159169            $table->get_search(),
     170            $table->get_filter( 'api_result' ),
    160171            $table->get_order_by( 'created_at' ),
    161172            $table->get_order( 'desc' ),
     
    166177
    167178        // Set total entries and items per page options key.
    168         $table->set_total_items( $form_entries->total( $table->get_search() ) );
     179        $table->set_total_items( $form_entries->total( $table->get_search(), $table->get_filter( 'api_result' ) ) );
    169180        $table->set_items_per_page_screen_options_key( 'convertkit_form_entries_per_page' );
    170181
  • convertkit/tags/3.0.1/includes/blocks/class-convertkit-block-form-builder-field.php

    r3357832 r3359712  
    280280        $css_styles  = $this->get_css_styles( $atts );
    281281
     282        // Determine if the field is required.
     283        $field_required = $this->field_required ? true : ( $atts['required'] ? true : false );
     284
    282285        // Build input / textarea.
    283286        switch ( $this->field_type ) {
     
    287290                    esc_attr( sanitize_title( $this->field_id ) ),
    288291                    esc_attr( $this->field_name ),
    289                     $this->field_required ? ' required' : ( $atts['required'] ? ' required' : '' )
     292                    $field_required ? ' required' : ''
    290293                );
    291294                break;
     
    296299                    esc_attr( sanitize_title( $this->field_id ) ),
    297300                    esc_attr( $this->field_name ),
    298                     $this->field_required ? ' required' : ( $atts['required'] ? ' required' : '' )
     301                    $field_required ? ' required' : ''
    299302                );
    300303                break;
     
    303306        // Build field HTML.
    304307        $html = sprintf(
    305             '<div class="%s" style="%s"><label for="%s">%s</label>%s</div>',
     308            '<div class="%s" style="%s"><label for="%s">%s%s</label>%s</div>',
    306309            implode( ' ', map_deep( $css_classes, 'sanitize_html_class' ) ),
    307310            implode( ';', map_deep( $css_styles, 'esc_attr' ) ),
    308311            esc_attr( sanitize_title( $this->field_id ) ),
    309312            esc_html( $atts['label'] ),
     313            ( $field_required ? ' <span class="convertkit-form-builder-field-required">*</span>' : '' ),
    310314            $field
    311315        );
  • convertkit/tags/3.0.1/includes/class-convertkit-cache-plugins.php

    r3337204 r3359712  
    5252        add_filter( 'convertkit_output_script_footer', array( $this, 'autoptimize_exclude_js_defer' ) );
    5353        add_filter( 'convertkit_resource_forms_output_script', array( $this, 'autoptimize_exclude_js_defer' ) );
     54        add_filter( 'autoptimize_filter_imgopt_should_lazyload', array( $this, 'disable_image_lazy_loading_on_landing_pages' ) );
    5455
    5556        // Debloat: Exclude Forms from Delay Load JS.
     
    6869        add_filter( 'convertkit_output_script_footer', array( $this, 'perfmatters_exclude_delay_js' ) );
    6970        add_filter( 'convertkit_resource_forms_output_script', array( $this, 'perfmatters_exclude_delay_js' ) );
    70         add_filter( 'perfmatters_lazyload', array( $this, 'perfmatters_disable_lazy_loading_on_landing_pages' ) );
     71        add_filter( 'perfmatters_lazyload', array( $this, 'disable_image_lazy_loading_on_landing_pages' ) );
    7172
    7273        // Siteground Speed Optimizer: Exclude Forms from JS combine.
     
    177178
    178179    /**
    179      * Disable lazy loading in Perfmatters when a WordPress Page configured to display a
     180     * Disable image lazy loading when a WordPress Page configured to display a
    180181     * ConvertKit Landing Page is viewed.
    181182     *
     
    185186     * @return  bool
    186187     */
    187     public function perfmatters_disable_lazy_loading_on_landing_pages( $enabled ) {
     188    public function disable_image_lazy_loading_on_landing_pages( $enabled ) {
    188189
    189190        // If the request isn't for a Page, don't change lazy loading settings.
     
    199200
    200201        // ConvertKit Landing Page is going to be displayed.
    201         // Disable Perfmatters Lazy Loading so that the Landing Page images display.
     202        // Disable image lazy loading so that the Landing Page images display.
    202203        return false;
    203204
  • convertkit/tags/3.0.1/includes/class-convertkit-form-entries.php

    r3357832 r3359712  
    274274     *
    275275     * @param   bool|string $search     Search Query.
     276     * @param   bool|string $api_result API Result.
    276277     * @param   string      $order_by   Order Results By.
    277278     * @param   string      $order      Order (asc|desc).
     
    280281     * @return  array
    281282     */
    282     public function search( $search = false, $order_by = 'created_at', $order = 'desc', $page = 1, $per_page = 25 ) {
     283    public function search( $search = false, $api_result = false, $order_by = 'created_at', $order = 'desc', $page = 1, $per_page = 25 ) {
    283284
    284285        global $wpdb;
     
    290291        );
    291292
    292         // Add search clause.
    293         if ( $search ) {
    294             $query .= $wpdb->prepare(
    295                 ' WHERE first_name LIKE %s OR email LIKE %s',
    296                 '%' . $search . '%',
    297                 '%' . $search . '%'
    298             );
     293        // Build where clauses.
     294        $where_clauses = $this->build_where_clauses( $search, $api_result );
     295
     296        // If where clauses are provided, add them to the query.
     297        if ( count( $where_clauses ) ) {
     298            $query .= ' WHERE ' . implode( ' AND ', $where_clauses );
    299299        }
    300300
     
    323323     *
    324324     * @param   bool|string $search     Search Query.
     325     * @param   bool|string $api_result API Result.
    325326     * @return  int
    326327     */
    327     public function total( $search = false ) {
     328    public function total( $search = false, $api_result = false ) {
    328329
    329330        global $wpdb;
     
    336337        );
    337338
     339        // Build where clauses.
     340        $where_clauses = $this->build_where_clauses( $search, $api_result );
     341
     342        // If where clauses are provided, add them to the query.
     343        if ( count( $where_clauses ) ) {
     344            $query .= ' WHERE ' . implode( ' AND ', $where_clauses );
     345        }
     346
     347        // Run and return total records found.
     348        return (int) $wpdb->get_var( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
     349
     350    }
     351
     352    /**
     353     * Builds the where clauses for the given query parameters
     354     *
     355     * @since   3.0.1
     356     *
     357     * @param   bool|string $search     Search Query.
     358     * @param   bool|string $api_result API Result.
     359     * @return  array
     360     */
     361    private function build_where_clauses( $search = false, $api_result = false ) {
     362
     363        global $wpdb;
     364
     365        $where_clauses = array();
     366
    338367        // Add search clause.
    339368        if ( $search ) {
    340             $query .= $wpdb->prepare(
    341                 ' WHERE first_name LIKE %s OR email LIKE %s',
     369            $where_clauses[] = $wpdb->prepare(
     370                '(first_name LIKE %s OR email LIKE %s)',
    342371                '%' . $search . '%',
    343372                '%' . $search . '%'
     
    345374        }
    346375
    347         // Run and return total records found.
    348         return (int) $wpdb->get_var( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
     376        // Add API result clause.
     377        if ( $api_result ) {
     378            $where_clauses[] = $wpdb->prepare(
     379                'api_result = %s',
     380                $api_result
     381            );
     382        }
     383
     384        return $where_clauses;
    349385
    350386    }
  • convertkit/tags/3.0.1/includes/class-convertkit-html-parser.php

    r3357832 r3359712  
    6868    public function get_body_html() {
    6969
    70         // Return modified content in the <body> tag.
    71         preg_match( '/<body[^>]*>(.*?)<\/body>/is', $this->html->saveHTML(), $matches );
    72         return $matches[1] ?? '';
     70        $body = $this->html->getElementsByTagName( 'body' )->item( 0 );
     71
     72        $html = '';
     73        foreach ( $body->childNodes as $child ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
     74            $html .= $this->html->saveHTML( $child );
     75        }
     76
     77        return $html;
    7378
    7479    }
  • convertkit/tags/3.0.1/languages/convertkit.pot

    r3357832 r3359712  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Kit (formerly ConvertKit) 3.0.0\n"
     5"Project-Id-Version: Kit (formerly ConvertKit) 3.0.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-09-08T02:02:21+00:00\n"
     12"POT-Creation-Date: 2025-09-11T05:00:40+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    143143msgstr ""
    144144
    145 #: admin/class-convertkit-wp-list-table.php:161
    146 #: admin/section/class-convertkit-admin-section-form-entries.php:180
     145#: admin/class-convertkit-wp-list-table.php:170
     146#: admin/section/class-convertkit-admin-section-form-entries.php:191
    147147msgid "Search"
     148msgstr ""
     149
     150#: admin/class-convertkit-wp-list-table.php:417
     151msgid "Filter"
    148152msgstr ""
    149153
     
    311315msgstr ""
    312316
    313 #: admin/section/class-convertkit-admin-section-form-entries.php:145
     317#: admin/section/class-convertkit-admin-section-form-entries.php:147
     318msgid "All Results"
     319msgstr ""
     320
     321#: admin/section/class-convertkit-admin-section-form-entries.php:149
     322msgid "Success"
     323msgstr ""
     324
     325#: admin/section/class-convertkit-admin-section-form-entries.php:150
     326#: admin/section/class-convertkit-admin-section-form-entries.php:162
     327msgid "Error"
     328msgstr ""
     329
     330#: admin/section/class-convertkit-admin-section-form-entries.php:155
    314331msgid "Select"
    315332msgstr ""
    316333
    317 #: admin/section/class-convertkit-admin-section-form-entries.php:146
     334#: admin/section/class-convertkit-admin-section-form-entries.php:156
    318335msgid "Post ID"
    319336msgstr ""
    320337
    321 #: admin/section/class-convertkit-admin-section-form-entries.php:147
     338#: admin/section/class-convertkit-admin-section-form-entries.php:157
    322339msgid "First Name"
    323340msgstr ""
    324341
    325 #: admin/section/class-convertkit-admin-section-form-entries.php:148
     342#: admin/section/class-convertkit-admin-section-form-entries.php:158
    326343#: includes/blocks/class-convertkit-block-form-builder-field-email.php:78
    327344msgid "Email"
    328345msgstr ""
    329346
    330 #: admin/section/class-convertkit-admin-section-form-entries.php:149
     347#: admin/section/class-convertkit-admin-section-form-entries.php:159
    331348msgid "Created"
    332349msgstr ""
    333350
    334 #: admin/section/class-convertkit-admin-section-form-entries.php:150
     351#: admin/section/class-convertkit-admin-section-form-entries.php:160
    335352msgid "Updated"
    336353msgstr ""
    337354
    338 #: admin/section/class-convertkit-admin-section-form-entries.php:151
     355#: admin/section/class-convertkit-admin-section-form-entries.php:161
    339356msgid "Result"
    340357msgstr ""
    341358
    342 #: admin/section/class-convertkit-admin-section-form-entries.php:152
    343 msgid "Error"
    344 msgstr ""
    345 
    346 #: admin/section/class-convertkit-admin-section-form-entries.php:174
     359#: admin/section/class-convertkit-admin-section-form-entries.php:185
    347360msgid "Search results for"
    348361msgstr ""
    349362
    350 #: admin/section/class-convertkit-admin-section-form-entries.php:206
     363#: admin/section/class-convertkit-admin-section-form-entries.php:217
    351364msgid "Form Entries per Page"
    352365msgstr ""
  • convertkit/tags/3.0.1/readme.txt

    r3357832 r3359712  
    66Tested up to: 6.8
    77Requires PHP: 7.1
    8 Stable tag: 3.0.0
     8Stable tag: 3.0.1
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    180180== Changelog ==
    181181
     182### 3.0.1 2025-09-11
     183* Added: Blocks: Form Builder: Display asterisk for required fields
     184* Added: Settings: Form Entries: Filter by API result
     185* Fix: Landing Pages: Prevent Autoptimize lazy loading images on Landing Pages, which would result in missing images
     186* Updated: Improved HTML parsing for Broadcasts and Form Builder block
     187
    182188### 3.0.0 2025-09-08
    183189* Added: Blocks: Form Builder. Create your own subscription forms with custom fields, tag and sequence support, within the block editor
  • convertkit/tags/3.0.1/resources/backend/css/settings.css

    r3357832 r3359712  
    208208    margin-bottom: 10px;
    209209}
    210 body.settings_page__wp_convertkit_settings .wrap .tablenav input.button.action {
     210body.settings_page__wp_convertkit_settings .wrap .tablenav input.button {
    211211    height: 20px;
    212212    line-height: 20px;
  • convertkit/tags/3.0.1/resources/frontend/css/form-builder.css

    r3357832 r3359712  
    1111    font-family: inherit;
    1212}
     13.wp-block-convertkit-form-builder-field label span.convertkit-form-builder-field-required {
     14    color: red;
     15}
    1316form .convertkit-form-builder-subscribed-message {
    1417    width: 100%;
  • convertkit/tags/3.0.1/wp-convertkit.php

    r3357832 r3359712  
    1010 * Plugin URI: https://kit.com/
    1111 * Description: Display Kit (formerly ConvertKit) email subscription forms, landing pages, products, broadcasts and more.
    12  * Version: 3.0.0
     12 * Version: 3.0.1
    1313 * Author: Kit
    1414 * Author URI: https://kit.com/
     
    2828define( 'CONVERTKIT_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    2929define( 'CONVERTKIT_PLUGIN_PATH', __DIR__ );
    30 define( 'CONVERTKIT_PLUGIN_VERSION', '3.0.0' );
     30define( 'CONVERTKIT_PLUGIN_VERSION', '3.0.1' );
    3131define( 'CONVERTKIT_OAUTH_CLIENT_ID', 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y' );
    3232define( 'CONVERTKIT_OAUTH_CLIENT_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' );
  • convertkit/trunk/admin/class-convertkit-wp-list-table.php

    r3357832 r3359712  
    4747     */
    4848    private $bulk_actions = array();
     49
     50    /**
     51     * Holds the supported filters.
     52     *
     53     * @since   3.0.1
     54     *
     55     * @var     array
     56     */
     57    private $filters = array();
    4958
    5059    /**
     
    287296
    288297    /**
     298     * Add a filter to the table
     299     *
     300     * @since   3.0.1
     301     *
     302     * @param string $key     Filter name.
     303     * @param string $label   Filter label.
     304     * @param array  $options Filter options.
     305     */
     306    public function add_filter( $key, $label, $options ) {
     307
     308        $this->filters[ $key ] = array(
     309            'label'   => $label,
     310            'options' => $options,
     311        );
     312
     313    }
     314
     315    /**
    289316     * Define table columns and pagination for this WP_List_Table.
    290317     *
     
    335362        <div class="tablenav <?php echo esc_attr( $which ); ?>">
    336363            <div class="alignleft actions bulkactions">
    337                 <?php $this->bulk_actions( $which ); ?>
     364                <?php
     365                $this->bulk_actions( $which );
     366                ?>
    338367            </div>
    339368            <?php
    340369            $this->extra_tablenav( $which );
    341370            $this->pagination( $which );
     371            $this->filters( $which );
    342372            ?>
    343373
    344374            <br class="clear" />
     375        </div>
     376        <?php
     377
     378    }
     379
     380    /**
     381     * Display the filters
     382     *
     383     * @since   3.0.1
     384     *
     385     * @param   string $which  The location of the bulk actions: 'top' or 'bottom'.
     386     */
     387    public function filters( $which ) {
     388
     389        // Don't output filters if not on the top.
     390        if ( 'top' !== $which ) {
     391            return;
     392        }
     393
     394        // Don't output filters if no filters are defined.
     395        if ( ! $this->filters ) {
     396            return;
     397        }
     398
     399        ?>
     400        <div class="alignleft actions filters">
     401            <?php
     402            foreach ( $this->filters as $filter_key => $filter ) {
     403                ?>
     404                <select name="filters[<?php echo esc_attr( $filter_key ); ?>]">
     405                    <option value=""><?php echo esc_html( $filter['label'] ); ?></option>
     406                    <?php
     407                    foreach ( $filter['options'] as $option_key => $option_value ) {
     408                        ?>
     409                        <option value="<?php echo esc_attr( $option_key ); ?>"<?php selected( $option_key, $this->get_filter( $filter_key ) ); ?>><?php echo esc_attr( $option_value ); ?></option>
     410                        <?php
     411                    }
     412                    ?>
     413                </select>
     414                <?php
     415            }
     416
     417            submit_button( __( 'Filter', 'convertkit' ), '', 'filter_action', false );
     418            ?>
    345419        </div>
    346420        <?php
     
    412486
    413487    /**
     488     * Get the filter requested by the user
     489     *
     490     * @since   3.0.1
     491     *
     492     * @param   string $key  Filter key.
     493     * @return  string
     494     */
     495    public function get_filter( $key ) {
     496
     497        // Bail if nonce is not valid.
     498        if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ), 'bulk-' . $this->_args['plural'] ) ) {
     499            return '';
     500        }
     501
     502        if ( ! array_key_exists( 'filters', $_REQUEST ) || ! array_key_exists( $key, $_REQUEST['filters'] ) ) {
     503            return '';
     504        }
     505
     506        return urldecode( sanitize_text_field( wp_unslash( $_REQUEST['filters'][ $key ] ) ) );
     507
     508    }
     509
     510    /**
    414511     * Get the Order By requested by the user
    415512     *
  • convertkit/trunk/admin/section/class-convertkit-admin-section-form-entries.php

    r3357832 r3359712  
    141141        $table->add_bulk_action( 'export', __( 'Export', 'convertkit' ) );
    142142        $table->add_bulk_action( 'delete', __( 'Delete', 'convertkit' ) );
     143
     144        // Add filters to table.
     145        $table->add_filter(
     146            'api_result',
     147            __( 'All Results', 'convertkit' ),
     148            array(
     149                'success' => __( 'Success', 'convertkit' ),
     150                'error'   => __( 'Error', 'convertkit' ),
     151            )
     152        );
    143153
    144154        // Add columns to table.
     
    158168        $entries = $form_entries->search(
    159169            $table->get_search(),
     170            $table->get_filter( 'api_result' ),
    160171            $table->get_order_by( 'created_at' ),
    161172            $table->get_order( 'desc' ),
     
    166177
    167178        // Set total entries and items per page options key.
    168         $table->set_total_items( $form_entries->total( $table->get_search() ) );
     179        $table->set_total_items( $form_entries->total( $table->get_search(), $table->get_filter( 'api_result' ) ) );
    169180        $table->set_items_per_page_screen_options_key( 'convertkit_form_entries_per_page' );
    170181
  • convertkit/trunk/includes/blocks/class-convertkit-block-form-builder-field.php

    r3357832 r3359712  
    280280        $css_styles  = $this->get_css_styles( $atts );
    281281
     282        // Determine if the field is required.
     283        $field_required = $this->field_required ? true : ( $atts['required'] ? true : false );
     284
    282285        // Build input / textarea.
    283286        switch ( $this->field_type ) {
     
    287290                    esc_attr( sanitize_title( $this->field_id ) ),
    288291                    esc_attr( $this->field_name ),
    289                     $this->field_required ? ' required' : ( $atts['required'] ? ' required' : '' )
     292                    $field_required ? ' required' : ''
    290293                );
    291294                break;
     
    296299                    esc_attr( sanitize_title( $this->field_id ) ),
    297300                    esc_attr( $this->field_name ),
    298                     $this->field_required ? ' required' : ( $atts['required'] ? ' required' : '' )
     301                    $field_required ? ' required' : ''
    299302                );
    300303                break;
     
    303306        // Build field HTML.
    304307        $html = sprintf(
    305             '<div class="%s" style="%s"><label for="%s">%s</label>%s</div>',
     308            '<div class="%s" style="%s"><label for="%s">%s%s</label>%s</div>',
    306309            implode( ' ', map_deep( $css_classes, 'sanitize_html_class' ) ),
    307310            implode( ';', map_deep( $css_styles, 'esc_attr' ) ),
    308311            esc_attr( sanitize_title( $this->field_id ) ),
    309312            esc_html( $atts['label'] ),
     313            ( $field_required ? ' <span class="convertkit-form-builder-field-required">*</span>' : '' ),
    310314            $field
    311315        );
  • convertkit/trunk/includes/class-convertkit-cache-plugins.php

    r3337204 r3359712  
    5252        add_filter( 'convertkit_output_script_footer', array( $this, 'autoptimize_exclude_js_defer' ) );
    5353        add_filter( 'convertkit_resource_forms_output_script', array( $this, 'autoptimize_exclude_js_defer' ) );
     54        add_filter( 'autoptimize_filter_imgopt_should_lazyload', array( $this, 'disable_image_lazy_loading_on_landing_pages' ) );
    5455
    5556        // Debloat: Exclude Forms from Delay Load JS.
     
    6869        add_filter( 'convertkit_output_script_footer', array( $this, 'perfmatters_exclude_delay_js' ) );
    6970        add_filter( 'convertkit_resource_forms_output_script', array( $this, 'perfmatters_exclude_delay_js' ) );
    70         add_filter( 'perfmatters_lazyload', array( $this, 'perfmatters_disable_lazy_loading_on_landing_pages' ) );
     71        add_filter( 'perfmatters_lazyload', array( $this, 'disable_image_lazy_loading_on_landing_pages' ) );
    7172
    7273        // Siteground Speed Optimizer: Exclude Forms from JS combine.
     
    177178
    178179    /**
    179      * Disable lazy loading in Perfmatters when a WordPress Page configured to display a
     180     * Disable image lazy loading when a WordPress Page configured to display a
    180181     * ConvertKit Landing Page is viewed.
    181182     *
     
    185186     * @return  bool
    186187     */
    187     public function perfmatters_disable_lazy_loading_on_landing_pages( $enabled ) {
     188    public function disable_image_lazy_loading_on_landing_pages( $enabled ) {
    188189
    189190        // If the request isn't for a Page, don't change lazy loading settings.
     
    199200
    200201        // ConvertKit Landing Page is going to be displayed.
    201         // Disable Perfmatters Lazy Loading so that the Landing Page images display.
     202        // Disable image lazy loading so that the Landing Page images display.
    202203        return false;
    203204
  • convertkit/trunk/includes/class-convertkit-form-entries.php

    r3357832 r3359712  
    274274     *
    275275     * @param   bool|string $search     Search Query.
     276     * @param   bool|string $api_result API Result.
    276277     * @param   string      $order_by   Order Results By.
    277278     * @param   string      $order      Order (asc|desc).
     
    280281     * @return  array
    281282     */
    282     public function search( $search = false, $order_by = 'created_at', $order = 'desc', $page = 1, $per_page = 25 ) {
     283    public function search( $search = false, $api_result = false, $order_by = 'created_at', $order = 'desc', $page = 1, $per_page = 25 ) {
    283284
    284285        global $wpdb;
     
    290291        );
    291292
    292         // Add search clause.
    293         if ( $search ) {
    294             $query .= $wpdb->prepare(
    295                 ' WHERE first_name LIKE %s OR email LIKE %s',
    296                 '%' . $search . '%',
    297                 '%' . $search . '%'
    298             );
     293        // Build where clauses.
     294        $where_clauses = $this->build_where_clauses( $search, $api_result );
     295
     296        // If where clauses are provided, add them to the query.
     297        if ( count( $where_clauses ) ) {
     298            $query .= ' WHERE ' . implode( ' AND ', $where_clauses );
    299299        }
    300300
     
    323323     *
    324324     * @param   bool|string $search     Search Query.
     325     * @param   bool|string $api_result API Result.
    325326     * @return  int
    326327     */
    327     public function total( $search = false ) {
     328    public function total( $search = false, $api_result = false ) {
    328329
    329330        global $wpdb;
     
    336337        );
    337338
     339        // Build where clauses.
     340        $where_clauses = $this->build_where_clauses( $search, $api_result );
     341
     342        // If where clauses are provided, add them to the query.
     343        if ( count( $where_clauses ) ) {
     344            $query .= ' WHERE ' . implode( ' AND ', $where_clauses );
     345        }
     346
     347        // Run and return total records found.
     348        return (int) $wpdb->get_var( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
     349
     350    }
     351
     352    /**
     353     * Builds the where clauses for the given query parameters
     354     *
     355     * @since   3.0.1
     356     *
     357     * @param   bool|string $search     Search Query.
     358     * @param   bool|string $api_result API Result.
     359     * @return  array
     360     */
     361    private function build_where_clauses( $search = false, $api_result = false ) {
     362
     363        global $wpdb;
     364
     365        $where_clauses = array();
     366
    338367        // Add search clause.
    339368        if ( $search ) {
    340             $query .= $wpdb->prepare(
    341                 ' WHERE first_name LIKE %s OR email LIKE %s',
     369            $where_clauses[] = $wpdb->prepare(
     370                '(first_name LIKE %s OR email LIKE %s)',
    342371                '%' . $search . '%',
    343372                '%' . $search . '%'
     
    345374        }
    346375
    347         // Run and return total records found.
    348         return (int) $wpdb->get_var( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
     376        // Add API result clause.
     377        if ( $api_result ) {
     378            $where_clauses[] = $wpdb->prepare(
     379                'api_result = %s',
     380                $api_result
     381            );
     382        }
     383
     384        return $where_clauses;
    349385
    350386    }
  • convertkit/trunk/includes/class-convertkit-html-parser.php

    r3357832 r3359712  
    6868    public function get_body_html() {
    6969
    70         // Return modified content in the <body> tag.
    71         preg_match( '/<body[^>]*>(.*?)<\/body>/is', $this->html->saveHTML(), $matches );
    72         return $matches[1] ?? '';
     70        $body = $this->html->getElementsByTagName( 'body' )->item( 0 );
     71
     72        $html = '';
     73        foreach ( $body->childNodes as $child ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
     74            $html .= $this->html->saveHTML( $child );
     75        }
     76
     77        return $html;
    7378
    7479    }
  • convertkit/trunk/languages/convertkit.pot

    r3357832 r3359712  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Kit (formerly ConvertKit) 3.0.0\n"
     5"Project-Id-Version: Kit (formerly ConvertKit) 3.0.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-09-08T02:02:21+00:00\n"
     12"POT-Creation-Date: 2025-09-11T05:00:40+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    143143msgstr ""
    144144
    145 #: admin/class-convertkit-wp-list-table.php:161
    146 #: admin/section/class-convertkit-admin-section-form-entries.php:180
     145#: admin/class-convertkit-wp-list-table.php:170
     146#: admin/section/class-convertkit-admin-section-form-entries.php:191
    147147msgid "Search"
     148msgstr ""
     149
     150#: admin/class-convertkit-wp-list-table.php:417
     151msgid "Filter"
    148152msgstr ""
    149153
     
    311315msgstr ""
    312316
    313 #: admin/section/class-convertkit-admin-section-form-entries.php:145
     317#: admin/section/class-convertkit-admin-section-form-entries.php:147
     318msgid "All Results"
     319msgstr ""
     320
     321#: admin/section/class-convertkit-admin-section-form-entries.php:149
     322msgid "Success"
     323msgstr ""
     324
     325#: admin/section/class-convertkit-admin-section-form-entries.php:150
     326#: admin/section/class-convertkit-admin-section-form-entries.php:162
     327msgid "Error"
     328msgstr ""
     329
     330#: admin/section/class-convertkit-admin-section-form-entries.php:155
    314331msgid "Select"
    315332msgstr ""
    316333
    317 #: admin/section/class-convertkit-admin-section-form-entries.php:146
     334#: admin/section/class-convertkit-admin-section-form-entries.php:156
    318335msgid "Post ID"
    319336msgstr ""
    320337
    321 #: admin/section/class-convertkit-admin-section-form-entries.php:147
     338#: admin/section/class-convertkit-admin-section-form-entries.php:157
    322339msgid "First Name"
    323340msgstr ""
    324341
    325 #: admin/section/class-convertkit-admin-section-form-entries.php:148
     342#: admin/section/class-convertkit-admin-section-form-entries.php:158
    326343#: includes/blocks/class-convertkit-block-form-builder-field-email.php:78
    327344msgid "Email"
    328345msgstr ""
    329346
    330 #: admin/section/class-convertkit-admin-section-form-entries.php:149
     347#: admin/section/class-convertkit-admin-section-form-entries.php:159
    331348msgid "Created"
    332349msgstr ""
    333350
    334 #: admin/section/class-convertkit-admin-section-form-entries.php:150
     351#: admin/section/class-convertkit-admin-section-form-entries.php:160
    335352msgid "Updated"
    336353msgstr ""
    337354
    338 #: admin/section/class-convertkit-admin-section-form-entries.php:151
     355#: admin/section/class-convertkit-admin-section-form-entries.php:161
    339356msgid "Result"
    340357msgstr ""
    341358
    342 #: admin/section/class-convertkit-admin-section-form-entries.php:152
    343 msgid "Error"
    344 msgstr ""
    345 
    346 #: admin/section/class-convertkit-admin-section-form-entries.php:174
     359#: admin/section/class-convertkit-admin-section-form-entries.php:185
    347360msgid "Search results for"
    348361msgstr ""
    349362
    350 #: admin/section/class-convertkit-admin-section-form-entries.php:206
     363#: admin/section/class-convertkit-admin-section-form-entries.php:217
    351364msgid "Form Entries per Page"
    352365msgstr ""
  • convertkit/trunk/readme.txt

    r3357832 r3359712  
    66Tested up to: 6.8
    77Requires PHP: 7.1
    8 Stable tag: 3.0.0
     8Stable tag: 3.0.1
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    180180== Changelog ==
    181181
     182### 3.0.1 2025-09-11
     183* Added: Blocks: Form Builder: Display asterisk for required fields
     184* Added: Settings: Form Entries: Filter by API result
     185* Fix: Landing Pages: Prevent Autoptimize lazy loading images on Landing Pages, which would result in missing images
     186* Updated: Improved HTML parsing for Broadcasts and Form Builder block
     187
    182188### 3.0.0 2025-09-08
    183189* Added: Blocks: Form Builder. Create your own subscription forms with custom fields, tag and sequence support, within the block editor
  • convertkit/trunk/resources/backend/css/settings.css

    r3357832 r3359712  
    208208    margin-bottom: 10px;
    209209}
    210 body.settings_page__wp_convertkit_settings .wrap .tablenav input.button.action {
     210body.settings_page__wp_convertkit_settings .wrap .tablenav input.button {
    211211    height: 20px;
    212212    line-height: 20px;
  • convertkit/trunk/resources/frontend/css/form-builder.css

    r3357832 r3359712  
    1111    font-family: inherit;
    1212}
     13.wp-block-convertkit-form-builder-field label span.convertkit-form-builder-field-required {
     14    color: red;
     15}
    1316form .convertkit-form-builder-subscribed-message {
    1417    width: 100%;
  • convertkit/trunk/wp-convertkit.php

    r3357832 r3359712  
    1010 * Plugin URI: https://kit.com/
    1111 * Description: Display Kit (formerly ConvertKit) email subscription forms, landing pages, products, broadcasts and more.
    12  * Version: 3.0.0
     12 * Version: 3.0.1
    1313 * Author: Kit
    1414 * Author URI: https://kit.com/
     
    2828define( 'CONVERTKIT_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    2929define( 'CONVERTKIT_PLUGIN_PATH', __DIR__ );
    30 define( 'CONVERTKIT_PLUGIN_VERSION', '3.0.0' );
     30define( 'CONVERTKIT_PLUGIN_VERSION', '3.0.1' );
    3131define( 'CONVERTKIT_OAUTH_CLIENT_ID', 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y' );
    3232define( 'CONVERTKIT_OAUTH_CLIENT_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' );
Note: See TracChangeset for help on using the changeset viewer.