Footer Putter - Version 1.6

Version Description

Add option to include email address in the copyright footer widget, remove the automatic adding of rel=nofollow in footer links, and add optional sub-footer sections to the privacy and terms pages

Download this release

Release Info

Developer powerblogservice
Plugin Icon 128x128 Footer Putter
Version 1.6
Comparing to
See all releases

Code changes from version 1.5 to 1.6

classes/admin.php CHANGED
@@ -68,32 +68,28 @@ The plugins define two widgets:
68
  <li>a <b>Footer Copyright Widget</b> that places a line at the foot of your site containing as many of the items listed above that you want to disclose.</li>
69
  <li>a <b>Trademarks Widget</b> that displays a line of trademarks that you have previously set up as "Links".
70
  </ol>
71
- <p>All footer links are rel=nofollow in line with best SEO recommendations.</p>
72
  <p>Typically you will drag both widgets into the Custom Footer Widget Area.</p>
73
- <p>Your footer will look something like this:</p>
74
- <img src="{$screenshot}" alt="Screenshot of Footer Credits Widget Area" />
75
 
76
- <h2>Instructions For WP Whoosh Users</h2>
77
- <p>If you have <a href="http://www.wpwhoosh.com/">whooshed</a> this site then all you need to do is replace the sample trademarks with the real trademarks.
78
-
79
- <h2>Instructions For Other Users</h2>
80
  <ol>
81
- <li>Create a <i>Privacy Policy</i> page with no sidebar and set robots meta as noindex, noarchive.</li>
82
- <li>Create a <i>Terms of Use</i> page with no sidebar and set robots meta as noindex, noarchive.</li>
83
  <li>Create a <i>Contact</i> page with a contact form.</li>
84
- <li>Create a WordPress menu <i>Footer Menu</i> with the above 3 pages.</li>
85
- <li>Go to <a href="{$footer_url}">Footer Credits</a> and update the Site Owner details and set the Footer Hook according to your choice of WordPress theme.</li>
 
 
86
  <li>Drag a <i>Footer Copyright Widget</i> into the <i>Custom Footer Widget Area</i> and select the <i>Footer Menu</i> and optional text if you want to have a "Return To Top" link</li>
87
  <li>Add a link for each of your trademarks and put each in a <i>Trademarks</i> link category - you can call this link category as you like</li>
88
  <li>Drag a Trademarks widget into the Custom Footer Widget and choose your <i>Trademarks</i> link category</li>
 
89
  </ol>
90
 
91
  <h3>Footer Hook</h3>
92
-
93
  <p>The footer hook is only required if your theme does not already have a footer widget area into which you can drag the two widgets.</p>
94
-
95
  <p>For some themes, the footer hook is left blank, for others use a WordPress hook such as <i>get_footer</i> or <i>wp_footer</i>,
96
- or use a theme-specific hook such as <i>twentyten_credits</i>, <i>twentyeleven_credits</i>, <i>twentytwelve_credits</i>, <i>genesis_footer</i>, <i>pagelines_leaf</i>, etc</p>
 
97
 
98
  <h3>Getting Help</h3>
99
  <p>Check out the <a href="{$home_url}">Footer Putter Plugin page</a> for more information about the plugin.</p>
68
  <li>a <b>Footer Copyright Widget</b> that places a line at the foot of your site containing as many of the items listed above that you want to disclose.</li>
69
  <li>a <b>Trademarks Widget</b> that displays a line of trademarks that you have previously set up as "Links".
70
  </ol>
 
71
  <p>Typically you will drag both widgets into the Custom Footer Widget Area.</p>
 
 
72
 
73
+ <h2>Instructions For Building A Footer</h2>
 
 
 
74
  <ol>
75
+ <li>Create a <i>Privacy Policy</i> page with the slug/permalink <em>privacy</em>, choose a page template with no sidebar.</li>
76
+ <li>Create a <i>Terms of Use</i> page with the slug/permalink <em>terms</em>, choose a page template with no sidebar.</li>
77
  <li>Create a <i>Contact</i> page with a contact form.</li>
78
+ <li>Create an <i>About</i> page, with information either about the site or about its owner.</li>
79
+ <li>If the site is selling an information product you may want to create a <i>Disclaimer</i> page, regarding any claims about the product performance.</li>
80
+ <li>Create a WordPress menu called <i>Footer Menu</i> with the above pages.</li>
81
+ <li>Go to <a href="{$footer_url}">Footer Credits</a> and update the Site Owner details, contact and legal information.</li>
82
  <li>Drag a <i>Footer Copyright Widget</i> into the <i>Custom Footer Widget Area</i> and select the <i>Footer Menu</i> and optional text if you want to have a "Return To Top" link</li>
83
  <li>Add a link for each of your trademarks and put each in a <i>Trademarks</i> link category - you can call this link category as you like</li>
84
  <li>Drag a Trademarks widget into the Custom Footer Widget and choose your <i>Trademarks</i> link category</li>
85
+ <li>Review the footer of the site. You may want to change font and background colors which you can set in the widget controls, or make adjustments using the Footer hook as described below.</li>
86
  </ol>
87
 
88
  <h3>Footer Hook</h3>
 
89
  <p>The footer hook is only required if your theme does not already have a footer widget area into which you can drag the two widgets.</p>
 
90
  <p>For some themes, the footer hook is left blank, for others use a WordPress hook such as <i>get_footer</i> or <i>wp_footer</i>,
91
+ or use a theme-specific hook such as <i>twentyten_credits</i>, <i>twentyeleven_credits</i>, <i>twentytwelve_credits</i>,
92
+ <i>twentythirteen_credits</i>, <i>genesis_footer</i>, <i>pagelines_leaf</i>, etc</p>
93
 
94
  <h3>Getting Help</h3>
95
  <p>Check out the <a href="{$home_url}">Footer Putter Plugin page</a> for more information about the plugin.</p>
classes/footer-credits-admin.php CHANGED
@@ -9,15 +9,13 @@ class FooterCreditsAdmin {
9
  private static $parenthook;
10
  private static $slug;
11
  private static $screen_id;
12
- private static $keys = array('owner', 'site', 'address', 'country', 'telephone',
13
- 'email', 'courts', 'updated', 'copyright_start_year', 'return_text', 'return_class',
14
- 'footer_class','footer_hook','footer_remove','footer_filter_hook','enable_html5');
15
  private static $tips = array(
16
  'owner' => array('heading' => 'Owner or Business Name', 'tip' => 'Enter the name of the legal entity that owns and operates the site.'),
17
  'address' => array('heading' => 'Full Address', 'tip' => 'Enter the full address that you want to appear in the footer and the privacy and terms pages.'),
18
  'country' => array('heading' => 'Country', 'tip' => 'Enter the country where the legal entity is domiciled.'),
19
  'telephone' => array('heading' => 'Telephone Number', 'tip' => 'Enter a telephone number here if you want it to appear in the footer of the installed site.'),
20
- 'email' => array('heading' => 'Email Address', 'tip' => 'Enter the email address here if you want it to appear in the privacy statement.'),
21
  'courts' => array('heading' => 'Legal Jurisdiction' , 'tip' => 'The Courts that have jurisdiction over any legal disputes regarding this site. For example: <i>the state and federal courts in Santa Clara County, California</i>, or <i>the Law Courts of England and Wales</i>'),
22
  'updated' => array('heading' => 'Last Updated' , 'tip' => 'This will be defaulted as today. For example, Oct 23rd, 2012'),
23
  'copyright_start_year' => array('heading' => 'Copyright Start' , 'tip' => 'The start year of the business appears in the copyright statement in the footer and an on the Terms and Conditions page.'),
@@ -27,14 +25,16 @@ class FooterCreditsAdmin {
27
  'footer_hook' => array('heading' => 'Footer Action Hook' , 'tip' => 'The hook where the footer widget area is added to the page. This field is only required if the theme does not already provide a suitable widget area where the footer widgets can be added.'),
28
  'footer_remove' => array('heading' => 'Remove Existing Actions?' , 'tip' => 'Click the checkbox to remove any other actions at the above footer hook. This may stop you getting two footers; one created by your theme and another created by this plugin. For some themes you will check this option as you will typically want to replace the theme footer by the plugin footer.'),
29
  'footer_filter_hook' => array('heading' => 'Footer Filter Hook' , 'tip' => 'If you want to kill off the footer created by your theme, and your theme allows you to filter the content of the footer, then enter the hook where the theme filters the footer. This may stop you getting two footers; one created by your theme and another created by this plugin.'),
30
- 'enable_html5' => array('heading' => 'Enable HTML5' , 'tip' => 'Use the HTML5 &lt;footer&gt; element for the custom footer widget area.')
 
 
31
  );
32
  private static $tooltips;
33
 
34
  public static function init($parent) {
35
  self::$version = FooterCredits::VERSION;
36
  self::$parenthook = $parent;
37
- self::$slug = self::$parenthook . '-' . self::SLUG;
38
  add_action('admin_menu',array(self::CLASSNAME, 'admin_menu'));
39
  }
40
 
@@ -89,6 +89,7 @@ class FooterCreditsAdmin {
89
  add_meta_box(self::CODE.'-advanced', __('Advanced',self::DOMAIN), array(self::CLASSNAME, 'advanced_panel'), self::get_screen_id(), 'normal', 'core', $callback_params);
90
  add_action('admin_enqueue_scripts', array(self::CLASSNAME, 'enqueue_styles'));
91
  add_action('admin_enqueue_scripts',array(self::CLASSNAME, 'enqueue_scripts'));
 
92
  self::$tooltips = new DIYTooltip(self::$tips);
93
  }
94
 
@@ -163,10 +164,13 @@ INTRO_PANEL;
163
  $tip1 = self::$tooltips->tip('owner');
164
  $tip2 = self::$tooltips->tip('address');
165
  $tip3 = self::$tooltips->tip('country');
 
 
166
  print <<< OWNER_PANEL
167
  <label>{$tip1}</label><input type="text" name="owner" size="25" value="{$terms['owner']}" /><br/>
168
  <label>{$tip2}</label><input type="text" name="address" size="80" value="{$terms['address']}" /><br/>
169
  <label>{$tip3}</label><input type="text" name="country" size="25" value="{$terms['country']}" /><br/>
 
170
  OWNER_PANEL;
171
  }
172
 
@@ -185,10 +189,13 @@ CONTACT_PANEL;
185
  $tip1 = self::$tooltips->tip('courts');
186
  $tip2 = self::$tooltips->tip('updated');
187
  $tip3 = self::$tooltips->tip('copyright_start_year');
 
 
188
  print <<< LEGAL_PANEL
189
  <label>{$tip1}</label><input type="text" name="courts" size="80" value="{$terms['courts']}" /><br/>
190
  <label>{$tip2}</label><input type="text" name="updated" size="20" value="{$terms['updated']}" /><br/>
191
  <label>{$tip3}</label><input type="text" name="copyright_start_year" size="5" value="{$terms['copyright_start_year']}" /><br/>
 
192
  LEGAL_PANEL;
193
  }
194
 
@@ -218,7 +225,7 @@ RETURN_PANEL;
218
  <p>You can place the Copyright and Trademark widgets in any existing widget area. However, if your theme does not have a suitably located widget area in the footer then you can create one by specifying the hook
219
  where the Widget Area will be located.</p>
220
  <p>You may use a standard WordPress hook like <i>get_footer</i> or <i>wp_footer</i> or choose a hook that is theme-specific such as <i>twentyten_credits</i>,
221
- <i>twentyeleven_credits</i> or <i>twentytwelve_credits</i>. If you using a Genesis child theme and the theme does not have a suitable widget area then use
222
  the hook <i>genesis_footer</i> or maybe <i>genesis_after</i>. See what looks best. Click for <a href="{$url}">suggestions of which hook to use for common WordPress themes</a>.</p>
223
  <label>{$tip1}</label><input type="text" name="footer_hook" size="30" value="{$options['footer_hook']}" /><br/>
224
  <label>{$tip2}</label><input type="checkbox" name="footer_remove" {$footer_remove}value="1" /><br/>
9
  private static $parenthook;
10
  private static $slug;
11
  private static $screen_id;
12
+ private static $keys;
 
 
13
  private static $tips = array(
14
  'owner' => array('heading' => 'Owner or Business Name', 'tip' => 'Enter the name of the legal entity that owns and operates the site.'),
15
  'address' => array('heading' => 'Full Address', 'tip' => 'Enter the full address that you want to appear in the footer and the privacy and terms pages.'),
16
  'country' => array('heading' => 'Country', 'tip' => 'Enter the country where the legal entity is domiciled.'),
17
  'telephone' => array('heading' => 'Telephone Number', 'tip' => 'Enter a telephone number here if you want it to appear in the footer of the installed site.'),
18
+ 'email' => array('heading' => 'Email Address', 'tip' => 'Enter the email address here if you want it to appear in the footer and in the privacy statement.'),
19
  'courts' => array('heading' => 'Legal Jurisdiction' , 'tip' => 'The Courts that have jurisdiction over any legal disputes regarding this site. For example: <i>the state and federal courts in Santa Clara County, California</i>, or <i>the Law Courts of England and Wales</i>'),
20
  'updated' => array('heading' => 'Last Updated' , 'tip' => 'This will be defaulted as today. For example, Oct 23rd, 2012'),
21
  'copyright_start_year' => array('heading' => 'Copyright Start' , 'tip' => 'The start year of the business appears in the copyright statement in the footer and an on the Terms and Conditions page.'),
25
  'footer_hook' => array('heading' => 'Footer Action Hook' , 'tip' => 'The hook where the footer widget area is added to the page. This field is only required if the theme does not already provide a suitable widget area where the footer widgets can be added.'),
26
  'footer_remove' => array('heading' => 'Remove Existing Actions?' , 'tip' => 'Click the checkbox to remove any other actions at the above footer hook. This may stop you getting two footers; one created by your theme and another created by this plugin. For some themes you will check this option as you will typically want to replace the theme footer by the plugin footer.'),
27
  'footer_filter_hook' => array('heading' => 'Footer Filter Hook' , 'tip' => 'If you want to kill off the footer created by your theme, and your theme allows you to filter the content of the footer, then enter the hook where the theme filters the footer. This may stop you getting two footers; one created by your theme and another created by this plugin.'),
28
+ 'enable_html5' => array('heading' => 'Enable HTML5' , 'tip' => 'Use the HTML5 &lt;footer&gt; element for the custom footer widget area.'),
29
+ 'privacy_contact' => array('heading' => 'Add Privacy Contact?', 'tip' => 'Add a section to the end of the privacy statement with contact information'),
30
+ 'terms_contact' => array('heading' => 'Add Terms Contact?', 'tip' => 'Add a section to the end of the Terms and Conditions page with contact and legal information'),
31
  );
32
  private static $tooltips;
33
 
34
  public static function init($parent) {
35
  self::$version = FooterCredits::VERSION;
36
  self::$parenthook = $parent;
37
+ self::$slug = self::$parenthook . '-' . self::SLUG;
38
  add_action('admin_menu',array(self::CLASSNAME, 'admin_menu'));
39
  }
40
 
89
  add_meta_box(self::CODE.'-advanced', __('Advanced',self::DOMAIN), array(self::CLASSNAME, 'advanced_panel'), self::get_screen_id(), 'normal', 'core', $callback_params);
90
  add_action('admin_enqueue_scripts', array(self::CLASSNAME, 'enqueue_styles'));
91
  add_action('admin_enqueue_scripts',array(self::CLASSNAME, 'enqueue_scripts'));
92
+ self::$keys = array_keys(self::$tips);
93
  self::$tooltips = new DIYTooltip(self::$tips);
94
  }
95
 
164
  $tip1 = self::$tooltips->tip('owner');
165
  $tip2 = self::$tooltips->tip('address');
166
  $tip3 = self::$tooltips->tip('country');
167
+ $tip4 = self::$tooltips->tip('privacy_contact');
168
+ $privacy_contact = $terms['privacy_contact'] ? 'checked="checked"' : '';
169
  print <<< OWNER_PANEL
170
  <label>{$tip1}</label><input type="text" name="owner" size="25" value="{$terms['owner']}" /><br/>
171
  <label>{$tip2}</label><input type="text" name="address" size="80" value="{$terms['address']}" /><br/>
172
  <label>{$tip3}</label><input type="text" name="country" size="25" value="{$terms['country']}" /><br/>
173
+ <label>{$tip4}</label><input type="checkbox" name="privacy_contact" {$privacy_contact} value="1" /><br/>
174
  OWNER_PANEL;
175
  }
176
 
189
  $tip1 = self::$tooltips->tip('courts');
190
  $tip2 = self::$tooltips->tip('updated');
191
  $tip3 = self::$tooltips->tip('copyright_start_year');
192
+ $tip4 = self::$tooltips->tip('terms_contact');
193
+ $terms_contact = $terms['terms_contact'] ? 'checked="checked"' : '';
194
  print <<< LEGAL_PANEL
195
  <label>{$tip1}</label><input type="text" name="courts" size="80" value="{$terms['courts']}" /><br/>
196
  <label>{$tip2}</label><input type="text" name="updated" size="20" value="{$terms['updated']}" /><br/>
197
  <label>{$tip3}</label><input type="text" name="copyright_start_year" size="5" value="{$terms['copyright_start_year']}" /><br/>
198
+ <label>{$tip4}</label><input type="checkbox" name="terms_contact" {$terms_contact} value="1" /><br/>
199
  LEGAL_PANEL;
200
  }
201
 
225
  <p>You can place the Copyright and Trademark widgets in any existing widget area. However, if your theme does not have a suitably located widget area in the footer then you can create one by specifying the hook
226
  where the Widget Area will be located.</p>
227
  <p>You may use a standard WordPress hook like <i>get_footer</i> or <i>wp_footer</i> or choose a hook that is theme-specific such as <i>twentyten_credits</i>,
228
+ <i>twentyeleven_credits</i>, <i>twentytwelve_credits</i> or <i>twentythirteen_credits</i>. If you using a Genesis child theme and the theme does not have a suitable widget area then use
229
  the hook <i>genesis_footer</i> or maybe <i>genesis_after</i>. See what looks best. Click for <a href="{$url}">suggestions of which hook to use for common WordPress themes</a>.</p>
230
  <label>{$tip1}</label><input type="text" name="footer_hook" size="30" value="{$options['footer_hook']}" /><br/>
231
  <label>{$tip2}</label><input type="checkbox" name="footer_remove" {$footer_remove}value="1" /><br/>
classes/footer-credits.php CHANGED
@@ -19,13 +19,16 @@ class FooterCredits {
19
  'email' => '',
20
  'telephone' => '',
21
  'address' => '',
22
- 'updated' => ''),
 
 
23
  'nav_menu' => 0,
24
  'separator' => '&nbsp;&middot;&nbsp;',
25
  'center' => true,
26
  'two_lines' => true,
27
  'show_copyright' => true,
28
  'show_telephone' => true,
 
29
  'show_address' => true,
30
  'show_return' => true,
31
  'return_text' => 'Return To Top',
@@ -74,6 +77,12 @@ class FooterCredits {
74
  if ($ffs = self::get_option('footer_filter_hook'))
75
  add_filter($ffs, array(self::CLASSNAME, 'no_footer'),100);
76
 
 
 
 
 
 
 
77
  if (is_page('terms') || is_page('privacy') || is_page('affiliates') || is_page('disclaimer'))
78
  add_filter('the_content', array(self::CLASSNAME, 'terms_filter') );
79
  }
@@ -170,7 +179,7 @@ class FooterCredits {
170
  case 'copyright' : $default = self::get_copyright(self::get_term('copyright_start_year')); break;
171
  case 'copyright_start_year': $default = date('Y'); break;
172
  case 'country' : $default = 'The United States'; break;
173
- case 'courts' : $default = ucwords(sprintf('the courts of %1$s',self::get_option('country'))); break;
174
  case 'email' : $default = 'privacy@'.strtolower(self::get_term('site')); break;
175
  case 'site' : $default = self::get_default_site(); break;
176
  case 'updated' : $default = date('d M Y'); break;
@@ -211,7 +220,7 @@ class FooterCredits {
211
  }
212
 
213
  static function footer_menu($menu) {
214
- return self::filter_links(wp_nav_menu(array('menu' => $menu, 'echo' => false, 'container' => false)));
215
  }
216
 
217
  static function return_to_top( $text, $class) {
@@ -236,16 +245,18 @@ class FooterCredits {
236
  }
237
  $copyright = self::copyright_owner(self::get_terms());
238
  $telephone = self::get_term('telephone');
 
239
  $address = self::get_term('address');
240
  return (empty($params['show_return']) ? '' :
241
  self::return_to_top($params['return_text'], $params['return_class'])) .
242
- sprintf('<div id="%1$s" class="%2$s">%3$s%4$s%5$s%6$s</div>%7$s<!-- end #%1$s -->',
243
  self::CODE,
244
  $params['footer_class'],
245
  (empty($params['nav_menu']) ? '' : self::footer_menu($params['nav_menu'])),
246
  (empty($params['show_copyright']) ? '' : sprintf('%1$s%2$s', $section_separator, $copyright)),
247
  ((empty($address) || empty($params['show_address'])) ? '' : sprintf('%1$s<span class="address">%2$s%3$s</span>', $item_separator, self::format_address($address, $params['separator']), self::get_term('country')) ),
248
  ((empty($telephone) || empty($params['show_telephone'])) ? '' : sprintf('%1$s<span class="telephone">%2$s</span>', $section_separator, $telephone) ),
 
249
  $clear
250
  );
251
  }
@@ -277,24 +288,7 @@ class FooterCredits {
277
  }
278
  }
279
 
280
- static function no_footer($content) { return ''; }
281
-
282
- static function add_footer_filter() {
283
- add_filter('wp_list_bookmarks', array(self::CLASSNAME,'filter_links'),20); //nofollow links in custom footer widgets
284
- }
285
-
286
- static function filter_links( $content) {
287
- return preg_replace_callback( '/<a([^>]*)>(.*?)<\/a[^>]*>/is', array( self::CLASSNAME, 'nofollow_link' ), $content );
288
- }
289
-
290
- static function nofollow_link($matches) { //make link nofollow
291
- $attrs = shortcode_parse_atts( stripslashes ($matches[ 1 ]) );
292
- if (isset($attrs['rel'])) return $matches[ 0 ]; //skip if already has a rel attribute
293
- $atts='';
294
- foreach ( $attrs AS $key => $value ) $atts .= sprintf('%1$s="%2$s" ', $key, $value);
295
- $atts = substr( $atts, 0, -1 );
296
- return sprintf('<a rel="nofollow" %1$s>%2$s</a>', $atts, $matches[ 2 ]);
297
- }
298
 
299
  static function is_terms_key($key) {
300
  return array_key_exists($key, self::$defaults['terms']);
@@ -308,6 +302,8 @@ class FooterCredits {
308
  self::$defaults['footer_hook'] = 'twentyeleven_credits'; break;
309
  case 'twentytwelve':
310
  self::$defaults['footer_hook'] = 'twentytwelve_credits'; break;
 
 
311
  case 'delicate':
312
  self::$defaults['footer_hook'] = 'get_footer'; break;
313
  case 'genesis':
@@ -324,7 +320,47 @@ class FooterCredits {
324
  self::$defaults['footer_remove'] = false;
325
  break;
326
  }
327
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  }
329
 
330
  class Footer_Putter_Copyright_Widget extends WP_Widget {
@@ -349,6 +385,7 @@ class Footer_Putter_Copyright_Widget extends WP_Widget {
349
  $instance['nav_menu'] = !empty($new_instance['nav_menu']) ? $new_instance['nav_menu'] : 0;
350
  $instance['show_copyright'] = !empty($new_instance['show_copyright']) ? 1 : 0;
351
  $instance['show_telephone'] = !empty($new_instance['show_telephone']) ? 1 : 0;
 
352
  $instance['show_address'] = !empty($new_instance['show_address']) ? 1 : 0;
353
  $instance['center'] = !empty($new_instance['center']) ? 1 : 0;
354
  $instance['two_lines'] = !empty($new_instance['two_lines']) ? 1 : 0;
@@ -371,6 +408,7 @@ class Footer_Putter_Copyright_Widget extends WP_Widget {
371
  $two_lines = isset( $instance['two_lines'] ) ? (bool) $instance['two_lines'] : false;
372
  $show_copyright = isset( $instance['show_copyright'] ) ? (bool) $instance['show_copyright'] : false;
373
  $show_address = isset( $instance['show_address'] ) ? (bool) $instance['show_address'] : false;
 
374
  $show_telephone = isset( $instance['show_telephone'] ) ? (bool) $instance['show_telephone'] : false;
375
  $show_return = isset( $instance['show_return'] ) ? (bool) $instance['show_return'] : false;
376
  $return_class = isset( $instance['return_class'] ) ? $instance['return_class'] : '';
@@ -399,6 +437,8 @@ class Footer_Putter_Copyright_Widget extends WP_Widget {
399
  <label for="<?php echo $this->get_field_id('show_address'); ?>"><?php _e( 'Show Address', self::DOMAIN ); ?></label><br />
400
  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_telephone', self::DOMAIN ); ?>" name="<?php echo $this->get_field_name('show_telephone'); ?>"<?php checked( $show_telephone ); ?> />
401
  <label for="<?php echo $this->get_field_id('show_telephone'); ?>"><?php _e( 'Show Telephone number', self::DOMAIN ); ?></label><br />
 
 
402
  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_return', self::DOMAIN ); ?>" name="<?php echo $this->get_field_name('show_return'); ?>"<?php checked( $show_return ); ?> />
403
  <label for="<?php echo $this->get_field_id('show_return'); ?>"><?php _e( 'Show Return To Top Link' ); ?></label><br />
404
  <h4>Custom Classes (Optional)</h4>
19
  'email' => '',
20
  'telephone' => '',
21
  'address' => '',
22
+ 'updated' => '',
23
+ 'privacy_contact' => '',
24
+ 'terms_contact' => ''),
25
  'nav_menu' => 0,
26
  'separator' => '&nbsp;&middot;&nbsp;',
27
  'center' => true,
28
  'two_lines' => true,
29
  'show_copyright' => true,
30
  'show_telephone' => true,
31
+ 'show_email' => false,
32
  'show_address' => true,
33
  'show_return' => true,
34
  'return_text' => 'Return To Top',
77
  if ($ffs = self::get_option('footer_filter_hook'))
78
  add_filter($ffs, array(self::CLASSNAME, 'no_footer'),100);
79
 
80
+ if (is_page('privacy') && self::get_term('privacy_contact'))
81
+ add_filter('the_content', array(self::CLASSNAME, 'add_privacy_footer'),9 );
82
+
83
+ if (is_page('terms') && self::get_term('terms_contact'))
84
+ add_filter('the_content', array(self::CLASSNAME, 'add_terms_footer'),9 );
85
+
86
  if (is_page('terms') || is_page('privacy') || is_page('affiliates') || is_page('disclaimer'))
87
  add_filter('the_content', array(self::CLASSNAME, 'terms_filter') );
88
  }
179
  case 'copyright' : $default = self::get_copyright(self::get_term('copyright_start_year')); break;
180
  case 'copyright_start_year': $default = date('Y'); break;
181
  case 'country' : $default = 'The United States'; break;
182
+ case 'courts' : $default = ucwords(sprintf('the courts of %1$s',self::get_term('country'))); break;
183
  case 'email' : $default = 'privacy@'.strtolower(self::get_term('site')); break;
184
  case 'site' : $default = self::get_default_site(); break;
185
  case 'updated' : $default = date('d M Y'); break;
220
  }
221
 
222
  static function footer_menu($menu) {
223
+ return wp_nav_menu(array('menu' => $menu, 'echo' => false, 'container' => false));
224
  }
225
 
226
  static function return_to_top( $text, $class) {
245
  }
246
  $copyright = self::copyright_owner(self::get_terms());
247
  $telephone = self::get_term('telephone');
248
+ $email = self::get_term('email');
249
  $address = self::get_term('address');
250
  return (empty($params['show_return']) ? '' :
251
  self::return_to_top($params['return_text'], $params['return_class'])) .
252
+ sprintf('<div id="%1$s" class="%2$s">%3$s%4$s%5$s%6$s%7$s</div>%8$s<!-- end #%1$s -->',
253
  self::CODE,
254
  $params['footer_class'],
255
  (empty($params['nav_menu']) ? '' : self::footer_menu($params['nav_menu'])),
256
  (empty($params['show_copyright']) ? '' : sprintf('%1$s%2$s', $section_separator, $copyright)),
257
  ((empty($address) || empty($params['show_address'])) ? '' : sprintf('%1$s<span class="address">%2$s%3$s</span>', $item_separator, self::format_address($address, $params['separator']), self::get_term('country')) ),
258
  ((empty($telephone) || empty($params['show_telephone'])) ? '' : sprintf('%1$s<span class="telephone">%2$s</span>', $section_separator, $telephone) ),
259
+ ((empty($email) || empty($params['show_email'])) ? '' : sprintf('%1$s<span class="email">%2$s</span>', $section_separator, $email) ),
260
  $clear
261
  );
262
  }
288
  }
289
  }
290
 
291
+ static function no_footer($content) { return ''; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
 
293
  static function is_terms_key($key) {
294
  return array_key_exists($key, self::$defaults['terms']);
302
  self::$defaults['footer_hook'] = 'twentyeleven_credits'; break;
303
  case 'twentytwelve':
304
  self::$defaults['footer_hook'] = 'twentytwelve_credits'; break;
305
+ case 'twentythirteen':
306
+ self::$defaults['footer_hook'] = 'twentythirteen_credits'; break;
307
  case 'delicate':
308
  self::$defaults['footer_hook'] = 'get_footer'; break;
309
  case 'genesis':
320
  self::$defaults['footer_remove'] = false;
321
  break;
322
  }
323
+ }
324
+
325
+ static function add_privacy_footer($content) {
326
+ $email = self::get_term('email');
327
+ $address = self::get_term('address');
328
+ $country = self::get_term('country');
329
+ $owner = self::get_term('owner');
330
+ $contact = <<< PRIVACY
331
+ <h2>How to Contact Us</h2>
332
+ <p>Questions about this statement or about our handling of your information may be sent by email to <a href="mailto:{$email}">{$email}</a>, or by post to {$owner} Privacy Office, {$address} {$country}. </p>
333
+ PRIVACY;
334
+ return (strpos($content,'%%') == FALSE) ? ($content . $contact) : $content;
335
+ }
336
+
337
+ static function add_terms_footer($content) {
338
+ $email = self::get_term('email');
339
+ $address = self::get_term('address');
340
+ $country = self::get_term('country');
341
+ $courts = self::get_term('courts');
342
+ $owner = self::get_term('owner');
343
+ $copyright = self::get_term('copyright');
344
+ $updated = self::get_term('updated');
345
+ $terms_contact = self::get_term('terms_contact');
346
+ $disputes = <<< DISPUTES
347
+ <h2>Dispute Resolution</h2>
348
+ <p>These terms, and any dispute arising from the use of this site, will be governed by {$courts} without regard to its conflicts of laws provisions.</p>
349
+ DISPUTES;
350
+ $terms = <<< TERMS
351
+ <h2>Feedback And Information</h2>
352
+ <p>Any feedback you provide at this site shall be deemed to be non-confidential. {$owner} shall be free to use such information on an unrestricted basis.</p>
353
+ <p>The terms and conditions for this web site are subject to change without notice.<p>
354
+ <p>{$copyright} {$owner} All rights reserved.<br/> {$owner}, {$address} {$country}</p>
355
+ <p>Updated by The {$owner} Legal Team on {$updated}</p>
356
+ TERMS;
357
+ if (strpos($content,'%%') == FALSE) {
358
+ $content .= $courts ? $disputes : '';
359
+ $content .= $address ? $terms : '';
360
+ }
361
+ return $content ;
362
+ }
363
+
364
  }
365
 
366
  class Footer_Putter_Copyright_Widget extends WP_Widget {
385
  $instance['nav_menu'] = !empty($new_instance['nav_menu']) ? $new_instance['nav_menu'] : 0;
386
  $instance['show_copyright'] = !empty($new_instance['show_copyright']) ? 1 : 0;
387
  $instance['show_telephone'] = !empty($new_instance['show_telephone']) ? 1 : 0;
388
+ $instance['show_email'] = !empty($new_instance['show_email']) ? 1 : 0;
389
  $instance['show_address'] = !empty($new_instance['show_address']) ? 1 : 0;
390
  $instance['center'] = !empty($new_instance['center']) ? 1 : 0;
391
  $instance['two_lines'] = !empty($new_instance['two_lines']) ? 1 : 0;
408
  $two_lines = isset( $instance['two_lines'] ) ? (bool) $instance['two_lines'] : false;
409
  $show_copyright = isset( $instance['show_copyright'] ) ? (bool) $instance['show_copyright'] : false;
410
  $show_address = isset( $instance['show_address'] ) ? (bool) $instance['show_address'] : false;
411
+ $show_email = isset( $instance['show_email'] ) ? (bool) $instance['show_email'] : false;
412
  $show_telephone = isset( $instance['show_telephone'] ) ? (bool) $instance['show_telephone'] : false;
413
  $show_return = isset( $instance['show_return'] ) ? (bool) $instance['show_return'] : false;
414
  $return_class = isset( $instance['return_class'] ) ? $instance['return_class'] : '';
437
  <label for="<?php echo $this->get_field_id('show_address'); ?>"><?php _e( 'Show Address', self::DOMAIN ); ?></label><br />
438
  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_telephone', self::DOMAIN ); ?>" name="<?php echo $this->get_field_name('show_telephone'); ?>"<?php checked( $show_telephone ); ?> />
439
  <label for="<?php echo $this->get_field_id('show_telephone'); ?>"><?php _e( 'Show Telephone number', self::DOMAIN ); ?></label><br />
440
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_email', self::DOMAIN ); ?>" name="<?php echo $this->get_field_name('show_email'); ?>"<?php checked( $show_email ); ?> />
441
+ <label for="<?php echo $this->get_field_id('show_email'); ?>"><?php _e( 'Show Email Address', self::DOMAIN ); ?></label><br />
442
  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_return', self::DOMAIN ); ?>" name="<?php echo $this->get_field_name('show_return'); ?>"<?php checked( $show_return ); ?> />
443
  <label for="<?php echo $this->get_field_id('show_return'); ?>"><?php _e( 'Show Return To Top Link' ); ?></label><br />
444
  <h4>Custom Classes (Optional)</h4>
classes/footer-trademarks.php CHANGED
@@ -28,7 +28,7 @@ class Footer_Putter_TradeMark_Widget extends WP_Widget {
28
  'limit' => $limit,
29
  )));
30
  echo $before_widget;
31
- echo FooterCredits::filter_links($links);
32
  echo $after_widget;
33
  }
34
 
28
  'limit' => $limit,
29
  )));
30
  echo $before_widget;
31
+ echo $links;
32
  echo $after_widget;
33
  }
34
 
main.php CHANGED
@@ -3,33 +3,36 @@
3
  * Plugin Name: Footer Putter
4
  * Plugin URI: http://www.diywebmastery.com/plugins/footer-putter/
5
  * Description: Put a footer on your site that boosts your credibility with both search engines and human visitors.
6
- * Version: 1.5
7
  * Author: Russell Jamieson
8
  * Author URI: http://www.diywebmastery.com/about/
9
  * License: GPLv2+
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
12
- define('FOOTER_PUTTER_VERSION','1.5');
13
  define('FOOTER_PUTTER_FRIENDLY_NAME', 'Footer Putter') ;
14
  define('FOOTER_PUTTER_PLUGIN_NAME', plugin_basename(dirname(__FILE__))) ;
15
  define('FOOTER_PUTTER_HOME_URL','http://www.diywebmastery.com/plugins/footer-putter/');
16
  $dir = dirname(__FILE__) . '/classes/';
17
  require_once($dir . 'footer-credits.php');
18
  require_once($dir . 'footer-trademarks.php');
 
 
19
  if (is_admin()) {
20
  require_once($dir . 'tooltip.php');
21
  require_once($dir . 'admin.php');
22
  require_once($dir . 'footer-credits-admin.php');
23
  require_once($dir . 'footer-trademarks-admin.php');
 
24
  }
25
 
26
  function footer_putter_init() {
27
  FooterCredits::init();
28
- if (is_admin()) {
29
- FooterPutterAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
30
- FooterCreditsAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
31
- FooterTrademarksAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
32
- }
33
  }
34
- add_action ('init', 'footer_putter_init',0); //run before widget init
35
- ?>
 
 
 
 
 
3
  * Plugin Name: Footer Putter
4
  * Plugin URI: http://www.diywebmastery.com/plugins/footer-putter/
5
  * Description: Put a footer on your site that boosts your credibility with both search engines and human visitors.
6
+ * Version: 1.6
7
  * Author: Russell Jamieson
8
  * Author URI: http://www.diywebmastery.com/about/
9
  * License: GPLv2+
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
12
+ define('FOOTER_PUTTER_VERSION','1.6');
13
  define('FOOTER_PUTTER_FRIENDLY_NAME', 'Footer Putter') ;
14
  define('FOOTER_PUTTER_PLUGIN_NAME', plugin_basename(dirname(__FILE__))) ;
15
  define('FOOTER_PUTTER_HOME_URL','http://www.diywebmastery.com/plugins/footer-putter/');
16
  $dir = dirname(__FILE__) . '/classes/';
17
  require_once($dir . 'footer-credits.php');
18
  require_once($dir . 'footer-trademarks.php');
19
+
20
+ add_action ('init', 'footer_putter_init',0); //run before widget init
21
  if (is_admin()) {
22
  require_once($dir . 'tooltip.php');
23
  require_once($dir . 'admin.php');
24
  require_once($dir . 'footer-credits-admin.php');
25
  require_once($dir . 'footer-trademarks-admin.php');
26
+ add_action ('init', 'footer_putter_admin_init',0); //run before widget init
27
  }
28
 
29
  function footer_putter_init() {
30
  FooterCredits::init();
 
 
 
 
 
31
  }
32
+
33
+ function footer_putter_admin_init() {
34
+ FooterPutterAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
35
+ FooterCreditsAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
36
+ FooterTrademarksAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
37
+ }
38
+ ?>
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Footer Putter ===
2
  Contributors: powerblogservice, diywebmastery
3
  Donate link: http://www.diywebmastery.com/donate/
4
- Tags: footer, copyright, rel=nofollow
5
  Requires at least: 3.0
6
- Tested up to: 3.6
7
- Stable tag: 1.5
8
  License: GPLv2+
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -20,7 +20,6 @@ Put a footer on your site that boosts your credibility with both search engines
20
  * Include a postal address to prove you are a real business
21
  * Supports both a single line centred footer and a multi-line right aligned footer
22
  * The Footer hook setting allows you to add the footer in just the right place on themes that do not have suitable widget areas
23
- * Ensures all links in the footer widgets are rel=nofollow in line with best SEO recommendations
24
  * HTML5 support
25
 
26
  == Installation ==
@@ -31,7 +30,6 @@ Put a footer on your site that boosts your credibility with both search engines
31
 
32
  * Why is a footer important? By creating an appropriate footer you can enhance the credibility of your site by informing visitors on how to contact you, asserting copyright over the site content, setting out the legal terms and conditions for using the site, and establishing the trade associations or other bodies that recognize the legitimacy of your business.
33
 
34
- * Why use rel=nofollow links? Links in the footer appear on every page on the site so you want to tell the search engines not to follow these links. After all, just because every page on the site may link to the "About Us", "Contact Us", "Terms of Service", and "Privacy Policy" pages doesn't mean you want these to be the top ranking pages on your site after the home page.
35
 
36
  == Screenshots ==
37
  1. Example of a footer with both a copyright widget and a trademark widget
@@ -44,6 +42,7 @@ Put a footer on your site that boosts your credibility with both search engines
44
 
45
  == Changelog ==
46
 
 
47
  = 1.5 = Use Javascript for Return To Top link to make it work on HTML5 sites, and strengthen CSS to ensure footer copyright and trademark widgets are full width
48
  = 1.4.1 = Reinstate support for PHP 5.2
49
  = 1.4 = Added support for HTML5 themes
@@ -54,8 +53,8 @@ Put a footer on your site that boosts your credibility with both search engines
54
 
55
  == Upgrade Notice ==
56
 
57
- = 1.5 =
58
- * Optional - Changes to Return To Top Link and Footer CSS to improve support for HTML5 sites.
59
 
60
  == Links ==
61
 
1
  === Footer Putter ===
2
  Contributors: powerblogservice, diywebmastery
3
  Donate link: http://www.diywebmastery.com/donate/
4
+ Tags: footer, copyright, trademark
5
  Requires at least: 3.0
6
+ Tested up to: 3.7
7
+ Stable tag: 1.6
8
  License: GPLv2+
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
20
  * Include a postal address to prove you are a real business
21
  * Supports both a single line centred footer and a multi-line right aligned footer
22
  * The Footer hook setting allows you to add the footer in just the right place on themes that do not have suitable widget areas
 
23
  * HTML5 support
24
 
25
  == Installation ==
30
 
31
  * Why is a footer important? By creating an appropriate footer you can enhance the credibility of your site by informing visitors on how to contact you, asserting copyright over the site content, setting out the legal terms and conditions for using the site, and establishing the trade associations or other bodies that recognize the legitimacy of your business.
32
 
 
33
 
34
  == Screenshots ==
35
  1. Example of a footer with both a copyright widget and a trademark widget
42
 
43
  == Changelog ==
44
 
45
+ = 1.6 = Add option to include email address in the copyright footer widget, remove the automatic adding of rel=nofollow in footer links, and add optional sub-footer sections to the privacy and terms pages
46
  = 1.5 = Use Javascript for Return To Top link to make it work on HTML5 sites, and strengthen CSS to ensure footer copyright and trademark widgets are full width
47
  = 1.4.1 = Reinstate support for PHP 5.2
48
  = 1.4 = Added support for HTML5 themes
53
 
54
  == Upgrade Notice ==
55
 
56
+ = 1.6 =
57
+ * Optional - Add option to include email address in the copyright footer widget
58
 
59
  == Links ==
60