84% optional-email

Code Review | Optional Email

WordPress plugin Optional Email scored84%from 54 tests.

About plugin

  • Plugin page: optional-email
  • Plugin version: 1.3.11
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Jul 27, 2012
  • Latest release: Nov 24, 2023
  • Number of updates: 18
  • Update frequency: every 229.9 days
  • Top authors: djanym (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

900+ active /7,641 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
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.31ms] Passed 4 tests

An overview of server-side resources used by Optional Email
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.84 ▲1.21
Dashboard /wp-admin3.36 ▲0.0647.03 ▼1.02
Posts /wp-admin/edit.php3.42 ▲0.0648.27 ▼5.59
Add New Post /wp-admin/post-new.php5.95 ▲0.0682.91 ▼14.70
Media Library /wp-admin/upload.php3.29 ▲0.0633.70 ▲0.09

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Optional Email: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3414.68 ▲0.331.68 ▲0.1540.37 ▼1.76
Dashboard /wp-admin2,201 ▲335.59 ▼0.0290.92 ▼8.9542.01 ▼4.01
Posts /wp-admin/edit.php2,103 ▼02.02 ▲0.0839.15 ▼2.8035.92 ▲0.71
Add New Post /wp-admin/post-new.php1,529 ▲323.33 ▲0.13630.82 ▼18.1854.73 ▼8.72
Media Library /wp-admin/upload.php1,397 ▼34.31 ▲0.1696.37 ▼6.3841.00 ▼2.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/optional-email/inc/woocommerce.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/optional-email/optional-email.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: password registration, email field, registration email, profile email

optional-email/optional-email.php Passed 13 tests

The primary PHP file in "Optional Email" version 1.3.11 is used by WordPress to initiate all plugin functionality
43 characters long description:
Makes email optional field for registration

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
Good job! No executable or dangerous file extensions detected237 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP249124237

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin