CVS edit link for amitray

Overwhelmed by the success of Joomla Components I would like to contribute to drupal the top CMS in the market. I develop SEO related extensions like Page Rank Checker, Page Analysis (Spider View), Keywords Rank Checker etc. My Joomla related works can be found in http://www.joomlaseo.org and the drupal counterpart under similar paths can be found in http://www.sitesellers.org. This is just starting for drupal with Page Rank Checker as my first module. Still many more to follow.
CommentFileSizeAuthor
#2 pagerankchecker.zip170.1 KBamitray

Comments

sun’s picture

Awaiting your code for review.

amitray’s picture

StatusFileSize
new170.1 KB
amitray’s picture

Issue tags: +Checker
sun’s picture

Issue tags: -Checker

Sorry, we don't like spam on drupal.org.

avpaderno’s picture

Status: Postponed (maintainer needs more info) » 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 the code, pointing out what it needs to be changed.

As per requirements, the motivation message should be expanded to contain more features of the proposed project. For themes, it should include also a screenshot of the theme, and (when possible) a link to a working demo site using the proposed theme; for modules, it should include also a comparison with the existing solutions.

sun’s picture

For the sake of this application, those existing modules being: http://drupal.org/project/modules?text=page%20rank

However, not limited to those. I merely pasted the keywords of your module into drupal.org's project search.

amitray’s picture

I didnt get you. How am I spamming. Please help i am unable to understand.

amitray’s picture

My module is entirely different from the existing modules. It has several new parameters for a full site analysis. Furthermore I am also going to add the code to check no. of inbound links based on Google and Yahoo API to get the accurate inbound links. Also a page analysis giving details of a page like its download speed, important keywords etc, I am going to add to this. I am new to the drupal module development, I am just learning the way it is to be developed referring some previous modules. Once I become expert in these i assure that drupal will have many contributed SEO modules from me. Hope you will help me in this regard.
Thanks
Urmila

sun’s picture

First and foremost, I've read your motivation message, the module's help text, README.txt, and I've read your module comparison explanation, but I still do not have any clue what this module does, neither from a user perspective, nor from a technical perspective.

In particular, especially from a technical perspective, we need a more detailed comparison to existing modules. In general, the Drupal community tries to avoid duplicate efforts, and join forces instead. Existing modules can be enhanced or otherwise altered instead.

Please also have a look into the list of SEO modules: http://drupal.org/project/modules?text=seo -- in general, however, I'm just suggesting search terms here. Making sure to avoid duplicated efforts is your job as applicant normally.

  1. The throbber and progress bar image files contained in the module need to be removed. Drupal core ships with such images in the /misc directory, which are loaded by CSS classes (in progress.css, I think) equally contained in that directory.

    However, as those CSS files are usually not loaded manually, this likely means that this module is not using Drupal's Batch API or JavaScript API correctly.

  2. LICENSE.txt needs to be removed. All code packaged on drupal.org gets a default LICENSE.txt file automatically.
  3. define('pagerankchecker_MAIL_DEFAULT', 1);
    define('pagerankchecker_MAIL_SUB', 'INFO: New Pagerank Checker Released');
    define('pagerankchecker_MAIL_BODY', "Greetings,\n\nThis is our new Release Pagerank Checker, the pagerank of !url has been updated to !pr.\n\nAll the best\n!site_name");
    

    These constants have to be removed. The code belongs into an implementation of hook_mail() and/or administrative settings. I'd recommend to make yourself familiar with Drupal's Mail API.

  4. The form "pagerankchecker_getform":
    • critical: The submit handler is entirely working around Form API and uses raw, unprocessed, and insecure values from request variables. This is a security issue. Please make yourself familiar with Form API and general form handling in Drupal.
    • Submit button (#value) is not localizable, as it does not use t(), and should be something more precise than "Go"
  5. Logically, aforementioned security issue also applies to all surrounding, related, and derived functions being called or involved in the form submission; i.e., pagerankchecker_page() and others.
  6. The raw HTML output in pagerankchecker_page() should be generated by a theme function.
  7. critical: The PHP file pagerankchecker.inc contains top-level PHP code that is executed directly, which is not wanted in Drupal.
    The code additionally uses and processes raw, unvalidated request values to invoke further functions.

    Furthermore, various global variables are used, which are outside of the module's namespace. In general, Drupal modules try to avoid usage of global variables at all costs, as they are a fragile and poor development instrument. The global variables used in this file could easily be changed into proper getter/setter functions. If that's not possible for any reason, then the global variables absolutely have to be in the namespace of the module.

  8. major: All of the functions in pagerankchecker.inc should use drupal_http_request() instead of raw cURL and other raw PHP functions, as the API function automatically negotiates available features and is used everywhere else throughout Drupal.

    The entire files are a bit hard to review, as the code does not follow any coding standard. You're encouraged to make your code adhere to Drupal's http://drupal.org/coding-standards

    I have serious troubles to understand, which function actually invokes and triggers the page rank checks, and which functions are declaring and passing options for that process, and which functions are rendering the results. It looks like the theme function/template is invoking the page rank check -- if that is the case, then this must be changed, as theme functions must render previously generated data only.

    Similarly, _pagerankchecker_block_fetch_stats() is a strange name for a function that outputs the final page rank check result in a block.

    Speaking of, the block is not cached. Thus, it seems that all of those relatively heavy requests to other sites and services are performed each time the block is displayed. You should be using Drupal's Block API and/or Cache API to prevent this performance nightmare.

    Overall, it looks like all of the code could be heavily simplified and shortened, if the module would use a proper plugin model, "registering" all sites and services as callbacks, also following and enforcing a proper function naming convention. Almost every of the page rank checks contains 3-4 similar lines, which could be prepared once for all instead.

  9. All ?> at the end of PHP files have to be removed. See Drupal's coding standards for details.

Lastly, after reviewing all this code, I'm not sure what exactly the difference to the existing page rank and SEO modules is? I can't help, but this code looks like the description of one of the seo/page rank modules. Some services may be missing or be different there, sure. But that's no reason.

Due to this, I stopped reviewing.

amitray’s picture

You are correct my extension needs a lot of improvement. I will come back with lot more improvement.
Thanks
Urmila

avpaderno’s picture

Status: Needs work » Closed (won't fix)
avpaderno’s picture

Component: Miscellaneous » new project application
Issue summary: View changes

Please read the following links as this is very important information about CVS applications.

Drupal.org has moved from CVS to Git! This is a very significant change for the Drupal community and for these applications. Please read Migrating from CVS Applications to (Git) Full Project Applications and Applying for permission to opt into security advisory coverage on how this affects and benefits you and the application process. In short, every user has now the permissions necessary to create new projects, but they need to apply for opt into security advisory coverage. Without applying, the projects will have a warning on projects that says:

This project is not covered by Drupal’s security advisory policy.