My module module provides a way to feature advertisements on a Drupal website (available only for Drupal 7). It displays graphical ads in configurable blocks. It records and reports useful statistics. It is easy to configure and does not depend on other contrib modules.

Features:

- Customizable groups for different ad types

- Automatically generates ad blocks for different ad types

- Many configuration options for individual ad blocks including ad size and number of ads to display in a block

- Convenient dashboard for quick review of active ads

- User-friendly ad scheduler makes it easy to schedule ad activation & expiration. (Enter Activation or Expiration Date by typing Now, +1 week, +1 year, etc..)

- Capture useful statistics including ad impressions, clicks for 1
hours, one day, one week, one month, 3 months, 6 months, 1 year,
and all time.

- Generates live ad statistics report

- Ad blocks can be themed

- Integration with WYSIWYG module. Plugin allows to inject Ads into content (supports TinyMCE, CKEditor, FCKEditor)

I called it "SimpleAdvertisements", but originally it was "SimpleAds", and it was already taken by someone http://drupal.org/project/SimpleAds.

It would be great if we can use "SimpleAds" name for our project.

GIT: git clone http://git.drupal.org/sandbox/minnur/1261590.git simpleadvertisements

Project URL: http://drupal.org/sandbox/minnur/1261590

We also know about http://drupal.org/project/ad (Advertisement) which is only for Drupal 6 and lots of people want Ad system for their D7 sites, and we are no exception, that's why we decided to create new Ad module for Drupal 7, which meets our requirements. And we are sure that this module will be useful for other sites too.

Thanks,

Minnur

CommentFileSizeAuthor
simpleads-image.jpg145.75 KBminnur
simpleads-image.jpg145.75 KBminnur

Comments

minnur’s picture

Issue summary: View changes

Fix typo

minnur’s picture

Issue summary: View changes

Update project features list.

klausi’s picture

Status: Needs review » Needs work

* your module uses taxonomy functions so it should depend on the taxonomy module
* there is an update function that only contains commented out code. Remove it.
* same for the empty validation function

minnur’s picture

Status: Needs work » Needs review

Hi Klaus,

Thank you for your review. I fixed the issues that you have found.

Thank you,
Minnur

klausi’s picture

Status: Needs review » Needs work

* "// default": Comments should be more meaningful and on a new line, see http://drupal.org/node/1354#inline
* simpleads_install(): no need to use variable_set() in there, variable_get() can use default values anyway.
* "if ($uend_time <= $now)" always use "{}" around if/else statements, even if it is just one line. This often leads to bugs if you add lines later. See http://drupal.org/node/318#controlstruct
* same for for() loops
* lines in README.txt should not exceed 80 characters

minnur’s picture

Status: Needs work » Needs review

Hi Klaus,

I fixed the issues.
Please review.

Thanks,

Minnur

klausi’s picture

Status: Needs review » Needs work

Otherwise I think this is nearly ready. The simpleads name space is already taken http://drupal.org/project/simpleads but I think it should be no problem to take it over. See http://drupal.org/node/251466

minnur’s picture

Status: Needs work » Needs review

Hi Klaus,

1. I have created branch 7.x-1.x
2. hook_init(): removed.
3. _simpleads_access_callback(): refined.
4. I have refined documentation for helper functions.

I have posted "support request" on SimpleAds project page. (http://drupal.org/node/1310978)

Please review.

Thank you,

Minnur

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Looks RTBC for me.

Now while we are waiting for the access grants would you be so kind and do a review of one of the other project applications as well? We have currently quite a backlog and need every help we can get. Just pick one from this list: http://drupal.org/project/issues/projectapplications?status=8

greggles’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +PAreview: security

Suggested fixes

Please take a moment to make your project page follow tips for a great project page.

Please take a moment to make your README.txt follow the guidelines for in-project documentation.

This code could be hardened against an attack:

398 $result .= '<a href="' . $ad['url'] . '" target="_blank"><img src="' . $ad['image'] . '" alt="' . $ad['alt'] . '" width="' . $ad_setting['ads_width'] . '" height="' . $ad_setting['ads_height'] . '" border="0"></a> ';

Specifically, the URL should be sent through url(), and the img tag should be built with something like theme_image which provides some sanity checks.

Required fixes

I think there are a few places open to cross site scripting. I created a new ad where every field contained: <script>alert('xss');</script>. When I browse around the admin pages I see a lot of popups.

Specifically, admin/content/simpleads and admin/content/simpleads/5/stat both showed popups.

The XSS needs to be fixed before this can be approved. The first three items are suggestions.

minnur’s picture

Status: Needs work » Needs review

* I have fixed XSS vulnerability.
* I moved HTML code from module to template file.

Thanks,

Minnur

greggles’s picture

Status: Needs review » Needs work

Looks like some great progress. I just noticed now that the term name is also vulnerable to xss on the admin page. It's important in this process to not only fix the bugs but also understand them and apply that new knowledge to other parts of the module. I should have included http://drupal.org/writing-secure-code in my earlier comment - it's a good resource to explain how to identify these problems and how to fix them.

minnur’s picture

Status: Needs work » Needs review

Hi Greg,

* Okay, I think I have fixed all XSS vulnerability issues that you found. I also fixed simpleads_block.tpl.php file.
* Next time I will keep in mind to double check all variables that I output in templates and modules.

Please review.

Thank you,

Minnur

klausi’s picture

Status: Needs review » Needs work
minnur’s picture

Status: Needs work » Needs review

Hi Klaus,

* Thanks for pointing this out, I didn't realize that I was working in the master branch. I have checked my TortiseGIt settings to make sure that I use correct branch.

* This is fixed.

* Thanks for this. I never thought that there is difference between '@', !' and '%'.

Thanks,

Minnur

klausi’s picture

Status: Needs review » Reviewed & tested by the community

RTBC for me.

sreynen’s picture

Status: Reviewed & tested by the community » Fixed

HI minnur,

Thanks for your contribution and welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects, at your discretion.

Now that you've experienced the full review process, please consider reviewing other projects that are still awaiting review. Anyone can help with reviews, following the guidelines.

minnur’s picture

Thank you

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Fix typo.