Skip to content

Commit

Permalink
Merge pull request #541 from alicolville/10.3.4
Browse files Browse the repository at this point in the history
10.3.4
  • Loading branch information
alicolville authored Dec 30, 2022
2 parents 4a7d700 + 84c5654 commit e1e8fc1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions includes/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,20 +256,20 @@ function ws_ls_ajax_user_search() {

foreach ( $users as $user ) {

$user_meta = get_user_meta( $user->id );
$user_meta = get_user_meta( $user->ID );
$user_meta = (array) $user_meta;

$name = sprintf( '%s %s', get_user_meta( $user->id, 'first_name', true ), get_user_meta( $user->id, 'last_name', true ) );
$name = sprintf( '%s %s', get_user_meta( $user->ID, 'first_name', true ), get_user_meta( $user->ID, 'last_name', true ) );

if ( true === empty( $name ) || ' ' == $name ) {
$name = $user->user_nicename;
} else {
$name = sprintf( '%s (%s)', $name, $user->user_nicename );
}

$data[] = [ 'id' => $user->id,
$data[] = [ 'id' => $user->ID,
'title' => $name,
'detail' => $user->user_email .$user_meta->first_name
'detail' => $user->user_email
];
}

Expand Down
6 changes: 4 additions & 2 deletions includes/shortcode-various.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ function ws_ls_shortcode_difference_in_weight_previous_latest( $user_defined_arg
]
, $user_defined_arguments );

if ( $cache = ws_ls_cache_user_get( $arguments[ 'user-id' ], 'shortcode-target' ) ) {
$cache_key = 'shortcode-diff-prev-latest-' . md5( json_encode( $arguments ) );

if ( $cache = ws_ls_cache_user_get( $arguments[ 'user-id' ], $cache_key ) ) {
return $cache;
}

Expand Down Expand Up @@ -149,7 +151,7 @@ function ws_ls_shortcode_difference_in_weight_previous_latest( $user_defined_arg
}
}

ws_ls_cache_user_set( $arguments[ 'user-id' ], 'shortcode-latets-previous', $output );
ws_ls_cache_user_set( $arguments[ 'user-id' ], $cache_key, $output );

return $output;
}
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: aliakro
Tags: weight,tracker,chart,bmi,bmr,macronutrient,measure,awards,custom fields,history,measurements,data
Requires at least: 5.7
Tested up to: 6.1.1
Stable tag: 10.3.3
Stable tag: 10.3.4
Requires PHP: 7.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -152,6 +152,12 @@ Measurements are created using Custom Fields. You can therefore specify the unit

== Changelog ==

= 10.3.4 =

* Maintenance: Removed reference to deprecated WP functionality (WP_User->id).
* Bug fix: Removed invalid reference to "$user_meta->first_name".
* Bug fix: Corrected caching issue with "Latest Weight" component / shortcode.

= 10.3.3 =

* Improvement: Added a new summary box component "user-id". Read more https://docs.yeken.uk/components.html
Expand Down
4 changes: 2 additions & 2 deletions weight-loss-tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Plugin Name: Weight Tracker
* Description: Allow your users to track their weight, body measurements, photos and other pieces of custom data. Display in charts, tables, shortcodes and widgets. Manage their data, issue awards, email notifications, etc! Provide advanced data on Body Mass Index (BMI), Basal Metabolic Rate (BMR), Calorie intake, Harris Benedict Formula, Macronutrients Calculator and more.
* Version: 10.3.3
* Version: 10.3.4
* Requires at least: 5.7
* Tested up to: 6.1.1
* Requires PHP: 7.2
Expand All @@ -18,7 +18,7 @@
*/

define( 'WS_LS_ABSPATH', plugin_dir_path( __FILE__ ) );
define( 'WE_LS_CURRENT_VERSION', '10.3.3' );
define( 'WE_LS_CURRENT_VERSION', '10.3.4' );
define( 'WE_LS_TITLE', 'Weight Tracker' );
define( 'WE_LS_SLUG', 'weight-loss-tracker' );
define( 'WE_LS_LICENSE_TYPES_URL', 'https://docs.yeken.uk/features.html' );
Expand Down

0 comments on commit e1e8fc1

Please sign in to comment.