Better Click To Tweet - Version 5.8.1

Version Description

  • new created a new nag for the plugins page announcing the UTM tags add-on.
  • new added a link to the main settings page for folks to check out the new UTM Tags addon.
  • bonus people who read change logs should get a discount. Use the code CHANGELOG at checkout for 10% off. http://benlikes.us/bcttaddons (good on the bundle, too!)
Download this release

Release Info

Developer ben.meredith@gmail.com
Plugin Icon 128x128 Better Click To Tweet
Version 5.8.1
Comparing to
See all releases

Code changes from version 5.8.0 to 5.8.1

admin-nags.php CHANGED
@@ -95,7 +95,8 @@ function bctt_alerts() {
95
  }
96
  }
97
 
98
- add_action( 'admin_notices', 'bctt_alerts' );
 
99
 
100
  function bctt_addon_notice_ignore() {
101
 
@@ -114,4 +115,123 @@ function bctt_addon_notice_ignore() {
114
  }
115
  }
116
 
117
- add_action( 'current_screen', 'bctt_addon_notice_ignore' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
96
  }
97
 
98
+ // Commented out in 5.8.1 to try the other new nag for a bit.
99
+ // add_action( 'admin_notices', 'bctt_alerts' );
100
 
101
  function bctt_addon_notice_ignore() {
102
 
115
  }
116
  }
117
 
118
+ // Commented out in 5.8.1 to try the other new nag for a bit.
119
+
120
+ // add_action( 'current_screen', 'bctt_addon_notice_ignore' );
121
+
122
+
123
+ function bctt_more_alerts() {
124
+ if (is_plugin_active('better-click-to-tweet-utm-tags/better-click-to-tweet-utm-tags.php')) {
125
+ return;
126
+ }
127
+
128
+ $screen = get_current_screen();
129
+
130
+ $screenparent = $screen->parent_file;
131
+
132
+
133
+ if ( $screenparent == 'plugins.php' && current_user_can( 'install_plugins' ) ) {
134
+
135
+ $user_id = wp_get_current_user()->ID;
136
+ $has_dismissed = get_user_meta( $user_id, 'bctt_has_dismissed_utm_nag', true );
137
+
138
+ if ( ! $has_dismissed && ! defined( 'BCTTUTM_VERSION' ) ) {
139
+ //add style inline so that it isn't enqueued if not used
140
+ ?>
141
+ <style>
142
+ span.bctt-more-addon-nag-header {
143
+ font-size: large;
144
+ font-weight: bold;
145
+ }
146
+
147
+ .updated.bctt-more-addon-nag {
148
+ padding: 1em;
149
+ }
150
+
151
+ p.bctt-more-addon-nag-copy {
152
+
153
+ }
154
+
155
+ ul.bctt-more-addon-nag-list {
156
+ list-style-type: none;
157
+ margin-left: 2em;
158
+ }
159
+
160
+ .bctt-more-addon-nag-list li:before {
161
+ content: "\f155";
162
+ display: inline-block;
163
+ -webkit-font-smoothing: antialiased;
164
+ font: normal 16px/1 'dashicons';
165
+ color: #46b450;
166
+ margin-right: 10px;
167
+ word-wrap: break-word;
168
+ }
169
+
170
+ .bctt-more-addon-nag-dismiss {
171
+ float: right;
172
+ text-decoration: none;
173
+ }
174
+ .bctt-nag-photo {
175
+ float: right;
176
+ margin:0;
177
+ max-height:105px;
178
+ max-width:98%;
179
+ }
180
+ @media screen and (max-width: 782px) {
181
+ .bctt-nag-photo {
182
+ float:none;
183
+ }
184
+ }
185
+ .bctt-more-nag-purchase-link {
186
+ font-size: large;
187
+ }
188
+ </style>
189
+ <div class="updated bctt-more-addon-nag">
190
+
191
+ <a href="<?php
192
+ //The Dismiss Button.
193
+ $nag_meta_key = 'bctt_has_dismissed_utm_nag';
194
+ $nag_admin_dismiss_url = 'plugins.php?' . $nag_meta_key . '=0';
195
+ echo esc_url( admin_url( $nag_admin_dismiss_url ) ); ?>" class="dismiss bctt-more-addon-nag-dismiss">Dismiss this <span
196
+ class="dashicons dashicons-dismiss"></span></a>
197
+ <h3
198
+ class="bctt-more-addon-nag-header"><?php esc_html_e( 'NEW: Track how well your Better Click To Tweets are performing!', 'better-click-to-tweet' ) ?></h3>
199
+
200
+ <a href="http://benlikes.us/bcttutmnag"
201
+ target="_blank"><img class="bctt-nag-photo" src="<?php echo esc_url( plugins_url() . '/better-click-to-tweet/assets/img/utm-tags.jpg' ); ?>"/></a>
202
+
203
+ <p class="bctt-more-addon-nag-copy"><?php esc_attr_e( 'Add UTM Codes to the URL that twitter users use to click back to your site!', 'better-click-to-tweet' ) ?></p>
204
+ <ul class="bctt-more-addon-nag-list">
205
+ <li><?php esc_html_e( 'Determine which BCTT boxes are converting best.', 'better-click-to-tweet' ) ?></li>
206
+ <li><?php esc_html_e( 'Configurable site-wide and on individual boxes.', 'better-click-to-tweet' ) ?></li>
207
+ <li><?php esc_html_e( 'Works with the block editor and with shortcodes.', 'better-click-to-tweet' ) ?></li>
208
+ </ul>
209
+ <p class="bctt-more-addon-nag-copy">
210
+ <a class="bctt-more-nag-purchase-link" href="http://benlikes.us/bcttutmnag"
211
+ target="_blank"><?php esc_html_e( 'Purchase it today', 'better-click-to-tweet' ) ?></a> <?php esc_html_e( 'Save 8% with the code NAGSareTHEbest', 'better-click-to-tweet') ?></p>
212
+ </div>
213
+ <?php
214
+ }
215
+ }
216
+ }
217
+
218
+ add_action( 'admin_notices', 'bctt_more_alerts' );
219
+
220
+ function bctt_more_addon_notice_ignore() {
221
+
222
+ /**
223
+ * If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not.
224
+ * See here: http://codex.wordpress.org/Function_Reference/add_user_meta
225
+ */
226
+
227
+ if ( isset( $_GET['bctt_has_dismissed_utm_nag'] ) && '0' == $_GET['bctt_has_dismissed_utm_nag'] ) {
228
+
229
+ //Get the global user
230
+ $current_user = wp_get_current_user();
231
+ $user_id = $current_user->ID;
232
+
233
+ add_user_meta( $user_id, 'bctt_has_dismissed_utm_nag', 'true', true );
234
+ }
235
+ }
236
+
237
+ add_action( 'current_screen', 'bctt_more_addon_notice_ignore' );
assets/img/utm-tags.jpg ADDED
Binary file
bctt_options.php CHANGED
@@ -145,18 +145,32 @@ function bctt_settings_page() {
145
  <label><?php _ex( 'Use Premium Styles?', 'label for checkbox on settings screen', 'better-click-to-tweet' ); ?></label>
146
  </th>
147
  <td><input type="checkbox" name="bctt-custom-style"
148
- value="1" <?php if ( is_plugin_active( 'better-click-to-tweet-styles/better-click-to-tweet-premium-styles.php' ) ) {
149
  echo 'checked="checked"';
150
  } else {
151
  echo 'disabled="disabled"';
152
- } ?>" /> <span
153
- style="font-size: .85em;"><em> <?php if ( ! is_plugin_active( 'better-click-to-tweet-styles/better-click-to-tweet-premium-styles.php' ) ) {
154
  echo sprintf( __( 'Want Premium styles? Add the <a href=%s>Premium Styles add-on</a> today!', 'better-click-to-tweet' ), esc_url( 'http://benlikes.us/bcttpsdirect' ) );
155
- } ?></em></span>
156
 
157
  </td>
158
  </tr>
159
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  </table>
161
  <?php do_action( 'bctt_before_settings_submit' ); ?>
162
  <br class="clear"/>
145
  <label><?php _ex( 'Use Premium Styles?', 'label for checkbox on settings screen', 'better-click-to-tweet' ); ?></label>
146
  </th>
147
  <td><input type="checkbox" name="bctt-custom-style"
148
+ value="1" style="float:left;"<?php if ( is_plugin_active( 'better-click-to-tweet-styles/better-click-to-tweet-premium-styles.php' ) ) {
149
  echo 'checked="checked"';
150
  } else {
151
  echo 'disabled="disabled"';
152
+ } ?>" /> <div
153
+ style="font-size: .85em; margin-left:3em; line-height:1.5em"><em> <?php if ( ! is_plugin_active( 'better-click-to-tweet-styles/better-click-to-tweet-premium-styles.php' ) ) {
154
  echo sprintf( __( 'Want Premium styles? Add the <a href=%s>Premium Styles add-on</a> today!', 'better-click-to-tweet' ), esc_url( 'http://benlikes.us/bcttpsdirect' ) );
155
+ } ?></em></div>
156
 
157
  </td>
158
  </tr>
159
  <?php } ?>
160
+ <?php if ( ! defined( 'BCTTUTM_VERSION' ) ) { ?>
161
+ <tr valign="top">
162
+ <th style="width:200px;">
163
+ <label><?php _ex( 'Use UTM Tags?', 'label for checkbox on settings screen', 'better-click-to-tweet' ); ?></label>
164
+ </th>
165
+ <td><input type="checkbox" name="bctt-utm-tags"
166
+ value="1" disabled="disabled" style="float:left;" /> <div
167
+ style="font-size: .85em; margin-left:3em; line-height:1.5em"><em> <?php
168
+ echo sprintf( __( 'Want add UTM tags to the return URL to track how well BCTT boxes are performing? Add the <a href=%s>UTM tags add-on</a> today!', 'better-click-to-tweet' ), esc_url( 'http://benlikes.us/bcttutmdirect' ) );
169
+ ?></em></div>
170
+
171
+ </td>
172
+ </tr>
173
+ <?php } ?>
174
  </table>
175
  <?php do_action( 'bctt_before_settings_submit' ); ?>
176
  <br class="clear"/>
better-click-to-tweet.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Better Click To Tweet
4
  * Description: Add Click to Tweet boxes simply and elegantly to your posts or pages. All the features of a premium plugin, for FREE!
5
- * Version: 5.8.0
6
  * Author: Ben Meredith
7
  * Author URI: https://www.betterclicktotweet.com
8
  * Plugin URI: https://wordpress.org/plugins/better-click-to-tweet/
@@ -12,7 +12,7 @@
12
 
13
  defined( 'ABSPATH' ) or die( "No soup for you. You leave now." );
14
 
15
- define ( 'BCTT_VERSION', '5.8.0' );
16
 
17
  include 'i18n-module.php';
18
  include 'bctt_options.php';
2
  /**
3
  * Plugin Name: Better Click To Tweet
4
  * Description: Add Click to Tweet boxes simply and elegantly to your posts or pages. All the features of a premium plugin, for FREE!
5
+ * Version: 5.8.1
6
  * Author: Ben Meredith
7
  * Author URI: https://www.betterclicktotweet.com
8
  * Plugin URI: https://wordpress.org/plugins/better-click-to-tweet/
12
 
13
  defined( 'ABSPATH' ) or die( "No soup for you. You leave now." );
14
 
15
+ define ( 'BCTT_VERSION', '5.8.1' );
16
 
17
  include 'i18n-module.php';
18
  include 'bctt_options.php';
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.wpsteward.com/donations/plugin-support/
4
  Tags: click to tweet, twitter, tweet,
5
  Requires at least: 3.8
6
  Tested up to: 5.1
7
- Stable tag: 5.8.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -97,6 +97,11 @@ Donations: http://benlikes.us/donate
97
 
98
  == Changelog ==
99
 
 
 
 
 
 
100
  = 5.8.0 =
101
  * new — adding a filter and various other enhancements to support a new UTM tags add-on
102
  * fix — testing with the newest version of the block-based editor (Gutenberg)
4
  Tags: click to tweet, twitter, tweet,
5
  Requires at least: 3.8
6
  Tested up to: 5.1
7
+ Stable tag: 5.8.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
97
 
98
  == Changelog ==
99
 
100
+ = 5.8.1 =
101
+ * new — created a new nag for the plugins page announcing the UTM tags add-on.
102
+ * new — added a link to the main settings page for folks to check out the new UTM Tags addon.
103
+ * bonus — people who read change logs should get a discount. Use the code CHANGELOG at checkout for 10% off. http://benlikes.us/bcttaddons (good on the bundle, too!)
104
+
105
  = 5.8.0 =
106
  * new — adding a filter and various other enhancements to support a new UTM tags add-on
107
  * fix — testing with the newest version of the block-based editor (Gutenberg)