This project will develop into a larger project. It is an initial prototype/work in progress. We are looking for a longer term partnership with a reliable developer.
Background
——————
This site is a test site for a wordpress development. This is the first custom programming for the site with more to come.
The site is based on wordpress using the Wishlist Member plugin to manage registration and content hiding. This should not affect anything you do in this project too much. Be aware if you add a new page there are some security settings at the bottom of every post and page that changes whether it is visible or not.
This project is to create the basic login flow of screens working. These screens will be very basic but will grow to have more details in further projects. The idea is to create something to build on.
I suggest creating the additions below as a wordpress plugin.
You will also need to create some database tables as part of this project which can be added to the plugin activation code.
The project
—————–
To create a plugin that handles the following steps. Please follow along on the demo site.
There are two parts to this project. i) A registration process with multiple steps ii) A shortcode that inserts the content from other pages into a page based on hardcoded details
i) The registration process.
—————————————–
*** You will need to read this several times as the start of the process makes reference to things you only know at the end of reading this ****
*** Please ask questions if you are not sure ***
The registration process is protected by a PIN CODE.
Step A: From the home page the user will be directed to a link to a PIN CODE entry page
http://msdev.watchthedemo.co.uk/pin-page/
The pin code page will have a single entry field that accepts up to 8 letters and numbers without a space and not case sensitive.
The pin code is validated against a database to check for validity before sending a valid user on to hardcoded success link (please create a config.php file for the plugin) in this case the success link is http://msdev.watchthedemo.co.uk/?/register/ADQWw0
Step B: The success link is a wishlist member page. (For this demo it is the registration link for the staff member membership level)
Once this page is completed the wishlist member plugin will register a user, log them in and send them to registration step 1 see below
Step C: (Note if the user does not complete a step for this point on, and logs in again they need to be taken to the last step they completed. This
is discussed below) See http://msdev.watchthedemo.co.uk/register-step-1/
This page needs to have a simple test form which has a single drop down list box. The label is topic and the selections are
Nothing(default), Sleep, Stress
The save button needs to record the topic into the PersonalDetails record along with the store id based on the pincode entered. (see below for table definitions). The pincode will have to be stored in a session variable from the pin code screen.
You also need to cope with the situation where a user does not complete this step and logs in. This will mean you will not have a pin code saved for this user. You may need to ask for the pin code again (step A) but skip step B going straight to step C.
The form needs a combined save and next button… which goes to http://msdev.watchthedemo.co.uk/register-step-2/ (add to config.php file)
Step D: registration step 2
http://msdev.watchthedemo.co.uk/register-step-2/
This is a dummy step with no content only next and previous buttons. It needs to work with the notes on enforcing the registration steps below.
Previous should return to Step C
Next should go to the internal home page (add to config.php) currently called http://msdev.watchthedemo.co.uk/inside-home/
Enforcing Registration Steps
——————————————-
It is important that the user can not skip around without completing the registration steps properly. It is possible that if the user does not complete the steps and logs in later they would otherwise go to the inner home page. To stop this happening I suggest we have a function call in the plugin which is called by the theme header files to validate that the requested page should be displayed and redirect if not. (Happy for another suggestion if you know a better way).
I suggest saving the current registration step in the personal details table against the user. This can be retrieved and the correct page redirection occurs as follows.
No value or 1 – go to step C
2 – goto step D
-1 if requested page is a registration page then go to the inner home page otherwise serve the requested page.
Tables
———-
I would like to use proper tables rather than user-meta data to be as efficient as possible in later data analysis. The system may have 100,000 users registered.
Pin Code Table
———————–
Create a table with an unique id column, a varchar(8) for the pin code, and varchar(50) for store description. Add the following data for now…
pin,store description
123, london south
456, london north
789, scotland
Personal Details Table
———————————–
Create a table
unique id, user id (linked to wordpress user), store id (linked to id of the pin code table),topic varchar(20) (from step 1 form), registrationstep int (used to indicate which steps they have done)
ii) The home page shortcode
——————————————–
http://msdev.watchthedemo.co.uk/inside-home/
I would like to programmatically insert the content from different pages into the home page at the point of a shortcode. The rest of the content of the orginal post should remain.
At the moment this is just a test to prove the concept. So it is based on the drop down on step C above…. This needs to be hard code.
If the user selected nothing add the content from http://msdev.watchthedemo.co.uk/nothing-home-page/
If the user selected sleep add the content from http://msdev.watchthedemo.co.uk/sleep-home-page/
if the user selected stress add the content from http://msdev.watchthedemo.co.uk/stress-home-page/
short code used is [SmartHomePage] there are no options at this time. Do not bother putting the pages above in the config just code them straight into the widget to save time.