Auto Terms of Service and Privacy Policy - Version 2.0.1

Version Description

Download this release

Release Info

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

Code changes from version 2.0.0 to 2.0.1

includes/admin/action/toggle-action.php CHANGED
@@ -20,8 +20,8 @@ class Toggle_Action extends Action_Base {
20
  $this->_option_name = $name;
21
  }
22
 
23
- protected function _handle($admin_post) {
24
- $option = ! boolval( get_option( $this->_option_name, false ) );
25
  if ( ! empty( $this->_license ) ) {
26
  if ( $this->_license->status() === License::STATUS_FREE ) {
27
  $option = false;
20
  $this->_option_name = $name;
21
  }
22
 
23
+ protected function _handle( $admin_post ) {
24
+ $option = ! (bool) get_option( $this->_option_name, false );
25
  if ( ! empty( $this->_license ) ) {
26
  if ( $this->_license->status() === License::STATUS_FREE ) {
27
  $option = false;
includes/admin/page/compliancekits.php CHANGED
@@ -43,7 +43,7 @@ class Compliancekits extends Settings_Base {
43
  $endorsements,
44
  );
45
  if ( isset( $_REQUEST['box'] ) ) {
46
- foreach ( $this->boxes() as &$box ) {
47
  if ( $box->id() == $_REQUEST['box'] ) {
48
  $this->_box = $box;
49
  }
43
  $endorsements,
44
  );
45
  if ( isset( $_REQUEST['box'] ) ) {
46
+ foreach ( $this->boxes() as $box ) {
47
  if ( $box->id() == $_REQUEST['box'] ) {
48
  $this->_box = $box;
49
  }
includes/admin/page/settings.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
-
3
- namespace wpautoterms\admin\page;
4
-
5
- use wpautoterms\Countries;
6
- use wpautoterms\option\Choices_Option;
7
- use wpautoterms\option\Text_Option;
8
- use wpautoterms\Util;
9
-
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
- }
13
-
14
- class Settings extends Settings_Base {
15
- const SHORTCODE_OPTION_TEMPLATE = 'shortcode-entry-option';
16
- const SHORTCODE_SELECT_TEMPLATE = 'shortcode-select-option';
17
-
18
-
19
- public function define_options() {
20
- parent::define_options();
21
- new Text_Option( 'site_name',
22
- __( 'Website name', WPAUTOTERMS_SLUG ),
23
- '',
24
- $this->id(), static::SECTION_ID,
25
- static::SHORTCODE_OPTION_TEMPLATE );
26
- new Text_Option( 'site_url',
27
- __( 'Website URL', WPAUTOTERMS_SLUG ),
28
- '',
29
- $this->id(), static::SECTION_ID,
30
- static::SHORTCODE_OPTION_TEMPLATE );
31
- new Text_Option( 'company_name',
32
- __( 'Company name', WPAUTOTERMS_SLUG ),
33
- '',
34
- $this->id(), static::SECTION_ID,
35
- static::SHORTCODE_OPTION_TEMPLATE );
36
- $country = new Choices_Option( 'country',
37
- __( 'Country', WPAUTOTERMS_SLUG ),
38
- '',
39
- $this->id(), static::SECTION_ID,
40
- static::SHORTCODE_SELECT_TEMPLATE, array(
41
- 'data-type' => 'country-selector',
42
- 'data-locale' => get_locale()
43
- ) );
44
- $countries = array();
45
- $current_locale = get_locale();
46
- $loc = setlocale( LC_COLLATE, $current_locale . '.UTF-8' );
47
- foreach ( Countries::get() as $country_code ) {
48
- $countries[ $country_code ] = Countries::translate( $country_code, $current_locale );
49
- }
50
- uasort( $countries, 'strcoll' );
51
- setlocale( LC_COLLATE, $loc );
52
- $country->set_values( $countries );
53
-
54
- new Text_Option( 'state', __( 'State', WPAUTOTERMS_SLUG ), '', $this->id(), static::SECTION_ID,
55
- static::SHORTCODE_OPTION_TEMPLATE, array(
56
- 'data-type' => 'state-selector',
57
- ) );
58
- }
59
-
60
- public function defaults() {
61
- return array(
62
- 'site_name' => get_option( 'blogname' ),
63
- 'site_url' => get_option( 'siteurl' ),
64
- 'company_name' => get_option( 'blogname' ),
65
- 'country' => '',
66
- );
67
- }
68
-
69
- public function enqueue_scripts() {
70
- parent::enqueue_scripts();
71
- wp_enqueue_script( WPAUTOTERMS_SLUG . '_settings', WPAUTOTERMS_PLUGIN_URL . 'js/settings.js',
72
- array( 'underscore', 'wp-util' ), false, true );
73
- $locale = Countries::select_locale( Countries::LOCALE_PATH );
74
- if ( $locale !== false ) {
75
- $locale = $locale[0];
76
- $locale = WPAUTOTERMS_PLUGIN_URL . substr( $locale, strlen( WPAUTOTERMS_PLUGIN_DIR ) );
77
- wp_enqueue_script( WPAUTOTERMS_SLUG . '_countries_locale', $locale, false, false, true );
78
- }
79
- wp_enqueue_script( WPAUTOTERMS_SLUG . '_countries_js', WPAUTOTERMS_PLUGIN_URL . 'js/data/states.js',
80
- false, false, true );
81
- }
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/option/checkbox-option-ex.php CHANGED
@@ -23,7 +23,7 @@ class Checkbox_Option_Ex extends Checkbox_Option {
23
  return false;
24
  }
25
 
26
- return boolval( $input );
27
  }
28
 
29
  public function get_value() {
23
  return false;
24
  }
25
 
26
+ return (bool) $input ;
27
  }
28
 
29
  public function get_value() {
includes/option/checkbox-option.php CHANGED
@@ -14,6 +14,6 @@ class Checkbox_Option extends Option {
14
  }
15
 
16
  public function sanitize( $input ) {
17
- return boolval( $input );
18
  }
19
  }
14
  }
15
 
16
  public function sanitize( $input ) {
17
+ return (bool) $input;
18
  }
19
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wpautoterms
3
  Tags: gdpr, privacy policy, terms and conditions, terms of service, terms of use, disclosure, disclaimer, affiliate, cookies, cookie consent, legal
4
  Requires at least: 4.2
5
  Tested up to: 4.9.7
6
- Stable tag: 2.0.0
7
  License: GPL version 3 or any later version
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -112,8 +112,12 @@ Installing the plugin is easy. Just follow these steps:
112
 
113
  == Changelog ==
114
 
 
 
 
 
115
  = Version 2.0.0 =
116
- * Aug 1, 2018 *
117
  * Update to version 2.0.0
118
  * Complete revamp of Auto Terms of Service and Privacy Policy plugin into our new WP AutoTerms plugin
119
  * Compatibility with Auto Terms of Service and Privacy Policy 1.8.2
3
  Tags: gdpr, privacy policy, terms and conditions, terms of service, terms of use, disclosure, disclaimer, affiliate, cookies, cookie consent, legal
4
  Requires at least: 4.2
5
  Tested up to: 4.9.7
6
+ Stable tag: 2.0.1
7
  License: GPL version 3 or any later version
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
112
 
113
  == Changelog ==
114
 
115
+ = Version 2.0.1 =
116
+ * Aug 1, 2018
117
+ * Bugfixes for version 2.0.0
118
+
119
  = Version 2.0.0 =
120
+ * Aug 1, 2018
121
  * Update to version 2.0.0
122
  * Complete revamp of Auto Terms of Service and Privacy Policy plugin into our new WP AutoTerms plugin
123
  * Compatibility with Auto Terms of Service and Privacy Policy 1.8.2