Email Before Download - Version 5.0.9

Version Description

Download this release

Release Info

Developer mandsconsulting
Plugin Icon 128x128 Email Before Download
Version 5.0.9
Comparing to
See all releases

Code changes from version 5.0.8 to 5.0.9

email-before-download.php CHANGED
@@ -11,7 +11,7 @@
11
  * @wordpress-plugin
12
  * Plugin Name: Email Before Download
13
  * Plugin URI: mandsconsulting.com
14
- * Version: 5.0.8
15
  * Author: M&S Consulting
16
  * Author URI: mandsconsulting.com
17
  * License: GPL-2.0+
@@ -25,7 +25,7 @@ if ( ! defined( 'WPINC' ) ) {
25
  }
26
 
27
 
28
- define( 'PLUGIN_NAME_VERSION', '5.0.8' );
29
 
30
  function activate_email_before_download() {
31
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-email-before-download-activator.php';
11
  * @wordpress-plugin
12
  * Plugin Name: Email Before Download
13
  * Plugin URI: mandsconsulting.com
14
+ * Version: 5.0.9
15
  * Author: M&S Consulting
16
  * Author URI: mandsconsulting.com
17
  * License: GPL-2.0+
25
  }
26
 
27
 
28
+ define( 'PLUGIN_NAME_VERSION', '5.0.9' );
29
 
30
  function activate_email_before_download() {
31
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-email-before-download-activator.php';
includes/class-email-before-download-form.php CHANGED
@@ -28,7 +28,7 @@ class Email_Before_Download_Form
28
  $raw = do_shortcode("[contact-form-7 id=\"$this->form_id\" ]");
29
  $form = new DOMDocument;
30
  $form->formatOutput = true;
31
- $form->loadHTML($raw);
32
  $parent = $form->getElementsByTagName('form')->item(0);
33
  $formID = $parent->getAttribute('action');
34
  $tmp = explode('#', $formID);
@@ -100,7 +100,7 @@ class Email_Before_Download_Form
100
  } else {
101
  $input = 'radio';
102
  }
103
- $formObject->loadHTML("<label class='ebd_input'><input type=\"$input\" $isChecked name=\"ebd_downloads[]\" value=\"$id|$title\"> $title</label>");
104
  $node = $formObject->getElementsByTagName("label");
105
  return $node->item(0);
106
  }
@@ -109,14 +109,14 @@ class Email_Before_Download_Form
109
  $formObject = new DOMDocument();
110
  $formObject->formatOutput = true;
111
  $title = $this->titles[$key];
112
- $formObject->loadHTML("<label class='ebd_input'><input type=\"hidden\" name=\"ebd_downloads[]\" value=\"$id|$title\"> </label>");
113
  $node = $formObject->getElementsByTagName("label");
114
  return $node->item(0);
115
  }
116
  private function hidden_dom_obj($name, $value){
117
  $formObject = new DOMDocument();
118
  $formObject->formatOutput = true;
119
- $formObject->loadHTML("<input type=\"hidden\" class=\"ebd_setting\" name =\"ebd_settings[]\" value=\"$name|$value\">");
120
  $node = $formObject->getElementsByTagName("input");
121
  return $node->item(0);
122
  }
28
  $raw = do_shortcode("[contact-form-7 id=\"$this->form_id\" ]");
29
  $form = new DOMDocument;
30
  $form->formatOutput = true;
31
+ $form->loadHTML('<?xml encoding="utf-8" ?>'.$raw);
32
  $parent = $form->getElementsByTagName('form')->item(0);
33
  $formID = $parent->getAttribute('action');
34
  $tmp = explode('#', $formID);
100
  } else {
101
  $input = 'radio';
102
  }
103
+ $formObject->loadHTML('<?xml encoding="utf-8" ?>'."<label class='ebd_input'><input type=\"$input\" $isChecked name=\"ebd_downloads[]\" value=\"$id|$title\"> $title</label>");
104
  $node = $formObject->getElementsByTagName("label");
105
  return $node->item(0);
106
  }
109
  $formObject = new DOMDocument();
110
  $formObject->formatOutput = true;
111
  $title = $this->titles[$key];
112
+ $formObject->loadHTML('<?xml encoding="utf-8" ?>'."<label class='ebd_input'><input type=\"hidden\" name=\"ebd_downloads[]\" value=\"$id|$title\"> </label>");
113
  $node = $formObject->getElementsByTagName("label");
114
  return $node->item(0);
115
  }
116
  private function hidden_dom_obj($name, $value){
117
  $formObject = new DOMDocument();
118
  $formObject->formatOutput = true;
119
+ $formObject->loadHTML('<?xml encoding="utf-8" ?>'."<input type=\"hidden\" class=\"ebd_setting\" name =\"ebd_settings[]\" value=\"$name|$value\">");
120
  $node = $formObject->getElementsByTagName("input");
121
  return $node->item(0);
122
  }
includes/class-email-before-download-shortcode.php CHANGED
@@ -29,6 +29,9 @@ public function init_shortcode($user_atts = array(), $content = null, $tag = 'em
29
  }else{
30
  $user_atts['checked'] = 'checked';
31
  }
 
 
 
32
  }
33
  $user_atts['download_id'] = str_replace(' ', '', $user_atts['download_id']);
34
 
@@ -50,6 +53,7 @@ public function init_shortcode($user_atts = array(), $content = null, $tag = 'em
50
  'link_format' => get_option($this->option_name.'_link_format')
51
  );
52
  $atts = shortcode_atts($default_atts, $user_atts, $tag);
 
53
  $atts['item_id'] = $this->add_item($atts);
54
  $form = new Email_Before_Download_Form($atts);
55
  $this->cf7_check();
29
  }else{
30
  $user_atts['checked'] = 'checked';
31
  }
32
+ }
33
+ if(isset($user_atts['title'])){
34
+
35
  }
36
  $user_atts['download_id'] = str_replace(' ', '', $user_atts['download_id']);
37
 
53
  'link_format' => get_option($this->option_name.'_link_format')
54
  );
55
  $atts = shortcode_atts($default_atts, $user_atts, $tag);
56
+
57
  $atts['item_id'] = $this->add_item($atts);
58
  $form = new Email_Before_Download_Form($atts);
59
  $this->cf7_check();
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: mandsconsulting
3
  Donate link: http://www.mandsconsulting.com/
4
  Tags: email, download
5
- Requires at least: 3.x
6
- Tested up to: 4.7.4
7
  Stable tag: trunk
8
 
9
  Email Before Download presents your users with a form where they submit information, like their name and email address, prior to receiving a download.
@@ -107,6 +107,9 @@ This is the list of all short code attributes that can be used. Some of them o
107
 
108
  == Changelog ==
109
 
 
 
 
110
  =5.0.8=
111
  * Fixed issue with older versions of PHP giving parse errors.
112
  * Added banner and icons for plugin.
2
  Contributors: mandsconsulting
3
  Donate link: http://www.mandsconsulting.com/
4
  Tags: email, download
5
+ Requires at least: 4.x
6
+ Tested up to: 4.9.2
7
  Stable tag: trunk
8
 
9
  Email Before Download presents your users with a form where they submit information, like their name and email address, prior to receiving a download.
107
 
108
  == Changelog ==
109
 
110
+ =5.0.9=
111
+ * Fixed issue with character encoding when building form
112
+
113
  =5.0.8=
114
  * Fixed issue with older versions of PHP giving parse errors.
115
  * Added banner and icons for plugin.