Overview
The personalization module adds highly configurable implicit and explicit personalization to Drupal websites based on geolocation and taxonomies. This means you can deliver content to site visitors that is relevant to their interests. This is ascertained from their physical location and behaviour on your site, which builds up a personalization profile of them.
There are a large number of applications for this module; a basic example would be if a user accesses lot's of pages about working for your company you could show them jobs closest to them. Or if you're an international company you could show the contact details of the office nearest to them. Or if they access a number of articles about marketing you can suggest other marketing content to them. There's no reason why you couldn't also use it for advertising, e.g. this user has looked at 10 articles tagged with Xbox, you could then display an advert for the Xbox One.
The module is designed for larger content heavy sites but would work effectively on any. It comes with a "Suggested content" block and paginated listing but the intention is for developers to call the modules functions directly to retrieve users suggested content to do with as they please. It was created to bridge a gap in Drupal core and contrib module space. After running many CMS selection workshops with enterprise clients, many of them ended up selecting SiteCore due to the level of personalization it offers; which is time consuming (expensive) to achieve in Drupal.
Note: Whilst the geolocation logic should work on any database engine that supports trigonometry, it has only been tested with MySQL.
[updated 02/12/2013] Please find attached to this issue an SQL file for a Drupal 7.23 installation with this module pre-installed and a bunch of categorised content pages to make this project easier to test. To use it, simply set up a vanilla install of 7.23, then import the SQL over the database. The user 1 login for the database is admin:admin
Links
Git: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/Dan.Ashdown/2137715.git personalization
Project Link: https://drupal.org/sandbox/danashdown/2137715
Manual reviews of other projects
https://drupal.org/comment/8187461#comment-8187461
https://drupal.org/comment/8187511#comment-8187511
https://drupal.org/comment/8188247#comment-8188247
https://drupal.org/comment/8354089#comment-8354089
https://drupal.org/comment/8356457#comment-8356457
https://drupal.org/comment/8357767#comment-8357767
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | personalization-testdb-7-23.sql_.gz | 138.01 KB | dan.ashdown |
Comments
Comment #1
dan.ashdown commentedComment #2
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
asghar commentedI have found some issues into your module code
1.
As you are passing some values globaly into js so that you variable name must be something like this due to prevent other modules conflicts.
2.
In personalization.admin.inc, no need for these lines drupal automatically call these functions
$form['#submit'][] = 'personalization_admin_submit';
$form['#validate'][] = 'personalization_admin_validate';
Comment #4
asghar commentedComment #5
dan.ashdown commentedThank you for the feedback asghar.
I've updated the module with your suggestions.
Comment #6
dan.ashdown commentedComment #7
centas commentedQuite a big module so might take a while to test it all properly.
Some comments from me:
1. "require_once" - admin one can be included in hook_menu() via "file" property. Maybe otehrs could be implemented in a same way?
2. Implement hook_uninstall() to remove the variable? just so if one removes the module it wont leave an variables in database.
Comment #8
dan.ashdown commentedThanks centas,
All changes made :)
Comment #9
dan.ashdown commentedComment #10
dan.ashdown commentedComment #11
dan.ashdown commentedComment #12
shubhangibb commentedHi,
I have reviewed "Personalization" module code using coder module. and pareview.sh .
I haven't found any error.
I have installed "Personalization" module. Then I have tried to add the new search mapping. But gives me following error. I have tried with Search keyword "test" and taxonomy term "test" . This taxonomy term has not been created in the system.
Error :
Notice: Trying to get property of non-object in personalization_admin_search_submit() (line 548 of D:\xampp\htdocs\wbc\sites\all\modules\personalization\personalization.admin.inc).
Notice: Trying to get property of non-object in personalization_admin_search_submit() (line 549 of D:\xampp\htdocs\wbc\sites\all\modules\personalization\personalization.admin.inc).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'vid' cannot be null: INSERT INTO {personalization_keyword_mapping} (keyword, vid, tid, created) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => test [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 1384850970 ) in personalization_admin_search_submit() (line 551 of D:\xampp\htdocs\wbc\sites\all\modules\personalization\personalization.admin.inc).
Could you please look into it?
Thanks,
Shubhangi.
Comment #13
dan.ashdown commentedThanks shubhangibb,
Fixed the validation and reuploaded.
Comment #14
SuzhouKada commentedReview report:
Please modify:
Git: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/Dan.Ashdown/2137715.git
as below:
Git: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/Dan.Ashdown/2137715.git personalization
Comment #15
dan.ashdown commentedThanks, SuzhouKada. Updated.
Comment #16
dan.ashdown commentedI've just attached an SQL file to this issue for a bare bones Drupal 7.23 install with this module installed and a load of dummy content to make this project easier to test. I appreciate it's quite big.
Just made a commit with a couple of minor fixes too.
Comment #17
jgullstr commentedMight be useful to know that testdb user 1 credentials are admin:admin :)
Comment #18
dan.ashdown commented@jgullstr
Ah yes, forgot that. Well cracked ;)
Comment #19
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxDanAshdown2137715git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #20
jgullstr commentedDocumentation
The current description is rather esoteric. I believe that a simple use case or two in the product description might help a lot in seeing the value of this module.
Code review
The source code is well structured and easy to read, although I would have liked to see a few more explanatory comments, esp. around the score altering functions. The module uses Drupal's APIs where applicable and the overall impression is solid. A few nit-picking errors were reported by pareview.sh. Some additional remarks:
Includes
cURL
To remove the need for cURL, consider using Drupal's HTTP client, drupal_http_request.
Suggestions
A permission “bypass personalization” might be useful for roles who have no need for this functionality – or maybe even a “use personalization” permission instead of choosing Anonymous and authenticated users on the config page.
I will just assume that the weighing algorithm works as intended, as I'm not familiar with it. However, there seems to be quite some additional database processing going on per request. It might be an idea to implement some form of “personalization_get_user”-dependent cache on personalization_match_content.
Other
First time I visited the page after importing example db, the module wouldn't stop writing db entries, and I ended up with 14k+ rows in user_locations and user_scores tables. I wasn't able to reproduce this behavior on a db reset, neither did I find any non-terminating conditions in source, so I'm writing it off as Force majeure. If it occurs to someone else, you might have a problem.
Comment #21
dan.ashdown commentedGreat feedback thanks jgullstr. I'll get cracking on these points.
Comment #22
jgullstr commentedThanks, and if you think I was too harsh, feel free to tear me a new one in my own project application ;)
Comment #23
dan.ashdown commentedThank again jgullstr, I've made the following amendments:
Comment #24
jgullstr commentedHello again,
Nice work! I've checked your code and as far as I'm concerned, you're good to go.
A few picky remarks:
I see no reason why REQUEST_TIME couldn't be used in all cases.
Updating status to RTBC.
Comment #25
klausimanual review:
Need to run now, will follow-up another time.
Comment #26
dan.ashdown commented@jgullstr, thanks for the status upgrade :) I've implemented both your points.
@klausi, thanks for the feedback. I've implemented as follows:
Comment #27
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
I don't think that pareview.sh requested check_plain() there. Coder Review has some old checks that are known to throw false positives, and you should never change your code blindly.
manual review continued:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #28
dan.ashdown commentedThanks very much Klausi, will work through these.
Comment #29
dan.ashdown commentedThanks again Klausi, appreciate your feedback.
Ok, so regarding the check_plain issues, I've removed a number of these however when I remove them from the tpl files I get "ERROR | Printing unsanitized input from node title" which is contradictory to the previous PAReview error: "WARNING | Do not use check_plain() on the first argument of l(), because | l() will sanitize it for you by default". So I'm no longer passing the whole node object to the template which seems better anyway.
Comment #30
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Sorry, I didn't see the node_access tag further down below in personalization_match_content(), so that is fine.
manual review:
<script>alert('XSS');</script>then I get a nasty javascript popup. You need to sanitize user provided text before printing into a table. Make sure to read https://drupal.org/node/28984 again. Same for the term name ==> user provided text, so it needs to be sanitized in the table.Comment #31
dan.ashdown commentedThanks again klausi,
I've fixed the automated testing issues. Oddly I always run PAReview before setting it back to needs review and make sure it has a clean report. Not sure how you pick up these additional issues. Are there different levels of scan?
Comment #32
klausiSorry for the delay. Make sure to review more project applications and get a new review bonus and this will get finished faster.
I'm constantly improving the automated review tools, that's why the show new stuff from time to time.
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Comment #33
dan.ashdown commentedThanks for reviewing Klausi, sorry was meaning to get another review bonus but haven't been online much over the holidays. Will work on this next.
I've implemented your points.
Comment #34
dan.ashdown commentedAdded 3 more manual reviews and "PAReview: review bonus" tag.
Comment #35
klausiLooks good to me now!
Assigning to patrickd as he might have time to take a final look at this.
Comment #36
klausino objections for more than a week, so ...
Thanks for your contribution, Dan.Ashdown!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #37
dan.ashdown commentedThank you very much Klausi, much appreciated!