Head, Footer and Post Injections - Version 3.0.5

Version Description

  • Debug notices fix
Download this release

Release Info

Developer satollo
Plugin Icon wp plugin Head, Footer and Post Injections
Version 3.0.5
Comparing to
See all releases

Code changes from version 3.0.4 to 3.0.5

Files changed (3) hide show
  1. options.php +12 -0
  2. plugin.php +13 -2
  3. readme.txt +16 -10
options.php CHANGED
@@ -686,6 +686,18 @@ else {
686
  </div>
687
  </div>
688
  <div class="clearfix"></div>
 
 
 
 
 
 
 
 
 
 
 
 
689
  </div>
690
 
691
 
686
  </div>
687
  </div>
688
  <div class="clearfix"></div>
689
+
690
+ <h3>Footer</h3>
691
+ <div class="row">
692
+
693
+ <div class="col-1">
694
+
695
+ <?php hefo_base_textarea_cm('amp_footer'); ?>
696
+
697
+ </div>
698
+ </div>
699
+ <div class="clearfix"></div>
700
+
701
  </div>
702
 
703
 
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Head, Footer and Post Injections
5
  Plugin URI: http://www.satollo.net/plugins/header-footer
6
  Description: Header and Footer lets to add html/javascript code to the head and footer and posts of your blog. Some examples are provided on the <a href="http://www.satollo.net/plugins/header-footer">official page</a>.
7
- Version: 3.0.4
8
  Author: Stefano Lissa
9
  Author URI: http://www.satollo.net
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -65,7 +65,7 @@ $hefo_generic_block = array();
65
  function hefo_template_redirect() {
66
  global $hefo_body_block, $hefo_generic_block, $hefo_options, $hefo_is_mobile;
67
 
68
- if ($hefo_is_mobile && $hefo_options['mobile_body_enabled']) {
69
  $hefo_body_block = hefo_execute($hefo_options['mobile_body']);
70
  } else {
71
  $hefo_body_block = hefo_execute($hefo_options['body']);
@@ -175,6 +175,14 @@ function hefo_amp_post_template_css() {
175
  echo "\n";
176
  }
177
 
 
 
 
 
 
 
 
 
178
  add_action('wp_footer', 'hefo_wp_footer');
179
 
180
  function hefo_wp_footer() {
@@ -344,6 +352,7 @@ function hefo_the_content($content) {
344
  else if (substr($skip, -1) == '%') {
345
  $skip = (intval($skip) * strlen($content) / 100);
346
  }
 
347
  if ($hefo_options['inner_pos_' . $i] == 'after') {
348
  $res = hefo_insert_after($content, hefo_execute($hefo_options[$prefix . 'inner_' . $i]), $hefo_options['inner_tag_' . $i], $skip);
349
  } else {
@@ -383,6 +392,7 @@ function hefo_insert_before(&$content, $what, $marker, $starting_from = 0) {
383
  }
384
 
385
  function hefo_insert_after(&$content, $what, $marker, $starting_from = 0) {
 
386
  if (strlen($content) < $starting_from) {
387
  return false;
388
  }
@@ -392,6 +402,7 @@ function hefo_insert_after(&$content, $what, $marker, $starting_from = 0) {
392
  }
393
 
394
  $x = strpos($content, $marker, $starting_from);
 
395
  if ($x !== false) {
396
  $content = substr_replace($content, $what, $x + strlen($marker), 0);
397
  return true;
4
  Plugin Name: Head, Footer and Post Injections
5
  Plugin URI: http://www.satollo.net/plugins/header-footer
6
  Description: Header and Footer lets to add html/javascript code to the head and footer and posts of your blog. Some examples are provided on the <a href="http://www.satollo.net/plugins/header-footer">official page</a>.
7
+ Version: 3.0.5
8
  Author: Stefano Lissa
9
  Author URI: http://www.satollo.net
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
65
  function hefo_template_redirect() {
66
  global $hefo_body_block, $hefo_generic_block, $hefo_options, $hefo_is_mobile;
67
 
68
+ if ($hefo_is_mobile && isset($hefo_options['mobile_body_enabled'])) {
69
  $hefo_body_block = hefo_execute($hefo_options['mobile_body']);
70
  } else {
71
  $hefo_body_block = hefo_execute($hefo_options['body']);
175
  echo "\n";
176
  }
177
 
178
+ add_action('amp_post_template_footer', 'hefo_amp_post_template_footer', 100);
179
+ function hefo_amp_post_template_footer() {
180
+ global $hefo_options;
181
+ echo "\n";
182
+ echo hefo_execute($hefo_options['amp_footer']);
183
+ echo "\n";
184
+ }
185
+
186
  add_action('wp_footer', 'hefo_wp_footer');
187
 
188
  function hefo_wp_footer() {
352
  else if (substr($skip, -1) == '%') {
353
  $skip = (intval($skip) * strlen($content) / 100);
354
  }
355
+
356
  if ($hefo_options['inner_pos_' . $i] == 'after') {
357
  $res = hefo_insert_after($content, hefo_execute($hefo_options[$prefix . 'inner_' . $i]), $hefo_options['inner_tag_' . $i], $skip);
358
  } else {
392
  }
393
 
394
  function hefo_insert_after(&$content, $what, $marker, $starting_from = 0) {
395
+
396
  if (strlen($content) < $starting_from) {
397
  return false;
398
  }
402
  }
403
 
404
  $x = strpos($content, $marker, $starting_from);
405
+
406
  if ($x !== false) {
407
  $content = substr_replace($content, $what, $x + strlen($marker), 0);
408
  return true;
readme.txt CHANGED
@@ -1,5 +1,5 @@
1
  === Head, Footer and Post Injections ===
2
- Tags: header, footer, blog, page, single, post, head, tracking, facebook, og meta tag, open graph, ads, adsense, injections, analytics, amp
3
  Requires at least: 3.0
4
  Tested up to: 4.7.2
5
  Stable tag: 3.0.4
@@ -16,18 +16,20 @@ remove my plugin, and it's not the case.
16
 
17
  = Head and Footer Codes =
18
 
19
- Why you have to install 10 plugins to add Google Analytics code, custom
20
- tracking code, Google Webmaster/Alexa/Bing/Tradedoubler verificaton code (and so on...)
21
- on head of footer section of your blog pages?
22
 
23
  With Header and Footer plugin you can just copy the code those services give you
24
- in a centralized point to manage them all.
 
25
 
26
- * manage the head section code
27
- * manage the footer code
28
- * recognize and execute PHP code to add logic
29
- * few SEO options
30
- * mobile detection
 
 
31
 
32
  = AMP =
33
 
@@ -91,6 +93,10 @@ FAQs are answered on [Header and Footer](http://www.satollo.net/plugins/header-f
91
 
92
  == Changelog ==
93
 
 
 
 
 
94
  = 3.0.4 =
95
 
96
  * Debug notices fix
1
  === Head, Footer and Post Injections ===
2
+ Tags: header, footer, blog, page, single, post, head, tracking, facebook, og meta tag, open graph, ads, adsense, injections, analytics, amp, pixel
3
  Requires at least: 3.0
4
  Tested up to: 4.7.2
5
  Stable tag: 3.0.4
16
 
17
  = Head and Footer Codes =
18
 
19
+ Why you have to install 10 plugins to add Google Analytics, Facebook Pixel, custom
20
+ tracking code, Google DFP code, Google Webmaster/Alexa/Bing/Tradedoubler verification code and so on...
 
21
 
22
  With Header and Footer plugin you can just copy the code those services give you
23
+ in a centralized point to manage them all. And theme independent: you can change your theme
24
+ without loosing the code injected!
25
 
26
+ = Injection points and features =
27
+
28
+ * in the <head> page section where most if the codes are usually added
29
+ * just after the <body> tag as required by some JavaScript SDK (like Facebook)
30
+ * in the page footer (just before the </body> tag)
31
+ * recognize and execute PHP code to add logic to your injections
32
+ * distinct desktop and mobile injections
33
 
34
  = AMP =
35
 
93
 
94
  == Changelog ==
95
 
96
+ = 3.0.5 =
97
+
98
+ * Debug notices fix
99
+
100
  = 3.0.4 =
101
 
102
  * Debug notices fix