CVS edit link for newsignature

New Signature (http://www.newsignature.com) develops and maintains Drupal sites for clients, and specializes in building custom modules and themes.

We have recently built a custom module to render a block showing users the most popular items on the site (most viewed, most emailed, most commented, etc). It uses analytics from a number of different services, including Google Analytics and AddThis.com, as well as statistics from within Drupal itself. The module is extensible, to allow other analytics services to be easily added, and is easy to configure and theme. It uses AJAX behaviors to allow users to see different aspects of the most popular data easily without refreshing the page, and gracefully degrades for browsers without javascript.

The functionality our Most Popular module provides partially overlaps with other projects, including Statistics, Hall of Fame (hof) and Google Analytics API. However, the Most Popular module pulls together the analytics data from these and any other sources into a single place and presents it to users through an intuitive interface. We believe it provides a unique user experience not currently available in Drupal, and we are excited to make it available to the Drupal community.

In addition to Google Analytics and AddThis.com, we are aware of a number of other services that have APIs for site analytics, including Technorati, ShareThis and Twitter, and look forward to working with the Drupal community to build additional service connectors.

Comments

newsignature’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new95.04 KB
avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Module review

Hello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.

As per http://drupal.org/cvs-application/requirements, the motivation message should be expanded to contain more details about the features of the proposed module, and it should include also a comparison with the existing solutions.

newsignature’s picture

StatusFileSize
new25.91 KB

Overview of Most Popular Module
New Signature (http://www.newsignature.com) develops and maintains Drupal sites for clients, and specializes in building custom modules and themes.

We have recently built a custom module to render a block showing users the most popular items on the site (most viewed, most emailed, most commented, etc). It uses analytics from a number of different services, including Google Analytics and AddThis.com, as well as statistics from within Drupal itself. The module is extensible, to allow other analytics services to be easily added, and is easy to configure and theme. It uses AJAX behaviors to allow users to see different aspects of the most popular data easily without refreshing the page, and gracefully degrades for browsers without javascript.

Ready to use features & functionality

The module is pre-packaged with several services including:

* Google Analytics Most Viewed
* Drupal Most Commented pages
* Drupal Most Viewed pages
* AddThis.com's Most Emailed feature

The system's plugin based architecture allows for addition of new services, which can pull data from 3rd-party providers or internally from Drupal.

Themeable design and user interface

By default the module comes with three styles ready to use:

* no styling - for when you'd like to style the module from scratch
* basic styling - for when you'd like some default styles but plan to override them with your own
* full styling - for user interface experts who wish to completely customize the look and feel of the module

You can override the themes used to render each component as well as override the stylesheets used by the module. You can also override the javascript configuration to:

* Change the selectors the javascript attaches to
* Change the transition animations and behaviors.

Through the Stylesheets and Javascript files, the module also:

* Saves the state of the filters as the user browses the site
* It includes options in the Stylesheet and Javascript file to include:
-- Custom showing and hiding of effects
-- Ability to toggle the display of the throbber when content is loading
-- A CSS/jQuery selector to target the Most Popular block
-- A CSS/jQuery selector to target the services
-- A CSS/jQuery selector to target the intervals
-- A CSS/jQuery selector to target the content
-- A unique class for the selected filter

The module uses an AJSX (AHAH) reload of results. If javascript is disabled, the module provides a fully-functional alternate interface for viewing the most popular nodes.

Drupal administration of options

Quickly control options and features through the Drupal administration interface. Options include:

* The ability to customize the maximum number of results to display
* Customizable maximum number of results to display
* Toggle the display of the item count on or off
* Multiple and customizable base URLs for normalizing URLs returned by services
* Multiple past intervals filters with custom time period and label
* Multiple services to filters with custom label
* Configuration pages for each service

Scalability and Performance

It is easy to control how often each service can refresh its data. Many 3rd-party providers specify quotas limiting how many times you can query their service within a period of time. With the Most Popular Module, you can specify a different wait period for each of the intervals over which you wish to receive data. Data is retreived when the Drupal cron job runs and is cached locally.

Additional Notes

The Most Popular Module is highly customizable, so you’re not limited to the features above. If you’d like to add a new feature you are welcome to do so. For additional details, please read the documentation.

Comparison of Similar Modules
The functionality our Most Popular module provides partially overlaps with other projects, including Statistics, Hall of Fame (hof) and Google Analytics API. However, the Most Popular module pulls together the analytics data from these and any other sources into a single place and presents it to users through an intuitive interface. We believe it provides a unique user experience not currently available in Drupal, and we are excited to make it available to the Drupal community.

In addition to Google Analytics and AddThis.com, we are aware of a number of other services that have APIs for site analytics, including Technorati, ShareThis and Twitter, and look forward to working with the Drupal community to build additional service connectors.

Comparison to Hall of Fame (HOF) Module

  • The HOF module requires a user to click through many pages to get to the content they are looking for. By comparison, the Drupal Most Popular Module provides a block with simple AJAX paging to view all information.
  • The HOF module can't connect to external services and relies solely on internal Drupal statistics, whereas the Drupal Most Popular Module both connects out to 3rd party sites (if selected) as well as reads from internal Drupal statistics

Google Analytics API Module

  • The Drupal Most Popular Module uses the Google Analytics API Module to connect to available analytics but can also connect to other 3rd party services as well. In addition it pulls all information together into a common format.
avpaderno’s picture

Status: Needs work » Needs review
newsignature’s picture

StatusFileSize
new44.02 KB

Updated zip file of module without SVN info.

newsignature’s picture

StatusFileSize
new43.02 KB

Latest code with one bug fix.

newsignature’s picture

StatusFileSize
new62.86 KB

One more update with GNU license info.

avpaderno’s picture

Status: Needs review » Needs work

Actually, license files should be removed.

newsignature’s picture

According to the drupal req's:

"Your work must be licensed under the same license as Drupal, which is GPL version 2 or later (read why). Also, we do not allow committing third-party libraries to CVS, even if they are GPL (read why)."

Do we need to remove the license in order to get approved? Thanks.

newsignature’s picture

Hi - it's been a while since I've heard anything. Should we proceed to remove the license or can we leave it as is? Is there anything else we need to do to get approval, or are we just in a holding pattern until someone can review the module? Thanks.

avpaderno’s picture

The status is needs work because the license file needs to be removed.

newsignature’s picture

Do we need to remove just the license file (license.txt)? Or the headers on each file? Or both?

avpaderno’s picture

Crell would reply that is better to not have references to the adopted license in the header files.

newsignature’s picture

StatusFileSize
new115.39 KB

Latest codebase without license headers is attached. Thanks.

avpaderno’s picture

Status: Needs work » Needs review
newsignature’s picture

StatusFileSize
new51.38 KB

Bug fixes to handle better integration with the Authcache module.

newsignature’s picture

Hello - I'm checking in to see if we can have someone review the module in the near future. We've had a lot of people visit our site in the past couple of weeks and have generated interested in the module, but still have yet to have it launched on Drupal.org. Is there anything we need to change on our end to speed up the process? Thanks.

jsenich’s picture

Subscribing.

newsignature’s picture

Hi. I'm checking in to see if we can have this module reviewed, as it's been a long time since we've received any feedback or next steps. Currently this module is available on our website and people are using it with Drupal and have given us good feedback so far. Can you please let us know if there is anything we can do to speed up the review process or if there are any issues preventing this from being reviewed?

Thanks.

jsenich’s picture

It's been almost 3 months since any sort of a response from a reviewer on this. Can somebody please take a look at this module and let us know if anything else need to be don to get it approved?

sun’s picture

Please understand that this module takes quite some time to review -- not only because it intermixes various different concepts, but also because it seems to partially resemble and duplicate the work and functionality of already existing modules (though I may be mistaken).

I only had time to quickly skim the code:

lastrun.php seems to duplicate includes/lock.inc and/or cron in Drupal core?

Most of the classes in this module more or less seem to be wrappers around simple database queries. AFAIK, there are not many OOP developers active in the CVS applications review process, and this usage of OOP additionally looks a bit questionable to me (which doesn't hold off this application in any way though), so this is very likely one major cause for the delay.

A proper security review likely requires to install the module, in order to understand the data flows.

--

If there won't be a proper review within the next 2 weeks, this application should be approved.

sun’s picture

Note, however, that we don't allow "group user accounts" on drupal.org. If "newsignature" is a user account that refers to a human person, and only a single one, who will effectively get CVS access, then that's fine.

If not, then we can 1) either rename that existing user account to match the actual person behind it, or 2) register an account for the real individual behind this application + approve his/her CVS access instead of this user account's.

avpaderno’s picture

Status: Needs review » Needs work

I am changing the status to get a reply from the applicant on both the points reported by sun.

newsignature’s picture

Thanks for the replies! Can we switch the user account to the czingerline user account on Drupal.org? He will be the single person responsible for maintaining this module. Thank you!

sun’s picture

We need a CVS application from http://drupal.org/user/278582 then, referring to this one. May he also reply to the questions in #21?

newsignature’s picture

Regarding post #21:

Objects:
I use objects to gather together common sets of functionality, which in this case are related to each of the most popular database tables. I also use them to maintain and pass around state within our application, which I have found makes the rest of the code using these objects clearer and more concise.

However, I have been careful to expose all the API functions and extension points, in mostpopular.api.php, using Drupal's functional model. The application does not expose the underlying objects directly through these functions, relying instead on passing around their IDs; nor does it require that developers writing hooks for new mostpopular services be aware of or interact directly with these objects.

lock.ini:
Drupal's locking mechanism, implemented in includes/lock.ini, provides a means for guaranteeing that only one instance of a block of code can run at a time. It is expected that the code will release the lock once it is complete or once a timeout has expired.

In contrast, the mostpopular_last_run table (and its lastrun.php wrapper class) controls how often each of the most popular cron processes are allowed to update their data from remote datasources, which is likely on the order of hours or days. They allow fine-grained control over how often to refresh the data for each interval of time, which we refer to internally as "throttles". These updates only occur as part of a cron job, of which there should only be a single instance running.

I considered using Drupal's locking for this purpose, but then the code would never release the locks and would necessarily wait instead for them to timeout on their own, which could be days. This seems like use of locks for which they were not intended. Using my own table also allows me more flexibility so I can keep track of each service and interval separately, as the number of available services and intervals are configurable.

Reviewing:
I agree that this is a complex module with many moving parts, and believe that it probably will make more sense to code reviewers if you install it and play with the configuration options. The administration pages correspond closely with the class objects.

I also recommend looking at mostpopular.api.php early in the review process, as this is where the key concepts and extension points are documented. This file is structured in a way which should be familiar to the Drupal community, even if reviewers are unfamiliar with the OOP structures.

czingerline’s picture

czingerline has requested a CVS account as he is the project maintainer for Drupal Most Popular.

avpaderno’s picture

I guess this application can be closed, then.

sun’s picture

Status: Needs work » Closed (duplicate)
avpaderno’s picture

Component: Miscellaneous » new project application
Issue summary: View changes
Related issues: +#882614: czingerline [czingerline]