Skip to content

Commit

Permalink
Merge pull request #750 from WordPoints/release/2.4.1
Browse files Browse the repository at this point in the history
2.4.1
  • Loading branch information
JDGrimes authored Nov 13, 2017
2 parents b0874ba + 425120c commit 7777c90
Show file tree
Hide file tree
Showing 18 changed files with 305 additions and 268 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ This is the developer changelog for WordPoints. For a user-centric changelog, se

Nothing documented yet.

## [2.4.1] - 2017-11-13

### Fixed

- More fatal errors when viewing the points logs after deactivating the BuddyPress plugin. #745
- Fatal errors when a rank type is not known. #744
- Stale extension data not being refreshed when after activating the extension's license. #749

## [2.4.0] - 2017-10-26

### Requires
Expand Down Expand Up @@ -525,6 +533,7 @@ Nothing documented yet.
- Notices for ophaned comments in comment points hooks. #436

[unreleased]: https://github.com/WordPoints/wordpoints/compare/master...develop
[2.4.1]: https://github.com/WordPoints/wordpoints/compare/2.4.0...2.4.1
[2.4.0]: https://github.com/WordPoints/wordpoints/compare/2.3.0...2.4.0
[2.3.0]: https://github.com/WordPoints/wordpoints/compare/2.2.2...2.3.0
[2.2.2]: https://github.com/WordPoints/wordpoints/compare/2.2.1...2.2.2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wordpoints",
"version": "2.4.0",
"version": "2.4.1",
"description": "Gamify your WordPress site with points.",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions src/admin/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,7 @@ function wordpoints_admin_save_extension_licenses( $extensions ) {
if ( true === $result ) {
wordpoints_show_admin_message( esc_html__( 'License activated.', 'wordpoints' ) );
$extension_data->set( 'license_key', $license_key );
wordpoints_check_for_extension_updates_now();
} elseif ( is_wp_error( $result ) ) {
// translators: Error message.
wordpoints_show_admin_error( sprintf( esc_html__( 'Sorry, there was an error while trying to activate the license: %s', 'wordpoints' ), $result->get_error_message() ) );
Expand Down
4 changes: 2 additions & 2 deletions src/components/points/classes/logs/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ protected function logs() {

foreach ( $this->logs as $log ) {

if ( isset( $current_site_id ) && $current_site_id !== $log->blog_id ) {
if ( isset( $current_site_id ) && $current_site_id !== (int) $log->blog_id ) {
switch_to_blog( $log->blog_id );
$current_site_id = $log->blog_id;
$current_site_id = (int) $log->blog_id;
}

$this->restriction = $viewing_restrictions->get_restriction( $log );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function applies() {
*/
public function user_can( $user_id ) {

if ( $this->log->blog_id && get_current_blog_id() !== $this->log->blog_id ) {
if ( $this->log->blog_id && get_current_blog_id() !== (int) $this->log->blog_id ) {
$switched = switch_to_blog( $this->log->blog_id );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function get_restriction( $log ) {
*/
public function apply_legacy_filters( $user_id, $log ) {

if ( $log->blog_id && get_current_blog_id() !== $log->blog_id ) {
if ( $log->blog_id && get_current_blog_id() !== (int) $log->blog_id ) {
$switched = switch_to_blog( $log->blog_id );
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/points/includes/logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ function wordpoints_flush_points_logs_caches( $args = array() ) {
function wordpoints_user_can_view_points_log( $user_id, $log ) {

// We do this just once here for optimization, as otherwise it would run 3 times.
if ( $log->blog_id && get_current_blog_id() !== $log->blog_id ) {
if ( $log->blog_id && get_current_blog_id() !== (int) $log->blog_id ) {
$switched = switch_to_blog( $log->blog_id );
}

Expand Down
16 changes: 16 additions & 0 deletions src/components/ranks/classes/rank/type.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ final public function maybe_increase_user_rank( $user_id, $rank, array $args = a

$rank_type = WordPoints_Rank_Types::get_type( $next_rank->type );

if ( ! $rank_type ) {
return $rank;
}

if ( ! $rank_type->can_transition_user_rank( $user_id, $next_rank, $args ) ) {
return $rank;
}
Expand Down Expand Up @@ -300,6 +304,10 @@ public function maybe_increase_user_ranks( array $user_ids, WordPoints_Rank $ran

$rank_type = WordPoints_Rank_Types::get_type( $next_rank->type );

if ( ! $rank_type ) {
return array();
}

// If the rank type supports bulk increases, use that.
if ( $rank_type instanceof WordPoints_Rank_Type_Bulk_CheckI ) {

Expand Down Expand Up @@ -354,6 +362,10 @@ final public function maybe_decrease_user_rank( $user_id, $rank, array $args = a

$rank_type = WordPoints_Rank_Types::get_type( $rank->type );

if ( ! $rank_type ) {
return $rank;
}

if ( $rank_type->can_transition_user_rank( $user_id, $rank, $args ) ) {
return $rank;
}
Expand Down Expand Up @@ -388,6 +400,10 @@ public function maybe_decrease_user_ranks( array $user_ids, WordPoints_Rank $ran

$rank_type = WordPoints_Rank_Types::get_type( $rank->type );

if ( ! $rank_type ) {
return array();
}

// If the rank type supports bulk checks, use that.
if ( $rank_type instanceof WordPoints_Rank_Type_Bulk_CheckI ) {

Expand Down
2 changes: 1 addition & 1 deletion src/includes/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @const WORDPOINTS_VERSION
*/
define( 'WORDPOINTS_VERSION', '2.4.0' );
define( 'WORDPOINTS_VERSION', '2.4.1' );

/**
* The full path to the plugin's main directory.
Expand Down
Binary file modified src/languages/wordpoints-es_ES.mo
Binary file not shown.
Loading

0 comments on commit 7777c90

Please sign in to comment.