Version Description
Download this release
Release Info
Developer | wpautoterms |
Plugin | Auto Terms of Service and Privacy Policy |
Version | 2.1.6 |
Comparing to | |
See all releases |
Code changes from version 2.1.5 to 2.1.6
- readme.txt → README.txt +5 -1
- auto-terms-of-service-privacy-policy.php +1 -1
- includes/admin/menu.php +5 -18
- includes/admin/page/settings-page.php +1 -0
- includes/cpt/cpt.php +1 -1
- includes/option/option.php +8 -6
- includes/upgrade.php +14 -0
- templates/links.php +5 -5
readme.txt → README.txt
RENAMED
@@ -4,7 +4,7 @@ Tags: gdpr, privacy policy, terms and conditions, terms of service, terms of use
|
|
4 |
Requires at least: 4.2
|
5 |
Tested up to: 4.9.7
|
6 |
Requires PHP: 5.3
|
7 |
-
Stable tag: 2.1.
|
8 |
License: GPL version 3 or any later version
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -113,6 +113,10 @@ Installing the plugin is easy. Just follow these steps:
|
|
113 |
|
114 |
== Changelog ==
|
115 |
|
|
|
|
|
|
|
|
|
116 |
= Version 2.1.5 =
|
117 |
* Aug 25, 2018
|
118 |
* Bugfix for legal page slug
|
4 |
Requires at least: 4.2
|
5 |
Tested up to: 4.9.7
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 2.1.3
|
8 |
License: GPL version 3 or any later version
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
+
= Version 2.1.6 =
|
117 |
+
* Aug 26, 2018
|
118 |
+
* Bugfix for headers already sent in admin pages
|
119 |
+
|
120 |
= Version 2.1.5 =
|
121 |
* Aug 25, 2018
|
122 |
* Bugfix for legal page slug
|
auto-terms-of-service-privacy-policy.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wpautoterms.com
|
|
5 |
Description: Create Privacy Policy (Simple or GDPR), Terms & Conditions, Disclaimers and more. Compliance Kits to help you be compliant with the law.
|
6 |
Author: WP AutoTerms
|
7 |
Author URI: https://wpautoterms.com
|
8 |
-
Version: 2.1.
|
9 |
License: GPLv2 or later
|
10 |
Text Domain: wpautoterms
|
11 |
Domain Path: /languages
|
5 |
Description: Create Privacy Policy (Simple or GDPR), Terms & Conditions, Disclaimers and more. Compliance Kits to help you be compliant with the law.
|
6 |
Author: WP AutoTerms
|
7 |
Author URI: https://wpautoterms.com
|
8 |
+
Version: 2.1.6
|
9 |
License: GPLv2 or later
|
10 |
Text Domain: wpautoterms
|
11 |
Domain Path: /languages
|
includes/admin/menu.php
CHANGED
@@ -31,7 +31,7 @@ abstract class Menu {
|
|
31 |
/**
|
32 |
* @var Settings_Base[]
|
33 |
*/
|
34 |
-
static
|
35 |
|
36 |
public static function font_sizes() {
|
37 |
return array(
|
@@ -63,33 +63,20 @@ abstract class Menu {
|
|
63 |
$sp = new Settings_Page( static::PAGE_SETTINGS, __( 'Settings', WPAUTOTERMS_SLUG ) );
|
64 |
$sp->set_license( $license );
|
65 |
|
66 |
-
static::$
|
67 |
new Compliancekits( static::PAGE_COMPLIANCE_KITS, __( 'Compliance Kits', WPAUTOTERMS_SLUG ), $license ),
|
68 |
$sp,
|
69 |
$ls,
|
70 |
new Legacy_Settings( static::PAGE_LEGACY_SETTINGS, __( 'Legacy Auto TOS & PP', WPAUTOTERMS_SLUG ) ),
|
71 |
$contact,
|
72 |
);
|
73 |
-
if ( ! get_option( WPAUTOTERMS_OPTION_PREFIX . 'options_activated' ) ) {
|
74 |
-
/**
|
75 |
-
* @var $page page\Base
|
76 |
-
*/
|
77 |
-
foreach ( static::$_pages as $page ) {
|
78 |
-
if ( $page instanceof Settings_Base ) {
|
79 |
-
foreach ( $page->defaults() as $k => $v ) {
|
80 |
-
add_option( WPAUTOTERMS_OPTION_PREFIX . $k, $v );
|
81 |
-
}
|
82 |
-
}
|
83 |
-
}
|
84 |
-
update_option( WPAUTOTERMS_OPTION_PREFIX . WPAUTOTERMS_OPTION_ACTIVATED, true );
|
85 |
-
}
|
86 |
add_action( 'admin_init', array( __CLASS__, 'register_settings' ) );
|
87 |
add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );
|
88 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
|
89 |
}
|
90 |
|
91 |
public static function register_settings() {
|
92 |
-
foreach ( static::$
|
93 |
if ( $page instanceof Settings_Base ) {
|
94 |
$page->define_options();
|
95 |
}
|
@@ -97,7 +84,7 @@ abstract class Menu {
|
|
97 |
}
|
98 |
|
99 |
public static function admin_menu() {
|
100 |
-
foreach ( static::$
|
101 |
$page->register_menu();
|
102 |
}
|
103 |
}
|
@@ -108,7 +95,7 @@ abstract class Menu {
|
|
108 |
return;
|
109 |
}
|
110 |
$page = substr( $page, strlen( $prefix ) );
|
111 |
-
foreach ( static::$
|
112 |
if ( $p->id() == $page ) {
|
113 |
$p->enqueue_scripts();
|
114 |
}
|
31 |
/**
|
32 |
* @var Settings_Base[]
|
33 |
*/
|
34 |
+
static public $pages;
|
35 |
|
36 |
public static function font_sizes() {
|
37 |
return array(
|
63 |
$sp = new Settings_Page( static::PAGE_SETTINGS, __( 'Settings', WPAUTOTERMS_SLUG ) );
|
64 |
$sp->set_license( $license );
|
65 |
|
66 |
+
static::$pages = array(
|
67 |
new Compliancekits( static::PAGE_COMPLIANCE_KITS, __( 'Compliance Kits', WPAUTOTERMS_SLUG ), $license ),
|
68 |
$sp,
|
69 |
$ls,
|
70 |
new Legacy_Settings( static::PAGE_LEGACY_SETTINGS, __( 'Legacy Auto TOS & PP', WPAUTOTERMS_SLUG ) ),
|
71 |
$contact,
|
72 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
add_action( 'admin_init', array( __CLASS__, 'register_settings' ) );
|
74 |
add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );
|
75 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
|
76 |
}
|
77 |
|
78 |
public static function register_settings() {
|
79 |
+
foreach ( static::$pages as $page ) {
|
80 |
if ( $page instanceof Settings_Base ) {
|
81 |
$page->define_options();
|
82 |
}
|
84 |
}
|
85 |
|
86 |
public static function admin_menu() {
|
87 |
+
foreach ( static::$pages as $page ) {
|
88 |
$page->register_menu();
|
89 |
}
|
90 |
}
|
95 |
return;
|
96 |
}
|
97 |
$page = substr( $page, strlen( $prefix ) );
|
98 |
+
foreach ( static::$pages as $p ) {
|
99 |
if ( $p->id() == $page ) {
|
100 |
$p->enqueue_scripts();
|
101 |
}
|
includes/admin/page/settings-page.php
CHANGED
@@ -115,6 +115,7 @@ class Settings_Page extends Settings_Base {
|
|
115 |
public function defaults() {
|
116 |
return array_reduce( Options::all_options(), function ( $acc, $x ) {
|
117 |
$acc[ $x ] = Options::default_value( $x );
|
|
|
118 |
}, array() );
|
119 |
}
|
120 |
|
115 |
public function defaults() {
|
116 |
return array_reduce( Options::all_options(), function ( $acc, $x ) {
|
117 |
$acc[ $x ] = Options::default_value( $x );
|
118 |
+
return $acc;
|
119 |
}, array() );
|
120 |
}
|
121 |
|
includes/cpt/cpt.php
CHANGED
@@ -15,7 +15,7 @@ define( 'WPAUTOTERMS_CAP_PLURAL', WPAUTOTERMS_SLUG . '_pages' );
|
|
15 |
abstract class CPT {
|
16 |
|
17 |
static function init() {
|
18 |
-
add_action( 'init', array( __CLASS__, 'add_caps' ) );
|
19 |
add_filter( 'map_meta_cap', array( __CLASS__, 'map_meta_cap' ), 10, 4 );
|
20 |
add_filter( 'theme_' . WPAUTOTERMS_CPT . '_templates', array( __CLASS__, 'filter_templates' ), 10, 2 );
|
21 |
}
|
15 |
abstract class CPT {
|
16 |
|
17 |
static function init() {
|
18 |
+
add_action( 'init', array( __CLASS__, 'add_caps' ), 0 );
|
19 |
add_filter( 'map_meta_cap', array( __CLASS__, 'map_meta_cap' ), 10, 4 );
|
20 |
add_filter( 'theme_' . WPAUTOTERMS_CPT . '_templates', array( __CLASS__, 'filter_templates' ), 10, 2 );
|
21 |
}
|
includes/option/option.php
CHANGED
@@ -21,11 +21,13 @@ abstract class Option {
|
|
21 |
|
22 |
protected function _prepare_attrs() {
|
23 |
$ret = array();
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
29 |
}
|
30 |
}
|
31 |
|
@@ -94,7 +96,7 @@ abstract class Option {
|
|
94 |
protected function _template_args() {
|
95 |
return array(
|
96 |
'name' => esc_attr( $this->_name ),
|
97 |
-
'value' =>
|
98 |
'tooltip' => $this->_tooltip,
|
99 |
'attrs' => $this->_prepare_attrs(),
|
100 |
'classes' => join( ' ', array_map( 'esc_attr', $this->_classes ) )
|
21 |
|
22 |
protected function _prepare_attrs() {
|
23 |
$ret = array();
|
24 |
+
if ( ! empty( $this->_attrs ) ) {
|
25 |
+
foreach ( $this->_attrs as $k => $attr ) {
|
26 |
+
if ( $attr === null ) {
|
27 |
+
$ret[] = esc_attr( $k );
|
28 |
+
} else {
|
29 |
+
$ret[] = esc_attr( $k ) . '="' . esc_attr( $attr ) . '"';
|
30 |
+
}
|
31 |
}
|
32 |
}
|
33 |
|
96 |
protected function _template_args() {
|
97 |
return array(
|
98 |
'name' => esc_attr( $this->_name ),
|
99 |
+
'value' => $this->get_value(),
|
100 |
'tooltip' => $this->_tooltip,
|
101 |
'attrs' => $this->_prepare_attrs(),
|
102 |
'classes' => join( ' ', array_map( 'esc_attr', $this->_classes ) )
|
includes/upgrade.php
CHANGED
@@ -5,6 +5,7 @@ namespace wpautoterms;
|
|
5 |
use wpautoterms\admin\Menu;
|
6 |
use wpautoterms\admin\Options;
|
7 |
use wpautoterms\admin\page\Legacy_Settings;
|
|
|
8 |
|
9 |
class Upgrade {
|
10 |
public function __construct() {
|
@@ -13,6 +14,19 @@ class Upgrade {
|
|
13 |
|
14 |
public function run() {
|
15 |
if ( ! get_option( WPAUTOTERMS_OPTION_PREFIX . WPAUTOTERMS_OPTION_ACTIVATED ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
flush_rewrite_rules();
|
17 |
update_option( WPAUTOTERMS_OPTION_PREFIX . WPAUTOTERMS_OPTION_ACTIVATED, true );
|
18 |
}
|
5 |
use wpautoterms\admin\Menu;
|
6 |
use wpautoterms\admin\Options;
|
7 |
use wpautoterms\admin\page\Legacy_Settings;
|
8 |
+
use wpautoterms\admin\page\Settings_Base;
|
9 |
|
10 |
class Upgrade {
|
11 |
public function __construct() {
|
14 |
|
15 |
public function run() {
|
16 |
if ( ! get_option( WPAUTOTERMS_OPTION_PREFIX . WPAUTOTERMS_OPTION_ACTIVATED ) ) {
|
17 |
+
/**
|
18 |
+
* @var $page \wpautoterms\admin\page\Base
|
19 |
+
*/
|
20 |
+
foreach ( Menu::$pages as $page ) {
|
21 |
+
if ( $page instanceof Settings_Base ) {
|
22 |
+
$d = $page->defaults();
|
23 |
+
if ( ! empty( $d ) ) {
|
24 |
+
foreach ( $d as $k => $v ) {
|
25 |
+
add_option( WPAUTOTERMS_OPTION_PREFIX . $k, $v );
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
29 |
+
}
|
30 |
flush_rewrite_rules();
|
31 |
update_option( WPAUTOTERMS_OPTION_PREFIX . WPAUTOTERMS_OPTION_ACTIVATED, true );
|
32 |
}
|
templates/links.php
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
<?php
|
2 |
-
if (!defined( 'ABSPATH' )) {
|
3 |
exit;
|
4 |
}
|
5 |
-
$args = array
|
6 |
'post_type' => WPAUTOTERMS_CPT,
|
7 |
'post_status' => 'publish',
|
8 |
'orderby' => 'post_modified',
|
9 |
);
|
10 |
|
11 |
$posts = get_posts( $args );
|
12 |
-
if(empty($posts)) {
|
13 |
return;
|
14 |
}
|
15 |
?>
|
16 |
<div class="wpautoterms-footer"><p>
|
17 |
<?php
|
18 |
-
$links = array
|
19 |
-
foreach ($posts as $post) {
|
20 |
$links[] = '<a href="' . esc_url( get_post_permalink( $post->ID ) ) . '">' . esc_html( $post->post_title ) . '</a>';
|
21 |
}
|
22 |
echo join( '<span class="separator"> ' . get_option( WPAUTOTERMS_OPTION_PREFIX . 'links_separator' ) . ' </span>', $links );
|
1 |
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
exit;
|
4 |
}
|
5 |
+
$args = array(
|
6 |
'post_type' => WPAUTOTERMS_CPT,
|
7 |
'post_status' => 'publish',
|
8 |
'orderby' => 'post_modified',
|
9 |
);
|
10 |
|
11 |
$posts = get_posts( $args );
|
12 |
+
if ( empty( $posts ) ) {
|
13 |
return;
|
14 |
}
|
15 |
?>
|
16 |
<div class="wpautoterms-footer"><p>
|
17 |
<?php
|
18 |
+
$links = array();
|
19 |
+
foreach ( $posts as $post ) {
|
20 |
$links[] = '<a href="' . esc_url( get_post_permalink( $post->ID ) ) . '">' . esc_html( $post->post_title ) . '</a>';
|
21 |
}
|
22 |
echo join( '<span class="separator"> ' . get_option( WPAUTOTERMS_OPTION_PREFIX . 'links_separator' ) . ' </span>', $links );
|