Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed behaviour of cross in bar #279

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules/
vendor/
docs/
dist/
.idea/*
composer.phar
9 changes: 7 additions & 2 deletions admin/class-gdpr-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ public function sanitize_cookie_categories( $cookie_categories ) {
*/
public function register_settings() {
$settings = array(

'gdpr_popUpVersion' =>'sanitize_text_field',
'gdrp_closeAccept' => 'sanitize_text_field',
'gdpr_cookie_privacy_button_help' => 'sanitize_text_field',
'gdpr_cookie_banner_content' => array( $this, 'sanitize_with_links' ),
'gdpr_cookie_privacy_excerpt' => 'sanitize_textarea_field',
'gdpr_cookie_privacy_excerpt' => array( $this, 'sanitize_with_links' ),
'gdpr_cookie_popup_content' => array( $this, 'sanitize_cookie_categories' ),
'gdpr_email_limit' => 'intval',
'gdpr_consent_types' => array( $this, 'sanitize_consents' ),
Expand All @@ -201,7 +205,7 @@ public function register_settings() {
'gdpr_display_cookie_categories_in_bar' => 'boolval',
'gdpr_hide_from_bots' => 'boolval',
'gdpr_reconsent_template' => 'sanitize_text_field',
'gdpr_privacy_bar_position' => 'sanitize_text_field',
'gdpr_privacy_bar_position' => 'sanitize_text_field',
);
foreach ( $settings as $option_name => $sanitize_callback ) {
register_setting( 'gdpr', $option_name, array( 'sanitize_callback' => $sanitize_callback ) );
Expand All @@ -216,6 +220,7 @@ public function register_settings() {
* @author Fernando Claussen <[email protected]>
*/
public function sanitize_with_links( $string ) {

return wp_kses( $string, $this->allowed_html );
}

Expand Down
57 changes: 56 additions & 1 deletion admin/partials/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
<input type="checkbox" name="gdpr_deletion_needs_review" id="gdpr_deletion_needs_review" value="1" <?php checked( $needs_review, true ); ?>><span class="description"><label for="gdpr_deletion_needs_review"><?php esc_html_e( 'Send all deletion requests to the review table.', 'gdpr' ); ?></label></span>
</td>
</tr>


<tr>
<th scope="row">
<label for="gdpr_refresh_after_preferences_update"><?php esc_html_e( 'Refresh page after updating preferences', 'gdpr' ); ?>:</label>
Expand All @@ -46,6 +48,20 @@
<span class="description"><?php esc_html_e( 'Useful for landing pages or to track a visit with Google Analytics.', 'gdpr' ); ?></span>
</td>
</tr>

<tr>
<th scope="row">
<label for="gdpr_popUpVersion"><?php esc_html_e( 'Popup var version', 'gdpr' ); ?>:</label>
</th>
<td>
<?php $popupVersion = get_option( 'gdpr_popUpVersion', 1 ); ?>
<input type="text" name="gdpr_popUpVersion" id="gdpr_popUpVersion" value="<?php echo esc_html($popupVersion,1)?> ">
<span class="description"><?php esc_html_e( 'Useful for reset bar consent', 'gdpr' ); ?></span>
</td>
</tr>

gdpr_popUpVersion

<tr>
<th scope="row">
<label for="gdpr_disable_css"><?php esc_html_e( 'Disable CSS', 'gdpr' ); ?>:</label>
Expand Down Expand Up @@ -96,6 +112,22 @@
</select>
</td>
</tr>

<tr>
<th scope="row">
<label for="gdrp_closeAccept"><?php esc_html_e( 'If close modal means accept', 'gdpr' ); ?>:</label>

</th>
<td>
<?php $close_accept = get_option( 'gdrp_closeAccept', 'modal' ); ?>
<select name="gdrp_closeAccept" id="gdrp_closeAccept">
<option value="1" <?php selected( '1', $close_accept ); ?>><?php esc_html_e( 'Accept', 'gdpr' ); ?></option>
<option value="0" <?php selected( '0', $close_accept ); ?>><?php esc_html_e( 'No Accept', 'gdpr' ); ?></option>
</select>
</td>
</tr>


</tbody>
</table>
<hr>
Expand Down Expand Up @@ -132,7 +164,8 @@
</th>
<td>
<?php $privacy_bar_content = get_option( 'gdpr_cookie_banner_content', '' ); ?>
<textarea name="gdpr_cookie_banner_content" id="gdpr_cookie_banner_content" cols="80" rows="6"><?php echo esc_html( $privacy_bar_content ); ?></textarea>
<textarea name="gdpr_cookie_banner_content" id="gdpr_cookie_banner_content" cols="80" rows="6"><?php echo esc_html( $privacy_bar_content ); ?></textarea></br>
<?php esc_html_e('This text is managed by translation. The translation key is [Privacy Text Bar]. If you don\'t have translations then textarea content is used ','gdpr')?>
</td>
</tr>
<tr>
Expand All @@ -146,9 +179,31 @@
<td>
<?php $privacy_excerpt = get_option( 'gdpr_cookie_privacy_excerpt', '' ); ?>
<textarea name="gdpr_cookie_privacy_excerpt" id="gdpr_cookie_privacy_excerpt" cols="80" rows="6"><?php echo esc_html( $privacy_excerpt ); ?></textarea>

<?php esc_html_e('This text is managed by translation. The translation key is [Privacy Text Consent] .If you don\'t have translations then textarea content is used ','gdpr')?>
<p class="description"><?php esc_html_e( 'This will appear in the consent section of the privacy preference window.', 'gdpr' ); ?></p>
</td>
</tr>


<tr>
<th scope="row">
<label for="gdpr_cookie_privacy_button_help"><?php esc_html_e( 'Privacy button text help', 'gdpr' ); ?>:</label>
<span class="screen-reader-text"><?php esc_attr_e( 'This will show up in the privacy preferences window.', 'gdpr' ); ?></span>
<span data-gdprtooltip="<?php esc_attr_e( 'This will show up in the privacy preferences window.', 'gdpr' ); ?>">
<span class="dashicons dashicons-info"></span>
</span>
</th>
<td>
<?php $privacy_button_help= get_option( 'gdpr_cookie_privacy_button_help', '' ); ?>
<input type="text" name="gdpr_cookie_privacy_button_help" id="gdpr_cookie_privacy_button_help" value="<?php echo esc_html( $privacy_button_help ); ?>">


<?php esc_html_e('This text is managed by translation. The translation key is [Privacy Text Consent button help] .If you don\'t have translations then textarea content is used ','gdpr')?>
<p class="description"><?php esc_html_e( 'This will appear in the consent section of the privacy preference window.', 'gdpr' ); ?></p>
</td>
</tr>

<tr>
<th scope="row">
<label for="gdpr_privacy_bar_position"><?php esc_html_e( 'Privacy Bar Position', 'gdpr' ); ?>:</label>
Expand Down
4 changes: 2 additions & 2 deletions gdpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin Name: GDPR
* Plugin URI: https://trewknowledge.com
* Description: This plugin is meant to assist a Controller, Data Processor, and Data Protection Officer (DPO) with efforts to meet the obligations and rights enacted under the GDPR.
* Version: 2.1.2
* Version: 2.1.4
* Author: Trew Knowledge
* Author URI: https://trewknowledge.com
* License: GPL-2.0+
Expand All @@ -35,7 +35,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'GDPR_VERSION', '2.1.2' );
define( 'GDPR_VERSION', '2.1.4' );

/**
* The minimum PHP version required to run the plugin.
Expand Down
60 changes: 30 additions & 30 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var gulp = require('gulp');
var uglify = require('gulp-uglify-es').default;
var $ = require('gulp-load-plugins')();
var gulp = require( 'gulp' );
var uglify = require( 'gulp-uglify-es' ).default;
var $ = require( 'gulp-load-plugins' )();

var paths = {
src: {
Expand All @@ -21,80 +21,80 @@ var paths = {
}
};

function errorLog(error) {
console.log(error.message);
this.emit('end');
function errorLog( error ) {
console.log( error.message );
this.emit( 'end' );
}

gulp.task('pot', function() {
gulp.task( 'pot', function() {
return gulp.src( paths.src.php )
.pipe( $.wpPot( {
domain: 'gdpr'
} ) )
.pipe( gulp.dest( paths.dest.pot + 'gdpr.pot' ) );
});
} );

gulp.task('admin-css', function() {
gulp.task( 'admin-css', function() {
return gulp.src( paths.src.admin.css )
.pipe( $.sass( {
outputStyle: 'compressed'
} ) )
.on('error', errorLog)
.on( 'error', errorLog )
.pipe( $.autoprefixer( 'last 4 versions' ) )
.pipe( $.rename( 'gdpr-admin.css' ) )
.pipe( gulp.dest( paths.dest.css ) )
.pipe( $.livereload() )
.pipe( $.notify( {
message: 'Admin SASS style task complete'
} ) );
});
} );

gulp.task('public-css', function() {
gulp.task( 'public-css', function() {
return gulp.src( paths.src.public.css )
.pipe( $.sass( {
outputStyle: 'compressed'
} ) )
.on('error', errorLog)
.on( 'error', errorLog )
.pipe( $.autoprefixer( 'last 4 versions' ) )
.pipe( $.rename( 'gdpr-public.css' ) )
.pipe( gulp.dest( paths.dest.css ) )
.pipe( $.livereload() )
.pipe( $.notify( {
message: 'Admin SASS style task complete'
} ) );
});
} );

gulp.task('admin-js', function() {
gulp.task( 'admin-js', function() {
return gulp.src( paths.src.admin.js )
.pipe( $.concat( 'gdpr-admin.js' ) )
.pipe( uglify() )
.on('error', errorLog)
.on( 'error', errorLog )
.pipe( gulp.dest( paths.dest.js ) )
.pipe($.livereload())
.pipe( $.livereload() )
.pipe( $.notify( {
message: 'Admin JS script task complete'
} ) );
});
} );

gulp.task('public-js', function() {
gulp.task( 'public-js', function() {
return gulp.src( paths.src.public.js )
.pipe( $.concat( 'gdpr-public.js' ) )
.pipe( uglify() )
.on('error', errorLog)
.on( 'error', errorLog )
.pipe( gulp.dest( paths.dest.js ) )
.pipe($.livereload())
.pipe( $.livereload() )
.pipe( $.notify( {
message: 'Public JS script task complete'
} ) );
});
} );

gulp.task('watch', function(){
gulp.task( 'watch', function() {
$.livereload.listen();
gulp.watch( paths.src.php, $.livereload.reload);
gulp.watch( paths.src.admin.css, ['admin-css']);
gulp.watch( paths.src.public.css, ['public-css']);
gulp.watch( paths.src.admin.js, ['admin-js']);
gulp.watch( paths.src.public.js, ['public-js']);
});
gulp.watch( paths.src.php, $.livereload.reload );
gulp.watch( paths.src.admin.css, [ 'admin-css' ] );
gulp.watch( paths.src.public.css, [ 'public-css' ] );
gulp.watch( paths.src.admin.js, [ 'admin-js' ] );
gulp.watch( paths.src.public.js, [ 'public-js' ] );
} );

gulp.task('default', ['admin-css', 'public-css', 'admin-js', 'public-js', 'pot', 'watch']);
gulp.task( 'default', [ 'admin-css', 'public-css', 'admin-js', 'public-js', 'pot', 'watch' ] );
Loading