-
Notifications
You must be signed in to change notification settings - Fork 73
/
gourl.php
8682 lines (6385 loc) · 406 KB
/
gourl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
if (!defined( 'ABSPATH' ) || !defined( 'GOURL' )) exit;
final class gourlclass
{
private $options = array(); // global setting values
private $hash_url = ""; // security; save your gourl public/private keys sha1 hash in file (db and file)
private $errors = array(); // global setting errors
private $payments = array(); // global activated payments (bitcoin, litecoin, etc)
private $adminform = "gourl_adminform";
private $admin_form_key = ""; // unique form key
private $options2 = array(); // pay-per-view settings
private $options3 = array(); // pay-per-membership settings
private $page = array(); // current page url
private $id = 0; // current record id
private $record = array(); // current record values
private $record_errors = array(); // current record errors
private $record_info = array(); // current record messages
private $record_fields = array(); // current record fields
private $updated = false; // publish 'record updated' message
private $lock_type = ""; // membership or view
private $coin_names = array();
private $coin_chain = array();
private $coin_www = array();
private $languages = array();
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
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
private $store_visitorid = array('COOKIE','SESSION','IPADDRESS','MANUAL'); // Save auto-generated unique visitor ID in cookies, sessions or use the IP address to decide unique visitors (without use cookies)
private $addon = array("gourlwoocommerce", "gourlwpecommerce", "gourljigoshop", "gourlappthemes", "gourlmarketpress", "gourlpmpro", "gourlgive", "gourledd");
private $fields_download = array("fileID" => 0, "fileTitle" => "", "active" => 1, "fileName" => "", "fileUrl" => "", "fileText" => "", "fileSize" => 0, "priceUSD" => "0.00", "priceCoin" => "0.0000", "priceLabel" => "BTC", "purchases" => "0", "userFormat" => "COOKIE", "expiryPeriod" => "2 DAYS", "lang" => "en", "defCoin" => "", "defShow" => 0, "image" => "", "imageWidth" => 200, "priceShow" => 1, "paymentCnt" => 0, "paymentTime" => "", "updatetime" => "", "createtime" => "");
private $fields_product = array("productID" => 0, "productTitle" => "", "active" => 1,"priceUSD" => "0.00", "priceCoin" => "0.0000", "priceLabel" => "BTC", "purchases" => "0", "expiryPeriod" => "NO EXPIRY", "lang" => "en", "defCoin" => "", "defShow" => 0, "productText" => "", "finalText" => "", "emailUser" => 0, "emailUserFrom" => "", "emailUserTitle" => "", "emailUserBody" => "", "emailAdmin" => 0, "emailAdminFrom" => "", "emailAdminTitle" => "", "emailAdminBody" => "", "emailAdminTo" => "", "paymentCnt" => 0, "paymentTime" => "", "updatetime" => "", "createtime" => "");
private $fields_view = array("ppvPrice" => "0.00", "ppvPriceCoin" => "0.0000", "ppvPriceLabel" => "BTC", "ppvExpiry" => "1 DAY", "ppvLevel" => 0, "ppvLang" => "en", "ppvCoin" => "", "ppvOneCoin" => "", "ppvTextAbove" => "", "ppvTextBelow" => "", "ppvTitle" => "", "ppvTitle2" => "", "ppvCommentAuthor" => "", "ppvCommentBody" => "", "ppvCommentReply" => "");
private $expiry_view = array("2 DAYS", "1 DAY", "12 HOURS", "6 HOURS", "3 HOURS", "2 HOURS", "1 HOUR");
private $lock_level_view = array("Unregistered Visitors", "Unregistered Visitors + Registered Subscribers", "Unregistered Visitors + Registered Subscribers/Contributors", "Unregistered Visitors + Registered Subscribers/Contributors/Authors");
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" => "");
private $fields_membership_newuser = array("userID" => 0, "paymentID" => 0, "startDate" => "", "endDate" => "", "disabled" => 0, "recordCreated" => "");
private $lock_level_membership = array("Registered Subscribers", "Registered Subscribers/Contributors", "Registered Subscribers/Contributors/Authors");
/*
* 1. Initialize plugin
*/
public function __construct()
{
// --------------------------------------
// path to images/js/php files. Use in gourl payment library class cryptobox.class.php
DEFINE("CRYPTOBOX_PHP_FILES_PATH", plugins_url('/includes/', __FILE__)); // path to directory with files: cryptobox.class.php / cryptobox.callback.php / cryptobox.newpayment.php;
DEFINE("CRYPTOBOX_IMG_FILES_PATH", plugins_url('/images/coins/', __FILE__)); // path to directory with coin image files (directory '/images' by default)
DEFINE("CRYPTOBOX_JS_FILES_PATH", plugins_url('/js/', __FILE__)); // path to directory with files: ajax.min.js/support.min.js
$val1 = "vlng";
$val2 = "vcni";
$val3 = substr(strtolower(preg_replace("/[^a-zA-Z]+/", "", base64_encode(home_url('/', 'http')))), -7, 5)."_";
if (!$val3 || strlen($val3) < 5) $val3 = "vprf_";
if (is_admin())
{
$val1 = "gourlcryptolang";
$val2 = "gourlcryptocoin";
$val3 = "acrypto_";
}
DEFINE("CRYPTOBOX_LANGUAGE_HTMLID", $val1); // language selection list html id; any value
DEFINE("CRYPTOBOX_COINS_HTMLID", $val2); // coins selection list html id; any value
DEFINE("CRYPTOBOX_PREFIX_HTMLID", $val3); // prefix for all html elements; any value
// security data hash; you can change path / file location
$this->hash_url = GOURL_PHP."/gourl.hash";
// admin form
$this->adminform = "gourl_adminform_" . md5(sha1(AUTH_KEY.NONCE_KEY.AUTH_KEY));
$this->admin_form_key = 'gourl_adminformkey_' . sha1(md5(AUTH_KEY.NONCE_KEY));
$this->coin_names = self::coin_names();
$this->coin_chain = self::coin_chain();
$this->coin_www = self::coin_www();
$this->languages = self::languages();
// compatible test
$ver = get_option(GOURL.'version'); // current plugin version; '-empty-' if you unistalled plugin
$prevver = get_option(GOURL.'prev_version'); // current plugin version; ; keep version value when plugin uninstalled; $ver == $prevver if plugin activated
if (!$ver || version_compare($ver, GOURL_VERSION) < 0 || version_compare($prevver, $ver) < 0) $this->upgrade();
elseif (is_admin()) gourl_retest_dir();
// Current Page, Record ID
$this->page = (isset($_GET['page'])) ? substr(preg_replace("/[^A-Za-z0-9\_\-]+/", "", $_GET['page']), 0, 50) : "";
$this->id = (isset($_GET['id']) && intval($_GET['id'])) ? intval($_GET['id']) : 0;
$this->updated = (isset($_GET['updated']) && $_GET["updated"] == "true") ? true : false;
// Redirect
if ($this->page == GOURL."contact") { header("Location: ".GOURL_ADMIN.GOURL."#i7"); die; }
if ($this->page == GOURL."addons") { header("Location: ".GOURL_ADMIN.GOURL."#j2"); die; }
// A. General Plugin Settings
$this->get_settings();
if (!($_POST && $this->page == GOURL.'settings')) $this->check_settings();
// B. Pay-Per-Download - New File
if ($this->page == GOURL.'file' && is_admin())
{
$this->record_fields = $this->fields_download;
$this->get_record('file');
if ($this->id && !$_POST) $this->check_download();
ini_set('max_execution_time', 3600);
ini_set('max_input_time', 3600);
}
// C. Pay-Per-View
if ($this->page == GOURL.'payperview' && is_admin())
{
$this->get_view();
if (!$_POST) $this->check_view();
}
// D. Pay-Per-Membership
if ($this->page == GOURL.'paypermembership' && is_admin())
{
$this->get_membership();
if (!$_POST) $this->check_membership();
}
// E. Pay-Per-Membership - New User
if ($this->page == GOURL.'paypermembership_user' && is_admin())
{
$this->record_fields = $this->fields_membership_newuser;
if (!$this->id) // default for new record
{
$this->record["startDate"] = gmdate("Y-m-d");
$this->record["endDate"] = gmdate("Y-m-d", strtotime("+1 month"));
if (isset($_GET['userID']) && intval($_GET['userID'])) $this->record["userID"] = intval($_GET['userID']);
}
}
// F. Pay-Per-Product - New Product
if ($this->page == GOURL.'product' && is_admin())
{
$this->record_fields = $this->fields_product;
$this->get_record('product');
if ($this->id && !$_POST) $this->check_product();
}
// Admin
if (is_admin())
{
if ($this->errors && $this->page != 'gourlsettings') add_action('admin_notices', array(&$this, 'admin_warning'));
if (!file_exists(GOURL_DIR."files") || !file_exists(GOURL_DIR."images") || !file_exists(GOURL_DIR."lockimg") || !file_exists(GOURL_PHP)) add_action('admin_notices', array(&$this, 'admin_warning_reactivate'));
add_action('admin_menu', array(&$this, 'admin_menu'));
add_action('init', array(&$this, 'admin_init'));
add_action('admin_head', array(&$this, 'admin_header'), 15);
add_filter('plugin_row_meta', array(&$this, 'admin_plugin_meta'), 10, 2 );
if (strpos($this->page, GOURL) === 0) add_action("admin_enqueue_scripts", array(&$this, "admin_scripts"));
if (in_array($this->page, array("gourl", "gourlpayments", "gourlproducts", "gourlproduct", "gourlfiles", "gourlfile", "gourlpayperview", "gourlpaypermembership", "gourlpaypermembership_users", "gourlpaypermembership_user", "gourlsettings"))) add_action('admin_footer_text', array(&$this, 'admin_footer_text'), 15);
}
else
{
add_action("init", array(&$this, "front_init"));
add_action("wp", array(&$this, "front_html"));
add_action("wp_enqueue_scripts", array(&$this, "front_scripts"));
add_shortcode(GOURL_TAG_DOWNLOAD, array(&$this, "shortcode_download"));
add_shortcode(GOURL_TAG_PRODUCT, array(&$this, "shortcode_product"));
add_shortcode(GOURL_TAG_VIEW, array(&$this, "shortcode_view"));
add_shortcode(GOURL_TAG_MEMBERSHIP, array(&$this, "shortcode_membership"));
add_shortcode(GOURL_TAG_MEMCHECKOUT,array(&$this, "shortcode_memcheckout"));
}
// Process Callbacks from GoUrl.io Payment Server
add_action('parse_request', array(&$this, 'callback_parse_request'), 1);
// Force Login - external plugins
add_filter('v_forcelogin_whitelist', array(&$this, "v_forcelogin_whitelist"), 10, 1); // https://wordpress.org/plugins/wp-force-login/
// Exclude gourl js file from aggregation
add_filter('autoptimize_filter_js_exclude', array(&$this, "exclude_js_file"), 10, 1);
// Disable BJ Lazy Load iframes
$bj_lazy_load_options = get_option('bj_lazy_load_options');
if ($bj_lazy_load_options && is_array($bj_lazy_load_options)) update_option('bj_lazy_load_options', array_merge( $bj_lazy_load_options, array("lazy_load_iframes" => "no") ));
}
/*
* 2.
*/
public function admin_scripts()
{
wp_enqueue_style ( 'cr-style-admin', plugins_url('/css/style.admin.css?', __FILE__), array(), GOURL_VERSION);
wp_enqueue_style ( 'cr-style', plugins_url('/css/style.front.css', __FILE__), array(), GOURL_VERSION);
wp_enqueue_style ( 'cr-font', "//fonts.googleapis.com/css?family=Tenor+Sans", array(), null );
return true;
}
/*
* 3.
*/
public function front_scripts()
{
wp_enqueue_style ( 'cr-style', plugins_url('/css/style.front.css', __FILE__) );
return true;
}
/*
* 6.
*/
public function iframe_scripts()
{
$tmp = "<script type='text/javascript' src='".plugins_url("/js/cryptobox.min.js?ver=".GOURL_VERSION, __FILE__)."'></script>";
return $tmp;
}
/*
* 7.
*/
public function bootstrap_scripts()
{
$theme = $this->options['box_theme'];
if ($theme == "black") $css = plugins_url("/css/darkly.min.css", __FILE__); // original https://bootswatch.com/4/darkly/bootstrap.css
elseif ($theme == "greyred") $css = plugins_url("/css/superhero.min.css", __FILE__);
elseif ($theme == "greygreen") $css = plugins_url("/css/solar.min.css", __FILE__);
elseif ($theme == "whiteblue") $css = plugins_url("/css/cerulean.min.css", __FILE__); // original https://bootswatch.com/4/cerulean/bootstrap.css
elseif ($theme == "whitered") $css = plugins_url("/css/united.min.css", __FILE__);
elseif ($theme == "whitegreen") $css = plugins_url("/css/flatly.min.css", __FILE__);
elseif ($theme == "whiteblack") $css = plugins_url("/css/lux.min.css", __FILE__);
elseif ($theme == "whitepurple")$css = plugins_url("/css/pulse.min.css", __FILE__);
elseif ($theme == "litera") $css = plugins_url("/css/litera.min.css", __FILE__);
elseif ($theme == "minty") $css = plugins_url("/css/minty.min.css", __FILE__);
elseif ($theme == "sandstone") $css = plugins_url("/css/sandstone.min.css", __FILE__);
elseif ($theme == "sketchy") $css = plugins_url("/css/sketchy.min.css", __FILE__);
else $css = plugins_url("/css/bootstrapcustom.min.css", __FILE__);
$tmp = "<link rel='stylesheet' id='cr-bootstrapcss-css' href='".$css."' type='text/css' media='all' />";
$tmp .= "<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js' crossorigin='anonymous'></script>";
$tmp .= "<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js' crossorigin='anonymous'></script>";
$tmp .= "<script type='text/javascript' src='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js' crossorigin='anonymous'></script>";
$tmp .= "<script type='text/javascript' src='https://use.fontawesome.com/releases/v5.0.9/js/all.js' crossorigin='anonymous'></script>";
$tmp .= "<script type='text/javascript' src='".plugins_url("/js/support.min.js?ver=".GOURL_VERSION, __FILE__)."' crossorigin='anonymous'></script>";
return $tmp;
}
/*
* 8.
*/
public function payments()
{
return $this->payments;
}
/*
* 9.
*/
public static function coin_names()
{
return array('BTC' => 'bitcoin', 'BCH' => 'bitcoincash', 'BSV' => 'bitcoinsv', 'LTC' => 'litecoin', 'DASH' => 'dash', 'DOGE' => 'dogecoin', 'SPD' => 'speedcoin', 'RDD' => 'reddcoin', 'POT' => 'potcoin', 'FTC' => 'feathercoin', 'VTC' => 'vertcoin', 'PPC' => 'peercoin', 'MUE' => 'monetaryunit');
}
/*
* 10.
*/
public static function coin_chain()
{
return array('bitcoin' => 'https://www.blockchain.com/btc/', 'bitcoincash' => 'https://www.blockchain.com/bch/', 'bitcoinsv' => 'https://bchsvexplorer.com/', 'litecoin' => 'https://chainz.cryptoid.info/ltc/', 'dash' => 'https://chainz.cryptoid.info/dash/', 'dogecoin' => 'https://dogechain.info/', 'speedcoin' => 'http://speedcoin.org:2750/', 'reddcoin' => 'http://live.reddcoin.com/', 'potcoin' => 'https://chainz.cryptoid.info/pot/', 'feathercoin' => 'https://chainz.cryptoid.info/ftc/', 'vertcoin' => 'https://chainz.cryptoid.info/vtc/', 'peercoin' => 'https://chainz.cryptoid.info/ppc/', 'monetaryunit' => 'https://chainz.cryptoid.info/mue/');
}
/*
* 11.
*/
public static function coin_www()
{
return array('bitcoin' => 'https://bitcoin.org/', 'bitcoincash' => 'https://www.bitcoincash.org/', 'bitcoinsv' => 'https://bitcoinsv.io/', 'litecoin' => 'https://litecoin.org/', 'dash' => 'https://www.dashpay.io/', 'dogecoin' => 'http://dogecoin.com/', 'speedcoin' => 'https://speedcoin.org/', 'reddcoin' => 'http://reddcoin.com/', 'potcoin' => 'http://www.potcoin.com/', 'feathercoin' => 'https://www.feathercoin.com/', 'vertcoin' => 'http://vertcoin.org/', 'peercoin' => 'http://peercoin.net/', 'monetaryunit' => 'http://www.monetaryunit.org/');
}
/*
* 12.
*/
public static function languages()
{
return array('en' => 'English', 'es' => 'Spanish', 'fr' => 'French', 'de' => 'German', 'it' => 'Italian', 'nl' => 'Dutch', 'ru' => 'Russian', 'sv' => 'Swedish', 'sq' => 'Albanian', 'ar' => 'Arabic', 'cn' => 'Simplified Chinese', 'zh' => 'Traditional Chinese', 'cs' => 'Czech', 'et' => 'Estonian', 'fi' => 'Finnish', 'el' => 'Greek', 'hi' => 'Hindi', 'id' => 'Indonesian', 'ja' => 'Japanese', 'ko' => 'Korean', 'fa' => 'Persian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'sr' => 'Serbian', 'sl' => 'Slovenian', 'tr' => 'Turkish');
}
/*
* 13.
*/
public function box_width()
{
return $this->options['box_width'];
}
/*
* 14.
*/
public function box_height()
{
return $this->options['box_height'];
}
/*
* 15. Return payment box custom image (need login / payment box disabled / etc)
*/
public function box_image($type = "plogin") // plogin, flogin, sold, pdisable, fdisable, nofile
{
$type = "img_" . $type;
if (!isset($this->custom_images[$type])) return "";
if ($this->options[$type] == 1 && $this->options[$type."url"] && file_exists(GOURL_DIR."box/".$this->options[$type.'url']))
return GOURL_DIR2."box/".$this->options[$type.'url'];
else
return plugins_url("/images/".$type.".png", __FILE__);
}
/*
* 15b. Return your company logo for payment box
*/
public function box_logo()
{
if ($this->options['boxlogo'] == 1) return plugins_url('/images/your_logo.png', __FILE__);
elseif ($this->options['boxlogo'] == 2 && $this->options['boxlogo_url'] && file_exists(GOURL_DIR."box/".$this->options['boxlogo_url'])) return GOURL_DIR2."box/".$this->options['boxlogo_url'];
else return "";
}
/*
* 15c.
*/
public function currencyconverterapi_key()
{
return $this->options['currencyconverterapi_key'];
}
/*
* 16. Return transaction url to block explorer
*/
public function blockexplorer_tr_url($txID, $coinName)
{
$coinName = strtolower($coinName);
if (!isset($this->coin_chain[$coinName])) return "";
$explorer = $this->coin_chain[$coinName];
$url = $explorer . (stripos($explorer,'cryptoid.info') ? 'tx.dws?' : (stripos($explorer,'blockdozer.com') ? 'tx/' : 'tx/')) . $txID;
return $url;
}
/*
* 17. Return address url to block explorer
*/
public function blockexplorer_addr_url($address, $coinName)
{
$coinName = strtolower($coinName);
if (!isset($this->coin_chain[$coinName])) return "";
$explorer = $this->coin_chain[$coinName];
$url = $explorer . (stripos($explorer,'cryptoid.info') ? 'address.dws?' : (stripos($explorer,'bchain.info') ? 'addr/' : (stripos($explorer,'blockdozer.com') ? 'address/' : 'address/'))) . $address;
return $url;
}
/*
* 18.
*/
public function page_summary()
{
global $wpdb;
$tmp = "<div class='wrap ".GOURL."admin'>";
$tmp .= $this->page_title(__('Summary', GOURL).$this->space(1).'<a class="add-new-h2" target="_blank" href="https://gourl.io/bitcoin-wordpress-plugin.html">' . __('version', GOURL).' '.GOURL_VERSION.'</a>');
$tmp .= "<div class='postbox'>";
$tmp .= "<div class='inside gourlsummary'>";
foreach($this->coin_names as $k => $v) $tmp .= '<a target="_blank" href="'.$this->coin_www[$v].'"><img width="70" hspace="20" vspace="15" alt="'.$v.'" src="'.plugins_url('/images/'.$v.'2.png', __FILE__).'" border="0"></a>';
// 1
$us_products = "";
$dt_products = "";
$res = $wpdb->get_row("SELECT count(*) as cnt from crypto_products", OBJECT);
$all_products = ($res) ? $res->cnt : 0;
$res = $wpdb->get_row("SELECT count(*) as cnt, sum(amountUSD) as total from crypto_payments where orderID like 'product\_%'", OBJECT);
$tr_products = ($res) ? $res->cnt : 0;
if ($tr_products)
{
$us_products = " ( $" . gourl_number_format($res->total, 2) . " )";
$res = $wpdb->get_row("SELECT paymentID, amount, coinLabel, countryID, DATE_FORMAT(txDate, '%d %b %Y, %H:%i %p') as dt from crypto_payments where orderID like 'product\_%' order by txDate desc", OBJECT);
$dt_products = "<span title='".__('Latest Payment to Pay-Per-Product', GOURL)."'>".$this->space(2).$res->dt.$this->space()."-".$this->space().
($res->countryID?"<a href='".GOURL_ADMIN.GOURL."payments&s=".$res->countryID."'><img width='16' border='0' style='margin-right:9px' alt='".$res->countryID."' src='".plugins_url('/images/flags/'.$res->countryID.'.png', __FILE__)."' border='0'></a>":"") .
"<a title='".__('Latest Payment', GOURL)."' href='".GOURL_ADMIN.GOURL."payments&s=payment_".$res->paymentID."'>" . gourl_number_format($res->amount, 4) . "</a> " . $res->coinLabel . "</span>";
}
// 2
$us_files = "";
$dt_files = "";
$res = $wpdb->get_row("SELECT count(*) as cnt from crypto_files", OBJECT);
$all_files = ($res) ? $res->cnt : 0;
$res = $wpdb->get_row("SELECT count(*) as cnt, sum(amountUSD) as total from crypto_payments where orderID like 'file\_%'", OBJECT);
$tr_files = ($res) ? $res->cnt : 0;
if ($tr_files)
{
$us_files = " ( $" . gourl_number_format($res->total, 2) . " )";
$res = $wpdb->get_row("SELECT paymentID, amount, coinLabel, countryID, DATE_FORMAT(txDate, '%d %b %Y, %H:%i %p') as dt from crypto_payments where orderID like 'file\_%' order by txDate desc", OBJECT);
$dt_files = "<span title='".__('Latest Payment to Pay-Per-Download', GOURL)."'>".$this->space(2).$res->dt.$this->space()."-".$this->space().
($res->countryID?"<a href='".GOURL_ADMIN.GOURL."payments&s=".$res->countryID."'><img width='16' border='0' style='margin-right:9px' alt='".$res->countryID."' src='".plugins_url('/images/flags/'.$res->countryID.'.png', __FILE__)."' border='0'></a>":"") .
"<a href='".GOURL_ADMIN.GOURL."payments&s=payment_".$res->paymentID."'>" . gourl_number_format($res->amount, 4) . "</a> " . $res->coinLabel . "</span>";
}
// 3
$us_membership = "";
$dt_membership = "";
$dt = gmdate('Y-m-d H:i:s');
$res = $wpdb->get_row("SELECT count(distinct userID) as cnt from crypto_membership where startDate <= '$dt' && endDate >= '$dt' && disabled = 0", OBJECT);
$all_users = ($res) ? $res->cnt : 0;
$res = $wpdb->get_row("SELECT count(*) as cnt, sum(amountUSD) as total from crypto_payments where orderID like 'membership%'", OBJECT);
$tr_membership = ($res) ? $res->cnt : 0;
if ($tr_membership)
{
$us_membership = " ( $" . gourl_number_format($res->total, 2) . " )";
$res = $wpdb->get_row("SELECT paymentID, amount, coinLabel, countryID, DATE_FORMAT(txDate, '%d %b %Y, %H:%i %p') as dt from crypto_payments where orderID like 'membership%' order by txDate desc", OBJECT);
$dt_membership = "<span title='".__('Latest Payment to Pay-Per-Membership', GOURL)."'>".$this->space(2).$res->dt.$this->space()."-".$this->space().
($res->countryID?"<a href='".GOURL_ADMIN.GOURL."payments&s=".$res->countryID."'><img width='16' border='0' style='margin-right:9px' alt='".$res->countryID."' src='".plugins_url('/images/flags/'.$res->countryID.'.png', __FILE__)."' border='0'></a>":"") .
"<a href='".GOURL_ADMIN.GOURL."payments&s=payment_".$res->paymentID."'>" . gourl_number_format($res->amount, 4) . "</a> " . $res->coinLabel . "</span>";
}
// 4
$us_payperview = "";
$dt_payperview = "";
$res = $wpdb->get_row("SELECT count(*) as cnt, sum(amountUSD) as total from crypto_payments where orderID = 'payperview'", OBJECT);
$tr_payperview = ($res) ? $res->cnt : 0;
if ($tr_payperview)
{
$us_payperview = " ( $" . gourl_number_format($res->total, 2) . " )";
$res = $wpdb->get_row("SELECT paymentID, amount, coinLabel, countryID, DATE_FORMAT(txDate, '%d %b %Y, %H:%i %p') as dt from crypto_payments where orderID = 'payperview' order by txDate desc", OBJECT);
$dt_payperview = "<span title='".__('Latest Payment to Pay-Per-View', GOURL)."'>".$this->space(2).$res->dt.$this->space()."-".$this->space().
($res->countryID?"<a href='".GOURL_ADMIN.GOURL."payments&s=".$res->countryID."'><img width='16' border='0' style='margin-right:9px' alt='".$res->countryID."' src='".plugins_url('/images/flags/'.$res->countryID.'.png', __FILE__)."' border='0'></a>":"") .
"<a href='".GOURL_ADMIN.GOURL."payments&s=payment_".$res->paymentID."'>" . gourl_number_format($res->amount, 4) . "</a> " . $res->coinLabel . "</span>";
}
// 5
$sql_where = "";
$us_addon = $dt_addon = $tr_addon = array();
foreach ($this->addon as $v)
{
$res = $wpdb->get_row("SELECT count(*) as cnt, sum(amountUSD) as total from crypto_payments where orderID like '".esc_sql($v).".%'", OBJECT);
$tr_addon[$v] = ($res) ? $res->cnt : 0;
if ($tr_addon[$v])
{
$us_addon[$v] = " ( $" . gourl_number_format($res->total, 2) . " )";
$res = $wpdb->get_row("SELECT paymentID, amount, coinLabel, countryID, DATE_FORMAT(txDate, '%d %b %Y, %H:%i %p') as dt from crypto_payments where orderID like '".esc_sql($v).".%' order by txDate desc", OBJECT);
$dt_addon[$v] = "<span title='".__('Latest Payment', GOURL)."'>".$this->space(2).$res->dt.$this->space()."-".$this->space().
($res->countryID?"<a href='".GOURL_ADMIN.GOURL."payments&s=".$res->countryID."'><img width='16' border='0' style='margin-right:9px' alt='".$res->countryID."' src='".plugins_url('/images/flags/'.$res->countryID.'.png', __FILE__)."' border='0'></a>":"") .
"<a href='".GOURL_ADMIN.GOURL."payments&s=payment_".$res->paymentID."'>" . gourl_number_format($res->amount, 4) . "</a> " . $res->coinLabel . "</span>";
}
$sql_where .= " && orderID not like '".esc_sql($v).".%'";
}
// 6
$us_other = "";
$dt_other = "";
$res = $wpdb->get_row("SELECT count(*) as cnt, sum(amountUSD) as total from crypto_payments where orderID like '%.%'".$sql_where, OBJECT);
$tr_other = ($res) ? $res->cnt : 0;
if ($tr_other)
{
$us_other = " ( $" . gourl_number_format($res->total, 2) . " )";
$res = $wpdb->get_row("SELECT paymentID, amount, coinLabel, countryID, DATE_FORMAT(txDate, '%d %b %Y, %H:%i %p') as dt from crypto_payments where orderID like '%.%' ".$sql_where." order by txDate desc", OBJECT);
$dt_other = "<span title='".__('Latest Payment to Other Plugins', GOURL)."'>".$this->space(2).$res->dt.$this->space()."-".$this->space().
($res->countryID?"<a href='".GOURL_ADMIN.GOURL."payments&s=".$res->countryID."'><img width='16' border='0' style='margin-right:9px' alt='".$res->countryID."' src='".plugins_url('/images/flags/'.$res->countryID.'.png', __FILE__)."' border='0'></a>":"") .
"<a href='".GOURL_ADMIN.GOURL."payments&s=payment_".$res->paymentID."'>" . gourl_number_format($res->amount, 4) . "</a> " . $res->coinLabel . "</span>";
}
// 7
$us_unrecognised = "";
$dt_unrecognised = "";
$res = $wpdb->get_row("SELECT count(*) as cnt, sum(amountUSD) as total from crypto_payments where unrecognised = 1", OBJECT);
$tr_unrecognised = ($res) ? $res->cnt : 0;
if ($tr_unrecognised)
{
$us_unrecognised = " ( $" . gourl_number_format($res->total, 2) . " )";
$res = $wpdb->get_row("SELECT paymentID, amount, coinLabel, countryID, DATE_FORMAT(txDate, '%d %b %Y, %H:%i %p') as dt from crypto_payments where unrecognised = 1 order by txDate desc", OBJECT);
$dt_unrecognised = "<span title='".__('Unrecognised Latest Payment', GOURL)."'>".$this->space(2).$res->dt.$this->space()."-".$this->space().
"<a href='".GOURL_ADMIN.GOURL."payments&s=payment_".$res->paymentID."'>" . gourl_number_format($res->amount, 4) . "</a> " . $res->coinLabel . "</span>";
}
// 8
$all_details = "";
$dt_last = "";
$res = $wpdb->get_row("SELECT count(*) as cnt, sum(amountUSD) as total from crypto_payments", OBJECT);
$all_payments = ($res) ? $res->cnt : 0;
if ($all_payments)
{
$all_details .= $this->space()."~ ".gourl_number_format($res->total, 2)." ".__('USD', GOURL);
$res = $wpdb->get_row("SELECT paymentID, amount, coinLabel, amountUSD, countryID, DATE_FORMAT(txDate, '%d %b %Y, %H:%i %p') as dt from crypto_payments order by txDate desc", OBJECT);
$dt_last = ($res->countryID?"<a href='".GOURL_ADMIN.GOURL."payments&s=".$res->countryID."'><img width='20' border='0' style='margin-right:13px' alt='".$res->countryID."' src='".plugins_url('/images/flags/'.$res->countryID.'.png', __FILE__)."' border='0'></a>":"") .
$res->dt.$this->space()."-".$this->space()."<a title='".__('Latest Payment', GOURL)."' href='".GOURL_ADMIN.GOURL."payments&s=payment_".$res->paymentID."'>" . gourl_number_format($res->amount, 4) . "</a> " . $res->coinLabel . $this->space() . "<small>( " . gourl_number_format($res->amountUSD, 2)." ".__('USD', GOURL). " )</small>";
}
// Re-test MySQL connection
include_once(plugin_dir_path( __FILE__ )."includes/cryptobox.class.php");
$sql = "SELECT fileID as nme FROM crypto_files LIMIT 1";
run_sql($sql);
$tmp .= "<a name='i1'></a>";
$tmp .= "<div class='gourltitle'>".__('Summary', GOURL)."</div>";
$tmp .= "<div class='gourlsummaryinfo'>";
$tmp .= '<div style="min-width:1200px;width:100%;">';
$tmp .= "<table border='0'>";
if ($tr_products || $tr_files || $tr_membership || $tr_payperview || !$all_payments)
{
// 1
$tmp .= "<tr><td>GoUrl Pay-Per-Product</td><td><a href='".GOURL_ADMIN.GOURL."products'>".sprintf(__('%s paid products', GOURL), $all_products)."</a></td>
<td><small><a href='".GOURL_ADMIN.GOURL."payments&s=products'>".$tr_products."</a> ".__('payments', GOURL).$us_products."</small></td><td><small>".$dt_products."</small></td></tr>";
// 2
$tmp .= "<tr><td>GoUrl Pay-Per-Download</td><td><a href='".GOURL_ADMIN.GOURL."files'>".sprintf(__('%s paid files', GOURL), $all_files)."</a></td>
<td><small><a href='".GOURL_ADMIN.GOURL."payments&s=files'>".$tr_files."</a> ".__('payments', GOURL).$us_files."</small></td><td><small>".$dt_files."</small></td></tr>";
// 3
$tmp .= "<tr><td>GoUrl Pay-Per-Membership</td><td><a href='".GOURL_ADMIN.GOURL."paypermembership_users&s=active'>".sprintf(__('%s premium users', GOURL), $all_users)."</a></td>
<td><small><a href='".GOURL_ADMIN.GOURL."payments&s=membership'>".$tr_membership."</a> ".__('payments', GOURL).$us_membership."</small></td><td><small>".$dt_membership."</small></td></tr>";
// 4
$tmp .= "<tr><td>GoUrl Pay-Per-View</td><td></td>
<td><small><a href='".GOURL_ADMIN.GOURL."payments&s=payperview'>".$tr_payperview."</a> ".__('payments', GOURL).$us_payperview."</small></td><td><small>".$dt_payperview."</small></td></tr>";
}
// 5
foreach ($us_addon as $k => $v)
{
if ($k == "gourlwoocommerce") $nme = "GoUrl WooCommerce";
elseif ($k == "gourlwpecommerce") $nme = "GoUrl WP eCommerce";
elseif ($k == "gourljigoshop") $nme = "GoUrl Jigoshop";
elseif ($k == "gourlappthemes") $nme = "GoUrl AppThemes";
elseif ($k == "gourlmarketpress") $nme = "GoUrl MarketPress";
elseif ($k == "gourlpmpro") $nme = "GoUrl Paid Memberships Pro";
elseif ($k == "gourlgive") $nme = "GoUrl Give/Donations";
elseif ($k == "gourledd") $nme = "GoUrl Easy Digital Downloads";
elseif (strpos($k, "gourl") === 0) $nme = "GoUrl " . ucfirst(str_replace("gourl", "", $k));
else $nme = ucfirst($k);
$tmp .= "<tr><td>".$nme."</td><td></td>
<td><small><a href='".GOURL_ADMIN.GOURL."payments&s=".$k."'>".$tr_addon[$k]." ".__('payments', GOURL)."</a> ".$us_addon[$k]."</small></td><td><small>".$dt_addon[$k]."</small></td></tr>";
}
// 6
$tmp .= "<tr><td>".__('Other Plugins with GoUrl', GOURL)."</td><td></td>
<td><small><a href='".GOURL_ADMIN.GOURL."payments&s=plugins'>".$tr_other." ".__('payments', GOURL)."</a> ".$us_other."</small></td><td><small>".$dt_other."</small></td></tr>";
// 7
$tmp .= "<tr><td>".__('Unrecognised Payments', GOURL)."</td><td></td>
<td><small><a href='".GOURL_ADMIN.GOURL."payments&s=unrecognised'>".$tr_unrecognised." ".__('payments', GOURL)."</a> ".$us_unrecognised."</small></td><td><small>".$dt_unrecognised."</small></td></tr>";
// 8
$tmp .= "<tr><td><small>---------</small><br>".__('Total Received', GOURL)."</td><td colspan='2'><br><a href='".GOURL_ADMIN.GOURL."payments'>".sprintf(__('%s payments', GOURL), $all_payments)."</a>".$all_details."</td></tr>";
$tmp .= "<tr><td><a name='chart' id='chart'></a>".__('Recent Payment', GOURL)."</td><td colspan='3'>".$dt_last."</td></tr>";
$tmp .= "</table>";
$charts = array('BTC' => 7777, 'LTC' => 3, 'DOGE' => 132, 'DASH' => 155, 'RDD' => 169, 'POT' => 173, 'FTC' => 5, 'VTC' => 151, 'VRC' => 209, 'PPC' => 28);
$chart = (isset($_GET["chart"]) && isset($charts[$_GET["chart"]])) ? substr($_GET["chart"], 0, 10) : "BTC";
$days = array(5=>"5 days", 10=>"10 days", 15=>"15 days", 31=>"1 month", 60=>"2 months", 90=>"3 months",120=>"4 months",180=>"6 months",240=>"9 months",360=>"1 year");
$day = (isset($_GET["days"]) && isset($days[$_GET["days"]])) ? intval($_GET["days"]) : 120;
$tmp .= "<div style='margin:90px 0 30px 0;height:auto;'>";
$tmp .= "<iframe width='1200' height='500' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://myip.ms/crypto.php?m=".$charts[$chart]."&d=".$day."&a=2&c18=dddddd&c19=dddddd&h=500&w=1200&t=usd".($this->options['chart_reverse']?"":"&r=1")."'></iframe>";
$tmp .= "<div>";
// $tmp .= '<select id="'.GOURL.'chart" onchange="window.location.href = \''.admin_url('admin.php?page='.GOURL.'&days='.$day).'&chart=\'+this.options[this.selectedIndex].value+\'#chart\';">';
// foreach($this->coin_names as $k => $v) if (isset($charts[$k])) $tmp .= '<option value="'.$k.'"'.$this->sel($k, $chart).'>'.ucfirst($v).$this->space().'('.$k.')</option>';
// $tmp .= '</select>';
$tmp .= '<select id="'.GOURL.'days" onchange="window.location.href = \''.admin_url('admin.php?page='.GOURL.'&chart='.$chart).'&days=\'+this.options[this.selectedIndex].value+\'#chart\';">';
foreach($days as $k => $v) $tmp .= '<option value="'.$k.'"'.$this->sel($k, $day).'>'.__($v, GOURL).'</option>';
$tmp .= '</select>' . $this->space(3);
$tmp .= "<a class='".GOURL."smalltext' target='_blank' href='https://gourl.io/bitcoin-payment-gateway-api.html'>".__("GoUrl Live Currency Rates", GOURL)." »</a>";
$tmp .="</div>";
$tmp .="</div>";
$tmp .="</div></div>";
$tmp .= "<div class='gourlimgphone'><a target='_blank' href='https://gourl.io/'><img src='".plugins_url('/images/screen.png', __FILE__)."' border='0'></a></div>";
$tmp .= "<a name='i2'></a>";
$tmp .= "<br><br><br><br>";
$tmp .= "<div class='gourltitle'>".__('What Makes Us Unique', GOURL)."</div>";
$tmp .="<div class='gourllist'>";
$img = "<img title='".__('Example', GOURL)."' class='gourlimgpreview' src='".plugins_url('/images/example.png', __FILE__)."' border='0'>";
$tmp .= "<ul>";
$tmp .= "<li> ".sprintf(__("100%% Free Open Source on <a target='_blank' href='%s'>Github.com</a>", GOURL), "https://github.com/cryptoapi/")."</li>";
$tmp .= '<li> '.sprintf(__("No Monthly Fee, Transaction Fee from 0%%. Set your own prices in USD, <a href='%s'>EUR, GBP, RUB, AUD (100 currencies)</a>", GOURL), 'https://wordpress.org/plugins/gourl-woocommerce-bitcoin-altcoin-payment-gateway-addon/').'</li>';
$tmp .= "<li> ".sprintf(__("No ID Required, No Bank Account Needed. Global, Anonymous, Secure, No Chargebacks, Zero Risk", GOURL), "https://gourl.io/#usd")."</li>";
$tmp .= "<li> ".sprintf(__("Get payments straight to your bitcoin/altcoin wallets and convert to <a target='_blank' href='%s'>USD/EUR/etc</a> later. All in automatic mode", GOURL), "https://gourl.io/#usd")."</li>";
$tmp .= '<li> '.sprintf(__("<a href='%s'>Pay-Per-Download</a> - simple solution for your <b>unregistered</b> visitors: make money on file downloads", GOURL), GOURL_ADMIN.GOURL.'files')." <a target='_blank' href='https://gourl.io/lib/examples/pay-per-download-multi.php'>".$img."</a></li>";
$tmp .= '<li> '.sprintf(__("<a href='%s'>Pay-Per-View/Page</a> - for your <b>unregistered</b> visitors: offer paid access to your premium content/videos", GOURL), GOURL_ADMIN.GOURL.'payperview')." <a target='_blank' href='https://gourl.io/lib/examples/pay-per-page-multi.php'>".$img."</a></li>";
$tmp .= '<li> '.sprintf(__("<a href='%s'>Pay-Per-Membership</a> - for your <b>registered users</b>: offer paid access to your premium content, custom <a href='%s'>actions</a>", GOURL), GOURL_ADMIN.GOURL.'paypermembership', plugins_url("/images/dir/membership_actions.txt", __FILE__))." <a target='_blank' href='https://gourl.io/lib/examples/pay-per-membership-multi.php'>".$img."</a></li>";
$tmp .= '<li> '.sprintf(__("<a href='%s'>Pay-Per-Product</a> - advanced solution for your <b>registered users</b>: sell any products on website, invoices with buyer confirmation email, etc", GOURL), GOURL_ADMIN.GOURL.'products')." <a target='_blank' href='https://gourl.io/lib/examples/pay-per-product-multi.php'>".$img."</a></li>";
$tmp .= '<li> '.__("<a href='#addon'>Working with third-party plugins</a> - good support for third party plugins (WoCommerce, Jigoshop, bbPress, AppThemes, etc)", GOURL).'</li>';
$tmp .= '<li> '.__("Support payments in Bitcoin, Bitcoin Cash, Bitcoin SV, Litecoin, Dash, Dogecoin, Speedcoin, Reddcoin, Potcoin, Feathercoin, Vertcoin, Peercoin, MonetaryUnit", GOURL).'</li>';
$tmp .= '<li> '.__("<b>Auto Synchronization</b> - between payments data stored on your GoUrl.io account and your Website. If GoUrl attempts to deliver a payment notification/transaction confirmation but your website is unavailable, the notification is stored on the queue, and delivered to the your website when it becomes available (re-check connection with your website every hour)", GOURL).'</li>';
$tmp .= '<li> '.sprintf(__("Free <a href='%s'>Plugin Support</a> and <a href='#addon'>Free Add-ons</a> for You", GOURL), "https://gourl.io/view/contact/Contact_Us.html").'</li>';
$tmp .= "</ul>";
$tmp .= "<a name='j2'></a>";
$tmp .= "</div>";
$tmp .= "<a name='addon'></a>";
$tmp .= "<br><br><br><br>";
$tmp .= "<div class='gourltitle'>".__('Free Bitcoin Gateway Add-ons', GOURL)."</div>";
$tmp .= "<p>".__('The following Add-ons extend the functionality of GoUrl -', GOURL)."</p>";
$tmp .= '<p><a style="margin-left:20px" target="_blank" href="https://wordpress.org/plugins/search/gourl/" class="button-primary">'.__('All Add-ons on Wordpress.prg', GOURL).'<span class="dashicons dashicons-external"></span></a>';
$tmp .= '<a style="margin-left:30px" href="'.admin_url('plugin-install.php?tab=search&type=author&s=gourl').'" class="button-primary">'.__("View on 'Add Plugins' Page", GOURL).'<span class="dashicons dashicons-external"></span></a>';
$tmp .= "</p>";
$tmp .= "<table class='gourltable gourltable-addons'>";
$tmp .= "<tr><th style='width:10px'></th><th>".__('Bitcoin/Altcoin Gateway', GOURL)."</th><th style='padding-left:60px'>".__('Description', GOURL)."</th><th>".__('Homepage', GOURL)."</th><th>".__('Wordpress.org', GOURL)."</th><th>".__('Installation pages', GOURL)."</th></tr>";
$tmp .= "<tr><td class='gourlnum'>1.</td><td><a target='_blank' href='https://wordpress.org/plugins/woocommerce/'><img src='".plugins_url('/images/logos/woocommerce.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("Provides a GoUrl Bitcoin/Altcoin Payment Gateway for wordpress E-Commerce - <a target='_blank' href='%s'>WooCommerce 2.1+</a>", GOURL), "https://wordpress.org/plugins/woocommerce/")."</td><td><a target='_blank' href='https://gourl.io/bitcoin-payments-woocommerce.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bitcoin-payments-woocommerce.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-woocommerce-bitcoin-altcoin-payment-gateway-addon/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/Bitcoin-Payments-Woocommerce'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+woocommerce+addon')."'>".__('Install Now', GOURL)." »</a><br><br>b. <a href='".admin_url('plugin-install.php?s=WooCommerce+Automattic+eCommerce+web+services+Android+and+iOS&tab=search&type=term')."'>".__('WooCommerce', GOURL)." »</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>2.</td><td><a target='_blank' href='https://woocommerce.com/products/woocommerce-subscriptions/'><img src='".plugins_url('/images/logos/woocommerce_subscriptions.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("Provides a GoUrl Bitcoin/Altcoin Payment Gateway for- <a target='_blank' href='%s'>WooCommerce Subscriptions</a><br><br>NOTE: WOOCOMMERCE SUBSCRIPTIONS PLUGIN IS FREE OPEN SOURCE, DO NOT PAY $199!<br>Free plugin download from <a target='_blank' href='%s'>Github Plugin Repository</a>", GOURL), "https://wordpress.org/plugins/woocommerce/", "https://github.com/wp-premium/woocommerce-subscriptions")."</td><td><a target='_blank' href='https://gourl.io/bitcoin-payments-woocommerce.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bitcoin-payments-woocommerce.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-woocommerce-bitcoin-altcoin-payment-gateway-addon/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/Bitcoin-Payments-Woocommerce'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+woocommerce+addon')."'>".__('GoUrl Install Now', GOURL)." »</a><br><br>b. <a target='_blank' href='https://github.com/wp-premium/woocommerce-subscriptions'>".__('Woo Subscriptions', GOURL)." »</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>3.</td><td><a target='_blank' href='https://wordpress.org/plugins/give/'><img src='".plugins_url('/images/logos/give.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("Bitcoin/Altcoin & Paypal Donations in Wordpress. Provides a GoUrl Bitcoin/Altcoin Payment Gateway for <a target='_blank' href='%s'>Give 0.8+</a> - easy to use wordpress donation plugin for accepting bitcoins, altcoins, paypal, authorize.net, stripe, paymill donations directly onto your website.", GOURL), "https://wordpress.org/plugins/give/")."</td><td><a target='_blank' href='https://gourl.io/bitcoin-donations-wordpress-plugin.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bitcoin-donations-wordpress-plugin.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-bitcoin-paypal-donations-give-addon/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/Bitcoin-Paypal-Donations-Wordpress'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+donation+addon')."'>".__('Install Now', GOURL)." »</a><br><br>b. <a href='https://github.com/cryptoapi/Give-Wordpress-Donations-Bitcoin'>".__('Give', GOURL)." »</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>4.</td><td><a target='_blank' href='https://wordpress.org/plugins/easy-digital-downloads/'><img src='".plugins_url('/images/logos/edd.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("Provides a GoUrl Bitcoin/Altcoin Payment Gateway for <a target='_blank' href='%s'>Easy Digital Downloads 2.4+</a> - sell digital files / downloads through WordPress.", GOURL), "https://wordpress.org/plugins/easy-digital-downloads/")."</td><td><a target='_blank' href='https://gourl.io/bitcoin-easy-digital-downloads-edd.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bitcoin-easy-digital-downloads-edd.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-bitcoin-easy-digital-downloads-edd/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/Bitcoin-Easy-Digital-Downloads'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+easy+digital+Downloads+edd')."'>".__('Install Now', GOURL)." »</a><br><br>b. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=Easy+Digital+Downloads+easiest+way+sell+digital+products+Track+dozen')."'>".__('EDD', GOURL)." »</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>5.</td><td><a target='_blank' href='https://wordpress.org/plugins/paid-memberships-pro/'><img src='".plugins_url('/images/logos/paid-memberships-pro.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("Provides a GoUrl Bitcoin/Altcoin Payment Gateway for advanced wordpress membership plugin - <a target='_blank' href='%s'>Paid Memberships Pro 1.8.4+</a>", GOURL), "https://wordpress.org/plugins/paid-memberships-pro/")."</td><td><a target='_blank' href='https://gourl.io/bitcoin-payments-paid-memberships-pro.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bitcoin-payments-paid-memberships-pro.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-bitcoin-paid-memberships-pro/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/Bitcoin-Gateway-Paid-Memberships-Pro'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+paid+memberships+addon')."'>".__('Install Now', GOURL)." »</a><br><br>b. <a href='".admin_url('plugin-install.php?s=paid+memberships+pro+stranger+studios+member+management&tab=search&type=term')."'>".__('PaidMembPro', GOURL)." »</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>6.</td><td><a target='_blank' href='https://wordpress.org/plugins/bbpress/'><img src='".plugins_url('/images/logos/bbpress.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("This addon will add Premium Membership and Bitcoin payment gateway to <a target='_blank' href='%s'>bbPress 2.5+</a> Forum / Customer Support System.<br>You can mark some topics on your forum/customer support system as Premium and can easily monetise it with Bitcoins/altcoins - user pay to read / pay to create / add new replies to the topic, etc.<br>You can add premium user support to your web site using <a target='_blank' href='%s'>bbPress</a>. Any user can place questions (create new premium topic in bbPress), and only paid/premium users will see your answers, etc.", GOURL), "https://wordpress.org/plugins/bbpress/", "https://wordpress.org/plugins/bbpress/")."</td><td><a target='_blank' href='https://gourl.io/bbpress-premium-membership.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bbpress-premium-membership.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-bbpress-premium-membership-bitcoin-payments/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/bbPress-Premium-Membership-Bitcoins'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+bbpress+topics')."'>".__('Install Now', GOURL)." »</a><br><br>b. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=bbPress+scale+forum+growing+community+contributors')."'>".__('bbPress', GOURL)." »</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>7.</td><td><a target='_blank' href='https://www.appthemes.com/themes/'><img src='".plugins_url('/images/logos/appthemes.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("Provides a GoUrl Bitcoin/Altcoin Payment Gateway and Escrow for all <a target='_blank' href='%s'>AppThemes Premium Themes</a> - Classipress, Vantage, JobRoller, Clipper, Taskerr, HireBee, Ideas, Quality Control, etc.", GOURL), "https://www.appthemes.com/themes/")."</td><td><a target='_blank' href='https://gourl.io/bitcoin-appthemes-classipress-jobroller-vantage-etc.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bitcoin-appthemes-classipress-jobroller-vantage-etc.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-appthemes-bitcoin-payments-classipress-vantage-jobroller/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/Bitcoin-Payments-Appthemes'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+appthemes+escrow')."'>".__('Install Now', GOURL)." »</a><br><br>b. <a href='https://www.appthemes.com/themes/'>".__('AppThemes', GOURL)." »</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>8.</td><td><a target='_blank' href='https://wordpress.org/plugins/jigoshop/'><img src='".plugins_url('/images/logos/jigoshop.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("Provides a GoUrl Bitcoin/Altcoin Payment Gateway for <a target='_blank' href='%s'>Jigoshop 1.12+</a>", GOURL), "https://wordpress.org/plugins/jigoshop/")."</td><td><a target='_blank' href='https://gourl.io/bitcoin-payments-jigoshop.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bitcoin-payments-jigoshop.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-jigoshop-bitcoin-payment-gateway-processor/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/Bitcoin-Payments-Jigoshop'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+jigoshop+processor')."'>".__('Install Now', GOURL)." »</a><br><br>b. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=jigoshop+excellent+performance+dynamic')."'>".__('Jigoshop', GOURL)." »</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>9.</td><td><a target='_blank' href='https://wordpress.org/plugins/wp-e-commerce/'><img src='".plugins_url('/images/logos/wp-ecommerce.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("Provides a GoUrl Bitcoin/Altcoin Payment Gateway for <a target='_blank' href='%s'>WP eCommerce 3.8.10+</a>", GOURL), "https://wordpress.org/plugins/wp-e-commerce/")."</td><td><a target='_blank' href='https://gourl.io/bitcoin-payments-wp-ecommerce.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bitcoin-payments-wp-ecommerce.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-wp-ecommerce-bitcoin-altcoin-payment-gateway-addon/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/Bitcoin-Payments-WP-eCommerce'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+wp+ecommerce+addon')."'>".__('Install Now', GOURL)." »</a><br><br>b. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=wp+ecommerce+empowers+sell+anything+ssl')."'>".__('WP eCommerce', GOURL)." »</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>10.</td><td><a target='_blank' href='https://wordpress.org/plugins/wordpress-ecommerce/'><img src='".plugins_url('/images/logos/marketpress.png', __FILE__)."' border='0'></a></td><td class='gourldesc'>".sprintf(__("Provides a GoUrl Bitcoin/Altcoin Payment Gateway for <a target='_blank' href='%s'>MarketPress 2.9+</a>", GOURL), "https://wordpress.org/plugins/wordpress-ecommerce/")."</td><td><a target='_blank' href='https://gourl.io/bitcoin-payments-wpmudev-marketpress.html'>".__('Plugin Homepage', GOURL)."</a><br><br><a target='_blank' href='https://gourl.io/bitcoin-payments-wpmudev-marketpress.html#screenshot'>".__('Screenshots', GOURL)."</a></td><td><a target='_blank' href='https://wordpress.org/plugins/gourl-wpmudev-marketpress-bitcoin-payment-gateway-addon/'>".__('Wordpress Page', GOURL)."</a><br><br><a target='_blank' href='https://github.com/cryptoapi/Bitcoin-Payments-MarketPress'>".__('Open Source', GOURL)."</a></td><td>a. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+marketpress+addon')."'>".__('Install Now', GOURL)." »</a><br><br>b. <a href='".admin_url('plugin-install.php?tab=search&type=term&s=marketpress+WordPress+eCommerce+Beautiful+Checkout')."'>".__('MarketPress', GOURL)." »</a><br><a style='font-size:12px;margin-left:20px' target='_blank' href='https://gourl.io/bitcoin-payments-wpmudev-marketpress.html#notes'>".__('Important Notes', GOURL)."</a></td></tr>";
$tmp .= "<tr><td class='gourlnum'>11.</td><td><a target='_blank' href='https://gourl.io/affiliates.html'><img src='".plugins_url('/images/logos/affiliate.png', __FILE__)."' border='0'></a><td colspan='4' class='gourldesc'><h4>".__("Supports Bitcoin/Altcoin Payments in Any Other Wordpress Plugins", GOURL)."</h4>";
$tmp .= sprintf(__("Other wordpress plugin developers can easily integrate Bitcoin payments to their own plugins (<a target='_blank' href='%s'>source example</a> and <a target='_blank' href='%s'>result</a>) using this GoUrl Plugin with payment gateway functionality. Please ask Wordpress Plugin Developers to add <a href='#i6'>a few lines of code below</a> to their plugins (gourl bitcoin payment gateway with optional <a target='_blank' href='%s'>Bitcoin Affiliate Program - 33.3%% lifetime revenue share</a> for them) and bitcoin/litecoin/dogecoin/etc payments will be automatically used in their plugins. It's easy!", GOURL), "https://github.com/cryptoapi/Bitcoin-Payments-Woocommerce/blob/master/gourl-woocommerce.php", "https://gourl.io/bitcoin-payments-woocommerce.html#screenshot", "https://gourl.io/affiliates.html");
$tmp .= "</td></tr>";
$tmp .= "<tr><td class='gourlnum'>12.</td><td colspan='5'><h3>".__("Webmaster Spelling Notifications Plugin", GOURL)."</h3>".sprintf(__("Plugin allows site visitors to send reports to the webmaster/owner about any spelling or grammatical errors. Spelling checker on your website. <a href='%s'>Live Demo</a>", GOURL), "https://gourl.io/php-spelling-notifications.html#live");
$tmp .= "<div style='margin:20px 0 10px 0'>";
$tmp .= "<a target='_blank' href='https://gourl.io/php-spelling-notifications.html'>".__('Plugin Homepage', GOURL)."</a>       ";
$tmp .= "<a target='_blank' href='https://wordpress.org/plugins/gourl-spelling-notifications/'>".__('Wordpress Page', GOURL)."</a>       ";
$tmp .= "<a target='_blank' href='https://github.com/cryptoapi/Wordpress-Spelling-Notifications'>".__('Open Source', GOURL)."</a>       ";
$tmp .= "<a href='".admin_url('plugin-install.php?tab=search&type=term&s=gourl+spelling')."'>".__('Install Now', GOURL)." »</a>";
$tmp .= "</div>";
$tmp .= "<a target='_blank' href='https://wordpress.org/plugins/gourl-spelling-notifications/'><img src='".plugins_url('/images/logos/spelling.png', __FILE__)."' border='0'></a>";
$tmp .= "<a name='i3'></a>";
$tmp .= "</td></tr>";
$tmp .= "</table>";
$tmp .= "<br><br><br><br><br><br><br>";
$tmp .= "<div class='gourltitle'>3. ".__('GoUrl Instruction', GOURL)."</div>";
$tmp .= "<ul class='gourllist'>";
$tmp .= "<li> ".sprintf(__("Free <a target='_blank' href='%s'>Register</a> or <a target='_blank' href='%s'>Login</a> on GoUrl.io - Global Bitcoin Payment Gateway", GOURL), "https://gourl.io/view/registration", "https://gourl.io/info/memberarea/My_Account.html")."</li>";
$tmp .= "<li> ".sprintf(__("Create <a target='_blank' href='%s'>Payment Box</a> Records for all coin types you will accept on your website", GOURL), "https://gourl.io/editrecord/coin_boxes/0")."</li>";
$tmp .= "<li> ".sprintf(__("You will need to place <a href='%s'>Callback URL</a> on Gourl.io, please use: <b>%s</b>", GOURL), plugins_url('/images/callback_field.png', __FILE__), trim(get_site_url(), "/ ")."/?cryptobox.callback.php")."</li>";
$tmp .= "<li> ".sprintf(__("You will get Free GoUrl <a href='%s'>Public/Private keys</a> from new created <a target='_blank' href='%s'>payment box</a>, save them on <a href='%s'>Settings Page</a>", GOURL), plugins_url('/images/keys_field.png', __FILE__), "https://gourl.io/editrecord/coin_boxes/0", GOURL_ADMIN.GOURL."settings#".GOURL."currencyconverterapi_key")."</li>";
$tmp .= "<li> ".sprintf(__("Optional - add your <a href='%s'>company logo</a> to payment box on <a href='%s'>Settings Page</a>", GOURL), plugins_url('/images/compare_box.png', __FILE__), GOURL_ADMIN.GOURL."settings#".GOURL."box_theme")."</li>";
$tmp .= "</ul>";
$tmp .= "<p>".__("THAT'S IT! YOUR WEBSITE IS READY TO ACCEPT BITCOINS ONLINE!", GOURL)."</p>";
$tmp .= "<br><p>".sprintf(__("<b>Testing environment</b>: You can use <a target='_blank' href='%s'>500 free Speedcoins</a> or <a target='_blank' href='%s'>Dogecoins</a> for testing", GOURL), "https://speedcoin.org/info/free_coins/Free_Speedcoins.html", "https://poloniex.com/");
$tmp .= "<a name='i4'></a>";
$tmp .= "</p>";
$tmp .= "<br><br><br><br><br><br><br><br>";
$tmp .= "<div class='gourltitle'>4. ".__('Differences between Pay-Per-View and Pay-Per-Membership', GOURL)."</div>";
$tmp .= "<div class='gourlimginstruction'>";
$tmp .= '<a target="_blank" title="'.__('Click to see full size image', GOURL).'" href="'.plugins_url('/images/tagexample_membership_full.png', __FILE__).'"><img width="400" height="379" alt="'.__('Add GoUrl Shortcodes to pages. Example', GOURL).'" src="'.plugins_url('/images/tagexample.png', __FILE__).'" border="0"></a>';
$tmp .= "</div>";
$tmp .= "<ul class='gourllist'>";
$tmp .= "<li> ".sprintf(__("<a href='%s'>Pay-Per-View</a> - shortcode <b>[%s]</b> - you can use it for unregistered website visitors. Plugin will automatically generate a unique user identification for every user and save it in user browser cookies. User can have a maximum of 2 days membership with Pay-Per-View and after they will need to pay again. Because if a user clears browser cookies, they will lose their membership and a new payment box will be displayed.", GOURL), GOURL_ADMIN.GOURL."payperview", GOURL_TAG_VIEW)."</li>";
$tmp .= "<li> ".sprintf(__("<a href='%s'>Pay-Per-Membership</a> - shortcode <b>[%s]</b> - similar to pay-per-view but for registered users only. It is a better safety solution because plugin uses registered userID not cookies. And a membership period from 1 hour to 1 year of your choice. You need to have website <a href='%s'>registration enabled</a>.", GOURL), GOURL_ADMIN.GOURL."paypermembership", GOURL_TAG_MEMBERSHIP, admin_url('options-general.php'))."</li>";
$tmp .= "<li> ".__('You can use <b>custom actions with Pay-Per-Membership</b> on your website (premium and free webpages).<br>For example, hide ads for premium users, php code below -', GOURL)."<br>";
$tmp .= "<a href='".plugins_url('/images/dir/membership_actions.txt', __FILE__)."'><img src='".plugins_url('/images/paypermembership_code.png', __FILE__)."'></a>";
$tmp .= "</li>";
$tmp .= "<li> ".__('You can use <b>custom actions with Pay-Per-View</b> on your website too -', GOURL)."<br>";
$tmp .= "<a href='".plugins_url('/images/dir/payperview_actions.txt', __FILE__)."'><img src='".plugins_url('/images/payperview_code.png', __FILE__)."'></a>";
$tmp .= "</li>";
$tmp .= "<li> ".sprintf(__("<b>Pay-Per-Membership</b> integrated with <a href='%s'>bbPress Forum/Customer Support</a> also ( use our <a href='%s'>GoUrl bbPress Addon</a> ). You can mark some topics on your bbPress as Premium and can easily monetise it with Bitcoins/altcoins.", GOURL), admin_url('plugin-install.php?tab=search&type=term&s=bbPress+forum+keeping+lean'), admin_url('plugin-install.php?tab=search&type=term&s=gourl+bbpress+topics'))."</li>";
$tmp .= "<li> ".sprintf(__("<b>Both solutions</b> - Pay-Per-Membership and Pay-Per-View hide content on premium pages from unpaid users/visitors and allow to use custom actions on free website pages; Pay-Per-Membership provides premium membership mode in <a href='%s'>bbPress</a> also.", GOURL), "https://wordpress.org/plugins/bbpress/")."</li>";
$tmp .= "<li> ".__("If a visitor goes to a premium page and have not logged in -<br>Pay-Per-View will show a payment box and accept payments from the unregistered visitor.<br>Pay-Per-Membership will show a message that the user needs to login/register on your website first and after show a payment box for logged in users only.", GOURL)."</li>";
$tmp .= "</ul>";
$tmp .= "<br><p>";
$tmp .= sprintf(__("For example, you might offer paid unlimited access to your 50 website premium pages/posts for the price of 1 USD for 2 DAYS to all your website visitors (<span class='gourlnowrap'>non-registered</span> visitors or registered users). Simple <a href='%s'>add</a> shortcode <a href='%s'>[%s]</a> or <a href='%s'>[%s]</a> for all those fifty your premium pages/posts. When visitors go on any of those pages, they will see automatic cryptocoin payment box (the original page content will be hidden). After visitor makes their payment, they will get access to original pages content/videos and after 2 days will see a new payment box. Visitor can make payment on any your premium page and they will get access to all other premium pages also.<br>Optional - You can <a href='%s'>show ads</a> for unpaid users on other your free webpages, etc.", GOURL), plugins_url('/images/tagexample_membership_full.png', __FILE__), GOURL_ADMIN.GOURL."payperview", GOURL_TAG_VIEW, GOURL_ADMIN.GOURL."paypermembership", GOURL_TAG_MEMBERSHIP, plugins_url('/images/paypermembership_code.png', __FILE__));
$tmp .= "<br><br>";
$tmp .= sprintf(__("<b>Notes:</b><br>- Do not use [%s] and [%s] together on the same page.<br>- Website Editors / Admins will have all the time full access to premium pages and see original page content", GOURL), GOURL_TAG_VIEW, GOURL_TAG_MEMBERSHIP);
$tmp .= "<a name='i5'></a>";
$tmp .= "</p>";
$tmp .= "<br><br><br><br><br><br><br>";
$tmp .= "<div class='gourltitle'>5. ".__('Adding Custom Actions after Payment has been received', GOURL)."</div>";
$tmp .= "<p><b>".__('Using for Pay-Per-Product, Pay-Per-Download, Pay-Per-View, Pay-Per-Membership only', GOURL)."</b></p>";
$tmp .= "<p id='gourl_successful_payment'>".sprintf(__("Optional - You can use additional actions after a payment has been received (for example create/update database records, etc) using gourl instant payment notification system. Simply edit php file <a href='%s'>gourl_ipn.php</a> in directory %s and add section with your order_ID in function <b>%s</b>.", GOURL), plugins_url('/images/dir/gourl_ipn.default.txt', __FILE__), GOURL_PHP, 'gourl_successful_payment(...)')." ";
$tmp .= __("This function will appear every time when a new payment from any user is received successfully. Function gets user_ID - user who made payment, current order_ID (the same value as at the bottom of record edit page Pay-Per-Product, Pay-Per-Download, etc.) and payment details as array.", GOURL)."</p>";
$tmp .= "<p><a target='_blank' href='https://gourl.io/affiliate-bitcoin-wordpress-plugins.html'><img alt='".__('Example of PHP code', GOURL)."' src='".plugins_url('/images/output.png', __FILE__)."' border='0'></a></p>";
$tmp .= "<br><p>".sprintf(__("P.S. If you use <a href='#addon'>additional plugins/add-ons</a> with gourl payment gateway, you can add your custom actions inside of function %s. That function will appear when a payment is received. Variable values received that add-on function identically to values received function gourl_successful_payment(), see <a href='%s'>screenshot</a> above.", GOURL), '<b>..addonname.."_gourlcallback"</b> ($user_ID = 0, $order_ID = "", $payment_details = array(), $box_status = "")', "#gourl_successful_payment");
$tmp .= "<a name='i6'></a></p>";
$tmp .= "<br><br><br><br><br><br><br>";
$tmp .= "<div class='gourltitle'>6. ".__('Bitcoin Payments with Any Other Wordpress Plugins', GOURL)."</div>";
$tmp .= "<p>".sprintf(__("<b>Other wordpress plugin developers can easily integrate Bitcoin payments to their own plugins</b> using this plugin with cryptocurrency payment gateway functionality. For example, see other add-on <a target='_blank' href='%s'>PHP source code</a> and <a target='_blank' href='%s'>result</a> - Bitcoin payments for <a target='_blank' href='%s'>WooCommerce</a>, which uses this plugin functionality. Please ask Wordpress Plugin Developers to add a few lines of code below to their plugins (gourl bitcoin payment gateway with optional <a target='_blank' href='%s'>Bitcoin Affiliate Program - 33.3%% lifetime revenue share</a> for them ) and bitcoin/altcoin payments will be automatically used in their plugins. GoUrl Payment Gateway will do all the work - display payment form, process received payments, etc and will submit that information to the plugin used. Around 5 seconds after cryptocoin payment is made, user will see confirmation on your webpage with any wordpress plugin that payment is received (i.e. very fast).", GOURL), "https://github.com/cryptoapi/Bitcoin-Payments-Woocommerce/blob/master/gourl-woocommerce.php", "https://gourl.io/bitcoin-payments-woocommerce.html#screenshot", "https://wordpress.org/plugins/woocommerce/", "https://gourl.io/affiliates.html")."</p>";
$tmp .= "<p>".sprintf(__("<b>Beneficial for You and other users.</b> Simply use this GoUrl Bitcoin/Altcoin Gateway for Wordpress which will automatically be used by other plugins and you will only need to enter your bitcoin/litecoin/dogecoin wallet addresses once. No multiple times, for different plugins. Also you will see the bitcoin/altcoin payment statistics in one common table <a href='%s'>All Payments</a> with details of all received payments. So it is easy to control everything. Of course, other plugins also can show bitcoin/altcoin transactions which linked with them, using data from that common 'All Payments' table.", GOURL), GOURL_ADMIN.GOURL."payments")."</p>";
$tmp .= "<br><h3>".__('Example of php code with GoUrl Bitcoin Payment Gateway for other wordpress plugins -', GOURL)."<br>";
$tmp .= "<a target='_blank' href='https://gourl.io/affiliate-bitcoin-wordpress-plugins.html'><img alt='".__('Example of PHP code', GOURL)."' src='".plugins_url('/images/script.png', __FILE__)."' border='0'></a>";
$tmp .= "</h3><p>";
$tmp .= sprintf(__("And add custom actions after payment has been received. <a href='%s'>Integration Instruction »</a>", GOURL), "https://gourl.io/affiliate-bitcoin-wordpress-plugins.html");
$tmp .= "<a name='i7'></a>";
$tmp .= "</p>";
$tmp .= "<br><br><br><br><br><br><br>";
$tmp .= "<div class='gourltitle'>7. ".__('GoUrl Contacts', GOURL)."</div>";
$btc = "16oxamUoh6zwLgFUoADkr5KnNC6mTbBbsj";
$bch = "15ZGAHwvwDiDhoDZtFjF3j5c5cpF8KFLZY";
$bsv = "17wDBhNE2syKCtUyFoFaLU4QVbtXG514Z3";
$ltc = "LarmyXoQpydpUCYHx9DZeYoxcQ4YzMfHDt";
$spd = "SiDHas473qf8JPJFvFLcNuAAnwXhxtvv9s";
$doge = "DNhHdAxV7CCqjPuwg2W4qTESd5jkF7iC1C";
$dash = "XfMTeciUUZEvRRHB49qaY9Jzi1E5HAJawJ";
$rdd = "RmB8ysK4YG4D3axNPHsKEoqxvg5KwySSJz";
$pot = "PKwNNWo6YdweQk2F87UDGp84TQK878PWho";
$ftc = "6otKdaB1aasmQ5kA9wKBXJM5mi9e19VxYQ";
$vtc = "VeRUojCEkZn9u8AswqiKvpfHW4BW8Uas7V";
$ppc = "PUxNprg24a8JjgG5pETKqesSiC5HprutvB";
$mue = "7SA3Ht7CvoVueRvnKqqRR7fW6xg5hZk8TX";
$tmp .= "<p>".sprintf(__('Please contact us with any questions - %s', GOURL), "<a href='https://gourl.io/view/contact/Contact_Us.html'>https://gourl.io/view/contact/Contact_Us.html</a>")."</p>";
$tmp .= "<p>".sprintf(__("A great way to get involved in open source is to contribute to the existing projects you're using. GitHub is home to more than 5 million open source projects. <a target='_blank' href='%s'>A pull request</a> is a method of submitting contributions to an open development project. You can create a pull request with your new add-ons/php code for this free open source plugin <a target='_blank' href='%s'>here</a>", GOURL), "http://readwrite.com/2014/07/02/github-pull-request-etiquette", "https://github.com/cryptoapi/Bitcoin-Wordpress-Plugin") ."</p>";
$tmp .= "<br><br>";
$tmp .= "<div style='float:right;margin:20px 20px 100px 0;width:570px'>";
$tmp .= "<h3>".__('Buttons For Your Website -', GOURL)."</h3>";
$tmp .= '<img hspace="10" vspace="10" src="'.plugins_url('/images/gourl.png', __FILE__).'" border="0">';
$tmp .= '<img hspace="10" vspace="10" src="'.plugins_url('/images/gourlpayments.png', __FILE__).'" border="0"><br>';
$tmp .= '<img hspace="10" vspace="10" src="'.plugins_url('/images/bitcoin_accepted.png', __FILE__).'" border="0">';
$tmp .= '<img hspace="10" vspace="10" src="'.plugins_url('/images/bitcoin_donate.png', __FILE__).'" border="0"><br>';
foreach($this->coin_names as $k => $v) $tmp .= '<img width="70" hspace="10" vspace="10" alt="'.$v.'" src="'.plugins_url('/images/'.$v.'2.png', __FILE__).'" border="0"> ';
$tmp .= "<br><br><br>";
$tmp .= "<img width='570' src='".plugins_url('/images/coins.png', __FILE__)."' border='0'>";
$tmp .= "</div>";
$tmp .= "<div style='margin:50px 0'>";
$tmp .= "<h3>".__('Our Project Donation Addresses -', GOURL)."</h3>";
$tmp .= "<p>Bitcoin:   <a href='bitcoin:".$btc."?label=Donation'>".$btc."</a></p>";
$tmp .= "<p>BitcoinCash:   <a href='bitcoincash:".$bch."?label=Donation'>".$bch."</a></p>";
$tmp .= "<p>BitcoinSV:   <a href='bitcoinsv:".$bsv."?label=Donation'>".$bsv."</a></p>";
$tmp .= "<p>Litecoin:   <a href='litecoin:".$ltc."?label=Donation'>".$ltc."</a></p>";
$tmp .= "<p>Dash:   <a href='dash:".$dash."?label=Donation'>".$dash."</a></p>";
$tmp .= "<p>Dogecoin:   <a href='dogecoin:".$doge."?label=Donation'>".$doge."</a></p>";
$tmp .= "<p>Speedcoin:   <a href='speedcoin:".$spd."?label=Donation'>".$spd."</a></p>";
$tmp .= "<p>Reddcoin:   <a href='reddcoin:".$rdd."?label=Donation'>".$rdd."</a></p>";
$tmp .= "<p>Potcoin:   <a href='potcoin:".$pot."?label=Donation'>".$pot."</a></p>";
$tmp .= "<p>Feathercoin:   <a href='feathercoin:".$ftc."?label=Donation'>".$ftc."</a></p>";
$tmp .= "<p>Vertcoin:   <a href='vertcoin:".$vtc."?label=Donation'>".$vtc."</a></p>";
$tmp .= "<p>MonetaryUnit:   <a href='monetaryunit:".$mue."?label=Donation'>".$mue."</a></p>";
$tmp .= "<p>Peercoin:   <a href='peercoin:".$ppc."?label=Donation'>".$ppc."</a></p>";
$tmp .= "</div>";
$tmp .= "<br><br><br><br><br><br><br>";
$tmp .= "</div>";
$tmp .= "</div>";
$tmp .= "</div>";
echo $tmp;
return true;
}
// list -
// function get
// function post
// function check
// function save
// function adminpage
// function shortcode
/**************** A. GENERAL OPTIONS ************************************/
/*
* 19. Get values from the options table
*/
private function get_settings()
{
$arr = array("box_type"=>"", "box_theme"=>"", "box_width"=>540, "box_height"=>230, "box_border"=>"", "box_style"=>"", "message_border"=>"", "message_style"=>"", "login_type"=>"", "rec_per_page"=>20, "popup_message"=>__('It is a Paid Download ! Please pay below', GOURL), "file_columns"=>"", "chart_reverse"=>"", "boxlogo"=>0, "boxlogo2"=>"", "boxlogo_url"=>"", "currencyconverterapi_key"=>"");
foreach($arr as $k => $v) $this->options[$k] = "";
foreach($this->custom_images as $k => $v)
{
$this->options[$k] = 0;
$this->options[$k."2"] = "";
$this->options[$k."url"] = "";
}
foreach($this->coin_names as $k => $v)
{
$this->options[$v."public_key"] = "";
$this->options[$v."private_key"] = "";
}
foreach ($this->options as $key => $value)
{
$this->options[$key] = get_option(GOURL.$key);
}
// default
foreach($arr as $k => $v)
{
if (!$this->options[$k]) $this->options[$k] = $v;
}
foreach($this->custom_images as $k => $v)
{
if (!$this->options[$k."url"]) $this->options[$k] = 0;
}
if ((!$this->options["boxlogo_url"] && $this->options["boxlogo"] == 2) || !in_array($this->options["boxlogo"], array(0, 1, 2))) $this->options["boxlogo"] = 0;
// Additional Security - compare gourl public/private keys sha1 hash with hash stored in file $this->hash_url
// ------------------
$txt = (is_readable($this->hash_url)) ? file_get_contents($this->hash_url) : "";
$arr = json_decode($txt, true);
/*
if (isset($arr["nonce"]) && $arr["nonce"] != sha1(md5(NONCE_KEY)))
{
$this->save_cryptokeys_hash(); // admin changed NONCE_KEY
$txt = (is_readable($this->hash_url)) ? file_get_contents($this->hash_url) : "";
$arr = json_decode($txt, true);
}
*/
foreach($this->coin_names as $k => $v)
{
$pub = $v."public_key";
$prv = $v."private_key";
if (($this->options[$pub] || $this->options[$prv]) &&
(!isset($arr[$pub]) || !isset($arr[$prv]) ||
$arr[$pub] != sha1($this->options[$pub].NONCE_KEY.$this->options[$pub]) ||
$arr[$prv] != sha1($this->options[$prv].NONCE_KEY.$this->options[$prv])))
{
$this->options[$pub] = $this->options[$prv] = "";
update_option(GOURL.$pub, "");
update_option(GOURL.$prv, "");
if (!isset($this->errors["md5_error"])) $this->errors["md5_error"] = sprintf(__("Invalid %s keys md5 hash in file %s. Please delete this file and re-enter your GoUrl Public/Private Keys"), $v, $this->hash_url);
}
}
return true;
}
/*
* 20.
*/
private function post_settings()
{
foreach ($this->options as $key => $value)
{
$this->options[$key] = (isset($_POST[GOURL.$key])) ? stripslashes($_POST[GOURL.$key]) : "";
if (is_string($this->options[$key])) $this->options[$key] = trim($this->options[$key]);
}
return true;
}
/*
* 21.
*/
private function check_settings()
{
$f = true;
foreach($this->coin_names as $k => $v)
{
$public_key = trim($this->options[$v."public_key"]);
$private_key = trim($this->options[$v."private_key"]);
$boxID = $this->left($public_key, "AA");
if ($public_key && (strpos($public_key, " ") !== false || strlen($public_key) != 50 || $public_key != preg_replace('/[^A-Za-z0-9]/', '', $public_key) || !strpos($public_key, "AA") || !$boxID || !is_numeric($boxID) || !strpos($public_key, ucfirst(strtolower($v))."77".strtoupper($k)."PUB"))) $this->errors[$v."public_key"] = ucfirst($v) . ' ' . __('Box Invalid Public Key', GOURL) . ' : ' . $public_key;
$boxID = $this->left($private_key, "AA");
if ($private_key && (strpos($private_key, " ") !== false || strlen($private_key) != 50 || $private_key != preg_replace('/[^A-Za-z0-9]/', '', $private_key) || !strpos($private_key, "AA") || !$boxID || !is_numeric($boxID) || !strpos($private_key, ucfirst(strtolower($v))."77".strtoupper($k)."PRV") || $boxID != $this->left($public_key, "AA"))) $this->errors[$v."private_key"] = ucfirst($v) . ' ' . __('Box Invalid Private Key', GOURL) . ' : ' . $private_key;
if ($public_key && !$private_key) $this->errors[$v."private_key"] = ucfirst($v) . ' ' . __('Box Private Key - cannot be empty', GOURL);
if ($private_key && !$public_key) $this->errors[$v."public_key"] = ucfirst($v) . ' ' . __('Box Public Key - cannot be empty', GOURL);
if ($public_key || $private_key) $f = false;
if ($public_key && $private_key && !isset($this->errors[$v."public_key"]) && !isset($this->errors[$v."private_key"])) $this->payments[$k] = ucfirst($v);
}
if ($f && !isset($this->errors["md5_error"])) $this->errors[] = sprintf(__("You must choose at least one payment method. Please enter your GoUrl Public/Private Keys. <a href='%s'>Instruction here »</a>", GOURL), GOURL_ADMIN.GOURL."#i3");
if (!is_numeric($this->options["box_width"]) || round($this->options["box_width"]) != $this->options["box_width"] || $this->options["box_width"] < 480 || $this->options["box_width"] > 700) $this->errors[] = __('Invalid Payment Box Width. Allowed 480..700px', GOURL);
if (!is_numeric($this->options["box_height"]) || round($this->options["box_height"]) != $this->options["box_height"] || $this->options["box_height"] < 200 || $this->options["box_height"] > 400) $this->errors[] = __('Invalid Payment Box Height. Allowed 200..400px', GOURL);
if (!is_numeric($this->options["rec_per_page"]) || round($this->options["rec_per_page"]) != $this->options["rec_per_page"] || $this->options["rec_per_page"] < 5 || $this->options["rec_per_page"] > 200) $this->errors[] = __('Invalid Records Per Page value. Allowed 5..200', GOURL);
if (mb_strlen($this->options["popup_message"]) < 15 || mb_strlen($this->options["popup_message"]) > 400) $this->errors[] = __('Invalid Popup Message text size. Allowed 15 - 400 characters text length', GOURL);
if ($this->options["box_style"] && (in_array($this->options["box_style"][0], array("'", "\"")) || $this->options["box_style"] != preg_replace('/[^A-Za-z0-9_\-\ \.\,\:\;\!\"\'\#]/', '', $this->options["box_style"]))) $this->errors[] = __('Invalid Payment Box Style', GOURL);
if ($this->options["message_style"] && (in_array($this->options["message_style"][0], array("'", "\"")) || $this->options["message_style"] != preg_replace('/[^A-Za-z0-9_\-\ \.\,\:\;\!\"\'\#]/', '', $this->options["message_style"]))) $this->errors[] = __('Invalid Payment Messages Style', GOURL);
// upload files
if ($_FILES && $_POST && is_admin() && $this->page == GOURL.'settings')
{
foreach($this->custom_images as $k => $v)
{
$file = (isset($_FILES[GOURL.$k."2"]["name"]) && $_FILES[GOURL.$k."2"]["name"]) ? $_FILES[GOURL.$k."2"] : "";
if ($file)
{
if ($this->options[$k."url"] && file_exists(GOURL_DIR."box/".$this->options[$k.'url']) && current_user_can('administrator')) unlink(GOURL_DIR."box/".$this->options[$k.'url']);
$this->options[$k."url"] = $this->upload_file($file, "box");
}
}