Changeset 3359712
- Timestamp:
- 09/11/2025 09:17:17 AM (6 months ago)
- Location:
- convertkit
- Files:
-
- 22 edited
- 1 copied
-
tags/3.0.1 (copied) (copied from convertkit/trunk)
-
tags/3.0.1/admin/class-convertkit-wp-list-table.php (modified) (4 diffs)
-
tags/3.0.1/admin/section/class-convertkit-admin-section-form-entries.php (modified) (3 diffs)
-
tags/3.0.1/includes/blocks/class-convertkit-block-form-builder-field.php (modified) (4 diffs)
-
tags/3.0.1/includes/class-convertkit-cache-plugins.php (modified) (5 diffs)
-
tags/3.0.1/includes/class-convertkit-form-entries.php (modified) (6 diffs)
-
tags/3.0.1/includes/class-convertkit-html-parser.php (modified) (1 diff)
-
tags/3.0.1/languages/convertkit.pot (modified) (4 diffs)
-
tags/3.0.1/readme.txt (modified) (2 diffs)
-
tags/3.0.1/resources/backend/css/settings.css (modified) (1 diff)
-
tags/3.0.1/resources/frontend/css/form-builder.css (modified) (1 diff)
-
tags/3.0.1/wp-convertkit.php (modified) (2 diffs)
-
trunk/admin/class-convertkit-wp-list-table.php (modified) (4 diffs)
-
trunk/admin/section/class-convertkit-admin-section-form-entries.php (modified) (3 diffs)
-
trunk/includes/blocks/class-convertkit-block-form-builder-field.php (modified) (4 diffs)
-
trunk/includes/class-convertkit-cache-plugins.php (modified) (5 diffs)
-
trunk/includes/class-convertkit-form-entries.php (modified) (6 diffs)
-
trunk/includes/class-convertkit-html-parser.php (modified) (1 diff)
-
trunk/languages/convertkit.pot (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/resources/backend/css/settings.css (modified) (1 diff)
-
trunk/resources/frontend/css/form-builder.css (modified) (1 diff)
-
trunk/wp-convertkit.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
convertkit/tags/3.0.1/admin/class-convertkit-wp-list-table.php
r3357832 r3359712 47 47 */ 48 48 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(); 49 58 50 59 /** … … 287 296 288 297 /** 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 /** 289 316 * Define table columns and pagination for this WP_List_Table. 290 317 * … … 335 362 <div class="tablenav <?php echo esc_attr( $which ); ?>"> 336 363 <div class="alignleft actions bulkactions"> 337 <?php $this->bulk_actions( $which ); ?> 364 <?php 365 $this->bulk_actions( $which ); 366 ?> 338 367 </div> 339 368 <?php 340 369 $this->extra_tablenav( $which ); 341 370 $this->pagination( $which ); 371 $this->filters( $which ); 342 372 ?> 343 373 344 374 <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 ?> 345 419 </div> 346 420 <?php … … 412 486 413 487 /** 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 /** 414 511 * Get the Order By requested by the user 415 512 * -
convertkit/tags/3.0.1/admin/section/class-convertkit-admin-section-form-entries.php
r3357832 r3359712 141 141 $table->add_bulk_action( 'export', __( 'Export', 'convertkit' ) ); 142 142 $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 ); 143 153 144 154 // Add columns to table. … … 158 168 $entries = $form_entries->search( 159 169 $table->get_search(), 170 $table->get_filter( 'api_result' ), 160 171 $table->get_order_by( 'created_at' ), 161 172 $table->get_order( 'desc' ), … … 166 177 167 178 // 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' ) ) ); 169 180 $table->set_items_per_page_screen_options_key( 'convertkit_form_entries_per_page' ); 170 181 -
convertkit/tags/3.0.1/includes/blocks/class-convertkit-block-form-builder-field.php
r3357832 r3359712 280 280 $css_styles = $this->get_css_styles( $atts ); 281 281 282 // Determine if the field is required. 283 $field_required = $this->field_required ? true : ( $atts['required'] ? true : false ); 284 282 285 // Build input / textarea. 283 286 switch ( $this->field_type ) { … … 287 290 esc_attr( sanitize_title( $this->field_id ) ), 288 291 esc_attr( $this->field_name ), 289 $ this->field_required ? ' required' : ( $atts['required'] ? ' required' : '' )292 $field_required ? ' required' : '' 290 293 ); 291 294 break; … … 296 299 esc_attr( sanitize_title( $this->field_id ) ), 297 300 esc_attr( $this->field_name ), 298 $ this->field_required ? ' required' : ( $atts['required'] ? ' required' : '' )301 $field_required ? ' required' : '' 299 302 ); 300 303 break; … … 303 306 // Build field HTML. 304 307 $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>', 306 309 implode( ' ', map_deep( $css_classes, 'sanitize_html_class' ) ), 307 310 implode( ';', map_deep( $css_styles, 'esc_attr' ) ), 308 311 esc_attr( sanitize_title( $this->field_id ) ), 309 312 esc_html( $atts['label'] ), 313 ( $field_required ? ' <span class="convertkit-form-builder-field-required">*</span>' : '' ), 310 314 $field 311 315 ); -
convertkit/tags/3.0.1/includes/class-convertkit-cache-plugins.php
r3337204 r3359712 52 52 add_filter( 'convertkit_output_script_footer', array( $this, 'autoptimize_exclude_js_defer' ) ); 53 53 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' ) ); 54 55 55 56 // Debloat: Exclude Forms from Delay Load JS. … … 68 69 add_filter( 'convertkit_output_script_footer', array( $this, 'perfmatters_exclude_delay_js' ) ); 69 70 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' ) ); 71 72 72 73 // Siteground Speed Optimizer: Exclude Forms from JS combine. … … 177 178 178 179 /** 179 * Disable lazy loading in Perfmatterswhen a WordPress Page configured to display a180 * Disable image lazy loading when a WordPress Page configured to display a 180 181 * ConvertKit Landing Page is viewed. 181 182 * … … 185 186 * @return bool 186 187 */ 187 public function perfmatters_disable_lazy_loading_on_landing_pages( $enabled ) {188 public function disable_image_lazy_loading_on_landing_pages( $enabled ) { 188 189 189 190 // If the request isn't for a Page, don't change lazy loading settings. … … 199 200 200 201 // 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. 202 203 return false; 203 204 -
convertkit/tags/3.0.1/includes/class-convertkit-form-entries.php
r3357832 r3359712 274 274 * 275 275 * @param bool|string $search Search Query. 276 * @param bool|string $api_result API Result. 276 277 * @param string $order_by Order Results By. 277 278 * @param string $order Order (asc|desc). … … 280 281 * @return array 281 282 */ 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 ) { 283 284 284 285 global $wpdb; … … 290 291 ); 291 292 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 ); 299 299 } 300 300 … … 323 323 * 324 324 * @param bool|string $search Search Query. 325 * @param bool|string $api_result API Result. 325 326 * @return int 326 327 */ 327 public function total( $search = false ) {328 public function total( $search = false, $api_result = false ) { 328 329 329 330 global $wpdb; … … 336 337 ); 337 338 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 338 367 // Add search clause. 339 368 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)', 342 371 '%' . $search . '%', 343 372 '%' . $search . '%' … … 345 374 } 346 375 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; 349 385 350 386 } -
convertkit/tags/3.0.1/includes/class-convertkit-html-parser.php
r3357832 r3359712 68 68 public function get_body_html() { 69 69 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; 73 78 74 79 } -
convertkit/tags/3.0.1/languages/convertkit.pot
r3357832 r3359712 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Kit (formerly ConvertKit) 3.0. 0\n"5 "Project-Id-Version: Kit (formerly ConvertKit) 3.0.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "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" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 143 143 msgstr "" 144 144 145 #: admin/class-convertkit-wp-list-table.php:1 61146 #: admin/section/class-convertkit-admin-section-form-entries.php:1 80145 #: admin/class-convertkit-wp-list-table.php:170 146 #: admin/section/class-convertkit-admin-section-form-entries.php:191 147 147 msgid "Search" 148 msgstr "" 149 150 #: admin/class-convertkit-wp-list-table.php:417 151 msgid "Filter" 148 152 msgstr "" 149 153 … … 311 315 msgstr "" 312 316 313 #: admin/section/class-convertkit-admin-section-form-entries.php:145 317 #: admin/section/class-convertkit-admin-section-form-entries.php:147 318 msgid "All Results" 319 msgstr "" 320 321 #: admin/section/class-convertkit-admin-section-form-entries.php:149 322 msgid "Success" 323 msgstr "" 324 325 #: admin/section/class-convertkit-admin-section-form-entries.php:150 326 #: admin/section/class-convertkit-admin-section-form-entries.php:162 327 msgid "Error" 328 msgstr "" 329 330 #: admin/section/class-convertkit-admin-section-form-entries.php:155 314 331 msgid "Select" 315 332 msgstr "" 316 333 317 #: admin/section/class-convertkit-admin-section-form-entries.php:1 46334 #: admin/section/class-convertkit-admin-section-form-entries.php:156 318 335 msgid "Post ID" 319 336 msgstr "" 320 337 321 #: admin/section/class-convertkit-admin-section-form-entries.php:1 47338 #: admin/section/class-convertkit-admin-section-form-entries.php:157 322 339 msgid "First Name" 323 340 msgstr "" 324 341 325 #: admin/section/class-convertkit-admin-section-form-entries.php:1 48342 #: admin/section/class-convertkit-admin-section-form-entries.php:158 326 343 #: includes/blocks/class-convertkit-block-form-builder-field-email.php:78 327 344 msgid "Email" 328 345 msgstr "" 329 346 330 #: admin/section/class-convertkit-admin-section-form-entries.php:1 49347 #: admin/section/class-convertkit-admin-section-form-entries.php:159 331 348 msgid "Created" 332 349 msgstr "" 333 350 334 #: admin/section/class-convertkit-admin-section-form-entries.php:1 50351 #: admin/section/class-convertkit-admin-section-form-entries.php:160 335 352 msgid "Updated" 336 353 msgstr "" 337 354 338 #: admin/section/class-convertkit-admin-section-form-entries.php:1 51355 #: admin/section/class-convertkit-admin-section-form-entries.php:161 339 356 msgid "Result" 340 357 msgstr "" 341 358 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 347 360 msgid "Search results for" 348 361 msgstr "" 349 362 350 #: admin/section/class-convertkit-admin-section-form-entries.php:2 06363 #: admin/section/class-convertkit-admin-section-form-entries.php:217 351 364 msgid "Form Entries per Page" 352 365 msgstr "" -
convertkit/tags/3.0.1/readme.txt
r3357832 r3359712 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.1 8 Stable tag: 3.0. 08 Stable tag: 3.0.1 9 9 License: GPLv3 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 180 180 == Changelog == 181 181 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 182 188 ### 3.0.0 2025-09-08 183 189 * 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 208 208 margin-bottom: 10px; 209 209 } 210 body.settings_page__wp_convertkit_settings .wrap .tablenav input.button .action{210 body.settings_page__wp_convertkit_settings .wrap .tablenav input.button { 211 211 height: 20px; 212 212 line-height: 20px; -
convertkit/tags/3.0.1/resources/frontend/css/form-builder.css
r3357832 r3359712 11 11 font-family: inherit; 12 12 } 13 .wp-block-convertkit-form-builder-field label span.convertkit-form-builder-field-required { 14 color: red; 15 } 13 16 form .convertkit-form-builder-subscribed-message { 14 17 width: 100%; -
convertkit/tags/3.0.1/wp-convertkit.php
r3357832 r3359712 10 10 * Plugin URI: https://kit.com/ 11 11 * Description: Display Kit (formerly ConvertKit) email subscription forms, landing pages, products, broadcasts and more. 12 * Version: 3.0. 012 * Version: 3.0.1 13 13 * Author: Kit 14 14 * Author URI: https://kit.com/ … … 28 28 define( 'CONVERTKIT_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 29 29 define( 'CONVERTKIT_PLUGIN_PATH', __DIR__ ); 30 define( 'CONVERTKIT_PLUGIN_VERSION', '3.0. 0' );30 define( 'CONVERTKIT_PLUGIN_VERSION', '3.0.1' ); 31 31 define( 'CONVERTKIT_OAUTH_CLIENT_ID', 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y' ); 32 32 define( 'CONVERTKIT_OAUTH_CLIENT_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' ); -
convertkit/trunk/admin/class-convertkit-wp-list-table.php
r3357832 r3359712 47 47 */ 48 48 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(); 49 58 50 59 /** … … 287 296 288 297 /** 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 /** 289 316 * Define table columns and pagination for this WP_List_Table. 290 317 * … … 335 362 <div class="tablenav <?php echo esc_attr( $which ); ?>"> 336 363 <div class="alignleft actions bulkactions"> 337 <?php $this->bulk_actions( $which ); ?> 364 <?php 365 $this->bulk_actions( $which ); 366 ?> 338 367 </div> 339 368 <?php 340 369 $this->extra_tablenav( $which ); 341 370 $this->pagination( $which ); 371 $this->filters( $which ); 342 372 ?> 343 373 344 374 <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 ?> 345 419 </div> 346 420 <?php … … 412 486 413 487 /** 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 /** 414 511 * Get the Order By requested by the user 415 512 * -
convertkit/trunk/admin/section/class-convertkit-admin-section-form-entries.php
r3357832 r3359712 141 141 $table->add_bulk_action( 'export', __( 'Export', 'convertkit' ) ); 142 142 $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 ); 143 153 144 154 // Add columns to table. … … 158 168 $entries = $form_entries->search( 159 169 $table->get_search(), 170 $table->get_filter( 'api_result' ), 160 171 $table->get_order_by( 'created_at' ), 161 172 $table->get_order( 'desc' ), … … 166 177 167 178 // 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' ) ) ); 169 180 $table->set_items_per_page_screen_options_key( 'convertkit_form_entries_per_page' ); 170 181 -
convertkit/trunk/includes/blocks/class-convertkit-block-form-builder-field.php
r3357832 r3359712 280 280 $css_styles = $this->get_css_styles( $atts ); 281 281 282 // Determine if the field is required. 283 $field_required = $this->field_required ? true : ( $atts['required'] ? true : false ); 284 282 285 // Build input / textarea. 283 286 switch ( $this->field_type ) { … … 287 290 esc_attr( sanitize_title( $this->field_id ) ), 288 291 esc_attr( $this->field_name ), 289 $ this->field_required ? ' required' : ( $atts['required'] ? ' required' : '' )292 $field_required ? ' required' : '' 290 293 ); 291 294 break; … … 296 299 esc_attr( sanitize_title( $this->field_id ) ), 297 300 esc_attr( $this->field_name ), 298 $ this->field_required ? ' required' : ( $atts['required'] ? ' required' : '' )301 $field_required ? ' required' : '' 299 302 ); 300 303 break; … … 303 306 // Build field HTML. 304 307 $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>', 306 309 implode( ' ', map_deep( $css_classes, 'sanitize_html_class' ) ), 307 310 implode( ';', map_deep( $css_styles, 'esc_attr' ) ), 308 311 esc_attr( sanitize_title( $this->field_id ) ), 309 312 esc_html( $atts['label'] ), 313 ( $field_required ? ' <span class="convertkit-form-builder-field-required">*</span>' : '' ), 310 314 $field 311 315 ); -
convertkit/trunk/includes/class-convertkit-cache-plugins.php
r3337204 r3359712 52 52 add_filter( 'convertkit_output_script_footer', array( $this, 'autoptimize_exclude_js_defer' ) ); 53 53 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' ) ); 54 55 55 56 // Debloat: Exclude Forms from Delay Load JS. … … 68 69 add_filter( 'convertkit_output_script_footer', array( $this, 'perfmatters_exclude_delay_js' ) ); 69 70 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' ) ); 71 72 72 73 // Siteground Speed Optimizer: Exclude Forms from JS combine. … … 177 178 178 179 /** 179 * Disable lazy loading in Perfmatterswhen a WordPress Page configured to display a180 * Disable image lazy loading when a WordPress Page configured to display a 180 181 * ConvertKit Landing Page is viewed. 181 182 * … … 185 186 * @return bool 186 187 */ 187 public function perfmatters_disable_lazy_loading_on_landing_pages( $enabled ) {188 public function disable_image_lazy_loading_on_landing_pages( $enabled ) { 188 189 189 190 // If the request isn't for a Page, don't change lazy loading settings. … … 199 200 200 201 // 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. 202 203 return false; 203 204 -
convertkit/trunk/includes/class-convertkit-form-entries.php
r3357832 r3359712 274 274 * 275 275 * @param bool|string $search Search Query. 276 * @param bool|string $api_result API Result. 276 277 * @param string $order_by Order Results By. 277 278 * @param string $order Order (asc|desc). … … 280 281 * @return array 281 282 */ 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 ) { 283 284 284 285 global $wpdb; … … 290 291 ); 291 292 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 ); 299 299 } 300 300 … … 323 323 * 324 324 * @param bool|string $search Search Query. 325 * @param bool|string $api_result API Result. 325 326 * @return int 326 327 */ 327 public function total( $search = false ) {328 public function total( $search = false, $api_result = false ) { 328 329 329 330 global $wpdb; … … 336 337 ); 337 338 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 338 367 // Add search clause. 339 368 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)', 342 371 '%' . $search . '%', 343 372 '%' . $search . '%' … … 345 374 } 346 375 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; 349 385 350 386 } -
convertkit/trunk/includes/class-convertkit-html-parser.php
r3357832 r3359712 68 68 public function get_body_html() { 69 69 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; 73 78 74 79 } -
convertkit/trunk/languages/convertkit.pot
r3357832 r3359712 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Kit (formerly ConvertKit) 3.0. 0\n"5 "Project-Id-Version: Kit (formerly ConvertKit) 3.0.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "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" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 143 143 msgstr "" 144 144 145 #: admin/class-convertkit-wp-list-table.php:1 61146 #: admin/section/class-convertkit-admin-section-form-entries.php:1 80145 #: admin/class-convertkit-wp-list-table.php:170 146 #: admin/section/class-convertkit-admin-section-form-entries.php:191 147 147 msgid "Search" 148 msgstr "" 149 150 #: admin/class-convertkit-wp-list-table.php:417 151 msgid "Filter" 148 152 msgstr "" 149 153 … … 311 315 msgstr "" 312 316 313 #: admin/section/class-convertkit-admin-section-form-entries.php:145 317 #: admin/section/class-convertkit-admin-section-form-entries.php:147 318 msgid "All Results" 319 msgstr "" 320 321 #: admin/section/class-convertkit-admin-section-form-entries.php:149 322 msgid "Success" 323 msgstr "" 324 325 #: admin/section/class-convertkit-admin-section-form-entries.php:150 326 #: admin/section/class-convertkit-admin-section-form-entries.php:162 327 msgid "Error" 328 msgstr "" 329 330 #: admin/section/class-convertkit-admin-section-form-entries.php:155 314 331 msgid "Select" 315 332 msgstr "" 316 333 317 #: admin/section/class-convertkit-admin-section-form-entries.php:1 46334 #: admin/section/class-convertkit-admin-section-form-entries.php:156 318 335 msgid "Post ID" 319 336 msgstr "" 320 337 321 #: admin/section/class-convertkit-admin-section-form-entries.php:1 47338 #: admin/section/class-convertkit-admin-section-form-entries.php:157 322 339 msgid "First Name" 323 340 msgstr "" 324 341 325 #: admin/section/class-convertkit-admin-section-form-entries.php:1 48342 #: admin/section/class-convertkit-admin-section-form-entries.php:158 326 343 #: includes/blocks/class-convertkit-block-form-builder-field-email.php:78 327 344 msgid "Email" 328 345 msgstr "" 329 346 330 #: admin/section/class-convertkit-admin-section-form-entries.php:1 49347 #: admin/section/class-convertkit-admin-section-form-entries.php:159 331 348 msgid "Created" 332 349 msgstr "" 333 350 334 #: admin/section/class-convertkit-admin-section-form-entries.php:1 50351 #: admin/section/class-convertkit-admin-section-form-entries.php:160 335 352 msgid "Updated" 336 353 msgstr "" 337 354 338 #: admin/section/class-convertkit-admin-section-form-entries.php:1 51355 #: admin/section/class-convertkit-admin-section-form-entries.php:161 339 356 msgid "Result" 340 357 msgstr "" 341 358 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 347 360 msgid "Search results for" 348 361 msgstr "" 349 362 350 #: admin/section/class-convertkit-admin-section-form-entries.php:2 06363 #: admin/section/class-convertkit-admin-section-form-entries.php:217 351 364 msgid "Form Entries per Page" 352 365 msgstr "" -
convertkit/trunk/readme.txt
r3357832 r3359712 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.1 8 Stable tag: 3.0. 08 Stable tag: 3.0.1 9 9 License: GPLv3 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 180 180 == Changelog == 181 181 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 182 188 ### 3.0.0 2025-09-08 183 189 * 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 208 208 margin-bottom: 10px; 209 209 } 210 body.settings_page__wp_convertkit_settings .wrap .tablenav input.button .action{210 body.settings_page__wp_convertkit_settings .wrap .tablenav input.button { 211 211 height: 20px; 212 212 line-height: 20px; -
convertkit/trunk/resources/frontend/css/form-builder.css
r3357832 r3359712 11 11 font-family: inherit; 12 12 } 13 .wp-block-convertkit-form-builder-field label span.convertkit-form-builder-field-required { 14 color: red; 15 } 13 16 form .convertkit-form-builder-subscribed-message { 14 17 width: 100%; -
convertkit/trunk/wp-convertkit.php
r3357832 r3359712 10 10 * Plugin URI: https://kit.com/ 11 11 * Description: Display Kit (formerly ConvertKit) email subscription forms, landing pages, products, broadcasts and more. 12 * Version: 3.0. 012 * Version: 3.0.1 13 13 * Author: Kit 14 14 * Author URI: https://kit.com/ … … 28 28 define( 'CONVERTKIT_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 29 29 define( 'CONVERTKIT_PLUGIN_PATH', __DIR__ ); 30 define( 'CONVERTKIT_PLUGIN_VERSION', '3.0. 0' );30 define( 'CONVERTKIT_PLUGIN_VERSION', '3.0.1' ); 31 31 define( 'CONVERTKIT_OAUTH_CLIENT_ID', 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y' ); 32 32 define( 'CONVERTKIT_OAUTH_CLIENT_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' );
Note: See TracChangeset
for help on using the changeset viewer.