MailMunch – Grow your Email List - Version 1.3.2

Version Description

  • Now supports multiple types of optin forms and themes
  • New type of optin form that could be embedded before, after or in the middle of your posts
  • Brand new UI for admin dashboard
Download this release

Release Info

Developer mailmunch
Plugin Icon 128x128 MailMunch – Grow your Email List
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3.1 to 1.3.2

Files changed (2) hide show
  1. mailmunch.php +41 -4
  2. readme.txt +16 -8
mailmunch.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MailMunch
4
  Plugin URI: http://www.mailmunch.co
5
  Description: Collect email addresses from website visitors and grow your subscribers with our attention grabbing optin-forms, entry/exit intent technology, and other effective lead-generation forms.
6
- Version: 1.3.1
7
  Author: MailMunch
8
  Author URI: http://www.mailmunch.co
9
  License: GPL2
@@ -13,7 +13,7 @@
13
  require_once( plugin_dir_path( __FILE__ ) . 'inc/common.php' );
14
 
15
  define( 'MAILMUNCH_SLUG', "mailmunch");
16
- define( 'MAILMUNCH_VER', "1.3.1");
17
  define( 'MAILMUNCH_URL', "www.mailmunch.co");
18
 
19
  // Adding Admin Menu
@@ -43,11 +43,16 @@
43
  $mailmunch_data = unserialize(get_option("mailmunch_data"));
44
  if (!$mailmunch_data["script_src"]) return;
45
 
 
 
 
 
 
46
  echo "<script type='text/javascript'>";
47
  echo "var _mmunch = {'front': false, 'page': false, 'post': false, 'category': false, 'author': false, 'search': false, 'attachment': false, 'tag': false};";
48
  if (is_front_page() || is_home()) { echo "_mmunch['front'] = true;"; }
49
- if (is_page()) { echo "_mmunch['page'] = true;"; }
50
- if (is_single()) { echo "_mmunch['post'] = true; _mmunch['postData'] = ".json_encode(get_post())."; _mmunch['postCategories'] = ".json_encode(get_the_category()).";"; }
51
  if (is_category()) { echo "_mmunch['category'] = true; _mmunch['categoryData'] = ".json_encode(get_category(get_query_var('cat'))).";"; }
52
  if (is_search()) { echo "_mmunch['search'] = true;"; }
53
  if (is_author()) { echo "_mmunch['author'] = true;"; }
@@ -76,6 +81,38 @@
76
  }
77
  }
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  function mailmunch_setup() {
80
  $mailmunch_data = unserialize(get_option("mailmunch_data"));
81
  $mailmunch_data["site_url"] = home_url();
3
  Plugin Name: MailMunch
4
  Plugin URI: http://www.mailmunch.co
5
  Description: Collect email addresses from website visitors and grow your subscribers with our attention grabbing optin-forms, entry/exit intent technology, and other effective lead-generation forms.
6
+ Version: 1.3.2
7
  Author: MailMunch
8
  Author URI: http://www.mailmunch.co
9
  License: GPL2
13
  require_once( plugin_dir_path( __FILE__ ) . 'inc/common.php' );
14
 
15
  define( 'MAILMUNCH_SLUG', "mailmunch");
16
+ define( 'MAILMUNCH_VER', "1.3.2");
17
  define( 'MAILMUNCH_URL', "www.mailmunch.co");
18
 
19
  // Adding Admin Menu
43
  $mailmunch_data = unserialize(get_option("mailmunch_data"));
44
  if (!$mailmunch_data["script_src"]) return;
45
 
46
+ if (is_single() || is_page()) {
47
+ $post = get_post();
48
+ $post_data = array("ID" => $post->ID, "post_name" => $post->post_name, "post_title" => $post->post_title, "post_type" => $post->post_type, "post_author" => $post->post_author, "post_status" => $post->post_status);
49
+ }
50
+
51
  echo "<script type='text/javascript'>";
52
  echo "var _mmunch = {'front': false, 'page': false, 'post': false, 'category': false, 'author': false, 'search': false, 'attachment': false, 'tag': false};";
53
  if (is_front_page() || is_home()) { echo "_mmunch['front'] = true;"; }
54
+ if (is_page()) { echo "_mmunch['page'] = true; _mmunch['pageData'] = ".json_encode($post_data).";"; }
55
+ if (is_single()) { echo "_mmunch['post'] = true; _mmunch['postData'] = ".json_encode($post_data)."; _mmunch['postCategories'] = ".json_encode(get_the_category())."; _mmunch['postTags'] = ".json_encode(get_the_tags())."; _mmunch['postAuthor'] = ".json_encode(array("name" => get_the_author_meta("display_name"), "ID" => get_the_author_meta("ID"))).";"; }
56
  if (is_category()) { echo "_mmunch['category'] = true; _mmunch['categoryData'] = ".json_encode(get_category(get_query_var('cat'))).";"; }
57
  if (is_search()) { echo "_mmunch['search'] = true;"; }
58
  if (is_author()) { echo "_mmunch['author'] = true;"; }
81
  }
82
  }
83
 
84
+ function add_post_containers($content) {
85
+ if (is_single() || is_page()) {
86
+ //$content = insert_form_after_paragraph("<div class='mailmunch-forms-after-paragraph-one' style='display: none !important;'></div>", 1, $content);
87
+ //$content = insert_form_after_paragraph("<div class='mailmunch-forms-after-paragraph-two' style='display: none !important;'></div>", 2, $content);
88
+ $content = insert_form_after_paragraph("<div class='mailmunch-forms-in-post-middle' style='display: none !important;'></div>", "middle", $content);
89
+ $content = "<div class='mailmunch-forms-before-post' style='display: none !important;'></div>" . $content . "<div class='mailmunch-forms-after-post' style='display: none !important;'></div>";
90
+ }
91
+
92
+ return $content;
93
+ }
94
+
95
+ function insert_form_after_paragraph($insertion, $paragraph_id, $content) {
96
+ $closing_p = '</p>';
97
+ $paragraphs = explode($closing_p, $content);
98
+ if ($paragraph_id == "middle") {
99
+ $paragraph_id = round(sizeof($paragraphs)/2);
100
+ }
101
+
102
+ foreach ($paragraphs as $index => $paragraph) {
103
+ if (trim($paragraph)) {
104
+ $paragraphs[$index] .= $closing_p;
105
+ }
106
+
107
+ if ($paragraph_id == $index + 1) {
108
+ $paragraphs[$index] .= $insertion;
109
+ }
110
+ }
111
+ return implode('', $paragraphs);
112
+ }
113
+
114
+ add_filter( 'the_content', 'add_post_containers' );
115
+
116
  function mailmunch_setup() {
117
  $mailmunch_data = unserialize(get_option("mailmunch_data"));
118
  $mailmunch_data["site_url"] = home_url();
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mailmunch
3
  Tags: widget, MailChimp, newsletter, newsletters, MailChimp plugin, Aweber,subscribe, popup, exit popup, exit intent, growth, subscribers, subscription, hellobar, email, posts, sharing, links, popover, analytics , newsletter, automatic , mail, lightbox, analytics, newsletter, getresponse, collect email, optin, optin forms, double optin, popover, optin monster, popup domination, sumome, list builder, mailchimp, popupdomination, optin revolution
4
  Requires at least: 3.0.1
5
  Tested up to: 4.0
6
- Stable tag: 1.3.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -131,19 +131,27 @@ Why people use Aweber
131
 
132
  == Changelog ==
133
 
134
- = 1.0 =
135
- * The first version of MailMunch's WordPress plugin
 
 
 
 
 
136
 
137
  = 1.0.1 =
138
  * Added better integration
139
 
140
- = 1.3.1 =
141
- * Added powerful targeting for pages, posts, categories, authors and attachments
142
 
143
  == Upgrade Notice ==
144
 
145
- = 1.0.1 =
146
- * Seamless integration with MailMunch designer
147
 
148
  = 1.3.1 =
149
- * Added powerful targeting for pages, posts, categories, authors and attachments
 
 
 
3
  Tags: widget, MailChimp, newsletter, newsletters, MailChimp plugin, Aweber,subscribe, popup, exit popup, exit intent, growth, subscribers, subscription, hellobar, email, posts, sharing, links, popover, analytics , newsletter, automatic , mail, lightbox, analytics, newsletter, getresponse, collect email, optin, optin forms, double optin, popover, optin monster, popup domination, sumome, list builder, mailchimp, popupdomination, optin revolution
4
  Requires at least: 3.0.1
5
  Tested up to: 4.0
6
+ Stable tag: 1.3.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
131
 
132
  == Changelog ==
133
 
134
+ = 1.3.2 =
135
+ * Now supports multiple types of optin forms and themes
136
+ * New type of optin form that could be embedded before, after or in the middle of your posts
137
+ * Brand new UI for admin dashboard
138
+
139
+ = 1.3.1 =
140
+ * Added powerful targeting for pages, posts, categories, authors and attachments
141
 
142
  = 1.0.1 =
143
  * Added better integration
144
 
145
+ = 1.0 =
146
+ * The first version of MailMunch's WordPress plugin
147
 
148
  == Upgrade Notice ==
149
 
150
+ = 1.3.2 =
151
+ * Added a new type of optin form that could be embedded before, after or in the middle of your posts and pages
152
 
153
  = 1.3.1 =
154
+ * Added powerful targeting for pages, posts, categories, authors and attachments
155
+
156
+ = 1.0.1 =
157
+ * Seamless integration with MailMunch designer