WP Security Audit Log - Version 3.2.2.2

Version Description

(2018-08-01) =

  • Bug fix
    • fixed an issue with an incorrect opt-in prompt from the SDK
Download this release

Release Info

Developer WPWhiteSecurity
Plugin Icon 128x128 WP Security Audit Log
Version 3.2.2.2
Comparing to
See all releases

Code changes from version 3.2.2.1 to 3.2.2.2

classes/Views/AuditLog.php CHANGED
@@ -78,7 +78,7 @@ class WSAL_Views_AuditLog extends WSAL_AbstractView {
78
  && ! class_exists( 'WSAL_Rep_Plugin' )
79
  && ! class_exists( 'WSAL_SearchExtension' )
80
  && ! class_exists( 'WSAL_User_Management_Plugin' )
81
- && ! get_site_option( 'wpsal_anonymous_mode', true ) // Anonymous mode option.
82
  ) {
83
  if ( current_user_can( 'manage_options' ) && $is_current_view && ! $this->IsNoticeDismissed( 'premium-wsal-' . $this->_version ) ) { ?>
84
  <div class="updated wsal_notice" data-notice-name="premium-wsal-<?php echo esc_attr( $this->_version ); ?>">
@@ -143,7 +143,7 @@ class WSAL_Views_AuditLog extends WSAL_AbstractView {
143
  }
144
 
145
  // Check anonymous mode.
146
- if ( get_site_option( 'wpsal_anonymous_mode', true ) ) { // If user manually opt-out then don't show the notice.
147
  if (
148
  wsal_freemius()->is_anonymous() // Anonymous mode option.
149
  && wsal_freemius()->is_not_paying() // Not paying customer.
@@ -570,7 +570,7 @@ class WSAL_Views_AuditLog extends WSAL_AbstractView {
570
  $choice = filter_input( INPUT_POST, 'choice', FILTER_SANITIZE_STRING ); // Choice selected by user.
571
 
572
  // Verify nonce.
573
- if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'wsal-freemius-opt' ) ) {
574
  // Nonce verification failed.
575
  echo wp_json_encode( array(
576
  'success' => false,
@@ -581,9 +581,6 @@ class WSAL_Views_AuditLog extends WSAL_AbstractView {
581
 
582
  // Check if choice is not empty.
583
  if ( ! empty( $choice ) ) {
584
- // Update anonymous mode to false.
585
- update_site_option( 'wpsal_anonymous_mode', 0 );
586
-
587
  if ( 'yes' === $choice ) {
588
  if ( ! is_multisite() ) {
589
  wsal_freemius()->opt_in(); // Opt in.
@@ -599,12 +596,18 @@ class WSAL_Views_AuditLog extends WSAL_AbstractView {
599
  }
600
  wsal_freemius()->opt_in( false, false, false, false, false, false, false, false, $sites_data );
601
  }
 
 
 
602
  } elseif ( 'no' === $choice ) {
603
  if ( ! is_multisite() ) {
604
  wsal_freemius()->skip_connection(); // Opt out.
605
  } else {
606
  wsal_freemius()->skip_connection( null, true ); // Opt out for all websites.
607
  }
 
 
 
608
  }
609
 
610
  echo wp_json_encode( array(
78
  && ! class_exists( 'WSAL_Rep_Plugin' )
79
  && ! class_exists( 'WSAL_SearchExtension' )
80
  && ! class_exists( 'WSAL_User_Management_Plugin' )
81
+ && 'anonymous' !== get_site_option( 'wsal_freemius_state', 'anonymous' ) // Anonymous mode option.
82
  ) {
83
  if ( current_user_can( 'manage_options' ) && $is_current_view && ! $this->IsNoticeDismissed( 'premium-wsal-' . $this->_version ) ) { ?>
84
  <div class="updated wsal_notice" data-notice-name="premium-wsal-<?php echo esc_attr( $this->_version ); ?>">
143
  }
144
 
145
  // Check anonymous mode.
146
+ if ( 'anonymous' === get_site_option( 'wsal_freemius_state', 'anonymous' ) ) { // If user manually opt-out then don't show the notice.
147
  if (
148
  wsal_freemius()->is_anonymous() // Anonymous mode option.
149
  && wsal_freemius()->is_not_paying() // Not paying customer.
570
  $choice = filter_input( INPUT_POST, 'choice', FILTER_SANITIZE_STRING ); // Choice selected by user.
571
 
572
  // Verify nonce.
573
+ if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'wsal-freemius-opt' ) ) {
574
  // Nonce verification failed.
575
  echo wp_json_encode( array(
576
  'success' => false,
581
 
582
  // Check if choice is not empty.
583
  if ( ! empty( $choice ) ) {
 
 
 
584
  if ( 'yes' === $choice ) {
585
  if ( ! is_multisite() ) {
586
  wsal_freemius()->opt_in(); // Opt in.
596
  }
597
  wsal_freemius()->opt_in( false, false, false, false, false, false, false, false, $sites_data );
598
  }
599
+
600
+ // Update freemius state.
601
+ update_site_option( 'wsal_freemius_state', 'in' );
602
  } elseif ( 'no' === $choice ) {
603
  if ( ! is_multisite() ) {
604
  wsal_freemius()->skip_connection(); // Opt out.
605
  } else {
606
  wsal_freemius()->skip_connection( null, true ); // Opt out for all websites.
607
  }
608
+
609
+ // Update freemius state.
610
+ update_site_option( 'wsal_freemius_state', 'skipped' );
611
  }
612
 
613
  echo wp_json_encode( array(
readme.txt CHANGED
@@ -6,7 +6,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
6
  Tags: wordpress security plugin, wordpress security audit log, audit log, event log wordpress, wordpress user tracking, wordpress activity log, wordpress audit, security event log, audit trail, wordpress security monitor, wordpress admin, wordpress admin monitoring, user activity, admin, multisite, dashboard, notification, wordpress monitoring, email notification, wordpress email alerts, tracking, user tracking, user activity report, wordpress audit trail
7
  Requires at least: 3.6
8
  Tested up to: 4.9.7
9
- Stable tag: 3.2.2.1
10
  Requires PHP: 5.4.43
11
 
12
  An easy to use and comprehensive monitoring & activity log solution that keeps a log of all changes & user activity on your WordPress site.
@@ -179,6 +179,11 @@ Please refer to our [Support & Documentation pages](https://www.wpsecurityauditl
179
 
180
  == Changelog ==
181
 
 
 
 
 
 
182
  = 3.2.2.1 (2018-07-18) =
183
 
184
  * **Bug fix**
6
  Tags: wordpress security plugin, wordpress security audit log, audit log, event log wordpress, wordpress user tracking, wordpress activity log, wordpress audit, security event log, audit trail, wordpress security monitor, wordpress admin, wordpress admin monitoring, user activity, admin, multisite, dashboard, notification, wordpress monitoring, email notification, wordpress email alerts, tracking, user tracking, user activity report, wordpress audit trail
7
  Requires at least: 3.6
8
  Tested up to: 4.9.7
9
+ Stable tag: 3.2.2.2
10
  Requires PHP: 5.4.43
11
 
12
  An easy to use and comprehensive monitoring & activity log solution that keeps a log of all changes & user activity on your WordPress site.
179
 
180
  == Changelog ==
181
 
182
+ = 3.2.2.2 (2018-08-01) =
183
+
184
+ * **Bug fix**
185
+ * fixed an issue with an incorrect opt-in prompt from the SDK
186
+
187
  = 3.2.2.1 (2018-07-18) =
188
 
189
  * **Bug fix**
sdk/wsal-freemius.php CHANGED
@@ -32,9 +32,11 @@ if ( file_exists( dirname( __FILE__ ) . '/freemius/start.php' ) ) {
32
  require_once dirname( __FILE__ ) . '/freemius/start.php';
33
 
34
  // Check anonymous mode.
35
- $is_anonymous = ( true === get_site_option( 'wpsal_anonymous_mode', true ) );
36
- $is_premium = false;
37
- $is_anonymous = $is_premium ? false : $is_anonymous;
 
 
38
 
39
  $wsal_freemius = fs_dynamic_init( array(
40
  'id' => '94',
32
  require_once dirname( __FILE__ ) . '/freemius/start.php';
33
 
34
  // Check anonymous mode.
35
+ // $is_anonymous = ( true === get_site_option( 'wpsal_anonymous_mode', true ) );
36
+ $freemius_state = get_site_option( 'wsal_freemius_state', 'anonymous' );
37
+ $is_anonymous = ( 'anonymous' === $freemius_state || 'skipped' === $freemius_state );
38
+ $is_premium = false;
39
+ $is_anonymous = $is_premium ? false : $is_anonymous;
40
 
41
  $wsal_freemius = fs_dynamic_init( array(
42
  'id' => '94',
wp-security-audit-log.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://www.wpsecurityauditlog.com/
5
  * Description: Identify WordPress security issues before they become a problem. Keep track of everything happening on your WordPress including WordPress users activity. Similar to Windows Event Log and Linux Syslog, WP Security Audit Log generates a security alert for everything that happens on your WordPress blogs and websites. Use the Audit Log Viewer included in the plugin to see all the security alerts.
6
  * Author: WP White Security
7
- * Version: 3.2.2.1
8
  * Text Domain: wp-security-audit-log
9
  * Author URI: http://www.wpsecurityauditlog.com/
10
  * License: GPL2
@@ -54,7 +54,7 @@ if ( ! function_exists( 'wsal_freemius' ) ) {
54
  *
55
  * @var string
56
  */
57
- public $version = '3.2.2.1';
58
 
59
  // Plugin constants.
60
  const PLG_CLS_PRFX = 'WSAL_';
@@ -245,7 +245,7 @@ if ( ! function_exists( 'wsal_freemius' ) ) {
245
  public function wsal_plugin_redirect() {
246
  if (
247
  get_option( 'wsal_redirect_on_activate', false )
248
- && get_site_option( 'wpsal_anonymous_mode', true )
249
  ) { // If the redirect option is true, then continue.
250
  delete_option( 'wsal_redirect_on_activate' ); // Delete redirect option.
251
  // Redirect to main page.
@@ -623,7 +623,7 @@ if ( ! function_exists( 'wsal_freemius' ) ) {
623
  wp_schedule_event( current_time( 'timestamp' ) + 600, 'hourly', 'wsal_cleanup' );
624
 
625
  // WSAL Audit Log page redirect option in anonymous mode.
626
- if ( get_site_option( 'wpsal_anonymous_mode', true ) ) {
627
  add_option( 'wsal_redirect_on_activate', true );
628
  }
629
  }
@@ -656,8 +656,26 @@ if ( ! function_exists( 'wsal_freemius' ) ) {
656
  // Dismiss privacy notice.
657
  $this->views->FindByClassName( 'WSAL_Views_AuditLog' )->DismissNotice( 'wsal-privacy-notice-3.2' );
658
 
659
- // Update anonymous mode to false.
660
- update_site_option( 'wpsal_anonymous_mode', 0 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
661
  }
662
  }
663
 
4
  * Plugin URI: http://www.wpsecurityauditlog.com/
5
  * Description: Identify WordPress security issues before they become a problem. Keep track of everything happening on your WordPress including WordPress users activity. Similar to Windows Event Log and Linux Syslog, WP Security Audit Log generates a security alert for everything that happens on your WordPress blogs and websites. Use the Audit Log Viewer included in the plugin to see all the security alerts.
6
  * Author: WP White Security
7
+ * Version: 3.2.2.2
8
  * Text Domain: wp-security-audit-log
9
  * Author URI: http://www.wpsecurityauditlog.com/
10
  * License: GPL2
54
  *
55
  * @var string
56
  */
57
+ public $version = '3.2.2.2';
58
 
59
  // Plugin constants.
60
  const PLG_CLS_PRFX = 'WSAL_';
245
  public function wsal_plugin_redirect() {
246
  if (
247
  get_option( 'wsal_redirect_on_activate', false )
248
+ && 'anonymous' === get_site_option( 'wsal_freemius_state', 'anonymous' )
249
  ) { // If the redirect option is true, then continue.
250
  delete_option( 'wsal_redirect_on_activate' ); // Delete redirect option.
251
  // Redirect to main page.
623
  wp_schedule_event( current_time( 'timestamp' ) + 600, 'hourly', 'wsal_cleanup' );
624
 
625
  // WSAL Audit Log page redirect option in anonymous mode.
626
+ if ( 'anonymous' === get_site_option( 'wsal_freemius_state', 'anonymous' ) ) {
627
  add_option( 'wsal_redirect_on_activate', true );
628
  }
629
  }
656
  // Dismiss privacy notice.
657
  $this->views->FindByClassName( 'WSAL_Views_AuditLog' )->DismissNotice( 'wsal-privacy-notice-3.2' );
658
 
659
+ /**
660
+ * IMPORTANT: VERSION SPECIFIC UPDATE
661
+ *
662
+ * It only needs to run when old version of the plugin is older/less than 3.0.0.
663
+ *
664
+ * @since 3.2.2.2
665
+ */
666
+ if ( version_compare( $old_version, '3.0.0', '>' ) ) {
667
+ // Check if the user has opted-in.
668
+ if ( wsal_freemius()->is_registered() ) {
669
+ // Update freemius state.
670
+ update_site_option( 'wsal_freemius_state', 'in' );
671
+ } else {
672
+ // Update freemius state.
673
+ update_site_option( 'wsal_freemius_state', 'skipped' );
674
+ }
675
+
676
+ // Remove connect account notice of Freemius.
677
+ FS_Admin_Notices::instance( 'wp-security-audit-log' )->remove_sticky( 'connect_account' );
678
+ }
679
  }
680
  }
681