Skip to content

Commit c0406cb

Browse files
committed
Version 1.6.0
Several new enhancements. Mandatory Update!
1 parent e29ac2f commit c0406cb

File tree

9 files changed

+42
-23
lines changed

9 files changed

+42
-23
lines changed

gourl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ private function save_settings()
10781078
if ($arr)
10791079
{
10801080
wp_mail(get_bloginfo('admin_email'), 'Notification - GoUrl Bitcoin Payment Gateway Plugin - Cryptobox Keys Changed',
1081-
date("r")."\n\nGoUrl Bitcoin Payment Gateway for Wordpress plugin\n\nFollowing crypto payment box/es keys was changed on your website -\n\n".print_r($arr, true));
1081+
date("r")." GMT \n\nGoUrl Bitcoin Payment Gateway for Wordpress plugin \n\nCrypto payment box/es keys was changed on your website (gourl plugin Settings Page).\n\nIF YOU DIDN'T CHANGE YOUR GOURL KEYS, PLEASE CHANGE YOUR WORDPRESS ADMIN PASSWORD AND RESTORE ORIGINAL KEYS !\nALSO UPDATE GOURL PLUGIN TO THE LATEST VERSION IF YOU ARE USING AN OLD VERSION ! \n\n".print_r($arr, true));
10821082

10831083
$this->save_cryptokeys_hash();
10841084
}

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.5.6
6+
Version: 1.6.0
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.5.6");
36+
DEFINE('GOURL_VERSION', "1.6.0");
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.'/');

includes/cryptobox.callback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @copyright 2014-2020 Delta Consultants
1212
* @category Libraries
1313
* @website https://gourl.io
14-
* @version 2.1.7
14+
* @version 2.2.0
1515
*
1616
*
1717
* This file processes call-backs from Cryptocoin Payment Box server when new payment

includes/cryptobox.class.php

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @example https://gourl.io/lib/examples/example_customize_box.php <----
1616
* @gitHub https://github.com/cryptoapi/Payment-Gateway
1717
* @license Free GPLv2
18-
* @version 2.1.7
18+
* @version 2.2.0
1919
*
2020
*
2121
* CLASS CRYPTOBOX - LIST OF METHODS:
@@ -79,7 +79,7 @@
7979
elseif (!defined('ABSPATH')) exit; // Wordpress
8080

8181

82-
define("CRYPTOBOX_VERSION", "2.1.7");
82+
define("CRYPTOBOX_VERSION", "2.2.0");
8383

8484
// GoUrl supported crypto currencies
8585
define("CRYPTOBOX_COINS", json_encode(array('bitcoin', 'bitcoincash', 'bitcoinsv', 'litecoin', 'dash', 'dogecoin', 'speedcoin', 'reddcoin', 'potcoin', 'feathercoin', 'vertcoin', 'peercoin', 'monetaryunit', 'universalcurrency')));
@@ -131,6 +131,7 @@ class Cryptobox {
131131
private $processed = false; // optional - set flag to paid & processed
132132
private $cookieName = ""; // user cookie/session name (if cookies/sessions use)
133133
private $localisation = ""; // localisation; en - English, es - Spanish, fr - French, de - German, nl - Dutch, it - Italian, ru - Russian, pl - Polish, pt - Portuguese, fa - Persian, ko - Korean, ja - Japanese, id - Indonesian, tr - Turkish, ar - Arabic, cn - Simplified Chinese, zh - Traditional Chinese, hi - Hindi
134+
private $ver = ""; // version
134135

135136

136137
public function __construct($options = array())
@@ -141,8 +142,7 @@ public function __construct($options = array())
141142
if (!function_exists( 'curl_init' )) die(sprintf("Error. Please enable <a target='_blank' href='%s'>CURL extension</a> in PHP. <a target='_blank' href='%s'>Read here &#187;</a>", "http://php.net/manual/en/book.curl.php", "http://stackoverflow.com/questions/1347146/how-to-enable-curl-in-php-xampp"));
142143
if (!function_exists( 'mysqli_connect' )) die(sprintf("Error. Please enable <a target='_blank' href='%s'>MySQLi extension</a> in PHP. <a target='_blank' href='%s'>Read here &#187;</a>", "http://php.net/manual/en/book.mysqli.php", "http://crybit.com/how-to-enable-mysqli-extension-on-web-server/"));
143144
if (version_compare(phpversion(), '5.4.0', '<')) die(sprintf("Error. You need PHP 5.4.0 (or greater). Current php version: %s", phpversion()));
144-
145-
145+
146146
foreach($options as $key => $value)
147147
if (in_array($key, array("public_key", "private_key", "webdev_key", "amount", "amountUSD", "period", "language", "iframeID", "orderID", "userID", "userFormat"))) $this->$key = (is_string($value)) ? trim($value) : $value;
148148

@@ -241,6 +241,18 @@ public function __construct($options = array())
241241
}
242242
}
243243

244+
// version string
245+
$this->ver = "version | gourlphp " . CRYPTOBOX_VERSION;
246+
if (CRYPTOBOX_WORDPRESS) $this->ver .= " | gourlwordpress" . (defined('GOURL_VERSION') ? " ".GOURL_VERSION : "");
247+
if (CRYPTOBOX_WORDPRESS && defined('GOURLWC_VERSION') && strpos($this->orderID, "gourlwoocommerce.") === 0) $this->ver .= " | gourlwoocommerce " . GOURLWC_VERSION;
248+
if (CRYPTOBOX_WORDPRESS && defined('GOURLAP_VERSION') && strpos($this->orderID, "gourlappthemes.") === 0) $this->ver .= " | gourlappthemes " . GOURLAP_VERSION;
249+
if (CRYPTOBOX_WORDPRESS && defined('GOURLEDD_VERSION') && strpos($this->orderID, "gourledd.") === 0) $this->ver .= " | gourledd " . GOURLEDD_VERSION;
250+
if (CRYPTOBOX_WORDPRESS && defined('GOURLPMP_VERSION') && strpos($this->orderID, "gourlpmpro.") === 0) $this->ver .= " | gourlpmpro " . GOURLPMP_VERSION;
251+
if (CRYPTOBOX_WORDPRESS && defined('GOURLGV_VERSION') && strpos($this->orderID, "gourlgive.") === 0) $this->ver .= " | gourlgive " . GOURLGV_VERSION;
252+
if (CRYPTOBOX_WORDPRESS && defined('GOURLJI_VERSION') && strpos($this->orderID, "gourljigoshop.") === 0) $this->ver .= " | gourljigoshop " . GOURLJI_VERSION;
253+
if (CRYPTOBOX_WORDPRESS && defined('GOURLWPSC_VERSION') && strpos($this->orderID, "gourlwpecommerce.") === 0) $this->ver .= " | gourlwpecommerce " . GOURLWPSC_VERSION;
254+
if (CRYPTOBOX_WORDPRESS && defined('GOURLMP_VERSION') && strpos($this->orderID, "gourlmarketpress.") === 0) $this->ver .= " | gourlmarketpress " . GOURLMP_VERSION;
255+
244256
if (!$this->iframeID) $this->iframeID = $this->iframe_id();
245257

246258
$this->check_payment();
@@ -273,6 +285,8 @@ public function display_cryptobox($submit_btn = true, $width = "540", $height =
273285

274286
$width = intval($width);
275287
$height = intval($height);
288+
289+
$box_style = trim($box_style, "; ") .";max-width:".$width."px !important;max-height:".$height."px !important;";
276290

277291
$cryptobox_html = "";
278292
$val = md5($this->iframeID.$this->private_key.$this->userID);
@@ -295,7 +309,7 @@ public function display_cryptobox($submit_btn = true, $width = "540", $height =
295309

296310
$cryptobox_html .= "<div align='center' style='min-width:".$width."px'><iframe id='$this->iframeID' ".($box_style?'style="'.htmlspecialchars($box_style, ENT_COMPAT).'"':'')." scrolling='no' marginheight='0' marginwidth='0' frameborder='0' width='$width' height='$height'></iframe></div>";
297311
$cryptobox_html .= "<div><script type='text/javascript'>";
298-
$cryptobox_html .= "cryptobox_show($this->boxID, '$this->coinName', '$this->public_key', $this->amount, $this->amountUSD, '$this->period', '$this->language', '$this->iframeID', '$this->userID', '$this->userFormat', '$this->orderID', '$this->cookieName', '$this->webdev_key', '$hash', $width, $height);";
312+
$cryptobox_html .= "cryptobox_show($this->boxID, '$this->coinName', '$this->public_key', $this->amount, $this->amountUSD, '$this->period', '$this->language', '$this->iframeID', '$this->userID', '$this->userFormat', '$this->orderID', '$this->cookieName', '$this->webdev_key', '".base64_encode($this->ver)."', '$hash', $width, $height);";
299313
$cryptobox_html .= "</script></div>";
300314

301315
if ($submit_btn && !$this->paid)
@@ -355,6 +369,7 @@ public function cryptobox_json_url()
355369
"j" => 1, // json
356370
"d" => base64_encode($ip),
357371
"f" => base64_encode($this->ua(false)),
372+
"t" => base64_encode($this->ver),
358373
"h" => $hash
359374
);
360375

@@ -433,8 +448,8 @@ public function get_json_values()
433448
public function cryptobox_hash($json = false, $width = 0, $height = 0)
434449
{
435450

436-
if ($json) $hash_str = $this->boxID."|".$this->coinName."|".$this->public_key."|".$this->private_key."|".$this->webdev_key."|".$this->amount."|".$this->amountUSD."|".$this->period."|". $this->language."|".$this->orderID."|".$this->userID."|".$this->userFormat."|".$this->ip_address();
437-
else $hash_str = $this->boxID."|".$this->coinName."|".$this->public_key."|".$this->private_key."|".$this->webdev_key."|".$this->amount."|".$this->amountUSD."|".$this->period."|". $this->language."|".$this->orderID."|".$this->userID."|".$this->userFormat."|".$this->iframeID."|".$width."|".$height;
451+
if ($json) $hash_str = $this->boxID."|".$this->coinName."|".$this->public_key."|".$this->private_key."|".$this->webdev_key."|".$this->amount."|".$this->amountUSD."|".$this->period."|". $this->language."|".$this->orderID."|".$this->userID."|".$this->userFormat."|".$this->ver."|".$this->ip_address();
452+
else $hash_str = $this->boxID."|".$this->coinName."|".$this->public_key."|".$this->private_key."|".$this->webdev_key."|".$this->amount."|".$this->amountUSD."|".$this->period."|". $this->language."|".$this->orderID."|".$this->userID."|".$this->userFormat."|".$this->ver."|".$this->iframeID."|".$width."|".$height;
438453

439454

440455
$hash = md5($hash_str);
@@ -1317,7 +1332,7 @@ private function check_payment_live()
13171332
{
13181333
$ip = $this->ip_address();
13191334
$private_key_hash = strtolower(hash("sha512", $this->private_key));
1320-
$hash = md5($this->boxID.$private_key_hash.$this->userID.$this->orderID.$this->language.$this->period.$ip);
1335+
$hash = md5($this->boxID.$private_key_hash.$this->userID.$this->orderID.$this->language.$this->period.$this->ver.$ip);
13211336
$box_status = "";
13221337

13231338
$data = array(
@@ -1327,6 +1342,7 @@ private function check_payment_live()
13271342
"u" => $this->userID,
13281343
"l" => $this->language,
13291344
"e" => $this->period,
1345+
"t" => $this->ver,
13301346
"i" => $ip,
13311347
"h" => $hash
13321348
);
@@ -2379,14 +2395,14 @@ function run_sql($sql)
23792395
);
23802396

23812397
if(!defined("CRYPTOBOX_LOCALISATION")) define("CRYPTOBOX_LOCALISATION", json_encode($cryptobox_localisation));
2382-
unset($cryptobox_localisation);
2398+
unset($cryptobox_localisation);
23832399

23842400
if (!CRYPTOBOX_WORDPRESS || defined("CRYPTOBOX_PRIVATE_KEYS"))
23852401
{
23862402
$cryptobox_private_keys = explode("^", CRYPTOBOX_PRIVATE_KEYS);
23872403
foreach ($cryptobox_private_keys as $v)
23882404
if (strpos($v, " ") !== false || strpos($v, "PRV") === false || strpos($v, "AA") === false || strpos($v, "77") === false) die("Invalid Private Key - ". (CRYPTOBOX_WORDPRESS ? "please setup it on your plugin settings page" : "$v in variable \$cryptobox_private_keys, file cryptobox.config.php."));
23892405

2390-
unset($v); unset($cryptobox_private_keys);
2406+
unset($v); unset($cryptobox_private_keys);
23912407
}
23922408
?>

js/_source/cryptobox.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* @category Javascript
55
* @website https://gourl.io
66
* @api https://gourl.io/api.html
7-
* @version 2.1.7
7+
* @version 2.2.0
88
*/
99

1010
/**
1111
* Display iFrame payment box
1212
* Full Instruction - https://gourl.io/bitcoin-payment-gateway-api.html
1313
*/
1414

15-
function cryptobox_show(boxID, coinName, public_key, amount, amountUSD, period, language, iframeID, userID, userFormat, orderID, cookieName, webdev_key, hash, width, height)
15+
function cryptobox_show(boxID, coinName, public_key, amount, amountUSD, period, language, iframeID, userID, userFormat, orderID, cookieName, webdev_key, ver, hash, width, height)
1616
{
1717
if (typeof width !== 'number') width = 0;
1818
if (typeof height !== 'number') height = 0;
@@ -30,6 +30,7 @@
3030
else if (period == '') alert('Invalid period');
3131
else if (public_key.length != 50) alert('Invalid public key');
3232
else if (webdev_key != '' && (webdev_key.indexOf("DEV") == -1 || webdev_key.length < 20)) alert('Invalid webdev_key, leave it empty');
33+
else if (ver == '') alert('Invalid ver value');
3334
else if (hash == '') alert('Invalid payment box hash');
3435
else
3536
{
@@ -40,6 +41,7 @@
4041
'/pe/'+encodeURIComponent(period.replace(' ', '_'))+'/l/'+encodeURIComponent(language)+
4142
'/i/'+encodeURIComponent(iframeID)+'/u/'+encodeURIComponent(userID)+
4243
'/us/'+encodeURIComponent(userFormat)+'/o/'+encodeURIComponent(orderID)+
44+
'/t/'+encodeURIComponent(ver)+
4345
(webdev_key?'/w/'+encodeURIComponent(webdev_key):'')+
4446
(width>0?'/ws/'+encodeURIComponent(width):'')+
4547
(height>0?'/hs/'+encodeURIComponent(height):'')+

js/_source/support.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @category Javascript
55
* @website https://gourl.io
66
* @api https://gourl.io/api.html
7-
* @version 2.1.7
7+
* @version 2.2.0
88
*/
99

1010
/**

js/cryptobox.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.5.6
5+
Version 1.6.0
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.5.6
20+
* Stable Tag: 1.6.0
2121
* License: GNU Version 2 or Any Later Version
2222

2323

0 commit comments

Comments
 (0)