Plugin Directory

Changeset 3246679


Ignore:
Timestamp:
02/25/2025 07:33:53 PM (13 months ago)
Author:
actpro
Message:

3.1.0

  • Add nonce after add to cart button.
  • Refactor code
  • Compatible with WooCommerce 9.7.x
Location:
extra-product-options-for-woocommerce
Files:
90 added
9 edited

Legend:

Unmodified
Added
Removed
  • extra-product-options-for-woocommerce/trunk/README.txt

    r3245856 r3246679  
    55Tested up to: 6.7.2
    66Requires PHP: 5.6
    7 WC tested up to: 9.6.2
    8 Stable tag: 3.0.9
     7WC tested up to: 9.7.0
     8Stable tag: 3.1.0
    99License: GNU General Public License v2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    208208
    209209== Changelog ==
     210= 3.1.0 =
     211* Add nonce after add to cart button.
     212* Refactor code
     213* Compatible with WooCommerce 9.7.x
     214
    210215= 3.0.9 =
    211216* New - Import Dummy Data
  • extra-product-options-for-woocommerce/trunk/extra-product-options-for-woocommerce.php

    r3245856 r3246679  
    33 * Plugin Name:         Extra Product Options for WooCommerce
    44 * Description:         Extra product options for WooCommerce Plugin allows you to add custom form fields (12+ field types) and sections to your WooCommerce product page. Easy way to add custom fields as per your requirement
    5  * Version:             3.0.9
     5 * Version:             3.1.0
    66 * Author:              actpro
    77 * Author URI:          https://profiles.wordpress.org/actpro/
     
    1212 *
    1313 * WC requires at least: 3.6
    14  * WC tested up to: 8.9.1
     14 * WC tested up to: 9.7.0
    1515 *
    1616 * @package Extra_Product_Options_For_WooCommerce
  • extra-product-options-for-woocommerce/trunk/includes/class-epofw-field-setting.php

    r3245856 r3246679  
    358358                wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'extra-product-options-for-woocommerce' ) );
    359359            }
    360             $action                        = filter_input( INPUT_GET, 'action', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    361             $epofw_save                    = filter_input( INPUT_POST, 'epofw_save', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    362             $epofw_save                    = isset( $epofw_save ) ? sanitize_text_field( wp_unslash( $epofw_save ) ) : '';
    363             $woocommerce_save_method_nonce = filter_input( INPUT_POST, 'woocommerce_save_method_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     360            $action     = filter_input( INPUT_GET, 'action', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     361            $epofw_save = filter_input( INPUT_POST, 'epofw_save', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     362            $epofw_save = isset( $epofw_save ) ? sanitize_text_field( wp_unslash( $epofw_save ) ) : '';
    364363            if ( ( isset( $action ) && ! empty( $action ) ) ) {
    365364                if ( ! empty( $epofw_save ) ) {
  • extra-product-options-for-woocommerce/trunk/includes/class-epofw-front.php

    r3245856 r3246679  
    548548            $main_fields_data_arr = $this->epofw_get_fields_data( $post->ID );
    549549            if ( ! empty( $main_fields_data_arr ) ) {
     550
     551                // Add nonce field using the centralized function.
     552                $this->epofw_add_nonce_field();
     553
    550554                foreach ( $main_fields_data_arr as $fields_data_arr ) {
    551555                    $addon_position = epofw_check_array_key_exists( 'epofw_addon_position', $fields_data_arr );
     
    605609            }
    606610
    607             $get_post_data      = $_POST; // phpcs:ignore WordPress.Security.NonceVerification.Missing
     611            $get_post_data      = array_map( 'sanitize_text_field', wp_unslash( $_POST ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
    608612            $fields_data_arr    = $this->epofw_get_fields_data( $product_id );
    609613            $get_field_name_arr = $this->epofw_get_field_name_from_data( $fields_data_arr, $get_post_data );
     
    15071511         * @param int|float $product_price  Product price.
    15081512         * @param array     $cart_item_data Cart item data.
     1513         * @param string    $cart_item_key  Cart item key.
    15091514         *
    15101515         * @return string
    15111516         */
    1512         public function epofw_woocommerce_cart_item_price( $product_price, $cart_item_data ) {
     1517        public function epofw_woocommerce_cart_item_price( $product_price, $cart_item_data, $cart_item_key ) {
    15131518            // Set without tax price becaue wc_get_price_to_display function will calucalte tax based on original price.
    15141519            if ( isset( $cart_item_data['epofw_product_price_without_tax'] ) ) {
  • extra-product-options-for-woocommerce/trunk/includes/class-epofw-wc-wholesale-prices-rymera.php

    r3078194 r3246679  
    66 * @subpackage Extra_Product_Options_For_WooCommerce/includes
    77 *
    8  * @since
     8 * @since 2.5
    99 */
    1010
  • extra-product-options-for-woocommerce/trunk/languages/extra-product-options-for-woocommerce.pot

    r3245856 r3246679  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Extra Product Options for WooCommerce 3.0.9\n"
     5"Project-Id-Version: Extra Product Options for WooCommerce 3.1.0\n"
    66"Report-Msgid-Bugs-To: https://www.wpactpro.com/contact/\n"
    7 "POT-Creation-Date: 2025-02-24 15:32:51+00:00\n"
     7"POT-Creation-Date: 2025-02-25 19:27:11+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
     
    115115msgstr ""
    116116
    117 #: includes/class-epofw-field-setting.php:370
     117#: includes/class-epofw-field-setting.php:369
    118118msgid "Security check failed."
    119119msgstr ""
    120120
    121 #: includes/class-epofw-field-setting.php:462
     121#: includes/class-epofw-field-setting.php:461
    122122msgid "Error saving Product Option."
    123123msgstr ""
    124124
    125 #: includes/class-epofw-field-setting.php:531
     125#: includes/class-epofw-field-setting.php:530
    126126msgid "Import Dummy Fields"
    127127msgstr ""
    128128
    129 #: includes/class-epofw-field-setting.php:561
     129#: includes/class-epofw-field-setting.php:560
    130130msgid "Field Listing"
    131131msgstr ""
    132132
    133 #: includes/class-epofw-field-setting.php:576
     133#: includes/class-epofw-field-setting.php:575
    134134msgid "Add New"
    135135msgstr ""
    136136
    137 #: includes/class-epofw-field-setting.php:589
     137#: includes/class-epofw-field-setting.php:588
    138138msgid "Search results for "
    139139msgstr ""
    140140
    141 #: includes/class-epofw-field-setting.php:601
     141#: includes/class-epofw-field-setting.php:600
    142142msgid "Search Product Option"
    143143msgstr ""
     
    235235msgstr ""
    236236
    237 #: includes/class-epofw-front.php:601
     237#: includes/class-epofw-front.php:605
    238238msgid "Security check failed. Please refresh the page and try again."
    239239msgstr ""
    240240
    241 #: includes/class-epofw-front.php:673
     241#: includes/class-epofw-front.php:677
    242242#. translators: %1$s: Field label that only accepts numbers
    243243msgid "Only numbers are allowed for \"%1$s\"."
    244244msgstr ""
    245245
    246 #: includes/class-epofw-front.php:683
     246#: includes/class-epofw-front.php:687
    247247#. translators: %1$s: Field label that accepts decimal numbers
    248248msgid "Decimal numbers are allowed for \" %1$s\"."
    249249msgstr ""
    250250
    251 #: includes/class-epofw-front.php:689
     251#: includes/class-epofw-front.php:693
    252252#. translators: %1$s: Field label that only accepts text
    253253msgid "Only texts are allowed for \" %1$s\"."
    254254msgstr ""
    255255
    256 #: includes/class-epofw-front.php:695
     256#: includes/class-epofw-front.php:699
    257257#. translators: %1$s: Field label that accepts both text and numbers
    258258msgid "Only text and numbers are allowed for \" %1$s\"."
    259259msgstr ""
    260260
    261 #: includes/class-epofw-front.php:701
     261#: includes/class-epofw-front.php:705
    262262#. translators: %1$s: Field label that requires email format
    263263msgid "Invalid email format for \" %1$s\"."
    264264msgstr ""
    265265
    266 #: includes/class-epofw-front.php:855
     266#: includes/class-epofw-front.php:859
    267267msgid "Option is invalid"
    268268msgstr ""
     
    403403
    404404#: settings/epofw-admin-settings.php:158
    405 #: settings/epofw-common-function.php:2203
     405#: settings/epofw-common-function.php:2205
    406406msgid "Field Status"
    407407msgstr ""
     
    955955msgstr ""
    956956
    957 #: settings/epofw-common-function.php:2204
     957#: settings/epofw-common-function.php:2206
    958958msgid "Enable or disable field based on checkbox."
    959959msgstr ""
    960960
    961 #: settings/epofw-common-function.php:2282
     961#: settings/epofw-common-function.php:2286
    962962msgid "In which product you want to display product fields."
    963963msgstr ""
    964964
    965 #: settings/epofw-common-function.php:2709
     965#: settings/epofw-common-function.php:2713
    966966msgid "Product"
    967967msgstr ""
    968968
    969 #: settings/epofw-common-function.php:2710
     969#: settings/epofw-common-function.php:2714
    970970msgid "Category"
    971971msgstr ""
    972972
    973 #: settings/epofw-common-function.php:2729
     973#: settings/epofw-common-function.php:2733
    974974msgid "Is Equal To"
    975975msgstr ""
    976976
    977 #: settings/epofw-common-function.php:2730
     977#: settings/epofw-common-function.php:2734
    978978msgid "Not Equal To"
    979979msgstr ""
    980980
    981 #: settings/epofw-common-function.php:2754
     981#: settings/epofw-common-function.php:2758
    982982msgid "Fixed"
    983983msgstr ""
    984984
    985 #: settings/epofw-common-function.php:2774
     985#: settings/epofw-common-function.php:2778
    986986msgid "Label"
    987987msgstr ""
    988988
    989 #: settings/epofw-common-function.php:2775
     989#: settings/epofw-common-function.php:2779
    990990msgid "H1"
    991991msgstr ""
    992992
    993 #: settings/epofw-common-function.php:2776
     993#: settings/epofw-common-function.php:2780
    994994msgid "H2"
    995995msgstr ""
    996996
    997 #: settings/epofw-common-function.php:2777
     997#: settings/epofw-common-function.php:2781
    998998msgid "H3"
    999999msgstr ""
    10001000
    1001 #: settings/epofw-common-function.php:2778
     1001#: settings/epofw-common-function.php:2782
    10021002msgid "H4"
    10031003msgstr ""
    10041004
    1005 #: settings/epofw-common-function.php:2779
     1005#: settings/epofw-common-function.php:2783
    10061006msgid "H5"
    10071007msgstr ""
    10081008
    1009 #: settings/epofw-common-function.php:2780
     1009#: settings/epofw-common-function.php:2784
    10101010msgid "H6"
    10111011msgstr ""
    10121012
    1013 #: settings/epofw-common-function.php:2781
     1013#: settings/epofw-common-function.php:2785
    10141014msgid "Strong"
    10151015msgstr ""
    10161016
    1017 #: settings/epofw-common-function.php:2782
     1017#: settings/epofw-common-function.php:2786
    10181018msgid "Span"
    10191019msgstr ""
    10201020
    1021 #: settings/epofw-common-function.php:2783
     1021#: settings/epofw-common-function.php:2787
    10221022msgid "Div"
    10231023msgstr ""
    10241024
    1025 #: settings/epofw-common-function.php:2802
     1025#: settings/epofw-common-function.php:2806
    10261026msgid "Allow all"
    10271027msgstr ""
    10281028
    1029 #: settings/epofw-common-function.php:2803
     1029#: settings/epofw-common-function.php:2807
    10301030msgid "Only Text"
    10311031msgstr ""
    10321032
    1033 #: settings/epofw-common-function.php:2804
     1033#: settings/epofw-common-function.php:2808
    10341034msgid "Only Number"
    10351035msgstr ""
    10361036
    1037 #: settings/epofw-common-function.php:2805
     1037#: settings/epofw-common-function.php:2809
    10381038msgid "Number with decimal"
    10391039msgstr ""
    10401040
    1041 #: settings/epofw-common-function.php:2806
     1041#: settings/epofw-common-function.php:2810
    10421042msgid "Text and Number"
    10431043msgstr ""
    10441044
    1045 #: settings/epofw-common-function.php:2807
     1045#: settings/epofw-common-function.php:2811
    10461046msgid "Email"
    10471047msgstr ""
    10481048
    1049 #: settings/epofw-common-function.php:2826
     1049#: settings/epofw-common-function.php:2830
    10501050msgid "P"
    10511051msgstr ""
    10521052
    1053 #: settings/epofw-common-function.php:2827
     1053#: settings/epofw-common-function.php:2831
    10541054msgid "Address"
    10551055msgstr ""
    10561056
    1057 #: settings/epofw-common-function.php:2828
     1057#: settings/epofw-common-function.php:2832
    10581058msgid "Blockquote"
    10591059msgstr ""
    10601060
    1061 #: settings/epofw-common-function.php:2829
     1061#: settings/epofw-common-function.php:2833
    10621062msgid "Canvas"
    10631063msgstr ""
    10641064
    1065 #: settings/epofw-common-function.php:2830
     1065#: settings/epofw-common-function.php:2834
    10661066msgid "Output"
    10671067msgstr ""
    10681068
    1069 #: settings/epofw-common-function.php:2849
     1069#: settings/epofw-common-function.php:2853
    10701070msgid "Text"
    10711071msgstr ""
    10721072
    1073 #: settings/epofw-common-function.php:2850
     1073#: settings/epofw-common-function.php:2854
    10741074msgid "Hidden"
    10751075msgstr ""
    10761076
    1077 #: settings/epofw-common-function.php:2851
     1077#: settings/epofw-common-function.php:2855
    10781078msgid "Number"
    10791079msgstr ""
    10801080
    1081 #: settings/epofw-common-function.php:2852
     1081#: settings/epofw-common-function.php:2856
    10821082msgid "Password"
    10831083msgstr ""
    10841084
    1085 #: settings/epofw-common-function.php:2853
     1085#: settings/epofw-common-function.php:2857
    10861086msgid "Textarea"
    10871087msgstr ""
    10881088
    1089 #: settings/epofw-common-function.php:2854
     1089#: settings/epofw-common-function.php:2858
    10901090msgid "Select"
    10911091msgstr ""
    10921092
    1093 #: settings/epofw-common-function.php:2855
     1093#: settings/epofw-common-function.php:2859
    10941094msgid "Multiselect"
    10951095msgstr ""
    10961096
    1097 #: settings/epofw-common-function.php:2856
     1097#: settings/epofw-common-function.php:2860
    10981098msgid "Checkbox"
    10991099msgstr ""
    11001100
    1101 #: settings/epofw-common-function.php:2857
     1101#: settings/epofw-common-function.php:2861
    11021102msgid "Checkbox Group"
    11031103msgstr ""
    11041104
    1105 #: settings/epofw-common-function.php:2858
     1105#: settings/epofw-common-function.php:2862
    11061106msgid "Radio"
    11071107msgstr ""
    11081108
    1109 #: settings/epofw-common-function.php:2859
     1109#: settings/epofw-common-function.php:2863
    11101110msgid "Date Picker"
    11111111msgstr ""
    11121112
    1113 #: settings/epofw-common-function.php:2860
     1113#: settings/epofw-common-function.php:2864
    11141114msgid "Time Picker"
    11151115msgstr ""
    11161116
    1117 #: settings/epofw-common-function.php:2861
     1117#: settings/epofw-common-function.php:2865
    11181118msgid "Color Picker"
    11191119msgstr ""
    11201120
    1121 #: settings/epofw-common-function.php:2862
     1121#: settings/epofw-common-function.php:2866
    11221122msgid "Heading"
    11231123msgstr ""
    11241124
    1125 #: settings/epofw-common-function.php:2863
     1125#: settings/epofw-common-function.php:2867
    11261126msgid "Paragraph"
    11271127msgstr ""
    11281128
    1129 #: settings/epofw-common-function.php:3072
    1130 #: settings/epofw-common-function.php:3111
     1129#: settings/epofw-common-function.php:3076
     1130#: settings/epofw-common-function.php:3115
    11311131msgid "Option Label"
    11321132msgstr ""
    11331133
    1134 #: settings/epofw-common-function.php:3091
    1135 #: settings/epofw-common-function.php:3130
     1134#: settings/epofw-common-function.php:3095
     1135#: settings/epofw-common-function.php:3134
    11361136msgid "Option Price"
    11371137msgstr ""
    11381138
    1139 #: settings/epofw-common-function.php:3111
     1139#: settings/epofw-common-function.php:3115
    11401140msgid "Option 1"
    11411141msgstr ""
    11421142
    1143 #: settings/epofw-common-function.php:3144
     1143#: settings/epofw-common-function.php:3148
    11441144msgid "Note: Options must be unique."
    11451145msgstr ""
    11461146
    1147 #: settings/epofw-common-function.php:3147
     1147#: settings/epofw-common-function.php:3151
    11481148msgid "Add New Option"
    11491149msgstr ""
    11501150
    1151 #: settings/epofw-common-function.php:3592
     1151#: settings/epofw-common-function.php:3596
    11521152msgid "Addon Details"
    11531153msgstr ""
    11541154
    1155 #: settings/epofw-common-function.php:3605
     1155#: settings/epofw-common-function.php:3609
    11561156msgid "Subtotal"
    11571157msgstr ""
  • extra-product-options-for-woocommerce/trunk/settings/epofw-actions.php

    r3245856 r3246679  
    2424}
    2525
    26 add_filter( 'epofw_get_field_label_class', 'epofw_get_field_label_class_callback', 10, 1 );
     26add_filter( 'epofw_get_field_label_class', 'epofw_get_field_label_class_callback' );
    2727
    2828/**
  • extra-product-options-for-woocommerce/trunk/settings/epofw-common-function.php

    r3245856 r3246679  
    5757function epofw_field_start_th_fn() {
    5858    ?>
    59     <div scope="row1" class="col-251">    <div scope="row" class="col-25">
     59    <div scope="row1" class="col-251"><div scope="row" class="col-25">
    6060    <?php
    6161}
     
    21702170        $data_property['id'] = $field_id;
    21712171    }
    2172     $data_property['class']   = $field_class;
     2172    if ( ! empty( $field_class ) ) {
     2173        $data_property['class'] = $field_class;
     2174    }
    21732175    $data_property['options'] = epofw_field_type_options_data();
    21742176    // phpcs:ignore WordPress.Security.EscapeOutput
     
    22522254        $data_property['id'] = $field_id;
    22532255    }
    2254     $data_property['class'] = $field_class;
     2256    if ( ! empty( $field_class ) ) {
     2257        $data_property['class'] = $field_class;
     2258    }
    22552259    // phpcs:ignore WordPress.Security.EscapeOutput
    22562260    echo cp_render_fields( $data_property, $field_type, $inc_key );
  • extra-product-options-for-woocommerce/trunk/settings/epofw-constant.php

    r3245856 r3246679  
    1212}
    1313if ( ! defined( 'EPOFW_PLUGIN_VERSION' ) ) {
    14     define( 'EPOFW_PLUGIN_VERSION', '3.0.9' );
     14    define( 'EPOFW_PLUGIN_VERSION', '3.1.0' );
    1515}
    1616if ( ! defined( 'EPOFW_SLUG' ) ) {
Note: See TracChangeset for help on using the changeset viewer.