Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handles feedback from wordpress plugin submission team (Tested on WordPress 4.4) #4

Merged
merged 6 commits into from
Jan 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sftp-config.json
wordpress/sftp-config.json
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# [Updated 1/1/2016 - Install a2b directly from Wordpress Plugin Directory](https://wordpress.org/plugins/block-ads-to-bitcoin/)

# <a href="https://github.com/owocki/adblock-to-bitcoin/blob/master/wordpress-plugin"> Updated 12/19/2015 -- Wordpress Plugin Released</a>

# <a href="http://owocki.com/adblock-to-bitcoin-publishers-wanted/"> Updated 12/10/2015 -- Publishers Wanted</a>
Expand All @@ -8,6 +10,10 @@

A project that turns ads into bitcoin donation solicitations when adblockers are enabled. Turns

# Install

[Install directly from Wordpress Plugin Directory](https://wordpress.org/plugins/block-ads-to-bitcoin/)

#### Example 1

<img src='http://bits.owocki.com/2u1K1Z0R3w0k/Image%202015-12-09%20at%207.31.49%20AM.png' />
Expand Down
Binary file added wordpress-plugin.zip
Binary file not shown.
Binary file modified wordpress-plugin/.DS_Store
Binary file not shown.
9 changes: 6 additions & 3 deletions wordpress-plugin/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<img src="http://bits.owocki.com/0Y1M132D0O2o/adblock-to-bitcoin.png" >

# adblock-to-bitcoin wordpress plug
# Block Ads to Bitcoin wordpress plug

# What

Implements [adblock-to-bitcoin](https://github.com/owocki/adblock-to-bitcoin) natively on a wordpress blog.

# Install

[Install directly from Wordpress Plugin Directory](https://wordpress.org/plugins/block-ads-to-bitcoin/)

# Download

Download plugin [here](http://bits.owocki.com/0i451Y1n1V1J/wordpress-plugin.zip).

# How

1. Install/Activate the plugin.
1. In your WP Admin, navigate to _Settings > adblock-to-bitcoin _.
1. In your WP Admin, navigate to _Settings > Block Ads to Bitcoin _.
1. Update your bitcoin address, and any other settings you may care to modify (copy, suggested donation amount, etc).
1. Don't have a bitcoin address? Create an account with coinbase, <a href="https://support.coinbase.com/customer/portal/articles/1027432-where-is-my-wallet-address-">and get one here</a>.
1. Add code to your templates whereever you'd like the plugin to display a bitcoin solicitation:
Expand Down
24 changes: 7 additions & 17 deletions wordpress-plugin/adblock-to-bitcoin.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Plugin Name: Adblock to Bitcoin
* Plugin URI: https://github.com/owocki/adblock-to-bitcoin
* Description: A simple way of turning ads into bitcoin donation solicitations when adblock is enabled. IMPORTANT: Set your bitcoin address in Settings > adblock-to-bitcoin.
* Version: 0.1
* Plugin Name: Block Ads to Bitcoin
* Plugin URI: https://github.com/owocki/adblock-to-bitcoin/tree/master/wordpress-plugin
* Description: A simple way of turning ads into bitcoin donation solicitations when adblock is enabled. IMPORTANT: Set your bitcoin address in Settings > Block Ads to Bitcoin.
* Version: 0.2
* Author: owocki
* Author URI: http://owocki.com
*
Expand All @@ -19,25 +19,15 @@
require_once plugin_dir_path( __FILE__ ) . "helpers.php";
require_once plugin_dir_path( __FILE__ ) . "settings.php";

function a2b_add_header() {
global $post;
if (!isset($post)) return;
echo "<!-- start adblock-to-bitcoin -->";
echo get_css();
echo "<!-- end adblock-to-bitcoin -->";
}

function a2b_add_script_footer() {
global $post;
if (!isset($post)) return;

echo "<!-- start adblock-to-bitcoin -->";
echo get_js();
echo get_bitcoin_address_template();
echo "<!-- end adblock-to-bitcoin -->";
echo a2b_get_bitcoin_address_template();
}
add_action('wp_head', 'a2b_add_header');
add_action('wp_footer', 'a2b_add_script_footer');

add_action( 'wp_enqueue_scripts', 'a2b_queue_css' );
add_action( 'wp_enqueue_scripts', 'a2b_queue_js' );

?>
71 changes: 37 additions & 34 deletions wordpress-plugin/helpers.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php


function get_bitcoin_address(){
function a2b_get_bitcoin_address(){
$options = get_option( 'a2b_option_group' );
$address = $options['bitcoin_address'];
if(!$address){
$address = '1A3KJ7f3YAS9jvhPjotLEzEMd1dNKZ9EPE';
$address = '<replace-with-wp-authors-bitcoin-address>';
}
return $address;
}

function get_suggested_donation_amount(){
function a2b_get_suggested_donation_amount(){
$options = get_option( 'a2b_option_group' );
$suggested_donation_amount = $options['suggested_donation_amount'];
if(!$suggested_donation_amount){
Expand All @@ -19,55 +19,58 @@ function get_suggested_donation_amount(){
return $suggested_donation_amount;
}

function get_default_copy($sol_size=False){
$suggested_donation_amount = get_suggested_donation_amount();
function a2b_get_default_copy($sol_size=False){
$suggested_donation_amount = a2b_get_suggested_donation_amount();
$copy = 'Hey there! You have an <strong>ad blocker enabled</strong>. <span class="sitename">'.get_bloginfo('name').'</span> supports your right to do so, but would you consider supporting our costs via a <span class="smallbitcoin">small bitcoin donation?</span>
Suggested donation: $'.$suggested_donation_amount.' .';
return $copy;
}


function get_copy($sol_size){
function a2b_get_copy($sol_size){
$options = get_option( 'a2b_option_group' );
$copy = $options['copy'];
if(!$copy){
$copy=get_default_copy($sol_size);
$copy=a2b_get_default_copy($sol_size);
}
return $copy;
}


function should_display_even_if_adblock_is_off(){
function a2b_should_display_even_if_adblock_is_off(){
$options = get_option( 'a2b_option_group' );
return (bool)$options['display_always'];
}

function a2b_display_powered_by(){
$options = get_option( 'a2b_option_group' );
return (bool)$options['powered_by'];
}


function get_plugin_staticfiles_url(){
return get_site_url().'/wp-content/plugins/adblock-to-bitcoin/static/';
function a2b_get_plugin_staticfiles_url(){
return plugin_dir_url( __FILE__ ).'static/' ;
}


function get_js(){
return '
'.(should_display_even_if_adblock_is_off()? '<script type="text/javascript">document.always_show_bitcoin_solicitations=1;</script>':'').'
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="'.get_plugin_staticfiles_url().'bitcoinaddress.js/dist/demo.js"></script>
<script src="'.get_plugin_staticfiles_url().'FuckAdBlock/fuckadblock.js"></script>
<script src="'.get_plugin_staticfiles_url().'adblock-to-bitcoin.js"></script>
';
function a2b_queue_js(){
if(a2b_should_display_even_if_adblock_is_off()){
wp_enqueue_script( 'always_show', a2b_get_plugin_staticfiles_url().'shared/alwaysshow.js' );
}

wp_enqueue_script( 'always_show', a2b_get_plugin_staticfiles_url().'shared/alwaysshow.js' );
wp_enqueue_script( 'bitcoinaddress', a2b_get_plugin_staticfiles_url().'bitcoinaddress.js/dist/demo.js' );
wp_enqueue_script( 'fuckadblock', a2b_get_plugin_staticfiles_url().'FuckAdBlock/fuckadblock.js' );
wp_enqueue_script( 'bootstrap', a2b_get_plugin_staticfiles_url().'shared/bootstrap.min.js' );
wp_enqueue_script( 'a2b', a2b_get_plugin_staticfiles_url().'adblock-to-bitcoin.js' );
}

function get_css(){
return '
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href="'.get_plugin_staticfiles_url().'adblock-to-bitcoin.css" rel="stylesheet">
';

function a2b_queue_css(){
wp_enqueue_style('font-awesome',a2b_get_plugin_staticfiles_url().'shared/font-awesome.css');
wp_enqueue_style('a2b',a2b_get_plugin_staticfiles_url().'adblock-to-bitcoin.css');
}

function get_bitcoin_address_template(){
function a2b_get_bitcoin_address_template(){
return '
<!-- Use HTML5 templates when they are more widespread http://www.html5rocks.com/en/tutorials/webcomponents/template/ -->
<div id="bitcoin-address-template" class="bitcoin-address-container" hidden>
Expand Down Expand Up @@ -114,35 +117,35 @@ function get_bitcoin_address_template(){
';
}

function get_bitcion_solicitation($sol_size='leaderboard'){
$suggested_donation_amount = get_suggested_donation_amount();
$bitcoin_address = get_bitcoin_address();
$copy = get_copy($sol_size);
function a2b_get_bitcion_solicitation($sol_size='leaderboard'){
$suggested_donation_amount = a2b_get_suggested_donation_amount();
$bitcoin_address = a2b_get_bitcoin_address();
$copy = a2b_get_copy($sol_size);
return '
<div class="bitcoin_solicitation '.$sol_size.'">
<p>'.$copy.'
<span class="hidden" id="donation-usd" data-usd-amount="'.$suggested_donation_amount.'" >$'.$suggested_donation_amount.'</span>
<p class="text-center">
<strong class="bitcoin-address" data-bc-address="'.$bitcoin_address.'">'.$bitcoin_address.'</strong>
<span class="poweredby"> (powered by <a href="https://github.com/owocki/adblock-to-bitcoin">adblock-to-bitcoin</a>)</span>
' . (a2b_display_powered_by() ? '<span class="poweredby"> (powered by <a href="https://github.com/owocki/adblock-to-bitcoin">adblock-to-bitcoin</a>)</span>' : '') .'
</p>
</div>
';
}

function a2b_leaderboard(){
return get_bitcion_solicitation('leaderboard');
return a2b_get_bitcion_solicitation('leaderboard');
}

function a2b_large_rectangle(){
return get_bitcion_solicitation('large-rectangle');
return a2b_get_bitcion_solicitation('large-rectangle');
}

function a2b_mobile_banner(){
return get_bitcion_solicitation('mobile-banner');
return a2b_get_bitcion_solicitation('mobile-banner');
}
function a2b_large_skyscraper(){
return get_bitcion_solicitation('large-skyscraper');
return a2b_get_bitcion_solicitation('large-skyscraper');
}

?>
13 changes: 8 additions & 5 deletions wordpress-plugin/readme.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
=== Plugin Name ===
Contributors: owocki
Donate link: http://github.com/owocki
Tags: adblock, bitcoin, monetization
Tags: blocked ads, adblock, bitcoin, monetization
Requires at least: 4.4
Tested up to: 4.4
Stable tag: 4.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

adblock-to-bitcoin is a wordpress blocks that allows publishers to monetize unused adspace when adblockers are on.
Block Ads to Bitcoin is a wordpress blocks that allows publishers to monetize unused adspace when adblockers are on.

== Description ==

adblock-to-bitcoin is a wordpress blocks that allows publishers to monetize unused adspace when adblockers are on. It turns ads into bitcoin donation solicitations when adblockers are enabled.
Block Ads to Bitcoin is a wordpress blocks that allows publishers to monetize unused adspace when adblockers are on. It turns ads into bitcoin donation solicitations when adblockers are enabled.

* Supports 4 ad sizes natively
* Allows customized suggested donation amounts.
Expand All @@ -23,7 +23,7 @@ adblock-to-bitcoin is a wordpress blocks that allows publishers to monetize unus


1. Install/Activate the plugin.
2. In your WP Admin, navigate to _Settings > adblock-to-bitcoin _.
2. In your WP Admin, navigate to _Settings > Block Ads to Bitcoin _.
3. Update your bitcoin address, and any other settings you may care to modify (copy, suggested donation amount, etc).
1. Don't have a bitcoin address? Create an account with coinbase and get one here: https://support.coinbase.com/customer/portal/articles/1027432-where-is-my-wallet-address-.
4. Add code to your templates whereever you'd like the plugin to display a bitcoin solicitation:
Expand Down Expand Up @@ -53,7 +53,7 @@ adblock-to-bitcoin is a wordpress blocks that allows publishers to monetize unus

== Frequently Asked Questions ==

= How much can I expect to monetize with adblock-to-bitcoin? =
= How much can I expect to monetize with Block Ads to Bitcoin? =

I've seen CPMs of over $2. More details here => http://owocki.com/adblock-to-bitcoin-2-dollar-cpms-via-micropayments/

Expand All @@ -65,6 +65,9 @@ I've seen CPMs of over $2. More details here => http://owocki.com/adblock-to-bi

== Changelog ==

= 0.2 =
* Wordpress submission guideilnes https://github.com/owocki/adblock-to-bitcoin/pull/4/files

= 0.1 =
* Plugin MVP

Expand Down