Auto Terms of Service and Privacy Policy - Version 2.3.2

Version Description

Download this release

Release Info

Developer wpautoterms
Plugin Icon Auto Terms of Service and Privacy Policy
Version 2.3.2
Comparing to
See all releases

Code changes from version 2.3.1 to 2.3.2

README.txt CHANGED
@@ -1,10 +1,10 @@
1
- === WP AutoTerms: GDPR Privacy Policy, Cookie Consent Banner, Terms & Conditions ===
2
  Contributors: wpautoterms
3
  Tags: gdpr, privacy policy, terms and conditions, cookie consent, terms of service, disclosure, disclaimer, affiliates, legal
4
  Requires at least: 4.2
5
  Tested up to: 5.3
6
  Requires PHP: 5.3
7
- Stable tag: 2.3.1
8
  License: GPL version 3 or any later version
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -119,6 +119,11 @@ Installing the plugin is easy. Just follow these steps:
119
 
120
  == Changelog ==
121
 
 
 
 
 
 
122
  = Version 2.3.1 =
123
  * Dec 9, 2019
124
  * Fix: Removed the Category template query due to WP Query limitation
1
+ === WP AutoTerms: Privacy Policy Generator, Cookie Notice Banner, Terms & Conditions Generator ===
2
  Contributors: wpautoterms
3
  Tags: gdpr, privacy policy, terms and conditions, cookie consent, terms of service, disclosure, disclaimer, affiliates, legal
4
  Requires at least: 4.2
5
  Tested up to: 5.3
6
  Requires PHP: 5.3
7
+ Stable tag: 2.3.2
8
  License: GPL version 3 or any later version
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
119
 
120
  == Changelog ==
121
 
122
+ = Version 2.3.2 =
123
+ * Jan 27, 2020
124
+ * Fix: Disable plugin if page is AMP endpoint (AMP does not allow JS scripts)
125
+ * Fix: Chrome prevents "Create" button from working due to validation (hidden field)
126
+
127
  = Version 2.3.1 =
128
  * Dec 9, 2019
129
  * Fix: Removed the Category template query due to WP Query limitation
auto-terms-of-service-privacy-policy.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wpautoterms.com
5
  Description: Create Privacy Policy, GDPR Privacy Policy, Terms & Conditions, Disclaimers. Cookie Consent Banner. More Compliance Kits to help you get compliant with the law.
6
  Author: WP AutoTerms
7
  Author URI: https://wpautoterms.com
8
- Version: 2.3.1
9
  License: GPLv2 or later
10
  Text Domain: wpautoterms
11
  Domain Path: /languages
5
  Description: Create Privacy Policy, GDPR Privacy Policy, Terms & Conditions, Disclaimers. Cookie Consent Banner. More Compliance Kits to help you get compliant with the law.
6
  Author: WP AutoTerms
7
  Author URI: https://wpautoterms.com
8
+ Version: 2.3.2
9
  License: GPLv2 or later
10
  Text Domain: wpautoterms
11
  Domain Path: /languages
includes/frontend.php CHANGED
@@ -45,7 +45,7 @@ abstract class Frontend {
45
  add_filter( 'cache_enabler_before_store', $body_handler );
46
  ob_start( array( __CLASS__, '_out_head' ) );
47
  }
48
- add_action( WPAUTOTERMS_SLUG . '_registered_cpt', array( __CLASS__, 'action_registered_cpt' ), 20 );
49
  add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
50
  add_action( 'wp_footer', array( __CLASS__, 'footer' ), 100002 );
51
  $a = Update_Notice::create();
@@ -80,7 +80,10 @@ abstract class Frontend {
80
  }
81
  }
82
 
83
- public static function action_registered_cpt() {
 
 
 
84
  if ( ! static::$_compat ) {
85
  static::$_body_top = static::top_container( true );
86
  }
45
  add_filter( 'cache_enabler_before_store', $body_handler );
46
  ob_start( array( __CLASS__, '_out_head' ) );
47
  }
48
+ add_action( 'wp', array( __CLASS__, 'action_wp' ), 20 );
49
  add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
50
  add_action( 'wp_footer', array( __CLASS__, 'footer' ), 100002 );
51
  $a = Update_Notice::create();
80
  }
81
  }
82
 
83
+ public static function action_wp() {
84
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
85
+ static::$_compat = true;
86
+ }
87
  if ( ! static::$_compat ) {
88
  static::$_body_top = static::top_container( true );
89
  }
includes/frontend/notice/base-notice.php CHANGED
@@ -9,7 +9,6 @@ if ( ! defined( 'ABSPATH' ) ) {
9
  use wpautoterms\frontend\Styles;
10
 
11
  abstract class Base_Notice {
12
-
13
  protected $_where;
14
  protected $_type;
15
  protected $_message;
@@ -26,6 +25,10 @@ abstract class Base_Notice {
26
  $this->_element = $element_class;
27
  }
28
 
 
 
 
 
29
  public function init() {
30
  if ( ! $this->_is_enabled() ) {
31
  return;
@@ -50,7 +53,13 @@ abstract class Base_Notice {
50
  }
51
 
52
  public function enqueue_scripts() {
53
- wp_enqueue_script( WPAUTOTERMS_SLUG . '_js', WPAUTOTERMS_PLUGIN_URL . 'js/wpautoterms.js', array( 'jquery', 'wp-util' ), WPAUTOTERMS_VERSION, true );
 
 
 
 
 
 
54
  wp_localize_script( WPAUTOTERMS_SLUG . '_js', 'wpautoterms_js_' . $this->id(), $this->_localize_args() );
55
  }
56
 
@@ -67,11 +76,14 @@ abstract class Base_Notice {
67
  }
68
 
69
  public function print_styles() {
 
 
 
70
  Styles::print_styles( $this->_id, $this->_element );
71
  }
72
 
73
  public function container( $where, $type ) {
74
- if ( ( $this->_where == $where ) && ( $this->_type == $type ) ) {
75
  $this->_print_box();
76
  }
77
  }
9
  use wpautoterms\frontend\Styles;
10
 
11
  abstract class Base_Notice {
 
12
  protected $_where;
13
  protected $_type;
14
  protected $_message;
25
  $this->_element = $element_class;
26
  }
27
 
28
+ public static function is_amp() {
29
+ return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint();
30
+ }
31
+
32
  public function init() {
33
  if ( ! $this->_is_enabled() ) {
34
  return;
53
  }
54
 
55
  public function enqueue_scripts() {
56
+ if ( static::is_amp() ) {
57
+ return;
58
+ }
59
+ wp_enqueue_script( WPAUTOTERMS_SLUG . '_js', WPAUTOTERMS_PLUGIN_URL . 'js/wpautoterms.js', array(
60
+ 'jquery',
61
+ 'wp-util'
62
+ ), WPAUTOTERMS_VERSION, true );
63
  wp_localize_script( WPAUTOTERMS_SLUG . '_js', 'wpautoterms_js_' . $this->id(), $this->_localize_args() );
64
  }
65
 
76
  }
77
 
78
  public function print_styles() {
79
+ if ( static::is_amp() ) {
80
+ return;
81
+ }
82
  Styles::print_styles( $this->_id, $this->_element );
83
  }
84
 
85
  public function container( $where, $type ) {
86
+ if ( ! static::is_amp() && ( $this->_where == $where ) && ( $this->_type == $type ) ) {
87
  $this->_print_box();
88
  }
89
  }
js/countries.js CHANGED
@@ -42,11 +42,11 @@ jQuery(document).ready(function () {
42
  stateRow.hide();
43
  STATE_INPUT.html("");
44
  STATE_INPUT.val("");
45
- STATE_INPUT.removeAttr("required");
46
  return;
47
  }
48
  stateRow.show();
49
- STATE_INPUT.attr("required", "required");
50
  var options = states.map(function (x) {
51
  return '<option value="' + x + '">' + wpautotermsStates.translations[x] + '</option>';
52
  });
42
  stateRow.hide();
43
  STATE_INPUT.html("");
44
  STATE_INPUT.val("");
45
+ // STATE_INPUT.removeAttr("required");
46
  return;
47
  }
48
  stateRow.show();
49
+ // STATE_INPUT.attr("required", "required");
50
  var options = states.map(function (x) {
51
  return '<option value="' + x + '">' + wpautotermsStates.translations[x] + '</option>';
52
  });
js/post-new.js CHANGED
@@ -1,5 +1,8 @@
1
  jQuery(document).ready(function ($) {
2
  var CREATE_SELECTOR = $("#legal-page-create-selector").show();
 
 
 
3
 
4
  $("[data-type='dismiss-button']").click(function (e) {
5
  var el = $(e.target);
@@ -57,7 +60,8 @@ jQuery(document).ready(function ($) {
57
  }
58
 
59
  function updateSectionRequirements(sectionId, visible) {
60
- jQuery("#" + sectionId + " input[type=radio]").prop("required", visible);
 
61
  }
62
 
63
  var hidden = wpautotermsPostNew.hidden[PAGE_ID];
@@ -65,7 +69,10 @@ jQuery(document).ready(function ($) {
65
  return "#" + x;
66
  }).join(",")).hide();
67
  CONTAINER.find("input[type=radio],input[type=checkbox]").click(updateDependencies);
68
- CONTAINER.find("input[type=radio]:visible").prop("required", true);
 
 
 
69
  CONTAINER.find("input[type='submit'],button[type='submit']").click(function (e) {
70
  CONTAINER.find("input[type=radio]").each(function () {
71
  var t = $(this);
1
  jQuery(document).ready(function ($) {
2
  var CREATE_SELECTOR = $("#legal-page-create-selector").show();
3
+
4
+ $('#post').attr('novalidate', true);
5
+ console.log('#post novalidate');
6
 
7
  $("[data-type='dismiss-button']").click(function (e) {
8
  var el = $(e.target);
60
  }
61
 
62
  function updateSectionRequirements(sectionId, visible) {
63
+ // jQuery("#" + sectionId + " input[type=radio]").prop("required", visible);
64
+ console.log('updateSectionRequirements: ' + sectionId + ' ' + visible);
65
  }
66
 
67
  var hidden = wpautotermsPostNew.hidden[PAGE_ID];
69
  return "#" + x;
70
  }).join(",")).hide();
71
  CONTAINER.find("input[type=radio],input[type=checkbox]").click(updateDependencies);
72
+
73
+ // CONTAINER.find("input[type=radio]:visible").prop("required", true);
74
+ console.log('CONTAINER input[type=radio]:visible');
75
+
76
  CONTAINER.find("input[type='submit'],button[type='submit']").click(function (e) {
77
  CONTAINER.find("input[type=radio]").each(function () {
78
  var t = $(this);
templates/legal-pages/admin/country.php CHANGED
@@ -3,13 +3,11 @@
3
  use wpautoterms\admin\form\Section;
4
 
5
  Section::begin( 'country_name_section', __( 'Your country', WPAUTOTERMS_SLUG ) ); ?>
6
- <select name="country" data-type="country-selector" required="required" class="wpautoterms-hidden">
7
- </select>
8
  <?php Section::end(); ?>
9
 
10
  <div data-type="state-row">
11
  <?php Section::begin( 'state_name_section', __( 'Your state', WPAUTOTERMS_SLUG ) ); ?>
12
- <select name="state" data-type="state-selector" class="wpautoterms-hidden">
13
- </select>
14
  <?php Section::end(); ?>
15
  </div>
3
  use wpautoterms\admin\form\Section;
4
 
5
  Section::begin( 'country_name_section', __( 'Your country', WPAUTOTERMS_SLUG ) ); ?>
6
+ <select name="country" data-type="country-selector" class="wpautoterms-hidden"></select>
 
7
  <?php Section::end(); ?>
8
 
9
  <div data-type="state-row">
10
  <?php Section::begin( 'state_name_section', __( 'Your state', WPAUTOTERMS_SLUG ) ); ?>
11
+ <select name="state" data-type="state-selector" class="wpautoterms-hidden"></select>
 
12
  <?php Section::end(); ?>
13
  </div>
templates/legal-pages/admin/privacy-policy.php CHANGED
@@ -13,11 +13,11 @@ use wpautoterms\admin\form\Section;
13
  <h1><?php _e( 'Privacy Policy', WPAUTOTERMS_SLUG ); ?></h1>
14
 
15
  <?php Section::begin('website_url_section', __('What is your website URL?', WPAUTOTERMS_SLUG)); ?>
16
- <input type="text" name="website_url" class="regular-text" value="<?php echo do_shortcode('[wpautoterms site_url]'); ?>" placeholder="Enter your website URL" required="required" />
17
  <?php Section::end(); ?>
18
 
19
  <?php Section::begin('website_name_section', __('What is your website name?', WPAUTOTERMS_SLUG)); ?>
20
- <input type="text" name="website_name" class="regular-text" value="<?php echo do_shortcode('[wpautoterms site_name]'); ?>" placeholder="Enter your website name" required="required" />
21
  <?php Section::end(); ?>
22
 
23
  <?php
@@ -26,7 +26,7 @@ use wpautoterms\admin\form\Section;
26
 
27
  <?php Section::begin('company_name_section', __('What is your company name?', WPAUTOTERMS_SLUG)); ?>
28
  <p class="text-muted text-small text-note">If this WordPress website is not operated/owned by a registered company or entity, please enter the website name instead.</p>
29
- <input type="text" name="company_name" class="regular-text" value="<?php echo do_shortcode('[wpautoterms company_name]'); ?>" placeholder="Enter your company name" required="required" />
30
  <?php Section::end(); ?>
31
 
32
  <?php Section::begin('user_accounts_section', __('Can users create an account on your website?', WPAUTOTERMS_SLUG)); ?>
13
  <h1><?php _e( 'Privacy Policy', WPAUTOTERMS_SLUG ); ?></h1>
14
 
15
  <?php Section::begin('website_url_section', __('What is your website URL?', WPAUTOTERMS_SLUG)); ?>
16
+ <input type="text" name="website_url" class="regular-text" value="<?php echo do_shortcode('[wpautoterms site_url]'); ?>" placeholder="Enter your website URL" />
17
  <?php Section::end(); ?>
18
 
19
  <?php Section::begin('website_name_section', __('What is your website name?', WPAUTOTERMS_SLUG)); ?>
20
+ <input type="text" name="website_name" class="regular-text" value="<?php echo do_shortcode('[wpautoterms site_name]'); ?>" placeholder="Enter your website name" />
21
  <?php Section::end(); ?>
22
 
23
  <?php
26
 
27
  <?php Section::begin('company_name_section', __('What is your company name?', WPAUTOTERMS_SLUG)); ?>
28
  <p class="text-muted text-small text-note">If this WordPress website is not operated/owned by a registered company or entity, please enter the website name instead.</p>
29
+ <input type="text" name="company_name" class="regular-text" value="<?php echo do_shortcode('[wpautoterms company_name]'); ?>" placeholder="Enter your company name" />
30
  <?php Section::end(); ?>
31
 
32
  <?php Section::begin('user_accounts_section', __('Can users create an account on your website?', WPAUTOTERMS_SLUG)); ?>
templates/legal-pages/admin/terms-and-conditions.php CHANGED
@@ -14,11 +14,11 @@ use wpautoterms\admin\form\Section;
14
  <h1><?php _e('Terms and Conditions', WPAUTOTERMS_SLUG); ?></h1>
15
 
16
  <?php Section::begin('website_url_section', __('What is your website URL?', WPAUTOTERMS_SLUG)); ?>
17
- <input type="text" name="website_url" class="regular-text" value="<?php echo do_shortcode('[wpautoterms site_url]'); ?>" placeholder="Enter your website URL" required="required" />
18
  <?php Section::end(); ?>
19
 
20
  <?php Section::begin('website_name_section', __('What is your website name?', WPAUTOTERMS_SLUG)); ?>
21
- <input type="text" name="website_name" class="regular-text" value="<?php echo do_shortcode('[wpautoterms site_name]'); ?>" placeholder="Enter your website name" required="required" />
22
  <?php Section::end(); ?>
23
 
24
  <?php
@@ -27,7 +27,7 @@ use wpautoterms\admin\form\Section;
27
 
28
  <?php Section::begin('company_name_section', __('What is your company name?', WPAUTOTERMS_SLUG)); ?>
29
  <p class="text-muted text-small text-note">If this WordPress website is not operated/owned by a registered company or entity, please enter the website name instead.</p>
30
- <input type="text" name="company_name" class="regular-text" value="<?php echo do_shortcode('[wpautoterms company_name]'); ?>" placeholder="Enter your company name" required="required" />
31
  <?php Section::end(); ?>
32
 
33
  <?php Section::begin('user_accounts_section', __('Can users create an account on your website?', WPAUTOTERMS_SLUG)); ?>
14
  <h1><?php _e('Terms and Conditions', WPAUTOTERMS_SLUG); ?></h1>
15
 
16
  <?php Section::begin('website_url_section', __('What is your website URL?', WPAUTOTERMS_SLUG)); ?>
17
+ <input type="text" name="website_url" class="regular-text" value="<?php echo do_shortcode('[wpautoterms site_url]'); ?>" placeholder="Enter your website URL" />
18
  <?php Section::end(); ?>
19
 
20
  <?php Section::begin('website_name_section', __('What is your website name?', WPAUTOTERMS_SLUG)); ?>
21
+ <input type="text" name="website_name" class="regular-text" value="<?php echo do_shortcode('[wpautoterms site_name]'); ?>" placeholder="Enter your website name" />
22
  <?php Section::end(); ?>
23
 
24
  <?php
27
 
28
  <?php Section::begin('company_name_section', __('What is your company name?', WPAUTOTERMS_SLUG)); ?>
29
  <p class="text-muted text-small text-note">If this WordPress website is not operated/owned by a registered company or entity, please enter the website name instead.</p>
30
+ <input type="text" name="company_name" class="regular-text" value="<?php echo do_shortcode('[wpautoterms company_name]'); ?>" placeholder="Enter your company name" />
31
  <?php Section::end(); ?>
32
 
33
  <?php Section::begin('user_accounts_section', __('Can users create an account on your website?', WPAUTOTERMS_SLUG)); ?>