From 89225386393c6c98017cee790355ca33582135ca Mon Sep 17 00:00:00 2001 From: Danny Jones <59394454+DannyWPWS@users.noreply.github.com> Date: Mon, 22 Jun 2020 18:55:35 +0100 Subject: [PATCH 01/10] Removing File Changes (now using WFCM) --- classes/AbstractSensor.php | 2 +- classes/AuditLogListView.php | 1 + classes/Models/ActiveRecord.php | 8 +- classes/Models/Occurrence.php | 6 +- classes/SensorManager.php | 16 +- classes/Sensors/MetaData.php | 5 + .../Utilities/PluginInstallAndActivate.php | 24 +- classes/Views/AuditLog.php | 12 +- classes/Views/EmailNotifications.php | 2 +- classes/Views/ExternalDB.php | 2 +- classes/Views/Help.php | 2 +- classes/Views/Settings.php | 875 +--- classes/Views/SetupWizard.php | 6 +- classes/Views/ToggleAlerts.php | 22 +- css/extensions.css | 30 +- defaults.php | 21 +- languages/wp-security-audit-log.pot | 3800 ++++++++++++++++- sdk/class-wsal-browser.php | 62 +- .../assets/img/wp-security-audit-log.png | Bin 0 -> 9380 bytes sdk/freemius/includes/class-freemius.php | 14 +- .../includes/fs-plugin-info-dialog.php | 2 +- sdk/wsal-freemius.php | 29 +- wp-security-audit-log.php | 151 +- 23 files changed, 3901 insertions(+), 1191 deletions(-) create mode 100644 sdk/freemius/assets/img/wp-security-audit-log.png diff --git a/classes/AbstractSensor.php b/classes/AbstractSensor.php index 64850f1b..15bc378b 100644 --- a/classes/AbstractSensor.php +++ b/classes/AbstractSensor.php @@ -24,7 +24,7 @@ abstract class WSAL_AbstractSensor { /** * Instance of WpSecurityAuditLog. * - * @var object + * @var WpSecurityAuditLog */ protected $plugin; diff --git a/classes/AuditLogListView.php b/classes/AuditLogListView.php index ad5aac9c..a905aad0 100644 --- a/classes/AuditLogListView.php +++ b/classes/AuditLogListView.php @@ -245,6 +245,7 @@ public function extra_tablenav( $which ) { } } + // Switch to live or archive DB. if ( $this->_plugin->settings->IsArchivingEnabled() ) { if ( diff --git a/classes/Models/ActiveRecord.php b/classes/Models/ActiveRecord.php index e02ace2a..2db2a159 100644 --- a/classes/Models/ActiveRecord.php +++ b/classes/Models/ActiveRecord.php @@ -184,7 +184,7 @@ public function LoadData( $data ) { case is_array( $copy->$key ): case is_object( $copy->$key ): $json_decoded_val = WSAL_Helpers_DataHelper::JsonDecode( $val ); - $this->$key = ( null == $json_decoded_val ) ? $val : $json_decoded_val; + $this->$key = ( null == $json_decoded_val ) ? $val : $json_decoded_val; break; case is_int( $copy->$key ): $this->$key = (int) $val; @@ -220,10 +220,10 @@ public function Save() { $this->created_on = $this->GetMicrotime(); } $update_id = $this->getId(); - $result = $this->getAdapter()->Save( $this ); + $result = $this->getAdapter()->Save( $this ); if ( false !== $result ) { - $this->_state = ( ! empty( $update_id ) ) ? self::STATE_UPDATED : self::STATE_CREATED; + $this->_state = ( ! empty( $update_id )) ? self::STATE_UPDATED : self::STATE_CREATED; } return $result; } @@ -236,7 +236,7 @@ public function Save() { */ public function Delete() { $this->_state = self::STATE_UNKNOWN; - $result = $this->getAdapter()->Delete( $this ); + $result = $this->getAdapter()->Delete( $this ); if ( false !== $result ) { $this->_state = self::STATE_DELETED; } diff --git a/classes/Models/Occurrence.php b/classes/Models/Occurrence.php index 1b8b95f0..7088d2d1 100644 --- a/classes/Models/Occurrence.php +++ b/classes/Models/Occurrence.php @@ -204,6 +204,10 @@ public function GetMessage( $meta_formatter = null, $highlight = false, $meta = 'name' => __( 'BBPress', 'wp-security-audit-log' ), 'event_ids' => array( 8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023 ), ), + 'wfcm' => array( + 'name' => __( 'WFCM', 'wp-security-audit-log' ), + 'event_ids' => array( 6028, 6029, 6030, 6031, 6032, 6033 ), + ), ); $installer_nonce = wp_create_nonce( 'wsal-install-addon' ); foreach ( $addon_event_codes as $key => $addon ) { @@ -211,7 +215,7 @@ public function GetMessage( $meta_formatter = null, $highlight = false, $meta = if ( in_array( $this->alert_id, $addon['event_ids'], true ) ) { // check key and update message here. $message = sprintf( - 'The details of this event are unknown. You need to install the add-on for %1$s to see the details.%2$s%3$sInstall and activate add-on%4$s', + 'The details of this event are unknown. You need to install the add-on for %1$s to see the details.%2$s%3$sInstall and activate extension %4$s', esc_html( $addon['name'] ), '
', '