Plugin Directory

Changeset 2052784


Ignore:
Timestamp:
03/18/2019 03:49:23 PM (7 years ago)
Author:
eplugin
Message:

multisite fix settings

Location:
digiwallet-for-woocommerce/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • digiwallet-for-woocommerce/trunk/INSTALL.txt

    r1972972 r2052784  
    66
    77********************************************************************************
     8
    89-- Requirements ----------------------------------------------------------------
    910
  • digiwallet-for-woocommerce/trunk/LICENSE

    r1972972 r2052784  
    66 Everyone is permitted to copy and distribute verbatim copies
    77 of this license document, but changing it is not allowed.
    8 
    98
    109                            Preamble
  • digiwallet-for-woocommerce/trunk/LICENSE.txt

    r1972972 r2052784  
    55 Everyone is permitted to copy and distribute verbatim copies
    66 of this license document, but changing it is not allowed.
    7 
    87
    98                            Preamble
  • digiwallet-for-woocommerce/trunk/README.md

    r1972972 r2052784  
    11# digiwallet plugin for Woocommerce
    2 
    32
    43## Usage
     
    2120
    2221## Installation
    23 
    2422
    2523### 1. Set up a Digiwallet account
  • digiwallet-for-woocommerce/trunk/changelog.txt

    r2013242 r2052784  
    225.0.4   21-9-2018       moved to digiwallet, adjusted text info and removed ssl warnings.
    335.0.5   15-1-2019       replace CUrl with WP_Http
     45.0.6   7-3-2019        fix plugin in case active WP Multisite
  • digiwallet-for-woocommerce/trunk/digiwallet.php

    r2014121 r2052784  
    1313 * Author: DigiWallet.nl
    1414 * Author URI: https://www.digiwallet.nl
    15  * Version: 5.0.5
     15 * Version: 5.0.6 - 7-3-2019 fix plugin in case active WP Multisite
    1616 */
    1717define('DIGIWALLET_TABLE_NAME', 'woocommerce_digiwallet');
    18 
    19 if (! in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
    20     return;
    21 }
    2218
    2319if (! class_exists('DigiWalletInstall')) {
     
    2723register_activation_hook(__FILE__, array(
    2824    'DigiWalletInstall',
    29     'install_db'));
     25    'install_db')
     26);
     27
     28/**
     29 * WooCommerce fallback notice.
     30 *
     31 * @return string
     32 */
     33function woocommerce_digiwallet_missing_wc_notice() {
     34    echo '<div class="error"><p><strong>DigiWallet for WooCommerce requires WooCommerce to be installed and active</strong></p></div>';
     35}
    3036
    3137/**
     
    6672    // so do nothing
    6773    if (! class_exists('WC_Payment_Gateway')) {
     74        add_action( 'admin_notices', 'woocommerce_digiwallet_missing_wc_notice' );
    6875        return;
    6976    }
  • digiwallet-for-woocommerce/trunk/includes/WC_Gateway_DigiWallet.php

    r1973568 r2052784  
    217217            $insert = $wpdb->insert($DigiWalletTable, array(
    218218                'cart_id' => esc_sql($order->get_order_number()),
     219                'site_id' => get_current_blog_id(),
    219220                'order_id' => esc_sql($order->get_id()),
    220221                'rtlo' => esc_sql($this->rtlo),
     
    391392        $DigiWalletTable = $this->getDigiWalletTableName();
    392393        return $wpdb->update($DigiWalletTable, $data, array(
     394            'site_id' => get_current_blog_id(),
    393395            'order_id' => esc_sql($order->get_id())));
    394396    }
     
    437439        global $wpdb;
    438440       
    439         return $wpdb->prefix . DIGIWALLET_TABLE_NAME;
     441        return $wpdb->base_prefix . DIGIWALLET_TABLE_NAME;
    440442    }
    441443
     
    450452        global $wpdb;
    451453        $DigiWalletTable = $this->getDigiWalletTableName();
    452         $sql = 'SELECT * FROM ' . $DigiWalletTable . " WHERE `order_id` = '" . esc_sql($orderId) . "' AND `transaction_id` = '" . esc_sql($trxid) . "' ORDER BY `id` DESC";
     454        $sql = 'SELECT * FROM ' . $DigiWalletTable . " WHERE `site_id` = '" . get_current_blog_id() . "' AND `order_id` = '" . esc_sql($orderId) . "' AND `transaction_id` = '" . esc_sql($trxid) . "' ORDER BY `id` DESC";
    453455        return $wpdb->get_row($sql, OBJECT);
    454456    }
     
    516518            $requiredColumns = array(
    517519                'id',
     520                'site_id',
    518521                'cart_id',
    519522                'order_id',
  • digiwallet-for-woocommerce/trunk/includes/digiwallet.class.php

    r2013242 r2052784  
    2121    // Constants
    2222
    23     const APP_ID = 'dw_woocommerce3.x_5.0.5';
     23    const APP_ID = 'dw_woocommerce3.x_5.0.6';
    2424
    2525    const MIN_AMOUNT            = 84;
  • digiwallet-for-woocommerce/trunk/includes/install.php

    r1973568 r2052784  
    99    {
    1010        global $wpdb;
    11         $digiwalletTbl = $wpdb->prefix . DIGIWALLET_TABLE_NAME;
     11        $digiwalletTbl = $wpdb->base_prefix . DIGIWALLET_TABLE_NAME;
    1212        if(!$wpdb->get_var("SHOW TABLES LIKE '$digiwalletTbl'") == $digiwalletTbl) {
    1313            self::create_digiwallet_db();
    1414        }
     15        self::update_digiwallet_db();
    1516    }
    1617
     
    2324        $charset_collate = $wpdb->get_charset_collate();
    2425
    25         $sql = "CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . DIGIWALLET_TABLE_NAME . " (
     26        $sql = "CREATE TABLE IF NOT EXISTS " . $wpdb->base_prefix . DIGIWALLET_TABLE_NAME . " (
    2627        `id` int(11) NOT NULL AUTO_INCREMENT,
    2728        `cart_id` int(11) NOT NULL DEFAULT '0',
     
    4041        dbDelta($sql);
    4142    }
     43   
     44    /**
     45     * Update woocommerce_digiwallet table
     46     */
     47    public static function update_digiwallet_db()
     48    {
     49        global $wpdb;
     50        $DigiWalletTable = $wpdb->base_prefix . DIGIWALLET_TABLE_NAME;
     51       
     52        if ($wpdb->get_var("SHOW TABLES LIKE '$DigiWalletTable'") == $DigiWalletTable) {
     53            $dbColums = $wpdb->get_col('DESC ' . $DigiWalletTable, 0);
     54            if(!in_array('site_id', $dbColums)) {
     55                $sql_update = ("ALTER TABLE `$DigiWalletTable` ADD `site_id` INT NOT NULL DEFAULT '1' AFTER `id`;");
     56                $wpdb->query($sql_update);
     57            }
     58        }
     59    }
    4260}
  • digiwallet-for-woocommerce/trunk/readme.txt

    r2013318 r2052784  
    33Tags: Digiwallet ,ideal , sofort, Bancontact, Paysafecard , Credit card, Maestro, Visa, paypal,  eplugins , targetpay , overboekingen
    44Requires at least: 4.9.8
    5 Tested up to: 5.0.5
     5Tested up to: 5.1
    66Requires PHP: 5.6
    7 Stable tag: 5.0.5
     7Stable tag: Master
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2929* Bancontact
    3030* Sofort
    31 * PaySafeCard
    3231* Afterpay
    3332* Credit Card
     
    4443
    4544### 1. Set up a Digiwallet account
    46 Before you can use the plugin, please sign up for a Digiwallet account on <a href="https://www.digiwallet.nl">Digiwallet.nl</a>
     45Before you can use the plugin, please sign up for a Digiwallet account on www.Digiwallet.nl
    4746
    4847Note that the plugin can be used in a live environment only after it has been completed with your details and
     
    5554### 3. Setting up
    5655
    57 Check out the specific installation instructions and tips on <a href="https://www.e-plugins.nl">e-plugins.nl</a>
     56Check out the specific installation instructions and tips on https://www.e-plugins.nl/
    5857
    5958== Frequently Asked Questions ==
    6059
    61 Please see the FAQ on <a href="https://www.e-plugins.nl">e-plugins.nl</a>
     60Please see the FAQ on https://www.e-plugins.nl/
    6261
    6362== Screenshots ==
     
    7069= 5.0.4 =
    7170Initial release , complete renewed from targetpay
    72 = 5.0.5 =
    73 Replaced curl with wp_http
    74 
    7571
    7672== Upgrade Notice ==
Note: See TracChangeset for help on using the changeset viewer.