Email Address Encoder - Version 1.0.18

Version Description

  • Show warning when incompatible plugins are installed
  • Fixed saving of dismissed notices
Download this release

Release Info

Developer tillkruess
Plugin Icon 128x128 Email Address Encoder
Version 1.0.18
Comparing to
See all releases

Code changes from version 1.0.17 to 1.0.18

email-address-encoder.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Email Address Encoder
4
  Plugin URI: https://encoder.till.im/
5
  Description: A lightweight plugin that protects email addresses from email-harvesting robots by encoding them into decimal and hexadecimal entities.
6
- Version: 1.0.17
7
  Author: Till Krüss
8
  Author URI: https://till.im/
9
  Text Domain: email-address-encoder
3
  Plugin Name: Email Address Encoder
4
  Plugin URI: https://encoder.till.im/
5
  Description: A lightweight plugin that protects email addresses from email-harvesting robots by encoding them into decimal and hexadecimal entities.
6
+ Version: 1.0.18
7
  Author: Till Krüss
8
  Author URI: https://till.im/
9
  Text Domain: email-address-encoder
includes/admin.php CHANGED
@@ -27,6 +27,11 @@ add_filter( 'plugin_action_links', 'eae_plugin_actions_links', 10, 2 );
27
  */
28
  add_action( 'admin_notices', 'eae_page_scanner_notice' );
29
 
 
 
 
 
 
30
  /**
31
  * Register scripts callback.
32
  */
@@ -227,7 +232,11 @@ function eae_adminbar_styles() {
227
  function eae_enqueue_admin_scripts() {
228
  $screen = get_current_screen();
229
 
230
- if ( ! isset( $screen->id ) || $screen->id !== 'dashboard' ) {
 
 
 
 
231
  return;
232
  }
233
 
@@ -266,7 +275,7 @@ function eae_page_scanner_notice() {
266
  return;
267
  }
268
 
269
- if ( $screen->id !== 'dashboard' && $screen->id !== 'edit-page' ) {
270
  return;
271
  }
272
 
@@ -282,7 +291,7 @@ function eae_page_scanner_notice() {
282
  return;
283
  }
284
 
285
- if ( get_user_meta( get_current_user_id(), 'eae_dismissed_automatic_warnings_notice', true ) === '1' ) {
286
  return;
287
  }
288
 
@@ -424,3 +433,50 @@ function eae_cleanup_response() {
424
  return $caps;
425
  } );
426
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  */
28
  add_action( 'admin_notices', 'eae_page_scanner_notice' );
29
 
30
+ /**
31
+ * Register callback to display warnings of incompatible plugins.
32
+ */
33
+ add_action( 'admin_notices', 'eae_compatibility_warnings' );
34
+
35
  /**
36
  * Register scripts callback.
37
  */
232
  function eae_enqueue_admin_scripts() {
233
  $screen = get_current_screen();
234
 
235
+ if ( ! isset( $screen->id ) ) {
236
+ return;
237
+ }
238
+
239
+ if ( ! in_array( $screen->id, array( 'dashboard', 'edit-page' ) ) ) {
240
  return;
241
  }
242
 
275
  return;
276
  }
277
 
278
+ if ( ! in_array( $screen->id, array( 'dashboard', 'edit-page' ) ) ) {
279
  return;
280
  }
281
 
291
  return;
292
  }
293
 
294
+ if ( get_user_meta( get_current_user_id(), 'eae_dismissed_automatic_warnings_notice', true ) == '1' ) {
295
  return;
296
  }
297
 
433
  return $caps;
434
  } );
435
  }
436
+
437
+ /**
438
+ * Display warnings when incompatible plugins are detected.
439
+ *
440
+ * @return void
441
+ */
442
+ function eae_compatibility_warnings() {
443
+ $screen = get_current_screen();
444
+
445
+ if ( ! isset( $screen->id ) ) {
446
+ return;
447
+ }
448
+
449
+ $screens = array(
450
+ 'dashboard',
451
+ 'plugins',
452
+ 'edit-page',
453
+ 'settings_page_email-address-encoder'
454
+ );
455
+
456
+ if ( ! in_array( $screen->id, $screens ) ) {
457
+ return;
458
+ }
459
+
460
+ if ( ! current_user_can( 'manage_options' ) ) {
461
+ return;
462
+ }
463
+
464
+ $plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
465
+
466
+ foreach ( $plugins as $plugin ) {
467
+ if ( strpos( $plugin, 'ginger/' ) === 0 ) {
468
+ $gingerCookieInstalled = true;
469
+ }
470
+ }
471
+
472
+ if ( isset( $gingerCookieInstalled ) ) {
473
+ printf(
474
+ '<div class="notice notice-error"><p><strong>%s</strong> %s</p></div>',
475
+ __( 'Incompatible plugin detected!', 'email-address-encoder' ),
476
+ sprintf(
477
+ __( 'The "Ginger – EU Cookie Law" plugin decodes all HTML entities and thus prevents the Email Address Encoder from working. Please use a different cookie banner plugin, or use the full-page scanner technique of the <a href="%s">Premium version</a>.', 'email-address-encoder' ),
478
+ admin_url( 'options-general.php?page=email-address-encoder' )
479
+ )
480
+ );
481
+ }
482
+ }
includes/dismiss-notice.js CHANGED
@@ -1,12 +1,16 @@
1
  ( function ( $ ) {
2
  $( function () {
3
- $( ".notice[data-dismissible] .notice-dismiss" ).click( function ( event ) {
4
- $.post( ajaxurl, {
5
- notice: $( this ).parent().attr( "data-dismissible" ),
6
- action: "eae_dismiss_notice",
7
- } );
 
 
 
8
 
9
- event.preventDefault();
10
- } );
 
11
  } );
12
  } ( jQuery ) );
1
  ( function ( $ ) {
2
  $( function () {
3
+ $( ".notice.is-dismissible[data-dismissible]" ).on(
4
+ "click.eae-dismiss-notice",
5
+ ".notice-dismiss",
6
+ function ( event ) {
7
+ $.post( ajaxurl, {
8
+ notice: $( this ).parent().attr( "data-dismissible" ),
9
+ action: "eae_dismiss_notice",
10
+ } );
11
 
12
+ event.preventDefault();
13
+ }
14
+ );
15
  } );
16
  } ( jQuery ) );
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: antispam, anti spam, spam, email, e-mail, mail, spider, crawler, harvester
5
  Requires at least: 2.0
6
  Tested up to: 5.1
7
  Requires PHP: 5.3
8
- Stable tag: 1.0.17
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -67,6 +67,11 @@ You can use the "Page Scanner" found under _Settings -> Email Encoder_ to see wh
67
 
68
  == Changelog ==
69
 
 
 
 
 
 
70
  = 1.0.17 =
71
 
72
  * Offload email detection to web worker
5
  Requires at least: 2.0
6
  Tested up to: 5.1
7
  Requires PHP: 5.3
8
+ Stable tag: 1.0.18
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
67
 
68
  == Changelog ==
69
 
70
+ = 1.0.18 =
71
+
72
+ * Show warning when incompatible plugins are installed
73
+ * Fixed saving of dismissed notices
74
+
75
  = 1.0.17 =
76
 
77
  * Offload email detection to web worker