diff --git a/classes/AbstractSensor.php b/classes/AbstractSensor.php index ec3dc075..95ab864b 100644 --- a/classes/AbstractSensor.php +++ b/classes/AbstractSensor.php @@ -35,7 +35,7 @@ abstract class WSAL_AbstractSensor { * * @var integer * - * @since 4.4.2 + * @since 4.4.2.1 */ protected static $seconds_to_check_back = 5; diff --git a/classes/Adapters/MySQL/MetaAdapter.php b/classes/Adapters/MySQL/MetaAdapter.php index bbd77b37..11783c72 100644 --- a/classes/Adapters/MySQL/MetaAdapter.php +++ b/classes/Adapters/MySQL/MetaAdapter.php @@ -102,7 +102,7 @@ protected function get_table_options() { * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ public function delete_by_occurrence_ids( $occurrence_ids ) { if ( ! empty( $occurrence_ids ) ) { @@ -120,7 +120,7 @@ public function delete_by_occurrence_ids( $occurrence_ids ) { * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public function load_by_name_and_occurrence_id( $meta_name, $occurrence_id ) { // Make sure to grab the migrated meta fields from the occurrence table. diff --git a/classes/AlertFormatter.php b/classes/AlertFormatter.php index 4ec16726..02b7096e 100644 --- a/classes/AlertFormatter.php +++ b/classes/AlertFormatter.php @@ -271,7 +271,7 @@ public function format_meta_expression( $expression, $value, $occurrence_id = nu * * @return string|mixed * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function data_truncate( $value, $expression, $length = 50, $ellipses_sequence = '...' ) { @@ -286,7 +286,7 @@ public static function data_truncate( $value, $expression, $length = 50, $ellips case '%MetaValue%': case '%MetaValueOld%': case '%MetaValueNew%': - $value = mb_strlen( $value ) > $length ? ( mb_substr( $value, 0, $length ) . $ellipses_sequence() ) : $value; + $value = mb_strlen( $value ) > $length ? ( mb_substr( $value, 0, $length ) . $ellipses_sequence ) : $value; break; default: break; diff --git a/classes/AlertManager.php b/classes/AlertManager.php index ddc28985..f29e4b1a 100644 --- a/classes/AlertManager.php +++ b/classes/AlertManager.php @@ -98,7 +98,7 @@ final class WSAL_AlertManager { * * @var array * - * @since 4.4.2 + * @since 4.4.2.1 */ private static $disabled_post_types = array(); @@ -154,7 +154,7 @@ public function __construct( WpSecurityAuditLog $plugin ) { * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_ignored_post_types(): array { if ( empty( self::$ignored_cpts ) ) { diff --git a/classes/Connector/ConnectorFactory.php b/classes/Connector/ConnectorFactory.php index 2459c740..e20433e0 100644 --- a/classes/Connector/ConnectorFactory.php +++ b/classes/Connector/ConnectorFactory.php @@ -43,7 +43,7 @@ abstract class WSAL_Connector_ConnectorFactory { * * @var boolean * - * @since 4.4.2 + * @since 4.4.2.1 */ private static $connection = false; @@ -172,7 +172,7 @@ public static function get_config() { * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function destroy_connection() { self::$connection = false; diff --git a/classes/Entities/class-abstract-entity.php b/classes/Entities/class-abstract-entity.php index 06efd4fd..ea4ce2e3 100644 --- a/classes/Entities/class-abstract-entity.php +++ b/classes/Entities/class-abstract-entity.php @@ -33,7 +33,7 @@ abstract class Abstract_Entity { * * @var [type] * - * @since 4.4.2 + * @since 4.4.2.1 */ private static $connection = null; @@ -42,10 +42,10 @@ abstract class Abstract_Entity { * * @return string * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_table_name(): string { - return self::get_connection()->prefix . static::$table; + return self::get_connection()->base_prefix . static::$table; } /** @@ -53,7 +53,7 @@ public static function get_table_name(): string { * * @return \WPDB @see \WSAL_Connector_MySQLDB * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_connection() { if ( null === self::$connection ) { @@ -78,7 +78,7 @@ public static function get_connection() { * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function set_connection( $connection ) { self::$connection = $connection; @@ -89,7 +89,7 @@ public static function set_connection( $connection ) { * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function destroy_connection() { self::$connection = null; @@ -105,7 +105,7 @@ public static function destroy_connection() { * * @return bool * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function maybe_create_table( string $table_name, string $create_ddl ): bool { foreach ( self::get_connection()->get_col( 'SHOW TABLES', 0 ) as $table ) { @@ -130,7 +130,7 @@ public static function maybe_create_table( string $table_name, string $create_dd * * @return boolean * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function is_external_db(): bool { $db_config = \WSAL_Connector_ConnectorFactory::get_config(); @@ -151,7 +151,7 @@ public static function is_external_db(): bool { * * @return boolean - True if the column exists and all given parameters are the same, false otherwise. * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function check_column( string $table_name, @@ -204,7 +204,7 @@ public static function check_column( * * @return integer * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_last_sql_error( $_wpdb ): int { $code = 0; @@ -235,7 +235,7 @@ public static function drop_table() { * * @return boolean * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function check_table_exists( string $table_name ): bool { foreach ( self::get_connection()->get_col( 'SHOW TABLES', 0 ) as $table ) { diff --git a/classes/Entities/class-metadata-entity.php b/classes/Entities/class-metadata-entity.php index ebb6e7a7..c290fb9f 100644 --- a/classes/Entities/class-metadata-entity.php +++ b/classes/Entities/class-metadata-entity.php @@ -35,7 +35,7 @@ class Metadata_Entity extends Abstract_Entity { * * @return bool * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function create_table(): bool { $table_name = self::get_table_name(); diff --git a/classes/Entities/class-occurrences-entity.php b/classes/Entities/class-occurrences-entity.php index c87fcd80..91450ba6 100644 --- a/classes/Entities/class-occurrences-entity.php +++ b/classes/Entities/class-occurrences-entity.php @@ -58,7 +58,7 @@ public static function get_upgrade_query() { * * @return bool * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function create_table(): bool { $table_name = self::get_table_name(); diff --git a/classes/Entities/class-options-entity.php b/classes/Entities/class-options-entity.php index 410de91d..948cb10e 100644 --- a/classes/Entities/class-options-entity.php +++ b/classes/Entities/class-options-entity.php @@ -41,7 +41,7 @@ class Options_Entity extends Abstract_Entity { * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function transfer_options() { global $wpdb; @@ -77,7 +77,7 @@ public static function drop_table() { * * @return string * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_table_name(): string { global $wpdb; diff --git a/classes/Helpers/class-classes-helper.php b/classes/Helpers/class-classes-helper.php index 3c065ae3..e8ebb777 100644 --- a/classes/Helpers/class-classes-helper.php +++ b/classes/Helpers/class-classes-helper.php @@ -27,7 +27,7 @@ class Classes_Helper { * * @var array * - * @since 4.4.2 + * @since 4.4.2.1 */ private static $class_map = array(); @@ -36,7 +36,7 @@ class Classes_Helper { * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_class_map(): array { if ( empty( self::$class_map ) ) { @@ -53,7 +53,7 @@ public static function get_class_map(): array { * * @return string|false * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_class_by_filename( string $file ) { if ( in_array( $file, self::get_class_map(), true ) ) { @@ -76,7 +76,7 @@ public static function get_class_by_filename( string $file ) { * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_subclasses_of_class( string $current_class, string $base_class, bool $exclude_abstracts = true ): array { @@ -100,7 +100,7 @@ public static function get_subclasses_of_class( string $current_class, string $b * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_classes_by_namespace( string $namespace ) { if ( 0 === strpos( $namespace, '\\' ) ) { @@ -148,7 +148,7 @@ function( $class ) use ( $term_upper ) { * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_classes_with_term( $term ) { $term_upper = strtoupper( $term ); diff --git a/classes/Helpers/class-php-helper.php b/classes/Helpers/class-php-helper.php index 235d8f6d..9099af76 100644 --- a/classes/Helpers/class-php-helper.php +++ b/classes/Helpers/class-php-helper.php @@ -29,7 +29,7 @@ class PHP_Helper { * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function string_to_array( string $string ): array { if ( empty( $string ) ) { diff --git a/classes/Helpers/class-validator.php b/classes/Helpers/class-validator.php index b6edbfd9..3d32b6de 100644 --- a/classes/Helpers/class-validator.php +++ b/classes/Helpers/class-validator.php @@ -30,7 +30,7 @@ class Validator { * * @return boolean - true - tag is valid, false - tag is not valid. * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function validate_mirror_tag( string $string ): bool { @@ -59,7 +59,7 @@ public static function validate_mirror_tag( string $string ): bool { * * @return boolean * - * @since 4.4.2 + * @since 4.4.2.1 */ private static function starts_alpha_numeric( string $string ): bool { if ( preg_match( '/^[a-zA-Z0-9]/', $string ) ) { @@ -77,7 +77,7 @@ private static function starts_alpha_numeric( string $string ): bool { * * @return boolean * - * @since 4.4.2 + * @since 4.4.2.1 */ private static function is_string_less_or_equal( string $string, int $size ): bool { if ( strlen( $string ) <= $size ) { @@ -94,7 +94,7 @@ private static function is_string_less_or_equal( string $string, int $size ): bo * * @return boolean * - * @since 4.4.2 + * @since 4.4.2.1 */ private static function is_string_contains_only( string $string ): bool { if ( preg_match( '/[a-z\d_-]*/i', $string ) ) { diff --git a/classes/Helpers/class-wp-helper.php b/classes/Helpers/class-wp-helper.php index 9769448d..4ac3a89c 100644 --- a/classes/Helpers/class-wp-helper.php +++ b/classes/Helpers/class-wp-helper.php @@ -22,7 +22,7 @@ /** * All the WP functionality must go trough this class * - * @since 4.4.2 + * @since 4.4.2.1 */ class WP_Helper { @@ -33,7 +33,7 @@ class WP_Helper { * * @var array * - * @since 4.4.2 + * @since 4.4.2.1 */ private static $user_roles = array(); @@ -42,7 +42,7 @@ class WP_Helper { * * @var array * - * @since 4.4.2 + * @since 4.4.2.1 */ private static $user_roles_wp = array(); @@ -51,7 +51,7 @@ class WP_Helper { * * @var bool * - * @since 4.4.2 + * @since 4.4.2.1 */ private static $is_multisite = null; @@ -69,7 +69,7 @@ class WP_Helper { * * @return boolean * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function is_role_exists( string $role ): bool { self::set_roles(); @@ -86,7 +86,7 @@ public static function is_role_exists( string $role ): bool { * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_roles() { self::set_roles(); @@ -99,7 +99,7 @@ public static function get_roles() { * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_roles_wp() { if ( empty( self::$user_roles_wp ) ) { @@ -115,7 +115,7 @@ public static function get_roles_wp() { * * @return boolean * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function is_multisite() { if ( null === self::$is_multisite ) { @@ -132,7 +132,7 @@ public static function is_multisite() { * * @return mixed * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_option( $setting_name, $default_value = false ) { $prefixed_name = self::prefix_name( $setting_name ); @@ -148,7 +148,7 @@ public static function get_option( $setting_name, $default_value = false ) { * * @return mixed * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function set_option( $setting_name, $new_value, $autoload = false ) { return self::update_option( $setting_name, $new_value, $autoload ); @@ -163,7 +163,7 @@ public static function set_option( $setting_name, $new_value, $autoload = false * * @return mixed * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function update_option( $setting_name, $new_value, $autoload = false ) { $prefixed_name = self::prefix_name( $setting_name ); @@ -177,7 +177,7 @@ public static function update_option( $setting_name, $new_value, $autoload = fal * * @return mixed * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function delete_option( $setting_name ) { $prefixed_name = self::prefix_name( $setting_name ); @@ -218,7 +218,7 @@ public static function delete_global_option( $option_name = '' ) { * * @return mixed * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function set_global_option( $setting_name, $new_value, $autoload = false ) { return self::update_global_option( $setting_name, $new_value, $autoload ); @@ -295,7 +295,7 @@ public static function get_global_option( $option_name = '', $default = null ) { * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function un_schedule_event( string $event_name ) { $schedule_time = wp_next_scheduled( $event_name ); @@ -329,7 +329,7 @@ public static function get_multi_sites(): array { * * @return bool True if the transient was deleted, false otherwise. * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function delete_transient( $transient ) { return self::is_multisite() ? delete_site_transient( $transient ) : delete_transient( $transient ); @@ -354,7 +354,7 @@ public static function is_plugin_installed(): bool { * * @return array * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_active_plugins(): array { $active_plugins = array(); @@ -372,7 +372,7 @@ public static function get_active_plugins(): array { * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ private static function set_roles() { if ( empty( self::$user_roles ) ) { @@ -393,7 +393,7 @@ private static function set_roles() { * * @return string * - * @since 4.4.2 + * @since 4.4.2.1 */ private static function prefix_name( string $name ): string { diff --git a/classes/Migration/class-abstract-migration.php b/classes/Migration/class-abstract-migration.php index a7bafa4a..cf0e3085 100644 --- a/classes/Migration/class-abstract-migration.php +++ b/classes/Migration/class-abstract-migration.php @@ -46,6 +46,11 @@ */ class Abstract_Migration { + /** + * That is a global constant used for marking the migration process as in progress. + */ + const STARTED_MIGRATION_PROCESS = 'migration-process-started'; + /** * Extracted version from the DB (WP option) * @@ -69,7 +74,7 @@ class Abstract_Migration { * * @var string * - * @since 4.4.2 + * @since 4.4.2.1 */ protected static $const_name_of_plugin_version = ''; @@ -106,7 +111,7 @@ public static function migrate() { } // Check if that process is not started already. - $migration_started = WP_Helper::get_global_option( 'migration-started', false ); + $migration_started = WP_Helper::get_global_option( self::STARTED_MIGRATION_PROCESS, false ); if ( version_compare( static::get_stored_version(), \constant( static::$const_name_of_plugin_version ), '<' ) ) { @@ -116,10 +121,25 @@ public static function migrate() { if ( '0000' === $stored_version_as_number && ! WP_Helper::is_plugin_installed() ) { // That is first install of the plugin, store the version and leave. self::store_updated_version(); + + $disabled_alerts = WP_Helper::get_global_option( 'disabled-alerts', false ); + + $always_disabled_alerts = implode( ',', \WSAL_Settings::get_default_always_disabled_alerts() ); + + $disabled_alerts = implode( ',', \array_merge( \explode( ',', $disabled_alerts ), \explode( ',', $always_disabled_alerts ) ) ); + + /** + * That is split only for clarity + */ + if ( false === $disabled_alerts ) { + WP_Helper::set_global_option( 'disabled-alerts', $always_disabled_alerts ); + } elseif ( $disabled_alerts !== $always_disabled_alerts ) { + WP_Helper::update_global_option( 'disabled-alerts', $disabled_alerts ); + } } else { if ( false === $migration_started ) { - WP_Helper::set_global_option( 'migration-started', true ); + WP_Helper::set_global_option( self::STARTED_MIGRATION_PROCESS, true ); try { // set transient for the updating status - would that help ?!? $method_as_version_numbers = static::get_all_migration_methods_as_numbers(); @@ -146,7 +166,7 @@ function( $method, $key ) use ( &$stored_version_as_number, &$target_version_as_ self::store_updated_version(); } finally { - \WSAL\Helpers\WP_Helper::delete_global_option( 'migration-started' ); + \WSAL\Helpers\WP_Helper::delete_global_option( self::STARTED_MIGRATION_PROCESS ); } } } @@ -158,7 +178,7 @@ function( $method, $key ) use ( &$stored_version_as_number, &$target_version_as_ * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ if ( false === $migration_started && version_compare( static::get_stored_version(), \constant( static::$const_name_of_plugin_version ), '>' ) ) { self::store_updated_version(); @@ -172,7 +192,7 @@ function( $method, $key ) use ( &$stored_version_as_number, &$target_version_as_ * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function remove_notice( string $notice ) { @@ -194,7 +214,7 @@ public static function remove_notice( string $notice ) { private static function get_stored_version() { if ( '' === trim( static::$stored_version ) ) { - static::$stored_version = WP_Helper::get_option( static::$version_option_name, '0.0.0' ); + static::$stored_version = WP_Helper::get_global_option( static::$version_option_name, '0.0.0' ); } return static::$stored_version; diff --git a/classes/Migration/class-metadata-migration-440.php b/classes/Migration/class-metadata-migration-440.php index 099f62e0..33373979 100644 --- a/classes/Migration/class-metadata-migration-440.php +++ b/classes/Migration/class-metadata-migration-440.php @@ -56,7 +56,7 @@ class Metadata_Migration_440 extends WP_Background_Process { * * @param string $action - The name of the action. * - * @since 4.4.2 + * @since 4.4.2.1 */ public function __construct( string $action ) { $this->action .= $action; diff --git a/classes/Migration/class-migration.php b/classes/Migration/class-migration.php index 90909009..d10d3ce2 100644 --- a/classes/Migration/class-migration.php +++ b/classes/Migration/class-migration.php @@ -35,7 +35,7 @@ class Migration extends Abstract_Migration { * * @var string * - * @since 4.4.2 + * @since 4.4.2.1 */ protected static $version_option_name = WSAL_PREFIX . 'plugin_version'; @@ -46,10 +46,19 @@ class Migration extends Abstract_Migration { * * @var string * - * @since 4.4.2 + * @since 4.4.2.1 */ protected static $const_name_of_plugin_version = 'WSAL_VERSION'; + /** + * Marks 442 update as started + * + * @var boolean + * + * @since 4.4.2.1 + */ + protected static $_442_started = false; + /** * Migration for version upto 4.4.2 * @@ -58,6 +67,9 @@ class Migration extends Abstract_Migration { * @return void */ protected static function migrate_up_to_4420() { + + self::$_442_started = true; + // If the legacy table exists, lets extract the options and remove it. if ( \WSAL\Entities\Options_Entity::check_table_exists( \WSAL\Entities\Options_Entity::get_table_name() ) ) { \WSAL\Entities\Options_Entity::transfer_options(); @@ -66,19 +78,34 @@ protected static function migrate_up_to_4420() { \WSAL\Entities\Options_Entity::destroy_connection(); } - $disabled_alerts = WP_Helper::get_global_option( 'disabled-alerts', false ); - $wsal = \WpSecurityAuditLog::get_instance(); + $wsal::load_freemius(); + $wsal->load_defaults(); + + // Load dependencies. + if ( ! isset( $wsal->alerts ) ) { + $wsal->alerts = new \WSAL_AlertManager( $wsal ); + } + + if ( ! isset( $wsal->constants ) ) { + $wsal->constants = new \WSAL_ConstantManager(); + } + + $wsal->sensors = new \WSAL_SensorManager( $wsal ); + + $disabled_alerts = WP_Helper::get_global_option( 'disabled-alerts', false ); $always_disabled_alerts = implode( ',', $wsal->settings()->always_disabled_alerts ); + $disabled_alerts = implode( ',', \array_merge( \explode( ',', $disabled_alerts ), \explode( ',', $always_disabled_alerts ) ) ); + /** * That is split only for clarity */ if ( false === $disabled_alerts ) { WP_Helper::set_global_option( 'disabled-alerts', $always_disabled_alerts ); } elseif ( $disabled_alerts !== $always_disabled_alerts ) { - WP_Helper::update_global_option( 'disabled-alerts', $always_disabled_alerts ); + WP_Helper::update_global_option( 'disabled-alerts', $disabled_alerts ); } self::remove_notice( 'wsal-notice-wsal-privacy-notice-3.2' ); @@ -405,22 +432,24 @@ protected static function migrate_up_to_4420() { * Premium or not does not matter. User can had premium but in time of the upgrade, their license could be expired, * that does not mean that they will never switch back to the premium version. */ - $table_exists = \WSAL\Entities\Occurrences_Entity::check_table_exists( $wpdb->prefix . 'wsal_sessions' ); + $table_exists = \WSAL\Entities\Occurrences_Entity::check_table_exists( $wpdb->base_prefix . 'wsal_sessions' ); if ( $table_exists ) { $column_exists = \WSAL\Entities\Occurrences_Entity::check_column( - $wpdb->prefix . 'wsal_sessions', + $wpdb->base_prefix . 'wsal_sessions', 'session_token', 'varchar( 255 )' ); if ( ! $column_exists ) { - $alter_query = 'ALTER TABLE `wp_wsal_sessions` CHANGE `session_token` `session_token` VARCHAR(128) + $alter_query = 'ALTER TABLE `' . $wpdb->base_prefix . 'wsal_sessions` CHANGE `session_token` `session_token` VARCHAR(128) NOT NULL;'; $wpdb->query( $alter_query ); // phpcs:ignore } } + \WSAL\Entities\Occurrences_Entity::destroy_connection(); + // If one of the new columns exists there is no need to alter the table. $column_exists = \WSAL\Entities\Occurrences_Entity::check_column( \WSAL\Entities\Occurrences_Entity::get_table_name(), @@ -492,5 +521,51 @@ protected static function migrate_up_to_4420() { } } } + + /** + * Migration for version upto 4.4.2.1 + * + * Note: The migration methods need to be in line with the @see WSAL\Utils\Abstract_Migration::$pad_length + * + * @return void + */ + protected static function migrate_up_to_4421() { + \WSAL\Helpers\WP_Helper::delete_global_option( 'migration-started' ); + + if ( ! self::$_442_started ) { + self::migrate_up_to_4420(); + } + + global $wpdb; + /** + * User session table should be always in the local database. + * + * Premium or not does not matter. User can had premium but in time of the upgrade, their license could be expired, + * that does not mean that they will never switch back to the premium version. + */ + $table_exists = \WSAL\Entities\Occurrences_Entity::check_table_exists( $wpdb->base_prefix . 'wsal_sessions' ); + if ( $table_exists ) { + $column_exists = \WSAL\Entities\Occurrences_Entity::check_column( + $wpdb->base_prefix . 'wsal_sessions', + 'sites', + 'longtext' + ); + $column_exists_id = \WSAL\Entities\Occurrences_Entity::check_column( + $wpdb->base_prefix . 'wsal_sessions', + 'id', + 'bigint' + ); + + if ( ! $column_exists || $column_exists_id ) { + $alter_query = 'DROP TABLE `' . $wpdb->base_prefix . 'wsal_sessions`;'; + + $wpdb->query( $alter_query ); // phpcs:ignore + + if ( class_exists( '\WSAL\Adapter\User_Sessions' ) ) { + \WSAL\Adapter\User_Sessions::create_table(); + } + } + } + } } } diff --git a/classes/SensorManager.php b/classes/SensorManager.php index 77548c47..a380ae39 100644 --- a/classes/SensorManager.php +++ b/classes/SensorManager.php @@ -35,7 +35,7 @@ final class WSAL_SensorManager extends WSAL_AbstractSensor { * * @param WpSecurityAuditLog $plugin - Instance of WpSecurityAuditLog. * - * @since 4.4.2 + * @since 4.4.2.1 */ public function __construct( WpSecurityAuditLog $plugin ) { parent::__construct( $plugin ); diff --git a/classes/Sensors/Content.php b/classes/Sensors/Content.php index 41bf66c6..32e2871f 100644 --- a/classes/Sensors/Content.php +++ b/classes/Sensors/Content.php @@ -92,7 +92,7 @@ class WSAL_Sensors_Content extends WSAL_AbstractSensor { * * @var WpSecurityAuditLog * - * @since 4.4.2 + * @since 4.4.2.1 */ private static $wsal_plugin = null; @@ -132,7 +132,7 @@ public function hook_events() { * * @param WpSecurityAuditLog $plugin - The plugin instance. * - * @since 4.4.2 + * @since 4.4.2.1 */ public function __construct( WpSecurityAuditLog $plugin ) { parent::__construct( $plugin ); @@ -146,7 +146,7 @@ public function __construct( WpSecurityAuditLog $plugin ) { * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function init( WpSecurityAuditLog $plugin ) { self::$wsal_plugin = $plugin; @@ -802,7 +802,7 @@ public function check_template_change( $post_id, $meta_value ) { /** * Fires immediately before updating a post's metadata. * - * @since 4.4.2 + * @since 4.4.2.1 * * @param int $meta_id ID of metadata entry to update. * @param int $object_id Post ID. @@ -826,7 +826,7 @@ public static function before_changing_meta( $meta_id, $object_id, $meta_key, $m * * @return void * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function fire_lock_change( int $post_id, string $meta_value ) { diff --git a/classes/Sensors/PluginsThemes.php b/classes/Sensors/PluginsThemes.php index 80fa6120..8d7d5373 100644 --- a/classes/Sensors/PluginsThemes.php +++ b/classes/Sensors/PluginsThemes.php @@ -95,7 +95,7 @@ public function detect_upgrade_completed( $upgrader_object, $hook_extra ) { * @param string $stylesheet Stylesheet of the theme to delete. * @param bool $deleted Whether the theme deletion was successful. * - * @since 4.4.2 + * @since 4.4.2.1 * * phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase */ diff --git a/classes/Settings.php b/classes/Settings.php index 358ad3d5..5a2a3327 100644 --- a/classes/Settings.php +++ b/classes/Settings.php @@ -127,6 +127,14 @@ class WSAL_Settings { */ public $always_disabled_alerts = array( 5010, 5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5022, 5023, 5024 ); + /** + * Alerts disabled by default - duplication of the above for faster access via static call + * + * @var int[] + * @since 4.4.2.1 + */ + private static $default_always_disabled_alerts = array( 5010, 5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5022, 5023, 5024 ); + /** * Current screen object. * @@ -2297,4 +2305,15 @@ public function set_database_version( $version ) { $this->plugin->set_global_setting( 'db_version', $version, true ); } + + /** + * Returns default disabled alerts statically + * + * @return array + * + * @since 4.4.2.1 + */ + public static function get_default_always_disabled_alerts(): array { + return self::$default_always_disabled_alerts; + } } diff --git a/classes/Upgrade/Upgrade_43000_To_44400.php b/classes/Upgrade/Upgrade_43000_To_44400.php deleted file mode 100644 index 061c7820..00000000 --- a/classes/Upgrade/Upgrade_43000_To_44400.php +++ /dev/null @@ -1,207 +0,0 @@ -plugin = $plugin; - } - - /** - * Runs the upgrade process. - */ - public function run() { - - // Delete unwanted usermeta. - global $wpdb; - $wpdb->query( // phpcs:ignore - $wpdb->prepare( - "DELETE FROM {$wpdb->usermeta} WHERE meta_key = '%s';", // phpcs:ignore - 'wsal-notice-update-44-notice' - ) - ); - - if ( class_exists( 'WSAL_Extension_Manager' ) ) { - WSAL_Extension_Manager::include_extension( 'external-db' ); - } - - if ( ! did_action( 'wsal_init' ) ) { - // We need to call wsal init manually because it does not run as before the upgrade procedure is triggered. - do_action( 'wsal_init', $this->plugin ); - } - - // Remove some forgotten WFCM settings from the options table. - $this->remove_wfcm_leftover_settings(); - - // Change occurrence table in local database. - $this->upgrade_occurrence_table( 'local' ); - - - $this->stop_autoloading_some_settings(); - } - - /** - * Removes a bunch of legacy WFCM extension related settings. - */ - private function remove_wfcm_leftover_settings() { - // Remove all settings related to WFCM plugin. - $not_found_page_related_settings = array( - 'wsal_scan-in-progress', - 'wsal_last-scanned', - 'wsal_is_initial_scan_0', - 'wsal_is_initial_scan_1', - 'wsal_is_initial_scan_2', - 'wsal_is_initial_scan_3', - 'wsal_is_initial_scan_4', - 'wsal_is_initial_scan_5', - 'wsal_is_initial_scan_6', - 'wsal_last_scan_start', - 'wsal_scanned_dirs', - ); - foreach ( $not_found_page_related_settings as $setting_name ) { - $this->plugin->delete_global_setting( $setting_name ); - } - } - - /** - * Upgrades an occurrence table using given connection. - * - * It also kicks-off a metadata migration in the background. - * - * @param string|array $connection Connection alias or configuration data. - * - * @throws Freemius_Exception Freemius exception. - */ - private function upgrade_occurrence_table( $connection ) { - $connector = $this->plugin->get_connector( $connection ); - /** @var WSAL_Adapters_MySQL_Occurrence $occurrence_adapter */ - $occurrence_adapter = $connector->get_adapter( 'Occurrence' ); - - // Skip the upgrade it the table does not exist for some reason. - if ( ! $connector->is_installed() ) { - return; - } - - $table_name = $occurrence_adapter->get_table(); - $connector->query( $this->get_occurrence_table_upgrade_query( $table_name ) ); - - // Check if there are any events to process. - if ( $occurrence_adapter->count() > 0 ) { - // Create a background job to migrate the metadata. - $job_info = array( - 'start_time' => current_time( 'timestamp' ), // phpcs:ignore - 'processed_events_count' => 0, - 'batch_size' => 50, - 'connection' => is_array( $connection ) ? $connection['name'] : $connection, - ); - - // Store the initial info to the db. - WSAL_Upgrade_MetadataMigration::store_migration_info( $job_info ); - - // Create and dispatch the background process itself. - $bg_process = new WSAL_Upgrade_MetadataMigration(); - $bg_process->push_to_queue( $job_info ); - $bg_process->save(); - $bg_process->dispatch(); - } - } - - /** - * Builds an upgrade query for the occurrence table. - * - * @param string $table_name Table name. - * - * @return string - */ - private function get_occurrence_table_upgrade_query( $table_name ) { - return "ALTER TABLE {$table_name}" - . ' DROP COLUMN is_read, ' - . ' DROP COLUMN is_migrated, ' - . " ADD client_ip VARCHAR(255) NOT NULL DEFAULT ''," - . ' ADD severity BIGINT NOT NULL DEFAULT 0,' - . " ADD object VARCHAR(255) NOT NULL DEFAULT ''," - . " ADD event_type VARCHAR(255) NOT NULL DEFAULT ''," - . " ADD user_agent VARCHAR(255) NOT NULL DEFAULT ''," - . " ADD user_roles VARCHAR(255) NOT NULL DEFAULT ''," - . ' ADD username VARCHAR(255) NULL,' - . ' ADD user_id BIGINT NULL ,' - . " ADD session_id VARCHAR(255) NOT NULL DEFAULT ''," - . " ADD post_status VARCHAR(255) NOT NULL DEFAULT ''," - . " ADD post_type VARCHAR(255) NOT NULL DEFAULT ''," - . ' ADD post_id BIGINT NOT NULL DEFAULT 0;'; - } - - - /** - * Change all but selected plugin settings to stop autoloading. - */ - private function stop_autoloading_some_settings() { - $settings_to_leave_on_autoload = array( - 'wsal_adapter-connection', - 'wsal_admin-bar-notif-updates', - 'wsal_db_version', - 'wsal_disable-admin-bar-notif', - 'wsal_frontend-events', - 'wsal_plugin-viewers', - 'wsal_restrict-log-viewer', - 'wsal_restrict-plugin-settings', - 'wsal_setup-modal-dismissed', - 'wsal_version', - 'wsal_freemius_state', - 'wsal_only-me-user-id', - ); - - // phpcs:disable - global $wpdb; - $plugin_options = $wpdb->get_results( - 'SELECT option_name, option_value ' - . " FROM $wpdb->options " - . " WHERE option_name LIKE '" . WpSecurityAuditLog::OPTIONS_PREFIX . "%';", - ARRAY_A - ); - // phpcs:enable - - if ( ! empty( $plugin_options ) ) { - foreach ( $plugin_options as $option ) { - if ( ! in_array( $option['option_name'], $settings_to_leave_on_autoload ) ) { // phpcs:ignore - $value = maybe_unserialize( $option['option_value'] ); - $this->plugin->set_global_setting( $option['option_name'], $value, false ); - } - } - } - } -} diff --git a/languages/wp-security-audit-log.pot b/languages/wp-security-audit-log.pot index 00823fca..a91bef29 100644 --- a/languages/wp-security-audit-log.pot +++ b/languages/wp-security-audit-log.pot @@ -2,14 +2,14 @@ # This file is distributed under the GPL v3. msgid "" msgstr "" -"Project-Id-Version: WP Activity Log 4.4.2\n" +"Project-Id-Version: WP Activity Log 4.4.2.1\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-security-audit-log\n" "Last-Translator: WP White Security \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2022-06-30T14:34:59+00:00\n" +"POT-Creation-Date: 2022-07-06T06:56:34+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.6.0\n" "X-Domain: wp-security-audit-log\n" diff --git a/readme.txt b/readme.txt index 00aa7aba..992859c2 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ License URI: https://www.gnu.org/licenses/gpl.html Tags: activity log, wordpress activity logs, security audit log, audit log, user tracking, security event log, audit trail, wordpress security monitor, wordpress admin, wordpress admin monitoring, user activity, admin, multisite, SMS alerts, wordpress monitoring, email notification, wordpress email alerts, tracking, user tracking, user activity report, wordpress audit trail Requires at least: 5.0 Tested up to: 6.0.0 -Stable tag: 4.4.2 +Stable tag: 4.4.2.1 Requires PHP: 7.0 The #1 user-rated activity log plugin. Keep a comprehensive log of the changes that happen on your site with this easy to use plugin. @@ -208,6 +208,18 @@ Please refer to our [support pages](https://wpactivitylog.com/support/?utm_sourc == Changelog == += 4.4.2.1 (2022-07-06) = + +* **Bug fixes** + * Fixed: Fatal error when a WooCommerce file download is triggered. + * Fixed: Only users with administrator role shown as logged in on a multisite network. + * Fixed: Event IDs 5010 - 5018 wrongly enabled by default. + * Fixed: A number of upgrade errors caused because of possibly outdated files. + * Fixed: Disabled event IDs disabled at multisite network level were activated back when accessing child sites. + * Fixed: Upgrade notice shown on a multisite network even when it is a new install. + * Fixed: Fatal error triggered due to incorrectly named files (wrong capilitazion). + * Fixed: Error in Alert formatter triggered during the upgrade process. + = 4.4.2 (2022-06-23) = Release notes: [More reports white labelling options & statistics reports](https://wpactivitylog.com/wsal-4-4-2/) diff --git a/third-party/vendor/autoload.php b/third-party/vendor/autoload.php index 6d8ba784..ecdea200 100644 --- a/third-party/vendor/autoload.php +++ b/third-party/vendor/autoload.php @@ -9,4 +9,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit5dee1c288df51b897f0222b5f8e70c3b::getLoader(); +return ComposerAutoloaderInit04f8f552ef027472d4c5ceff80bb3dde::getLoader(); diff --git a/third-party/vendor/composer/autoload_real.php b/third-party/vendor/composer/autoload_real.php index 240889f9..38523253 100644 --- a/third-party/vendor/composer/autoload_real.php +++ b/third-party/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit5dee1c288df51b897f0222b5f8e70c3b +class ComposerAutoloaderInit04f8f552ef027472d4c5ceff80bb3dde { private static $loader; @@ -22,12 +22,12 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit5dee1c288df51b897f0222b5f8e70c3b', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit04f8f552ef027472d4c5ceff80bb3dde', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit5dee1c288df51b897f0222b5f8e70c3b', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit04f8f552ef027472d4c5ceff80bb3dde', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit5dee1c288df51b897f0222b5f8e70c3b::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit04f8f552ef027472d4c5ceff80bb3dde::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); diff --git a/third-party/vendor/composer/autoload_static.php b/third-party/vendor/composer/autoload_static.php index 412bade0..9331aba1 100644 --- a/third-party/vendor/composer/autoload_static.php +++ b/third-party/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit5dee1c288df51b897f0222b5f8e70c3b +class ComposerStaticInit04f8f552ef027472d4c5ceff80bb3dde { public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', @@ -15,7 +15,7 @@ class ComposerStaticInit5dee1c288df51b897f0222b5f8e70c3b public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->classMap = ComposerStaticInit5dee1c288df51b897f0222b5f8e70c3b::$classMap; + $loader->classMap = ComposerStaticInit04f8f552ef027472d4c5ceff80bb3dde::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/autoload.php b/vendor/autoload.php index 738bc758..595a738f 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -9,4 +9,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit63381eb5ad7f702bb2471bb0fe7f4556::getLoader(); +return ComposerAutoloaderInite2764569fb0dddb672f4325f47684b81::getLoader(); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 856472de..f72e671c 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -90,7 +90,6 @@ 'WSAL_Settings' => $baseDir . '/classes/Settings.php', 'WSAL_TablePressExtension' => $baseDir . '/classes/ThirdPartyExtensions/TablePressExtension.php', 'WSAL_Uninstall' => $baseDir . '/classes/Uninstall.php', - 'WSAL_Upgrade_43000_To_44400' => $baseDir . '/classes/Upgrade/Upgrade_43000_To_44400.php', 'WSAL_Utilities_DateTimeFormatter' => $baseDir . '/classes/Utilities/DateTimeFormatter.php', 'WSAL_Utilities_Emailer' => $baseDir . '/classes/Utilities/Emailer.php', 'WSAL_Utilities_FileSystemUtils' => $baseDir . '/classes/Utilities/FileSystemUtils.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 0c943709..b9cba5e7 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit63381eb5ad7f702bb2471bb0fe7f4556 +class ComposerAutoloaderInite2764569fb0dddb672f4325f47684b81 { private static $loader; @@ -22,18 +22,18 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit63381eb5ad7f702bb2471bb0fe7f4556', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInite2764569fb0dddb672f4325f47684b81', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit63381eb5ad7f702bb2471bb0fe7f4556', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInite2764569fb0dddb672f4325f47684b81', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit63381eb5ad7f702bb2471bb0fe7f4556::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInite2764569fb0dddb672f4325f47684b81::getInitializer($loader)); $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInit63381eb5ad7f702bb2471bb0fe7f4556::$files; + $includeFiles = \Composer\Autoload\ComposerStaticInite2764569fb0dddb672f4325f47684b81::$files; foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire63381eb5ad7f702bb2471bb0fe7f4556($fileIdentifier, $file); + composerRequiree2764569fb0dddb672f4325f47684b81($fileIdentifier, $file); } return $loader; @@ -45,7 +45,7 @@ public static function getLoader() * @param string $file * @return void */ -function composerRequire63381eb5ad7f702bb2471bb0fe7f4556($fileIdentifier, $file) +function composerRequiree2764569fb0dddb672f4325f47684b81($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index c161873a..1232bb65 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit63381eb5ad7f702bb2471bb0fe7f4556 +class ComposerStaticInite2764569fb0dddb672f4325f47684b81 { public static $files = array ( '2007ccaa29a9efd0493ee82176c977d1' => __DIR__ . '/..' . '/wpwhitesecurity/import-export-plugin-settings/SettingsImportExport.php', @@ -110,7 +110,6 @@ class ComposerStaticInit63381eb5ad7f702bb2471bb0fe7f4556 'WSAL_Settings' => __DIR__ . '/../..' . '/classes/Settings.php', 'WSAL_TablePressExtension' => __DIR__ . '/../..' . '/classes/ThirdPartyExtensions/TablePressExtension.php', 'WSAL_Uninstall' => __DIR__ . '/../..' . '/classes/Uninstall.php', - 'WSAL_Upgrade_43000_To_44400' => __DIR__ . '/../..' . '/classes/Upgrade/Upgrade_43000_To_44400.php', 'WSAL_Utilities_DateTimeFormatter' => __DIR__ . '/../..' . '/classes/Utilities/DateTimeFormatter.php', 'WSAL_Utilities_Emailer' => __DIR__ . '/../..' . '/classes/Utilities/Emailer.php', 'WSAL_Utilities_FileSystemUtils' => __DIR__ . '/../..' . '/classes/Utilities/FileSystemUtils.php', @@ -138,9 +137,9 @@ class ComposerStaticInit63381eb5ad7f702bb2471bb0fe7f4556 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit63381eb5ad7f702bb2471bb0fe7f4556::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit63381eb5ad7f702bb2471bb0fe7f4556::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit63381eb5ad7f702bb2471bb0fe7f4556::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInite2764569fb0dddb672f4325f47684b81::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInite2764569fb0dddb672f4325f47684b81::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInite2764569fb0dddb672f4325f47684b81::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 1464b477..76764f89 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -90,17 +90,17 @@ }, { "name": "woocommerce/action-scheduler", - "version": "3.4.0", - "version_normalized": "3.4.0.0", + "version": "3.4.2", + "version_normalized": "3.4.2.0", "source": { "type": "git", "url": "https://github.com/woocommerce/action-scheduler.git", - "reference": "3218a33ff14b968f8cb05de9656c2efa1eeb1330" + "reference": "7d8e830b6387410ccf11708194d3836f01cb2942" }, "dist": { "type": "zip", - "url": "https://github.com/repos/woocommerce/action-scheduler/zipball/3218a33ff14b968f8cb05de9656c2efa1eeb1330", - "reference": "3218a33ff14b968f8cb05de9656c2efa1eeb1330", + "url": "https://github.com/repos/woocommerce/action-scheduler/zipball/7d8e830b6387410ccf11708194d3836f01cb2942", + "reference": "7d8e830b6387410ccf11708194d3836f01cb2942", "shasum": "" }, "require-dev": { @@ -109,7 +109,7 @@ "wp-cli/wp-cli": "~2.5.0", "yoast/phpunit-polyfills": "^1.0" }, - "time": "2021-10-28T17:09:12+00:00", + "time": "2022-06-08T15:46:07+00:00", "type": "wordpress-plugin", "extra": { "scripts-description": { @@ -127,7 +127,7 @@ "homepage": "https://actionscheduler.org/", "support": { "issues": "https://github.com/woocommerce/action-scheduler/issues", - "source": "https://github.com/woocommerce/action-scheduler/tree/3.4.0" + "source": "https://github.com/woocommerce/action-scheduler/tree/3.4.2" }, "install-path": "../woocommerce/action-scheduler" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 59f86522..5bdb3890 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -29,9 +29,9 @@ 'dev_requirement' => false, ), 'woocommerce/action-scheduler' => array( - 'pretty_version' => '3.4.0', - 'version' => '3.4.0.0', - 'reference' => '3218a33ff14b968f8cb05de9656c2efa1eeb1330', + 'pretty_version' => '3.4.2', + 'version' => '3.4.2.0', + 'reference' => '7d8e830b6387410ccf11708194d3836f01cb2942', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../woocommerce/action-scheduler', 'aliases' => array(), diff --git a/wp-security-audit-log.php b/wp-security-audit-log.php index 916d4d54..88deddd8 100644 --- a/wp-security-audit-log.php +++ b/wp-security-audit-log.php @@ -7,7 +7,7 @@ * * @wordpress-plugin * Plugin Name: WP Activity Log - * Version: 4.4.2 + * Version: 4.4.2.1 * Plugin URI: https://wpactivitylog.com/ * Description: Identify WordPress security issues before they become a problem. Keep track of everything happening on your WordPress, including users activity. Similar to Linux Syslog, WP Activity Log generates an activity log with a record of everything that happens on your WordPress websites. * Author: WP White Security @@ -37,8 +37,6 @@ * along with this program. If not, see . */ -use WSAL\Helpers\WP_Helper; - if ( ! defined( 'ABSPATH' ) ) { exit; } @@ -49,10 +47,35 @@ } if ( ! defined( 'WSAL_PREFIX' ) ) { - define( 'WSAL_VERSION', '4.4.2' ); + define( 'WSAL_VERSION', '4.4.2.1' ); define( 'WSAL_PREFIX', 'wsal_' ); } +// Plugin Name. +if ( ! defined( 'WSAL_BASE_NAME' ) ) { + define( 'WSAL_BASE_NAME', plugin_basename( __FILE__ ) ); +} +// Plugin Directory URL. +if ( ! defined( 'WSAL_BASE_URL' ) ) { + define( 'WSAL_BASE_URL', plugin_dir_url( __FILE__ ) ); +} +// Plugin Directory Path. +if ( ! defined( 'WSAL_BASE_DIR' ) ) { + define( 'WSAL_BASE_DIR', plugin_dir_path( __FILE__ ) ); +} +// Plugin Docs URL. +if ( ! defined( 'WSAL_DOCS_URL' ) ) { + define( 'WSAL_DOCS_URL', 'https://wpactivitylog.com/support/' ); +} +// Plugin Issue Reporting URL. +if ( ! defined( 'WSAL_ISSUE_URL' ) ) { + define( 'WSAL_ISSUE_URL', 'https://wordpress.org/support/plugin/wp-security-audit-log' ); +} +// Plugin Classes Prefix. +if ( ! defined( 'WSAL_CLASS_PREFIX' ) ) { + define( 'WSAL_CLASS_PREFIX', 'WSAL_' ); +} + if ( ! function_exists( 'wsal_freemius' ) ) { if ( ! class_exists( 'WpSecurityAuditLog' ) ) { @@ -335,7 +358,6 @@ public function setup() { return; } - $this->define_constants(); $this->set_allowed_html_tags(); $this->includes(); $this->update(); @@ -603,7 +625,6 @@ public static function is_wpseo_active() { */ public static function is_mainwp_active() { return self::is_plugin_active( 'mainwp-child/mainwp-child.php' ); - } /** @@ -747,38 +768,6 @@ public function set_allowed_html_tags() { ); } - /** - * Method: Define constants. - * - * @since 2.6.6 - */ - public function define_constants() { - - // Plugin Name. - if ( ! defined( 'WSAL_BASE_NAME' ) ) { - define( 'WSAL_BASE_NAME', plugin_basename( __FILE__ ) ); - } - // Plugin Directory URL. - if ( ! defined( 'WSAL_BASE_URL' ) ) { - define( 'WSAL_BASE_URL', plugin_dir_url( __FILE__ ) ); - } - // Plugin Directory Path. - if ( ! defined( 'WSAL_BASE_DIR' ) ) { - define( 'WSAL_BASE_DIR', plugin_dir_path( __FILE__ ) ); - } - // Plugin Docs URL. - if ( ! defined( 'WSAL_DOCS_URL' ) ) { - define( 'WSAL_DOCS_URL', 'https://wpactivitylog.com/support/' ); - } - // Plugin Issue Reporting URL. - if ( ! defined( 'WSAL_ISSUE_URL' ) ) { - define( 'WSAL_ISSUE_URL', 'https://wordpress.org/support/plugin/wp-security-audit-log' ); - } - // Plugin Classes Prefix. - if ( ! defined( 'WSAL_CLASS_PREFIX' ) ) { - define( 'WSAL_CLASS_PREFIX', 'WSAL_' ); - } - } /** * Customize Freemius connect message for new users. * @@ -2054,7 +2043,7 @@ public function close_external_connection() { * @param string $transient Transient name. Expected to not be SQL-escaped. * * @return mixed Value of transient. - * @since 4.4.2 + * @since 4.4.2.1 */ public static function get_transient( $transient ) { return self::is_multisite() ? get_site_transient( $transient ) : get_transient( $transient ); @@ -2073,7 +2062,7 @@ public static function get_transient( $transient ) { * @param int $expiration Optional. Time until expiration in seconds. Default 0 (no expiration). * * @return bool True if the value was set, false otherwise. - * @since 4.4.2 + * @since 4.4.2.1 */ public static function set_transient( $transient, $value, $expiration = 0 ) { return self::is_multisite() ? set_site_transient( $transient, $value, $expiration ) : set_transient( $transient, $value, $expiration ); @@ -2086,7 +2075,7 @@ public static function set_transient( $transient, $value, $expiration = 0 ) { * * @return bool True if the transient was deleted, false otherwise. * - * @since 4.4.2 + * @since 4.4.2.1 */ public static function delete_transient( $transient ) { return self::is_multisite() ? delete_site_transient( $transient ) : delete_transient( $transient );