Page no: S55a
Table of contents
Details:
My idea is very simple. I make different (without connection to wordpress login / register forms or any plugins). In that form I put what I want (We will check the user country via ip and it will be selected. He can select any other if he wants. After proceeding the form – I can make what I want. I will use core db functionality and add user in db, after that I can add his ip in second table with second query. Login is the same – different form, I only log in user via core wp functionality and check for ip. Simple. I’m almost ready. Just some tests tomorrow. I will put all of this in popups and it will be perfect. The good part is that we have full access to every part of the code and can be easily changed.
- We use the core wordpress db for registering user
- The fields are: IP, REVERSE IP, COUNTRY
TO DO: We need these fields: Language,WordPress.com Login, Livefyre loginCountry & CSS additional:
Our table structure is IP | COUNTRY – super optimized (query with 1M rows will be 0.05s, now: 0.001)
We check on first page view (impression) if we have the ip in our db. If we have it, we set globally (no any other checks) the language.
We add in the table using the register – On successful register, we add the user ip and country.
TO DO: We have to use API for finding the country of the IP
We add also with the login form – on every successful login, if the ip is not in our db, we add it.
TO DO: We have to use API for finding the country of the IP
Process:
- store all data in the Memory
- proceed the form from cookie
- store the user in the core DB
- Store additional data in the second table
Testing:
1. Precondition: User not registered
2. Test: Store all attributes, Name, first Name, Email, language, Country,
and Lifefyre Login, wordpress.com Login (both optional)
and IP (not shown to user) to the WordPress DB in the WordPress user table and Extension table
— User enters his data (Name, first Name, lang….)
3. Postcondition: a DB entry for this user exists in both WordPress and Extension table
Display users
Display registered users in WP admin:
We will probably a new plugin that extends the user attributes in the WP backend with the new fields
We could call them “user-defined 1”, “user-defined 2”, and give them a XML like idenfication
<field Name> <field value>
This inside WP user is too much hard-coded
Field Name : Field Value
for example “wordpress.com Login” “NikoDimitri”
and “lifefyre Login” “NikoDimitri”
and “Country”: “Bulgaria”
and “Language” “Bulgarian”
The Extension with the “additional fields” section is a new plugin
See more for