Skip to content

Commit

Permalink
Merge pull request #1234 from xwp/release/3.7.0
Browse files Browse the repository at this point in the history
Release 3.7.0
  • Loading branch information
kasparsd authored May 11, 2021
2 parents a8b5f46 + dea5ff4 commit 29ad0f7
Show file tree
Hide file tree
Showing 20 changed files with 1,981 additions and 1,874 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ services:
- docker

before_install:
- docker-compose pull wordpress
- echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker-compose pull
- nvm install
- nvm use
# Lock to Composer version 1 for now.
Expand Down
6 changes: 4 additions & 2 deletions alerts/class-alert-type-highlight.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ public function save_fields( $alert ) {
* @return array New list of classes.
*/
public function post_class( $classes, $record ) {
if ( ! empty( $record->meta['wp_stream_alerts_triggered']['highlight']['highlight_color'] ) ) {
$color = $record->meta['wp_stream_alerts_triggered']['highlight']['highlight_color'];
$record = new Record( $record );
$alerts_triggered = $record->get_meta( Alerts::ALERTS_TRIGGERED_META_KEY, true );
if ( ! empty( $alerts_triggered[ $this->slug ]['highlight_color'] ) ) {
$color = $alerts_triggered[ $this->slug ]['highlight_color'];
}

if ( empty( $color ) || ! is_string( $color ) ) {
Expand Down
2 changes: 1 addition & 1 deletion classes/class-alerts-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct( $plugin ) {
* @return array
*/
public function parse_request( $query_vars ) {
$screen = get_current_screen();
$screen = \get_current_screen();
if ( 'edit-wp_stream_alerts' === $screen->id && Alerts::POST_TYPE === $query_vars['post_type'] && empty( $query_vars['post_status'] ) ) {
$query_vars['post_status'] = array( 'wp_stream_enabled', 'wp_stream_disabled' );
}
Expand Down
10 changes: 6 additions & 4 deletions classes/class-log.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,23 +242,25 @@ public function is_record_excluded( $connector, $context, $action, $user = null,
* @return boolean
*/
public function record_matches_rules( $record, $exclude_rules ) {
$matches_needed = count( $exclude_rules );
$matches_found = 0;
foreach ( $exclude_rules as $exclude_key => $exclude_value ) {
if ( ! isset( $record[ $exclude_key ] ) ) {
if ( ! isset( $record[ $exclude_key ] ) || is_null( $exclude_value ) ) {
continue;
}

if ( 'ip_address' === $exclude_key ) {
$ip_addresses = explode( ',', $exclude_value );

if ( in_array( $record['ip_address'], $ip_addresses, true ) ) {
return true;
$matches_found++;
}
} elseif ( $record[ $exclude_key ] === $exclude_value ) {
return true;
$matches_found++;
}
}

return false;
return $matches_found === $matches_needed;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/class-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Plugin {
*
* @const string
*/
const VERSION = '3.6.2';
const VERSION = '3.7.0';

/**
* WP-CLI command
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"wp-phpunit/wp-phpunit": "^5.4",
"wpackagist-plugin/advanced-custom-fields": "5.8.12",
"wpackagist-plugin/easy-digital-downloads": "^2.9.23",
"wpackagist-plugin/jetpack": "^8.7",
"wpackagist-plugin/user-switching": "^1.5.5",
"wpsh/local": "^0.2.3"
},
Expand Down
113 changes: 69 additions & 44 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 29ad0f7

Please sign in to comment.