Skip to content

Commit 2f24aa2

Browse files
committed
Version 1.5.5
Several new enhancements. Mandatory Update!
1 parent 500ba03 commit 2f24aa2

File tree

4 files changed

+47
-31
lines changed

4 files changed

+47
-31
lines changed

gourl.php

+36-24
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@
66

77
final class gourlclass
88
{
9-
private $options = array(); // global setting values
10-
private $hash_url = ""; // security; save your gourl public/private keys sha1 hash in file (db and file)
9+
private $options = array(); // global setting values
10+
private $hash_url = ""; // security; save your gourl public/private keys sha1 hash in file (db and file)
1111
private $errors = array(); // global setting errors
12-
private $payments = array(); // global activated payments (bitcoin, litecoin, etc)
12+
private $payments = array(); // global activated payments (bitcoin, litecoin, etc)
1313

1414
private $options2 = array(); // pay-per-view settings
1515
private $options3 = array(); // pay-per-membership settings
1616

1717
private $page = array(); // current page url
1818
private $id = 0; // current record id
19-
private $record = array(); // current record values
20-
private $record_errors = array(); // current record errors
21-
private $record_info = array(); // current record messages
22-
private $record_fields = array(); // current record fields
19+
private $record = array(); // current record values
20+
private $record_errors = array(); // current record errors
21+
private $record_info = array(); // current record messages
22+
private $record_fields = array(); // current record fields
2323

24-
private $updated = false; // publish 'record updated' message
24+
private $updated = false; // publish 'record updated' message
2525

2626
private $lock_type = ""; // membership or view
2727

2828
private $coin_names = array();
2929
private $coin_chain = array();
3030
private $coin_www = array();
31-
private $languages = array();
31+
private $languages = array();
3232

3333
private $custom_images = array('img_plogin'=>'Payment Login', 'img_flogin'=>'File Download Login', 'img_sold'=>'Product Sold', 'img_pdisable'=>'Payments Disabled', 'img_fdisable'=>'File Payments Disabled', 'img_nofile'=>'File Not Exists'); // custom payment box images
3434
private $expiry_period = array('NO EXPIRY', '10 MINUTES', '20 MINUTES', '30 MINUTES', '1 HOUR', '2 HOURS', '3 HOURS', '6 HOURS', '12 HOURS', '1 DAY', '2 DAYS', '3 DAYS', '4 DAYS', '5 DAYS', '1 WEEK', '2 WEEKS', '3 WEEKS', '4 WEEKS', '1 MONTH', '2 MONTHS', '3 MONTHS', '6 MONTHS', '12 MONTHS'); // payment expiry period
@@ -42,9 +42,9 @@ final class gourlclass
4242
private $expiry_view = array("2 DAYS", "1 DAY", "12 HOURS", "6 HOURS", "3 HOURS", "2 HOURS", "1 HOUR");
4343
private $lock_level_view = array("Unregistered Visitors", "Unregistered Visitors + Registered Subscribers", "Unregistered Visitors + Registered Subscribers/Contributors", "Unregistered Visitors + Registered Subscribers/Contributors/Authors");
4444

45-
private $fields_membership = array("ppmPrice" => "0.00", "ppmPriceCoin" => "0.0000", "ppmPriceLabel" => "BTC", "ppmExpiry" => "1 MONTH", "ppmLevel" => 0, "ppmProfile" => 0, "ppmLang" => "en", "ppmCoin" => "", "ppmOneCoin" => "", "ppmTextAbove" => "", "ppmTextBelow" => "", "ppmTextAbove2" => "", "ppmTextBelow2" => "", "ppmTitle" => "", "ppmTitle2" => "", "ppmCommentAuthor" => "", "ppmCommentBody" => "", "ppmCommentReply" => "");
45+
private $fields_membership = array("ppmPrice" => "0.00", "ppmPriceCoin" => "0.0000", "ppmPriceLabel" => "BTC", "ppmExpiry" => "1 MONTH", "ppmLevel" => 0, "ppmProfile" => 0, "ppmLang" => "en", "ppmCoin" => "", "ppmOneCoin" => "", "ppmTextAbove" => "", "ppmTextBelow" => "", "ppmTextAbove2" => "", "ppmTextBelow2" => "", "ppmTitle" => "", "ppmTitle2" => "", "ppmCommentAuthor" => "", "ppmCommentBody" => "", "ppmCommentReply" => "");
4646
private $fields_membership_newuser = array("userID" => 0, "paymentID" => 0, "startDate" => "", "endDate" => "", "disabled" => 0, "recordCreated" => "");
47-
private $lock_level_membership = array("Registered Subscribers", "Registered Subscribers/Contributors", "Registered Subscribers/Contributors/Authors");
47+
private $lock_level_membership = array("Registered Subscribers", "Registered Subscribers/Contributors", "Registered Subscribers/Contributors/Authors");
4848

4949

5050

@@ -1048,7 +1048,7 @@ private function save_settings()
10481048
{
10491049
$arr = array();
10501050

1051-
if (!(is_admin() && current_user_can('administrator')))
1051+
if (!(is_admin() && is_user_logged_in() && current_user_can('administrator')))
10521052
{
10531053
$this->errors[] = __('You don\'t have permission to edit this page. Please login as ADMIN user!', GOURL);
10541054
return false;
@@ -1117,13 +1117,26 @@ public function page_settings()
11171117
{
11181118
$readonly = (file_exists($this->hash_url) && !is_writable($this->hash_url)) ? 'readonly' : '';
11191119

1120+
if ($readonly)
1121+
{
1122+
$txt = (is_readable($this->hash_url)) ? file_get_contents($this->hash_url) : "";
1123+
$arr = json_decode($txt, true);
1124+
if (isset($arr["nonce"]) && $arr["nonce"] != sha1(md5(NONCE_KEY)))
1125+
{
1126+
$this->errors[] = sprintf(__('The value of wordpress constant NONCE_KEY has been changed. <br>Please unlock "%s" and re-enter your gourl keys; and after that, you can lock gourl.hash file again', GOURL), $this->hash_url);
1127+
}
1128+
unset($arr); unset($txt);
1129+
}
1130+
1131+
1132+
11201133
if ($this->errors) $message = "<div class='error'>".__('Please fix errors below:', GOURL)."<ul><li>- ".implode("</li><li>- ", $this->errors)."</li></ul></div>";
11211134
elseif ($this->updated) $message = '<div class="updated"><p>'.__('Settings have been updated <strong>successfully</strong>', GOURL).'</p></div>';
11221135
else $message = "";
11231136

11241137
if (!$this->errors && ((isset($_GET['testconnect']) && $_GET["testconnect"] == "true") || $this->updated))
11251138
{
1126-
if (!(is_admin() && current_user_can('administrator'))) $message .= "<div class='error'><p>".__('Cannot test connection to GoUrl.io Payment Server. You should be ADMIN user!', GOURL)."</p></div>";
1139+
if (!(is_admin() && is_user_logged_in() && current_user_can('administrator'))) $message .= "<div class='error'><p>".__('Cannot test connection to GoUrl.io Payment Server. You should be ADMIN user!', GOURL)."</p></div>";
11271140
else
11281141
{
11291142
$messages = $this->test_gourl_connection( $this->updated );
@@ -1164,7 +1177,7 @@ public function page_settings()
11641177

11651178
$tmp .= '<p>'.sprintf(__( "If you use multiple websites online, please create separate <a target='_blank' href='%s'>GoUrl Payment Box</a> records (with unique payment box public/private keys) for each of your websites. Do not use the same GoUrl Payment Box with the same public/private keys on your different websites.", GOURL ), "https://gourl.io/editrecord/coin_boxes/0") . '</p>';
11661179
$tmp .= '<p>'.sprintf(__( "If you want to use plugin in a language other than English, see the page <a href='%s'>Languages and Translations</a>. &#160; This enables you to easily customize the texts of all the labels visible to your users.", GOURL ), "https://gourl.io/languages.html", "https://gourl.io/languages.html") . '</p>';
1167-
if (!$readonly) $tmp .= '<p class="blue">'.sprintf(__( "<b style='color:red'>ADDITIONAL PAYMENTS SECURITY</b> - You can make file <a href='%s'>%s</a> - <a target='_blank' href='%s'>readonly</a>. GoUrl Public/Private keys on page below will be not editable anymore (readonly mode). Optional - for full security make <a target='_blank' href='%s'>readonly</a> gourl main plugin file <a href='%s'>gourl.php</a> also.", GOURL ), $this->hash_url, "<b>".basename($this->hash_url)."</b>", "https://www.cyberciti.biz/faq/linux-write-protecting-a-file/", "https://www.cyberciti.biz/faq/linux-write-protecting-a-file/", plugin_dir_url( __FILE__ )."gourl.php") . '</p>';
1180+
if (!$readonly) $tmp .= '<p class="blue">'.sprintf(__( "<b style='color:red'>ADDITIONAL PAYMENTS SECURITY</b> - You can make file <a href='%s'>%s</a> - <a target='_blank' href='%s'>readonly</a> (<b>file location</b> - %s; <a target='_blank' href='%s'>instruction</a>) <br>GoUrl Public/Private keys on page below will be not editable anymore (readonly mode). <br>Optional - for full security make <a target='_blank' href='%s'>readonly</a> gourl main plugin file <a href='%s'>gourl.php</a> also.", GOURL ), $this->hash_url, "<b>".basename($this->hash_url)."</b>", "https://www.cyberciti.biz/faq/linux-write-protecting-a-file/", (strpos($this->hash_url, "wp-content") ? "wp-content".$this->right($this->hash_url, "wp-content") : $this->hash_url), "https://www.cyberciti.biz/faq/linux-write-protecting-a-file/", "https://www.cyberciti.biz/faq/linux-write-protecting-a-file/", plugin_dir_url( __FILE__ )."gourl.php") . '</p>';
11681181
$tmp .= '<br><br>';
11691182
$tmp .= '<div class="alignright">';
11701183
$tmp .= '<img id="gourlsubmitloading" src="'.plugins_url('/images/loading.gif', __FILE__).'" border="0">';
@@ -1592,7 +1605,7 @@ private function save_download()
15921605

15931606
$dt = gmdate('Y-m-d H:i:s');
15941607

1595-
if (!(is_admin() && current_user_can('administrator')))
1608+
if (!(is_admin() && is_user_logged_in() && current_user_can('administrator')))
15961609
{
15971610
$this->record_errors[] = __('You don\'t have permission to edit this page. Please login as ADMIN user!', GOURL);
15981611
return false;
@@ -2425,7 +2438,7 @@ private function save_view()
24252438
if ($this->options2['ppvPriceCoin'] <= 0 || $this->options2['ppvPrice'] > 0) { $this->options2['ppvPriceCoin'] = 0; $this->options2['ppvPriceLabel'] = ""; }
24262439

24272440

2428-
if (!(is_admin() && current_user_can('administrator')))
2441+
if (!(is_admin() && is_user_logged_in() && current_user_can('administrator')))
24292442
{
24302443
$this->record_errors[] = __('You don\'t have permission to edit this page. Please login as ADMIN user!', GOURL);
24312444
return false;
@@ -3241,7 +3254,7 @@ private function save_membership()
32413254
if ($this->options3['ppmPrice'] <= 0) $this->options3['ppmPrice'] = 0;
32423255
if ($this->options3['ppmPriceCoin'] <= 0 || $this->options3['ppmPrice'] > 0) { $this->options3['ppmPriceCoin'] = 0; $this->options3['ppmPriceLabel'] = ""; }
32433256

3244-
if (!(is_admin() && current_user_can('administrator')))
3257+
if (!(is_admin() && is_user_logged_in() && current_user_can('administrator')))
32453258
{
32463259
$this->record_errors[] = __('You don\'t have permission to edit this page. Please login as ADMIN user!', GOURL);
32473260
return false;
@@ -4218,7 +4231,7 @@ private function save_membership_newuser()
42184231
global $wpdb;
42194232

42204233

4221-
if (!(is_admin() && current_user_can('administrator')))
4234+
if (!(is_admin() && is_user_logged_in() && current_user_can('administrator')))
42224235
{
42234236
$this->record_errors[] = __('You don\'t have permission to edit this page. Please login as ADMIN user!', GOURL);
42244237
return false;
@@ -4319,7 +4332,7 @@ public function save_product()
43194332

43204333
$dt = gmdate('Y-m-d H:i:s');
43214334

4322-
if (!(is_admin() && current_user_can('administrator')))
4335+
if (!(is_admin() && is_user_logged_in() && current_user_can('administrator')))
43234336
{
43244337
$this->record_errors[] = __('You don\'t have permission to edit this page. Please login as ADMIN user!', GOURL);
43254338
return false;
@@ -5502,7 +5515,7 @@ public function admin_init()
55025515

55035516
// Actions GET
55045517

5505-
if (!isset($_POST['ak_action']) && strpos($this->page, GOURL) === 0 && is_admin() && current_user_can('administrator'))
5518+
if (!isset($_POST['ak_action']) && strpos($this->page, GOURL) === 0 && is_admin() && is_user_logged_in() && current_user_can('administrator'))
55065519
{
55075520

55085521
switch($this->page)
@@ -5831,7 +5844,7 @@ private function upload_file($file, $dir, $english = true)
58315844
if (mb_strpos($ext, " ")!==false) $ext = str_replace(" ", "_", $ext);
58325845
if (mb_strpos($fileName, ".")!==false) $fileName = str_replace(".", "_", $fileName);
58335846

5834-
if (!(is_admin() && current_user_can('administrator')))
5847+
if (!(is_admin() && is_user_logged_in() && current_user_can('administrator')))
58355848
{
58365849
$this->record_errors[] = sprintf(__("Cannot upload file '%s' on server. Please login as ADMIN user!", GOURL), $file["name"]);
58375850
return "";
@@ -8500,6 +8513,5 @@ function gourl_altcoin_btc_price ($altcoin, $interval = 1)
85008513
}
85018514

85028515

8503-
return 0;
8504-
}
8505-
8516+
return 0;
8517+
}

gourl_wordpress.php

+2-2
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.4
6+
Version: 1.5.5
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.4");
36+
DEFINE('GOURL_VERSION', "1.5.5");
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

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

2323

readme.txt

+7-3
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.5.4
9+
Stable Tag: 1.5.5
1010
License: GNU Version 2 or Any Later Version
1111
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1212

@@ -181,8 +181,12 @@ Yes, we offer [Free Technical Support](https://gourl.io/view/contact/Contact_Us.
181181
== Changelog ==
182182

183183

184+
= 1.5.5 =
185+
Several new enhancements. Mandatory Update!
186+
184187
= 1.5.4 =
185-
Several new enhancements
188+
* Security issue fixed
189+
* Several new enhancements
186190

187191
= 1.5.3 =
188192
Update currencyconverterapi.com api
@@ -351,4 +355,4 @@ Add Pay-Per-Product, Pay-Per-Membership
351355

352356
= 1.0.0 =
353357
This is the first version of GoUrl Bitcoin Payment Gateway & Paid Downloads & Membership Plugin
354-
358+

0 commit comments

Comments
 (0)