Pinterest "Pin It" Button - Version 1.1.2

Version Description

  • Bug fix: Removed use of session state storing for now as it caused errors for some
Download this release

Release Info

Developer pderksen
Plugin Icon 128x128 Pinterest "Pin It" Button
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

Files changed (3) hide show
  1. pinterest-pin-it-button.php +30 -65
  2. readme.txt +4 -0
  3. uninstall.php +2 -0
pinterest-pin-it-button.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Pinterest "Pin It" Button
4
  Plugin URI: http://pinterestplugin.com/
5
  Description: Add a Pinterest "Pin It" button to your posts and pages.
6
- Version: 1.1.1
7
  Author: Phil Derksen
8
  Author URI: http://pinterestplugin.com/
9
  */
@@ -24,12 +24,6 @@
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
- //Start session if it doesn't exist
28
-
29
- if( ! session_id() ) {
30
- session_start();
31
- }
32
-
33
  //Set global variables
34
 
35
  if ( ! defined( 'PIB_PLUGIN_BASENAME' ) )
@@ -40,6 +34,7 @@ define( 'BASE_BTN_HTML', '<a href="javascript:void(0)" class="pin-it-btn" title=
40
  //Plugin install/activation
41
 
42
  function pib_install() {
 
43
  //Deactivate plugin if WP version too low
44
  if ( version_compare( get_bloginfo( 'version' ), '3.0', '<' ) ) {
45
  deactivate_plugins( basename( __FILE__ ) );
@@ -47,7 +42,7 @@ function pib_install() {
47
 
48
  //Setup default settings
49
  $pib_options = array(
50
- 'display_home_page' => 0,
51
  'display_front_page' => 0,
52
  'display_posts' => 1,
53
  'display_pages' => 1,
@@ -61,40 +56,10 @@ function pib_install() {
61
 
62
  //Save default option values
63
  update_option( 'pib_options', $pib_options );
64
-
65
- //Set session variable to display admin notice
66
- $_SESSION['msg'] = 1;
67
  }
68
 
69
  register_activation_hook( __FILE__, 'pib_install' );
70
 
71
- //Display admin notice to proceed to options
72
-
73
- function pib_plugin_activate_notice() {
74
- //Add message to only Plugin Page
75
- global $current_screen;
76
-
77
- if ( $current_screen -> parent_base == 'plugins' ) {
78
- if( $_SESSION['msg'] == 1 ) {
79
- echo '<div class="updated"><p>' .
80
- sprintf( __( '<a href="%1$s" class="activate-notice-link">Update Your "Pin It" Button Settings</a>' ),
81
- 'admin.php?page=' . PIB_PLUGIN_BASENAME ) .
82
- '</p></div>';
83
- }
84
- }
85
- }
86
-
87
- add_action('admin_notices', 'pib_plugin_activate_notice');
88
-
89
- //Destroy session variable when navigate to other page
90
-
91
- function pib_session_destroy() {
92
- if ( $current_screen->parent_base != 'plugins' ) {
93
- session_destroy();
94
- }
95
- }
96
-
97
- add_action('admin_menu', 'pib_session_destroy');
98
 
99
  /********************
100
  Public-Only Functions
@@ -168,7 +133,7 @@ function pib_render_btn( $content ) {
168
  $content .= pib_button_html();
169
  }
170
  }
171
-
172
  return $content;
173
  }
174
 
@@ -377,31 +342,31 @@ function pib_create_settings_page() {
377
 
378
  <div class="pib-right-column postbox-container">
379
  <div class="meta-box-sortables ui-sortable">
380
- <div id="email-signup">
381
- <h4>Like This Plugin?</h4>
382
-
383
- <p class="large-text">
384
- Join the mailing list to be notified when new features are released.
385
- </p>
386
-
387
- <!-- Begin MailChimp Signup Form -->
388
- <div id="mc_embed_signup">
389
- <form action="http://pinterestplugin.us1.list-manage.com/subscribe/post?u=bfa8cc8ba2614b0796d33a238&amp;id=80e1043ae4" method="post"
390
- id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
391
-
392
- <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
393
-
394
- <div class="clear">
395
- <input type="submit" value="Sign Up!" name="subscribe" id="mc-embedded-subscribe" class="awesome large red">
396
- </div>
397
- </form>
398
- </div>
399
- <!--End mc_embed_signup-->
400
-
401
- <p>
402
- No spam. Unsubscribe anytime.
403
- </p>
404
- </div>
405
 
406
  <div id="other-links" class="postbox pib-postbox">
407
  <div class="handlediv" title="Click to toggle"><br /></div>
@@ -474,4 +439,4 @@ function pib_plugin_action_links( $links, $file ) {
474
 
475
  add_filter( 'plugin_action_links', 'pib_plugin_action_links', 10, 2 );
476
 
477
- ?>
3
  Plugin Name: Pinterest "Pin It" Button
4
  Plugin URI: http://pinterestplugin.com/
5
  Description: Add a Pinterest "Pin It" button to your posts and pages.
6
+ Version: 1.1.2
7
  Author: Phil Derksen
8
  Author URI: http://pinterestplugin.com/
9
  */
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
 
 
 
 
 
 
27
  //Set global variables
28
 
29
  if ( ! defined( 'PIB_PLUGIN_BASENAME' ) )
34
  //Plugin install/activation
35
 
36
  function pib_install() {
37
+
38
  //Deactivate plugin if WP version too low
39
  if ( version_compare( get_bloginfo( 'version' ), '3.0', '<' ) ) {
40
  deactivate_plugins( basename( __FILE__ ) );
42
 
43
  //Setup default settings
44
  $pib_options = array(
45
+ 'display_home_page' => 1,
46
  'display_front_page' => 0,
47
  'display_posts' => 1,
48
  'display_pages' => 1,
56
 
57
  //Save default option values
58
  update_option( 'pib_options', $pib_options );
 
 
 
59
  }
60
 
61
  register_activation_hook( __FILE__, 'pib_install' );
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
  /********************
65
  Public-Only Functions
133
  $content .= pib_button_html();
134
  }
135
  }
136
+
137
  return $content;
138
  }
139
 
342
 
343
  <div class="pib-right-column postbox-container">
344
  <div class="meta-box-sortables ui-sortable">
345
+ <div id="email-signup">
346
+ <h4>Like This Plugin?</h4>
347
+
348
+ <p class="large-text">
349
+ Join the mailing list to be notified when new features are released.
350
+ </p>
351
+
352
+ <!-- Begin MailChimp Signup Form -->
353
+ <div id="mc_embed_signup">
354
+ <form action="http://pinterestplugin.us1.list-manage.com/subscribe/post?u=bfa8cc8ba2614b0796d33a238&amp;id=80e1043ae4" method="post"
355
+ id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
356
+
357
+ <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
358
+
359
+ <div class="clear">
360
+ <input type="submit" value="Sign Up!" name="subscribe" id="mc-embedded-subscribe" class="awesome large red">
361
+ </div>
362
+ </form>
363
+ </div>
364
+ <!--End mc_embed_signup-->
365
+
366
+ <p>
367
+ No spam. Unsubscribe anytime.
368
+ </p>
369
+ </div>
370
 
371
  <div id="other-links" class="postbox pib-postbox">
372
  <div class="handlediv" title="Click to toggle"><br /></div>
439
 
440
  add_filter( 'plugin_action_links', 'pib_plugin_action_links', 10, 2 );
441
 
442
+ ?>
readme.txt CHANGED
@@ -63,6 +63,10 @@ Alertnatively, you can download this plugin, unzip the contents, then FTP upload
63
 
64
  == Changelog ==
65
 
 
 
 
 
66
  = 1.1.1 =
67
 
68
  * Updated jQuery coding method to avoid JavaScript conflicts with other plugins and themes some were getting
63
 
64
  == Changelog ==
65
 
66
+ = 1.1.2 =
67
+
68
+ * Bug fix: Removed use of session state storing for now as it caused errors for some
69
+
70
  = 1.1.1 =
71
 
72
  * Updated jQuery coding method to avoid JavaScript conflicts with other plugins and themes some were getting
uninstall.php CHANGED
@@ -4,6 +4,8 @@ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
  exit;
5
  }
6
 
 
 
7
  //Remove option records from options table
8
  delete_option( 'pib_options' );
9
 
4
  exit;
5
  }
6
 
7
+ //Note this will run on manual deactivate, but should not run when upgrading/overwriting plugin
8
+
9
  //Remove option records from options table
10
  delete_option( 'pib_options' );
11