Google Analytics Opt-Out - Version 2.0.1

Version Description

  • Plugin can now be translated via translate.wordpress.org
Download this release

Release Info

Developer wp-buddy
Plugin Icon 128x128 Google Analytics Opt-Out
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0.0 to 2.0.1

google-analytics-opt-out.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: Google Analytics Opt-Out
4
  Plugin URI: https://wp-buddy.com/products/plugins/google-analytics-opt-out
5
  Description: Provides an Opt-Out functionality for Google Analytics
6
- Version: 2.0.0
7
  Author: WP-Buddy
8
  Author URI: https://wp-buddy.com
9
  License: GPL2
10
- Text Domain: gaoo
11
  Domain Path: /languages/
12
 
13
  Copyright 2016 WP-Buddy (email : info@wp-buddy.com)
@@ -32,20 +32,17 @@ if ( ! defined( 'ABSPATH' ) ) {
32
  exit;
33
  }
34
 
35
- // For translation purposes
36
- __( 'Google Analytics Opt-Out Pro', 'gaoop' );
37
- __( 'Provides an Opt-Out functionality for Google Analytics', 'gaoop' );
 
38
 
39
  define( 'GAOOP_FILE', __FILE__ );
40
  define( 'GAOOP_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
41
  define( 'GAOOP_URL', trailingslashit( plugins_url() ) . trailingslashit( dirname( plugin_basename( __FILE__ ) ) ) );
42
 
43
- add_action( 'init', function () {
44
- load_plugin_textdomain( 'gaoop', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
45
- } );
46
-
47
  if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
48
- wp_die( sprintf( __( 'You are using PHP in version %s. This version is outdated and cannot be used with the Google Analytics Opt-Out plugin. Please update to the latest PHP version in order to use this plugin. You can ask your provider on how to do this.', 'gaoop' ), PHP_VERSION ) );
49
  }
50
 
51
  require_once GAOOP_PATH . 'inc/functions.php';
@@ -62,7 +59,7 @@ function gaoop_activation() {
62
  }
63
 
64
  if ( is_plugin_active( 'google-analytics-opt-out/google-analytics-opt-out.php' ) ) {
65
- wp_die( __( 'It seems that the free version of the Google Analytics Opt-Out is installed. Please deactivate the free version before activating the pro version. Thanks! ', 'gaoop' ) . '<br /><br /><a href="' . admin_url( 'plugins.php' ) . '">' . __( '&larr; Go back', 'gaoop' ) . '</a>' );
66
  }
67
  }
68
 
3
  Plugin Name: Google Analytics Opt-Out
4
  Plugin URI: https://wp-buddy.com/products/plugins/google-analytics-opt-out
5
  Description: Provides an Opt-Out functionality for Google Analytics
6
+ Version: 2.0.1
7
  Author: WP-Buddy
8
  Author URI: https://wp-buddy.com
9
  License: GPL2
10
+ Text Domain: google-analytics-opt-out
11
  Domain Path: /languages/
12
 
13
  Copyright 2016 WP-Buddy (email : info@wp-buddy.com)
32
  exit;
33
  }
34
 
35
+ add_action( 'init', function () {
36
+ # this is still needed @see https://wordpress.org/support/topic/this-plugin-is-not-properly-prepared-for-localization/#post-6885466
37
+ load_plugin_textdomain( 'google-analytics-opt-out' );
38
+ } );
39
 
40
  define( 'GAOOP_FILE', __FILE__ );
41
  define( 'GAOOP_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
42
  define( 'GAOOP_URL', trailingslashit( plugins_url() ) . trailingslashit( dirname( plugin_basename( __FILE__ ) ) ) );
43
 
 
 
 
 
44
  if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
45
+ wp_die( sprintf( __( 'You are using PHP in version %s. This version is outdated and cannot be used with the Google Analytics Opt-Out plugin. Please update to the latest PHP version in order to use this plugin. You can ask your provider on how to do this.', 'google-analytics-opt-out' ), PHP_VERSION ) );
46
  }
47
 
48
  require_once GAOOP_PATH . 'inc/functions.php';
59
  }
60
 
61
  if ( is_plugin_active( 'google-analytics-opt-out/google-analytics-opt-out.php' ) ) {
62
+ wp_die( __( 'It seems that the free version of the Google Analytics Opt-Out is installed. Please deactivate the free version before activating the pro version. Thanks! ', 'google-analytics-opt-out' ) . '<br /><br /><a href="' . admin_url( 'plugins.php' ) . '">' . __( '&larr; Go back', 'google-analytics-opt-out' ) . '</a>' );
63
  }
64
  }
65
 
inc/admin.php CHANGED
@@ -8,7 +8,7 @@ function gaoop_admin_notice() {
8
  ?>
9
  <div class="error">
10
  <p>
11
- <a href="<?php echo admin_url( 'options-general.php?page=gaoo-options' ); ?>"><?php _e( 'To use the Google Analytics Opt-Out Plugin please enter an UA-Code on the settings page.', 'gaoop' ); ?></a>
12
  </p>
13
  </div>
14
  <?php
@@ -27,8 +27,8 @@ add_action( 'admin_notices', 'gaoop_admin_notice' );
27
  * @return array
28
  */
29
  function gaoop_plugin_action_links( $links ) {
30
- $links[] = '<a href="' . admin_url( 'options-general.php?page=gaoo-options' ) . '">' . __( 'Settings', 'gaoop' ) . '</a>';
31
- $links[] = '<a target="_blank" href="http://wp-buddy.com">' . __( 'More by WP-Buddy', 'gaoop' ) . '</a>';
32
 
33
  return $links;
34
  }
8
  ?>
9
  <div class="error">
10
  <p>
11
+ <a href="<?php echo admin_url( 'options-general.php?page=gaoo-options' ); ?>"><?php _e( 'To use the Google Analytics Opt-Out Plugin please enter an UA-Code on the settings page.', 'google-analytics-opt-out' ); ?></a>
12
  </p>
13
  </div>
14
  <?php
27
  * @return array
28
  */
29
  function gaoop_plugin_action_links( $links ) {
30
+ $links[] = '<a href="' . admin_url( 'options-general.php?page=gaoo-options' ) . '">' . __( 'Settings', 'google-analytics-opt-out' ) . '</a>';
31
+ $links[] = '<a target="_blank" href="http://wp-buddy.com">' . __( 'More by WP-Buddy', 'google-analytics-opt-out' ) . '</a>';
32
 
33
  return $links;
34
  }
inc/frontend.php CHANGED
@@ -16,9 +16,9 @@ function gaoop_footer() {
16
  return;
17
  }
18
  echo '<div style="display: none;" data-gaoop_ua="' . gaoop_get_ua_code() . '" data-gaoop_hide="' . intval( get_option( 'gaoop_hide', 0 ) ) . '" class="gaoop">'
19
- . '<a class="gaoop-info-icon" href="#" title="' . __( 'Google Analytics Opt-Out Information', 'gaoop' ) . '" ><img src="' . apply_filters( 'gaoop_info_icon', GAOOP_URL . 'images/info-icon.png' ) . '" alt="' . __( 'Close', 'gaoop' ) . '" /></a>'
20
  . '<div class="gaoop-opt-out-content">' . $opt_out_text . '</div>'
21
- . '<a class="gaoop-close-icon" href="#" title="' . __( 'Close this and do not ask me again', 'gaoop' ) . '"><img src="' . apply_filters( 'gaoop_close_icon', GAOOP_URL . 'images/close-icon.png' ) . '" alt="' . __( 'Close this and do not ask me again', 'gaoop' ) . '" /></a>'
22
  . '</div>';
23
 
24
  }
@@ -34,11 +34,11 @@ add_action( 'wp_footer', 'gaoop_footer' );
34
  function gaoop_optout_text() {
35
  $opt_out_text = get_option( 'gaoop_opt_out_text', '' );
36
  if ( empty( $opt_out_text ) ) {
37
- $opt_out_text = __( 'This website is using Google Analytics. Please click here if you want to opt-out.', 'gaoop' );
38
  }
39
 
40
  if ( ! has_shortcode( $opt_out_text, 'google_analytics_optout' ) && (bool) get_option( 'gaoop_opt_out_shortcode_integration', 1 ) ) {
41
- $opt_out_text .= sprintf( ' [google_analytics_optout]%s[/google_analytics_optout]', __( 'Click here to opt-out.', 'gaoop' ) );
42
  }
43
 
44
  return $opt_out_text;
16
  return;
17
  }
18
  echo '<div style="display: none;" data-gaoop_ua="' . gaoop_get_ua_code() . '" data-gaoop_hide="' . intval( get_option( 'gaoop_hide', 0 ) ) . '" class="gaoop">'
19
+ . '<a class="gaoop-info-icon" href="#" title="' . __( 'Google Analytics Opt-Out Information', 'google-analytics-opt-out' ) . '" ><img src="' . apply_filters( 'gaoop_info_icon', GAOOP_URL . 'images/info-icon.png' ) . '" alt="' . __( 'Close', 'google-analytics-opt-out' ) . '" /></a>'
20
  . '<div class="gaoop-opt-out-content">' . $opt_out_text . '</div>'
21
+ . '<a class="gaoop-close-icon" href="#" title="' . __( 'Close this and do not ask me again', 'google-analytics-opt-out' ) . '"><img src="' . apply_filters( 'gaoop_close_icon', GAOOP_URL . 'images/close-icon.png' ) . '" alt="' . __( 'Close this and do not ask me again', 'google-analytics-opt-out' ) . '" /></a>'
22
  . '</div>';
23
 
24
  }
34
  function gaoop_optout_text() {
35
  $opt_out_text = get_option( 'gaoop_opt_out_text', '' );
36
  if ( empty( $opt_out_text ) ) {
37
+ $opt_out_text = __( 'This website is using Google Analytics. Please click here if you want to opt-out.', 'google-analytics-opt-out' );
38
  }
39
 
40
  if ( ! has_shortcode( $opt_out_text, 'google_analytics_optout' ) && (bool) get_option( 'gaoop_opt_out_shortcode_integration', 1 ) ) {
41
+ $opt_out_text .= sprintf( ' [google_analytics_optout]%s[/google_analytics_optout]', __( 'Click here to opt-out.', 'google-analytics-opt-out' ) );
42
  }
43
 
44
  return $opt_out_text;
inc/functions.php CHANGED
@@ -93,7 +93,7 @@ function gaoop_opt_out_cookie_set_text() {
93
  return $text;
94
  }
95
 
96
- return __( 'Thanks. We have set a cookie so that Google Analytics data collection will be disabled on your next visit.', 'gaoop' );
97
  }
98
 
99
  add_filter( 'gaoop_opt_out_cookie_set_text', 'gaoop_opt_out_cookie_set_text' );
93
  return $text;
94
  }
95
 
96
+ return __( 'Thanks. We have set a cookie so that Google Analytics data collection will be disabled on your next visit.', 'google-analytics-opt-out' );
97
  }
98
 
99
  add_filter( 'gaoop_opt_out_cookie_set_text', 'gaoop_opt_out_cookie_set_text' );
inc/scripts.php CHANGED
@@ -65,9 +65,9 @@ function gaoop_js( $echo = true ) {
65
  * @since 1.0
66
  */
67
  function gaoop_enqueue_scripts() {
68
- wp_enqueue_script( 'gaoop', GAOOP_URL . 'js/frontend.js', array( 'jquery' ), false, true );
69
  add_filter( 'script_loader_tag', function ( $tag, $handle ) {
70
- if ( $handle === 'gaoop' ) {
71
  return str_replace( '<script', '<script async ', $tag );
72
  }
73
 
65
  * @since 1.0
66
  */
67
  function gaoop_enqueue_scripts() {
68
+ wp_enqueue_script( 'goop', GAOOP_URL . 'js/frontend.js', array( 'jquery' ), false, true );
69
  add_filter( 'script_loader_tag', function ( $tag, $handle ) {
70
+ if ( $handle === 'goop' ) {
71
  return str_replace( '<script', '<script async ', $tag );
72
  }
73
 
inc/settings.php CHANGED
@@ -7,10 +7,10 @@
7
  * @return void
8
  */
9
  function gaoop_admin_menu() {
10
- $hook = add_submenu_page( 'options-general.php', __( 'Analytics Opt-Out', 'gaoop' ), __( 'Analytics Opt-Out', 'gaoop' ), 'manage_options', 'gaoo-options', 'gaoop_settings_page' );
11
  add_action( "load-$hook", 'gaoop_settings_scripts' );
12
 
13
- $hook = add_submenu_page( 'yst_ga_dashboard', __( 'Analytics Opt-Out', 'gaoop' ), __( 'Opt-Out Settings', 'gaoop' ), 'manage_options', 'gaoo-options', 'gaoop_settings_page' );
14
  add_action( "load-$hook", 'gaoop_settings_scripts' );
15
  }
16
 
@@ -27,7 +27,7 @@ function gaoop_settings_page() {
27
  ?>
28
  <div class="wrap">
29
  <div id="icon-options-general" class="icon32"></div>
30
- <h2><?php _e( 'Google Analaytics Opt-Out Pro', 'gaoop' ); ?> </h2>
31
 
32
  <form action="options.php" method="post">
33
  <?php
@@ -60,30 +60,30 @@ function gaoop_settings_scripts() {
60
  */
61
  function gaoop_register_theme_options_section() {
62
 
63
- add_settings_section( 'gaoop_settings_section', __( 'Analytics Opt-Out', 'gaoop' ), null, 'gaoop_options_page' );
64
 
65
- add_settings_field( 'gaoop_yoast', __( 'Use Monster Insights Settings', 'gaoop' ), 'gaoop_options_yoast', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_yoast' ) );
66
  register_setting( 'gaoop_options_page', 'gaoop_yoast', 'intval' );
67
 
68
- add_settings_field( 'gaoop_property', __( 'UA-Code', 'gaoop' ), 'gaoop_options_property', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_property' ) );
69
  register_setting( 'gaoop_options_page', 'gaoop_property', 'sanitize_text_field' );
70
 
71
- add_settings_field( 'gaoop_banner', __( 'Use Banner', 'gaoop' ), 'gaoop_options_banner', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_banner' ) );
72
  register_setting( 'gaoop_options_page', 'gaoop_banner', 'intval' );
73
 
74
- add_settings_field( 'gaoop_opt_out_text', __( 'Opt-Out Banner-Text', 'gaoop' ), 'gaoop_options_opt_out_text', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_opt_out_text' ) );
75
  register_setting( 'gaoop_options_page', 'gaoop_opt_out_text', 'wp_kses_post' );
76
 
77
- add_settings_field( 'gaoop_opt_out_shortcode_integration', __( 'Integrate Shortcode', 'gaoop' ), 'gaoop_options_opt_out_shortcode_integration', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_opt_out_shortcode_integration' ) );
78
  register_setting( 'gaoop_options_page', 'gaoop_opt_out_shortcode_integration', 'sanitize_text_field' );
79
 
80
- add_settings_field( 'gaoop_opt_out_cookie_set_text', __( 'Opt-Out Successful', 'gaoop' ), 'gaoop_options_opt_out_cookie_set_text', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_opt_out_cookie_set_text' ) );
81
  register_setting( 'gaoop_options_page', 'gaoop_opt_out_cookie_set_text', 'sanitize_text_field' );
82
 
83
- add_settings_field( 'gaoop_hide', __( 'Hide banner after closing', 'gaoop' ), 'gaoop_options_hide', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_hide' ) );
84
  register_setting( 'gaoop_options_page', 'gaoop_hide', 'intval' );
85
 
86
- add_settings_field( 'gaoop_custom_styles', __( 'Custom CSS', 'gaoop' ), 'gaoop_options_custom_styles', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_custom_styles' ) );
87
  register_setting( 'gaoop_options_page', 'gaoop_custom_styles' );
88
 
89
 
@@ -116,9 +116,9 @@ function gaoop_options_yoast() {
116
  echo '<input ' . disabled( ! $yoast_active, true, false ) . ' ' . checked( $option, 1, false ) . ' id="gaoop_options_yoast" type="checkbox" name="gaoop_yoast" value="1" />';
117
  echo '<p class="description">';
118
  if ( $yoast_active ) {
119
- echo '<span style="color: #5EB95E;">' . __( 'Monster Insights Plugin has been detected.', 'gaoop' ) . '</span>';
120
  } else {
121
- echo '<span style="color: #DD514C;">' . __( 'Monster Insights Plugin has NOT been detected. Please enter your UA code manually and then check the sourcode of your website. Make sure that Analytics code appears AFTER the opt-out code (which starts with <code>/* Google Analytics Opt-Out</code>).', 'gaoop' ) . '</span>';
122
  }
123
  echo '</p>';
124
  }
@@ -174,7 +174,7 @@ function gaoop_options_opt_out_text() {
174
  )
175
  );
176
 
177
- printf( '<p class="description">%s</p>', __( 'Please integrate the shortcode so that the user can opt-out.', 'gaoop' ) );
178
  }
179
 
180
  /**
@@ -187,7 +187,7 @@ function gaoop_options_opt_out_shortcode_integration() {
187
  '<input type="checkbox" id="gaoop_options_opt_out_shortcode_integration" value="1" name="gaoop_opt_out_shortcode_integration" %s />',
188
  checked( (bool) get_option( 'gaoop_opt_out_shortcode_integration', 1 ), true, false )
189
  );
190
- printf( '<p class="description">%s</p>', __( 'If the shortcode was not detected, it will be added automatically.', 'gaoop' ) );
191
  }
192
 
193
  /**
@@ -197,7 +197,7 @@ function gaoop_options_opt_out_shortcode_integration() {
197
  * @return void
198
  */
199
  function gaoop_options_opt_out_cookie_set_text() {
200
- echo '<input id="gaoop_options_opt_out_cookie_set_text" placeholder="' . __( 'Thanks. We have set a cookie so that Google Analytics data collection will be disabled on your next visit.', 'gaoop' ) . '" type="text" class="regular-text" value="' . sanitize_text_field( get_option( 'gaoop_opt_out_cookie_set_text', '' ) ) . '" name="gaoop_opt_out_cookie_set_text" /> ';
201
 
202
  }
203
 
@@ -209,7 +209,7 @@ function gaoop_options_opt_out_cookie_set_text() {
209
  */
210
  function gaoop_options_hide() {
211
  echo '<input type="checkbox" id="gaoop_options_hide" ' . checked( intval( get_option( 'gaoop_hide', 0 ) ), 1, false ) . ' value="1" name="gaoop_hide" /> ';
212
- echo '<p class="description">' . __( 'This will hide the opt-out box after the user has clicked the close-button. Otherwise a little info-button will be fixed to the bottom-right.', 'gaoop' ) . '</p>';
213
 
214
  }
215
 
7
  * @return void
8
  */
9
  function gaoop_admin_menu() {
10
+ $hook = add_submenu_page( 'options-general.php', __( 'Analytics Opt-Out', 'google-analytics-opt-out' ), __( 'Analytics Opt-Out', 'google-analytics-opt-out' ), 'manage_options', 'gaoo-options', 'gaoop_settings_page' );
11
  add_action( "load-$hook", 'gaoop_settings_scripts' );
12
 
13
+ $hook = add_submenu_page( 'yst_ga_dashboard', __( 'Analytics Opt-Out', 'google-analytics-opt-out' ), __( 'Opt-Out Settings', 'google-analytics-opt-out' ), 'manage_options', 'gaoo-options', 'gaoop_settings_page' );
14
  add_action( "load-$hook", 'gaoop_settings_scripts' );
15
  }
16
 
27
  ?>
28
  <div class="wrap">
29
  <div id="icon-options-general" class="icon32"></div>
30
+ <h2><?php _e( 'Google Analaytics Opt-Out Pro', 'google-analytics-opt-out' ); ?> </h2>
31
 
32
  <form action="options.php" method="post">
33
  <?php
60
  */
61
  function gaoop_register_theme_options_section() {
62
 
63
+ add_settings_section( 'gaoop_settings_section', __( 'Analytics Opt-Out', 'google-analytics-opt-out' ), null, 'gaoop_options_page' );
64
 
65
+ add_settings_field( 'gaoop_yoast', __( 'Use Monster Insights Settings', 'google-analytics-opt-out' ), 'gaoop_options_yoast', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_yoast' ) );
66
  register_setting( 'gaoop_options_page', 'gaoop_yoast', 'intval' );
67
 
68
+ add_settings_field( 'gaoop_property', __( 'UA-Code', 'google-analytics-opt-out' ), 'gaoop_options_property', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_property' ) );
69
  register_setting( 'gaoop_options_page', 'gaoop_property', 'sanitize_text_field' );
70
 
71
+ add_settings_field( 'gaoop_banner', __( 'Use Banner', 'google-analytics-opt-out' ), 'gaoop_options_banner', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_banner' ) );
72
  register_setting( 'gaoop_options_page', 'gaoop_banner', 'intval' );
73
 
74
+ add_settings_field( 'gaoop_opt_out_text', __( 'Opt-Out Banner-Text', 'google-analytics-opt-out' ), 'gaoop_options_opt_out_text', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_opt_out_text' ) );
75
  register_setting( 'gaoop_options_page', 'gaoop_opt_out_text', 'wp_kses_post' );
76
 
77
+ add_settings_field( 'gaoop_opt_out_shortcode_integration', __( 'Integrate Shortcode', 'google-analytics-opt-out' ), 'gaoop_options_opt_out_shortcode_integration', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_opt_out_shortcode_integration' ) );
78
  register_setting( 'gaoop_options_page', 'gaoop_opt_out_shortcode_integration', 'sanitize_text_field' );
79
 
80
+ add_settings_field( 'gaoop_opt_out_cookie_set_text', __( 'Opt-Out Successful', 'google-analytics-opt-out' ), 'gaoop_options_opt_out_cookie_set_text', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_opt_out_cookie_set_text' ) );
81
  register_setting( 'gaoop_options_page', 'gaoop_opt_out_cookie_set_text', 'sanitize_text_field' );
82
 
83
+ add_settings_field( 'gaoop_hide', __( 'Hide banner after closing', 'google-analytics-opt-out' ), 'gaoop_options_hide', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_hide' ) );
84
  register_setting( 'gaoop_options_page', 'gaoop_hide', 'intval' );
85
 
86
+ add_settings_field( 'gaoop_custom_styles', __( 'Custom CSS', 'google-analytics-opt-out' ), 'gaoop_options_custom_styles', 'gaoop_options_page', 'gaoop_settings_section', array( 'label_for' => 'gaoop_options_custom_styles' ) );
87
  register_setting( 'gaoop_options_page', 'gaoop_custom_styles' );
88
 
89
 
116
  echo '<input ' . disabled( ! $yoast_active, true, false ) . ' ' . checked( $option, 1, false ) . ' id="gaoop_options_yoast" type="checkbox" name="gaoop_yoast" value="1" />';
117
  echo '<p class="description">';
118
  if ( $yoast_active ) {
119
+ echo '<span style="color: #5EB95E;">' . __( 'Monster Insights Plugin has been detected.', 'google-analytics-opt-out' ) . '</span>';
120
  } else {
121
+ echo '<span style="color: #DD514C;">' . __( 'Monster Insights Plugin has NOT been detected. Please enter your UA code manually and then check the sourcode of your website. Make sure that Analytics code appears AFTER the opt-out code (which starts with <code>/* Google Analytics Opt-Out</code>).', 'google-analytics-opt-out' ) . '</span>';
122
  }
123
  echo '</p>';
124
  }
174
  )
175
  );
176
 
177
+ printf( '<p class="description">%s</p>', __( 'Please integrate the shortcode so that the user can opt-out.', 'google-analytics-opt-out' ) );
178
  }
179
 
180
  /**
187
  '<input type="checkbox" id="gaoop_options_opt_out_shortcode_integration" value="1" name="gaoop_opt_out_shortcode_integration" %s />',
188
  checked( (bool) get_option( 'gaoop_opt_out_shortcode_integration', 1 ), true, false )
189
  );
190
+ printf( '<p class="description">%s</p>', __( 'If the shortcode was not detected, it will be added automatically.', 'google-analytics-opt-out' ) );
191
  }
192
 
193
  /**
197
  * @return void
198
  */
199
  function gaoop_options_opt_out_cookie_set_text() {
200
+ echo '<input id="gaoop_options_opt_out_cookie_set_text" placeholder="' . __( 'Thanks. We have set a cookie so that Google Analytics data collection will be disabled on your next visit.', 'google-analytics-opt-out' ) . '" type="text" class="regular-text" value="' . sanitize_text_field( get_option( 'gaoop_opt_out_cookie_set_text', '' ) ) . '" name="gaoop_opt_out_cookie_set_text" /> ';
201
 
202
  }
203
 
209
  */
210
  function gaoop_options_hide() {
211
  echo '<input type="checkbox" id="gaoop_options_hide" ' . checked( intval( get_option( 'gaoop_hide', 0 ) ), 1, false ) . ' value="1" name="gaoop_hide" /> ';
212
+ echo '<p class="description">' . __( 'This will hide the opt-out box after the user has clicked the close-button. Otherwise a little info-button will be fixed to the bottom-right.', 'google-analytics-opt-out' ) . '</p>';
213
 
214
  }
215
 
inc/shortcodes.php CHANGED
@@ -48,13 +48,13 @@ function gaoop_shortcode( $atts, $content = '' ) {
48
  //$atts = shortcode_atts( array(), $atts );
49
 
50
  if ( empty( $content ) ) {
51
- $content = __( 'Click here to opt out.', 'gaoop' );
52
  }
53
 
54
  $ua_code = gaoop_get_ua_code();
55
 
56
  if ( empty( $ua_code ) ) {
57
- return '<span style="cursor: help; border: 0 none; border-bottom-width: 1px; border-style: dashed;" title="' . __( 'No UA-Code has been entered. Please ask the admin to solve this issue!', 'gaoop' ) . '">' . do_shortcode( $content ) . '</span>';
58
  }
59
 
60
  return '<a class="gaoo-opt-out google-analytics-opt-out" href="javascript:gaoop_analytics_optout();">' . do_shortcode( $content ) . '</a>';
@@ -74,7 +74,7 @@ function gaoop_shortcode( $atts, $content = '' ) {
74
  */
75
  function gaoop_shortcode_close( $atts, $content, $name ) {
76
  if ( empty( $content ) ) {
77
- $content = __( 'OK', 'gaoop' );
78
  }
79
 
80
  return sprintf( '<a href="#" class="gaoop-close-link">%s</a>', $content );
48
  //$atts = shortcode_atts( array(), $atts );
49
 
50
  if ( empty( $content ) ) {
51
+ $content = __( 'Click here to opt out.', 'google-analytics-opt-out' );
52
  }
53
 
54
  $ua_code = gaoop_get_ua_code();
55
 
56
  if ( empty( $ua_code ) ) {
57
+ return '<span style="cursor: help; border: 0 none; border-bottom-width: 1px; border-style: dashed;" title="' . __( 'No UA-Code has been entered. Please ask the admin to solve this issue!', 'google-analytics-opt-out' ) . '">' . do_shortcode( $content ) . '</span>';
58
  }
59
 
60
  return '<a class="gaoo-opt-out google-analytics-opt-out" href="javascript:gaoop_analytics_optout();">' . do_shortcode( $content ) . '</a>';
74
  */
75
  function gaoop_shortcode_close( $atts, $content, $name ) {
76
  if ( empty( $content ) ) {
77
+ $content = __( 'OK', 'google-analytics-opt-out' );
78
  }
79
 
80
  return sprintf( '<a href="#" class="gaoop-close-link">%s</a>', $content );
languages/gaoo.pot CHANGED
@@ -1,14 +1,15 @@
 
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Google Analytics Opt-Out Pro\n"
4
- "POT-Creation-Date: 2013-11-12 09:04+0100\n"
5
  "PO-Revision-Date: 2013-11-12 09:04+0100\n"
6
  "Last-Translator: WP-Buddy <info@wp-buddy.com>\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.5.7\n"
12
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
13
  "_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
14
  "esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
@@ -16,7 +17,15 @@ msgstr ""
16
  "X-Poedit-Basepath: .\n"
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
19
- #: ../google-analytics-opt-out-pro.php:27
 
 
 
 
 
 
 
 
20
  #, php-format
21
  msgid ""
22
  "You are using PHP in version %s. This version is outdated and cannot be used "
@@ -25,14 +34,14 @@ msgid ""
25
  "this."
26
  msgstr ""
27
 
28
- #: ../google-analytics-opt-out-pro.php:45
29
  msgid ""
30
  "It seems that the free version of the Google Analytics Opt-Out is installed. "
31
  "Please deactivate the free version before activating the pro version. "
32
  "Thanks! "
33
  msgstr ""
34
 
35
- #: ../google-analytics-opt-out-pro.php:45
36
  msgid "&larr; Go back"
37
  msgstr ""
38
 
@@ -50,103 +59,112 @@ msgstr ""
50
  msgid "More by WP-Buddy"
51
  msgstr ""
52
 
53
- #: ../inc/frontend.php:14
54
  msgid "Google Analytics Opt-Out Information"
55
  msgstr ""
56
 
57
- #: ../inc/frontend.php:14
58
  msgid "Close"
59
  msgstr ""
60
 
61
- #: ../inc/frontend.php:16
62
  msgid "Close this and do not ask me again"
63
  msgstr ""
64
 
65
- #: ../inc/frontend.php:32 ../inc/settings.php:142
66
  msgid ""
67
  "This website is using Google Analytics. Please click here if you want to opt-"
68
  "out."
69
  msgstr ""
70
 
71
- #: ../inc/functions.php:95 ../inc/settings.php:148
 
 
 
 
72
  msgid ""
73
  "Thanks. We have set a cookie so that Google Analytics data collection will "
74
  "be disabled on your next visit."
75
  msgstr ""
76
 
77
- #: ../inc/settings.php:9
78
- msgid "Analytics Opt-Out Pro"
79
  msgstr ""
80
 
81
- #: ../inc/settings.php:25
82
- msgid "Google Analaytics Opt-Out Pro"
83
  msgstr ""
84
 
85
- #: ../inc/settings.php:56
86
- msgid "Analytics Opt-Out"
87
  msgstr ""
88
 
89
- #: ../inc/settings.php:58
90
- msgid "Use Yoast Analytics Settings"
91
  msgstr ""
92
 
93
- #: ../inc/settings.php:61
94
  msgid "UA-Code"
95
  msgstr ""
96
 
97
- #: ../inc/settings.php:64
98
- msgid "Opt-Out Box-Text"
99
  msgstr ""
100
 
101
- #: ../inc/settings.php:67
102
- msgid "Opt-Out Successful"
103
  msgstr ""
104
 
105
- #: ../inc/settings.php:70
106
- msgid "Hide banner after opt-out"
107
  msgstr ""
108
 
109
- #: ../inc/settings.php:73
110
- msgid "Custom CSS"
 
 
 
 
111
  msgstr ""
112
 
113
- #: ../inc/settings.php:76
114
- msgid "Purchase Code"
115
  msgstr ""
116
 
117
- #: ../inc/settings.php:106
118
- msgid "Yoast Analytics Plugin has been detected."
119
  msgstr ""
120
 
121
- #: ../inc/settings.php:109
122
  msgid ""
123
- "Yoast Analytics Plugin has NOT been detected. Please enter your UA code "
124
  "manually and then check the sourcode of your website. Make sure that "
125
  "Analytics code appears AFTER the opt-out code (which starts with <code>/* "
126
  "Google Analytics Opt-Out</code>)."
127
  msgstr ""
128
 
129
- #: ../inc/settings.php:160
130
- msgid ""
131
- "This will hide the opt-out box after the user has opted-out. Otherwise a "
132
- "little info-button will be fixed to the bottom-right."
133
  msgstr ""
134
 
135
- #: ../inc/settings.php:181
136
- msgid ""
137
- "If you enter your purchase code you get updates automatically via WordPress' "
138
- "internal update functionality."
139
  msgstr ""
140
 
141
- #: ../inc/settings.php:181
142
  msgid ""
143
- "If you don' know where you can find your purchase code, please click here."
 
144
  msgstr ""
145
 
146
- #: ../inc/shortcodes.php:49
147
  msgid "Click here to opt out."
148
  msgstr ""
149
 
150
- #: ../inc/shortcodes.php:55
151
  msgid "No UA-Code has been entered. Please ask the admin to solve this issue!"
152
  msgstr ""
 
 
 
 
1
+ #, fuzzy
2
  msgid ""
3
  msgstr ""
4
+ "Project-Id-Version: Google Analytics Opt-Out\n"
5
+ "POT-Creation-Date: 2016-12-02 09:43+0100\n"
6
  "PO-Revision-Date: 2013-11-12 09:04+0100\n"
7
  "Last-Translator: WP-Buddy <info@wp-buddy.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.11\n"
13
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
14
  "_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
15
  "esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
17
  "X-Poedit-Basepath: .\n"
18
  "X-Poedit-SearchPath-0: ..\n"
19
 
20
+ #: ../google-analytics-opt-out.php:36
21
+ msgid "Google Analytics Opt-Out Pro"
22
+ msgstr ""
23
+
24
+ #: ../google-analytics-opt-out.php:37
25
+ msgid "Provides an Opt-Out functionality for Google Analytics"
26
+ msgstr ""
27
+
28
+ #: ../google-analytics-opt-out.php:44
29
  #, php-format
30
  msgid ""
31
  "You are using PHP in version %s. This version is outdated and cannot be used "
34
  "this."
35
  msgstr ""
36
 
37
+ #: ../google-analytics-opt-out.php:61
38
  msgid ""
39
  "It seems that the free version of the Google Analytics Opt-Out is installed. "
40
  "Please deactivate the free version before activating the pro version. "
41
  "Thanks! "
42
  msgstr ""
43
 
44
+ #: ../google-analytics-opt-out.php:61
45
  msgid "&larr; Go back"
46
  msgstr ""
47
 
59
  msgid "More by WP-Buddy"
60
  msgstr ""
61
 
62
+ #: ../inc/frontend.php:19
63
  msgid "Google Analytics Opt-Out Information"
64
  msgstr ""
65
 
66
+ #: ../inc/frontend.php:19
67
  msgid "Close"
68
  msgstr ""
69
 
70
+ #: ../inc/frontend.php:21
71
  msgid "Close this and do not ask me again"
72
  msgstr ""
73
 
74
+ #: ../inc/frontend.php:37
75
  msgid ""
76
  "This website is using Google Analytics. Please click here if you want to opt-"
77
  "out."
78
  msgstr ""
79
 
80
+ #: ../inc/frontend.php:41
81
+ msgid "Click here to opt-out."
82
+ msgstr ""
83
+
84
+ #: ../inc/functions.php:96 ../inc/settings.php:200
85
  msgid ""
86
  "Thanks. We have set a cookie so that Google Analytics data collection will "
87
  "be disabled on your next visit."
88
  msgstr ""
89
 
90
+ #: ../inc/settings.php:10 ../inc/settings.php:13 ../inc/settings.php:63
91
+ msgid "Analytics Opt-Out"
92
  msgstr ""
93
 
94
+ #: ../inc/settings.php:13
95
+ msgid "Opt-Out Settings"
96
  msgstr ""
97
 
98
+ #: ../inc/settings.php:30
99
+ msgid "Google Analaytics Opt-Out Pro"
100
  msgstr ""
101
 
102
+ #: ../inc/settings.php:65
103
+ msgid "Use Monster Insights Settings"
104
  msgstr ""
105
 
106
+ #: ../inc/settings.php:68
107
  msgid "UA-Code"
108
  msgstr ""
109
 
110
+ #: ../inc/settings.php:71
111
+ msgid "Use Banner"
112
  msgstr ""
113
 
114
+ #: ../inc/settings.php:74
115
+ msgid "Opt-Out Banner-Text"
116
  msgstr ""
117
 
118
+ #: ../inc/settings.php:77
119
+ msgid "Integrate Shortcode"
120
  msgstr ""
121
 
122
+ #: ../inc/settings.php:80
123
+ msgid "Opt-Out Successful"
124
+ msgstr ""
125
+
126
+ #: ../inc/settings.php:83
127
+ msgid "Hide banner after closing"
128
  msgstr ""
129
 
130
+ #: ../inc/settings.php:86
131
+ msgid "Custom CSS"
132
  msgstr ""
133
 
134
+ #: ../inc/settings.php:119
135
+ msgid "Monster Insights Plugin has been detected."
136
  msgstr ""
137
 
138
+ #: ../inc/settings.php:121
139
  msgid ""
140
+ "Monster Insights Plugin has NOT been detected. Please enter your UA code "
141
  "manually and then check the sourcode of your website. Make sure that "
142
  "Analytics code appears AFTER the opt-out code (which starts with <code>/* "
143
  "Google Analytics Opt-Out</code>)."
144
  msgstr ""
145
 
146
+ #: ../inc/settings.php:177
147
+ msgid "Please integrate the shortcode so that the user can opt-out."
 
 
148
  msgstr ""
149
 
150
+ #: ../inc/settings.php:190
151
+ msgid "If the shortcode was not detected, it will be added automatically."
 
 
152
  msgstr ""
153
 
154
+ #: ../inc/settings.php:212
155
  msgid ""
156
+ "This will hide the opt-out box after the user has clicked the close-button. "
157
+ "Otherwise a little info-button will be fixed to the bottom-right."
158
  msgstr ""
159
 
160
+ #: ../inc/shortcodes.php:51
161
  msgid "Click here to opt out."
162
  msgstr ""
163
 
164
+ #: ../inc/shortcodes.php:57
165
  msgid "No UA-Code has been entered. Please ask the admin to solve this issue!"
166
  msgstr ""
167
+
168
+ #: ../inc/shortcodes.php:77
169
+ msgid "OK"
170
+ msgstr ""
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: wp-buddy, floriansimeth
3
  Donate link: https://wp-buddy.com/products/plugins/google-analytics-opt-out/
4
  Tags: google analytics, analytics, analytics opt-out, analytics opt out, monster insights, monster insight, yoast analytics
5
- Version: 2.0.0
6
  Requires at least: 3.7
7
- Stable tag: 2.0.0
8
  Tested up to: 4.7
9
  License: GPLv2
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -40,6 +40,9 @@ The free and the pro version have now been merged together. So you now can have
40
 
41
  == Changelog ==
42
 
 
 
 
43
  = 2.0.0 =
44
  * The pro version is now free (this is it!)
45
  * New: allow the complete deactivation of the banner.
2
  Contributors: wp-buddy, floriansimeth
3
  Donate link: https://wp-buddy.com/products/plugins/google-analytics-opt-out/
4
  Tags: google analytics, analytics, analytics opt-out, analytics opt out, monster insights, monster insight, yoast analytics
5
+ Version: 2.0.1
6
  Requires at least: 3.7
7
+ Stable tag: 2.0.1
8
  Tested up to: 4.7
9
  License: GPLv2
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
40
 
41
  == Changelog ==
42
 
43
+ = 2.0.1 =
44
+ * Plugin can now be translated via [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/google-analytics-opt-out)
45
+
46
  = 2.0.0 =
47
  * The pro version is now free (this is it!)
48
  * New: allow the complete deactivation of the banner.