79% otp-by-email

Code Review | OTP by Email for Contact Form 7

WordPress plugin OTP by Email for Contact Form 7 scored 79% from 54 tests.

About plugin

  • Plugin page: otp-by-email
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Dec 1, 2020
  • Latest release: May 2, 2023
  • Number of updates: 10
  • Update frequency: every 88.3 days
  • Top authors: aurovrata (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 962 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.97ms] Passed 4 tests

A check of server-side resources used by OTP by Email for Contact Form 7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.94 ▼2.62
Dashboard /wp-admin3.31 ▲0.0054.15 ▼8.30
Posts /wp-admin/edit.php3.36 ▲0.0045.68 ▼8.70
Add New Post /wp-admin/post-new.php5.89 ▲0.00104.66 ▼12.24
Media Library /wp-admin/upload.php3.23 ▲0.0037.67 ▲4.65

Server storage [IO: ▲0.05MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by OTP by Email for Contact Form 7
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼0.791.61 ▼0.4552.36 ▲0.24
Dashboard /wp-admin2,203 ▲215.83 ▲0.94132.15 ▼10.8654.71 ▲4.57
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0146.26 ▼0.0737.22 ▼6.50
Add New Post /wp-admin/post-new.php1,533 ▼123.16 ▲0.01761.82 ▲57.8261.90 ▼8.42
Media Library /wp-admin/upload.php1,382 ▼64.22 ▼0.03131.63 ▲10.7353.79 ▼8.00

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/otp-by-email/public/partials/otp-by-email-public-display.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to a member function scan_form_tags() on null in wp-content/plugins/otp-by-email/admin/partials/otp-by-email-admin-display.php:12
    • > PHP Notice
      Undefined variable: contact_form in wp-content/plugins/otp-by-email/admin/partials/otp-by-email-admin-display.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: email validation, contact form 7 extension, otp, email verification, otp by email

otp-by-email/otp-by-email.php Passed 13 tests

The main PHP script in "OTP by Email for Contact Form 7" version 1.2.0 is automatically included on every request by WordPress
73 characters long description:
Enable OTP validation of an email field using the CF7 notification email.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin329 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP12106603305
PO File13324

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity4.29
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods412.50%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin