Changes in wp-security-audit-log/trunk [2897171:2911239]
- Location:
- wp-security-audit-log/trunk
- Files:
-
- 73 added
- 1 deleted
- 41 edited
-
classes/AuditLogGridView.php (modified) (7 diffs)
-
classes/AuditLogListView.php (modified) (2 diffs)
-
classes/Controllers/class-alert-manager.php (modified) (2 diffs)
-
classes/Controllers/class-sensors-load-manager.php (modified) (2 diffs)
-
classes/Entities/class-metadata-entity.php (modified) (2 diffs)
-
classes/Entities/class-occurrences-entity.php (modified) (1 diff)
-
classes/Helpers/class-plugins-helper.php (modified) (1 diff)
-
classes/Helpers/class-settings-helper.php (modified) (10 diffs)
-
classes/Helpers/class-wp-helper.php (modified) (1 diff)
-
classes/Migration/class-migration.php (modified) (12 diffs)
-
classes/Ref.php (modified) (5 diffs)
-
classes/Select2 (added)
-
classes/Select2/assets (added)
-
classes/Select2/assets/css (added)
-
classes/Select2/assets/css/select2.css (added)
-
classes/Select2/assets/css/select2.min.css (added)
-
classes/Select2/assets/css/wp-overrides.css (added)
-
classes/Select2/assets/js (added)
-
classes/Select2/assets/js/i18n (added)
-
classes/Select2/assets/js/i18n/af.js (added)
-
classes/Select2/assets/js/i18n/ar.js (added)
-
classes/Select2/assets/js/i18n/az.js (added)
-
classes/Select2/assets/js/i18n/bg.js (added)
-
classes/Select2/assets/js/i18n/bn.js (added)
-
classes/Select2/assets/js/i18n/bs.js (added)
-
classes/Select2/assets/js/i18n/build.txt (added)
-
classes/Select2/assets/js/i18n/ca.js (added)
-
classes/Select2/assets/js/i18n/cs.js (added)
-
classes/Select2/assets/js/i18n/da.js (added)
-
classes/Select2/assets/js/i18n/de.js (added)
-
classes/Select2/assets/js/i18n/dsb.js (added)
-
classes/Select2/assets/js/i18n/el.js (added)
-
classes/Select2/assets/js/i18n/en.js (added)
-
classes/Select2/assets/js/i18n/es.js (added)
-
classes/Select2/assets/js/i18n/et.js (added)
-
classes/Select2/assets/js/i18n/eu.js (added)
-
classes/Select2/assets/js/i18n/fa.js (added)
-
classes/Select2/assets/js/i18n/fi.js (added)
-
classes/Select2/assets/js/i18n/fr.js (added)
-
classes/Select2/assets/js/i18n/gl.js (added)
-
classes/Select2/assets/js/i18n/he.js (added)
-
classes/Select2/assets/js/i18n/hi.js (added)
-
classes/Select2/assets/js/i18n/hr.js (added)
-
classes/Select2/assets/js/i18n/hsb.js (added)
-
classes/Select2/assets/js/i18n/hu.js (added)
-
classes/Select2/assets/js/i18n/hy.js (added)
-
classes/Select2/assets/js/i18n/id.js (added)
-
classes/Select2/assets/js/i18n/is.js (added)
-
classes/Select2/assets/js/i18n/it.js (added)
-
classes/Select2/assets/js/i18n/ja.js (added)
-
classes/Select2/assets/js/i18n/ka.js (added)
-
classes/Select2/assets/js/i18n/km.js (added)
-
classes/Select2/assets/js/i18n/ko.js (added)
-
classes/Select2/assets/js/i18n/lt.js (added)
-
classes/Select2/assets/js/i18n/lv.js (added)
-
classes/Select2/assets/js/i18n/mk.js (added)
-
classes/Select2/assets/js/i18n/ms.js (added)
-
classes/Select2/assets/js/i18n/nb.js (added)
-
classes/Select2/assets/js/i18n/ne.js (added)
-
classes/Select2/assets/js/i18n/nl.js (added)
-
classes/Select2/assets/js/i18n/pl.js (added)
-
classes/Select2/assets/js/i18n/ps.js (added)
-
classes/Select2/assets/js/i18n/pt-BR.js (added)
-
classes/Select2/assets/js/i18n/pt.js (added)
-
classes/Select2/assets/js/i18n/ro.js (added)
-
classes/Select2/assets/js/i18n/ru.js (added)
-
classes/Select2/assets/js/i18n/sk.js (added)
-
classes/Select2/assets/js/i18n/sl.js (added)
-
classes/Select2/assets/js/i18n/sq.js (added)
-
classes/Select2/assets/js/i18n/sr-Cyrl.js (added)
-
classes/Select2/assets/js/i18n/sr.js (added)
-
classes/Select2/assets/js/i18n/sv.js (added)
-
classes/Select2/assets/js/i18n/th.js (added)
-
classes/Select2/assets/js/i18n/tk.js (added)
-
classes/Select2/assets/js/i18n/tr.js (added)
-
classes/Select2/assets/js/i18n/uk.js (added)
-
classes/Select2/assets/js/i18n/vi.js (added)
-
classes/Select2/assets/js/i18n/zh-CN.js (added)
-
classes/Select2/assets/js/i18n/zh-TW.js (added)
-
classes/Select2/assets/js/select2.full.js (added)
-
classes/Select2/assets/js/select2.full.min.js (added)
-
classes/Select2/assets/js/select2.js (added)
-
classes/Select2/assets/js/select2.min.js (added)
-
classes/Select2/class-select2-wpws.php (added)
-
classes/SensorManager.php (modified) (2 diffs)
-
classes/Settings.php (modified) (6 diffs)
-
classes/Views/AuditLog.php (modified) (9 diffs)
-
classes/Views/Settings.php (modified) (11 diffs)
-
classes/WPSensors/class-wp-content-sensor.php (modified) (1 diff)
-
classes/WPSensors/class-wp-log-in-out-sensor.php (modified) (8 diffs)
-
classes/WPSensors/class-wp-multisite-sensor.php (modified) (1 diff)
-
classes/WPSensors/class-wp-register-sensor.php (modified) (2 diffs)
-
css/auditlog.css (modified) (5 diffs)
-
js/auditlog.js (modified) (2 diffs)
-
languages/wp-security-audit-log.pot (modified) (3 diffs)
-
nofs/lib/class-wsal-freemius.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
sdk/wsal-freemius.php (modified) (1 diff)
-
third-party/vendor/autoload.php (modified) (1 diff)
-
third-party/vendor/classes/wp-async-request.php (modified) (8 diffs)
-
third-party/vendor/classes/wp-background-process.php (modified) (27 diffs)
-
third-party/vendor/composer/ClassLoader.php (modified) (4 diffs)
-
third-party/vendor/composer/autoload_real.php (modified) (2 diffs)
-
third-party/vendor/composer/autoload_static.php (modified) (2 diffs)
-
third-party/vendor/wp-background-processing.php (modified) (1 diff)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/ClassLoader.php (modified) (4 diffs)
-
vendor/composer/autoload_classmap.php (modified) (1 diff)
-
vendor/composer/autoload_files.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (3 diffs)
-
vendor/composer/autoload_static.php (modified) (3 diffs)
-
vendor/composer/installed.json (modified) (9 diffs)
-
vendor/composer/installed.php (modified) (4 diffs)
-
vendor/wpwhitesecurity/select2-wpwhitesecurity (deleted)
-
wp-security-audit-log.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-security-audit-log/trunk/classes/AuditLogGridView.php
r2897171 r2911239 226 226 } 227 227 228 // phpcs:disable 229 // phpcs:enable 228 230 } 229 231 … … 414 416 $uhtml = '<a class="tooltip" data-tooltip="' . esc_attr( $tooltip ) . '" data-user="' . $user->user_login . '" href="' . $user_edit_link . '" target="_blank">' . esc_html( $display_name ) . '</a>'; 415 417 418 // phpcs:disable 419 // phpcs:enable 416 420 417 421 $roles = WSAL_Utilities_UsersUtils::get_roles_label( $item['user_roles'] ); … … 452 456 // If there's no IP... 453 457 if ( is_null( $scip ) || '' === $scip ) { 454 return '<i>unknown</i>'; 458 if ( isset( $item['meta_values'] ) && isset( $item['meta_values']['OtherIPs'] ) ) { 459 if ( is_array( $item['meta_values']['OtherIPs'] ) ) { 460 $scip = reset( $item['meta_values']['OtherIPs'] )[0]; 461 } 462 } else { 463 return '<i>unknown</i>'; 464 } 455 465 } 456 466 … … 463 473 $oips_html = "<a class='search-ip' data-tooltip='$tooltip' data-ip='$scip' target='_blank' href='$link'>" . esc_html( $scip ) . '</a>'; 464 474 } 465 } else { 466 if ( count( $oips ) < 2 ) { 475 } elseif ( count( $oips ) < 2 ) { 467 476 $oips_html = "<a target='_blank' href='$link'>" . esc_html( $scip ) . '</a>'; 468 }469 477 } 470 478 … … 527 535 $url = admin_url( 'admin-ajax.php' ) . '?action=AjaxInspector&occurrence=' . $item['id']; 528 536 $tooltip = esc_attr__( 'View all details of this change', 'wp-security-audit-log' ); 529 return '<a class="more-info thickbox" data-tooltip="' . $tooltip . '" title="' . __( 'Alert Data Inspector', 'wp-security-audit-log' ) . '"'530 . ' href="' . $url . '&TB_iframe=true&width=600&height=550">…</a>';537 return '<a class="more-info button button-secondary thickbox" data-tooltip="' . $tooltip . '" title="' . __( 'Event data inspector', 'wp-security-audit-log' ) . '"' 538 . ' href="' . $url . '&TB_iframe=true&width=600&height=550">' . __( 'More details...', 'wp-security-audit-log' ) . '</a>'; 531 539 default: 532 return isset( $item[ $column_name] )533 ? esc_html( $item[ $column_name] )540 return isset( $item[ $column_name ] ) 541 ? esc_html( $item[ $column_name ] ) 534 542 : 'Column "' . esc_html( $column_name ) . '" not found'; 535 543 } … … 624 632 $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>' 625 633 . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />'; 626 $cb_counter++;634 ++$cb_counter; 627 635 } 628 636 … … 707 715 */ 708 716 public function query_events( $paged = 0 ) { 717 // phpcs:disable 718 // phpcs:enable 709 719 710 720 // TO DO: Get rid of OccurrenceQuery and use the Occurrence Model. -
wp-security-audit-log/trunk/classes/AuditLogListView.php
r2897171 r2911239 448 448 // If there's no IP... 449 449 if ( is_null( $scip ) || '' === $scip ) { 450 return '<i>unknown</i>'; 450 if ( isset( $item['meta_values'] ) && isset( $item['meta_values']['OtherIPs'] ) ) { 451 if ( is_array( $item['meta_values']['OtherIPs'] ) ) { 452 $scip = reset( $item['meta_values']['OtherIPs'] )[0]; 453 } 454 } else { 455 return '<i>unknown</i>'; 456 } 451 457 } 452 458 … … 498 504 $url = admin_url( 'admin-ajax.php' ) . '?action=AjaxInspector&occurrence=' . $item['id']; 499 505 $tooltip = esc_attr__( 'View all details of this change', 'wp-security-audit-log' ); 500 return '<a class="more-info thickbox" data-tooltip="' . $tooltip . '" title="' . __( 'Alert Data Inspector', 'wp-security-audit-log' ) . '"'501 . ' href="' . $url . '&TB_iframe=true&width=600&height=550"> …</a>';506 return '<a class="more-info button button-secondary thickbox" data-tooltip="' . $tooltip . '" title="' . __( 'Event data inspector', 'wp-security-audit-log' ) . '"' 507 . ' href="' . $url . '&TB_iframe=true&width=600&height=550">' . __( 'More details...', 'wp-security-audit-log' ) . '</a>'; 502 508 case 'object': 503 509 return ( isset( $item['meta_values']['Object'] ) && ! empty( $item['meta_values']['Object'] ) ) ? Alert_Manager::get_event_objects_data( $item['meta_values']['Object'] ) : ''; -
wp-security-audit-log/trunk/classes/Controllers/class-alert-manager.php
r2897171 r2911239 412 412 public static function is_disabled_user( $user ) { 413 413 if ( empty( self::$excluded_users ) ) { 414 self::$excluded_users = Settings_Helper::get_option_value( 'excluded-users', array() ); 415 } 416 417 if ( ! \is_array( self::$excluded_users ) ) { 418 self::$excluded_users = array( self::$excluded_users ); 414 self::$excluded_users = Settings_Helper::get_excluded_monitoring_users(); 419 415 } 420 416 … … 435 431 436 432 if ( empty( self::$excluded_roles ) ) { 437 self::$excluded_roles = Settings_Helper::get_ option_value( 'excluded-roles', array());433 self::$excluded_roles = Settings_Helper::get_excluded_monitoring_roles(); 438 434 } 439 435 -
wp-security-audit-log/trunk/classes/Controllers/class-sensors-load-manager.php
r2897171 r2911239 15 15 namespace WSAL\Controllers; 16 16 17 use WSAL\Helpers\WP_Helper; 17 18 use WSAL\Helpers\Classes_Helper; 18 19 … … 90 91 } 91 92 92 if ( \WpSecurityAuditLog::is_login_screen() && ! is_user_logged_in() ) {93 if ( WP_Helper::is_login_screen() && ! is_user_logged_in() ) { 93 94 // Here we need to load only the Sensors which are login enabled. 94 95 foreach ( $sensors as $key => &$sensor ) { -
wp-security-audit-log/trunk/classes/Entities/class-metadata-entity.php
r2897171 r2911239 57 57 `value` longtext NOT NULL, 58 58 PRIMARY KEY (`id`), 59 KEY `occurrence_name` (`occurrence_id`,`name`) 59 KEY `occurrence_name` (`occurrence_id`,`name`), 60 KEY `name_value` (`name`,`value`(64)) 60 61 ) 61 62 ' . self::get_connection()->get_charset_collate() . ';'; … … 63 64 return self::maybe_create_table( $table_name, $wp_entity_sql ); 64 65 } 66 67 /** 68 * Sets an index (if not there already) 69 * 70 * @return void 71 * 72 * @since 4.5.1 73 */ 74 public static function create_indexes() { 75 $db_connection = self::get_connection(); 76 // check if an index exists. 77 $index_exists = false; 78 if ( $db_connection->query( 'SELECT COUNT(1) IndexIsThere FROM INFORMATION_SCHEMA.STATISTICS WHERE table_schema=DATABASE() AND table_name="' . self::get_table_name() . '" AND index_name="name_value"' ) ) { 79 // query succeeded, does index exist? 80 $index_exists = ( isset( $db_connection->last_result[0]->IndexIsThere ) ) ? $db_connection->last_result[0]->IndexIsThere : false; 81 } 82 // if no index exists then make one. 83 if ( ! $index_exists ) { 84 $db_connection->query( 'CREATE INDEX name_value ON ' . self::get_table_name() . ' (name, value(64))' ); 85 } 86 } 65 87 } 66 88 } -
wp-security-audit-log/trunk/classes/Entities/class-occurrences-entity.php
r2897171 r2911239 225 225 $sqls = 'INSERT INTO `' . Metadata_Entity::get_table_name() . "` ($fields) VALUES " . rtrim( $sqls, ',' ); 226 226 227 self::get_connection()->suppress_errors( true ); 227 228 self::get_connection()->query( $sqls ); 229 230 if ( '' !== self::get_connection()->last_error ) { 231 if ( 1146 === Metadata_Entity::get_last_sql_error( self::get_connection() ) ) { 232 if ( Metadata_Entity::create_table() ) { 233 self::get_connection()->query( $sqls ); 234 } 235 } 236 } 237 self::get_connection()->suppress_errors( false ); 228 238 } 229 239 } 230 240 } 231 241 } 242 243 /** 244 * Sets an index (if not there already) 245 * 246 * @return void 247 * 248 * @since 4.5.1 249 */ 250 public static function create_indexes() { 251 $index_exists = false; 252 $db_connection = self::get_connection(); 253 // check if an index exists. 254 if ( $db_connection->query( 'SELECT COUNT(1) IndexIsThere FROM INFORMATION_SCHEMA.STATISTICS WHERE table_schema=DATABASE() AND table_name="' . self::get_table_name() . '" AND index_name="created_on"' ) ) { 255 // query succeeded, does index exist? 256 $index_exists = ( isset( $db_connection->last_result[0]->IndexIsThere ) ) ? $db_connection->last_result[0]->IndexIsThere : false; 257 } 258 // if no index exists then make one. 259 if ( ! $index_exists ) { 260 $db_connection->query( 'CREATE INDEX created_on ON ' . self::get_table_name() . ' (created_on)' ); 261 } 262 } 232 263 } 233 264 } -
wp-security-audit-log/trunk/classes/Helpers/class-plugins-helper.php
r2897171 r2911239 8 8 * @since 4.5.0 9 9 * 10 * @copyright %%YEAR%%WP White Security10 * @copyright 2023 WP White Security 11 11 * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 12 12 * -
wp-security-audit-log/trunk/classes/Helpers/class-settings-helper.php
r2897171 r2911239 81 81 82 82 /** 83 * Users excluded from monitoring. 84 * 85 * @var array 86 * 87 * @since 4.5.0 88 */ 89 private static $excluded_roles = array(); 90 91 /** 83 92 * Holds the main IP of the client. 84 93 * … … 124 133 */ 125 134 private static $database_logging_enabled = null; 135 136 /** 137 * Is the database logging enabled or not. 138 * 139 * @var bool 140 * 141 * @since 4.5.1 142 */ 143 private static $frontend_events = null; 126 144 127 145 /** … … 364 382 */ 365 383 public static function get_all_mirrors() { 366 $mirrors_options = self::get_options_by_prefix( WSAL_MIRROR_PREFIX, true );384 $mirrors_options = self::get_options_by_prefix( \WSAL_MIRROR_PREFIX, true ); 367 385 368 386 $mirrors = array(); … … 499 517 if ( self::get_boolean_option_value( 'use-proxy-ip' ) ) { 500 518 // TODO: The algorithm below just gets the first IP in the list...we might want to make this more intelligent somehow. 501 self::$main_client_ip = isset( self::get_client_ips()[0] ) ? self::get_client_ips()[0] : null; 519 $ips = self::get_client_ips(); 520 $ips = reset( $ips ); 521 self::$main_client_ip = isset( $ips[0] ) ? $ips[0] : ''; 502 522 } elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) { 503 523 $ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ); … … 964 984 public static function get_excluded_monitoring_users() { 965 985 if ( empty( self::$excluded_users ) ) { 966 self::$excluded_users = array_unique( array_filter( explode( ',', self::get_option_value( 'excluded-users', '' ) )) );986 self::$excluded_users = self::get_option_value( 'excluded-users', array() ); 967 987 } 968 988 … … 979 999 public static function set_excluded_monitoring_users( $users ) { 980 1000 $old_value = self::get_option_value( 'excluded-users', array() ); 981 $changes = self::determine_added_and_removed_items( $old_value, implode( ',', $users ));1001 $changes = self::determine_added_and_removed_items( $old_value, $users ); 982 1002 983 1003 if ( ! empty( $changes['added'] ) ) { … … 1007 1027 1008 1028 self::$excluded_users = $users; 1009 self::set_option_value( 'excluded-users', esc_html( implode( ',', self::$excluded_users ) ) ); 1029 self::set_option_value( 'excluded-users', array_unique( array_filter( $users ) ) ); 1030 } 1031 1032 /** 1033 * Set roles excluded from monitoring. 1034 * 1035 * @param array $roles - Array of roles. 1036 */ 1037 public static function set_excluded_monitoring_roles( $roles ) { 1038 // Trigger alert. 1039 $old_value = self::get_option_value( 'excluded-roles', array() ); 1040 $changes = self::determine_added_and_removed_items( $old_value, $roles ); 1041 1042 if ( ! empty( $changes['added'] ) ) { 1043 foreach ( $changes['added'] as $user ) { 1044 Alert_Manager::trigger_event( 1045 6054, 1046 array( 1047 'role' => $user, 1048 'previous_users' => ( empty( $old_value ) ) ? self::tidy_blank_values( $old_value ) : str_replace( ',', ', ', $old_value ), 1049 'EventType' => 'added', 1050 ) 1051 ); 1052 } 1053 } 1054 if ( ! empty( $changes['removed'] ) && ! empty( $old_value ) ) { 1055 foreach ( $changes['removed'] as $user ) { 1056 Alert_Manager::trigger_event( 1057 6054, 1058 array( 1059 'role' => $user, 1060 'previous_users' => empty( $old_value ) ? self::tidy_blank_values( $old_value ) : str_replace( ',', ', ', $old_value ), 1061 'EventType' => 'removed', 1062 ) 1063 ); 1064 } 1065 } 1066 1067 self::$excluded_roles = $roles; 1068 self::set_option_value( 'excluded-roles', array_unique( array_filter( $roles ) ) ); 1069 } 1070 1071 /** 1072 * Get roles excluded from monitoring. 1073 */ 1074 public static function get_excluded_monitoring_roles() { 1075 if ( empty( self::$excluded_roles ) ) { 1076 self::$excluded_roles = self::get_option_value( 'excluded-roles', array() ); 1077 } 1078 1079 return self::$excluded_roles; 1010 1080 } 1011 1081 … … 1126 1196 1127 1197 // Work out the working directory base path. 1128 if ( defined( ' WSAL_WORKING_DIR_PATH' ) ) {1129 $result = trailingslashit( WSAL_WORKING_DIR_PATH );1198 if ( defined( '\WSAL_WORKING_DIR_PATH' ) ) { 1199 $result = trailingslashit( \WSAL_WORKING_DIR_PATH ); 1130 1200 } else { 1131 1201 $upload_dir = wp_upload_dir( null, false ); … … 1187 1257 */ 1188 1258 public static function get_frontend_events() { 1189 // Option defaults. 1190 $default = array( 1191 'register' => false, 1192 'login' => false, 1193 'woocommerce' => false, 1194 ); 1259 if ( null === self::$frontend_events ) { 1260 // Option defaults. 1261 $default = array( 1262 'register' => false, 1263 'login' => false, 1264 'woocommerce' => false, 1265 ); 1266 self::$frontend_events = self::get_option_value( self::FRONT_END_EVENTS_OPTION_NAME, $default ); 1267 } 1195 1268 1196 1269 // Get the option. 1197 return self:: get_option_value( self::FRONT_END_EVENTS_OPTION_NAME, $default );1270 return self::$frontend_events; 1198 1271 } 1199 1272 … … 1208 1281 */ 1209 1282 public static function set_frontend_events( $value = array() ) { 1283 self::$frontend_events = $value; 1210 1284 return self::set_option_value( self::FRONT_END_EVENTS_OPTION_NAME, $value, true ); 1211 1285 } -
wp-security-audit-log/trunk/classes/Helpers/class-wp-helper.php
r2897171 r2911239 552 552 */ 553 553 public static function is_login_screen(): bool { 554 if ( isset( $_SERVER['PHP_SELF'] ) && 'wp-login.php' === basename( \sanitize_text_field( \wp_unslash( $_SERVER['PHP_SELF'] ) ) ) ) { 555 return true; 556 } 557 558 return false; 554 555 $login = parse_url( site_url( 'wp-login.php' ), PHP_URL_PATH ) === parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ); // phpcs:ignore 556 557 return \apply_filters( 'wsal_login_screen_url', $login ); 559 558 } 560 559 -
wp-security-audit-log/trunk/classes/Migration/class-migration.php
r2897171 r2911239 14 14 defined( 'ABSPATH' ) || exit; // Exit if accessed directly. 15 15 16 use \WSAL\Helpers\WP_Helper;17 16 use WSAL_Settings; 18 17 use WSAL_Ext_MirrorLogger; 18 use \WSAL\Helpers\WP_Helper; 19 use WSAL\Helpers\Settings_Helper; 19 20 20 21 /** … … 84 85 $wsal::load_freemius(); 85 86 $wsal::load_defaults(); 86 87 // Load dependencies.88 // if ( ! isset( $wsal->alerts ) ) {89 // $wsal->alerts = new \WSAL_AlertManager( $wsal );90 // }91 92 // if ( ! isset( $wsal->constants ) ) {93 // $wsal->constants = new \WSAL_ConstantManager();94 // }95 96 // $wsal->sensors = new \WSAL_SensorManager( $wsal );97 87 98 88 $disabled_alerts = WP_Helper::get_global_option( 'disabled-alerts', false ); … … 123 113 * @since 3.2.3.3 124 114 */ 125 if ( ! \WSAL\Helpers\Settings_Helper::get_boolean_option_value( 'mwp-child-stealth-mode', false ) ) {115 if ( ! Settings_Helper::get_boolean_option_value( 'mwp-child-stealth-mode', false ) ) { 126 116 $wsal->settings()->set_mainwp_child_stealth_mode(); 127 117 } … … 139 129 140 130 // Remove 'system' entry from the front-end events array as it was removed along with 404 tracking. 141 $frontend_events = \WSAL\Helpers\Settings_Helper::get_frontend_events();131 $frontend_events = Settings_Helper::get_frontend_events(); 142 132 if ( array_key_exists( 'system', $frontend_events ) ) { 143 133 unset( $frontend_events['system'] ); 144 \WSAL\Helpers\Settings_Helper::set_frontend_events( $frontend_events );134 Settings_Helper::set_frontend_events( $frontend_events ); 145 135 } 146 136 … … 177 167 $scheduled_hook_mirroring = 'wsal_run_mirroring'; 178 168 179 $mirrors = \WSAL\Helpers\Settings_Helper::get_all_mirrors();169 $mirrors = Settings_Helper::get_all_mirrors(); 180 170 if ( ! empty( $mirrors ) ) { 181 171 foreach ( $mirrors as $mirror ) { … … 243 233 244 234 if ( ! is_null( $wsal->external_db_util ) ) { 245 $connections = \WSAL\Helpers\Settings_Helper::get_all_connections();235 $connections = Settings_Helper::get_all_connections(); 246 236 if ( ! empty( $connections ) ) { 247 237 foreach ( $connections as $connection ) { 248 238 if ( \WSAL\Extensions\ExternalDB\Mirrors\WSAL_Ext_Mirrors_AWSCloudWatchConnection::get_type() === $connection['type'] ) { 249 \WSAL\Helpers\Settings_Helper::set_boolean_option_value( 'show-aws-sdk-config-nudge-4_3_2', true );239 Settings_Helper::set_boolean_option_value( 'show-aws-sdk-config-nudge-4_3_2', true ); 250 240 break; 251 241 } … … 408 398 $mirrors_in_use = false; 409 399 if ( ! is_null( $wsal->external_db_util ) ) { 410 $mirrors = \WSAL\Helpers\Settings_Helper::get_all_mirrors();400 $mirrors = Settings_Helper::get_all_mirrors(); 411 401 $mirrors_in_use = ! empty( $mirrors ); 412 402 } … … 427 417 428 418 if ( $notifications_in_use || $mirrors_in_use ) { 429 \WSAL\Helpers\Settings_Helper::set_boolean_option_value( 'show-helper-plugin-needed-nudge', true, false );419 Settings_Helper::set_boolean_option_value( 'show-helper-plugin-needed-nudge', true, false ); 430 420 } 431 421 } … … 495 485 496 486 \WSAL\Entities\Occurrences_Entity::set_connection( 497 ( new \WSAL_Connector_MySQLDB( $connection_config ) )->get_connection()498 );487 ( new \WSAL_Connector_MySQLDB( $connection_config ) )->get_connection() 488 ); 499 489 500 490 // If one of the new columns exists there is no need to alter the table. 501 491 $column_exists = \WSAL\Entities\Occurrences_Entity::check_column( 502 \WSAL\Entities\Occurrences_Entity::get_table_name(),503 'client_ip',504 'varchar( 255 )'492 \WSAL\Entities\Occurrences_Entity::get_table_name(), 493 'client_ip', 494 'varchar( 255 )' 505 495 ); 506 496 if ( ! $column_exists ) { … … 573 563 } 574 564 } 565 575 566 /** 576 567 * Migration for version upto 4.4.3 … … 585 576 if ( class_exists( 'WSAL_Ext_MirrorLogger' ) && method_exists( '\WSAL\Helpers\Settings_Helper', 'get_working_dir_path_static' ) ) { 586 577 587 $working_dir_path = \WSAL\Helpers\Settings_Helper::get_working_dir_path_static();578 $working_dir_path = Settings_Helper::get_working_dir_path_static(); 588 579 589 580 if ( file_exists( $working_dir_path . WSAL_Ext_MirrorLogger::FILE_NAME_FAILED_LOGS . '.json' ) ) { … … 599 590 } 600 591 } 592 593 /** 594 * Migration for version upto 4.5.0 595 * 596 * Note: The migration methods need to be in line with the @see WSAL\Utils\Abstract_Migration::$pad_length 597 * 598 * @return void 599 */ 600 protected static function migrate_up_to_4450() { 601 \WSAL\Entities\Metadata_Entity::create_indexes(); 602 \WSAL\Entities\Occurrences_Entity::create_indexes(); 603 } 604 605 /** 606 * Migration for version upto 4.5.2 607 * 608 * Converts excluded users to array 609 * 610 * Note: The migration methods need to be in line with the @see WSAL\Utils\Abstract_Migration::$pad_length 611 * 612 * @return void 613 */ 614 protected static function migrate_up_to_4520() { 615 $excluded_users = Settings_Helper::get_option_value( 'excluded-users', array() ); 616 if ( is_string( $excluded_users ) ) { 617 $excluded_users = array_unique( array_filter( explode( ',', $excluded_users ) ) ); 618 Settings_Helper::set_option_value( 'excluded-users', $excluded_users ); 619 } 620 $excluded_roles = Settings_Helper::get_option_value( 'excluded-roles', array() ); 621 if ( is_string( $excluded_roles ) ) { 622 $excluded_roles = array_unique( array_filter( explode( ',', $excluded_roles ) ) ); 623 Settings_Helper::set_option_value( 'excluded-roles', $excluded_roles ); 624 } 625 } 601 626 } 602 627 } -
wp-security-audit-log/trunk/classes/Ref.php
r2897171 r2911239 1389 1389 } 1390 1390 1391 $max = max( array_map( 'static::strLen', array_keys( $subject ) ) );1391 $max = max( array_map( self::class . '::strLen', array_keys( $subject ) ) ); 1392 1392 $subject[ static::MARKER_KEY ] = true; 1393 1393 … … 1529 1529 } 1530 1530 1531 $max = max( array_map( 'static::strLen', array_keys( $meta ) ) );1531 $max = max( array_map( self::class . '::strLen', array_keys( $meta ) ) ); 1532 1532 foreach ( $meta as $key => $value ) { 1533 1533 $this->fmt->startRow(); … … 1666 1666 $errors = \DateTime::getLastErrors(); 1667 1667 1668 if ( ( $errors['warning_count'] < 1) && ($errors['error_count']< 1) ) {1668 if ( (((int)$errors['warning_count']) < 1) && (((int)$errors['error_count']) < 1) ) { 1669 1669 $now = new \Datetime( 'now' ); 1670 1670 $nowUtc = new \Datetime( 'now', new \DateTimeZone( 'UTC' ) ); … … 1929 1929 if ( $constants ) { 1930 1930 $this->fmt->sectionTitle( 'Constants' ); 1931 $max = max( array_map( 'static::strLen', array_keys( $constants ) ) );1931 $max = max( array_map( self::class . '::strLen', array_keys( $constants ) ) ); 1932 1932 foreach ( $constants as $name => $value ) { 1933 1933 $meta = null; … … 2954 2954 */ 2955 2955 protected static function escape( $var ) { 2956 return is_array( $var ) ? array_map( 'static::escape', $var ) : htmlspecialchars( $var, ENT_QUOTES );2956 return is_array( $var ) ? array_map( self::class . '::escape', $var ) : htmlspecialchars( $var, ENT_QUOTES ); 2957 2957 } 2958 2958 -
wp-security-audit-log/trunk/classes/SensorManager.php
r2897171 r2911239 14 14 } 15 15 16 use WSAL\Helpers\WP_Helper; 16 17 use \WSAL\Helpers\Classes_Helper; 17 18 /** … … 210 211 211 212 // Only LogInOut and Register sensors should load on login page. 212 if ( W pSecurityAuditLog::is_login_screen() ) {213 if ( WP_Helper::is_login_screen() ) { 213 214 if ( in_array( $filename, array( 'Register', 'LogInOut' ), true ) ) { 214 215 return true; -
wp-security-audit-log/trunk/classes/Settings.php
r2897171 r2911239 67 67 */ 68 68 protected $per_page = null; 69 70 /**71 * Roles excluded from monitoring.72 *73 * @var array74 */75 protected $excluded_roles = array();76 69 77 70 /** … … 708 701 $this->site_admins = $wpdb->get_col( $sql ); // phpcs:ignore 709 702 } 710 } else { 711 if ( empty( $this->site_admins ) ) { 703 } elseif ( empty( $this->site_admins ) ) { 712 704 $query = 'role=administrator&fields[]=user_login'; 713 foreach ( get_users( $query ) as $user ) { 714 $this->site_admins[] = $user->user_login; 715 } 705 foreach ( get_users( $query ) as $user ) { 706 $this->site_admins[] = $user->user_login; 716 707 } 717 708 } … … 942 933 * 943 934 * @return string 944 *935 * 945 936 * @deprecated 4.5 - Use \WSAL\Helpers\Settings_Helper::normalize_ip() 946 937 */ … … 1042 1033 * @deprecated 4.5 - Use \WSAL\Helpers\Settings_Helper::get_excluded_post_types() 1043 1034 */ 1044 public function get_excluded_post_types(): array {1035 public function get_excluded_post_types(): array { 1045 1036 _deprecated_function( __FUNCTION__, '4.5', '\WSAL\Helpers\Settings_Helper::get_excluded_post_types()' ); 1046 1037 … … 1052 1043 * 1053 1044 * @param array $roles - Array of roles. 1045 * 1046 * @deprecated 4.5.1 - Use \WSAL\Helpers\Settings_Helper::set_excluded_monitoring_roles() 1054 1047 */ 1055 1048 public function set_excluded_monitoring_roles( $roles ) { 1056 // Trigger alert. 1057 $old_value = WSAL\Helpers\Settings_Helper::get_option_value( 'excluded-roles', array() ); 1058 $changes = \WSAL\Helpers\Settings_Helper::determine_added_and_removed_items( $old_value, implode( ',', $roles ) ); 1059 1060 if ( ! empty( $changes['added'] ) ) { 1061 foreach ( $changes['added'] as $user ) { 1062 Alert_Manager::trigger_event( 1063 6054, 1064 array( 1065 'role' => $user, 1066 'previous_users' => ( empty( $old_value ) ) ? \WSAL\Helpers\Settings_Helper::tidy_blank_values( $old_value ) : str_replace( ',', ', ', $old_value ), 1067 'EventType' => 'added', 1068 ) 1069 ); 1070 } 1071 } 1072 if ( ! empty( $changes['removed'] ) && ! empty( $old_value ) ) { 1073 foreach ( $changes['removed'] as $user ) { 1074 Alert_Manager::trigger_event( 1075 6054, 1076 array( 1077 'role' => $user, 1078 'previous_users' => empty( $old_value ) ? \WSAL\Helpers\Settings_Helper::tidy_blank_values( $old_value ) : str_replace( ',', ', ', $old_value ), 1079 'EventType' => 'removed', 1080 ) 1081 ); 1082 } 1083 } 1084 1085 $this->excluded_roles = $roles; 1086 \WSAL\Helpers\Settings_Helper::set_option_value( 'excluded-roles', esc_html( implode( ',', $roles ) ) ); 1049 _deprecated_function( __FUNCTION__, '4.5.1', '\WSAL\Helpers\Settings_Helper::set_excluded_monitoring_roles()' ); 1050 1051 return \WSAL\Helpers\Settings_Helper::set_excluded_monitoring_users( $roles ); 1087 1052 } 1088 1053 1089 1054 /** 1090 1055 * Get roles excluded from monitoring. 1056 * 1057 * @deprecated 4.5.1 - Use \WSAL\Helpers\Settings_Helper::get_excluded_monitoring_roles() 1091 1058 */ 1092 1059 public function get_excluded_monitoring_roles() { 1093 if ( empty( $this->excluded_roles ) ) { 1094 $this->excluded_roles = array_unique( array_filter( explode( ',', WSAL\Helpers\Settings_Helper::get_option_value( 'excluded-roles', '' ) ) ) ); 1095 } 1096 1097 return $this->excluded_roles; 1060 _deprecated_function( __FUNCTION__, '4.5.1', '\WSAL\Helpers\Settings_Helper::get_excluded_monitoring_roles()' ); 1061 1062 return \WSAL\Helpers\Settings_Helper::get_excluded_monitoring_roles(); 1098 1063 } 1099 1064 … … 1571 1536 // we have no business here - the token is valid and within users, but we are looking 1572 1537 // for roles 1573 if ( false !== $type && 'ExRole' === $type ) {1538 if ( false !== $type && 'ExRole' === $type ) { 1574 1539 1575 1540 } else { -
wp-security-audit-log/trunk/classes/Views/AuditLog.php
r2897171 r2911239 141 141 'skipped' === \WSAL\Helpers\Settings_Helper::get_option_value( 'freemius_state', 'anonymous' ) ) 142 142 ) { 143 $wsal_premium_advert = \WSAL\Helpers\Settings_Helper::get_option_value( 'premium-advert', false ); // Get the advert to display.144 $wsal_premium_advert = false !== $wsal_premium_advert ? (int) $wsal_premium_advert : 0; // Set the default.143 $wsal_premium_advert = \WSAL\Helpers\Settings_Helper::get_option_value( 'premium-advert', false ); // Get the advert to display. 144 $wsal_premium_advert = false !== $wsal_premium_advert ? (int) $wsal_premium_advert : 0; // Set the default. 145 145 146 146 $more_info = add_query_arg( … … 200 200 } 201 201 202 // phpcs:disable 203 // phpcs:enable 202 204 203 205 // Check anonymous mode. … … 229 231 $screen = get_current_screen(); 230 232 233 // phpcs:disable 234 // phpcs:enable 231 235 232 236 if ( $is_current_view && in_array( $screen->base, array( 'toplevel_page_wsal-auditlog', 'toplevel_page_wsal-auditlog-network' ), true ) ) { … … 243 247 $predefined_plugins_check = array_column( $predefined_plugins, 'addon_for' ); 244 248 249 $plugin_filenames = array_unique( $plugin_filenames ); 250 245 251 // Loop through plugins and create an array of slugs, we will compare these against the plugins we have addons for. 246 252 $we_have_addon = array_intersect( $plugin_filenames, $predefined_plugins_check ); … … 258 264 259 265 if ( ! $is_dismissed ) { 260 // @codingStandardsIgnoreStart 261 $image_filename = array_search( $addon, array_column( $predefined_plugins, 'addon_for', 'image_filename' ) );262 $title = array_search( $addon, array_column( $predefined_plugins, 'addon_for', 'title' ) );263 $plugin_description = array_search( $addon, array_column( $predefined_plugins, 'addon_for', 'plugin_description' ) );264 // @codingStandardsIgnoreEnd 266 267 $image_filename = array_search( $addon, array_column( $predefined_plugins, 'addon_for', 'image_filename' ), true ); 268 $title = array_search( $addon, array_column( $predefined_plugins, 'addon_for', 'title' ), true ); 269 $plugin_description = array_search( $addon, array_column( $predefined_plugins, 'addon_for', 'plugin_description' ), true ); 270 265 271 ?> 266 272 <div class="notice notice-information is-dismissible notice-addon-available" id="wsal-notice-addon-available-<?php echo esc_attr( $addon ); ?>" data-addon="<?php echo esc_attr( $addon ); ?>"> … … 615 621 } 616 622 623 // phpcs:disable 624 // phpcs:enable 617 625 618 626 $occ = new WSAL_Models_Occurrence(); … … 654 662 $old = (int) $post_array['logcount']; 655 663 664 // phpcs:disable 665 // phpcs:enable 656 666 657 667 // Check for new total number of alerts. … … 711 721 } 712 722 723 // phpcs:disable 724 // phpcs:enable 713 725 714 726 /** … … 1121 1133 } 1122 1134 1135 // phpcs:disable 1136 // phpcs:enable 1123 1137 1124 1138 /** -
wp-security-audit-log/trunk/classes/Views/Settings.php
r2897171 r2911239 155 155 156 156 // Get the current tab. 157 $current_tab = ( isset( $_GET['tab'] ) ) ? \sanitize_text_field( \wp_unslash( $_GET['tab'] ) ) : '';157 $current_tab = ( isset( $_GET['tab'] ) ) ? \sanitize_text_field( \wp_unslash( $_GET['tab'] ) ) : ''; 158 158 $this->current_tab = empty( $current_tab ) ? 'general' : $current_tab; 159 159 } … … 277 277 */ 278 278 public function ajax_run_cleanup() { 279 // Verify nonce. 280 if ( ! isset( $_REQUEST['nonce'] ) || false === wp_verify_nonce( \sanitize_text_field( \wp_unslash( $_REQUEST['nonce'] ) ), 'wsal-run-cleanup' ) ) { 281 wp_send_json_error( esc_html__( 'Insecure request.', 'wp-security-audit-log' ) ); 282 } 283 279 284 if ( ! $this->plugin->settings()->current_user_can( 'edit' ) ) { 280 285 die( 'Access Denied.' ); … … 286 291 287 292 // phpcs:disable 288 // phpcs: disable293 // phpcs:enable 289 294 290 295 // Calculate limit timestamp. … … 295 300 // $query->add_condition( 'created_on <= %s', intval( $max_stamp ) ); // Add limits of timestamp. 296 301 // $results = $query->get_adapter()->execute_query( $query ); 297 $items = \WSAL\Entities\Occurrences_Entity::count('created_on <= %s', intval( $max_stamp ));302 $items = \WSAL\Entities\Occurrences_Entity::count( 'created_on <= %s', intval( $max_stamp ) ); 298 303 if ( $items ) { 299 304 $this->plugin->clean_up(); … … 978 983 $retention_help_text = __( '<a href="https://wpactivitylog.com/pricing/?utm_source=plugin&utm_medium=referral&utm_campaign=WSAL&utm_content=settings+pages" target="_blank">Upgrade to Premium</a> to store the activity log data in an external database.', 'wp-security-audit-log' ); 979 984 985 // phpcs:disable 986 // phpcs:enable 980 987 echo wp_kses( $retention_help_text, $this->plugin->allowed_html_tags ); 981 988 ?> … … 983 990 984 991 <?php 992 // phpcs:disable 985 993 /* @free:start */ 994 // phpcs:enable 986 995 // Ensure it doesn't load a 2nd time for premium users. 987 996 if ( ! wsal_freemius()->can_use_premium_code() ) { 988 997 $this->render_retention_settings_table(); 989 998 } 999 // phpcs:disable 990 1000 /* @free:end */ 1001 // phpcs:enable 991 1002 ?> 992 1003 … … 1243 1254 <br style="clear: both;"/> 1244 1255 <div id="ExRoleList"> 1245 <?php foreach ( $this->plugin->settings()->get_excluded_monitoring_roles() as $item ) : ?>1256 <?php foreach ( \WSAL\Helpers\Settings_Helper::get_excluded_monitoring_roles() as $item ) : ?> 1246 1257 <span class="sectoken-<?php echo esc_attr( $this->get_token_type( $item ) ); ?>"> 1247 1258 <input type="hidden" name="ExRoles[]" value="<?php echo esc_attr( $item ); ?>"/> … … 1368 1379 1369 1380 \WSAL\Helpers\Settings_Helper::set_excluded_monitoring_users( isset( $post_array['ExUsers'] ) ? $post_array['ExUsers'] : array() ); 1370 $this->plugin->settings()->set_excluded_monitoring_roles( isset( $post_array['ExRoles'] ) ? $post_array['ExRoles'] : array() );1381 \WSAL\Helpers\Settings_Helper::set_excluded_monitoring_roles( isset( $post_array['ExRoles'] ) ? $post_array['ExRoles'] : array() ); 1371 1382 \WSAL\Helpers\Settings_Helper::set_excluded_post_meta_fields( isset( $post_array['PostMetas'] ) ? $post_array['PostMetas'] : array() ); 1372 1383 \WSAL\Helpers\Settings_Helper::set_excluded_user_meta_fields( isset( $post_array['UserMetas'] ) ? $post_array['UserMetas'] : array() ); … … 1769 1780 // $alerts = array(); 1770 1781 // foreach ( $registered_alerts as $alert => $details ) { 1771 // $alerts[] = (string) $details->code;1782 // $alerts[] = (string) $details->code; 1772 1783 // } 1773 1784 … … 1941 1952 <?php 1942 1953 foreach ( $pruning_unit_options as $option => $label ) { 1943 echo '<option value="' . esc_attr( $option ) . '" ' . selected( $pruning_unit, $option, true ) . '>' . ucwords( $label ) . '</option>'; // phpcs: disable1954 echo '<option value="' . esc_attr( $option ) . '" ' . selected( $pruning_unit, $option, true ) . '>' . ucwords( $label ) . '</option>'; // phpcs:ignore 1944 1955 } 1945 1956 ?> … … 1957 1968 esc_html( human_time_diff( current_time( 'timestamp' ), $next ) ) 1958 1969 ); 1959 echo '<!-- ' . esc_html( date( 'dMy H:i:s', $next ) ) . ' --> ';1970 echo '<!-- ' . esc_html( gmdate( 'dMy H:i:s', $next ) ) . ' --> '; 1960 1971 echo esc_html__( 'You can run the purging process now by clicking the button below.', 'wp-security-audit-log' ); 1961 1972 ?> 1962 1973 </p> 1963 1974 <p> 1964 <a class="button-primary" href="<?php echo esc_url( add_query_arg( 'action', 'AjaxRunCleanup', admin_url( 'admin-ajax.php' ) ) ); ?>"><?php esc_html_e( 'Purge Old Data', 'wp-security-audit-log' ); ?></a>1975 <a class="button-primary" href="<?php echo esc_url( add_query_arg( ['action'=> 'AjaxRunCleanup', 'nonce'=> wp_create_nonce( 'wsal-run-cleanup' )], admin_url( 'admin-ajax.php' ) ) ); ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wsal-run-cleanup' ) ); ?>" ><?php esc_html_e( 'Purge Old Data', 'wp-security-audit-log' ); ?></a> 1965 1976 </p> 1966 1977 <?php endif; ?> -
wp-security-audit-log/trunk/classes/WPSensors/class-wp-content-sensor.php
r2897171 r2911239 1620 1620 $post_events = array_merge( $post_events, array_keys( Alert_Manager::get_alerts_by_sub_category( 'Coupons' ) ) ); 1621 1621 1622 $post_events = array_merge( $post_events, array_keys( Alert_Manager::get_alerts_by_sub_category( 'Tags' ) ) ); 1623 1624 $post_events = array_merge( $post_events, array_keys( Alert_Manager::get_alerts_by_sub_category( 'Categories' ) ) ); 1625 1626 $post_events = array_merge( $post_events, array_keys( Alert_Manager::get_alerts_by_sub_category( 'Custom Fields' ) ) ); 1627 1628 $post_events = array_merge( $post_events, array_keys( Alert_Manager::get_alerts_by_sub_category( 'Custom Fields (ACF)' ) ) ); 1629 1630 $post_events = array_merge( $post_events, array_keys( Alert_Manager::get_alerts_by_sub_category( 'Comments' ) ) ); 1631 1632 $post_events = array_merge( $post_events, array_keys( Alert_Manager::get_alerts_by_sub_category( 'Custom Post Types' ) ) ); 1633 1634 $post_events = array_merge( $post_events, array_keys( Alert_Manager::get_alerts_by_sub_category( 'Pages' ) ) ); 1635 1622 1636 foreach ( $post_events as $event ) { 1623 1637 if ( Alert_Manager::will_or_has_triggered( $event ) || Alert_Manager::was_triggered_recently( $event ) ) { -
wp-security-audit-log/trunk/classes/WPSensors/class-wp-log-in-out-sensor.php
r2897171 r2911239 16 16 use WSAL\Helpers\WP_Helper; 17 17 use WSAL\Helpers\User_Helper; 18 use WSAL\Helpers\Settings_Helper; 18 19 use WSAL\Controllers\Alert_Manager; 19 20 … … 96 97 public static function is_login_sensor() { 97 98 return self::$login_sensor; 99 } 100 101 /** 102 * That needs to be registered as a frontend sensor, when the admin sets the plugin to monitor the login from 3rd parties. 103 * 104 * @return boolean 105 * 106 * @since 4.5.1 107 */ 108 public static function is_frontend_sensor(): bool { 109 $frontend_events = Settings_Helper::get_frontend_events(); 110 $should_load = ! empty( $frontend_events['register'] ) || ! empty( $frontend_events['login'] ); 111 112 if ( $should_load ) { 113 return true; 114 } 115 116 return false; 98 117 } 99 118 … … 204 223 if ( self::$current_user->ID ) { 205 224 // get the list of excluded users. 206 $excluded_users = \WSAL\Helpers\Settings_Helper::get_excluded_monitoring_users();225 $excluded_users = Settings_Helper::get_excluded_monitoring_users(); 207 226 $excluded_user_ids = array(); 208 227 // convert excluded usernames into IDs. … … 237 256 */ 238 257 protected static function get_login_failure_log_limit() { 239 return \WSAL\Helpers\Settings_Helper::get_option_value( 'log-failed-login-limit', 10 );258 return Settings_Helper::get_option_value( 'log-failed-login-limit', 10 ); 240 259 } 241 260 … … 248 267 */ 249 268 protected static function get_visitor_login_failure_log_limit() { 250 return intval( \WSAL\Helpers\Settings_Helper::get_option_value( 'log-visitor-failed-login-limit', 10 ) );269 return intval( Settings_Helper::get_option_value( 'log-visitor-failed-login-limit', 10 ) ); 251 270 } 252 271 … … 344 363 $d = (int) $d; 345 364 346 $ip = \WSAL\Helpers\Settings_Helper::get_main_client_ip();365 $ip = Settings_Helper::get_main_client_ip(); 347 366 348 367 // Filter $_POST global array for security. … … 520 539 * Current user switched to another user event. 521 540 * 522 * @since 3.4523 *524 541 * @param int $new_user_id - New user id. 525 542 * @param int $old_user_id - Old user id. … … 527 544 * @since 4.5.0 528 545 */ 529 public function user_switched_event( $new_user_id, $old_user_id ) {546 public static function user_switched_event( $new_user_id, $old_user_id ) { 530 547 $target_user = get_user_by( 'ID', $new_user_id ); 531 548 $target_user_roles = User_Helper::get_user_roles( $target_user ); -
wp-security-audit-log/trunk/classes/WPSensors/class-wp-multisite-sensor.php
r2897171 r2911239 248 248 } 249 249 250 $blog_title = strip_tags( $_POST['blog']['title'] ); // phpcs:ignore 250 if ( isset( $_POST['blog'] ) && isset( $_POST['blog']['title'] ) ) { 251 $blog_title = strip_tags( $_POST['blog']['title'] ); 252 } elseif ( isset( $_POST['target_title'] ) ) { 253 $blog_title = strip_tags( $_POST['target_title'] ); 254 } else { 255 $blog_title = WP_Helper::get_blog_info( $new_blog->blog_id )['name']; 256 } 251 257 $blog_url = untrailingslashit( $home_scheme . '://' . $new_blog->domain . $new_blog->path ); 252 258 -
wp-security-audit-log/trunk/classes/WPSensors/class-wp-register-sensor.php
r2897171 r2911239 15 15 16 16 use WSAL\Helpers\WP_Helper; 17 use WSAL\Helpers\Settings_Helper; 17 18 use WSAL\Controllers\Alert_Manager; 18 19 … … 71 72 72 73 /** 74 * That needs to be registered as a frontend sensor, when the admin sets the plugin to monitor the login from 3rd parties. 75 * 76 * @return boolean 77 * 78 * @since 4.5.1 79 */ 80 public static function is_frontend_sensor(): bool { 81 $frontend_events = Settings_Helper::get_frontend_events(); 82 $should_load = ! empty( $frontend_events['register'] ) || ! empty( $frontend_events['login'] ) || ! empty( $frontend_events['woocommerce'] ); 83 84 if ( $should_load ) { 85 return true; 86 } 87 88 return false; 89 } 90 91 /** 73 92 * When a user registers, action 'user_register' is fired because it is part of the function 'wp_insert_user'. We 74 93 * can assume event 4000 if the current session is not logged in. -
wp-security-audit-log/trunk/css/auditlog.css
r2897171 r2911239 78 78 position: absolute; 79 79 bottom: 0; 80 right: 0;80 right: -100px; 81 81 width: 0; 82 82 height: 0; … … 88 88 position: absolute; 89 89 bottom: 6px; 90 right: 6px;90 right: -94px; 91 91 background: white; 92 92 box-shadow: rgb(0 0 0 / 24%) 0px 3px 8px; … … 148 148 149 149 .more-info { 150 float: right;151 display: block;152 width: 16px;153 height: 16px;154 color: #FFF;155 font-weight: bold;156 font-size: 13px;157 line-height: 10px;158 text-align: center;159 border-radius: 32px;160 margin-left: 8px;161 background: #AAA;150 float: right; 151 display: block; 152 width: auto; 153 height: 15px; 154 color: #FFF; 155 font-size: 11px !important; 156 line-height: 27px !important; 157 text-align: center; 158 border-radius: 32px; 159 padding: 0 8px !important; 160 border-color: #ddd !important; 161 background: #f6f7f7; 162 162 } 163 163 … … 498 498 } 499 499 500 .wp-list-table #data { 501 width: 80px; 502 } 503 500 504 .column-crtd { 501 505 width: 135px; … … 507 511 .wp-list-table.wsal-table-grid .data { 508 512 width: 120px; 509 }510 511 .wsal-table-grid .more-info {512 float: inherit;513 width: 35px;514 height: 35px;515 font-size: 2em;516 line-height: 0.65em;517 513 } 518 514 -
wp-security-audit-log/trunk/js/auditlog.js
r2897171 r2911239 221 221 } 222 222 223 function WsalDBChange(value ) {223 function WsalDBChange(value, nonce) { 224 224 jQuery.ajax({ 225 225 type: 'POST', … … 228 228 data: { 229 229 action: 'AjaxSwitchDB', 230 nonce: nonce, 230 231 selected_db: value 231 232 }, -
wp-security-audit-log/trunk/languages/wp-security-audit-log.pot
r2897171 r2911239 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WP Activity Log 4.5. 0\n"5 "Project-Id-Version: WP Activity Log 4.5.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-security-audit-log\n" 7 7 "Last-Translator: WP White Security <info@wpwhitesecurity.com>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2023-0 4-11T09:21:04+00:00\n"12 "POT-Creation-Date: 2023-05-11T14:19:31+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2. 7.1\n"14 "X-Generator: WP-CLI 2.6.0\n" 15 15 "X-Domain: wp-security-audit-log\n" 16 16 … … 36 36 37 37 #. translators: User's first name 38 #: wp-security-audit-log.php:71 539 #: wp-security-audit-log.php:74 338 #: wp-security-audit-log.php:716 39 #: wp-security-audit-log.php:744 40 40 msgid "Hey %s" 41 41 msgstr "" 42 42 43 #: wp-security-audit-log.php:7 1943 #: wp-security-audit-log.php:720 44 44 msgid "Never miss an important update! Opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with freemius.com." 45 msgstr ""46 47 #: wp-security-audit-log.php:72048 #: wp-security-audit-log.php:75549 msgid "Note: "50 45 msgstr "" 51 46 52 47 #: wp-security-audit-log.php:721 53 48 #: wp-security-audit-log.php:756 49 msgid "Note: " 50 msgstr "" 51 52 #: wp-security-audit-log.php:722 53 #: wp-security-audit-log.php:757 54 54 msgid "NO ACTIVITY LOG ACTIVITY & DATA IS SENT BACK TO OUR SERVERS." 55 55 msgstr "" 56 56 57 57 #. translators: 1: Plugin name. 2: Plugin name. 2: Freemius link. 4: Plugin name. 58 #: wp-security-audit-log.php:7 4958 #: wp-security-audit-log.php:750 59 59 msgid "Please help us improve %1$s! If you opt-in, some non-sensitive data about your usage of %2$s will be sent to %3$s, a diagnostic tracking service we use. If you skip this, that's okay! %2$s will still work just fine." 60 60 msgstr "" 61 61 62 #: wp-security-audit-log.php:79 362 #: wp-security-audit-log.php:794 63 63 msgid "You need to activate the licence key to use WP Activity Log Premium. %s" 64 64 msgstr "" 65 65 66 #: wp-security-audit-log.php:79 466 #: wp-security-audit-log.php:795 67 67 msgid "Activate the licence key now" 68 68 msgstr "" 69 69 70 70 #. Translators: Expired message and time 71 #: wp-security-audit-log.php:81 871 #: wp-security-audit-log.php:819 72 72 msgid "%s You need to renew your license to continue using premium features." 73 73 msgstr "" 74 74 75 75 #. Translators: Number of sites 76 #: wp-security-audit-log.php:82 176 #: wp-security-audit-log.php:822 77 77 msgid "The license is limited to %s sub-sites. You need to upgrade your license to cover all the sub-sites on this network." 78 78 msgstr "" 79 79 80 #: wp-security-audit-log.php:91 680 #: wp-security-audit-log.php:917 81 81 msgid "Error: You do not have sufficient permissions to disable this custom field." 82 82 msgstr "" 83 83 84 84 #. translators: name of meta field (in bold) 85 #: wp-security-audit-log.php:96 285 #: wp-security-audit-log.php:963 86 86 msgid "Custom field %s is no longer being monitored." 87 87 msgstr "" 88 88 89 89 #. translators: setting tab name "Excluded Objects" 90 #: wp-security-audit-log.php:96 890 #: wp-security-audit-log.php:969 91 91 msgid "Enable the monitoring of this custom field again from the %s tab in the plugin settings." 92 92 msgstr "" 93 93 94 #: wp-security-audit-log.php:9 6994 #: wp-security-audit-log.php:970 95 95 msgid "Excluded Objects" 96 96 msgstr "" 97 97 98 #: wp-security-audit-log.php:98 298 #: wp-security-audit-log.php:983 99 99 msgid "Error: You do not have sufficient permissions to disable this alert." 100 100 msgstr "" 101 101 102 #: wp-security-audit-log.php:100 2102 #: wp-security-audit-log.php:1003 103 103 msgid "Alert %1$s is no longer being monitored.<br /> %2$s" 104 104 msgstr "" 105 105 106 #: wp-security-audit-log.php:100 4106 #: wp-security-audit-log.php:1005 107 107 msgid "You can enable this alert again from the Enable/Disable Alerts node in the plugin menu." 108 108 msgstr "" 109 109 110 #: wp-security-audit-log.php:103 5110 #: wp-security-audit-log.php:1036 111 111 msgid "Installing, please wait" 112 112 msgstr "" 113 113 114 #: wp-security-audit-log.php:103 6114 #: wp-security-audit-log.php:1037 115 115 msgid "Already installed" 116 116 msgstr "" 117 117 118 #: wp-security-audit-log.php:103 7118 #: wp-security-audit-log.php:1038 119 119 msgid "Extension installed" 120 120 msgstr "" 121 121 122 #: wp-security-audit-log.php:103 8122 #: wp-security-audit-log.php:1039 123 123 msgid "Extension activated" 124 124 msgstr "" 125 125 126 #: wp-security-audit-log.php:10 39126 #: wp-security-audit-log.php:1040 127 127 msgid "Install failed" 128 128 msgstr "" 129 129 130 #: wp-security-audit-log.php:104 0130 #: wp-security-audit-log.php:1041 131 131 msgid "Reloading page" 132 132 msgstr "" 133 133 134 134 #. Translators: %s: PHP Version 135 #: wp-security-audit-log.php:107 6135 #: wp-security-audit-log.php:1077 136 136 msgid "You are using a version of PHP that is older than %s, which is no longer supported." 137 137 msgstr "" 138 138 139 #: wp-security-audit-log.php:107 8139 #: wp-security-audit-log.php:1079 140 140 msgid "Contact us on <a href=\"mailto:plugins@wpwhitesecurity.com\">plugins@wpwhitesecurity.com</a> to help you switch the version of PHP you are using." 141 141 msgstr "" 142 142 143 143 #. Translators: %s: Activity Log for MainWP plugin hyperlink 144 #: wp-security-audit-log.php:108 3144 #: wp-security-audit-log.php:1084 145 145 msgid "Please install the %s plugin on the MainWP dashboard." 146 146 msgstr "" 147 147 148 148 #. Translators: %s: Activity Log for MainWP plugin hyperlink 149 #: wp-security-audit-log.php:108 3149 #: wp-security-audit-log.php:1084 150 150 msgid "Activity Log for MainWP" 151 151 msgstr "" 152 152 153 153 #. Translators: %s: Getting started guide hyperlink 154 #: wp-security-audit-log.php:108 5154 #: wp-security-audit-log.php:1086 155 155 msgid "The WP Activity Log should be installed on the child sites only. Refer to the %s for more information." 156 156 msgstr "" 157 157 158 158 #. Translators: %s: Getting started guide hyperlink 159 #: wp-security-audit-log.php:108 5159 #: wp-security-audit-log.php:1086 160 160 msgid "getting started guide" 161 161 msgstr "" 162 162 163 #: wp-security-audit-log.php:148 1163 #: wp-security-audit-log.php:1482 164 164 msgid "For security and auditing purposes, a record of all of your logged-in actions and changes within the WordPress dashboard will be recorded in an activity log with the <a href=\"https://wpactivitylog.com/\" target=\"_blank\">WP Activity Log plugin</a>. The audit log also includes the IP address where you accessed this site from." 165 165 msgstr "" 166 166 167 #: wp-security-audit-log.php:150 0167 #: wp-security-audit-log.php:1501 168 168 msgid "Every 6 hours" 169 169 msgstr "" 170 170 171 #: wp-security-audit-log.php:150 4171 #: wp-security-audit-log.php:1505 172 172 msgid "Every 45 minutes" 173 173 msgstr "" 174 174 175 #: wp-security-audit-log.php:150 8175 #: wp-security-audit-log.php:1509 176 176 msgid "Every 30 minutes" 177 177 msgstr "" 178 178 179 #: wp-security-audit-log.php:151 2179 #: wp-security-audit-log.php:1513 180 180 msgid "Every 15 minutes" 181 181 msgstr "" 182 182 183 #: wp-security-audit-log.php:151 6183 #: wp-security-audit-log.php:1517 184 184 msgid "Every 10 minutes" 185 185 msgstr "" 186 186 187 #: wp-security-audit-log.php:152 0187 #: wp-security-audit-log.php:1521 188 188 msgid "Every 5 minutes" 189 189 msgstr "" 190 190 191 191 #. translators: 1. Deprecated method name 2. Version since deprecated 192 #: wp-security-audit-log.php:153 4192 #: wp-security-audit-log.php:1535 193 193 msgid "Method %1$s is deprecated since version %2$s!" 194 194 msgstr "" -
wp-security-audit-log/trunk/nofs/lib/class-wsal-freemius.php
r2897171 r2911239 86 86 87 87 public function is_free_plan() { 88 return true;89 88 return true; 90 89 } -
wp-security-audit-log/trunk/readme.txt
r2897171 r2911239 4 4 License: GPLv3 5 5 License URI: https://www.gnu.org/licenses/gpl.html 6 Tags: activity log, security audit log, user tracking, security event log, audit trail, user activity 6 Tags: activity log, security audit log, user tracking, security event log, audit trail, user activity, changelog, history, log, website changes 7 7 Requires at least: 5.0 8 8 Tested up to: 6.2 9 Stable tag: 4.5. 09 Stable tag: 4.5.2 10 10 Requires PHP: 7.2 11 11 … … 210 210 == Changelog == 211 211 212 = 4.5.0 (2023-04-12) = 213 214 Release notes: [Announcing WP Activity Log 4.5](https://wpactivitylog.com/wsal-4-5-0/) 212 = 4.5.2 (2023-05-11) = 215 213 216 214 * **Plugin & features improvements** 217 * Refactoring the plugin's code phase 1 - improved performance, reliability and maintainability. 218 * Better support for PHP8 - addressed all reported warnings and fatal errors. 219 * Event ID 2002 is now reported when a user changes something in a post for which the plugin does not have a specific event ID. 220 * Added checks to the excluded objects placeholders to ensure users do not specify wrong objects in the wrong setting. 221 * Replaced technical term severity labels with friendly ones. For example WSAL_HIGH is now High severity. 222 * Added some new help text and improved existing help text in some pages throughout the plugin. 223 * Improved support for RTL setups in the activity log viewer. 224 * Removed code related to the migration of events when using an external database from the Free edition of the plugin. 225 * Improved the way the database table changes are detected by the plugin - all event IDs used for database changes monitoring are now enabled by default. 226 * Improved the sensor that detects page changes (page created, deleted or changed) done automatically via plugins. 227 * UI/UX improvements in the reports page and the settings for the periodic reports. 215 * Improved PHP 8.2 compatability. 216 * Replaced the elipsis icon used for the Event data viewer with a "More details" button in the activity log viewer. 217 * Updated a number of hooks (better interoperability) used in custom sensors. 218 * Improved the "installed plugin" check to only show one extension notification when both the free and premium edition of a plugin are installed at the same time. 219 * Activity log data is also automatically deleted from the archive database when using the logs data deletion tool. 220 221 * **Security updates** 222 * Fixed a number of CSRFs, missing authorization & missing capabilities checks discovered by Marco from Wordfence. 228 223 229 224 * **Bug fixes** 230 * Fixed: Intermittent fatal error in UserSessionsTracking.php when loggin in from custom login pages (like WooCommerce). 231 * Fixed: Event ID 7009 (user changed the maximum upload file size for a site on a multisite network) was wrongly logged instead event ID 7011(user changed the maximum upload file size for the network). 232 * Fixed: Renaming a menu was not reported correctly, event ID 2085 (Changed menu items order) was reported instead. 233 * Fixed: Error reported in the message of event ID 6060 (Changed the status of an event ID). 234 * Fixed: WP Activity Log now keeps a log when it is activated or deactivated. 235 * Fixed: Deleting events with "Informational" severity delets all events in the log. 236 * Fixed: Fatal error in class-alert-manager.php when excluding a user and its role at the same time. 237 * Fixed: Super Admin role added to Admin user in logs on a single site. 238 * Fixed: PHP warning in /classes/Sensors/Multisite.php on a multisite network when running NOFS edition of the plugin on some specific multisite network setup. 239 * Fixed: Plugin version update notice still shown in the NOFS edition of the plugin even when the plugin is up to date. 240 * Fixed: When objets are excluded from the activity log. 241 * Fixed: Event ID 6052 (Changed activity log retention settings) was not reported if the setting is already on "delete events older than" and the user changes the number of months or years. 242 * Fixed: Event IDs 6053 - 6058, used to keep a log of when objects are excluded from the activity log are not reported in a multisite network environment. 243 * Fixed: Site title change not reported (Event ID 6059). 244 * Fixed: Event ID 6034 (Purged activity log) also reported along site event ID 6006 when resetting plugin settings to default. 245 246 Refer to the [complete plugin changelog](https://wpactivitylog.com/support/kb/plugin-changelog/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=WSAL&utm_content=plugin+repos+description) for more detailed information about what was new, improved and fixed in previous versions of the WP Activity Log plugin.. 225 * Fixed: Fatal error reported when cloning a site on a multisite network with the NS Cloner plugin. 226 * Fixed: Plugin was not retrieving the correct IP address when using a reverse proxy since update 4.5.0. 227 * Addressed a number of PHP Warnings reported when using the WP Rocket plugin to purge the cache. 228 * Fixed: PHP warning when saving Exclude Objects settings. 229 * Setting up a mirroring connection and configuring the mirror of logs was not being reported in the logs. 230 * Fixed: Fatal error when using the User Switching plugin to switch a user's session. 231 * Fixed: Logins from non-native login forms (such as those from WooCommerce) were not captured correctly since update 4.5.0. 232 * Fixed: Plugin not terminating existing user session when the seting to "overwrite existing session" was enabled. 233 234 Refer to the [complete plugin changelog](https://wpactivitylog.com/support/kb/plugin-changelog/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=WSAL&utm_content=plugin+repos+description) for more detailed information about what was new, improved and fixed in previous versions of the WP Activity Log plugin. -
wp-security-audit-log/trunk/sdk/wsal-freemius.php
r2897171 r2911239 45 45 $freemius_state = \WSAL\Helpers\Settings_Helper::get_option_value( 'wsal_freemius_state', 'anonymous' ); 46 46 $is_anonymous = ( 'anonymous' === $freemius_state || 'skipped' === $freemius_state ); 47 $is_premium = true;47 $is_premium = false; 48 48 $is_anonymous = $is_premium ? false : $is_anonymous; 49 49 -
wp-security-audit-log/trunk/third-party/vendor/autoload.php
r2897171 r2911239 4 4 5 5 if (PHP_VERSION_ID < 50600) { 6 if (!headers_sent()) { 7 header('HTTP/1.1 500 Internal Server Error'); 8 } 9 $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; 10 if (!ini_get('display_errors')) { 11 if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 12 fwrite(STDERR, $err); 13 } elseif (!headers_sent()) { 14 echo $err; 15 } 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 6 echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; 7 exit(1); 21 8 } 22 9 23 10 require_once __DIR__ . '/composer/autoload_real.php'; 24 11 25 return ComposerAutoloaderInit 201f86ba52b29dc488d34f8e732c3d2f::getLoader();12 return ComposerAutoloaderInite241c7387a5aac99f296110be12551fd::getLoader(); -
wp-security-audit-log/trunk/third-party/vendor/classes/wp-async-request.php
r2897171 r2911239 50 50 protected $data = array(); 51 51 /** 52 * Initiate new async request 52 * Initiate new async request. 53 53 */ 54 54 public function __construct() … … 59 59 } 60 60 /** 61 * Set data used during the request 61 * Set data used during the request. 62 62 * 63 63 * @param array $data Data. … … 71 71 } 72 72 /** 73 * Dispatch the async request 73 * Dispatch the async request. 74 74 * 75 * @return array|WP_Error 75 * @return array|WP_Error|false HTTP Response array, WP_Error on failure, or false if not attempted. 76 76 */ 77 77 public function dispatch() … … 82 82 } 83 83 /** 84 * Get query args 84 * Get query args. 85 85 * 86 86 * @return array … … 100 100 } 101 101 /** 102 * Get query URL 102 * Get query URL. 103 103 * 104 104 * @return string … … 118 118 } 119 119 /** 120 * Get post args 120 * Get post args. 121 121 * 122 122 * @return array … … 127 127 return $this->post_args; 128 128 } 129 $args = array('timeout' => 0.01, 'blocking' => \false, 'body' => $this->data, 'cookies' => $_COOKIE, 'sslverify' => apply_filters('https_local_ssl_verify', \false)); 129 $args = array( 130 'timeout' => 0.01, 131 'blocking' => \false, 132 'body' => $this->data, 133 'cookies' => $_COOKIE, 134 // Passing cookies ensures request is performed as initiating user. 135 'sslverify' => apply_filters('https_local_ssl_verify', \false), 136 ); 130 137 /** 131 138 * Filters the post arguments used during an async request. … … 136 143 } 137 144 /** 138 * Maybe handle 145 * Maybe handle a dispatched request. 139 146 * 140 147 * Check for correct nonce and pass to handler. 148 * 149 * @return void|mixed 141 150 */ 142 151 public function maybe_handle() 143 152 { 144 // Don't lock up other requests while processing 153 // Don't lock up other requests while processing. 145 154 \session_write_close(); 146 155 check_ajax_referer($this->identifier, 'nonce'); 147 156 $this->handle(); 148 wp_die();157 return $this->maybe_wp_die(); 149 158 } 150 159 /** 151 * Handle 160 * Should the process exit with wp_die? 161 * 162 * @param mixed $return What to return if filter says don't die, default is null. 163 * 164 * @return void|mixed 165 */ 166 protected function maybe_wp_die($return = null) 167 { 168 /** 169 * Should wp_die be used? 170 * 171 * @return bool 172 */ 173 if (apply_filters($this->identifier . '_wp_die', \true)) { 174 wp_die(); 175 } 176 return $return; 177 } 178 /** 179 * Handle a dispatched request. 152 180 * 153 181 * Override this method to perform any actions required -
wp-security-audit-log/trunk/third-party/vendor/classes/wp-background-process.php
r2897171 r2911239 37 37 * Cron_hook_identifier 38 38 * 39 * @var mixed39 * @var string 40 40 * @access protected 41 41 */ … … 44 44 * Cron_interval_identifier 45 45 * 46 * @var mixed46 * @var string 47 47 * @access protected 48 48 */ 49 49 protected $cron_interval_identifier; 50 50 /** 51 * Initiate new background process 51 * The status set when process is cancelling. 52 * 53 * @var int 54 */ 55 const STATUS_CANCELLED = 1; 56 /** 57 * The status set when process is paused or pausing. 58 * 59 * @var int; 60 */ 61 const STATUS_PAUSED = 2; 62 /** 63 * Initiate new background process. 52 64 */ 53 65 public function __construct() … … 60 72 } 61 73 /** 62 * Dispatch74 * Schedule the cron healthcheck and dispatch an async request to start processing the queue. 63 75 * 64 76 * @access public 65 * @return void77 * @return array|WP_Error|false HTTP Response array, WP_Error on failure, or false if not attempted. 66 78 */ 67 79 public function dispatch() 68 80 { 81 if ($this->is_processing()) { 82 // Process already running. 83 return \false; 84 } 69 85 // Schedule the cron healthcheck. 70 86 $this->schedule_event(); … … 73 89 } 74 90 /** 75 * Push to queue 91 * Push to the queue. 92 * 93 * Note, save must be called in order to persist queued items to a batch for processing. 76 94 * 77 95 * @param mixed $data Data. … … 85 103 } 86 104 /** 87 * Save queue105 * Save the queued items for future processing. 88 106 * 89 107 * @return $this … … 95 113 update_site_option($key, $this->data); 96 114 } 115 // Clean out data so that new data isn't prepended with closed session's data. 116 $this->data = array(); 97 117 return $this; 98 118 } 99 119 /** 100 * Update queue120 * Update a batch's queued items. 101 121 * 102 122 * @param string $key Key. … … 113 133 } 114 134 /** 115 * Delete queue135 * Delete a batch of queued items. 116 136 * 117 137 * @param string $key Key. … … 125 145 } 126 146 /** 127 * Generate key 147 * Delete entire job queue. 148 */ 149 public function delete_all() 150 { 151 $batches = $this->get_batches(); 152 foreach ($batches as $batch) { 153 $this->delete($batch->key); 154 } 155 delete_site_option($this->get_status_key()); 156 $this->cancelled(); 157 } 158 /** 159 * Cancel job on next batch. 160 */ 161 public function cancel() 162 { 163 update_site_option($this->get_status_key(), self::STATUS_CANCELLED); 164 // Just in case the job was paused at the time. 165 $this->dispatch(); 166 } 167 /** 168 * Has the process been cancelled? 169 * 170 * @return bool 171 */ 172 public function is_cancelled() 173 { 174 $status = get_site_option($this->get_status_key(), 0); 175 if (absint($status) === self::STATUS_CANCELLED) { 176 return \true; 177 } 178 return \false; 179 } 180 /** 181 * Called when background process has been cancelled. 182 */ 183 protected function cancelled() 184 { 185 do_action($this->identifier . '_cancelled'); 186 } 187 /** 188 * Pause job on next batch. 189 */ 190 public function pause() 191 { 192 update_site_option($this->get_status_key(), self::STATUS_PAUSED); 193 } 194 /** 195 * Is the job paused? 196 * 197 * @return bool 198 */ 199 public function is_paused() 200 { 201 $status = get_site_option($this->get_status_key(), 0); 202 if (absint($status) === self::STATUS_PAUSED) { 203 return \true; 204 } 205 return \false; 206 } 207 /** 208 * Called when background process has been paused. 209 */ 210 protected function paused() 211 { 212 do_action($this->identifier . '_paused'); 213 } 214 /** 215 * Resume job. 216 */ 217 public function resume() 218 { 219 delete_site_option($this->get_status_key()); 220 $this->schedule_event(); 221 $this->dispatch(); 222 $this->resumed(); 223 } 224 /** 225 * Called when background process has been resumed. 226 */ 227 protected function resumed() 228 { 229 do_action($this->identifier . '_resumed'); 230 } 231 /** 232 * Is queued? 233 * 234 * @return bool 235 */ 236 public function is_queued() 237 { 238 return !$this->is_queue_empty(); 239 } 240 /** 241 * Is the tool currently active, e.g. starting, working, paused or cleaning up? 242 * 243 * @return bool 244 */ 245 public function is_active() 246 { 247 return $this->is_queued() || $this->is_processing() || $this->is_paused() || $this->is_cancelled(); 248 } 249 /** 250 * Generate key for a batch. 128 251 * 129 252 * Generates a unique key based on microtime. Queue items are 130 253 * given a unique key so that they can be merged upon save. 131 254 * 132 * @param int $length Length. 255 * @param int $length Optional max length to trim key to, defaults to 64 characters. 256 * @param string $key Optional string to append to identifier before hash, defaults to "batch". 133 257 * 134 258 * @return string 135 259 */ 136 protected function generate_key($length = 64 )137 { 138 $unique = \md5(\microtime() . \rand());139 $prepend = $this->identifier . '_ batch_';260 protected function generate_key($length = 64, $key = 'batch') 261 { 262 $unique = \md5(\microtime() . wp_rand()); 263 $prepend = $this->identifier . '_' . $key . '_'; 140 264 return \substr($prepend . $unique, 0, $length); 141 265 } 142 266 /** 143 * Maybe process queue 267 * Get the status key. 268 * 269 * @return string 270 */ 271 protected function get_status_key() 272 { 273 return $this->identifier . '_status'; 274 } 275 /** 276 * Maybe process a batch of queued items. 144 277 * 145 278 * Checks whether data exists within the queue and that … … 148 281 public function maybe_handle() 149 282 { 150 // Don't lock up other requests while processing 283 // Don't lock up other requests while processing. 151 284 \session_write_close(); 152 if ($this->is_process _running()) {285 if ($this->is_processing()) { 153 286 // Background process already running. 154 wp_die(); 287 return $this->maybe_wp_die(); 288 } 289 if ($this->is_cancelled()) { 290 $this->clear_scheduled_event(); 291 $this->delete_all(); 292 return $this->maybe_wp_die(); 293 } 294 if ($this->is_paused()) { 295 $this->clear_scheduled_event(); 296 $this->paused(); 297 return $this->maybe_wp_die(); 155 298 } 156 299 if ($this->is_queue_empty()) { 157 300 // No data to process. 158 wp_die();301 return $this->maybe_wp_die(); 159 302 } 160 303 check_ajax_referer($this->identifier, 'nonce'); 161 304 $this->handle(); 162 wp_die();163 } 164 /** 165 * Is queue empty 305 return $this->maybe_wp_die(); 306 } 307 /** 308 * Is queue empty? 166 309 * 167 310 * @return bool … … 169 312 protected function is_queue_empty() 170 313 { 171 global $wpdb; 172 $table = $wpdb->options; 173 $column = 'option_name'; 174 if (is_multisite()) { 175 $table = $wpdb->sitemeta; 176 $column = 'meta_key'; 177 } 178 $key = $wpdb->esc_like($this->identifier . '_batch_') . '%'; 179 $count = $wpdb->get_var($wpdb->prepare("\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM {$table}\n\t\t\tWHERE {$column} LIKE %s\n\t\t", $key)); 180 return $count > 0 ? \false : \true; 181 } 182 /** 183 * Is process running 314 return empty($this->get_batch()); 315 } 316 /** 317 * Is process running? 184 318 * 185 319 * Check whether the current process is already running 186 320 * in a background process. 321 * 322 * @return bool 323 * 324 * @deprecated 1.1.0 Superseded. 325 * @see is_processing() 187 326 */ 188 327 protected function is_process_running() 328 { 329 return $this->is_processing(); 330 } 331 /** 332 * Is the background process currently running? 333 * 334 * @return bool 335 */ 336 public function is_processing() 189 337 { 190 338 if (get_site_transient($this->identifier . '_process_lock')) { … … 195 343 } 196 344 /** 197 * Lock process 345 * Lock process. 198 346 * 199 347 * Lock the process so that multiple instances can't run simultaneously. … … 211 359 } 212 360 /** 213 * Unlock process 361 * Unlock process. 214 362 * 215 363 * Unlock the process so that other instances can spawn. … … 223 371 } 224 372 /** 225 * Get batch 226 * 227 * @return stdClass Return the first batch from the queue373 * Get batch. 374 * 375 * @return stdClass Return the first batch of queued items. 228 376 */ 229 377 protected function get_batch() 230 378 { 379 return \array_reduce($this->get_batches(1), function ($carry, $batch) { 380 return $batch; 381 }, array()); 382 } 383 /** 384 * Get batches. 385 * 386 * @param int $limit Number of batches to return, defaults to all. 387 * 388 * @return array of stdClass 389 */ 390 public function get_batches($limit = 0) 391 { 231 392 global $wpdb; 393 if (empty($limit) || !\is_int($limit)) { 394 $limit = 0; 395 } 232 396 $table = $wpdb->options; 233 397 $column = 'option_name'; … … 241 405 } 242 406 $key = $wpdb->esc_like($this->identifier . '_batch_') . '%'; 243 $query = $wpdb->get_row($wpdb->prepare("\n\t\t\tSELECT *\n\t\t\tFROM {$table}\n\t\t\tWHERE {$column} LIKE %s\n\t\t\tORDER BY {$key_column} ASC\n\t\t\tLIMIT 1\n\t\t", $key)); 244 $batch = new \stdClass(); 245 $batch->key = $query->{$column}; 246 $batch->data = maybe_unserialize($query->{$value_column}); 247 return $batch; 248 } 249 /** 250 * Handle 407 $sql = ' 408 SELECT * 409 FROM ' . $table . ' 410 WHERE ' . $column . ' LIKE %s 411 ORDER BY ' . $key_column . ' ASC 412 '; 413 $args = array($key); 414 if (!empty($limit)) { 415 $sql .= ' LIMIT %d'; 416 $args[] = $limit; 417 } 418 $items = $wpdb->get_results($wpdb->prepare($sql, $args)); 419 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 420 $batches = array(); 421 if (!empty($items)) { 422 $batches = \array_map(function ($item) use($column, $value_column) { 423 $batch = new \stdClass(); 424 $batch->key = $item->{$column}; 425 $batch->data = maybe_unserialize($item->{$value_column}); 426 return $batch; 427 }, $items); 428 } 429 return $batches; 430 } 431 /** 432 * Handle a dispatched request. 251 433 * 252 434 * Pass each queue item to the task handler, while remaining … … 256 438 { 257 439 $this->lock_process(); 440 /** 441 * Number of seconds to sleep between batches. Defaults to 0 seconds, minimum 0. 442 * 443 * @param int $seconds 444 */ 445 $throttle_seconds = \max(0, apply_filters($this->identifier . '_seconds_between_batches', apply_filters($this->prefix . '_seconds_between_batches', 0))); 258 446 do { 259 447 $batch = $this->get_batch(); … … 265 453 unset($batch->data[$key]); 266 454 } 455 // Keep the batch up to date while processing it. 456 if (!empty($batch->data)) { 457 $this->update($batch->key, $batch->data); 458 } 459 // Let the server breathe a little. 460 \sleep($throttle_seconds); 267 461 if ($this->time_exceeded() || $this->memory_exceeded()) { 268 462 // Batch limits reached. … … 270 464 } 271 465 } 272 // Update or delete current batch. 273 if (!empty($batch->data)) { 274 $this->update($batch->key, $batch->data); 275 } else { 466 // Delete current batch if fully processed. 467 if (empty($batch->data)) { 276 468 $this->delete($batch->key); 277 469 } … … 284 476 $this->complete(); 285 477 } 286 wp_die();287 } 288 /** 289 * Memory exceeded 478 return $this->maybe_wp_die(); 479 } 480 /** 481 * Memory exceeded? 290 482 * 291 483 * Ensures the batch process never exceeds 90% … … 306 498 } 307 499 /** 308 * Get memory limit 500 * Get memory limit in bytes. 309 501 * 310 502 * @return int … … 325 517 } 326 518 /** 327 * Time exceeded.519 * Time limit exceeded? 328 520 * 329 521 * Ensures the batch never exceeds a sensible time limit. … … 343 535 } 344 536 /** 345 * Complete .537 * Complete processing. 346 538 * 347 539 * Override if applicable, but ensure that the below actions are … … 350 542 protected function complete() 351 543 { 352 // Unschedule the cron healthcheck. 544 delete_site_option($this->get_status_key()); 545 // Remove the cron healthcheck job from the cron schedule. 353 546 $this->clear_scheduled_event(); 354 } 355 /** 356 * Schedule cron healthcheck 547 $this->completed(); 548 } 549 /** 550 * Called when background process has completed. 551 */ 552 protected function completed() 553 { 554 do_action($this->identifier . '_completed'); 555 } 556 /** 557 * Schedule the cron healthcheck job. 357 558 * 358 559 * @access public … … 364 565 public function schedule_cron_healthcheck($schedules) 365 566 { 366 $interval = apply_filters($this-> identifier . '_cron_interval', 5);567 $interval = apply_filters($this->cron_interval_identifier, 5); 367 568 if (\property_exists($this, 'cron_interval')) { 368 $interval = apply_filters($this->identifier . '_cron_interval', $this->cron_interval); 369 } 370 // Adds every 5 minutes to the existing schedules. 371 $schedules[$this->identifier . '_cron_interval'] = array('interval' => \MINUTE_IN_SECONDS * $interval, 'display' => \sprintf(__('Every %d Minutes'), $interval)); 569 $interval = apply_filters($this->cron_interval_identifier, $this->cron_interval); 570 } 571 if (1 === $interval) { 572 $display = __('Every Minute'); 573 } else { 574 $display = \sprintf(__('Every %d Minutes'), $interval); 575 } 576 // Adds an "Every NNN Minute(s)" schedule to the existing cron schedules. 577 $schedules[$this->cron_interval_identifier] = array('interval' => \MINUTE_IN_SECONDS * $interval, 'display' => $display); 372 578 return $schedules; 373 579 } 374 580 /** 375 * Handle cron healthcheck 581 * Handle cron healthcheck event. 376 582 * 377 583 * Restart the background process if not already running … … 380 586 public function handle_cron_healthcheck() 381 587 { 382 if ($this->is_process _running()) {588 if ($this->is_processing()) { 383 589 // Background process already running. 384 590 exit; … … 389 595 exit; 390 596 } 391 $this->handle(); 392 exit; 393 } 394 /** 395 * Schedule event 597 $this->dispatch(); 598 } 599 /** 600 * Schedule the cron healthcheck event. 396 601 */ 397 602 protected function schedule_event() … … 402 607 } 403 608 /** 404 * Clear scheduled event609 * Clear scheduled cron healthcheck event. 405 610 */ 406 611 protected function clear_scheduled_event() … … 412 617 } 413 618 /** 414 * Cancel Process 415 * 416 * Stop processing queue items, clear cronjob and delete batch. 417 * 619 * Cancel the background process. 620 * 621 * Stop processing queue items, clear cron job and delete batch. 622 * 623 * @deprecated 1.1.0 Superseded. 624 * @see cancel() 418 625 */ 419 626 public function cancel_process() 420 627 { 421 if (!$this->is_queue_empty()) { 422 $batch = $this->get_batch(); 423 $this->delete($batch->key); 424 wp_clear_scheduled_hook($this->cron_hook_identifier); 425 } 426 } 427 /** 428 * Task 628 $this->cancel(); 629 } 630 /** 631 * Perform task with queued item. 429 632 * 430 633 * Override this method to perform any actions required on each -
wp-security-audit-log/trunk/third-party/vendor/composer/ClassLoader.php
r2897171 r2911239 43 43 class ClassLoader 44 44 { 45 /** @var \Closure(string):void */46 private static $includeFile;47 48 45 /** @var ?string */ 49 46 private $vendorDir; … … 110 107 { 111 108 $this->vendorDir = $vendorDir; 112 self::initializeIncludeClosure();113 109 } 114 110 … … 430 426 { 431 427 if ($file = $this->findFile($class)) { 432 $includeFile = self::$includeFile; 433 $includeFile($file); 428 includeFile($file); 434 429 435 430 return true; … … 561 556 return false; 562 557 } 563 564 /**565 * @return void566 */567 private static function initializeIncludeClosure()568 {569 if (self::$includeFile !== null) {570 return;571 }572 573 /**574 * Scope isolated include.575 *576 * Prevents access to $this/self from included files.577 *578 * @param string $file579 * @return void580 */581 self::$includeFile = \Closure::bind(static function($file) {582 include $file;583 }, null, null);584 }585 558 } 559 560 /** 561 * Scope isolated include. 562 * 563 * Prevents access to $this/self from included files. 564 * 565 * @param string $file 566 * @return void 567 * @private 568 */ 569 function includeFile($file) 570 { 571 include $file; 572 } -
wp-security-audit-log/trunk/third-party/vendor/composer/autoload_real.php
r2897171 r2911239 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 201f86ba52b29dc488d34f8e732c3d2f5 class ComposerAutoloaderInite241c7387a5aac99f296110be12551fd 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit 201f86ba52b29dc488d34f8e732c3d2f', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInite241c7387a5aac99f296110be12551fd', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit 201f86ba52b29dc488d34f8e732c3d2f', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInite241c7387a5aac99f296110be12551fd', 'loadClassLoader')); 28 28 29 29 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit 201f86ba52b29dc488d34f8e732c3d2f::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInite241c7387a5aac99f296110be12551fd::getInitializer($loader)); 31 31 32 32 $loader->setClassMapAuthoritative(true); -
wp-security-audit-log/trunk/third-party/vendor/composer/autoload_static.php
r2897171 r2911239 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 201f86ba52b29dc488d34f8e732c3d2f7 class ComposerStaticInite241c7387a5aac99f296110be12551fd 8 8 { 9 9 public static $classMap = array ( … … 16 16 { 17 17 return \Closure::bind(function () use ($loader) { 18 $loader->classMap = ComposerStaticInit 201f86ba52b29dc488d34f8e732c3d2f::$classMap;18 $loader->classMap = ComposerStaticInite241c7387a5aac99f296110be12551fd::$classMap; 19 19 20 20 }, null, ClassLoader::class); -
wp-security-audit-log/trunk/third-party/vendor/wp-background-processing.php
r2897171 r2911239 10 10 /* 11 11 Plugin Name: WP Background Processing 12 Plugin URI: https://github.com/ A5hleyRich/wp-background-processing12 Plugin URI: https://github.com/deliciousbrains/wp-background-processing 13 13 Description: Asynchronous requests and background processing in WordPress. 14 14 Author: Delicious Brains Inc. 15 15 Version: 1.0 16 16 Author URI: https://deliciousbrains.com/ 17 GitHub Plugin URI: https://github.com/ A5hleyRich/wp-background-processing17 GitHub Plugin URI: https://github.com/deliciousbrains/wp-background-processing 18 18 GitHub Branch: master 19 19 */ -
wp-security-audit-log/trunk/vendor/autoload.php
r2897171 r2911239 4 4 5 5 if (PHP_VERSION_ID < 50600) { 6 if (!headers_sent()) { 7 header('HTTP/1.1 500 Internal Server Error'); 8 } 9 $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; 10 if (!ini_get('display_errors')) { 11 if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 12 fwrite(STDERR, $err); 13 } elseif (!headers_sent()) { 14 echo $err; 15 } 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 6 echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; 7 exit(1); 21 8 } 22 9 23 10 require_once __DIR__ . '/composer/autoload_real.php'; 24 11 25 return ComposerAutoloaderInit d9d3dcc1572b67d66b72324849a8befc::getLoader();12 return ComposerAutoloaderInita2507426f604506cb47388e3fa33b5f5::getLoader(); -
wp-security-audit-log/trunk/vendor/composer/ClassLoader.php
r2897171 r2911239 43 43 class ClassLoader 44 44 { 45 /** @var \Closure(string):void */46 private static $includeFile;47 48 45 /** @var ?string */ 49 46 private $vendorDir; … … 110 107 { 111 108 $this->vendorDir = $vendorDir; 112 self::initializeIncludeClosure();113 109 } 114 110 … … 430 426 { 431 427 if ($file = $this->findFile($class)) { 432 $includeFile = self::$includeFile; 433 $includeFile($file); 428 includeFile($file); 434 429 435 430 return true; … … 561 556 return false; 562 557 } 563 564 /**565 * @return void566 */567 private static function initializeIncludeClosure()568 {569 if (self::$includeFile !== null) {570 return;571 }572 573 /**574 * Scope isolated include.575 *576 * Prevents access to $this/self from included files.577 *578 * @param string $file579 * @return void580 */581 self::$includeFile = \Closure::bind(static function($file) {582 include $file;583 }, null, null);584 }585 558 } 559 560 /** 561 * Scope isolated include. 562 * 563 * Prevents access to $this/self from included files. 564 * 565 * @param string $file 566 * @return void 567 * @private 568 */ 569 function includeFile($file) 570 { 571 include $file; 572 } -
wp-security-audit-log/trunk/vendor/composer/autoload_classmap.php
r2897171 r2911239 12 12 'RHtmlFormatter' => $baseDir . '/classes/Ref.php', 13 13 'RTextFormatter' => $baseDir . '/classes/Ref.php', 14 'Tools\\Select2_WPWS' => $baseDir . '/classes/Select2/class-select2-wpws.php', 14 15 'WSAL\\Actions\\Pluging_Installer' => $baseDir . '/classes/Actions/class-plugin-installer.php', 15 16 'WSAL\\Adapter\\WSAL_Adapters_MySQL_ActiveRecord' => $baseDir . '/classes/Adapters/MySQL/ActiveRecordAdapter.php', -
wp-security-audit-log/trunk/vendor/composer/autoload_files.php
r2897171 r2911239 8 8 return array( 9 9 '2007ccaa29a9efd0493ee82176c977d1' => $vendorDir . '/wpwhitesecurity/import-export-plugin-settings/SettingsImportExport.php', 10 'ed8f7d07f343dc9e7c5d31cc6cd4019b' => $vendorDir . '/wpwhitesecurity/select2-wpwhitesecurity/load.php',11 10 ); -
wp-security-audit-log/trunk/vendor/composer/autoload_real.php
r2897171 r2911239 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit d9d3dcc1572b67d66b72324849a8befc5 class ComposerAutoloaderInita2507426f604506cb47388e3fa33b5f5 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit d9d3dcc1572b67d66b72324849a8befc', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInita2507426f604506cb47388e3fa33b5f5', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit d9d3dcc1572b67d66b72324849a8befc', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInita2507426f604506cb47388e3fa33b5f5', 'loadClassLoader')); 28 28 29 29 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit d9d3dcc1572b67d66b72324849a8befc::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInita2507426f604506cb47388e3fa33b5f5::getInitializer($loader)); 31 31 32 32 $loader->register(true); 33 33 34 $filesToLoad = \Composer\Autoload\ComposerStaticInitd9d3dcc1572b67d66b72324849a8befc::$files; 35 $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { 36 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 37 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 38 39 require $file; 40 } 41 }, null, null); 42 foreach ($filesToLoad as $fileIdentifier => $file) { 43 $requireFile($fileIdentifier, $file); 34 $includeFiles = \Composer\Autoload\ComposerStaticInita2507426f604506cb47388e3fa33b5f5::$files; 35 foreach ($includeFiles as $fileIdentifier => $file) { 36 composerRequirea2507426f604506cb47388e3fa33b5f5($fileIdentifier, $file); 44 37 } 45 38 … … 47 40 } 48 41 } 42 43 /** 44 * @param string $fileIdentifier 45 * @param string $file 46 * @return void 47 */ 48 function composerRequirea2507426f604506cb47388e3fa33b5f5($fileIdentifier, $file) 49 { 50 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 51 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 52 53 require $file; 54 } 55 } -
wp-security-audit-log/trunk/vendor/composer/autoload_static.php
r2897171 r2911239 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit d9d3dcc1572b67d66b72324849a8befc7 class ComposerStaticInita2507426f604506cb47388e3fa33b5f5 8 8 { 9 9 public static $files = array ( 10 10 '2007ccaa29a9efd0493ee82176c977d1' => __DIR__ . '/..' . '/wpwhitesecurity/import-export-plugin-settings/SettingsImportExport.php', 11 'ed8f7d07f343dc9e7c5d31cc6cd4019b' => __DIR__ . '/..' . '/wpwhitesecurity/select2-wpwhitesecurity/load.php',12 11 ); 13 12 … … 37 36 'RHtmlFormatter' => __DIR__ . '/../..' . '/classes/Ref.php', 38 37 'RTextFormatter' => __DIR__ . '/../..' . '/classes/Ref.php', 38 'Tools\\Select2_WPWS' => __DIR__ . '/../..' . '/classes/Select2/class-select2-wpws.php', 39 39 'WSAL\\Actions\\Pluging_Installer' => __DIR__ . '/../..' . '/classes/Actions/class-plugin-installer.php', 40 40 'WSAL\\Adapter\\WSAL_Adapters_MySQL_ActiveRecord' => __DIR__ . '/../..' . '/classes/Adapters/MySQL/ActiveRecordAdapter.php', … … 179 179 { 180 180 return \Closure::bind(function () use ($loader) { 181 $loader->prefixLengthsPsr4 = ComposerStaticInit d9d3dcc1572b67d66b72324849a8befc::$prefixLengthsPsr4;182 $loader->prefixDirsPsr4 = ComposerStaticInit d9d3dcc1572b67d66b72324849a8befc::$prefixDirsPsr4;183 $loader->classMap = ComposerStaticInit d9d3dcc1572b67d66b72324849a8befc::$classMap;181 $loader->prefixLengthsPsr4 = ComposerStaticInita2507426f604506cb47388e3fa33b5f5::$prefixLengthsPsr4; 182 $loader->prefixDirsPsr4 = ComposerStaticInita2507426f604506cb47388e3fa33b5f5::$prefixDirsPsr4; 183 $loader->classMap = ComposerStaticInita2507426f604506cb47388e3fa33b5f5::$classMap; 184 184 185 185 }, null, ClassLoader::class); -
wp-security-audit-log/trunk/vendor/composer/installed.json
r2897171 r2911239 3 3 { 4 4 "name": "deliciousbrains/wp-background-processing", 5 "version": "1. 0.2",6 "version_normalized": "1. 0.2.0",5 "version": "1.1.0", 6 "version_normalized": "1.1.0.0", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/deliciousbrains/wp-background-processing.git", 10 "reference": " 2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800"10 "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d" 11 11 }, 12 12 "dist": { 13 13 "type": "zip", 14 "url": "https://api.github.com/repos/deliciousbrains/wp-background-processing/zipball/ 2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800",15 "reference": " 2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800",14 "url": "https://api.github.com/repos/deliciousbrains/wp-background-processing/zipball/d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", 15 "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", 16 16 "shasum": "" 17 17 }, 18 18 "require": { 19 "php": ">=5.2" 19 "php": ">=5.6" 20 }, 21 "require-dev": { 22 "phpcompatibility/phpcompatibility-wp": "*", 23 "phpunit/phpunit": "^8.0", 24 "spryker/code-sniffer": "^0.17.18", 25 "wp-coding-standards/wpcs": "^2.3", 26 "yoast/phpunit-polyfills": "^1.0" 20 27 }, 21 28 "suggest": { 22 29 "coenjacobs/mozart": "Easily wrap this library with your own prefix, to prevent collisions when multiple plugins use this library" 23 30 }, 24 "time": "202 0-07-31T07:00:11+00:00",31 "time": "2023-04-18T12:32:25+00:00", 25 32 "type": "library", 26 33 "installation-source": "dist", … … 43 50 "support": { 44 51 "issues": "https://github.com/deliciousbrains/wp-background-processing/issues", 45 "source": "https://github.com/deliciousbrains/wp-background-processing/tree/ master"52 "source": "https://github.com/deliciousbrains/wp-background-processing/tree/1.1.0" 46 53 }, 47 54 "install-path": "../deliciousbrains/wp-background-processing" … … 49 56 { 50 57 "name": "freemius/wordpress-sdk", 51 "version": "2.5. 6",52 "version_normalized": "2.5. 6.0",58 "version": "2.5.7", 59 "version_normalized": "2.5.7.0", 53 60 "source": { 54 61 "type": "git", 55 62 "url": "https://github.com/Freemius/wordpress-sdk.git", 56 "reference": " 095fc9ced29efef5b18f9b7242bb80b0b4ac6aff"63 "reference": "78b876e227905373b94fecdd5e5449bcc4d63407" 57 64 }, 58 65 "dist": { 59 66 "type": "zip", 60 "url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/ 095fc9ced29efef5b18f9b7242bb80b0b4ac6aff",61 "reference": " 095fc9ced29efef5b18f9b7242bb80b0b4ac6aff",67 "url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/78b876e227905373b94fecdd5e5449bcc4d63407", 68 "reference": "78b876e227905373b94fecdd5e5449bcc4d63407", 62 69 "shasum": "" 63 70 }, … … 65 72 "php": ">=5.2" 66 73 }, 67 "time": "2023-0 3-28T10:40:38+00:00",74 "time": "2023-04-24T06:32:35+00:00", 68 75 "type": "library", 69 76 "installation-source": "dist", … … 85 92 "support": { 86 93 "issues": "https://github.com/Freemius/wordpress-sdk/issues", 87 "source": "https://github.com/Freemius/wordpress-sdk/tree/2.5. 6"94 "source": "https://github.com/Freemius/wordpress-sdk/tree/2.5.7" 88 95 }, 89 96 "install-path": "../freemius/wordpress-sdk" … … 91 98 { 92 99 "name": "woocommerce/action-scheduler", 93 "version": "3. 5.4",94 "version_normalized": "3. 5.4.0",100 "version": "3.6.0", 101 "version_normalized": "3.6.0.0", 95 102 "source": { 96 103 "type": "git", 97 104 "url": "https://github.com/woocommerce/action-scheduler.git", 98 "reference": " 9533e71b0eba4a519721dde84a34dfb161f11eb8"105 "reference": "1373570a9ee03a0be31c73df086d1e4343a27347" 99 106 }, 100 107 "dist": { 101 108 "type": "zip", 102 "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/ 9533e71b0eba4a519721dde84a34dfb161f11eb8",103 "reference": " 9533e71b0eba4a519721dde84a34dfb161f11eb8",109 "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/1373570a9ee03a0be31c73df086d1e4343a27347", 110 "reference": "1373570a9ee03a0be31c73df086d1e4343a27347", 104 111 "shasum": "" 105 112 }, … … 110 117 "yoast/phpunit-polyfills": "^1.0" 111 118 }, 112 "time": "2023-0 1-17T20:20:43+00:00",119 "time": "2023-05-10T19:25:40+00:00", 113 120 "type": "wordpress-plugin", 114 121 "extra": { … … 128 135 "support": { 129 136 "issues": "https://github.com/woocommerce/action-scheduler/issues", 130 "source": "https://github.com/woocommerce/action-scheduler/tree/3. 5.4"137 "source": "https://github.com/woocommerce/action-scheduler/tree/3.6.0" 131 138 }, 132 139 "install-path": "../woocommerce/action-scheduler" … … 170 177 }, 171 178 "install-path": "../wpwhitesecurity/import-export-plugin-settings" 172 },173 {174 "name": "wpwhitesecurity/select2-wpwhitesecurity",175 "version": "1.0.2",176 "version_normalized": "1.0.2.0",177 "source": {178 "type": "git",179 "url": "https://github.com/wpwhitesecurity/select2-wpwhitesecurity.git",180 "reference": "d56f367bcd22ba0836cd2ee6e88a1a3902f01ad3"181 },182 "dist": {183 "type": "zip",184 "url": "https://api.github.com/repos/wpwhitesecurity/select2-wpwhitesecurity/zipball/d56f367bcd22ba0836cd2ee6e88a1a3902f01ad3",185 "reference": "d56f367bcd22ba0836cd2ee6e88a1a3902f01ad3",186 "shasum": ""187 },188 "require": {189 "php": ">=7.0"190 },191 "time": "2022-03-16T08:53:12+00:00",192 "type": "library",193 "installation-source": "dist",194 "autoload": {195 "files": [196 "load.php"197 ]198 },199 "authors": [200 {201 "name": "WP White Security",202 "email": "info@wpwhitesecurity.com"203 }204 ],205 "description": "Select2 integration library for WordPress",206 "support": {207 "source": "https://github.com/wpwhitesecurity/select2-wpwhitesecurity/tree/v1.0.2",208 "issues": "https://github.com/wpwhitesecurity/select2-wpwhitesecurity/issues"209 },210 "install-path": "../wpwhitesecurity/select2-wpwhitesecurity"211 179 } 212 180 ], -
wp-security-audit-log/trunk/vendor/composer/installed.php
r2897171 r2911239 12 12 'versions' => array( 13 13 'deliciousbrains/wp-background-processing' => array( 14 'pretty_version' => '1. 0.2',15 'version' => '1. 0.2.0',16 'reference' => ' 2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800',14 'pretty_version' => '1.1.0', 15 'version' => '1.1.0.0', 16 'reference' => 'd5ef95cecba7f792ddca3e3bd70ebfb90dc4996d', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../deliciousbrains/wp-background-processing', … … 21 21 ), 22 22 'freemius/wordpress-sdk' => array( 23 'pretty_version' => '2.5. 6',24 'version' => '2.5. 6.0',25 'reference' => ' 095fc9ced29efef5b18f9b7242bb80b0b4ac6aff',23 'pretty_version' => '2.5.7', 24 'version' => '2.5.7.0', 25 'reference' => '78b876e227905373b94fecdd5e5449bcc4d63407', 26 26 'type' => 'library', 27 27 'install_path' => __DIR__ . '/../freemius/wordpress-sdk', … … 30 30 ), 31 31 'woocommerce/action-scheduler' => array( 32 'pretty_version' => '3. 5.4',33 'version' => '3. 5.4.0',34 'reference' => ' 9533e71b0eba4a519721dde84a34dfb161f11eb8',32 'pretty_version' => '3.6.0', 33 'version' => '3.6.0.0', 34 'reference' => '1373570a9ee03a0be31c73df086d1e4343a27347', 35 35 'type' => 'wordpress-plugin', 36 36 'install_path' => __DIR__ . '/../woocommerce/action-scheduler', … … 56 56 'dev_requirement' => false, 57 57 ), 58 'wpwhitesecurity/select2-wpwhitesecurity' => array(59 'pretty_version' => '1.0.2',60 'version' => '1.0.2.0',61 'reference' => 'd56f367bcd22ba0836cd2ee6e88a1a3902f01ad3',62 'type' => 'library',63 'install_path' => __DIR__ . '/../wpwhitesecurity/select2-wpwhitesecurity',64 'aliases' => array(),65 'dev_requirement' => false,66 ),67 58 ), 68 59 ); -
wp-security-audit-log/trunk/wp-security-audit-log.php
r2897171 r2911239 3 3 * WP Activity Log. 4 4 * 5 * @copyright Copyright (C) 2013- %%YEAR%%, WP White Security - support@wpwhitesecurity.com5 * @copyright Copyright (C) 2013-2023, WP White Security - support@wpwhitesecurity.com 6 6 * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 or higher 7 7 * 8 8 * @wordpress-plugin 9 9 * Plugin Name: WP Activity Log 10 * Version: 4.5. 010 * Version: 4.5.2 11 11 * Plugin URI: https://wpactivitylog.com/ 12 12 * 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. … … 56 56 57 57 if ( ! defined( 'WSAL_PREFIX' ) ) { 58 define( 'WSAL_VERSION', '4.5. 0' );58 define( 'WSAL_VERSION', '4.5.2' ); 59 59 define( 'WSAL_PREFIX', 'wsal_' ); 60 60 define( 'WSAL_PREFIX_PAGE', 'wsal-' ); … … 86 86 } 87 87 88 /** 89 * Connections Prefix. 90 */ 91 if ( ! defined( 'WSAL_CONN_PREFIX' ) ) { 92 define( 'WSAL_CONN_PREFIX', 'connection-' ); 93 } 94 if ( ! defined( 'WSAL_MIRROR_PREFIX' ) ) { 95 define( 'WSAL_MIRROR_PREFIX', 'mirror-' ); 96 } 97 88 98 /* @free:start */ 89 99 if ( ! function_exists( 'wsal_disable_freemius_on_free' ) ) { … … 237 247 238 248 add_action( 239 $bootstrap_hook[0],249 'init', 240 250 function() { 241 251 WSAL\Controllers\Alert_Manager::init(); … … 304 314 public static function is_frontend() { 305 315 return ! is_admin() 306 && ! self::is_login_screen()316 && ! WP_Helper::is_login_screen() 307 317 && ( ! defined( 'WP_CLI' ) || ! WP_CLI ) 308 318 && ( ! defined( 'DOING_CRON' ) || ! DOING_CRON ) … … 318 328 public static function is_frontend_page() { 319 329 return ! is_admin() 320 && ! self::is_login_screen()330 && ! WP_Helper::is_login_screen() 321 331 && ( ! defined( 'WP_CLI' ) || ! WP_CLI ) 322 332 && ( ! defined( 'DOING_CRON' ) || ! DOING_CRON ) … … 497 507 498 508 /** 499 * Whether the current page is the login screen.500 *501 * @return bool502 */503 public static function is_login_screen() {504 return parse_url( site_url( 'wp-login.php' ), PHP_URL_PATH ) === parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ); // phpcs:ignore505 }506 507 /**508 509 * Load Freemius SDK. 509 510 */ … … 594 595 } 595 596 596 if ( $is_admin_blocking_plugins_support_enabled || is_admin() || self::is_login_screen() || self::is_rest_api() || ( defined( 'DOING_CRON' ) && DOING_CRON ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {597 if ( $is_admin_blocking_plugins_support_enabled || is_admin() || WP_Helper::is_login_screen() || self::is_rest_api() || ( defined( 'DOING_CRON' ) && DOING_CRON ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) { 597 598 598 599 self::load_freemius(); … … 842 843 // $this->sensors = new WSAL_SensorManager( $this ); 843 844 844 Sensors_Load_Manager::load_sensors();845 // Sensors_Load_Manager::load_sensors(); 845 846 846 847 if ( is_admin() ) { … … 1111 1112 // run any installs. 1112 1113 self::get_connector()->install_all(); 1113 self::get_connector()->get_adapter( 'Occurrence' )->create_indexes();1114 self::get_connector()->get_adapter( 'Meta' )->create_indexes();1114 // self::get_connector()->get_adapter( 'Occurrence' )->create_indexes(); 1115 // self::get_connector()->get_adapter( 'Meta' )->create_indexes(); 1115 1116 1116 1117
Note: See TracChangeset
for help on using the changeset viewer.