- Improvement: Added additional argument for [wlt] shortcode that disables the check to see if [wlt] has already been placed on the page. Some users (and clashing plugins) were causing it to fail.
- Bug fix: Allow decimal entries for pounds (when in stones and pounds).
- Bug fix: When display comparison values, a rounding to one decimal place was causing the difference values to be slightly out. This has been changed to two decimals.
- Improvement: Refactored User preferences code so it can be extended.
- Improvement: Added new filters “wlt-filter-admin-user-sidebar-top”, “wlt-filter-admin-user-sidebar-middle” and “wlt-filter-admin-user-sidebar-bottom” to allow developers to add HTML to user sidebar in “Manage Data”.
- Improvement: Added new filter “wlt-filter-js-ws-ls-config” to allow developers to filter JS config.
- Improvement: Added new filter “wlt-filter-user-settings-below-aim” to allow developers to add to the User settings page.
- Improvement: Added the filters ‘wlt-filter-user-settings-db-formats’ and ‘wlt-filter-user-settings-save-fields’ to allow a developer to save other user preference fields.
- Bug fix: Stopped [wlt-calories] and [wlt-macronutrients] throwing an error when the user was logged out. Thanks @MARKONEX
- Big fix: Fixed a bug where “Your modifications have been saved” message was always being shown on [wlt-table] shortcode.
- Database schema changes for future releases.
I recently created a site called TrackYourWeight.co.uk and as outlined here, it serves as a demo site as well as a tool for real people! Building the site, gave me the opportunity to the plugin in the way a web developer / customer would. One feature I found missing that would benefit the plugin was a “Registration Wizard”. Ideally, before allowing people full use of the site, I wanted them to complete a three step sign up process. This process will ensure the user completed their “About You” fields, latest weight and finally their target.
So, using the new [wlt-if] shortcode I started by building a “Registration Wizard” page! The page would have three steps:
- Step 1: Complete “About You” fields.
- Step 2: Set your target weight.
- Step 3: Enter your current weight.
The new [wlt-if] shortcode is a clever and not well publicised shortcode. In essence, it allows you to show and hide content depending on whether a Weight Tracker field has been populated. So using the brief above, I was able to develop a wizard page (paste this into the content section of a WordPress page):
(the above code can be copied from this GistHub page)
The content contains three nested [wlt-if] statements. The first statement ensures Height, Date of Birth, Activity Level and Gender have been specified. If they haven’t, Step 1 is shown of the wizard – the User Settings form. When the page reloads, the second [wlt-if] checks if the user has specified a Target Weight – if not, the target form is displayed. The third and final [wlt-if] checks whether or not a Weight entry has been added – in the event it hasn’t the weight entry form is displayed. Finally, if everything has been completed, a [wlt-progress-bar] is shown!
Of course, this relies on the person staying on the wizard page. They could easily click away and never come back – defeating the point of the Wizard! So, I went onto write a little bit of code to put in my theme’s functions.php:
The code (can be copied from this gist) is simple really. On every page load in the front-end several checks are performed. If it’s deemed necessary the user is redirected back to wizard page. Some notes:
- Line 15 checks the user is not on the wizard page, but they are on a page or post and they are logged in. If this isn’t the case, we ignore the visit and do no further work.
- Line 20 does the hard work, the function ws_ls_shortcode_if_value_exist() checks whether the user is logged in and has entered the relevant fields. If not, they are redirected back to the wizard url.
- Remember to modify line 15 and replace /wizard/ with your page slug e.g /the-slug-of-your-wizard-page/
- Modify line 21 to include the URL to your Wizard page.
If you have any questions, please pop them into the forum! 🙂
- Improvement: Added a new “About You” field called “Aim”. This allows the user (or Admin) to specify their aim e.g. maintain, gain, or lose weight.
- Improvement: Expanded [wlt-if] to include a new field of “aim”. Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Calorie caps can now be disabled by setting them to 0.
- Improvement: jQuery validation added to prompt the user to upload a smaller image if above file size limit.
- Improvement: New setting to limit the file size of images being uploaded.
- Improvement: Added check to ensure [wlt] shortcode is only placed once on a page or post.
- Improvement: An email is set to the Admin email address when the license expires.
- Improvement: License expire notifications are now sent to YeKen.
- Improvement: New hook “wlt-hook-license-expired” is fired when a license expires.
- Improvement: Removed setting “Advanced data tables?”. This has been moved onto the shortcode themselves. See [wlt] argument “disable-advanced-tables”. Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Removed setting “Display in tabs?”. This has been moved onto the shortcode themselves. See [wlt] argument “disable-tabs”. Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Merged and tidied up “User Experience” and “General” setting tabs.
- Improvement: Updated Chart.js to 2.7.0. Read more: https://github.com/chartjs/Chart.js/releases/tag/v2.7.0
- Bug fix: Ensured the string “photo” can be translated on [wlt] shortcode.
- Bug fix: Fixed issue where the width of chart lines was being effected by the chart “width” attribute.
- Removed “width” argument from [wlt-chart]. The attribute wasn’t used.
- Notifications from YeKen are on by default and disabled when
- Updated Languages.
- Improvement: Added an Advanced tab to [wlt] shortcode to display a BMI, BMR, Calories and Macronutrients. This tab can be hidden with the attribute “hide-tab-advanced” – Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Added a Photos tab to [wlt] shortcode to display a gallery. This tab can be hidden with the attribute “hide-tab-photos” – Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Added footable.js to Macronutrient and Calorie tables in Admin (tables looks a lot better in responsive mode).
- Improvement: Added “alternate” class for Macronutrient table to make alternative rows stand out.
- Bug fix: Ensured “No data found” can be translated on data tables.
- Bug fix: Show hamburger menu icon on tabs.
- Improvement: Added footable.js to Macronutrient and Calorie tables (tables looks a lot better in responsive mode).
- Bug fix: Fixed “Can’t use return function in write context” appearing in older versions of PHP.
- Bug fix: Ensured “Measurements are in” can be translated.
- Bug fix: Ensured “Search” text on new data tables can be translated.
- Photo Uploads!
- New field on attachments “Don’t show to public” (set to true by default) to stop user photo’s being rendered on standard attachment pages.
- Users can now upload / replace / remove a photo alongside their weight / measurement entries.
- Admin can view all photos uploaded by a user.
- Admin can upload / replace / remove a user’s photo.
- New shortcode [wlt-photo-count] to display the number of photos uploaded by the user – Read more: https://weight.yeken.uk/shortcodes/
- New shortcode [wlt-photo-oldest] to display the user’s oldest photo – Read more: https://weight.yeken.uk/shortcodes/
- New shortcode [wlt-photo-recent] to display the user’s most recent photo – Read more: https://weight.yeken.uk/shortcodes/
- New shortcode [wlt-gallery] to display the user’s most recent photo – Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Added “css-class” argument for [wlt-macronutrients-table] shortcode – Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Added “css-class” argument for [wlt-calories-table] shortcode – Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Standard Pro Users can now upgrade to Pro Plus for 50% cheaper!
- Improvement: [wlt] shortcode has a new argument “hide-photos”. If set to true, the photo section of the form will be hidden. Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Added field “photo” to [wlt-if] shortcode. Allows you to check if the user has uploaded a photo.
- Improvement: New hook “wlt-hook-data-entry-deleted” created. Fired when an entry is deleted.
- Improvement: Removed DataTables.js and replaced with Footable.js for advanced data tables. This keeps the front end consistent with admin area.
- Improvement: [wlt-table] has a new argument to disable data being edited / deleted “enable-add-edit”. Read more: https://weight.yeken.uk/shortcodes/
- Improvement: [wlt-table] user’s now have the option to edit their data with this shortcode (not just delete).
- Improvement: Tweaked form headers to say “Edit” intead of “Add” when editing an entry.
- Improvement: Editing an entry is done using PHP and HTML. jQuery / Ajax has been removed so more reliable.
- Improvement: Re-factored all to use one function to keep things consistent.
- Improvement: Added French-speaking Canada (Québec), French-speaking Belgium and French-speaking Switzerland- thanks Pierre
- Improvement: Updated French language – thanks Pierre
- Bug fix: When display a user’s weight entries on Search results, if there are no entries, display nothing instead of 0[weight unit]
- Bug fix: Don’t display “Difference form target” if there is no recent or target weights to calculate from.
- Bug fix: Fixed locale issues in data tables.
- Removed “(needed for BMR)” from setting fields.
Recently I decided to build my own website for people to track their weight for free! Having a Weight Loss Tracker plugin of my own, it made sense to build a website using it! Besides providing people with a service, it will allow me to develop and test my site in different ways. I’ll now be able to use my plugin as an end user and have access to a larger range of data to test with – that can only be good news for the progression of the plugin!
- Improvement: Added “strip-p-br” argument to [wlt-if] shortcode. – Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Added .pot file.
- Updated language files.
- Bug fix: Search results now shows user’s that have no weight entries.
- Improvement: [wlt-if] can now be nested. You can nest [wlt-if] statements upto three levels deep. – Read more: https://weight.yeken.uk/shortcodes/
- Improvement: [wlt-if] field now supports one or more fields (creating an AND statement). Fields can be specified in a comma delimited list. – Read more: https://weight.yeken.uk/shortcodes/
- Improvement: Prompt to login text when [wlt-form] is in target mode has been modified to remove reference to weight entry.
- Improvement: Added additional text to display whether the measurements are optional or mandatory.
- Improvement: Added a license check to be performed on software update.
- Improvement: Added [wlt-bmi] – a shorter name for [wlt-recent-bmi].- Read more: https://weight.yeken.uk/shortcodes/
- Bug fix: Fixed a typo in a Progress Bar error message.
- Bug fix: Removed “Delete user data” command from redirect querystring if previously specified.