Skip to content

Commit 122c7fa

Browse files
committed
Version 1.6.1
Improve plugin installation process
1 parent c0406cb commit 122c7fa

File tree

4 files changed

+28
-19
lines changed

4 files changed

+28
-19
lines changed

gourl.php

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ public function __construct()
9090
$this->languages = self::languages();
9191

9292
// compatible test
93-
$ver = get_option(GOURL.'version');
94-
if (!$ver || version_compare($ver, GOURL_VERSION) < 0) $this->upgrade();
93+
$ver = get_option(GOURL.'version'); // current plugin version; '-empty-' if you unistalled plugin
94+
$prevver = get_option(GOURL.'prev_version'); // current plugin version; ; keep version value when plugin uninstalled; $ver == $prevver if plugin activated
95+
if (!$ver || version_compare($ver, GOURL_VERSION) < 0 || version_compare($prevver, $ver) < 0) $this->upgrade();
9596
elseif (is_admin()) gourl_retest_dir();
9697

98+
9799

98100
// Current Page, Record ID
99101
$this->page = (isset($_GET['page'])) ? substr(preg_replace("/[^A-Za-z0-9\_\-]+/", "", $_GET['page']), 0, 50) : "";
@@ -6331,7 +6333,7 @@ public function cryptopayments ($pluginName, $amount, $amountLabel = "USD", $ord
63316333
/*
63326334
* 76.
63336335
*/
6334-
private function upgrade ()
6336+
private function upgrade()
63356337
{
63366338
global $wpdb;
63376339

@@ -6397,16 +6399,13 @@ private function upgrade ()
63976399
$wpdb->query("alter table crypto_files add key `priceCoin` (priceCoin)");
63986400
$wpdb->query("alter table crypto_files add key `priceLabel` (priceLabel)");
63996401
}
6400-
elseif (true === version_compare(get_option(GOURL.'version'), '1.4.7', '<'))
6402+
elseif ($wpdb->query("select fileUrl from crypto_files limit 1") === false)
64016403
{
64026404
$wpdb->query("alter table crypto_files add `fileUrl` varchar(255) NOT NULL DEFAULT '' after fileName");
64036405
$wpdb->query("alter table crypto_files add key `fileUrl` (fileUrl)");
64046406
$wpdb->query("ALTER TABLE `crypto_files` CHANGE `priceCoin` `priceCoin` DOUBLE(17,5) NOT NULL DEFAULT '0.00000'");
64056407
}
6406-
elseif (true === version_compare(get_option(GOURL.'version'), '1.2.7', '<'))
6407-
{
6408-
$wpdb->query("ALTER TABLE `crypto_files` CHANGE `priceCoin` `priceCoin` DOUBLE(17,5) NOT NULL DEFAULT '0.00000'");
6409-
}
6408+
64106409

64116410

64126411
// TABLE 2 - crypto_payments
@@ -6536,17 +6535,23 @@ private function upgrade ()
65366535

65376536
$wpdb->query($sql);
65386537
}
6539-
elseif (true === version_compare(get_option(GOURL.'version'), '1.2.7', '<'))
6538+
6539+
6540+
if (true === version_compare(get_option(GOURL.'prev_version'), '1.6.0', '<'))
6541+
foreach($this->coin_names as $k => $v)
65406542
{
6541-
$wpdb->query("ALTER TABLE `crypto_products` CHANGE `priceCoin` `priceCoin` DOUBLE(17,5) NOT NULL DEFAULT '0.00000'");
6542-
}
6543-
6543+
update_option(GOURL.$v."public_key", "");
6544+
update_option(GOURL.$v."private_key", "");
6545+
}
6546+
6547+
65446548
// upload dir
65456549
gourl_retest_dir();
65466550

65476551
if (!file_exists($this->hash_url)) file_put_contents($this->hash_url, '{"nonce":"1"}');
65486552

6549-
// current version
6553+
// current plugin version
6554+
update_option(GOURL.'prev_version', GOURL_VERSION);
65506555
update_option(GOURL.'version', GOURL_VERSION);
65516556

65526557
ob_flush();
@@ -8569,5 +8574,5 @@ function gourl_altcoin_btc_price ($altcoin, $interval = 1)
85698574
}
85708575

85718576

8572-
return 0;
8577+
return 0;
85738578
}

gourl_wordpress.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: GoUrl Bitcoin Payment Gateway & Paid Downloads & Membership
44
Plugin URI: https://gourl.io/bitcoin-wordpress-plugin.html
55
Description: Official <a href="https://gourl.io">GoUrl.io</a> Bitcoin Payment Gateway for Wordpress. White Label Solution. Provides bitcoin/altcoin payment gateways for - WooCommerce, Paid Memberships Pro, bbPress, Give Donations, Pay-Per-View, Pay-Per-Download, etc. Accept Bitcoin, BitcoinCash, BitcoinSV, Litecoin, Dash, Dogecoin, etc payments online. No Chargebacks, Global, Secure. All in automatic mode.
6-
Version: 1.6.0
6+
Version: 1.6.1
77
Author: GoUrl.io
88
Author URI: https://gourl.io
99
WC requires at least: 2.1.0
@@ -33,7 +33,7 @@
3333

3434
DEFINE('GOURL', "gourl");
3535
DEFINE('GOURL_PREVIEW', "gourladmin");
36-
DEFINE('GOURL_VERSION', "1.6.0");
36+
DEFINE('GOURL_VERSION', "1.6.1");
3737
DEFINE('GOURL_ADMIN', admin_url("admin.php?page="));
3838
DEFINE('GOURL_DIR', $dir_arr["basedir"]."/".GOURL.'/');
3939
DEFINE('GOURL_DIR2', $dir_arr["baseurl"]."/".GOURL.'/');

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
GoUrl Bitcoin Payment Gateway & Paid Downloads & Membership
33
-----------------------------------------------------------
44

5-
Version 1.6.0
5+
Version 1.6.1
66

77

88
**GoUrl Official Bitcoin/Altcoin Payment Gateway for Wordpress 3.5 or higher version**
@@ -17,7 +17,7 @@ Accept Bitcoin, BitcoinCash, BitcoinSV, Litecoin, Dash, Dogecoin, Speedcoin, Red
1717
* Instruction - [https://tishonator.com/blog/how-to-add-bitcoin-payment-to-your-woocommerce-store](https://tishonator.com/blog/how-to-add-bitcoin-payment-to-your-woocommerce-store)
1818
* Requires at least: 3.5
1919
* Tested up to: 5.5
20-
* Stable Tag: 1.6.0
20+
* Stable Tag: 1.6.1
2121
* License: GNU Version 2 or Any Later Version
2222

2323

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Author URI: https://gourl.io
66
Tags: bitcoin, accept bitcoin, bitcoin payments, bitcoin woocommerce, bitcoin wordpress plugin, bitcoin wordpress, bitcoin payments, bitcoincash, bitcoin cash, bitcoin sv, bitcoins, affiliate program, cryptocurrency, affiliates, altcoins, bitpay, paid memberships pro, pmpro, paid membership, btc, marketpress, coinbase, e-commerce, content protection, access-control, credit cards, currency, payment, dash, digital downloads, dogecoin, donation, downloads, e-downloads, e-store, easy digital downloads, ecommerce, feathercoin, universalcurrency, file download, gateway, gourl, litecoin, membership, paid content, payment gateway, paypal, potcoin, protection, reddcoin, registration, restrict access, restrict content, speedcoin, subscription, usd, vertcoin, virtual currency, jigoshop, woocommerce, authorize, shop, wp e-commerce, appthemes, classipress, vantage, jobroller, clipper, taskerr, hirebee, ideas, quality control, akismet, bbpress, buddypress, discussion, forums, forum, bitcoin donations, bitcoin donation, charity, churches, crowdfunding, donate, donation, donations, fundraiser, fundraising, gifts, giving, non-profit, nonprofit, paypal, stripe, give, wordpress donations, bitcoin, payments, payment gateway, digital downloads, download, downloads, e-commerce, e-downloads, e-store, ecommerce, eshop, selling, wp ecommerce, edd, easy digital downloads, litecoin, dogecoin, dash, speedcoin, vertcoin, reddcoin, feathercoin, potcoin, monetaryunit, peercoin, white label
77
Requires at least: 3.5
88
Tested up to: 5.5
9-
Stable Tag: 1.6.0
9+
Stable Tag: 1.6.1
1010
License: GNU Version 2 or Any Later Version
1111
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1212

@@ -180,6 +180,9 @@ Yes, we offer [Free Technical Support](https://gourl.io/view/contact/Contact_Us.
180180

181181
== Changelog ==
182182

183+
= 1.6.1 =
184+
Improve plugin installation process
185+
183186
= 1.6.0 =
184187
Several new enhancements. Mandatory Update!
185188

@@ -359,3 +362,4 @@ Add Pay-Per-Product, Pay-Per-Membership
359362

360363
= 1.0.0 =
361364
This is the first version of GoUrl Bitcoin Payment Gateway & Paid Downloads & Membership Plugin
365+

0 commit comments

Comments
 (0)