Giter Site home page Giter Site logo

lightspeedwp / lsx-health-plan Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 5.0 13.02 MB

LSX Health Plan plugin adds the ability to include a structured exercise and nutrition programme to your WordPress website using the LSX Theme and extensions.

Home Page: https://lsdev.biz/lsx/extensions/health/

License: GNU General Public License v3.0

CSS 2.20% JavaScript 2.28% PHP 78.29% SCSS 17.23%
lsx blocks meal-plan workout recipes lsx-health-plan lsx-theme wordpress-website nutrition-programme structured-exercise

lsx-health-plan's People

Contributors

ashleyshaw avatar dependabot-preview[bot] avatar dependabot[bot] avatar eleshar avatar garthglaum avatar imgbotapp avatar jacquesvdhorst avatar joseabreu1985 avatar josephlightspeed avatar justinabes007 avatar krugazul avatar mergify[bot] avatar snyk-bot avatar viscosho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lsx-health-plan's Issues

Downloads linking is not working correctly

Linked downloads sometimes do not appear in the backend of meal plan.

When downloads are unlinked from meal plan they will still display on the frontend and / or the backend.

Deleted downloads show as an error on the frontend (see screenshot)

image

image

Design Updates to Recipes Cards

Problem
Recipes cards are a bit sparse...How do we make better use of the recipes metadata?

Example Screenshot
Screenshot 2020-01-22 at 16 01 00

Solution
Display the metadata connected with recipes on the cards, include icons and move the "recipes type" label into a badge overlaid on the image

Screenshot 2020-01-22 at 16 04 21

Next Steps
Assigned to dev for implementation and styling

Add Pre Workout Snack and the Recovery Snack to Workout

Feature request:
Adding Pre-workout Snacks and Recovery Snacks to the Workout Tab Content

Description:
The Workout Tab should allow for Pre-workout Snacks to be shown as well as Recovery Snacks after the Workouts

Solution:

  • Add New Custom Meta Box for Pre-workout Snack
  • Add New Custom Meta Box for Recovery Snack
  • Call to front-end

Testing:

  • If no text is entered, then the pre-workout snack and recovery snack should not show.
  • If there is text entered then it should show, and the text should be formatted.
  • Is the information showing in the correct place.

Add a download list to the weekly plan block

A download list
We would like the option to include the downloads on the weekly plan block itself. We do not want it on all projects so it should be disabled by default. You would need to enable a checkbox to add the download list to the block shortcode.

Screenshot 2020-01-09 at 20 21 42

What should happen

  • Create a setting in the block to include a "downloads" list box. There will be no firther options in the block for this.
  • Create a filter to allow the week view to include the downloads if the option has been specified.
  • Desktop, Mobile and Tablet views need to be taken into account.

PHP issue: strtolower() expects parameter 1 to be string, array given

Describe the bug

PHP issue: strtolower() expects parameter 1 to be string, array given

Happening on:
lsx_health_plan_week_plan_block() -> wp-content/plugins/lsx-health-plan/includes/shortcodes.php:64
the_content() -> wp-content/plugins/lsx-health-plan/templates/page-template-my-plan.php:52

Steps to Reproduce

  1. Go to a page that has a HP shortcode like 'My Plan' page
  2. Then go to the server and check the debug log
  3. See the error registered
  4. Also you can see this error on the front using a debug plugin like Query Monitor

Expected behavior

Environment information

  • Device: MacBook
  • OS: MacOS
  • Browser and version: Chrome
  • Theme and version: Latest LSX
  • WordPress version: Latest WP

Checkout enhancements

Issue with the checkout page

  • The banner pushes the checkout form below the fold
  • Section headings are not distinct enough
  • Stacked checkout makes the page long and clumsy
  • To many distractions during checkout

Solution

  • remove the banner in favour of a simple and clear H1 page title
  • Improve typography for the section headings
  • Checkout form and order summary to side by side
  • remove header and footer navigation so that the focus is on completing the transaction

Designs

LSX-HP-checkout-updated

Design Links

Add in a "pre" snack field to the Meal Plan

Problem
Some of the sites using LSX HP have a "snack" before and after breakfast, lunch or supper.

Solution

  • Duplicate the "Snack" meta field on the meal plan post type, and add one before the breakfast, lunch and supper fields.
  • Rename the Breakfast Snack field to Post-breakfast Snack and `Pre-breakfast Snack
  • In the frontend, duplicate the call for the current snack field, and use those for the pre snack field.
  • On the frontend name the both of them "Snack" for now, but pass them through a filter so child themes can change them if they need to. apply_filters( 'lsx_hp_pre_snack_title', $title );

Testing

  • If no text is entered, then the pre snack should not show, or the title.
  • If there is text entered then it should show, and the text should be formatted.
  • Is the information showing in the correct place.

Screenshot 2020-01-14 at 15 26 30

Screenshot 2020-01-14 at 15 33 44

The recipe type taxonomy needs to look like the recipe landing page

Problem
We need to highlight certain recipes via a separate URL, e.g a list of Paleo recipes.

Solution
We are going to use the "Type" taxonomy term page and style it like the post type archive. It will not integrate with LSX Search though.

To Do

  • Add the taxonomy redirect for the Type Template
  • Copy the post type archive template and convert it into a taxonomy template.
  • Change "Type" in the Breadcrumbs to "Recipes" and link to the post type archive.
  • Move the description to below the banner
  • Change the term page title to "{term_name} Recipes".
  • Add the neccesary CSS Classes to the stylesheet to handle the archive.

Screenshot 2020-01-17 at 17 36 37

Day Plan on Tablet - Styling issue with days

Describe the bug
When viewing the day plan on tablet size the last day of each week will sit on the very end this is caused by die justify-content: space-around style as seen here:

To Reproduce
Steps to reproduce the behavior:

  1. Go to My Plan
  2. Open Week 2 dropdown
  3. Resize browser to Tablet Size or to 768px window size

Expected behaviour
The last days should not sit on the end of the list as it currently does.

Screenshot
image
https://verloorjouboep.feedmybeta.com/my-plan/

Desktop

  • Displaying fine

Tablet

  • Last day is showing at the end

Mobile

  • Displaying fine

Exercise - Single / Modal

Describe the solution you'd like

Each workout will have an attached set of "exercises", when you click through to the "Single Exercise" from the plan, we would like a button to display to say "Back to Plan".

The Single template itself will be a WP Block Page, so all of the styling should inherit the usual LSX and WP Blocks styling.

Functionality

  • Plugin Setting - Enable Exercise Modals
  • Back to my plan (if you click through from that, because the modals are disabled)
  • Repeatable field in the backend for images / giphy / video fields

Designs

Workout - Exercise Modal
Screenshot 2020-04-30 at 08 13 21

Exercise with a Gallery assigned.
Link to be added.

Exercise Single
The design will be added when its complete.

Create plugin settings to allow a user to disable the post types

**Checkboxes on the plugin settings page **
Add in an additional box with a list of checkboxes, one for each post type. Here the user will be able to disable the post types they do not want active.

Describe alternatives you've considered
We will have filters which allow you to do this, but most users are not code savy, so plugin settings are easier for them.

What should happen

  • A user clicks the checkbox and saves the settings page.
  • The tab for the post type should not appear on the plan page.
  • All visible connections on the frontend should not be visible. e.g If tips are disabled the carousel should not show.
  • Any blocks registered for that post type should not appear in the backend.
  • Any meta boxes in the backend for this post type should not show. e.g if recipes is disabled then the "connection" on the plan should not show.
  • Disable the tips, recipes and workouts shortcode if the tip post type is disabled.

Add a setting to make downloads global vs allocated individually to posts

Add a setting to make downloads global vs allocated individually to posts
There should be both options:

  • A user should be able to configure downloads on a per post basis
  • A user should be able to assign global download files

NB: All download files must be secure no matter what method is used.

Workout tab disappear when a Warm up is removed

Describe the bug
Workout tab disappear from the Plan Nav bar when a warm up is removed and updated on the Day plan Editor on the Wordpress backend.

To Reproduce

  • Select a day on My plan section
  • Be sure the Workout tab is in the Plan nav bar
  • Go to the day editor
  • Remove Warm Up from the editor options and click on update
  • Back to the picked day front and notice that the Workout tab is gone.

Expected behaviour
The Plan nav bar should display the Workout tab should appear if is exist or not a Warm up option.

Screenshots
The Workout tab appear if a Warm Up option is active
workout-tab-warmup-active

Removing Warm Up from the Day plan options
remove-warmup

After the Warm Up option is removed we can noticed that the Workout tab disappear from the Plan Nav.
workout-tab-disappear-1

Desktop:
Happening in all browsers.

Mobile:
Happening in device.

Refactor the Classes folder with subfolders

Problem
The classes folder is becoming too large, there are lots of files in the root.

Solution
We are going to add in 2 subfolders and move the classes into those.

IMPORTANT
You will need to use the terminal command git mv <source> <destination> to move the files, that way the git history is retained.

Example

  1. You will cd into the lsx-health-plan/classes directory.
  2. Then create the new directory integrations.
  3. Then run git mv class-woocommerce.php integrations/woocommerce.php

Tasks

  • create the integrations folder
  • integrations/class-woocommerce.php
  • integrations/class-lsx-search.php
  • integrations/class-wp-user-avatar.php
  • integrations/class-downloads-monitor.php (this will rename the class-downloads.phpfile toclass-downloads-monitor.php`)
  • Fix the initiation of the downloads monitor class and class name.
  • create the classes/post-types folder
  • post-types/class-plan.php
  • post-types/class-meal.php
  • post-types/class-tip.php
  • post-types/class-receipe.php
  • post-types/class-video.php
  • post-types/class-workout.php
  • Fix the path to the classes in class-post-types.php

Add Workout Group Extra Information to Workout Tables

Feature request:
Add Workout Group Extra Information to Workout Tables

Description:
We should add the option for extra information in the Excercise Groups for each Workout

Solution:

  • Add new Custom Meta Box for Workout Group Information
    For each workout group we need a:
  • Description - Text Area
  • Equipment - Text Input
  • Muscle Group - Text Input
  • Call these to front-end

Testing:

  • If no text is entered, then the workout group section should not show.
  • If there is text entered then it should show, and the text should be formatted.
  • Is the information showing in the correct place.

Change "Video" column to "How to"

Is your enhancement related to a problem? Please describe.

No

Describe the solution you'd like

On the workout, change the column heading Video to How To
See screenshot:

Screenshot 2020-04-14 at 16 11 02

Connected Post Types are duplicating when saving

When you edit a Meal Plan for example, and add in a new Download or Day Plan, and click save, the connected item will be duplicated. See example below.

1:) Edit meal plan 3 and connect it to Day 4.
meal-plan-edit

2:) View the connected "Day" attached. You will see the connected "items" duplicate the attached meal plan
day-plan-edit

The fields that show the connections to other CTPs on each of the single edit screen are not showing content, nor you can update or change content.

Describe the bug
After updating CMB2 and Woocommerce, the fields that show the connections to other CTPs on each of the single edit screen are not showing content, nor you can update or change content.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any of the Health Plan CTP (recipes, workouts, plan, etc)
  2. Go to a single post type.
  3. Scroll down to the details section.
  4. See error

Expected behavior
The fields should show the connections to the other custom post types and should be able to add more or delete existent.

This is how the Custom Fields look now (broken)
Screen Shot 2020-01-28 at 3 56 33 PM

This is how the Custom Fields should look
Screen Shot 2020-01-28 at 4 01 30 PM

Desktop (please complete the following information):

  • All Browsers

Smartphone (please complete the following information):

  • All Devices

Additional context
This has something to do with the latest version of CMB2 or Woocommerce, since it happened after updating both.

https://www.bugherd.com/projects/168385/tasks/201

The recipes archive needs to handle the LSX Search plugin

Problem

Currently the recipes archive is not searchable or sortable.

Solution

We are going to integrate the recipes post type with the LSX Search Plugin

What to do

Setup

  • Create a new class class-lsx-search.php, similar to the class-woocommerce.php already there.
  • Create a new function initiating the class and add a new add_action
  • This class should only be included if the FacetWP plugin is enabled.

Backend

  • Create a new setting panel for the recipe search settings, we will need a setting for each of the following field in the screenshot.
  • We will prefix the field names with recipe_ but all all of the fields will use the same names as LSX uses.
    Screenshot 2020-01-14 at 21 53 25

Frontend

  • Edit the setup function, and allow the LSX HP plugin to allow the recipe post type for LSX.
  • Filter the search options variable and insert our recipes setting values.

The filters needed to be filtered are here, the frontend will follow the LSX Search design.
Screenshot 2020-01-14 at 22 05 58

Testing

  • Install FacetWP
  • Setup the facets and index the site.
  • Setup the settings in the LSX HP Settings page.
  • Test filtering the facets on the frontend.
  • Test using the pagination
  • Test using the sorting.

Facets

  • Title (text search)
  • Prep time (single slider, per min)
  • Cooking time (single slider, per min)
  • Serves ( radio buttons, only 1 selection allowed )
  • Portion size ( radio buttons, only 1 selection allowed )

When deleting/trashing recipes they still stay on the day plan in the back-end

Issue Description

When you trash a recipe (or any LSX HP post type) that has already been linked to a day it still stays on the day plan which results in an empty recipes tab content on the day.

Tested on Verloor jou boep - https://verloorjouboep.feedmybeta.com/plan/vrydag/recipes/

image

Solution Needed

  • Add in a filter to the WP action trashed_post.
  • Check to see if the current post being trashed is one of the LSX HP post types.
  • If it is check what post type it is and if it has connections to any other post types.
  • Run through those connected post IDs, and remove the ID of the deleting post. (breaking the connection)
  • Test this by deleting a recipe and making sure the post ID is not there.

Add in a setting to be able to set the tab endpoint names, for translations

We are going to need to be able to translate the tabs on the single plan page.

Settings

  • Add in a new section, and a text input setting for each tab, this will house the endpoint slug.
  • The default value of the field will need to be the english slug.
  • This section will need a description, it will need to explain that you need to resave your permalinks after changing the endpoint settings.
  • Each setting name will need to prefixed with endpoint_ e.g endpoint_warm_up

Look here for settings we have already added in.

Endpoint Class

  • You need to get the endpoints setting, and use that, in the add_rewrite_rule instead of it being hard coded. This needs to happen for all 4 of the tabs.

Frontend

  • Edit the single-plan-tabs.php template and make sure these pull through the setting value as well, otherwise default to the english slug.

Testing

  • Test the endpoints in english
  • Test Translating the endpoints and save the permalinks.

Exercise Landing Page

Description

Our exercise post type will use the same layout as the other LSX Search enabled archives, in a grid layout.

Filters

  • Type
  • Equipment
  • Muscle Group

Designs

Archive Landing

Screenshot 2020-04-30 at 07 41 17

Additional context

You will need to enable the exercise post type via the settings before it is enabled.

Breadcrumbs not translating with Endpoints

Describe the bug

Currently, when translating the Health Plan Endpoints via the Settings the Breadcrumbs don't translate with.

Steps to Reproduce

  1. Go to Settings > LSX Health Plan
  2. Scroll down to SET ENDPOINT TRANSLATIONS
  3. Translate desired endpoints
  4. View Health plan pages containing the translated endpoints for example - Meal Plan or Workout and look at breadcrumbs.

Expected behavior

That breadcrumbs are translated.

Solution

In side this else statement, add the call to the endpoint translation
https://github.com/lightspeeddevelopment/lsx-health-plan/blob/master/classes/class-woocommerce.php#L126

As done here - https://github.com/lightspeeddevelopment/lsx-health-plan/blob/master/classes/class-endpoints.php#L65-L68

Replace the workout in the key, to be more dynamic,

$endpoint_translation = \lsx_health_plan\functions\get_option( 'endpoint_' . $endpoint, false );
if ( false !== $endpoint_translation && '' !== $endpoint_translation ) {
	$endpoint = $endpoint_translation;
}

LSX HP - change My Stats field to optional

Describe the bug
The My Stats fields are currently required fields. This prevents users from saving their profile if they do not to want to enter this information.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to https://loseit.co.za/my-plan/edit-account/
  2. Click on Account Details
  3. Scroll down to My Stats
  4. Leave some fields blank
  5. Click Save Changes
  6. See error messages at top of the page

Screenshot 2020-02-10 at 15 49 23

Expected behaviour
After entering the stats information, the new fields should be reflected at the top of the page. If not information is entered then there should be NO error message

Screenshots
See above.

Desktop (please complete the following information):

  • All desktop browsers

Mobile (please complete the following information):

  • All mobile devices

LSX HP - workout and meal linking multiple times in backend

Describe the bug
When linking Meal plans and Workout to a Day Plan, it shows several times in the backend. This is very bad for user experience, and can be confusing.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to https://lsx-health-plan.lsdev.biz/wp-admin/post.php?post=2557&action=edit&classic-editor
  2. Scroll down to Workout sections
  3. See there are five Workout 1 linked there

Expected behavior
The linked workout or meal plan should only appear once.

Screenshots
Screenshot 2020-01-24 at 16 09 51

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: Version 79.0.3945.130 (Official Build) (64-bit)

Smartphone (please complete the following information):

  • Device: iPhone6
  • OS: iOs 13
  • Browser Chrome
  • Version Version 79.0.3945.130 (Official Build) (64-bit)

Additional context
None

Meal Plan does not interpret HTML

Related Links

Backend- Meal Plan does not interpret HTML properly
Meal Plan does not interpret HTML properly

PHP issue: Undefined property: lsx_health_plan\classes\Settings::$post_types

Describe the bug

PHP issue: Undefined property: lsx_health_plan\classes\Settings::$post_types

Happening on:
wp-content/plugins/lsx-health-plan/classes/class-settings.php:367
wp-content/plugins/lsx-health-plan/classes/class-settings.php:179

Steps to Reproduce

  1. Go to a page that has a HP shortcode like 'My Plan' page, or any backend page.
  2. Then go to the server and check the debug log
  3. See the error registered
  4. Also you can see this error on the front using a debug plugin like Query Monitor

Expected behavior

No PHP errors.

Environment information

  • Device: MacBook
  • OS: MacOS
  • Browser and version: Chrome
  • Theme and version: Latest LSX
  • WordPress version: Latest WP

Add in Settings to assign a default workout, recipe, warm up and meal type post

We currently can set global default, which add to the downloads. For example we can add a default workout which shows in the downloads box.

BUT the workout tab will not display, this is because there is only a downloads assigned, and not post with information.

We need a section which has the same fields as the edit plan page in the settings. If no connection to the post is found, then it looks for the one added to the settings.

  • Warm Up
  • Recipes
  • Workout
  • Meal Plan

Each Tab on the single plan template should default to these post types if they are set and there are no connections added to the plan.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.