Plugin Directory

Changeset 3391941


Ignore:
Timestamp:
11/07/2025 07:53:31 PM (4 months ago)
Author:
maximumsoftware
Message:

Deploy from Git

Location:
pdf-forms-for-woocommerce/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • pdf-forms-for-woocommerce/trunk/js/admin-order.js

    r3016398 r3391941  
    1212       
    1313        jQuery.ajax({
    14             url: pdf_forms_for_woocommerce.ajax_url,
     14            url: ajaxurl,
    1515            type: 'POST',
    1616            data: {
     
    5454       
    5555        jQuery.ajax({
    56             url: pdf_forms_for_woocommerce.ajax_url,
     56            url: ajaxurl,
    5757            type: 'POST',
    5858            data: {
  • pdf-forms-for-woocommerce/trunk/js/admin-product.js

    r3239797 r3391941  
    592592            return;
    593593       
     594        data = deepCopy(data);
     595       
    594596        var filename = info.filename;
    595597        var options = data.options;
     
    709711    {
    710712        if(!post_id)
    711             return errorMessage(pdf_forms_for_wpforms.__No_Post_ID);
     713            return errorMessage(pdf_forms_for_woocommerce.__No_Post_ID);
    712714       
    713715        // get initial form data
     
    769771            jQuery.each(data.value_mappings, function(index, value_mapping) {
    770772               
     773                value_mapping = shallowCopy(value_mapping);
     774               
    771775                // find mapping id
    772776                for(var i=0, l=mappings.length; i<l; i++)
     
    899903        || typeof data.pdf_value == 'undefined')
    900904            return;
     905       
     906        data = deepCopy(data);
    901907       
    902908        data.value_mapping_id = generateId();
     
    10151021    var addMapping = function(data)
    10161022    {
     1023        data = deepCopy(data);
     1024       
    10171025        if(!data.hasOwnProperty('placeholders'))
    10181026            return;
     
    11401148                return;
    11411149        }
     1150       
     1151        embed = deepCopy(embed);
    11421152       
    11431153        if(!embed.id)
     
    12661276       
    12671277        jQuery.ajax({
    1268             url: pdf_forms_for_woocommerce.ajax_url,
     1278            url: ajaxurl,
    12691279            type: 'POST',
    12701280            data: {
     
    14621472    {
    14631473        jQuery.ajax({
    1464             url: pdf_forms_for_woocommerce.ajax_url,
     1474            url: ajaxurl,
    14651475            type: 'POST',
    14661476            data: {
     
    14881498                            return;
    14891499                    setAttachmentData(data.attachment_id, data);
    1490                     addAttachment({'attachment_id': data.attachment_id, options: defaultPdfOptions});
     1500                    addAttachment({'attachment_id': data.attachment_id, options: deepCopy(defaultPdfOptions)});
    14911501                }
    14921502            },
  • pdf-forms-for-woocommerce/trunk/js/new-key.js

    r3016398 r3391941  
    1919       
    2020        jQuery.ajax({
    21             url: pdf_forms_for_woocommerce_new_key.ajax_url,
     21            url: ajaxurl,
    2222            type: 'POST',
    2323            data: {
  • pdf-forms-for-woocommerce/trunk/js/notices.js

    r3016398 r3391941  
    4040        var notice = jQuery(this).closest('.pdf-forms-for-woocommerce-notice');
    4141        jQuery.ajax({
    42             url: pdf_forms_for_woocommerce.ajax_url,
     42            url: ajaxurl,
    4343            type: 'POST',
    4444            data: {
  • pdf-forms-for-woocommerce/trunk/pdf-forms-for-woocommerce.php

    r3239797 r3391941  
    44 * Plugin URI: https://pdfformsfiller.org/
    55 * Description: Automatically fill PDF forms with WooCommerce orders and attach generated PDFs to email notifications and order downloads.
    6  * Version: 1.1.1
     6 * Version: 1.1.2
    77 * Requires at least: 5.4
    88 * Requires PHP: 5.5
    99 * Requires Plugins: woocommerce
    1010 * WC requires at least: 7.1.0
    11  * WC tested up to: 9.6
     11 * WC tested up to: 10.3
    1212 * Author: Maximum.Software
    1313 * Author URI: https://maximum.software/
     
    2727    class Pdf_Forms_For_WooCommerce
    2828    {
    29         const VERSION = '1.1.1';
     29        const VERSION = '1.1.2';
    3030        const MIN_WC_VERSION = '7.1.0';
    31         const MAX_WC_VERSION = '9.6.99';
     31        const MAX_WC_VERSION = '10.3.99';
    3232        private static $BLACKLISTED_WC_VERSIONS = array();
    3333       
     
    292292                if( count( $messages ) > 0 )
    293293                {
    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 );
    295295                    $messageHtml = self::render(
    296296                        'admin-messages',
     
    809809                    "image/svg+xml",
    810810                    "image/webp",
     811                    "application/pdf",
    811812                );
    812813           
     
    934935                            }
    935936                        }
    936                        
    937                         // clear temporary files
    938                         self::remove_tmp_storage();
    939937                    }
     938                   
     939                    // clear temporary files
     940                    self::remove_tmp_storage();
    940941                }
    941942            }
     
    20952096            if( ! isset( $attributes['classes'] ) )
    20962097                $attributes['classes'] = "";
    2097             $attributes['classes'] = trim( $attributes['classes'] . " notice-$type" );
     2098            $attributes['classes'] = trim( $attributes['classes'] . " notice-" . esc_attr($type) );
    20982099           
    20992100            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' );
    21012102           
    21022103            if( $notice_id )
     
    21472148        {
    21482149            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 ) ),
    21502151                array_values( $tags ),
    21512152                $string
     
    22732274                            'id'    => 'pdf-forms-for-woocommerce-data',
    22742275                            '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 &quot;, so we need to pre-emptively double-escape with esc_textarea()
    22762277                        ) );
    22772278                        return ob_get_clean(); // no escaping needed
    22782279                    } ),
    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
    22802281                    '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' ),
    22812282                    'attach-pdf' => esc_html__( "Attach a PDF File", 'pdf-forms-for-woocommerce' ),
     
    25492550           
    25502551            wp_localize_script( 'pdf_forms_for_woocommerce_notices_script', 'pdf_forms_for_woocommerce', array(
    2551                 'ajax_url' => admin_url( 'admin-ajax.php' ),
    25522552                'ajax_nonce' => wp_create_nonce( 'pdf-forms-for-woocommerce-ajax-nonce' ),
    25532553            ) );
     
    25682568            {
    25692569                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' );
    25712571               
    25722572                wp_register_script( 'pdf_forms_for_woocommerce_admin_product_script', plugin_dir_url( __FILE__ ) . 'js/admin-product.js', array( 'jquery', 'jcrop', 'select2' ), self::VERSION );
     
    25742574               
    25752575                wp_localize_script( 'pdf_forms_for_woocommerce_admin_product_script', 'pdf_forms_for_woocommerce', array(
    2576                     'ajax_url' => admin_url( 'admin-ajax.php' ),
    25772576                    'ajax_nonce' => wp_create_nonce( 'pdf-forms-for-woocommerce-ajax-nonce' ),
    25782577                    '__No_Post_ID' => __( "Failed to determine post ID", 'pdf-forms-for-woocommerce' ),
     
    26132612                $order = wc_get_order();
    26142613                wp_localize_script( 'pdf_forms_for_woocommerce_admin_order_script', 'pdf_forms_for_woocommerce', array(
    2615                     'ajax_url' => admin_url( 'admin-ajax.php' ),
    26162614                    'ajax_nonce' => wp_create_nonce( 'pdf-forms-for-woocommerce-ajax-nonce' ),
    26172615                    'order_id' => is_a( $order, 'WC_Order' ) ? $order->get_id() : null,
  • pdf-forms-for-woocommerce/trunk/readme.txt

    r3239797 r3391941  
    11=== PDF Forms Filler for WooCommerce ===
    2 Version: 1.1.1
    3 Stable tag: 1.1.1
     2Version: 1.1.2
     3Stable tag: 1.1.2
    44Tested up to: 6.7
    55Tags: pdf, form, woocommerce, email, download
     
    5454
    5555== 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
    5664
    5765= 1.1.1 =
  • pdf-forms-for-woocommerce/trunk/src/services/pdf-ninja.php

    r3176212 r3391941  
    134134                    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 );
    135135                    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' ),
    137136                        'ajax_nonce' => wp_create_nonce( 'pdf-forms-for-woocommerce-ajax-nonce' ),
    138137                        '__Unknown_error' => __( 'Unknown error', 'pdf-forms-for-woocommerce' ),
Note: See TracChangeset for help on using the changeset viewer.