Plugin Directory


Ignore:
Location:
wp-security-audit-log/trunk
Files:
73 added
1 deleted
41 edited

Legend:

Unmodified
Added
Removed
  • wp-security-audit-log/trunk/classes/AuditLogGridView.php

    r2897171 r2911239  
    226226        }
    227227
     228        // phpcs:disable
     229        // phpcs:enable
    228230    }
    229231
     
    414416                    $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>';
    415417
     418                    // phpcs:disable
     419                    // phpcs:enable
    416420
    417421                    $roles = WSAL_Utilities_UsersUtils::get_roles_label( $item['user_roles'] );
     
    452456                // If there's no IP...
    453457                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                    }
    455465                }
    456466
     
    463473                        $oips_html = "<a class='search-ip' data-tooltip='$tooltip' data-ip='$scip' target='_blank' href='$link'>" . esc_html( $scip ) . '</a>';
    464474                    }
    465                 } else {
    466                     if ( count( $oips ) < 2 ) {
     475                } elseif ( count( $oips ) < 2 ) {
    467476                        $oips_html = "<a target='_blank' href='$link'>" . esc_html( $scip ) . '</a>';
    468                     }
    469477                }
    470478
     
    527535                $url     = admin_url( 'admin-ajax.php' ) . '?action=AjaxInspector&amp;occurrence=' . $item['id'];
    528536                $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 . '&amp;TB_iframe=true&amp;width=600&amp;height=550">&hellip;</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 . '&amp;TB_iframe=true&amp;width=600&amp;height=550">' . __( 'More details...', 'wp-security-audit-log' ) . '</a>';
    531539            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 ] )
    534542                    : 'Column "' . esc_html( $column_name ) . '" not found';
    535543        }
     
    624632            $columns['cb']     = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
    625633                . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
    626             $cb_counter++;
     634            ++$cb_counter;
    627635        }
    628636
     
    707715     */
    708716    public function query_events( $paged = 0 ) {
     717        // phpcs:disable
     718        // phpcs:enable
    709719
    710720        // TO DO: Get rid of OccurrenceQuery and use the Occurrence Model.
  • wp-security-audit-log/trunk/classes/AuditLogListView.php

    r2897171 r2911239  
    448448                // If there's no IP...
    449449                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                    }
    451457                }
    452458
     
    498504                $url     = admin_url( 'admin-ajax.php' ) . '?action=AjaxInspector&amp;occurrence=' . $item['id'];
    499505                $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 . '&amp;TB_iframe=true&amp;width=600&amp;height=550">&hellip;</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 . '&amp;TB_iframe=true&amp;width=600&amp;height=550">' . __( 'More details...', 'wp-security-audit-log' ) . '</a>';
    502508            case 'object':
    503509                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  
    412412        public static function is_disabled_user( $user ) {
    413413            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();
    419415            }
    420416
     
    435431
    436432            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();
    438434            }
    439435
  • wp-security-audit-log/trunk/classes/Controllers/class-sensors-load-manager.php

    r2897171 r2911239  
    1515namespace WSAL\Controllers;
    1616
     17use WSAL\Helpers\WP_Helper;
    1718use WSAL\Helpers\Classes_Helper;
    1819
     
    9091            }
    9192
    92             if ( \WpSecurityAuditLog::is_login_screen() && ! is_user_logged_in() ) {
     93            if ( WP_Helper::is_login_screen() && ! is_user_logged_in() ) {
    9394                // Here we need to load only the Sensors which are login enabled.
    9495                foreach ( $sensors as $key => &$sensor ) {
  • wp-security-audit-log/trunk/classes/Entities/class-metadata-entity.php

    r2897171 r2911239  
    5757                    `value` longtext NOT NULL,
    5858                PRIMARY KEY (`id`),
    59                 KEY `occurrence_name` (`occurrence_id`,`name`)
     59                KEY `occurrence_name` (`occurrence_id`,`name`),
     60                KEY `name_value` (`name`,`value`(64))
    6061                )
    6162              ' . self::get_connection()->get_charset_collate() . ';';
     
    6364            return self::maybe_create_table( $table_name, $wp_entity_sql );
    6465        }
     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        }
    6587    }
    6688}
  • wp-security-audit-log/trunk/classes/Entities/class-occurrences-entity.php

    r2897171 r2911239  
    225225                        $sqls = 'INSERT INTO `' . Metadata_Entity::get_table_name() . "` ($fields) VALUES " . rtrim( $sqls, ',' );
    226226
     227                        self::get_connection()->suppress_errors( true );
    227228                        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 );
    228238                    }
    229239                }
    230240            }
    231241        }
     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        }
    232263    }
    233264}
  • wp-security-audit-log/trunk/classes/Helpers/class-plugins-helper.php

    r2897171 r2911239  
    88 * @since 4.5.0
    99 *
    10  * @copyright  %%YEAR%% WP White Security
     10 * @copyright  2023 WP White Security
    1111 * @license    https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
    1212 *
  • wp-security-audit-log/trunk/classes/Helpers/class-settings-helper.php

    r2897171 r2911239  
    8181
    8282        /**
     83         * Users excluded from monitoring.
     84         *
     85         * @var array
     86         *
     87         * @since 4.5.0
     88         */
     89        private static $excluded_roles = array();
     90
     91        /**
    8392         * Holds the main IP of the client.
    8493         *
     
    124133         */
    125134        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;
    126144
    127145        /**
     
    364382         */
    365383        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 );
    367385
    368386            $mirrors = array();
     
    499517                if ( self::get_boolean_option_value( 'use-proxy-ip' ) ) {
    500518                    // 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] : '';
    502522                } elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
    503523                    $ip                   = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );
     
    964984        public static function get_excluded_monitoring_users() {
    965985            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() );
    967987            }
    968988
     
    979999        public static function set_excluded_monitoring_users( $users ) {
    9801000            $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 );
    9821002
    9831003            if ( ! empty( $changes['added'] ) ) {
     
    10071027
    10081028            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;
    10101080        }
    10111081
     
    11261196
    11271197            // 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 );
    11301200            } else {
    11311201                $upload_dir = wp_upload_dir( null, false );
     
    11871257         */
    11881258        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            }
    11951268
    11961269            // Get the option.
    1197             return self::get_option_value( self::FRONT_END_EVENTS_OPTION_NAME, $default );
     1270            return self::$frontend_events;
    11981271        }
    11991272
     
    12081281         */
    12091282        public static function set_frontend_events( $value = array() ) {
     1283            self::$frontend_events = $value;
    12101284            return self::set_option_value( self::FRONT_END_EVENTS_OPTION_NAME, $value, true );
    12111285        }
  • wp-security-audit-log/trunk/classes/Helpers/class-wp-helper.php

    r2897171 r2911239  
    552552         */
    553553        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 );
    559558        }
    560559
  • wp-security-audit-log/trunk/classes/Migration/class-migration.php

    r2897171 r2911239  
    1414defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
    1515
    16 use \WSAL\Helpers\WP_Helper;
    1716use WSAL_Settings;
    1817use WSAL_Ext_MirrorLogger;
     18use \WSAL\Helpers\WP_Helper;
     19use WSAL\Helpers\Settings_Helper;
    1920
    2021/**
     
    8485            $wsal::load_freemius();
    8586            $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 );
    9787
    9888            $disabled_alerts = WP_Helper::get_global_option( 'disabled-alerts', false );
     
    123113             * @since 3.2.3.3
    124114             */
    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 ) ) {
    126116                $wsal->settings()->set_mainwp_child_stealth_mode();
    127117            }
     
    139129
    140130            // 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();
    142132            if ( array_key_exists( 'system', $frontend_events ) ) {
    143133                unset( $frontend_events['system'] );
    144                 \WSAL\Helpers\Settings_Helper::set_frontend_events( $frontend_events );
     134                Settings_Helper::set_frontend_events( $frontend_events );
    145135            }
    146136
     
    177167                $scheduled_hook_mirroring = 'wsal_run_mirroring';
    178168
    179                 $mirrors = \WSAL\Helpers\Settings_Helper::get_all_mirrors();
     169                $mirrors = Settings_Helper::get_all_mirrors();
    180170                if ( ! empty( $mirrors ) ) {
    181171                    foreach ( $mirrors as $mirror ) {
     
    243233
    244234                    if ( ! is_null( $wsal->external_db_util ) ) {
    245                         $connections = \WSAL\Helpers\Settings_Helper::get_all_connections();
     235                        $connections = Settings_Helper::get_all_connections();
    246236                        if ( ! empty( $connections ) ) {
    247237                            foreach ( $connections as $connection ) {
    248238                                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 );
    250240                                    break;
    251241                                }
     
    408398                    $mirrors_in_use = false;
    409399                    if ( ! is_null( $wsal->external_db_util ) ) {
    410                         $mirrors        = \WSAL\Helpers\Settings_Helper::get_all_mirrors();
     400                        $mirrors        = Settings_Helper::get_all_mirrors();
    411401                        $mirrors_in_use = ! empty( $mirrors );
    412402                    }
     
    427417
    428418                    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 );
    430420                    }
    431421                }
     
    495485
    496486                \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                );
    499489
    500490                // If one of the new columns exists there is no need to alter the table.
    501491                $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 )'
    505495                );
    506496                if ( ! $column_exists ) {
     
    573563            }
    574564        }
     565
    575566        /**
    576567         * Migration for version upto 4.4.3
     
    585576            if ( class_exists( 'WSAL_Ext_MirrorLogger' ) && method_exists( '\WSAL\Helpers\Settings_Helper', 'get_working_dir_path_static' ) ) {
    586577
    587                 $working_dir_path = \WSAL\Helpers\Settings_Helper::get_working_dir_path_static();
     578                $working_dir_path = Settings_Helper::get_working_dir_path_static();
    588579
    589580                if ( file_exists( $working_dir_path . WSAL_Ext_MirrorLogger::FILE_NAME_FAILED_LOGS . '.json' ) ) {
     
    599590            }
    600591        }
     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        }
    601626    }
    602627}
  • wp-security-audit-log/trunk/classes/Ref.php

    r2897171 r2911239  
    13891389                }
    13901390
    1391                 $max = max( array_map( 'static::strLen', array_keys( $subject ) ) );
     1391                $max = max( array_map( self::class . '::strLen', array_keys( $subject ) ) );
    13921392                $subject[ static::MARKER_KEY ] = true;
    13931393
     
    15291529                }
    15301530
    1531                 $max = max( array_map( 'static::strLen', array_keys( $meta ) ) );
     1531                $max = max( array_map( self::class . '::strLen', array_keys( $meta ) ) );
    15321532                foreach ( $meta as $key => $value ) {
    15331533                    $this->fmt->startRow();
     
    16661666                                $errors = \DateTime::getLastErrors();
    16671667
    1668                                 if ( ($errors['warning_count'] < 1) && ($errors['error_count'] < 1) ) {
     1668                                if ( (((int)$errors['warning_count']) < 1) && (((int)$errors['error_count']) < 1) ) {
    16691669                                    $now    = new \Datetime( 'now' );
    16701670                                    $nowUtc = new \Datetime( 'now', new \DateTimeZone( 'UTC' ) );
     
    19291929        if ( $constants ) {
    19301930            $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 ) ) );
    19321932            foreach ( $constants as $name => $value ) {
    19331933                $meta = null;
     
    29542954     */
    29552955    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 );
    29572957    }
    29582958
  • wp-security-audit-log/trunk/classes/SensorManager.php

    r2897171 r2911239  
    1414}
    1515
     16use WSAL\Helpers\WP_Helper;
    1617use \WSAL\Helpers\Classes_Helper;
    1718/**
     
    210211
    211212        // Only LogInOut and Register sensors should load on login page.
    212         if ( WpSecurityAuditLog::is_login_screen() ) {
     213        if ( WP_Helper::is_login_screen() ) {
    213214            if ( in_array( $filename, array( 'Register', 'LogInOut' ), true ) ) {
    214215                return true;
  • wp-security-audit-log/trunk/classes/Settings.php

    r2897171 r2911239  
    6767     */
    6868    protected $per_page = null;
    69 
    70     /**
    71      * Roles excluded from monitoring.
    72      *
    73      * @var array
    74      */
    75     protected $excluded_roles = array();
    7669
    7770    /**
     
    708701                $this->site_admins = $wpdb->get_col( $sql ); // phpcs:ignore
    709702            }
    710         } else {
    711             if ( empty( $this->site_admins ) ) {
     703        } elseif ( empty( $this->site_admins ) ) {
    712704                $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;
    716707            }
    717708        }
     
    942933     *
    943934     * @return string
    944     *
     935    *
    945936     * @deprecated 4.5 - Use \WSAL\Helpers\Settings_Helper::normalize_ip()
    946937     */
     
    10421033     * @deprecated 4.5 - Use \WSAL\Helpers\Settings_Helper::get_excluded_post_types()
    10431034     */
    1044     public function get_excluded_post_types(): array {
     1035    public function get_excluded_post_types(): array {
    10451036        _deprecated_function( __FUNCTION__, '4.5', '\WSAL\Helpers\Settings_Helper::get_excluded_post_types()' );
    10461037
     
    10521043     *
    10531044     * @param array $roles - Array of roles.
     1045     *
     1046     * @deprecated 4.5.1 - Use \WSAL\Helpers\Settings_Helper::set_excluded_monitoring_roles()
    10541047     */
    10551048    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 );
    10871052    }
    10881053
    10891054    /**
    10901055     * Get roles excluded from monitoring.
     1056     *
     1057     * @deprecated 4.5.1 - Use \WSAL\Helpers\Settings_Helper::get_excluded_monitoring_roles()
    10911058     */
    10921059    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();
    10981063    }
    10991064
     
    15711536            // we have no business here - the token is valid and within users, but we are looking
    15721537            // for roles
    1573             if ( false !== $type && 'ExRole' === $type  ) {
     1538            if ( false !== $type && 'ExRole' === $type ) {
    15741539
    15751540            } else {
  • wp-security-audit-log/trunk/classes/Views/AuditLog.php

    r2897171 r2911239  
    141141            'skipped' === \WSAL\Helpers\Settings_Helper::get_option_value( 'freemius_state', 'anonymous' ) )
    142142        ) {
    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.
    145145
    146146            $more_info = add_query_arg(
     
    200200        }
    201201
     202        // phpcs:disable
     203        // phpcs:enable
    202204
    203205        // Check anonymous mode.
     
    229231        $screen = get_current_screen();
    230232
     233        // phpcs:disable
     234        // phpcs:enable
    231235
    232236        if ( $is_current_view && in_array( $screen->base, array( 'toplevel_page_wsal-auditlog', 'toplevel_page_wsal-auditlog-network' ), true ) ) {
     
    243247            $predefined_plugins_check = array_column( $predefined_plugins, 'addon_for' );
    244248
     249            $plugin_filenames = array_unique( $plugin_filenames );
     250
    245251            // Loop through plugins and create an array of slugs, we will compare these against the plugins we have addons for.
    246252            $we_have_addon = array_intersect( $plugin_filenames, $predefined_plugins_check );
     
    258264
    259265                    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
    265271                        ?>
    266272                        <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 ); ?>">
     
    615621        }
    616622
     623        // phpcs:disable
     624        // phpcs:enable
    617625
    618626        $occ = new WSAL_Models_Occurrence();
     
    654662        $old = (int) $post_array['logcount'];
    655663
     664        // phpcs:disable
     665        // phpcs:enable
    656666
    657667        // Check for new total number of alerts.
     
    711721    }
    712722
     723    // phpcs:disable
     724    // phpcs:enable
    713725
    714726    /**
     
    11211133    }
    11221134
     1135    // phpcs:disable
     1136    // phpcs:enable
    11231137
    11241138    /**
  • wp-security-audit-log/trunk/classes/Views/Settings.php

    r2897171 r2911239  
    155155
    156156        // 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'] ) ) : '';
    158158        $this->current_tab = empty( $current_tab ) ? 'general' : $current_tab;
    159159    }
     
    277277     */
    278278    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
    279284        if ( ! $this->plugin->settings()->current_user_can( 'edit' ) ) {
    280285            die( 'Access Denied.' );
     
    286291
    287292        // phpcs:disable
    288         // phpcs:disable
     293        // phpcs:enable
    289294
    290295        // Calculate limit timestamp.
     
    295300        // $query->add_condition( 'created_on <= %s', intval( $max_stamp ) ); // Add limits of timestamp.
    296301        // $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 ) );
    298303        if ( $items ) {
    299304            $this->plugin->clean_up();
     
    978983            $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' );
    979984
     985            // phpcs:disable
     986            // phpcs:enable
    980987            echo wp_kses( $retention_help_text, $this->plugin->allowed_html_tags );
    981988            ?>
     
    983990
    984991        <?php
     992        // phpcs:disable
    985993        /* @free:start */
     994        // phpcs:enable
    986995        // Ensure it doesn't load a 2nd time for premium users.
    987996        if ( ! wsal_freemius()->can_use_premium_code() ) {
    988997            $this->render_retention_settings_table();
    989998        }
     999        // phpcs:disable
    9901000        /* @free:end */
     1001        // phpcs:enable
    9911002        ?>
    9921003
     
    12431254                            <br style="clear: both;"/>
    12441255                            <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 ) : ?>
    12461257                                    <span class="sectoken-<?php echo esc_attr( $this->get_token_type( $item ) ); ?>">
    12471258                                    <input type="hidden" name="ExRoles[]" value="<?php echo esc_attr( $item ); ?>"/>
     
    13681379
    13691380        \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() );
    13711382        \WSAL\Helpers\Settings_Helper::set_excluded_post_meta_fields( isset( $post_array['PostMetas'] ) ? $post_array['PostMetas'] : array() );
    13721383        \WSAL\Helpers\Settings_Helper::set_excluded_user_meta_fields( isset( $post_array['UserMetas'] ) ? $post_array['UserMetas'] : array() );
     
    17691780        // $alerts = array();
    17701781        // foreach ( $registered_alerts as $alert => $details ) {
    1771         //  $alerts[] = (string) $details->code;
     1782        // $alerts[] = (string) $details->code;
    17721783        // }
    17731784
     
    19411952                            <?php
    19421953                            foreach ( $pruning_unit_options as $option => $label ) {
    1943                                 echo '<option value="' . esc_attr( $option ) . '" ' . selected( $pruning_unit, $option, true ) . '>' . ucwords( $label ) . '</option>'; // phpcs:disable
     1954                                echo '<option value="' . esc_attr( $option ) . '" ' . selected( $pruning_unit, $option, true ) . '>' . ucwords( $label ) . '</option>'; // phpcs:ignore
    19441955                            }
    19451956                            ?>
     
    19571968                                esc_html( human_time_diff( current_time( 'timestamp' ), $next ) )
    19581969                            );
    1959                             echo '<!-- ' . esc_html( date( 'dMy H:i:s', $next ) ) . ' --> ';
     1970                            echo '<!-- ' . esc_html( gmdate( 'dMy H:i:s', $next ) ) . ' --> ';
    19601971                            echo esc_html__( 'You can run the purging process now by clicking the button below.', 'wp-security-audit-log' );
    19611972                            ?>
    19621973                        </p>
    19631974                        <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>
    19651976                        </p>
    19661977                    <?php endif; ?>
  • wp-security-audit-log/trunk/classes/WPSensors/class-wp-content-sensor.php

    r2897171 r2911239  
    16201620            $post_events = array_merge( $post_events, array_keys( Alert_Manager::get_alerts_by_sub_category( 'Coupons' ) ) );
    16211621
     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
    16221636            foreach ( $post_events as $event ) {
    16231637                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  
    1616use WSAL\Helpers\WP_Helper;
    1717use WSAL\Helpers\User_Helper;
     18use WSAL\Helpers\Settings_Helper;
    1819use WSAL\Controllers\Alert_Manager;
    1920
     
    9697        public static function is_login_sensor() {
    9798            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;
    98117        }
    99118
     
    204223            if ( self::$current_user->ID ) {
    205224                // 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();
    207226                $excluded_user_ids = array();
    208227                // convert excluded usernames into IDs.
     
    237256         */
    238257        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 );
    240259        }
    241260
     
    248267         */
    249268        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 ) );
    251270        }
    252271
     
    344363            $d = (int) $d;
    345364
    346             $ip = \WSAL\Helpers\Settings_Helper::get_main_client_ip();
     365            $ip = Settings_Helper::get_main_client_ip();
    347366
    348367            // Filter $_POST global array for security.
     
    520539         * Current user switched to another user event.
    521540         *
    522          * @since 3.4
    523          *
    524541         * @param int $new_user_id - New user id.
    525542         * @param int $old_user_id - Old user id.
     
    527544         * @since 4.5.0
    528545         */
    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 ) {
    530547            $target_user       = get_user_by( 'ID', $new_user_id );
    531548            $target_user_roles = User_Helper::get_user_roles( $target_user );
  • wp-security-audit-log/trunk/classes/WPSensors/class-wp-multisite-sensor.php

    r2897171 r2911239  
    248248            }
    249249
    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            }
    251257            $blog_url   = untrailingslashit( $home_scheme . '://' . $new_blog->domain . $new_blog->path );
    252258
  • wp-security-audit-log/trunk/classes/WPSensors/class-wp-register-sensor.php

    r2897171 r2911239  
    1515
    1616use WSAL\Helpers\WP_Helper;
     17use WSAL\Helpers\Settings_Helper;
    1718use WSAL\Controllers\Alert_Manager;
    1819
     
    7172
    7273        /**
     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        /**
    7392         * When a user registers, action 'user_register' is fired because it is part of the function 'wp_insert_user'. We
    7493         * can assume event 4000 if the current session is not logged in.
  • wp-security-audit-log/trunk/css/auditlog.css

    r2897171 r2911239  
    7878    position: absolute;
    7979    bottom: 0;
    80     right: 0;
     80    right: -100px;
    8181    width: 0;
    8282    height: 0;
     
    8888    position: absolute;
    8989    bottom: 6px;
    90     right: 6px;
     90    right: -94px;
    9191    background: white;
    9292    box-shadow: rgb(0 0 0 / 24%) 0px 3px 8px;
     
    148148
    149149.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;
    162162}
    163163
     
    498498}
    499499
     500.wp-list-table #data {
     501    width: 80px;
     502}
     503
    500504.column-crtd {
    501505    width: 135px;
     
    507511.wp-list-table.wsal-table-grid .data {
    508512    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;
    517513}
    518514
  • wp-security-audit-log/trunk/js/auditlog.js

    r2897171 r2911239  
    221221}
    222222
    223 function WsalDBChange(value) {
     223function WsalDBChange(value, nonce) {
    224224    jQuery.ajax({
    225225        type: 'POST',
     
    228228        data: {
    229229            action: 'AjaxSwitchDB',
     230            nonce: nonce,
    230231            selected_db: value
    231232        },
  • wp-security-audit-log/trunk/languages/wp-security-audit-log.pot

    r2897171 r2911239  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WP Activity Log 4.5.0\n"
     5"Project-Id-Version: WP Activity Log 4.5.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-security-audit-log\n"
    77"Last-Translator: WP White Security <info@wpwhitesecurity.com>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-04-11T09:21:04+00:00\n"
     12"POT-Creation-Date: 2023-05-11T14:19:31+00:00\n"
    1313"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"
    1515"X-Domain: wp-security-audit-log\n"
    1616
     
    3636
    3737#. translators: User's first name
    38 #: wp-security-audit-log.php:715
    39 #: wp-security-audit-log.php:743
     38#: wp-security-audit-log.php:716
     39#: wp-security-audit-log.php:744
    4040msgid "Hey %s"
    4141msgstr ""
    4242
    43 #: wp-security-audit-log.php:719
     43#: wp-security-audit-log.php:720
    4444msgid "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:720
    48 #: wp-security-audit-log.php:755
    49 msgid "Note: "
    5045msgstr ""
    5146
    5247#: wp-security-audit-log.php:721
    5348#: wp-security-audit-log.php:756
     49msgid "Note: "
     50msgstr ""
     51
     52#: wp-security-audit-log.php:722
     53#: wp-security-audit-log.php:757
    5454msgid "NO ACTIVITY LOG ACTIVITY & DATA IS SENT BACK TO OUR SERVERS."
    5555msgstr ""
    5656
    5757#. translators: 1: Plugin name. 2: Plugin name. 2: Freemius link. 4: Plugin name.
    58 #: wp-security-audit-log.php:749
     58#: wp-security-audit-log.php:750
    5959msgid "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."
    6060msgstr ""
    6161
    62 #: wp-security-audit-log.php:793
     62#: wp-security-audit-log.php:794
    6363msgid "You need to activate the licence key to use WP Activity Log Premium. %s"
    6464msgstr ""
    6565
    66 #: wp-security-audit-log.php:794
     66#: wp-security-audit-log.php:795
    6767msgid "Activate the licence key now"
    6868msgstr ""
    6969
    7070#. Translators: Expired message and time
    71 #: wp-security-audit-log.php:818
     71#: wp-security-audit-log.php:819
    7272msgid "%s You need to renew your license to continue using premium features."
    7373msgstr ""
    7474
    7575#. Translators: Number of sites
    76 #: wp-security-audit-log.php:821
     76#: wp-security-audit-log.php:822
    7777msgid "The license is limited to %s sub-sites. You need to upgrade your license to cover all the sub-sites on this network."
    7878msgstr ""
    7979
    80 #: wp-security-audit-log.php:916
     80#: wp-security-audit-log.php:917
    8181msgid "Error: You do not have sufficient permissions to disable this custom field."
    8282msgstr ""
    8383
    8484#. translators: name of meta field (in bold)
    85 #: wp-security-audit-log.php:962
     85#: wp-security-audit-log.php:963
    8686msgid "Custom field %s is no longer being monitored."
    8787msgstr ""
    8888
    8989#. translators: setting tab name "Excluded Objects"
    90 #: wp-security-audit-log.php:968
     90#: wp-security-audit-log.php:969
    9191msgid "Enable the monitoring of this custom field again from the %s tab in the plugin settings."
    9292msgstr ""
    9393
    94 #: wp-security-audit-log.php:969
     94#: wp-security-audit-log.php:970
    9595msgid "Excluded Objects"
    9696msgstr ""
    9797
    98 #: wp-security-audit-log.php:982
     98#: wp-security-audit-log.php:983
    9999msgid "Error: You do not have sufficient permissions to disable this alert."
    100100msgstr ""
    101101
    102 #: wp-security-audit-log.php:1002
     102#: wp-security-audit-log.php:1003
    103103msgid "Alert %1$s is no longer being monitored.<br /> %2$s"
    104104msgstr ""
    105105
    106 #: wp-security-audit-log.php:1004
     106#: wp-security-audit-log.php:1005
    107107msgid "You can enable this alert again from the Enable/Disable Alerts node in the plugin menu."
    108108msgstr ""
    109109
    110 #: wp-security-audit-log.php:1035
     110#: wp-security-audit-log.php:1036
    111111msgid "Installing, please wait"
    112112msgstr ""
    113113
    114 #: wp-security-audit-log.php:1036
     114#: wp-security-audit-log.php:1037
    115115msgid "Already installed"
    116116msgstr ""
    117117
    118 #: wp-security-audit-log.php:1037
     118#: wp-security-audit-log.php:1038
    119119msgid "Extension installed"
    120120msgstr ""
    121121
    122 #: wp-security-audit-log.php:1038
     122#: wp-security-audit-log.php:1039
    123123msgid "Extension activated"
    124124msgstr ""
    125125
    126 #: wp-security-audit-log.php:1039
     126#: wp-security-audit-log.php:1040
    127127msgid "Install failed"
    128128msgstr ""
    129129
    130 #: wp-security-audit-log.php:1040
     130#: wp-security-audit-log.php:1041
    131131msgid "Reloading page"
    132132msgstr ""
    133133
    134134#. Translators: %s: PHP Version
    135 #: wp-security-audit-log.php:1076
     135#: wp-security-audit-log.php:1077
    136136msgid "You are using a version of PHP that is older than %s, which is no longer supported."
    137137msgstr ""
    138138
    139 #: wp-security-audit-log.php:1078
     139#: wp-security-audit-log.php:1079
    140140msgid "Contact us on <a href=\"mailto:plugins@wpwhitesecurity.com\">plugins@wpwhitesecurity.com</a> to help you switch the version of PHP you are using."
    141141msgstr ""
    142142
    143143#. Translators: %s: Activity Log for MainWP plugin hyperlink
    144 #: wp-security-audit-log.php:1083
     144#: wp-security-audit-log.php:1084
    145145msgid "Please install the %s plugin on the MainWP dashboard."
    146146msgstr ""
    147147
    148148#. Translators: %s: Activity Log for MainWP plugin hyperlink
    149 #: wp-security-audit-log.php:1083
     149#: wp-security-audit-log.php:1084
    150150msgid "Activity Log for MainWP"
    151151msgstr ""
    152152
    153153#. Translators: %s: Getting started guide hyperlink
    154 #: wp-security-audit-log.php:1085
     154#: wp-security-audit-log.php:1086
    155155msgid "The WP Activity Log should be installed on the child sites only. Refer to the %s for more information."
    156156msgstr ""
    157157
    158158#. Translators: %s: Getting started guide hyperlink
    159 #: wp-security-audit-log.php:1085
     159#: wp-security-audit-log.php:1086
    160160msgid "getting started guide"
    161161msgstr ""
    162162
    163 #: wp-security-audit-log.php:1481
     163#: wp-security-audit-log.php:1482
    164164msgid "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."
    165165msgstr ""
    166166
    167 #: wp-security-audit-log.php:1500
     167#: wp-security-audit-log.php:1501
    168168msgid "Every 6 hours"
    169169msgstr ""
    170170
    171 #: wp-security-audit-log.php:1504
     171#: wp-security-audit-log.php:1505
    172172msgid "Every 45 minutes"
    173173msgstr ""
    174174
    175 #: wp-security-audit-log.php:1508
     175#: wp-security-audit-log.php:1509
    176176msgid "Every 30 minutes"
    177177msgstr ""
    178178
    179 #: wp-security-audit-log.php:1512
     179#: wp-security-audit-log.php:1513
    180180msgid "Every 15 minutes"
    181181msgstr ""
    182182
    183 #: wp-security-audit-log.php:1516
     183#: wp-security-audit-log.php:1517
    184184msgid "Every 10 minutes"
    185185msgstr ""
    186186
    187 #: wp-security-audit-log.php:1520
     187#: wp-security-audit-log.php:1521
    188188msgid "Every 5 minutes"
    189189msgstr ""
    190190
    191191#. translators: 1. Deprecated method name 2. Version since deprecated
    192 #: wp-security-audit-log.php:1534
     192#: wp-security-audit-log.php:1535
    193193msgid "Method %1$s is deprecated since version %2$s!"
    194194msgstr ""
  • wp-security-audit-log/trunk/nofs/lib/class-wsal-freemius.php

    r2897171 r2911239  
    8686
    8787        public function is_free_plan() {
    88         return true;
    8988            return true;
    9089        }
  • wp-security-audit-log/trunk/readme.txt

    r2897171 r2911239  
    44License: GPLv3
    55License URI: https://www.gnu.org/licenses/gpl.html
    6 Tags: activity log, security audit log, user tracking, security event log, audit trail, user activity
     6Tags: activity log, security audit log, user tracking, security event log, audit trail, user activity, changelog, history, log, website changes
    77Requires at least: 5.0
    88Tested up to: 6.2
    9 Stable tag: 4.5.0
     9Stable tag: 4.5.2
    1010Requires PHP: 7.2
    1111
     
    210210== Changelog ==
    211211
    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) =
    215213   
    216214* **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.
    228223   
    229224* **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
     234Refer 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  
    4545        $freemius_state = \WSAL\Helpers\Settings_Helper::get_option_value( 'wsal_freemius_state', 'anonymous' );
    4646        $is_anonymous   = ( 'anonymous' === $freemius_state || 'skipped' === $freemius_state );
    47         $is_premium     = true;
     47        $is_premium     = false;
    4848        $is_anonymous   = $is_premium ? false : $is_anonymous;
    4949
  • wp-security-audit-log/trunk/third-party/vendor/autoload.php

    r2897171 r2911239  
    44
    55if (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);
    218}
    229
    2310require_once __DIR__ . '/composer/autoload_real.php';
    2411
    25 return ComposerAutoloaderInit201f86ba52b29dc488d34f8e732c3d2f::getLoader();
     12return ComposerAutoloaderInite241c7387a5aac99f296110be12551fd::getLoader();
  • wp-security-audit-log/trunk/third-party/vendor/classes/wp-async-request.php

    r2897171 r2911239  
    5050    protected $data = array();
    5151    /**
    52      * Initiate new async request
     52     * Initiate new async request.
    5353     */
    5454    public function __construct()
     
    5959    }
    6060    /**
    61      * Set data used during the request
     61     * Set data used during the request.
    6262     *
    6363     * @param array $data Data.
     
    7171    }
    7272    /**
    73      * Dispatch the async request
     73     * Dispatch the async request.
    7474     *
    75      * @return array|WP_Error
     75     * @return array|WP_Error|false HTTP Response array, WP_Error on failure, or false if not attempted.
    7676     */
    7777    public function dispatch()
     
    8282    }
    8383    /**
    84      * Get query args
     84     * Get query args.
    8585     *
    8686     * @return array
     
    100100    }
    101101    /**
    102      * Get query URL
     102     * Get query URL.
    103103     *
    104104     * @return string
     
    118118    }
    119119    /**
    120      * Get post args
     120     * Get post args.
    121121     *
    122122     * @return array
     
    127127            return $this->post_args;
    128128        }
    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        );
    130137        /**
    131138         * Filters the post arguments used during an async request.
     
    136143    }
    137144    /**
    138      * Maybe handle
     145     * Maybe handle a dispatched request.
    139146     *
    140147     * Check for correct nonce and pass to handler.
     148     *
     149     * @return void|mixed
    141150     */
    142151    public function maybe_handle()
    143152    {
    144         // Don't lock up other requests while processing
     153        // Don't lock up other requests while processing.
    145154        \session_write_close();
    146155        check_ajax_referer($this->identifier, 'nonce');
    147156        $this->handle();
    148         wp_die();
     157        return $this->maybe_wp_die();
    149158    }
    150159    /**
    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.
    152180     *
    153181     * Override this method to perform any actions required
  • wp-security-audit-log/trunk/third-party/vendor/classes/wp-background-process.php

    r2897171 r2911239  
    3737     * Cron_hook_identifier
    3838     *
    39      * @var mixed
     39     * @var string
    4040     * @access protected
    4141     */
     
    4444     * Cron_interval_identifier
    4545     *
    46      * @var mixed
     46     * @var string
    4747     * @access protected
    4848     */
    4949    protected $cron_interval_identifier;
    5050    /**
    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.
    5264     */
    5365    public function __construct()
     
    6072    }
    6173    /**
    62      * Dispatch
     74     * Schedule the cron healthcheck and dispatch an async request to start processing the queue.
    6375     *
    6476     * @access public
    65      * @return void
     77     * @return array|WP_Error|false HTTP Response array, WP_Error on failure, or false if not attempted.
    6678     */
    6779    public function dispatch()
    6880    {
     81        if ($this->is_processing()) {
     82            // Process already running.
     83            return \false;
     84        }
    6985        // Schedule the cron healthcheck.
    7086        $this->schedule_event();
     
    7389    }
    7490    /**
    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.
    7694     *
    7795     * @param mixed $data Data.
     
    85103    }
    86104    /**
    87      * Save queue
     105     * Save the queued items for future processing.
    88106     *
    89107     * @return $this
     
    95113            update_site_option($key, $this->data);
    96114        }
     115        // Clean out data so that new data isn't prepended with closed session's data.
     116        $this->data = array();
    97117        return $this;
    98118    }
    99119    /**
    100      * Update queue
     120     * Update a batch's queued items.
    101121     *
    102122     * @param string $key  Key.
     
    113133    }
    114134    /**
    115      * Delete queue
     135     * Delete a batch of queued items.
    116136     *
    117137     * @param string $key Key.
     
    125145    }
    126146    /**
    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.
    128251     *
    129252     * Generates a unique key based on microtime. Queue items are
    130253     * given a unique key so that they can be merged upon save.
    131254     *
    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".
    133257     *
    134258     * @return string
    135259     */
    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 . '_';
    140264        return \substr($prepend . $unique, 0, $length);
    141265    }
    142266    /**
    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.
    144277     *
    145278     * Checks whether data exists within the queue and that
     
    148281    public function maybe_handle()
    149282    {
    150         // Don't lock up other requests while processing
     283        // Don't lock up other requests while processing.
    151284        \session_write_close();
    152         if ($this->is_process_running()) {
     285        if ($this->is_processing()) {
    153286            // 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();
    155298        }
    156299        if ($this->is_queue_empty()) {
    157300            // No data to process.
    158             wp_die();
     301            return $this->maybe_wp_die();
    159302        }
    160303        check_ajax_referer($this->identifier, 'nonce');
    161304        $this->handle();
    162         wp_die();
    163     }
    164     /**
    165      * Is queue empty
     305        return $this->maybe_wp_die();
     306    }
     307    /**
     308     * Is queue empty?
    166309     *
    167310     * @return bool
     
    169312    protected function is_queue_empty()
    170313    {
    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?
    184318     *
    185319     * Check whether the current process is already running
    186320     * in a background process.
     321     *
     322     * @return bool
     323     *
     324     * @deprecated 1.1.0 Superseded.
     325     * @see        is_processing()
    187326     */
    188327    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()
    189337    {
    190338        if (get_site_transient($this->identifier . '_process_lock')) {
     
    195343    }
    196344    /**
    197      * Lock process
     345     * Lock process.
    198346     *
    199347     * Lock the process so that multiple instances can't run simultaneously.
     
    211359    }
    212360    /**
    213      * Unlock process
     361     * Unlock process.
    214362     *
    215363     * Unlock the process so that other instances can spawn.
     
    223371    }
    224372    /**
    225      * Get batch
    226      *
    227      * @return stdClass Return the first batch from the queue
     373     * Get batch.
     374     *
     375     * @return stdClass Return the first batch of queued items.
    228376     */
    229377    protected function get_batch()
    230378    {
     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    {
    231392        global $wpdb;
     393        if (empty($limit) || !\is_int($limit)) {
     394            $limit = 0;
     395        }
    232396        $table = $wpdb->options;
    233397        $column = 'option_name';
     
    241405        }
    242406        $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.
    251433     *
    252434     * Pass each queue item to the task handler, while remaining
     
    256438    {
    257439        $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)));
    258446        do {
    259447            $batch = $this->get_batch();
     
    265453                    unset($batch->data[$key]);
    266454                }
     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);
    267461                if ($this->time_exceeded() || $this->memory_exceeded()) {
    268462                    // Batch limits reached.
     
    270464                }
    271465            }
    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)) {
    276468                $this->delete($batch->key);
    277469            }
     
    284476            $this->complete();
    285477        }
    286         wp_die();
    287     }
    288     /**
    289      * Memory exceeded
     478        return $this->maybe_wp_die();
     479    }
     480    /**
     481     * Memory exceeded?
    290482     *
    291483     * Ensures the batch process never exceeds 90%
     
    306498    }
    307499    /**
    308      * Get memory limit
     500     * Get memory limit in bytes.
    309501     *
    310502     * @return int
     
    325517    }
    326518    /**
    327      * Time exceeded.
     519     * Time limit exceeded?
    328520     *
    329521     * Ensures the batch never exceeds a sensible time limit.
     
    343535    }
    344536    /**
    345      * Complete.
     537     * Complete processing.
    346538     *
    347539     * Override if applicable, but ensure that the below actions are
     
    350542    protected function complete()
    351543    {
    352         // Unschedule the cron healthcheck.
     544        delete_site_option($this->get_status_key());
     545        // Remove the cron healthcheck job from the cron schedule.
    353546        $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.
    357558     *
    358559     * @access public
     
    364565    public function schedule_cron_healthcheck($schedules)
    365566    {
    366         $interval = apply_filters($this->identifier . '_cron_interval', 5);
     567        $interval = apply_filters($this->cron_interval_identifier, 5);
    367568        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);
    372578        return $schedules;
    373579    }
    374580    /**
    375      * Handle cron healthcheck
     581     * Handle cron healthcheck event.
    376582     *
    377583     * Restart the background process if not already running
     
    380586    public function handle_cron_healthcheck()
    381587    {
    382         if ($this->is_process_running()) {
     588        if ($this->is_processing()) {
    383589            // Background process already running.
    384590            exit;
     
    389595            exit;
    390596        }
    391         $this->handle();
    392         exit;
    393     }
    394     /**
    395      * Schedule event
     597        $this->dispatch();
     598    }
     599    /**
     600     * Schedule the cron healthcheck event.
    396601     */
    397602    protected function schedule_event()
     
    402607    }
    403608    /**
    404      * Clear scheduled event
     609     * Clear scheduled cron healthcheck event.
    405610     */
    406611    protected function clear_scheduled_event()
     
    412617    }
    413618    /**
    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()
    418625     */
    419626    public function cancel_process()
    420627    {
    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.
    429632     *
    430633     * Override this method to perform any actions required on each
  • wp-security-audit-log/trunk/third-party/vendor/composer/ClassLoader.php

    r2897171 r2911239  
    4343class ClassLoader
    4444{
    45     /** @var \Closure(string):void */
    46     private static $includeFile;
    47 
    4845    /** @var ?string */
    4946    private $vendorDir;
     
    110107    {
    111108        $this->vendorDir = $vendorDir;
    112         self::initializeIncludeClosure();
    113109    }
    114110
     
    430426    {
    431427        if ($file = $this->findFile($class)) {
    432             $includeFile = self::$includeFile;
    433             $includeFile($file);
     428            includeFile($file);
    434429
    435430            return true;
     
    561556        return false;
    562557    }
    563 
    564     /**
    565      * @return void
    566      */
    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 $file
    579          * @return void
    580          */
    581         self::$includeFile = \Closure::bind(static function($file) {
    582             include $file;
    583         }, null, null);
    584     }
    585558}
     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 */
     569function includeFile($file)
     570{
     571    include $file;
     572}
  • wp-security-audit-log/trunk/third-party/vendor/composer/autoload_real.php

    r2897171 r2911239  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit201f86ba52b29dc488d34f8e732c3d2f
     5class ComposerAutoloaderInite241c7387a5aac99f296110be12551fd
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit201f86ba52b29dc488d34f8e732c3d2f', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInite241c7387a5aac99f296110be12551fd', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInit201f86ba52b29dc488d34f8e732c3d2f', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInite241c7387a5aac99f296110be12551fd', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInit201f86ba52b29dc488d34f8e732c3d2f::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInite241c7387a5aac99f296110be12551fd::getInitializer($loader));
    3131
    3232        $loader->setClassMapAuthoritative(true);
  • wp-security-audit-log/trunk/third-party/vendor/composer/autoload_static.php

    r2897171 r2911239  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit201f86ba52b29dc488d34f8e732c3d2f
     7class ComposerStaticInite241c7387a5aac99f296110be12551fd
    88{
    99    public static $classMap = array (
     
    1616    {
    1717        return \Closure::bind(function () use ($loader) {
    18             $loader->classMap = ComposerStaticInit201f86ba52b29dc488d34f8e732c3d2f::$classMap;
     18            $loader->classMap = ComposerStaticInite241c7387a5aac99f296110be12551fd::$classMap;
    1919
    2020        }, null, ClassLoader::class);
  • wp-security-audit-log/trunk/third-party/vendor/wp-background-processing.php

    r2897171 r2911239  
    1010/*
    1111Plugin Name: WP Background Processing
    12 Plugin URI: https://github.com/A5hleyRich/wp-background-processing
     12Plugin URI: https://github.com/deliciousbrains/wp-background-processing
    1313Description: Asynchronous requests and background processing in WordPress.
    1414Author: Delicious Brains Inc.
    1515Version: 1.0
    1616Author URI: https://deliciousbrains.com/
    17 GitHub Plugin URI: https://github.com/A5hleyRich/wp-background-processing
     17GitHub Plugin URI: https://github.com/deliciousbrains/wp-background-processing
    1818GitHub Branch: master
    1919*/
  • wp-security-audit-log/trunk/vendor/autoload.php

    r2897171 r2911239  
    44
    55if (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);
    218}
    229
    2310require_once __DIR__ . '/composer/autoload_real.php';
    2411
    25 return ComposerAutoloaderInitd9d3dcc1572b67d66b72324849a8befc::getLoader();
     12return ComposerAutoloaderInita2507426f604506cb47388e3fa33b5f5::getLoader();
  • wp-security-audit-log/trunk/vendor/composer/ClassLoader.php

    r2897171 r2911239  
    4343class ClassLoader
    4444{
    45     /** @var \Closure(string):void */
    46     private static $includeFile;
    47 
    4845    /** @var ?string */
    4946    private $vendorDir;
     
    110107    {
    111108        $this->vendorDir = $vendorDir;
    112         self::initializeIncludeClosure();
    113109    }
    114110
     
    430426    {
    431427        if ($file = $this->findFile($class)) {
    432             $includeFile = self::$includeFile;
    433             $includeFile($file);
     428            includeFile($file);
    434429
    435430            return true;
     
    561556        return false;
    562557    }
    563 
    564     /**
    565      * @return void
    566      */
    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 $file
    579          * @return void
    580          */
    581         self::$includeFile = \Closure::bind(static function($file) {
    582             include $file;
    583         }, null, null);
    584     }
    585558}
     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 */
     569function includeFile($file)
     570{
     571    include $file;
     572}
  • wp-security-audit-log/trunk/vendor/composer/autoload_classmap.php

    r2897171 r2911239  
    1212    'RHtmlFormatter' => $baseDir . '/classes/Ref.php',
    1313    'RTextFormatter' => $baseDir . '/classes/Ref.php',
     14    'Tools\\Select2_WPWS' => $baseDir . '/classes/Select2/class-select2-wpws.php',
    1415    'WSAL\\Actions\\Pluging_Installer' => $baseDir . '/classes/Actions/class-plugin-installer.php',
    1516    'WSAL\\Adapter\\WSAL_Adapters_MySQL_ActiveRecord' => $baseDir . '/classes/Adapters/MySQL/ActiveRecordAdapter.php',
  • wp-security-audit-log/trunk/vendor/composer/autoload_files.php

    r2897171 r2911239  
    88return array(
    99    '2007ccaa29a9efd0493ee82176c977d1' => $vendorDir . '/wpwhitesecurity/import-export-plugin-settings/SettingsImportExport.php',
    10     'ed8f7d07f343dc9e7c5d31cc6cd4019b' => $vendorDir . '/wpwhitesecurity/select2-wpwhitesecurity/load.php',
    1110);
  • wp-security-audit-log/trunk/vendor/composer/autoload_real.php

    r2897171 r2911239  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitd9d3dcc1572b67d66b72324849a8befc
     5class ComposerAutoloaderInita2507426f604506cb47388e3fa33b5f5
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInitd9d3dcc1572b67d66b72324849a8befc', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInita2507426f604506cb47388e3fa33b5f5', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInitd9d3dcc1572b67d66b72324849a8befc', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInita2507426f604506cb47388e3fa33b5f5', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInitd9d3dcc1572b67d66b72324849a8befc::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInita2507426f604506cb47388e3fa33b5f5::getInitializer($loader));
    3131
    3232        $loader->register(true);
    3333
    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);
    4437        }
    4538
     
    4740    }
    4841}
     42
     43/**
     44 * @param string $fileIdentifier
     45 * @param string $file
     46 * @return void
     47 */
     48function 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  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitd9d3dcc1572b67d66b72324849a8befc
     7class ComposerStaticInita2507426f604506cb47388e3fa33b5f5
    88{
    99    public static $files = array (
    1010        '2007ccaa29a9efd0493ee82176c977d1' => __DIR__ . '/..' . '/wpwhitesecurity/import-export-plugin-settings/SettingsImportExport.php',
    11         'ed8f7d07f343dc9e7c5d31cc6cd4019b' => __DIR__ . '/..' . '/wpwhitesecurity/select2-wpwhitesecurity/load.php',
    1211    );
    1312
     
    3736        'RHtmlFormatter' => __DIR__ . '/../..' . '/classes/Ref.php',
    3837        'RTextFormatter' => __DIR__ . '/../..' . '/classes/Ref.php',
     38        'Tools\\Select2_WPWS' => __DIR__ . '/../..' . '/classes/Select2/class-select2-wpws.php',
    3939        'WSAL\\Actions\\Pluging_Installer' => __DIR__ . '/../..' . '/classes/Actions/class-plugin-installer.php',
    4040        'WSAL\\Adapter\\WSAL_Adapters_MySQL_ActiveRecord' => __DIR__ . '/../..' . '/classes/Adapters/MySQL/ActiveRecordAdapter.php',
     
    179179    {
    180180        return \Closure::bind(function () use ($loader) {
    181             $loader->prefixLengthsPsr4 = ComposerStaticInitd9d3dcc1572b67d66b72324849a8befc::$prefixLengthsPsr4;
    182             $loader->prefixDirsPsr4 = ComposerStaticInitd9d3dcc1572b67d66b72324849a8befc::$prefixDirsPsr4;
    183             $loader->classMap = ComposerStaticInitd9d3dcc1572b67d66b72324849a8befc::$classMap;
     181            $loader->prefixLengthsPsr4 = ComposerStaticInita2507426f604506cb47388e3fa33b5f5::$prefixLengthsPsr4;
     182            $loader->prefixDirsPsr4 = ComposerStaticInita2507426f604506cb47388e3fa33b5f5::$prefixDirsPsr4;
     183            $loader->classMap = ComposerStaticInita2507426f604506cb47388e3fa33b5f5::$classMap;
    184184
    185185        }, null, ClassLoader::class);
  • wp-security-audit-log/trunk/vendor/composer/installed.json

    r2897171 r2911239  
    33        {
    44            "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",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/deliciousbrains/wp-background-processing.git",
    10                 "reference": "2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800"
     10                "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d"
    1111            },
    1212            "dist": {
    1313                "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",
    1616                "shasum": ""
    1717            },
    1818            "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"
    2027            },
    2128            "suggest": {
    2229                "coenjacobs/mozart": "Easily wrap this library with your own prefix, to prevent collisions when multiple plugins use this library"
    2330            },
    24             "time": "2020-07-31T07:00:11+00:00",
     31            "time": "2023-04-18T12:32:25+00:00",
    2532            "type": "library",
    2633            "installation-source": "dist",
     
    4350            "support": {
    4451                "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"
    4653            },
    4754            "install-path": "../deliciousbrains/wp-background-processing"
     
    4956        {
    5057            "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",
    5360            "source": {
    5461                "type": "git",
    5562                "url": "https://github.com/Freemius/wordpress-sdk.git",
    56                 "reference": "095fc9ced29efef5b18f9b7242bb80b0b4ac6aff"
     63                "reference": "78b876e227905373b94fecdd5e5449bcc4d63407"
    5764            },
    5865            "dist": {
    5966                "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",
    6269                "shasum": ""
    6370            },
     
    6572                "php": ">=5.2"
    6673            },
    67             "time": "2023-03-28T10:40:38+00:00",
     74            "time": "2023-04-24T06:32:35+00:00",
    6875            "type": "library",
    6976            "installation-source": "dist",
     
    8592            "support": {
    8693                "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"
    8895            },
    8996            "install-path": "../freemius/wordpress-sdk"
     
    9198        {
    9299            "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",
    95102            "source": {
    96103                "type": "git",
    97104                "url": "https://github.com/woocommerce/action-scheduler.git",
    98                 "reference": "9533e71b0eba4a519721dde84a34dfb161f11eb8"
     105                "reference": "1373570a9ee03a0be31c73df086d1e4343a27347"
    99106            },
    100107            "dist": {
    101108                "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",
    104111                "shasum": ""
    105112            },
     
    110117                "yoast/phpunit-polyfills": "^1.0"
    111118            },
    112             "time": "2023-01-17T20:20:43+00:00",
     119            "time": "2023-05-10T19:25:40+00:00",
    113120            "type": "wordpress-plugin",
    114121            "extra": {
     
    128135            "support": {
    129136                "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"
    131138            },
    132139            "install-path": "../woocommerce/action-scheduler"
     
    170177            },
    171178            "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"
    211179        }
    212180    ],
  • wp-security-audit-log/trunk/vendor/composer/installed.php

    r2897171 r2911239  
    1212    'versions' => array(
    1313        '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',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../deliciousbrains/wp-background-processing',
     
    2121        ),
    2222        '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',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../freemius/wordpress-sdk',
     
    3030        ),
    3131        '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',
    3535            'type' => 'wordpress-plugin',
    3636            'install_path' => __DIR__ . '/../woocommerce/action-scheduler',
     
    5656            'dev_requirement' => false,
    5757        ),
    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         ),
    6758    ),
    6859);
  • wp-security-audit-log/trunk/wp-security-audit-log.php

    r2897171 r2911239  
    33 * WP Activity Log.
    44 *
    5  * @copyright Copyright (C) 2013-%%YEAR%%, WP White Security - support@wpwhitesecurity.com
     5 * @copyright Copyright (C) 2013-2023, WP White Security - support@wpwhitesecurity.com
    66 * @license   http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 or higher
    77 *
    88 * @wordpress-plugin
    99 * Plugin Name: WP Activity Log
    10  * Version:     4.5.0
     10 * Version:     4.5.2
    1111 * Plugin URI:  https://wpactivitylog.com/
    1212 * 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.
     
    5656
    5757if ( ! defined( 'WSAL_PREFIX' ) ) {
    58     define( 'WSAL_VERSION', '4.5.0' );
     58    define( 'WSAL_VERSION', '4.5.2' );
    5959    define( 'WSAL_PREFIX', 'wsal_' );
    6060    define( 'WSAL_PREFIX_PAGE', 'wsal-' );
     
    8686}
    8787
     88/**
     89 * Connections Prefix.
     90 */
     91if ( ! defined( 'WSAL_CONN_PREFIX' ) ) {
     92    define( 'WSAL_CONN_PREFIX', 'connection-' );
     93}
     94if ( ! defined( 'WSAL_MIRROR_PREFIX' ) ) {
     95    define( 'WSAL_MIRROR_PREFIX', 'mirror-' );
     96}
     97
    8898/* @free:start */
    8999if ( ! function_exists( 'wsal_disable_freemius_on_free' ) ) {
     
    237247
    238248                add_action(
    239                     $bootstrap_hook[0],
     249                    'init',
    240250                    function() {
    241251                        WSAL\Controllers\Alert_Manager::init();
     
    304314            public static function is_frontend() {
    305315                return ! is_admin()
    306                     && ! self::is_login_screen()
     316                    && ! WP_Helper::is_login_screen()
    307317                    && ( ! defined( 'WP_CLI' ) || ! WP_CLI )
    308318                    && ( ! defined( 'DOING_CRON' ) || ! DOING_CRON )
     
    318328            public static function is_frontend_page() {
    319329                return ! is_admin()
    320                     && ! self::is_login_screen()
     330                    && ! WP_Helper::is_login_screen()
    321331                    && ( ! defined( 'WP_CLI' ) || ! WP_CLI )
    322332                    && ( ! defined( 'DOING_CRON' ) || ! DOING_CRON )
     
    497507
    498508            /**
    499              * Whether the current page is the login screen.
    500              *
    501              * @return bool
    502              */
    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:ignore
    505             }
    506 
    507             /**
    508509             * Load Freemius SDK.
    509510             */
     
    594595                }
    595596
    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 ) ) {
    597598
    598599                    self::load_freemius();
     
    842843                // $this->sensors = new WSAL_SensorManager( $this );
    843844
    844                 Sensors_Load_Manager::load_sensors();
     845                // Sensors_Load_Manager::load_sensors();
    845846
    846847                if ( is_admin() ) {
     
    11111112                // run any installs.
    11121113                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();
    11151116
    11161117
Note: See TracChangeset for help on using the changeset viewer.