Email Obfuscate Field for Drupal 8

https://www.drupal.org/project/obfuscate_email

Source

git clone command:

git clone --branch 8.x-1.x https://git.drupal.org/project/obfuscate_email.git
cd obfuscate_email_field

GitHub: https://www.github.com/WondrousLLC/obfuscate_email_field

What Is This?

This is a template to override the field output ot the type email. To hide your
emails from bots, render a non readable email on the server and decrypt it via
vanilla JS in the client. No jQuery needed. The
basic idea
consists of three parts:

  • hide behind a data-attribute
  • substitute the @-sign and dots (.) with /at/, /dot/, then
  • shift everything via rot13
  • rebuild it via javascript

How To Use it

Have a look into template/field--email.html.twig to have a fully working
example. This template will be used when the module is enabled. Use the
drupal suggestion system to override this default template. The JS is attached
inside the twig template.

<a data-mail-to="znvy/ng/znvy/qbg/pbz">Email</a>
<a data-mail-to="znvy/ng/znvy/qbg/pbz" data-replace-inner="">Email</a>
<span data-mail-to="znvy/ng/znvy/qbg/pbz" data-replace-inner="@mail">drop me a line at @mail</span>

will be converted to

<a href="mailto:mail@mail.com">Email</a>
<a href="mailto:mail@mail.com">mail@mail.com</a>
<span>drop me a line at mail@mail.com</span>

Comments

tassilogroeper created an issue. See original summary.

PA robot’s picture

Issue summary: View changes

Fixed the git clone URL in the issue summary for non-maintainer users.

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.

sourabh.singhal’s picture

Status: Active » Needs work

Hi tassilogroeper,

There are some issues in your code which was detected on "https://pareview.sh" site. For your reference here is the URL for PA Review Code Result.

Thanks
Sourdrup

tassilogroeper’s picture

Status: Needs work » Needs review

Thank you @sourdrup. updated the recommendations.

damondt’s picture

Module works, great idea. Just a few problems.

  • The email-obfuscatior.js file is included on every page, not just the ones where the field is used.
  • The twig template by default applies to all email fields. A more drupaly way to go about this would be to create a field formatter.
  • The module package is called Wondrous, which seems a bit cheeky.
tassilogroeper’s picture

Issue summary: View changes
tassilogroeper’s picture

@damondt Thank you for your review. I updated the docs

1. used attach_library in the twig template.
2. Yes that would be correct. But this is actually by design, since there should not be an email clearly readable - even by accident. I can not guarantee it, I know.
3. missed that. corrected it.

tassilogroeper’s picture

bump

apaderno’s picture

Priority: Normal » Critical

To the reviewers: Please change back the priority to Normal after doing a review.

sleitner’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

Automated Review

pareview details: https://pareview.sh/pareview/https-git.drupal.org-project-obfuscate_emai...

Git errors:

  • There is still a master branch, make sure to set the correct default branch

Review of the 8.x-1.x branch (commit c609e16):

  • Your README.md does not follow best practices (headings need to be uppercase).
  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
  • DrupalPractice has found some issues with your code, but could be false positives.
  • No automated test cases were found, did you consider writing PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation. Similar: https://www.drupal.org/project/obfuscate provides twig function and service
Master Branch
No: Does not follow the guidelines for master branch. See pareview details
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
guidelines for 3rd party assets/code.
README.txt/README.md
No: Does not follow the guidelines for in-project documentation and/or the README Template. See pareview details
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
None

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.

sleitner’s picture

Issue summary: View changes
apaderno’s picture

Status: Needs work » Closed (won't fix)

If you are still working on this application, you should fix all known problems and set the status to Needs review. (See also the project application workflow.)
Please don't change status of this application if you aren't sure you have time to dedicate to this application, or it will be closed again as won't fix.

I am closing this application due to lack of activity.