Module-Description
SWTOR - Star Wars The Old Republic - Server Status
swtor_server_status module
Category: "Games and Amusements"
The module provides a block displaying SWTOR (Star Wars The Old Republic) server status information.
These game server status informations are very popular and displayed on gamer-, guild-, clan-websites.
There are multiple options for selecting the game-server-locale/game-server-name, for displaying additionally guild link, render wrapper elements, setting the caching time etc.
Links
Project Page: http://drupal.org/sandbox/aw030/1913016
Git Repo: git clone --branch 7.x-1.x http://drupal.org/sandbox/aw030/1913016.git swtor_server_status
Drupal Version
Drupal 7
Notes
- Automated code review using http://ventral.org/pareview/ gives only a false positive, but there is NO /e flag used in regular expressions.
- I dont't know why there isnt' already a swtor server status module since the game release, please let me know if it's forbidden from drupal side, SWTOR recommend spreading the data to build up a big outer-game-community.
- The way getting the data is recommended, if - perhaps in future - a server status api is released i will immediately switch over.
- Please contact me or comment for feedback, help or info, you're very welcome!
Review Bonus
http://drupal.org/node/1881052#comment-7049764
http://drupal.org/node/1913236#comment-7049628
http://drupal.org/node/1912952#comment-7049888
http://drupal.org/node/1898112#comment-7073862
http://drupal.org/node/1917624#comment-7073720
http://drupal.org/node/1913236#comment-7073356
http://drupal.org/node/1908884#comment-7075774
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | xss-exploit-1914458-6.patch | 512 bytes | klausi |
Comments
Comment #1
rob.barnett commentedThis looks fun. You should also run your code through the coder module. It found some nitpicking white space issues but also a possible security issue with your use of preg_match on line 57 in the .module
Comment #2
aw030 commentedOk, thx,
i will try the Coder module this evening and fix the whitespace-issues.=> The whitespace-issues thrown by the "Coder" module has been fixed.
The security issue warning is only thrown by the PAreview script on ventral.org,
but it seems to be an issue with these automated-review-scripts (CodeSniffer),
see: http://drupal.org/node/1847730.
False positive: The /e-flag is NOT used in this module here
(--->the review-script only don't recognize well the modifiers of the regular expression and gives a false positive)
Comment #3
sylus commentedI just did a quick review and it found a few more whitespace issues.
Otherwise I looked at the code and it is very succinct and solves the desired use case well.
My only question would be at:
http://drupalcode.org/sandbox/aw030/1913016.git/blob/refs/heads/7.x-1.x:...
Are these the only languages provided by SWTOR?
Comment #4
aw030 commentedThx for your review, too.
The whitespaces are now fixed:
No errors in Coder module and only the false-positive at ventral.org,
see the latest version running through script here:
http://ventral.org/pareview/httpgitdrupalorgsandboxaw0301913016git
Languages: Yes, the only languages supported/provided for the status server
informations are these three languages (if you visit swtor.com, you
will see the option for this 3 languages at the top of the page).
Comment #5
aw030 commentedI forgot to set the review bonus tag...
Comment #6
klausiThank you for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no major flaws).
manual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #7
aw030 commentedThx a lot for your very helpful review!
Ok in my future reviews i will manipulate the issue status,
i dont't knew that i am permitted to do this.
All issues mentioned above are fixed now
1. Cleaned up the .info file.
2. drupal_http_request() now in use.
3. Permissions set to "administer site configuration"
4. Added a _uninstall hook in new .install file
5. system_settings_form() now in use.
6. @author tags removed.
7. I agree to that, and as mentioned in the article http://drupal.org/node/28984,
I have used now check_plain() on every value.
After reviewing 3 other projects i will re-add the bonus tag,
and for now i will remove the "PAReview: security"-tag
(i hope this is correct, because the xss-issue is fixed...)
Comment #8
klausiPlease don't remove the security tag, we keep that for statistics and to show examples of security problems.
Comment #8.0
klausi*for better understanding
Comment #9
aw030 commentedI have done some more reviews and re-add the review-bonus-tag:
http://drupal.org/node/1898112#comment-7073862
http://drupal.org/node/1917624#comment-7073720
http://drupal.org/node/1913236#comment-7073356
http://drupal.org/node/1908884#comment-7075774
Comment #9.0
aw030 commentedAdded 3 other reviews for review bonus
Comment #10
klausimanual review:
But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to dman as he might have time to finally approve this.
Comment #11
dman commentedInstalled OK.
User review:
I'd like to see the project detail (as shown on the modules admin page) use the full name instead of the acronym in the description, thought that's mainly because I found it hard to find and unfamiliar
- didn't really take advantage of the description field to describe anything :-)
Installation instructions on the project page were good.
I expected the options for configuring the block would be at the block configuration screen ( admin/structure/block/manage/swtor_server_status/swtor_server_status/configure ) - I think that would be a tidier place for this if there is only to be one block. It's just one click away if using the inline edit tools that are on by default in D7.
However, really good and reasonably clear admin UI options (considering I don't know this system at all!)
Perhaps you could have the css display options ON by default in first install, and provide the option to disable or override them later, instead of vice versa.
Code review:
I'm puzzled that immediately after starting to use SimpleXMLElement to parse server responses, you then switch to use substr() to get data out of it, but I'll let that slide.
You *appear* to be using check_plain in most of the data fields I can see. So it's currently probably OK, but it's a vector to remain vigilant about.
Instead of iterating through all servers looking for their names each time
I would have just indexed the data array by the server name at the time. You have the label available when you are creating the array.
Good use of translation throughout.
I'd expect that the display (and the work you've done to toggle the wrapper elements etc) could easily be delegated to a theme.tpl instead of using the render array anf #type=html_tag so heavily, ...but it's fine as is.
eg
... we usually just use l() for that :-)
I notice that the provided css ONLY gets included if the 'guild' option is added. That's a little unexpected. Is it by design?
OK. Code is fine. Behavior is fine,. the issues above (especially the XSS) have been addressed.
Looks good to go by me.
@aw030 , you should now have the ability to promote your sandbox to a full project.
To copy & paste Klausi's standard welcome message:
----------------------
Now that this experimental project has been promoted, you'll need to update the URL of your remote repository or reclone it.
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 get 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.
----------------------
Thanks Klausi too.
.dan.
Comment #12
klausidman updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Comment #13
aw030 commentedThanks a lot to all involved! I am very pleased about that!
I'll will fix the recommendations from comments #10 / #11 in the next steps, update the project page (description) and the documentation.
Comment #14.0
(not verified) commentedreview-link added