Email Before Download - Version 5.1.7

Version Description

Download this release

Release Info

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

Code changes from version 5.1.6 to 5.1.7

admin/class-email-before-download-admin.php CHANGED
@@ -201,7 +201,7 @@ class Email_Before_Download_Admin
201
  }
202
  public function email_before_download_support_cb()
203
  {
204
- echo "<span class='subtitle'>". __('Email Before Download started as a plugin we developed for personal in-house needs. We realized this could be useful to other WordPress users. At that point, we made the decision to release the plugin for anyone to use. We apologize if we cannot provide support to you on an individual or timely basis. However, please feel free to post in the WordPress forums where we hope your questions can be answered by the WordPress community.', 'email-before-download')."</span>";
205
  echo "<ul>
206
  <li><a href=\"https://www.mandsconsulting.com/products/wp-email-before-download\" target=\"_blank\">".__('Plugin Homepage at M&amp;S Consulting with Live Demos and Test Download','email-before-download')."</a></li>
207
  <li><a href=\"https://wordpress.org/plugins/email-before-download/V\" target=\"_blank\">". __('Plugin Homepage at WordPress', 'email-before-download')."</a></li>
@@ -225,7 +225,7 @@ class Email_Before_Download_Admin
225
  <?php _e('Both','email-before-download'); ?>
226
  </option>
227
  </select>
228
- <span class="subtitle"> <?php _e('Can be overridden in the shortcode with: delivery_format="inline link/send email/both" ','email-before-downlaod'); ?></span>
229
 
230
  <?php
231
  }
@@ -265,7 +265,7 @@ class Email_Before_Download_Admin
265
  1 week
266
  </option>
267
  </select>
268
- <span class="subtitle"> <?php _e('This option expires the link after a set period of time. <br>It can be overridden in the shortcode with: expire_time="X minute/hour/day/week".','email-before-downlaod'); ?></span>
269
  <?php
270
  }
271
 
@@ -274,7 +274,7 @@ class Email_Before_Download_Admin
274
  ?>
275
  <textarea class="ebd_input" cols="40" rows="10"
276
  name="<?php echo $this->option_name . '_forbidden' ?>"><?php echo get_option($this->option_name . '_forbidden'); ?></textarea>
277
- <span class="subtitle"><?php _e('A comma separated list of the forbidden domains','email-before-download'); ?></span>
278
  <?php
279
  }
280
 
@@ -289,7 +289,7 @@ class Email_Before_Download_Admin
289
  _self
290
  </option>
291
  </select>
292
- <span class="subtitle"><i> <?php _e('This option can be overridden in the shortcode with: link_format="_self/_blank"','email-before-download'); ?></i></span>
293
  <?php
294
  }
295
 
@@ -298,7 +298,7 @@ class Email_Before_Download_Admin
298
  ?>
299
  <input type="text" size="40" name="<?php echo $this->option_name . '_link_css' ?>"
300
  value="<?php echo get_option($this->option_name . '_link_css'); ?>"/>
301
- <span class="subtitle"> <?php _e('CSS class used to render the div and the link','email-before-download'); ?></span>
302
  <?php
303
  }
304
 
@@ -307,7 +307,7 @@ class Email_Before_Download_Admin
307
  ?>
308
  <input type="text" size="40" name="<?php echo $this->option_name . '_html_before' ?>"
309
  value="<?php echo get_option($this->option_name . '_html_before'); ?>"/>
310
- <span class="subtitle"> <?php _e('HTML you want to be added before the link','email-before-dowjnload'); ?></span>
311
  <?php
312
  }
313
 
@@ -316,7 +316,7 @@ class Email_Before_Download_Admin
316
  ?>
317
  <input type="text" size="40" name="<?php echo $this->option_name . '_html_after' ?>"
318
  value="<?php echo get_option($this->option_name . '_html_after'); ?>"/>
319
- <span class="subtitle"> <?php _e('HTML you want to be added after the link','email-before-download'); ?> </span>
320
  <?php
321
  }
322
 
@@ -325,7 +325,7 @@ class Email_Before_Download_Admin
325
  ?>
326
  <textarea class="ebd_input" cols="40" rows="10"
327
  name="<?php echo $this->option_name . '_single_email' ?>"><?php echo get_option($this->option_name . '_single_email'); ?></textarea>
328
- <span class="subtitle"> <?php _e("[file_name] and [file_url] are specific placeholders for Email Before Download. Placeholders from Contact Form 7 can be used as long as your form has the same fields. If a placeholder is used with no corresponding form field, it will be ignored.",'email-before-download'); ?><br>
329
  <br><?php _e('Note. If you leave this field empty, The default template will be used.','email-before-download'); ?>
330
  <p><?php _e("The Default template is:<br><strong> Here is the download for",'email-before-download'); echo htmlentities('<a href="[file_url]">[file_name]</a>'); _e("that you requested.</strong>",'email-before-download'); ?>
331
  </p></span>
@@ -337,7 +337,7 @@ class Email_Before_Download_Admin
337
  ?>
338
  <textarea class="ebd_input" cols="40" rows="10"
339
  name="<?php echo $this->option_name . '_multi_email' ?>"><?php echo get_option($this->option_name . '_multi_email'); ?></textarea>
340
- <span class="subtitle"><?php _e('The same rules apply to this template as the single URL template. <br>Use the following placeholder for multiple urls: [file_urls]</br> If this is left blank, a list of URLs will be sent.','email-before-download'); ?> </span>
341
  <?php
342
  }
343
 
@@ -347,7 +347,7 @@ class Email_Before_Download_Admin
347
  <input type="checkbox" size="40" id="<?php echo $this->option_name . '_attachment' ?>"
348
  name="<?php echo $this->option_name . '_attachment' ?>"
349
  value="1" <?php if (get_option($this->option_name . '_attachment')) echo 'checked="checked"'; ?> />
350
- <span class="subtitle"><?php _e('This can only be applied to the files uploaded using Download Monitor plugin.<br> This option can be overridden in the shorcode with: attachment="yes/no"','email-before-download');?></span>
351
  <?php
352
  }
353
 
@@ -356,7 +356,7 @@ class Email_Before_Download_Admin
356
  ?>
357
  <input type="text" size="40" name="<?php echo $this->option_name . '_subject' ?>"
358
  value="<?php echo get_option($this->option_name . '_subject'); ?>"/>
359
- <span class="subtitle"><?php _e('If this field is left blank, the default subject is: "Your requested file(s)".','email-before-download');?></span>
360
  <?php
361
  }
362
  public function email_before_download_email_from_cb()
@@ -364,7 +364,7 @@ class Email_Before_Download_Admin
364
  ?>
365
  <input type="text" size="40" name="<?php echo $this->option_name . '_email_from' ?>"
366
  value="<?php echo get_option($this->option_name . '_email_from'); ?>"/>
367
- <span class="subtitle"><?php _e('Email address used to deliver the download links. If this field is left blank, the default wordpress email will be used..','email-before-download');?></span>
368
  <?php
369
  }
370
  public function email_before_download_from_name_cb()
@@ -372,7 +372,7 @@ class Email_Before_Download_Admin
372
  ?>
373
  <input type="text" size="40" name="<?php echo $this->option_name . '_from_name' ?>"
374
  value="<?php echo get_option($this->option_name . '_from_name'); ?>"/>
375
- <span class="subtitle"><?php _e('Name used to deliver the download links. If this field is left blank, the default wordpress email name will be used..','email-before-download');?></span>
376
  <?php
377
  }
378
 
@@ -385,7 +385,7 @@ class Email_Before_Download_Admin
385
  ?>
386
  <input type="text" size="40" name="<?php echo $this->option_name . '_default_cf7' ?>"
387
  value="<?php echo get_option($this->option_name . '_default_cf7'); ?>"/>
388
- <span class="subtitle"> <?php _e('If you want to use the same form for all your downloads.</br> This can be overwritten in the shortcode with: contact-form-id="X" ','email-before-download'); ?></span>
389
  <?php
390
  }
391
 
@@ -400,7 +400,7 @@ class Email_Before_Download_Admin
400
  Unchecked
401
  </option>
402
  </select>
403
- <span class="subtitle"><?php _e('The default state of the Multiple Checkboxes.<br> This can be overridden in the shortcode with: checked="yes/no"','email-before-download'); ?></span>
404
  <?php
405
  }
406
 
@@ -415,7 +415,7 @@ class Email_Before_Download_Admin
415
  <?php _e('No','email-before-download'); ?>
416
  </option>
417
  </select>
418
- <span class="subtitle"> <?php _e('Hide the form until user selects a download. <br> This can be overriden in the shortcode with hide_form="yes/no"','email-before-download'); ?></span>
419
  <?php
420
  }
421
 
@@ -430,7 +430,7 @@ class Email_Before_Download_Admin
430
  <?php _e('No','email-before-download'); ?>
431
  </option>
432
  </select>
433
- <span class="subtitle"><?php _e('Radio buttons instead of checkboxes.<br> This can be overridden in the shortcode with: radio="yes/no"','email-before-download'); ?></span>
434
  <?php
435
  }
436
  }
201
  }
202
  public function email_before_download_support_cb()
203
  {
204
+ echo "<span class='ebd_subtitle'>". __('Email Before Download started as a plugin we developed for personal in-house needs. We realized this could be useful to other WordPress users. At that point, we made the decision to release the plugin for anyone to use. We apologize if we cannot provide support to you on an individual or timely basis. However, please feel free to post in the WordPress forums where we hope your questions can be answered by the WordPress community.', 'email-before-download')."</span>";
205
  echo "<ul>
206
  <li><a href=\"https://www.mandsconsulting.com/products/wp-email-before-download\" target=\"_blank\">".__('Plugin Homepage at M&amp;S Consulting with Live Demos and Test Download','email-before-download')."</a></li>
207
  <li><a href=\"https://wordpress.org/plugins/email-before-download/V\" target=\"_blank\">". __('Plugin Homepage at WordPress', 'email-before-download')."</a></li>
225
  <?php _e('Both','email-before-download'); ?>
226
  </option>
227
  </select>
228
+ <span class="ebd_subtitle"> <?php _e('Can be overridden in the shortcode with: delivery_format="inline link/send email/both" ','email-before-downlaod'); ?></span>
229
 
230
  <?php
231
  }
265
  1 week
266
  </option>
267
  </select>
268
+ <span class="ebd_subtitle"> <?php _e('This option expires the link after a set period of time. <br>It can be overridden in the shortcode with: expire_time="X minute/hour/day/week".','email-before-downlaod'); ?></span>
269
  <?php
270
  }
271
 
274
  ?>
275
  <textarea class="ebd_input" cols="40" rows="10"
276
  name="<?php echo $this->option_name . '_forbidden' ?>"><?php echo get_option($this->option_name . '_forbidden'); ?></textarea>
277
+ <span class="ebd_subtitle"><?php _e('A comma separated list of the forbidden domains','email-before-download'); ?></span>
278
  <?php
279
  }
280
 
289
  _self
290
  </option>
291
  </select>
292
+ <span class="ebd_subtitle"><i> <?php _e('This option can be overridden in the shortcode with: link_format="_self/_blank"','email-before-download'); ?></i></span>
293
  <?php
294
  }
295
 
298
  ?>
299
  <input type="text" size="40" name="<?php echo $this->option_name . '_link_css' ?>"
300
  value="<?php echo get_option($this->option_name . '_link_css'); ?>"/>
301
+ <span class="ebd_subtitle"> <?php _e('CSS class used to render the div and the link','email-before-download'); ?></span>
302
  <?php
303
  }
304
 
307
  ?>
308
  <input type="text" size="40" name="<?php echo $this->option_name . '_html_before' ?>"
309
  value="<?php echo get_option($this->option_name . '_html_before'); ?>"/>
310
+ <span class="ebd_subtitle"> <?php _e('HTML you want to be added before the link','email-before-dowjnload'); ?></span>
311
  <?php
312
  }
313
 
316
  ?>
317
  <input type="text" size="40" name="<?php echo $this->option_name . '_html_after' ?>"
318
  value="<?php echo get_option($this->option_name . '_html_after'); ?>"/>
319
+ <span class="ebd_subtitle"> <?php _e('HTML you want to be added after the link','email-before-download'); ?> </span>
320
  <?php
321
  }
322
 
325
  ?>
326
  <textarea class="ebd_input" cols="40" rows="10"
327
  name="<?php echo $this->option_name . '_single_email' ?>"><?php echo get_option($this->option_name . '_single_email'); ?></textarea>
328
+ <span class="ebd_subtitle"> <?php _e("[file_name] and [file_url] are specific placeholders for Email Before Download. Placeholders from Contact Form 7 can be used as long as your form has the same fields. If a placeholder is used with no corresponding form field, it will be ignored.",'email-before-download'); ?><br>
329
  <br><?php _e('Note. If you leave this field empty, The default template will be used.','email-before-download'); ?>
330
  <p><?php _e("The Default template is:<br><strong> Here is the download for",'email-before-download'); echo htmlentities('<a href="[file_url]">[file_name]</a>'); _e("that you requested.</strong>",'email-before-download'); ?>
331
  </p></span>
337
  ?>
338
  <textarea class="ebd_input" cols="40" rows="10"
339
  name="<?php echo $this->option_name . '_multi_email' ?>"><?php echo get_option($this->option_name . '_multi_email'); ?></textarea>
340
+ <span class="ebd_subtitle"><?php _e('The same rules apply to this template as the single URL template. <br>Use the following placeholder for multiple urls: [file_urls]</br> If this is left blank, a list of URLs will be sent.','email-before-download'); ?> </span>
341
  <?php
342
  }
343
 
347
  <input type="checkbox" size="40" id="<?php echo $this->option_name . '_attachment' ?>"
348
  name="<?php echo $this->option_name . '_attachment' ?>"
349
  value="1" <?php if (get_option($this->option_name . '_attachment')) echo 'checked="checked"'; ?> />
350
+ <span class="ebd_subtitle"><?php _e('This can only be applied to the files uploaded using Download Monitor plugin.<br> This option can be overridden in the shorcode with: attachment="yes/no"','email-before-download');?></span>
351
  <?php
352
  }
353
 
356
  ?>
357
  <input type="text" size="40" name="<?php echo $this->option_name . '_subject' ?>"
358
  value="<?php echo get_option($this->option_name . '_subject'); ?>"/>
359
+ <span class="ebd_subtitle"><?php _e('If this field is left blank, the default subject is: "Your requested file(s)".','email-before-download');?></span>
360
  <?php
361
  }
362
  public function email_before_download_email_from_cb()
364
  ?>
365
  <input type="text" size="40" name="<?php echo $this->option_name . '_email_from' ?>"
366
  value="<?php echo get_option($this->option_name . '_email_from'); ?>"/>
367
+ <span class="ebd_subtitle"><?php _e('Email address used to deliver the download links. If this field is left blank, the default wordpress email will be used..','email-before-download');?></span>
368
  <?php
369
  }
370
  public function email_before_download_from_name_cb()
372
  ?>
373
  <input type="text" size="40" name="<?php echo $this->option_name . '_from_name' ?>"
374
  value="<?php echo get_option($this->option_name . '_from_name'); ?>"/>
375
+ <span class="ebd_subtitle"><?php _e('Name used to deliver the download links. If this field is left blank, the default wordpress email name will be used..','email-before-download');?></span>
376
  <?php
377
  }
378
 
385
  ?>
386
  <input type="text" size="40" name="<?php echo $this->option_name . '_default_cf7' ?>"
387
  value="<?php echo get_option($this->option_name . '_default_cf7'); ?>"/>
388
+ <span class="ebd_subtitle"> <?php _e('If you want to use the same form for all your downloads.</br> This can be overwritten in the shortcode with: contact-form-id="X" ','email-before-download'); ?></span>
389
  <?php
390
  }
391
 
400
  Unchecked
401
  </option>
402
  </select>
403
+ <span class="ebd_subtitle"><?php _e('The default state of the Multiple Checkboxes.<br> This can be overridden in the shortcode with: checked="yes/no"','email-before-download'); ?></span>
404
  <?php
405
  }
406
 
415
  <?php _e('No','email-before-download'); ?>
416
  </option>
417
  </select>
418
+ <span class="ebd_subtitle"> <?php _e('Hide the form until user selects a download. <br> This can be overriden in the shortcode with hide_form="yes/no"','email-before-download'); ?></span>
419
  <?php
420
  }
421
 
430
  <?php _e('No','email-before-download'); ?>
431
  </option>
432
  </select>
433
+ <span class="ebd_subtitle"><?php _e('Radio buttons instead of checkboxes.<br> This can be overridden in the shortcode with: radio="yes/no"','email-before-download'); ?></span>
434
  <?php
435
  }
436
  }
admin/css/email-before-download-admin.css CHANGED
@@ -13,7 +13,7 @@
13
  .form-table tr {
14
  border-bottom: 1px solid #ddd;
15
  }
16
- span.subtitle {
17
  float: right;
18
  width: 50%;
19
  }
13
  .form-table tr {
14
  border-bottom: 1px solid #ddd;
15
  }
16
+ span.ebd_subtitle {
17
  float: right;
18
  width: 50%;
19
  }
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.1.6
15
  * Author: M&S Consulting
16
  * Author URI: mandsconsulting.com
17
  * License: GPL-2.0+
@@ -24,7 +24,7 @@ if ( ! defined( 'WPINC' ) ) {
24
  die;
25
  }
26
 
27
- define( 'PLUGIN_NAME_VERSION', '5.1.6' );
28
 
29
  function activate_email_before_download() {
30
  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.1.7
15
  * Author: M&S Consulting
16
  * Author URI: mandsconsulting.com
17
  * License: GPL-2.0+
24
  die;
25
  }
26
 
27
+ define( 'PLUGIN_NAME_VERSION', '5.1.7' );
28
 
29
  function activate_email_before_download() {
30
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-email-before-download-activator.php';
includes/class-email-before-download-db.php CHANGED
@@ -153,7 +153,7 @@ class Email_Before_Download_DB
153
  return $csv;
154
  }
155
  public function get_ajax_links($email){
156
- $time = time() - 25;
157
 
158
  $linkQuery = "
159
  SELECT uid, selected_id
153
  return $csv;
154
  }
155
  public function get_ajax_links($email){
156
+ $time = time() - 30;
157
 
158
  $linkQuery = "
159
  SELECT uid, selected_id
includes/class-email-before-download-form.php CHANGED
@@ -32,7 +32,7 @@ class Email_Before_Download_Form
32
  $form = new DOMDocument;
33
  libxml_use_internal_errors(true);
34
  $form->formatOutput = true;
35
- $form->loadHTML('<?xml encoding="utf-8" ?>'.$raw);
36
  $parent = $form->getElementsByTagName('form')->item(0);
37
  $formID = $parent->getAttribute('action');
38
  $tmp = explode('#', $formID);
@@ -77,7 +77,7 @@ class Email_Before_Download_Form
77
  } else {
78
  $input = 'radio';
79
  }
80
- $formObject->loadHTML('<?xml encoding="utf-8" ?>'."<label class='ebd_input'><input type=\"$input\" $isChecked name=\"ebd_downloads[]\" value=\"$id|$title\"> $title</label>");
81
  $node = $formObject->getElementsByTagName("label");
82
  return $node->item(0);
83
  }
@@ -86,14 +86,14 @@ class Email_Before_Download_Form
86
  $formObject = new DOMDocument();
87
  $formObject->formatOutput = true;
88
  $title = $this->titles[$key];
89
- $formObject->loadHTML('<?xml encoding="utf-8" ?>'."<label class='ebd_input'><input type=\"hidden\" name=\"ebd_downloads[]\" value=\"$id|$title\"> </label>");
90
  $node = $formObject->getElementsByTagName("label");
91
  return $node->item(0);
92
  }
93
  private function hidden_dom_obj($name, $value){
94
  $formObject = new DOMDocument();
95
  $formObject->formatOutput = true;
96
- $formObject->loadHTML('<?xml encoding="utf-8" ?>'."<input type=\"hidden\" class=\"ebd_setting\" name =\"ebd_settings[]\" value=\"$name|$value\">");
97
  $node = $formObject->getElementsByTagName("input");
98
  return $node->item(0);
99
  }
32
  $form = new DOMDocument;
33
  libxml_use_internal_errors(true);
34
  $form->formatOutput = true;
35
+ $form->loadHTML(mb_convert_encoding($raw, 'HTML-ENTITIES', 'UTF-8'));
36
  $parent = $form->getElementsByTagName('form')->item(0);
37
  $formID = $parent->getAttribute('action');
38
  $tmp = explode('#', $formID);
77
  } else {
78
  $input = 'radio';
79
  }
80
+ $formObject->loadHTML("<label class='ebd_input'><input type=\"$input\" $isChecked name=\"ebd_downloads[]\" value=\"$id|$title\"> $title</label>");
81
  $node = $formObject->getElementsByTagName("label");
82
  return $node->item(0);
83
  }
86
  $formObject = new DOMDocument();
87
  $formObject->formatOutput = true;
88
  $title = $this->titles[$key];
89
+ $formObject->loadHTML("<label class='ebd_input'><input type=\"hidden\" name=\"ebd_downloads[]\" value=\"$id|$title\"> </label>");
90
  $node = $formObject->getElementsByTagName("label");
91
  return $node->item(0);
92
  }
93
  private function hidden_dom_obj($name, $value){
94
  $formObject = new DOMDocument();
95
  $formObject->formatOutput = true;
96
+ $formObject->loadHTML("<input type=\"hidden\" class=\"ebd_setting\" name =\"ebd_settings[]\" value=\"$name|$value\">");
97
  $node = $formObject->getElementsByTagName("input");
98
  return $node->item(0);
99
  }
readme.txt CHANGED
@@ -106,6 +106,8 @@ This is the list of all short code attributes that can be used. Some of them o
106
 
107
 
108
  == Changelog ==
 
 
109
  =5.1.6=
110
  * fixed issue where some people weren't getting ajaxed links
111
  =5.1.5=
106
 
107
 
108
  == Changelog ==
109
+ =5.1.7=
110
+ * Fixed issue with some malformed HTML being created by DOMDocument()
111
  =5.1.6=
112
  * fixed issue where some people weren't getting ajaxed links
113
  =5.1.5=