true, 'checked' => 0 ); } $limit = max( 1, (int) $limit ); $rows = APWPM_DB::get_logs_for_verify( $limit ); $prev = ''; foreach ( (array) $rows as $row ) { $copy = $row; unset( $copy['id'], $copy['row_hash'] ); $copy['prev_hash'] = $prev; $expected = self::hash( $copy ); if ( ! hash_equals( $expected, (string) $row['row_hash'] ) ) { return array( 'ok' => false, 'broken_at' => (int) $row['id'], 'checked' => count( $rows ), ); } $prev = $row['row_hash']; } return array( 'ok' => true, 'checked' => count( $rows ) ); } }