Skip to content

Commit d210a3e

Browse files
committed
Initial release
1 parent e7d4ce5 commit d210a3e

9 files changed

Lines changed: 164 additions & 2 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ Official Nyzo Website: https://nyzo.co
4242

4343
Chrome extension, from official Tech website: http://tech.nyzo.co/setupInstructions/chromeBrowserExtension
4444

45-
<span style="display:none" class="nyzo-tip-button" data-client-url="https://client.nyzo.co" data-receiver-id="id__8fKFZURhpkYzQA6CkP~kivW_ospgrjJXU0tMwS3uByzcqjaVvi-I" data-tag="Sent with nyzo tip wp extension" ></span>
45+
<span style="display:none" class="nyzo-tip-button" data-client-url="https://client.nyzo.co" data-receiver-id="id__8fKFZURhpkYzQA6CkP~kivW_ospgrjJXU0tMwS3uByzcqjaVvi-I" data-tag="Sent with nyzo tip wp extension" > </span>
46+
47+
# Changelog
48+
49+
see [changelog.md](changelog.md)
4650

4751
# Licence
4852

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
4+
- 0.0.1: Initial public release

nyzo-tip/languages/todo.txt

Whitespace-only changes.

nyzo-tip/nyzo-tip.php

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?php
2+
/**
3+
* @package nyzo-tip
4+
*/
5+
/*
6+
Plugin Name: Nyzo tip button
7+
Plugin URI: https://angainor.com
8+
Description: Activate on your WordPress blog and get tips from the Nyzo Chrome extension in seconds.
9+
Version: 0.0.1
10+
Author: AngainorDev
11+
Author URI: https://angainor.com
12+
License: Unlicence
13+
Text Domain: nyzo-tip
14+
*/
15+
16+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
17+
load_plugin_textdomain('nyzo-tip', false, basename( dirname( __FILE__ ) ) . '/languages' );
18+
19+
$nyzotip_options = get_option('nyzotip_options');
20+
21+
22+
function nyzotip_install() {
23+
global $nyzotip_options;
24+
if (!get_option('nyzo_options')) {
25+
add_option('nyzo_options', array (
26+
'client_url' => 'https://client.nyzo.co',
27+
'receiver_id' => 'id__8fKFZURhpkYzQA6CkP~kivW_ospgrjJXU0tMwS3uByzcqjaVvi-I',
28+
'stealth_tip' => true
29+
));
30+
$nyzotip_options = get_option('nyzo_options');
31+
}
32+
}
33+
34+
function get_dataset(){
35+
global $nyzotip_options;
36+
return(' data-client-url="'.$nyzotip_options['client_url'].'" data-receiver-id="'.$nyzotip_options['receiver_id'].'" data-tag="Sent with nyzo tip wp extension" ');
37+
}
38+
39+
function nyzotip_wp_head(){
40+
global $nyzotip_options;
41+
if($nyzotip_options["stealth_tip"]){
42+
echo('<span style="display:none" class="nyzo-tip-button" '.get_dataset().'></span>');
43+
}
44+
echo('<style>.nyzo-extension-installed{content:url("/wp-content/plugins/nyzo-tip/nyzo-extension-installed-256.png");};</style>');
45+
}
46+
47+
add_action('wp_head', 'nyzotip_wp_head');
48+
49+
function nyzotip_shortcode($atts) {
50+
return('<img src="/wp-content/plugins/nyzo-tip/nyzo-extension-not-installed-256.png" class="nyzo-tip-button nyzo-extension-not-installed" '.get_dataset().'" data-tag="Sent with nyzo tip wp extension" style="width:120px">');
51+
}
52+
53+
add_shortcode('nyzotip', 'nyzotip_shortcode');
54+
55+
function nyzotip_options() {
56+
global $current_user;
57+
global $nyzotip_options;
58+
if (!is_admin()) {
59+
die();
60+
}
61+
if (!empty($_POST['receiver_id'])) {
62+
//check_admin_referer();
63+
$nyzotip_options['receiver_id'] = $_POST['receiver_id'];
64+
$nyzotip_options['client_url'] = $_POST['client_url'];
65+
if($_POST['stealth_tip'] == "1"){
66+
$nyzotip_options['stealth_tip'] = true;
67+
}
68+
else{
69+
$nyzotip_options['stealth_tip'] = false;
70+
}
71+
72+
update_option('nyzotip_options', $nyzotip_options);
73+
74+
echo '<div id="message" class="updated fade"><p>' . __('Changes successfully saved!', 'nyzotip') . '</p></div>' . "\n";
75+
}
76+
77+
$nyzotip_options = get_option('nyzotip_options');
78+
include ('options.tmpl.php');
79+
}
80+
81+
function nyzotip_admin_menu() {
82+
if (is_admin()) {
83+
$menu = array (
84+
'Nyzotip',
85+
'Nyzotip',
86+
8,
87+
'nyzotip/nyzo-tip.php' ,
88+
'nyzotip_options'
89+
);
90+
call_user_func_array('add_menu_page', $menu);
91+
}
92+
}
93+
94+
if (is_admin()) {
95+
register_activation_hook(__FILE__, 'nyzotip_install');
96+
add_action('admin_menu', 'nyzotip_admin_menu');
97+
}

nyzo-tip/options.tmpl.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<div class="wrap">
2+
<h2>Nyzotip config</h2>
3+
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
4+
<label for="receiver_id">Receiver id (id__ nyzostring):</label><br />
5+
<input type="text" name="receiver_id" value="<?php echo $nyzotip_options['receiver_id']; ?>" >
6+
<br>&nbsp;<br />
7+
<label for="client_url">Client url (default https://client.nyzo.co):</label><br />
8+
<input type="text" name="client_url" value="<?php echo $nyzotip_options['client_url']; ?>" >
9+
<br>&nbsp;<br />
10+
<label for="stealth_tip">Add stealth code to each page:</label><br>
11+
<label for="stealth_tip1">Yes:</label>
12+
<input type="radio" name="stealth_tip" id="stealth_tip1" value="1" <?php if($nyzotip_options['stealth_tip']){ echo checked;}; ?>>
13+
<label for="stealth_tip0">No: </label>
14+
<input type="radio" name="stealth_tip" id="stealth_tip0" value="0" <?php if(!$nyzotip_options['stealth_tip']){ echo checked;}; ?>>
15+
<br>&nbsp;<br />
16+
<button>Save</button>
17+
</form>
18+
</div>

nyzo-tip/readme.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

nyzo-tip/readme.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
=== nyzo-tip ===
2+
Contributors: angainordev
3+
Tags: nyzo, tip
4+
Donate link: https://github.com/AngainorDev/Nyzotip-plugin#donation-address
5+
Requires at least: 3.0
6+
Tested up to: 5.4.1
7+
Requires PHP: 7.0
8+
Stable tag: 0.0.1
9+
License: Unlicence
10+
License URI: https://github.com/AngainorDev/Nyzotip-plugin/raw/master/LICENSE
11+
12+
A Nyzo tip Wordpress plugin.
13+
Activate on your WordPress blog and get tips from the Nyzo Chrome extension in seconds.
14+
15+
== Description ==
16+
A Nyzo tip Wordpress plugin.
17+
Activate on your wordpress blog and get tips from the Nyzo Chrome extension in seconds.
18+
19+
Nyzo is a cryptocurrency written from scratch, with small and fast payments in mind.
20+
21+
Plugin github is https://github.com/AngainorDev/Nyzotip-plugin
22+
Official Nyzo Website: https://nyzo.co
23+
24+
Chrome extension, from official Tech website: http://tech.nyzo.co/setupInstructions/chromeBrowserExtension
25+
26+
27+
== Installation ==
28+
- Upload plugin
29+
- Activate from plugins menu
30+
- Configure your Nyzo address
31+
32+
== Frequently Asked Questions ==
33+
See https://github.com/AngainorDev/Nyzotip-plugin
34+
35+
== Screenshots ==
36+
1. https://raw.githubusercontent.com/AngainorDev/Nyzotip-plugin/master/nyzotip1.png
37+
2. https://raw.githubusercontent.com/AngainorDev/Nyzotip-plugin/master/nyzotip2.png
38+
39+
== Changelog ==
40+
https://raw.githubusercontent.com/AngainorDev/Nyzotip-plugin/master/changelog.md

nyzotip1.png

33.8 KB
Loading

nyzotip2.png

21.7 KB
Loading

0 commit comments

Comments
 (0)