Phoneword is a simple module that provides a block displaying a click-to-call telephone link that cross-fades between a phone word and its corresponding phone number. Clicking the link will launch the user's phone dialler (if installed) or alternatively it can link to a "contact us" page. There's also a little SVG phone handset icon with CSS ringing animation, which can be changed or removed by overriding the CSS.

Phoneword animation

Project Page

https://www.drupal.org/sandbox/inteja/2633760

Git Clone

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/inteja/2633760.git phoneword

Comments

inteja created an issue. See original summary.

PA robot’s picture

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.

adam_’s picture

Status: Needs review » Reviewed & tested by the community

I like it. Phone numbers are always easier to remember as word.

Very straightforward code example for review.

Licensing looks good. Individual user account. Style and spacing looks good as well. It does what it's supposed to do, looks good. No 3rd party assets/code. Just hits the recommended 5 functions for minimum code length.

Marking as Reviewed & tested by the community.

inteja’s picture

Thanks hook_awesome!

inteja’s picture

Now this is at RBTC I'm not sure what to do next. Do I just wait for a git admin to give me 'create full projects' permissions or should I change the status back to 'needs review', try to get some more reviews and participate in the review bonus program (happy to do anyway in a week or so when I'm more free)?

moshnoi’s picture

Status: Reviewed & tested by the community » Needs work

Hi,
I found some problems:
1. Implement hook_uninstall() and delete the variables set in module(use variable_del());
2. Use Drupal.behaviors instead of $(document).ready().

inteja’s picture

Status: Needs work » Needs review
chanderbhushan’s picture

Status: Needs review » Needs work

Hi @inteja,

Thanks for your contribution
I found some issues

1. $phoneword_tooltip = variable_get('phoneword_tooltip', 'Click to call us'); use t() function for strings
2.

phoneword_wrapper' => array(
        '#prefix' => '<div id="phoneword-wrapper"><a href="tel:' . $phoneword_link . '" title="' . $phoneword_tooltip . '"><div id="phonewords">',

can't we use l() instead of .

inteja’s picture

Thanks chanderbhushan.

RE 1) I've changed to use t().

RE 2) Not sure about this one, given that the link wraps multiple nested divs.

inteja’s picture

Status: Needs work » Needs review

Changing back to needs review. Not sure if using l() in this context would be an improvement, but happy for any advice or suggestions to the contrary.

Rahul Seth’s picture

Automated Review

Review of the 7.x-1.x branch (commit 747d335):

No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

Note that perfect adherence to Drupal Coding Standard is NOT a reason to block an application, except for total disregard of them. However, modules should follow them as closely as possible.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
No: Causes module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. (*) Nothing
  2. (+) It would be good, if you implement hook_permission in your module.
  3. Just a recommendation
  4. Use more comments on module file.

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.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

Rahul Seth’s picture

Status: Needs review » Reviewed & tested by the community
inteja’s picture

Thanks Rahul Seth.

inteja’s picture

Thanks Rahul Seth.

mlhess’s picture

Status: Reviewed & tested by the community » Needs review

This module has security issues in it. You accept user input but don't filter it.

jthorson’s picture

Status: Needs review » Needs work
klausi’s picture

Issue tags: +PAreview: security

@mlhess we use this tag to track security issues in project applications.

Could you also be a bit more specific so that the applicants know where exactly they need to fix something?

inteja’s picture

Status: Needs work » Needs review

Thanks for the feedback @mlhess @jthorson and @klausi.

I've wrapped all user-submitted variable output in check_plain() according to Handle text in a secure fashion.

http://cgit.drupalcode.org/sandbox-inteja-2633760/commit/?id=b25ad7c

romanblanyar’s picture

Hello, I have installed and tested the functionality of the module. It works well and does not cause errors or failures. Your module is quite efficient and can be used at various sites. Thanks.

klausi’s picture

@romanblanyar: looks like you forgot to change the status? I this now RTBC after your code review or are there any blockers left?

RavindraSingh’s picture

Assigned: Unassigned » RavindraSingh

reviewing this module

RavindraSingh’s picture

Status: Needs review » Needs work

<a href="tel:' . $phoneword_link . '" title="' . $phoneword_tooltip . '"> Needs to be wrapped in l() function.

Javascript coding standard for Drupal 7 module is missing in JS file.

(function ($) {
  'use strict';

  Drupal.behaviors.phoneword = {
    attach: function (context, settings) {

      // Get settings.
      var element = settings.phoneword.element;
      var fadeInterval = settings.phoneword.fadeInterval;
      var fadeDuration = settings.phoneword.fadeDuration;
inteja’s picture

@RavindraSingh can you please be a little more specific?

I addressed the same l() wrapping question in #9 above. Given the link wraps multiple nested divs, how would you suggest I use l() in this case or restructure the markup?

What exactly is missing in the JS file?

RavindraSingh’s picture

Assigned: RavindraSingh » Unassigned
Issue summary: View changes

@inteja, This is how you can optimize your code to use l().

Example:

$phoneword_link = '12343455';
  $phoneword_tooltip = '434455text';
  $options = array(
                        'attributes' => array (
                            'class' => 'phonewords',
                            'id' => 'phonewords',
                            'title' => $phoneword_tooltip,
                        ),
                    );
 l('phonewords', 'tel:' . $phoneword_link, $options);

For JS, commenting is very important thats why I have added JS link in #22

Follow #2183405: [Obsolete] JavaScript API documentation and comment standards and see the example for the coding standard.

/**
 * Attaches the table drag behavior to tables.
 *
 * @type {Drupal~behavior}
 * 
 * @prop {Drupal~behaviorAttach} attach
 *   Specific description of this attach function goes here.
 * @prop {Drupal~behaviorDetach} detach
 *   Specific description of this detach function goes here.
 */
Drupal.behaviors.tableDrag = {
  attach: function (context, settings) {
    // ...
  },
  detach: function (context, settings, trigger) {
    // …
  }
};
inteja’s picture

Status: Needs work » Needs review

@RavindraSingh thanks. I've made the suggested changes. See a01ec36

As previously mentioned (#9 & #23), ideally I wanted the one link to wrap multiple divs (both the phone word and number) and I couldn't work out how to do that with l(). Your code example doesn't illustrate how I could do this with l(). However, I've changed it as per your suggestion and the code is definitely cleaner but with separate links on the phone word and number, if the user's pointer is hovering over a link, when it cross-fades to the other link, unless the user moves their pointer then the :hover pseudo-class is not updated. It's just a small cosmetic thing, but that's one reason why I wanted the link to wrap both divs and why I initially avoided the l() function.

RavindraSingh’s picture

Assigned: Unassigned » RavindraSingh

@inteja, Fantastic, I will review your changes.

I understand your concerns, But now it is more good approach. give a clear documentation to end module user so if they want to add they can.
For hovering effect you can add css for outer div??

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxinteja2633760git

I'm a robot and this is an automated message from Project Applications Scraper.

inteja’s picture

Status: Needs work » Needs review

Fixed code standards issues found by robot. See e8f1c27

RavindraSingh’s picture

StatusFileSize
new111.98 KB

I see very simple issue the the phone word is overlapping phone no.

Phone world

And there is no animation.

If you this is happening because of l('phonewords', 'tel:' . $phoneword_link, $options); implemented. Please mentioned clearly in the description of the issue and take this to that old stage. So community can review your module.

inteja’s picture

Works for me sorry. Will do some more testing.

inteja’s picture

@RavindraSingh I just tried a fresh local install of Drupal 7.43 and latest phoneword and it works as expected for me.

inteja’s picture

Assigned: RavindraSingh » Unassigned

@RavindraSingh I've tested this on a handful of sites now and can't replicate what you are reporting. The only other thing that's changed are code style in response to new PA robot ESLint reported issues, namely double quotes " changed to single quotes ' in the JS file. I can't see how this would cause any problems.

saraswathi ravikumar’s picture

StatusFileSize
new13.24 KB

Hi inteja,

Please add validation to the link field. Right now it is accepting even alphabets. Please refer to screenshot attached.

Thanks,
Sarah.

inteja’s picture

Bumping in the hopes of getting some more reviews ...

inteja’s picture

Rather than add numeric validation to the link field I've actually made it more generic by removing the hard-coded "tel:" prefix. This way people can link to either a phone number or for instance their "contact us" page, which is also a common use-case.

See issue https://www.drupal.org/node/2750481

Please review.

inteja’s picture

Issue summary: View changes
inteja’s picture

Issue summary: View changes
inteja’s picture

Issue summary: View changes
abhishek.pareek’s picture

Status: Needs review » Needs work

I guess you have not fixed all coding standard issue, you missed this one http://pareview.sh/pareview/httpgitdrupalorgsandboxinteja2633760git.

klausi’s picture

Status: Needs work » Needs review

Minor coding standard issues are surely not application blockers, anything else that you found or should this be RTBC instead?

inteja’s picture

Fixed minor code standards issue.

inteja’s picture

Can anyone take another look at this? I think it's fundamentally sound, plus it's a quick, simple module to review.

Thanks in advance.

lionslair’s picture

Status: Needs review » Reviewed & tested by the community

Appears to be passing all automated tests

http://pareview.sh/pareview/httpgitdrupalorgsandboxinteja2633760git-7x-1x

Manual Review

Individual user account
[Yes: Follows ] the guidelines for individual user accounts.
No duplication
[Yes: Does not cause] module duplication and/or fragmentation.
Master Branch
[Yes: Follows] the guidelines for master branch.
README.txt
[Yes: Follows] the guidelines for in-project documentation and/or the README Template.
Secure code
[Yes: Meets the security requirements]
inteja’s picture

@lionslair thanks

chanderbhushan’s picture

inteja’s picture

Issue tags: -PAreview: security
misc’s picture

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

inteja, please don't remove PAReview: security - they are kept even after it is fixed.

With that said:

Thanks for your contribution, inteja!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

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 stay 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.

inteja’s picture

Thanks very much MiSc!

chanderbhushan’s picture

Status: Fixed » Closed (fixed)

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