Plugin Directory

Changeset 2662719


Ignore:
Timestamp:
01/24/2022 02:52:14 AM (4 years ago)
Author:
customdonations
Message:

tagging version 1.2

Location:
customdonations/tags/1.2
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • customdonations/tags/1.2/classes/cd-config-class.php

    r2048717 r2662719  
    2424        add_settings_section('customdonations_section_account', __('Optional Settings', 'customdonations'), null, 'customdonations');
    2525        add_settings_field('customdonations_acctid', __('Account', 'customdonations'), [$this, 'customdonations_field_account_callback'], 'customdonations', 'customdonations_section_account', ['label_for' => 'customdonations_acctid', 'class' => 'customdonations_account_row', 'customdonations_custom_data' => 'custom']);
    26         add_settings_field('customdonations_paymentver', __('Default Payment Version', 'customdonations'), [$this, 'customdonations_paymentver_callback'],'customdonations','customdonations_section_account', ['label_for' => 'customdonations_paymentver', 'class' => 'customdonations_account_row', 'customdonations_custom_data' => 'custom']);
     26        //add_settings_field('customdonations_paymentver', __('Default Payment Version', 'customdonations'), [$this, 'customdonations_paymentver_callback'],'customdonations','customdonations_section_account', ['label_for' => 'customdonations_paymentver', 'class' => 'customdonations_account_row', 'customdonations_custom_data' => 'custom']);
    2727    }
    2828
     
    111111     * Allows the paymentVersion to have a different default, if the user wants to use inline forms across their site.
    112112     */
    113     function customdonations_paymentver_callback($args){
     113    /*function customdonations_paymentver_callback($args){
    114114        ?>
    115115        <select id="<?php echo esc_attr($args['label_for']); ?>" name="customdonations_options[<?php echo esc_attr($args['label_for']); ?>]"
     
    126126        </p>
    127127        <?php
    128     }
     128    }*/
    129129
    130130    /**
  • customdonations/tags/1.2/classes/cd-shortcode-class.php

    r2323399 r2662719  
    99    private $helper;
    1010    private $memberid_enabled, $memberid_field; //fields set in settings.
    11     public $account, $form, $allocation, $mode, $memberId, $paymentVersion, $interval, $useReCaptcha, $shortcodeDebug;
     11    public $account, $form, $allocation, $mode, $memberId, /*$paymentVersion,*/ $interval, $useReCaptcha, $shortcodeDebug;
    1212    public $baseUrl = 'https://api.customdonations.com';
    1313    public $apiVersion = 'v1';
     
    1919        $opts = get_option('customdonations_options'); //get settings from the database
    2020        $config_acctid = !empty($opts['customdonations_acctid']) ? $opts['customdonations_acctid'] : null; //is there an account id configured in the DB?
    21         $config_paymentver = !empty($opts['customdonations_paymentver']) && is_numeric($opts['customdonations_paymentver']) ? (int) $opts['customdonations_paymentver'] : 1;
     21        //$config_paymentver = !empty($opts['customdonations_paymentver']) && is_numeric($opts['customdonations_paymentver']) ? (int) $opts['customdonations_paymentver'] : 1;
    2222        $this->memberid_enabled = $helper::VarToBool($opts['customdonations_memberid_enabled']);
    2323        $this->memberid_field = !empty($opts['customdonations_memberid_field']) ? $opts['customdonations_memberid_field'] : null; //what field should be used for logged-in users?
     
    2727        $this->memberId = $this->memberid_enabled ? $this->fill_memberid_field() : null;  //if we aren't wanting to fill memberId for logged-in users, use null as the value
    2828        $this->mode = ($mode === 'live' || $mode === 'test') ? esc_attr($mode) : null; //there is an issue if mode isn't provided.
    29         $this->paymentVersion = !empty($paymentversion) && $paymentversion > 0 && $paymentversion <= 2 ? $paymentversion : $config_paymentver; //1: for modal payment window. 2: for inline payment with Google/Apple Pay options (US CLIENTS ONLY!)
     29        //$this->paymentVersion = !empty($paymentversion) && $paymentversion > 0 && $paymentversion <= 2 ? $paymentversion : $config_paymentver; //1: for modal payment window. 2: for inline payment with Google/Apple Pay options (US CLIENTS ONLY!)
    3030        $this->interval = $helper::VarToBool($interval) ? trim(strtolower($interval)) : null; // once, monthly, quarterly, yearly, or empty.
    3131        $this->useReCaptcha = $helper::VarToBool($userecaptcha);
     
    7575    function enqueue_customdonations_scripts_js() {
    7676        $dateTime = new DateTime();
    77         $frm_builder_script_url = "{$this->baseUrl}/{$this->apiVersion}/js/form-builder.min.js";
     77        //$frm_builder_script_url = "{$this->baseUrl}/{$this->apiVersion}/js/form-builder.min.js";
    7878        $cacheBust = $dateTime->getTimestamp();
    79         wp_enqueue_script('customdonations-form-builder', $frm_builder_script_url, '', $cacheBust, true);
     79        //wp_enqueue_script('customdonations-form-builder', $frm_builder_script_url, '', $cacheBust, true);
    8080        wp_enqueue_script('customdonations-shortcode', plugins_url('../js/cd-shortcode.js', __FILE__), '', $cacheBust, true);
    8181        $data = [
     
    8787            'baseUrl' => $this->baseUrl,
    8888            'mode' => $this->mode,
    89             'paymentVersion' => $this->paymentVersion,
     89            //'paymentVersion' => $this->paymentVersion,
    9090            'interval' => $this->interval,
    9191            'useReCaptcha' => $this->useReCaptcha,
     
    102102        $user_current = wp_get_current_user();
    103103        $return_val = null; //return null by default.
     104        if ($this->memberid_field == "id")
     105            $this->memberid_field = "ID";
    104106        if (get_class($user_current) == "WP_User" && !empty($this->memberid_field)) { //we have a logged-in user.
    105107            $return_val = esc_attr($user_current->get($this->memberid_field)); //get the desired user field value.
  • customdonations/tags/1.2/customdonations.php

    r2313474 r2662719  
    66 * Author URI:      https://www.customdonations.com
    77 * Text Domain:     customdonations
    8  * Version:         1.1.3
     8 * Version:         1.2
    99 * License:         GPLv2
    1010 * License URI:     https://www.gnu.org/licenses/gpl-2.0.html
  • customdonations/tags/1.2/js/cd-shortcode.js

    r2313474 r2662719  
    1 class CustomDonations_WP{
    2     constructor(formData){
    3         this.debugEnabled = !!(formData.shortcodeDebug);
    4         delete(formData.shortcodeDebug);       
    5         this.formData = formData;
    6         this.formData.paymentVersion = parseInt(formData.paymentVersion);
    7         this.formData.useReCaptcha = !!(formData.useReCaptcha);
    8     }
    9     Load(){
    10         this.debugEnabled ? console.log(this.formData) : null;
    11         CustomDonations.BuildForm(this.formData);
    12     }
    13 }
    14 var cdLoad = new CustomDonations_WP(shortcode_data);
    15 cdLoad.Load();
     1var cdDebugEnabled = !!(shortcode_data.shortcodeDebug);
     2delete(shortcode_data.shortcodeDebug);
     3var cdFormConfig = shortcode_data;
     4//cdFormConfig.paymentVersion = parseInt(shortcode_data.paymentVersion);
     5cdFormConfig.useReCaptcha = !!(shortcode_data.useReCaptcha);
     6
     7var LoadCDScripts = function () {
     8    var cdscript = document.createElement('script');
     9    cdscript.onerror = function (e) {
     10        document.head.removeChild(this);
     11        setTimeout(LoadCDScripts, 1750);
     12    };
     13    cdscript.onload = function () {
     14        cdDebugEnabled ? console.log(cdFormConfig) : null;
     15        CustomDonations.BuildForm(cdFormConfig);
     16    };
     17    cdscript.src = "https://api.customdonations.com/v1/js/form-builder.min.js?v=" + new Date().getTime();
     18    document.head.appendChild(cdscript);
     19};
     20LoadCDScripts();
    1621shortcode_data = null;
  • customdonations/tags/1.2/readme.txt

    r2496435 r2662719  
    11=== CustomDonations.com ===
    2 Tested up to: 5.7
     2Tested up to: 5.9
    33Requires PHP: 5.2
    4 Stable tag: 1.1.4
     4Stable tag: 1.2
    55License: GPLv2
    66License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3434To add a form to your site, add the following information from the Custom Donations site to your site in the following format:
    3535
    36 `[CustomDonations account="account-id-goes-here"  form="form-id-goes-here" mode="live" allocation="optional" paymentVersion=1]`
     36`[CustomDonations account="account-id-goes-here"  form="form-id-goes-here" mode="live" allocation="optional"]`
    3737
    3838The value for allocation is optional and may be omitted from the shortcode if it doesn't apply to your form. The value for 'mode' if you wish to test your form is 'test'.
     
    4242
    4343== Changelog ==
     44= 1.2=
     45JavaScript improvements to shortcode loader. Minor bug fixes.
    4446= 1.1.4 =
    4547Adjustments to member id field processing.
Note: See TracChangeset for help on using the changeset viewer.