Search Meter - Version 2.4

Version Description

Download this release

Release Info

Developer bennettmcelwee
Plugin Icon 128x128 Search Meter
Version 2.4
Comparing to
See all releases

Code changes from version 2.3 to 2.4

Files changed (2) hide show
  1. readme.txt +7 -7
  2. search-meter.php +58 -76
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Search Meter ===
2
  Contributors: bennettmcelwee
3
  Donate link: http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/
4
- Tags: search, statistics, widget, admin
5
  Requires at least: 1.5
6
  Tested up to: 2.7
7
- Stable tag: 2.3
8
 
9
  Search Meter tracks what your readers are searching for on your blog. View full details of recent searches or stats for the last day, week or month.
10
 
@@ -18,17 +18,17 @@ Search Meter installs easily and requires no configuration. Just install it, act
18
 
19
  = View Statistics =
20
 
21
- To see your search statistics, Log in to WordPress Admin, go to the Dashboard page and click Search Meter. You'll see the most popular searches in the last day, week and month. Click "Last 100 Searches" or "Last 500 Searches" to see lists of all recent searches.
22
 
23
  = Manage Statistics =
24
 
25
- There are a couple of management option available if you go to the Options page and click Search Meter. Use the Reset Statistics button to clear all past search statistics; Search Meter will immediately start gathering fresh statistics. If you're technically-minded, you might want to check the "Keep detailed information" checkbox to make Search Meter save technical information about every search (the information is taken from the HTTP headers).
26
 
27
  = Popular and Recent Searches =
28
 
29
  The Popular Searches widget displays a list of the most popular successful search terms on your blog during the last 30 days. The Recent Searches widget displays a simple list of the most recent successful search terms. In both cases, the search terms in the lists are hyperlinked to the actual search results; readers can click the search term to show the results for that search. Also, you can configure the maximum number of searches that each widget will display.
30
 
31
- To add these widgets to your sidebar, log in to WordPress Admin, go to the Presentation page and click Widgets. You can drag the appropriate widget to the sidebar of your choice, and click the Configure button to set the number of searches to display.
32
 
33
  Widget support depends on the version of WordPress and the theme you're using. In some cases you will not be able to use the widgets. In any case, you can always use the Search Meter template tags to display the same information. You'll need to edit your theme to use them.
34
 
@@ -51,8 +51,8 @@ Show a simple list of the 5 most recent successful search terms, hyperlinked to
51
 
52
  == Installation ==
53
 
54
- 1. Upload `search-meter.php` to the `/wp-content/plugins/` directory
55
- 1. Activate the plugin through the 'Plugins' menu in WordPress
56
 
57
  == Frequently Asked Questions ==
58
 
1
  === Search Meter ===
2
  Contributors: bennettmcelwee
3
  Donate link: http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/
4
+ Tags: search, meter, search-meter, statistics, widget, admin
5
  Requires at least: 1.5
6
  Tested up to: 2.7
7
+ Stable tag: 2.4
8
 
9
  Search Meter tracks what your readers are searching for on your blog. View full details of recent searches or stats for the last day, week or month.
10
 
18
 
19
  = View Statistics =
20
 
21
+ To see your search statistics, Log in to WordPress Admin, go to the Dashboard section and click Search Meter. You'll see the most popular searches in the last day, week and month. Click "Last 100 Searches" or "Last 500 Searches" to see lists of all recent searches.
22
 
23
  = Manage Statistics =
24
 
25
+ There are a couple of management option available if you go to the Settings section and click Search Meter. Use the Reset Statistics button to clear all past search statistics; Search Meter will immediately start gathering fresh statistics. If you're technically-minded, you might want to check the "Keep detailed information" checkbox to make Search Meter save technical information about every search (the information is taken from the HTTP headers).
26
 
27
  = Popular and Recent Searches =
28
 
29
  The Popular Searches widget displays a list of the most popular successful search terms on your blog during the last 30 days. The Recent Searches widget displays a simple list of the most recent successful search terms. In both cases, the search terms in the lists are hyperlinked to the actual search results; readers can click the search term to show the results for that search. Also, you can configure the maximum number of searches that each widget will display.
30
 
31
+ To add these widgets to your sidebar, log in to WordPress Admin, go to the Appearance section and click Widgets. You can drag the appropriate widget to the sidebar of your choice, and click the Edit button to set the number of searches to display.
32
 
33
  Widget support depends on the version of WordPress and the theme you're using. In some cases you will not be able to use the widgets. In any case, you can always use the Search Meter template tags to display the same information. You'll need to edit your theme to use them.
34
 
51
 
52
  == Installation ==
53
 
54
+ 1. Just install the plugin as usual - in WordPress 2.7 and higher you can simply upload the search-meter.zip file. For older version, unzip & upload to the /wp-content/plugins/search-meter directory
55
+ 1. Activate the plugin through the 'Plugins' section in WordPress
56
 
57
  == Frequently Asked Questions ==
58
 
search-meter.php CHANGED
@@ -2,35 +2,34 @@
2
  /*
3
  Plugin Name: Search Meter
4
  Plugin URI: http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/
5
- Description: Keeps track of what your visitors are searching for. After you have activated this plugin, you can check the <a href="index.php?page=search-meter.php">Search Meter Statistics</a> page to see what your visitors are searching for on your blog.
6
- Version: 2.3
7
  Author: Bennett McElwee
8
  Author URI: http://www.thunderguy.com/semicolon/
9
 
10
- $Revision: 109 $
11
 
12
 
13
  INSTRUCTIONS
14
 
15
  1. Copy this file into the plugins directory in your WordPress installation
16
- (wp-content/plugins).
17
- 2. Log in to WordPress administration. Go to the Plugins page and Activate
18
  this plugin.
19
 
20
  * To see search statistics, log in to WordPress Admin, go to the Dashboard
21
- page and click Search Meter.
22
- * To control search statistics, log in to WordPress Admin, go to the Options
23
- page and click Search Meter.
24
  * To display recent and popular searches, use the Recent Searches and
25
  Popular Searches widgets, or the sm_list_popular_searches() and
26
  sm_list_recent_searches() template tags.
27
  * For full details, see http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/
28
 
29
- Thanks to Kaufman (http://www.terrik.com/wordpress/) and the many others who have for valuable coding suggestions.
30
- The many other users who have offered suggestions.
31
 
32
 
33
- Copyright (C) 2005-07 Bennett McElwee (bennett at thunderguy dotcom)
34
 
35
  This program is free software; you can redistribute it and/or
36
  modify it under the terms of version 2 of the GNU General Public
@@ -191,14 +190,7 @@ function sm_list_recent_searches_control() {
191
  }
192
 
193
  function sm_constrain_widget_search_count($number) {
194
- if (!$number) {
195
- $number = 5;
196
- } else if ($number < 1) {
197
- $number = 1;
198
- } else if (100 < $number) {
199
- $number = 100;
200
- }
201
- return $number;
202
  }
203
 
204
  function tguy_sm_register_widgets() {
@@ -236,8 +228,7 @@ function tguy_sm_save_search(&$posts) {
236
  $search_terms = $search_string;
237
  $search_terms = preg_replace('/[," ]+/', ' ', $search_terms);
238
  $search_terms = trim($search_terms);
239
- // This actually only returns a maximum of the number of posts per page
240
- $hit_count = count($posts);
241
  // Other useful details of the search
242
  $details = '';
243
  $options = get_option('tguy_search_meter');
@@ -252,19 +243,19 @@ function tguy_sm_save_search(&$posts) {
252
  }
253
 
254
  // Sanitise as necessary
255
- $search_string = addslashes($search_string);
256
- $search_terms = addslashes($search_terms);
257
- $details = addslashes($details);
258
 
259
  // Save the individual search to the DB
260
  $query = "INSERT INTO `{$table_prefix}searchmeter_recent` (`terms`,`datetime`,`hits`,`details`)
261
  VALUES ('$search_string',NOW(),$hit_count,'$details')";
262
- $success = mysql_query($query);
263
  // If it failed, maybe the table was never created.
264
  // Try to create it and then try again.
265
  if (!$success) {
266
  if (tguy_sm_create_recent_table()) {
267
- $success = mysql_query($query);
268
  }
269
  }
270
  if ($success) {
@@ -279,19 +270,19 @@ function tguy_sm_save_search(&$posts) {
279
  FROM `{$table_prefix}searchmeter_recent`
280
  ORDER BY `datetime` DESC LIMIT ".TGUY_SM_HISTORY_SIZE.", 1");
281
  $query = "DELETE FROM `{$table_prefix}searchmeter_recent` WHERE `datetime` < '$dateZero'";
282
- $success = mysql_query($query);
283
  }
284
  }
285
- // Save search summary into the DB. Usually this will be a new query, so try to insert first
286
  $query = "INSERT INTO `{$table_prefix}searchmeter` (`terms`,`date`,`count`,`last_hits`)
287
  VALUES ('$search_terms',CURDATE(),1,$hit_count)";
288
- $success = mysql_query($query);
289
  if (!$success) {
290
  $query = "UPDATE `{$table_prefix}searchmeter` SET
291
  `count` = `count` + 1,
292
  `last_hits` = $hit_count
293
  WHERE `terms` = '$search_terms' AND `date` = CURDATE()";
294
- $success = mysql_query($query);
295
  // Table should always exist, so don't try to create again
296
  }
297
  }
@@ -433,7 +424,6 @@ function tguy_sm_summary_page() {
433
  echo "<!-- Search Meter: deleted $result old rows -->\n";
434
  ?>
435
  <div class="wrap">
436
- <?php if (!$is_disable_donation) { tguy_sm_show_donation_bar(); } ?>
437
 
438
  <ul id="search_meter_menu">
439
  <li class="current">Summary</li>
@@ -480,11 +470,13 @@ function tguy_sm_summary_page() {
480
  <h2>Notes</h2>
481
 
482
  <?php if (current_user_can(TGUY_SM_OPTIONS_CAPABILITY_LEVEL)) : ?>
483
- <p>To manage your search statistics, go to your <a href="<?php bloginfo('wpurl'); ?>/wp-admin/options-general.php?page=search-meter.php">Search Meter Options page</a>.</p>
484
  <?php endif; ?>
485
 
486
  <p>For information and updates, see the <a href="http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/">Search Meter home page</a>. You can also offer suggestions, request new features or report problems.</p>
487
 
 
 
488
  </div>
489
  <?php
490
  }
@@ -556,7 +548,6 @@ function tguy_sm_recent_page($max_lines, $do_show_details) {
556
  $this_url_recent_arg = '&amp;recent=' . $max_lines;
557
  ?>
558
  <div class="wrap">
559
- <?php if (!$is_disable_donation) { tguy_sm_show_donation_bar(); } ?>
560
 
561
  <ul id="search_meter_menu">
562
  <li><a href="<?php echo $this_url_base ?>">Summary</a></li>
@@ -630,11 +621,13 @@ function tguy_sm_recent_page($max_lines, $do_show_details) {
630
  <h2>Notes</h2>
631
 
632
  <?php if (current_user_can(TGUY_SM_OPTIONS_CAPABILITY_LEVEL)) : ?>
633
- <p>To manage your search statistics, go to your <a href="<?php bloginfo('wpurl'); ?>/wp-admin/options-general.php?page=search-meter.php">Search Meter Options page</a>.</p>
634
  <?php endif; ?>
635
 
636
  <p>For information and updates, see the <a href="http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/">Search Meter home page</a>. You can also offer suggestions, request new features or report problems.</p>
637
 
 
 
638
  </div>
639
  <?php
640
  }
@@ -662,7 +655,6 @@ function tguy_sm_options_page() {
662
 
663
  <h2>Search Meter Options</h2>
664
 
665
- <?php if (!$options['sm_disable_donation']) { tguy_sm_show_donation_box(); } ?>
666
  <form name="searchmeter" action="<?php echo $action_url; ?>" method="post">
667
  <?php
668
  if (function_exists('wp_nonce_field')) {
@@ -672,28 +664,31 @@ function tguy_sm_options_page() {
672
 
673
  <input type="hidden" name="submitted" value="1" />
674
 
675
- <fieldset class="options">
676
- <ul>
677
- <li>
678
- <label for="sm_details_verbose">
679
- <input type="checkbox" id="sm_details_verbose" name="sm_details_verbose" <?php echo ($options['sm_details_verbose']==true?"checked=\"checked\"":"") ?> />
680
- Keep detailed information about recent searches (taken from HTTP headers)
681
- </label>
682
- </li>
683
- <li>
684
- <label for="sm_disable_donation">
685
- <input type="checkbox" id="sm_disable_donation" name="sm_disable_donation" <?php echo ($options['sm_disable_donation']==true?"checked=\"checked\"":"") ?> />
686
- Hide the &#8220;Do you find this plugin useful?&#8221; box
687
- </label>
688
- </li>
689
- </ul>
690
- </fieldset>
 
 
 
691
  <p class="submit">
692
  <input type="submit" name="Submit" value="Save changes &raquo;" />
693
  </p>
694
  </form>
695
 
696
- <h2>Reset statistics</h2>
697
 
698
  <p>Click this button to reset all search statistics. This will delete all information about previous searches.</p>
699
 
@@ -703,49 +698,37 @@ function tguy_sm_options_page() {
703
  wp_nonce_field('search-meter-reset-stats');
704
  }
705
  ?>
706
- <p class="submit">
707
- <input type="submit" name="tguy_sm_reset" value="Reset statistics &raquo;" onclick="return confirm('You are about to delete all saved search statistics.\n \'Cancel\' to stop, \'OK\' to delete.');" />
708
  </p>
709
  </form>
710
 
711
- <h2>Notes</h2>
712
 
713
- <p>To see your search statistics, go to your <a href="<?php bloginfo('wpurl'); ?>/wp-admin/index.php?page=search-meter.php">Search Meter Statistics page</a>.</p>
714
 
715
  <p>For information and updates, see the <a href="http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/">Search Meter home page</a>. At that page, you can also offer suggestions, request new features or report problems.</p>
716
 
 
 
717
  </div>
718
  <?php
719
  }
720
 
721
- function tguy_sm_show_donation_bar() {
722
- ?>
723
- <div style="width:30%; background:#EEEEEE none repeat scroll 0%; border:1px solid #6699CC; float:right; font-size:90%; margin:0 0 -20px 0; padding:0;"><div style="margin:0; padding:0 0 0 2ex; float: right;">
724
- <?php tguy_sm_show_donation_button() ?>
725
- </div>
726
- <p style="margin:0; padding:0.5em">Do you find this plugin useful?</p>
727
-
728
- </div>
729
- <?php
730
- }
731
-
732
- function tguy_sm_show_donation_box() {
733
  ?>
734
- <div style="width:30%; background:#EEEEEE none repeat scroll 0%; border:1px solid #6699CC; float:right; font-size:90%; margin:0 0 1em 1em; padding:1em;">
735
-
736
- <div style="margin: 0; padding: 0 2ex 0.25ex 0; float: left;">
737
  <?php tguy_sm_show_donation_button() ?>
738
  </div>
739
- <p style="margin: 0; padding: 0"><strong>Do you find this plugin useful?</strong><br />
740
  I write WordPress plugins because I enjoy doing it, but it does take up a lot
741
  of my time. If you think this plugin is useful, please consider donating some appropriate
742
- amount by clicking here. Thank you.</p>
743
-
744
- </div>
745
  <?php
746
  }
747
 
748
  function tguy_sm_show_donation_button() {
 
749
  ?><form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin:0; padding:0;"
750
  ><input name="cmd" value="_s-xclick" type="hidden" style="margin:0; padding:0;"
751
  /><input src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" border="0" type="image" style="margin:0; padding:0;"
@@ -753,4 +736,3 @@ function tguy_sm_show_donation_button() {
753
  " type="hidden" style="margin:0; padding:0;"
754
  /></form><?php
755
  }
756
- ?>
2
  /*
3
  Plugin Name: Search Meter
4
  Plugin URI: http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/
5
+ Description: Keeps track of what your visitors are searching for. After you have activated this plugin, you can check the Search Meter section in the Dashboard to see what your visitors are searching for on your blog.
6
+ Version: 2.4
7
  Author: Bennett McElwee
8
  Author URI: http://www.thunderguy.com/semicolon/
9
 
10
+ $Revision: 113 $
11
 
12
 
13
  INSTRUCTIONS
14
 
15
  1. Copy this file into the plugins directory in your WordPress installation
16
+ (wp-content/plugins/search-meter/search-meter.php).
17
+ 2. Log in to WordPress administration. Go to the Plugins section and activate
18
  this plugin.
19
 
20
  * To see search statistics, log in to WordPress Admin, go to the Dashboard
21
+ section and click Search Meter.
22
+ * To control search statistics, log in to WordPress Admin, go to the Settings
23
+ section and click Search Meter.
24
  * To display recent and popular searches, use the Recent Searches and
25
  Popular Searches widgets, or the sm_list_popular_searches() and
26
  sm_list_recent_searches() template tags.
27
  * For full details, see http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/
28
 
29
+ Thanks to Kaufman (http://www.terrik.com/wordpress/) and the many others who have offered suggestions.
 
30
 
31
 
32
+ Copyright (C) 2005-09 Bennett McElwee (bennett at thunderguy dotcom)
33
 
34
  This program is free software; you can redistribute it and/or
35
  modify it under the terms of version 2 of the GNU General Public
190
  }
191
 
192
  function sm_constrain_widget_search_count($number) {
193
+ return max(1, min((int)$number, 100));
 
 
 
 
 
 
 
194
  }
195
 
196
  function tguy_sm_register_widgets() {
228
  $search_terms = $search_string;
229
  $search_terms = preg_replace('/[," ]+/', ' ', $search_terms);
230
  $search_terms = trim($search_terms);
231
+ $hit_count = $wp_query->found_posts; // Thanks to Will for this line
 
232
  // Other useful details of the search
233
  $details = '';
234
  $options = get_option('tguy_search_meter');
243
  }
244
 
245
  // Sanitise as necessary
246
+ $search_string = $wpdb->escape($search_string);
247
+ $search_terms = $wpdb->escape($search_terms);
248
+ $details = $wpdb->escape($details);
249
 
250
  // Save the individual search to the DB
251
  $query = "INSERT INTO `{$table_prefix}searchmeter_recent` (`terms`,`datetime`,`hits`,`details`)
252
  VALUES ('$search_string',NOW(),$hit_count,'$details')";
253
+ $success = $wpdb->query($query);
254
  // If it failed, maybe the table was never created.
255
  // Try to create it and then try again.
256
  if (!$success) {
257
  if (tguy_sm_create_recent_table()) {
258
+ $success = $wpdb->query($query);
259
  }
260
  }
261
  if ($success) {
270
  FROM `{$table_prefix}searchmeter_recent`
271
  ORDER BY `datetime` DESC LIMIT ".TGUY_SM_HISTORY_SIZE.", 1");
272
  $query = "DELETE FROM `{$table_prefix}searchmeter_recent` WHERE `datetime` < '$dateZero'";
273
+ $success = $wpdb->query($query);
274
  }
275
  }
276
+ // Save search summary into the DB. Usually this will be a new row, so try to insert first
277
  $query = "INSERT INTO `{$table_prefix}searchmeter` (`terms`,`date`,`count`,`last_hits`)
278
  VALUES ('$search_terms',CURDATE(),1,$hit_count)";
279
+ $success = $wpdb->query($query);
280
  if (!$success) {
281
  $query = "UPDATE `{$table_prefix}searchmeter` SET
282
  `count` = `count` + 1,
283
  `last_hits` = $hit_count
284
  WHERE `terms` = '$search_terms' AND `date` = CURDATE()";
285
+ $success = $wpdb->query($query);
286
  // Table should always exist, so don't try to create again
287
  }
288
  }
424
  echo "<!-- Search Meter: deleted $result old rows -->\n";
425
  ?>
426
  <div class="wrap">
 
427
 
428
  <ul id="search_meter_menu">
429
  <li class="current">Summary</li>
470
  <h2>Notes</h2>
471
 
472
  <?php if (current_user_can(TGUY_SM_OPTIONS_CAPABILITY_LEVEL)) : ?>
473
+ <p>To manage your search statistics, go to the <strong>Settings</strong> section and choose <strong>Search Meter</strong>.</p>
474
  <?php endif; ?>
475
 
476
  <p>For information and updates, see the <a href="http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/">Search Meter home page</a>. You can also offer suggestions, request new features or report problems.</p>
477
 
478
+ <?php if (!$options['sm_disable_donation']) { tguy_sm_show_donation_message(); } ?>
479
+
480
  </div>
481
  <?php
482
  }
548
  $this_url_recent_arg = '&amp;recent=' . $max_lines;
549
  ?>
550
  <div class="wrap">
 
551
 
552
  <ul id="search_meter_menu">
553
  <li><a href="<?php echo $this_url_base ?>">Summary</a></li>
621
  <h2>Notes</h2>
622
 
623
  <?php if (current_user_can(TGUY_SM_OPTIONS_CAPABILITY_LEVEL)) : ?>
624
+ <p>To manage your search statistics, go to the <strong>Settings</strong> section and choose <strong>Search Meter</strong>.</p>
625
  <?php endif; ?>
626
 
627
  <p>For information and updates, see the <a href="http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/">Search Meter home page</a>. You can also offer suggestions, request new features or report problems.</p>
628
 
629
+ <?php if (!$options['sm_disable_donation']) { tguy_sm_show_donation_message(); } ?>
630
+
631
  </div>
632
  <?php
633
  }
655
 
656
  <h2>Search Meter Options</h2>
657
 
 
658
  <form name="searchmeter" action="<?php echo $action_url; ?>" method="post">
659
  <?php
660
  if (function_exists('wp_nonce_field')) {
664
 
665
  <input type="hidden" name="submitted" value="1" />
666
 
667
+ <table class="form-table">
668
+ <tr>
669
+ <th class="th-full" scope="row">
670
+ <label for="sm_details_verbose">
671
+ <input type="checkbox" id="sm_details_verbose" name="sm_details_verbose" <?php echo ($options['sm_details_verbose']==true?"checked=\"checked\"":"") ?> />
672
+ Keep detailed information about recent searches (taken from HTTP headers)
673
+ </label>
674
+ </th>
675
+ </tr>
676
+ <tr>
677
+ <th class="th-full" scope="row">
678
+ <label for="sm_disable_donation">
679
+ <input type="checkbox" id="sm_disable_donation" name="sm_disable_donation" <?php echo ($options['sm_disable_donation']==true?"checked=\"checked\"":"") ?> />
680
+ Hide the &#8220;Do you find this plugin useful?&#8221; box
681
+ </label>
682
+ </th>
683
+ </tr>
684
+ </table>
685
+
686
  <p class="submit">
687
  <input type="submit" name="Submit" value="Save changes &raquo;" />
688
  </p>
689
  </form>
690
 
691
+ <h3>Reset statistics</h3>
692
 
693
  <p>Click this button to reset all search statistics. This will delete all information about previous searches.</p>
694
 
698
  wp_nonce_field('search-meter-reset-stats');
699
  }
700
  ?>
701
+ <p>
702
+ <input type="submit" name="tguy_sm_reset" value="Reset statistics &raquo;" class="button-secondary delete" onclick="return confirm('You are about to delete all saved search statistics.\n \'Cancel\' to stop, \'OK\' to delete.');" />
703
  </p>
704
  </form>
705
 
706
+ <h3>Notes</h3>
707
 
708
+ <p>To see your search statistics, go to the <strong>Dashboard</strong> and choose <strong>Search Meter</strong>.</p>
709
 
710
  <p>For information and updates, see the <a href="http://www.thunderguy.com/semicolon/wordpress/search-meter-wordpress-plugin/">Search Meter home page</a>. At that page, you can also offer suggestions, request new features or report problems.</p>
711
 
712
+ <?php if (!$options['sm_disable_donation']) { tguy_sm_show_donation_message(); } ?>
713
+
714
  </div>
715
  <?php
716
  }
717
 
718
+ function tguy_sm_show_donation_message() {
 
 
 
 
 
 
 
 
 
 
 
719
  ?>
720
+ <p><div style="margin: 0; padding: 0 2ex 0.25ex 0; float: left;">
 
 
721
  <?php tguy_sm_show_donation_button() ?>
722
  </div>
723
+ <strong>Do you find this plugin useful?</strong><br />
724
  I write WordPress plugins because I enjoy doing it, but it does take up a lot
725
  of my time. If you think this plugin is useful, please consider donating some appropriate
726
+ amount by clicking the Donate button. Thank you.</p>
 
 
727
  <?php
728
  }
729
 
730
  function tguy_sm_show_donation_button() {
731
+ // I wish PayPal offered a simple little REST-style URL instead of this monstrosity
732
  ?><form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin:0; padding:0;"
733
  ><input name="cmd" value="_s-xclick" type="hidden" style="margin:0; padding:0;"
734
  /><input src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" border="0" type="image" style="margin:0; padding:0;"
736
  " type="hidden" style="margin:0; padding:0;"
737
  /></form><?php
738
  }