Changeset 3391941
- Timestamp:
- 11/07/2025 07:53:31 PM (4 months ago)
- Location:
- pdf-forms-for-woocommerce/trunk
- Files:
-
- 7 edited
-
js/admin-order.js (modified) (2 diffs)
-
js/admin-product.js (modified) (9 diffs)
-
js/new-key.js (modified) (1 diff)
-
js/notices.js (modified) (1 diff)
-
pdf-forms-for-woocommerce.php (modified) (12 diffs)
-
readme.txt (modified) (2 diffs)
-
src/services/pdf-ninja.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pdf-forms-for-woocommerce/trunk/js/admin-order.js
r3016398 r3391941 12 12 13 13 jQuery.ajax({ 14 url: pdf_forms_for_woocommerce.ajax_url,14 url: ajaxurl, 15 15 type: 'POST', 16 16 data: { … … 54 54 55 55 jQuery.ajax({ 56 url: pdf_forms_for_woocommerce.ajax_url,56 url: ajaxurl, 57 57 type: 'POST', 58 58 data: { -
pdf-forms-for-woocommerce/trunk/js/admin-product.js
r3239797 r3391941 592 592 return; 593 593 594 data = deepCopy(data); 595 594 596 var filename = info.filename; 595 597 var options = data.options; … … 709 711 { 710 712 if(!post_id) 711 return errorMessage(pdf_forms_for_w pforms.__No_Post_ID);713 return errorMessage(pdf_forms_for_woocommerce.__No_Post_ID); 712 714 713 715 // get initial form data … … 769 771 jQuery.each(data.value_mappings, function(index, value_mapping) { 770 772 773 value_mapping = shallowCopy(value_mapping); 774 771 775 // find mapping id 772 776 for(var i=0, l=mappings.length; i<l; i++) … … 899 903 || typeof data.pdf_value == 'undefined') 900 904 return; 905 906 data = deepCopy(data); 901 907 902 908 data.value_mapping_id = generateId(); … … 1015 1021 var addMapping = function(data) 1016 1022 { 1023 data = deepCopy(data); 1024 1017 1025 if(!data.hasOwnProperty('placeholders')) 1018 1026 return; … … 1140 1148 return; 1141 1149 } 1150 1151 embed = deepCopy(embed); 1142 1152 1143 1153 if(!embed.id) … … 1266 1276 1267 1277 jQuery.ajax({ 1268 url: pdf_forms_for_woocommerce.ajax_url,1278 url: ajaxurl, 1269 1279 type: 'POST', 1270 1280 data: { … … 1462 1472 { 1463 1473 jQuery.ajax({ 1464 url: pdf_forms_for_woocommerce.ajax_url,1474 url: ajaxurl, 1465 1475 type: 'POST', 1466 1476 data: { … … 1488 1498 return; 1489 1499 setAttachmentData(data.attachment_id, data); 1490 addAttachment({'attachment_id': data.attachment_id, options: de faultPdfOptions});1500 addAttachment({'attachment_id': data.attachment_id, options: deepCopy(defaultPdfOptions)}); 1491 1501 } 1492 1502 }, -
pdf-forms-for-woocommerce/trunk/js/new-key.js
r3016398 r3391941 19 19 20 20 jQuery.ajax({ 21 url: pdf_forms_for_woocommerce_new_key.ajax_url,21 url: ajaxurl, 22 22 type: 'POST', 23 23 data: { -
pdf-forms-for-woocommerce/trunk/js/notices.js
r3016398 r3391941 40 40 var notice = jQuery(this).closest('.pdf-forms-for-woocommerce-notice'); 41 41 jQuery.ajax({ 42 url: pdf_forms_for_woocommerce.ajax_url,42 url: ajaxurl, 43 43 type: 'POST', 44 44 data: { -
pdf-forms-for-woocommerce/trunk/pdf-forms-for-woocommerce.php
r3239797 r3391941 4 4 * Plugin URI: https://pdfformsfiller.org/ 5 5 * Description: Automatically fill PDF forms with WooCommerce orders and attach generated PDFs to email notifications and order downloads. 6 * Version: 1.1. 16 * Version: 1.1.2 7 7 * Requires at least: 5.4 8 8 * Requires PHP: 5.5 9 9 * Requires Plugins: woocommerce 10 10 * WC requires at least: 7.1.0 11 * WC tested up to: 9.611 * WC tested up to: 10.3 12 12 * Author: Maximum.Software 13 13 * Author URI: https://maximum.software/ … … 27 27 class Pdf_Forms_For_WooCommerce 28 28 { 29 const VERSION = '1.1. 1';29 const VERSION = '1.1.2'; 30 30 const MIN_WC_VERSION = '7.1.0'; 31 const MAX_WC_VERSION = ' 9.6.99';31 const MAX_WC_VERSION = '10.3.99'; 32 32 private static $BLACKLISTED_WC_VERSIONS = array(); 33 33 … … 292 292 if( count( $messages ) > 0 ) 293 293 { 294 $messages = array_map( function( $message ) { return "<span class='".esc_attr($message['type'])."'>".esc_ html($message['message'])."</span>"; }, $messages );294 $messages = array_map( function( $message ) { return "<span class='".esc_attr($message['type'])."'>".esc_textarea($message['message'])."</span>"; }, $messages ); 295 295 $messageHtml = self::render( 296 296 'admin-messages', … … 809 809 "image/svg+xml", 810 810 "image/webp", 811 "application/pdf", 811 812 ); 812 813 … … 934 935 } 935 936 } 936 937 // clear temporary files938 self::remove_tmp_storage();939 937 } 938 939 // clear temporary files 940 self::remove_tmp_storage(); 940 941 } 941 942 } … … 2095 2096 if( ! isset( $attributes['classes'] ) ) 2096 2097 $attributes['classes'] = ""; 2097 $attributes['classes'] = trim( $attributes['classes'] . " notice- $type");2098 $attributes['classes'] = trim( $attributes['classes'] . " notice-" . esc_attr($type) ); 2098 2099 2099 2100 if( !isset( $attributes['label'] ) ) 2100 $attributes['label'] = __( "PDF Forms Filler for WooCommerce", 'pdf-forms-for-woocommerce' );2101 $attributes['label'] = esc_html__( "PDF Forms Filler for WooCommerce", 'pdf-forms-for-woocommerce' ); 2101 2102 2102 2103 if( $notice_id ) … … 2147 2148 { 2148 2149 return str_replace( 2149 array_map( array( get_class(), 'add_curly_braces' ), array_keys( $tags ) ),2150 array_map( array( __CLASS__, 'add_curly_braces' ), array_keys( $tags ) ), 2150 2151 array_values( $tags ), 2151 2152 $string … … 2273 2274 'id' => 'pdf-forms-for-woocommerce-data', 2274 2275 'class' => 'pdf-forms-for-woocommerce-data', 2275 'value' => Pdf_Forms_For_WooCommerce_Wrapper::json_encode( $settings ),2276 'value' => esc_textarea( Pdf_Forms_For_WooCommerce_Wrapper::json_encode( $settings ) ), // esc_attr() is used to output this value which does not double-escape by design, which causes issues with JSON already containing entities like ", so we need to pre-emptively double-escape with esc_textarea() 2276 2277 ) ); 2277 2278 return ob_get_clean(); // no escaping needed 2278 2279 } ), 2279 'preload-data' => esc_ html( Pdf_Forms_For_WooCommerce_Wrapper::json_encode( $preload_data ) ),2280 'preload-data' => esc_textarea( Pdf_Forms_For_WooCommerce_Wrapper::json_encode( $preload_data ) ), // esc_textarea() is used to double-escape for correct JSON, esc_html() does not double-escape by design 2280 2281 'instructions' => esc_html__( "You can use this section to attach a PDF file to your product and link WooCommerce placeholders to fields in the PDF file. You can also embed images from a URL into the PDF file. Changes here are applied when the product is saved.", 'pdf-forms-for-woocommerce' ), 2281 2282 'attach-pdf' => esc_html__( "Attach a PDF File", 'pdf-forms-for-woocommerce' ), … … 2549 2550 2550 2551 wp_localize_script( 'pdf_forms_for_woocommerce_notices_script', 'pdf_forms_for_woocommerce', array( 2551 'ajax_url' => admin_url( 'admin-ajax.php' ),2552 2552 'ajax_nonce' => wp_create_nonce( 'pdf-forms-for-woocommerce-ajax-nonce' ), 2553 2553 ) ); … … 2568 2568 { 2569 2569 wp_register_style( 'select2', plugin_dir_url( __FILE__ ) . 'css/select2.min.css', array(), '4.0.13' ); 2570 wp_register_script( 'select2', plugin_dir_url( __FILE__ ) . 'js/select2/select2.min.js', array( 'jquery' ), '4.0.13' );2570 wp_register_script( 'select2', plugin_dir_url( __FILE__ ) . 'js/select2/select2.min.js', array( 'jquery' ), '4.0.13' ); 2571 2571 2572 2572 wp_register_script( 'pdf_forms_for_woocommerce_admin_product_script', plugin_dir_url( __FILE__ ) . 'js/admin-product.js', array( 'jquery', 'jcrop', 'select2' ), self::VERSION ); … … 2574 2574 2575 2575 wp_localize_script( 'pdf_forms_for_woocommerce_admin_product_script', 'pdf_forms_for_woocommerce', array( 2576 'ajax_url' => admin_url( 'admin-ajax.php' ),2577 2576 'ajax_nonce' => wp_create_nonce( 'pdf-forms-for-woocommerce-ajax-nonce' ), 2578 2577 '__No_Post_ID' => __( "Failed to determine post ID", 'pdf-forms-for-woocommerce' ), … … 2613 2612 $order = wc_get_order(); 2614 2613 wp_localize_script( 'pdf_forms_for_woocommerce_admin_order_script', 'pdf_forms_for_woocommerce', array( 2615 'ajax_url' => admin_url( 'admin-ajax.php' ),2616 2614 'ajax_nonce' => wp_create_nonce( 'pdf-forms-for-woocommerce-ajax-nonce' ), 2617 2615 'order_id' => is_a( $order, 'WC_Order' ) ? $order->get_id() : null, -
pdf-forms-for-woocommerce/trunk/readme.txt
r3239797 r3391941 1 1 === PDF Forms Filler for WooCommerce === 2 Version: 1.1. 13 Stable tag: 1.1. 12 Version: 1.1.2 3 Stable tag: 1.1.2 4 4 Tested up to: 6.7 5 5 Tags: pdf, form, woocommerce, email, download … … 54 54 55 55 == Changelog == 56 57 = 1.1.2 = 58 59 * Release date: November 7, 2025 60 61 * Verified support for WC 10.3 62 * Added PDF as a supported image format for embedding 63 * Bug fixes and minor improvements 56 64 57 65 = 1.1.1 = -
pdf-forms-for-woocommerce/trunk/src/services/pdf-ninja.php
r3176212 r3391941 134 134 wp_register_script( 'pdf_forms_for_woocommerce_new_key_script', plugins_url( '../../js/new-key.js', __FILE__ ), array( 'jquery', 'pdf_forms_filler_spinner_script' ), Pdf_Forms_For_WooCommerce::VERSION ); 135 135 wp_localize_script( 'pdf_forms_for_woocommerce_new_key_script', 'pdf_forms_for_woocommerce_new_key', array( 136 'ajax_url' => admin_url( 'admin-ajax.php' ),137 136 'ajax_nonce' => wp_create_nonce( 'pdf-forms-for-woocommerce-ajax-nonce' ), 138 137 '__Unknown_error' => __( 'Unknown error', 'pdf-forms-for-woocommerce' ),
Note: See TracChangeset
for help on using the changeset viewer.