The WoWTools module provides various tools for the game World of Warcraft to help guilds to use certain information on their webpage. The sub-module WoWBlocks has the features included, where the WoWTools itself has just a settings page, where you have the possibility to gather data from the official Battle Net API to increase the functionality of WoWBlocks.
Further information you can find on the WoWTools project page.
Additional information
The automatic update feature within the raid progress block uses https url requests to update the data. I found out that XAMP is buggy with https urls, the data just can't be retrieved. It works normally in a normal webserver environment, but not in XAMP.
Sample Data WoWTools Settings
API key: 2yw7mchvrb2cs6zgg6yt62b65dekshs7
Region: EU
Server: Gul'dan
Guild: predicted
Similar modules
Both modules are not up-to-date since they are not using the new Battle Net API introduced mid 2014.
World of Warcraft Guild Hosting - Focus on integration of WoW characters into drupal.
World of Warcraft API - Focus on connecting to WoW API to integrate the data into drupal core.
Git Command for Clone
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/pfu/2193049.git wowtools
cd wowtools
Reviews of other projects
https://www.drupal.org/node/2330561#comment-9155897
https://www.drupal.org/node/2310391#comment-9157365
https://www.drupal.org/node/2333455#comment-9155491
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | XSS_wowtools.jpg | 85.86 KB | pushpinderchauhan |
| #11 | wowblocks_screenshot.png | 12.61 KB | mccrodp |
| #8 | fatal_error.jpg | 70.23 KB | pushpinderchauhan |
Comments
Comment #1
pfu.mi@outlook.com commentedComment #2
pfu.mi@outlook.com commentedComment #3
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxpfu2193049git
We 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 #4
sagar ramgade commentedHi,
Please find my review comments :
a. Please remove your functions from wowtools.api.php, usually modulename.api.php is used to describe your hook or api usage of your module.
b. Please move code from wowtools.api.php to .inc file.
c. Remove .gitignore file from your repository.
d. Remove require_once from wowtools.module and use file key in hook_menu.
e. Use ajax commands instead of writing inline js for ajax callback function wowtools_apikey_remove_ajax
Comment #5
pfu.mi@outlook.com commented- Corrected errors issued by #comment-9148149. Can't resolve the naming issues. WoWblocks is its own module and should have its own namespace. Just to clarify, the WoWBlocks module is included in the WoWTools Module.
- Thanks for your feedback #comment-9149281, I corrected everything except the d. point. The require_once is needed because some files in /wowblocks use this file, if I do it with file key it's only available in the scope of the wowtools.module.
*EDIT*
I just corrected the require_once thing, I found something else for the other files. So everything fixed from your review, thank you!
Comment #6
pfu.mi@outlook.com commentedComment #7
pfu.mi@outlook.com commentedComment #8
pushpinderchauhan commented@pfumi, thankyou for your contribution.
Automated Review
Best practice issues identified by pareview.sh / drupalcs / coder. Yes, http://pareview.sh/pareview/httpgitdrupalorgsandboxpfu2193049git reported number of issues that need to be addressed.
Manual Review
admin/config/wowtools/settings), unable to add API key, getting following fatal error.Recoverable fatal error: Argument 1 passed to wowtools_api_data_valid() must be of the type array, null given, called in C:\xampp\htdocs\drupal731\sites\all\modules\2193049\wowtools.module on line 156 and defined in wowtools_api_data_valid() (line 111 of C:\xampp\htdocs\drupal731\sites\all\modules\2193049\wowtools.inc).<script>jQuery(document).readythat looks weird, same thing you are using at number of places. I would recommend you to use Drupal.behaviors, not jQuery(document).ready().wowtools_build_curl()function you are using PHP cURL to send http get request, I would recommend you to use drupal_http_request() to hit the external URL.<img width='20' height='20' src='{$img_path}/images/classes/class-{$key}.png'><span class='wowclass wowclass-{$key}'>{$class['name']}</span>";The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
I'll stop review as one blocker issue is there and this project is huge too.
I'll review this module in next week, once you addressed above issues.
Thanks again for your hard work.
Comment #9
pfu.mi@outlook.com commentedThanks for your great review @er.pushpinderrana. I corrected all your points, I'm also now using drupal_http_request() for single requests. But there are requests which have to go in parallel though, where I think the best solution is to stay with the PHP Curl multi functions.
*EDIT* Found something for drupal, but it's only for Drupal 8 sadly. - ParallelAdapterInterface
*EDIT2* I have one question, may someone can answer. The Automatic Review tells me namespace problems, but WoWBlocks is its own module included in WoWTools. Why is this problem?
Comment #10
mccrodp commentedHi @pfumi. In the process of composing a full review for your module today, so I will update this comment when i am finished. Just a few initial points.
As of False positives on submodule hooks support thread, you need to rename your submodule prefixed with your module name: wowtools_wowblocks. I would also do the following for consistency.
I would also advise changing the git clone directory to that of the machine name of the module, as seems to be the standard. I can't think of a module that doesn't follow this convention off the top of my head.
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/pfu/2193049.git wowtoolsComment #11
mccrodp commentedAutomated Review
Automated Review issues.
- Recommendations in previous comment.
Manual Review
It worked the second time.
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
This review uses the Project Application Review Template.
Comment #12
pfu.mi@outlook.com commentedComment #13
pfu.mi@outlook.com commentedThanks for your great review @mccrodp, it helps me a lot. Also that you mentioned the naming issue, and how to solve it. I just corrected all issues you addressed in #comment-9171901. For the other #comment-9172135 I'll need some more time, I appreciate your work you have put into the review, thanks!
Comment #14
pfu.mi@outlook.com commentedComment #15
pfu.mi@outlook.com commentedComment #16
pfu.mi@outlook.com commentedComment #17
pfu.mi@outlook.com commentedThanks again @mccrodp for your review. I resvoled all your points you issued at #comment-9172135.
No duplication
I wrote something in the project application page and also project page.
README.txt/README.md
toc in README added, also overall the content extended and the module path changed to something general.
Coding style & Drupal API usage
1.) I could'nt reproduce the error, this error only occures when the API is not rechable (probably maintenance of the API). I improved the error handling, to just abort if it takes to long and also added clear error message to the user.
2.) For the WoWTool settings I now only use submits. Since I needed to refresh the page, it was not very useful to use ajax. If it takes more then 5 seconds, a message to the user with timeout error occures.
3.) done
4.) done
5.) I added a lot of inline comments to make it more clear what particular function parts are doing.
6.) The recruitment block is empty since intially no settings were made, same for raid progress. Both have settings in their block configuration to display staff in the block.
Comment #18
pfu.mi@outlook.com commentedComment #19
pingwin4egA quick review of branch 7.x-1.x, commit 01a98db:
_wowtools_api_data_validfunction has untranslatable strings (String translation is mandatory). I don't know where and how this function is used, so maybe there shouldnot be translations? In this case add a comment about the reasons to the function doc.Always delete all the module variables with the variable_del() function.
This is only for the main module, so please apply any new rules you learn to the included module as well.
Comment #20
pfu.mi@outlook.com commentedThanks for your informative review @pingwin4eg
I hope I addressed everything you mentioned in #comment-9261205
1. You are right, it's not applicable, I removed it.
2. I removed some data which was not ideal, the data as it is now does not change. It sometimes has to be extended, but it's not possible to retrieve it automatically, because I don't know what/and how much new is coming. So I maintain it myself (most likely every 6 months or so I have to add data).
3. Removed some of the constants and commentated those ones which are still there.
4. The hardcoded string which go to the user are now translatable.
5. I changed the optional parameter commentating style and also changed the documentation of the callbacks.
6. Use of url is now included, I can't use this function completely, because the 'query' parameter just add a & everytime, and I need the fields comma seperated like so. ?apikey=&fields=progression,members. But it is used for some cases.
7. Changed the module description and deleted the package property. I want to extend this module at some point, maybe if it's larger I add this again.
8. I changed this and delete now every variable with variable_del()
9. The reason is just that the displayed message is not visible if it refreshes instantly. So I made this little gap.
10. Ok right, I removed the second one.
11. Changed this where I had used multiple lines, they are now in one line.
12. Corrected that.
13. Corrected it by some extend. E.g. 'API' I think it's better to write it this way than 'Api'
14. I can't remember why I disabled this, I enabled it again.
15. Changed this to be with prefixed module name.
Thanks again for your help, I open it again to Needs review.
Comment #21
pfu.mi@outlook.com commentedComment #22
pushpinderchauhan commentedAssigning to myself for next review.
Comment #23
pushpinderchauhan commentedAutomated Review
Best practice issues identified by pareview.sh / drupalcs / coder. None
Review of the 7.x-1.x branch (commit df4b7aa):
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
<script>alert('XSS Apply Link');</script>in apply_link element, every time If I visit the associated page get a nasty javascript popup. You need to sanitize this before rendering, make sure to read https://www.drupal.org/node/28984 again. Also check the same for other places too in your code.$guild['err_msg']data coming from third party response and you are printing the same as it is (drupal_set_message($guild['err_msg'], 'error');), that is vulnerable to XSS exploits. You should sanitize this before printing See https://api.drupal.org/comment/35298#comment-35298drupal_set_message($guild['err_msg'], 'error');that need to be fix. You can check the same by changing this variable value to$guild['err_msg'] = '<script>alert("XSS")</script>';, will get a nasty javascript popup on form submission. Also check the same at other places in your code.wowtools.jsfile that include this file to every page that looks weird. Instead you add this js only where it is actually required.<a href=' . $view['apply_link']['link'] . '>' . $view['apply_link']['text'] . '</a>The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Please don't remove the security tag, we keep that for statistics and to show examples of security problems.
Comment #24
pfu.mi@outlook.com commentedThanks for your review @er.pushpinderrana. I haven't corrected everything yet, the (*) should be eliminated.
Regarding the
I have informed myself. Since the legal faq on their website: http://us.blizzard.com/en-us/company/about/legal-faq.html tells:
I'm allowed to use their staff, but I'm not allowed in drupals way, to re license it under GPL. Since there is no policy from their website for linking to their resources, I do that now instead and removed everything I can't keep in my git repo. I hope this is acceptable :), a short answer would be nice. thank you.
Comment #25
pushpinderchauhan commentedYes this is fine :)
Comment #26
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.