Plugin Directory

Changeset 3308828


Ignore:
Timestamp:
06/10/2025 02:33:18 AM (9 months ago)
Author:
beycanpress
Message:

Update to version 1.0.3 from GitHub

Location:
cryptopay-gateway-for-gravity-forms
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • cryptopay-gateway-for-gravity-forms/tags/1.0.3/app/Gateways/AbstractGateway.php

    r3262505 r3308828  
    5656
    5757    /**
    58      * @param array<mixed> $properties
    59      */
    60     public function __construct(array $properties = [])
    61     {
    62         parent::__construct($properties);
     58     * @param mixed $properties
     59     */
     60    public function __construct(mixed $properties = [])
     61    {
     62        if (is_array($properties)) {
     63            parent::__construct($properties);
     64        }
     65
    6366        $this->field_input_id = 'input_' . $this->id;
    6467
     
    151154    {
    152155        // phpcs:disable
    153         wp_add_inline_script(
    154             'crypto-pay-gateway-for-gravity-forms',
    155             `;(function ($) {
    156                 $(document).ready(() => {
    157                     let currentFieldId = 0;
    158                     const fieldList = $("#gform_fields");
    159                     const customSubmit = $(".custom-submit-placeholder");
    160                     const customSubmitParent = customSubmit.closest('#field_submit');
    161                     if (customSubmitParent) {
    162                         customSubmitParent.hide();
    163                     }
    164 
    165                     const hideSubmit = () => {
    166                         currentFieldId = 0;
    167                         customSubmit.hide();
    168                         customSubmitParent.hide();
    169                         $('#field_submit').hide();
    170                     }
    171 
    172                     const showSubmit = () => {
    173                         customSubmit.show();
    174                         customSubmitParent.show();
    175                         $('#field_submit').show();
    176                     }
    177 
    178                     $(document).on('gform_field_added', function (event, form, field) {
    179                         if (field.type === '` . esc_js($this->type) . `') {
    180                             hideSubmit()
    181                             currentFieldId = parseInt(field.id);
     156        add_action('admin_footer', function () {
     157?>
     158            <script type="text/javascript">
     159                ;
     160                (function($) {
     161                    $(document).ready(() => {
     162                        let currentFieldId = 0;
     163                        const fieldList = $("#gform_fields");
     164                        const customSubmit = $(".custom-submit-placeholder");
     165                        const customSubmitParent = customSubmit.closest('#field_submit');
     166                        if (customSubmitParent) {
     167                            customSubmitParent.hide();
    182168                        }
    183                         if (form.fields.some(field => field.type === 'total')) {
    184                             $('#field_' + currentFieldId + ' .ginput_container')?.html(
    185                                 '` . esc_js($this->get_field_works_or_expect_msg()) . `'
    186                             );
     169
     170                        const hideSubmit = () => {
     171                            currentFieldId = 0;
     172                            customSubmit.hide();
     173                            customSubmitParent.hide();
     174                            $('#field_submit').hide();
    187175                        }
    188                     });
    189                     $(document).on('gform_field_deleted', function (event, form, fieldId) {
    190                         if (parseInt(fieldId) === currentFieldId) {
    191                             showSubmit();
     176
     177                        const showSubmit = () => {
     178                            customSubmit.show();
     179                            customSubmitParent.show();
     180                            $('#field_submit').show();
    192181                        }
    193                         if (!form.fields.some(field => field.type === 'total')) {
    194                             $('#field_' + currentFieldId + ' .ginput_container')?.html(
    195                                 '` . esc_js($this->get_field_works_or_expect_msg(false)) . `'
    196                             );
    197                         }
    198                         if (!form.fields.some(field => field.type === '` . esc_js($this->type) . `')) {
    199                             showSubmit();
    200                         }
    201                     });
    202                 })
    203             })(jQuery);`,
    204             'after'
    205         );
     182
     183                        $(document).on('gform_field_added', function(event, form, field) {
     184                            if (field.type === '<?php esc_js($this->type) ?>') {
     185                                hideSubmit()
     186                                currentFieldId = parseInt(field.id);
     187                            }
     188                            if (form.fields.some(field => field.type === 'total')) {
     189                                $('#field_' + currentFieldId + ' .ginput_container')?.html(
     190                                    '<?php esc_js($this->get_field_works_or_expect_msg()) ?>'
     191                                );
     192                            }
     193                        });
     194                        $(document).on('gform_field_deleted', function(event, form, fieldId) {
     195                            if (parseInt(fieldId) === currentFieldId) {
     196                                showSubmit();
     197                            }
     198                            if (!form.fields.some(field => field.type === 'total')) {
     199                                $('#field_' + currentFieldId + ' .ginput_container')?.html(
     200                                    '<?php esc_js($this->get_field_works_or_expect_msg(false)) ?>'
     201                                );
     202                            }
     203                            if (!form.fields.some(field => field.type === '<?php esc_js($this->type) ?>')) {
     204                                showSubmit();
     205                            }
     206                        });
     207                    })
     208                })(jQuery);
     209            </script>
     210        <?php
     211        });
    206212        // phpcs:enable
    207213    }
     
    216222        ?>
    217223        case '<?php echo esc_js($this->type); ?>' :
    218             if (!field.label) {
    219                 field.label = '<?php /** @disregard */ echo esc_js($this->get_form_editor_field_title()); ?>';
    220             }
     224        if (!field.label) {
     225        field.label = '<?php /** @disregard */ echo esc_js($this->get_form_editor_field_title()); ?>';
     226        }
    221227        break;
    222         <?php
     228    <?php
    223229        // phpcs:enable
    224230    }
     
    239245        ob_start();
    240246        ?>
    241             <div class='ginput_container ginput_container_cp_info'>
    242                 <?php echo esc_html($this->get_field_works_or_expect_msg($this->form_hash_total_field($form))); ?>
    243             </div>
     247        <div class='ginput_container ginput_container_cp_info'>
     248            <?php echo esc_html($this->get_field_works_or_expect_msg($this->form_hash_total_field($form))); ?>
     249        </div>
    244250        <?php
    245251        return ob_get_clean();
  • cryptopay-gateway-for-gravity-forms/tags/1.0.3/app/Gateways/Gateway.php

    r3262505 r3308828  
    1919
    2020    /**
    21      * @param array<mixed> $properties
     21     * @param mixed $properties
    2222     */
    23     public function __construct(array $properties = [])
     23    public function __construct(mixed $properties = [])
    2424    {
    2525        parent::__construct($properties);
  • cryptopay-gateway-for-gravity-forms/tags/1.0.3/app/Gateways/GatewayLite.php

    r3262505 r3308828  
    1919
    2020    /**
    21      * @param array<mixed> $properties
     21     * @param mixed $properties
    2222     */
    23     public function __construct(array $properties = [])
     23    public function __construct(mixed $properties = [])
    2424    {
    2525        parent::__construct($properties);
  • cryptopay-gateway-for-gravity-forms/tags/1.0.3/app/Gateways/PaymentAddon.php

    r3262505 r3308828  
    130130    public function pre_process_feeds($feeds, $entry, $form): array
    131131    {
     132        if (!is_array($feeds)) {
     133            return [];
     134        }
    132135        $ourFeedIndex = array_search($this->_slug, array_column($feeds, 'addon_slug'), true);
    133136        $feeds[$ourFeedIndex]['meta']['version'] = Helpers::exists() ? 'cryptopay' : 'cryptopay_lite';
  • cryptopay-gateway-for-gravity-forms/tags/1.0.3/assets/js/main.js

    r3262505 r3308828  
    2323                    value = $(this).val();
    2424                } else if (elementType === 'textarea') {
    25                     value = $(this).text();
     25                    value = $(this).text() || $(this).val();
    2626                } else if (elementType === 'checkbox') {
    2727                    value = $(this).is(':checked') ? 'checked' : '';
  • cryptopay-gateway-for-gravity-forms/tags/1.0.3/cryptopay-gateway-for-gravity-forms.php

    r3298451 r3308828  
    1212/**
    1313 * Plugin Name: CryptoPay Gateway for Gravity Forms
    14  * Version:     1.0.2
     14 * Version:     1.0.3
    1515 * Plugin URI:  https://beycanpress.com/cryptopay/
    1616 * Description: Adds Cryptocurrency payment gateway (CryptoPay) for Gravity Forms.
     
    3030
    3131define('GF_CRYPTOPAY_FILE', __FILE__);
    32 define('GF_CRYPTOPAY_VERSION', '1.0.2');
     32define('GF_CRYPTOPAY_VERSION', '1.0.3');
    3333define('GF_CRYPTOPAY_KEY', basename(__DIR__));
    3434define('GF_CRYPTOPAY_URL', plugin_dir_url(__FILE__));
  • cryptopay-gateway-for-gravity-forms/tags/1.0.3/readme.txt

    r3298451 r3308828  
    55Tested up to: 6.8
    66Requires PHP: 8.1
    7 Stable Tag: 1.0.2
    8 Version: 1.0.2
     7Stable Tag: 1.0.3
     8Version: 1.0.3
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5757== Changelog ==
    5858
     59= 1.0.3 =
     60* Fixed: removed shell_exec requirement
     61
    5962= 1.0.2 =
    6063* Fixed: _load_textdomain_just_in_time early call
  • cryptopay-gateway-for-gravity-forms/trunk/app/Gateways/AbstractGateway.php

    r3262505 r3308828  
    5656
    5757    /**
    58      * @param array<mixed> $properties
    59      */
    60     public function __construct(array $properties = [])
    61     {
    62         parent::__construct($properties);
     58     * @param mixed $properties
     59     */
     60    public function __construct(mixed $properties = [])
     61    {
     62        if (is_array($properties)) {
     63            parent::__construct($properties);
     64        }
     65
    6366        $this->field_input_id = 'input_' . $this->id;
    6467
     
    151154    {
    152155        // phpcs:disable
    153         wp_add_inline_script(
    154             'crypto-pay-gateway-for-gravity-forms',
    155             `;(function ($) {
    156                 $(document).ready(() => {
    157                     let currentFieldId = 0;
    158                     const fieldList = $("#gform_fields");
    159                     const customSubmit = $(".custom-submit-placeholder");
    160                     const customSubmitParent = customSubmit.closest('#field_submit');
    161                     if (customSubmitParent) {
    162                         customSubmitParent.hide();
    163                     }
    164 
    165                     const hideSubmit = () => {
    166                         currentFieldId = 0;
    167                         customSubmit.hide();
    168                         customSubmitParent.hide();
    169                         $('#field_submit').hide();
    170                     }
    171 
    172                     const showSubmit = () => {
    173                         customSubmit.show();
    174                         customSubmitParent.show();
    175                         $('#field_submit').show();
    176                     }
    177 
    178                     $(document).on('gform_field_added', function (event, form, field) {
    179                         if (field.type === '` . esc_js($this->type) . `') {
    180                             hideSubmit()
    181                             currentFieldId = parseInt(field.id);
     156        add_action('admin_footer', function () {
     157?>
     158            <script type="text/javascript">
     159                ;
     160                (function($) {
     161                    $(document).ready(() => {
     162                        let currentFieldId = 0;
     163                        const fieldList = $("#gform_fields");
     164                        const customSubmit = $(".custom-submit-placeholder");
     165                        const customSubmitParent = customSubmit.closest('#field_submit');
     166                        if (customSubmitParent) {
     167                            customSubmitParent.hide();
    182168                        }
    183                         if (form.fields.some(field => field.type === 'total')) {
    184                             $('#field_' + currentFieldId + ' .ginput_container')?.html(
    185                                 '` . esc_js($this->get_field_works_or_expect_msg()) . `'
    186                             );
     169
     170                        const hideSubmit = () => {
     171                            currentFieldId = 0;
     172                            customSubmit.hide();
     173                            customSubmitParent.hide();
     174                            $('#field_submit').hide();
    187175                        }
    188                     });
    189                     $(document).on('gform_field_deleted', function (event, form, fieldId) {
    190                         if (parseInt(fieldId) === currentFieldId) {
    191                             showSubmit();
     176
     177                        const showSubmit = () => {
     178                            customSubmit.show();
     179                            customSubmitParent.show();
     180                            $('#field_submit').show();
    192181                        }
    193                         if (!form.fields.some(field => field.type === 'total')) {
    194                             $('#field_' + currentFieldId + ' .ginput_container')?.html(
    195                                 '` . esc_js($this->get_field_works_or_expect_msg(false)) . `'
    196                             );
    197                         }
    198                         if (!form.fields.some(field => field.type === '` . esc_js($this->type) . `')) {
    199                             showSubmit();
    200                         }
    201                     });
    202                 })
    203             })(jQuery);`,
    204             'after'
    205         );
     182
     183                        $(document).on('gform_field_added', function(event, form, field) {
     184                            if (field.type === '<?php esc_js($this->type) ?>') {
     185                                hideSubmit()
     186                                currentFieldId = parseInt(field.id);
     187                            }
     188                            if (form.fields.some(field => field.type === 'total')) {
     189                                $('#field_' + currentFieldId + ' .ginput_container')?.html(
     190                                    '<?php esc_js($this->get_field_works_or_expect_msg()) ?>'
     191                                );
     192                            }
     193                        });
     194                        $(document).on('gform_field_deleted', function(event, form, fieldId) {
     195                            if (parseInt(fieldId) === currentFieldId) {
     196                                showSubmit();
     197                            }
     198                            if (!form.fields.some(field => field.type === 'total')) {
     199                                $('#field_' + currentFieldId + ' .ginput_container')?.html(
     200                                    '<?php esc_js($this->get_field_works_or_expect_msg(false)) ?>'
     201                                );
     202                            }
     203                            if (!form.fields.some(field => field.type === '<?php esc_js($this->type) ?>')) {
     204                                showSubmit();
     205                            }
     206                        });
     207                    })
     208                })(jQuery);
     209            </script>
     210        <?php
     211        });
    206212        // phpcs:enable
    207213    }
     
    216222        ?>
    217223        case '<?php echo esc_js($this->type); ?>' :
    218             if (!field.label) {
    219                 field.label = '<?php /** @disregard */ echo esc_js($this->get_form_editor_field_title()); ?>';
    220             }
     224        if (!field.label) {
     225        field.label = '<?php /** @disregard */ echo esc_js($this->get_form_editor_field_title()); ?>';
     226        }
    221227        break;
    222         <?php
     228    <?php
    223229        // phpcs:enable
    224230    }
     
    239245        ob_start();
    240246        ?>
    241             <div class='ginput_container ginput_container_cp_info'>
    242                 <?php echo esc_html($this->get_field_works_or_expect_msg($this->form_hash_total_field($form))); ?>
    243             </div>
     247        <div class='ginput_container ginput_container_cp_info'>
     248            <?php echo esc_html($this->get_field_works_or_expect_msg($this->form_hash_total_field($form))); ?>
     249        </div>
    244250        <?php
    245251        return ob_get_clean();
  • cryptopay-gateway-for-gravity-forms/trunk/app/Gateways/Gateway.php

    r3262505 r3308828  
    1919
    2020    /**
    21      * @param array<mixed> $properties
     21     * @param mixed $properties
    2222     */
    23     public function __construct(array $properties = [])
     23    public function __construct(mixed $properties = [])
    2424    {
    2525        parent::__construct($properties);
  • cryptopay-gateway-for-gravity-forms/trunk/app/Gateways/GatewayLite.php

    r3262505 r3308828  
    1919
    2020    /**
    21      * @param array<mixed> $properties
     21     * @param mixed $properties
    2222     */
    23     public function __construct(array $properties = [])
     23    public function __construct(mixed $properties = [])
    2424    {
    2525        parent::__construct($properties);
  • cryptopay-gateway-for-gravity-forms/trunk/app/Gateways/PaymentAddon.php

    r3262505 r3308828  
    130130    public function pre_process_feeds($feeds, $entry, $form): array
    131131    {
     132        if (!is_array($feeds)) {
     133            return [];
     134        }
    132135        $ourFeedIndex = array_search($this->_slug, array_column($feeds, 'addon_slug'), true);
    133136        $feeds[$ourFeedIndex]['meta']['version'] = Helpers::exists() ? 'cryptopay' : 'cryptopay_lite';
  • cryptopay-gateway-for-gravity-forms/trunk/assets/js/main.js

    r3262505 r3308828  
    2323                    value = $(this).val();
    2424                } else if (elementType === 'textarea') {
    25                     value = $(this).text();
     25                    value = $(this).text() || $(this).val();
    2626                } else if (elementType === 'checkbox') {
    2727                    value = $(this).is(':checked') ? 'checked' : '';
  • cryptopay-gateway-for-gravity-forms/trunk/cryptopay-gateway-for-gravity-forms.php

    r3298451 r3308828  
    1212/**
    1313 * Plugin Name: CryptoPay Gateway for Gravity Forms
    14  * Version:     1.0.2
     14 * Version:     1.0.3
    1515 * Plugin URI:  https://beycanpress.com/cryptopay/
    1616 * Description: Adds Cryptocurrency payment gateway (CryptoPay) for Gravity Forms.
     
    3030
    3131define('GF_CRYPTOPAY_FILE', __FILE__);
    32 define('GF_CRYPTOPAY_VERSION', '1.0.2');
     32define('GF_CRYPTOPAY_VERSION', '1.0.3');
    3333define('GF_CRYPTOPAY_KEY', basename(__DIR__));
    3434define('GF_CRYPTOPAY_URL', plugin_dir_url(__FILE__));
  • cryptopay-gateway-for-gravity-forms/trunk/readme.txt

    r3298451 r3308828  
    55Tested up to: 6.8
    66Requires PHP: 8.1
    7 Stable Tag: 1.0.2
    8 Version: 1.0.2
     7Stable Tag: 1.0.3
     8Version: 1.0.3
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5757== Changelog ==
    5858
     59= 1.0.3 =
     60* Fixed: removed shell_exec requirement
     61
    5962= 1.0.2 =
    6063* Fixed: _load_textdomain_just_in_time early call
Note: See TracChangeset for help on using the changeset viewer.