79% optin-comment-notifications

Code Review | Optin Comment Notifications

WordPress plugin Optin Comment Notifications scored79%from 54 tests.

About plugin

  • Plugin page: optin-comment-not...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.1
  • WordPress version: 6.3.1
  • First release: Jan 12, 2015
  • Latest release: Mar 27, 2019
  • Number of updates: 8
  • Update frequency: every 191.9 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /3,362 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼0.41ms] Passed 4 tests

This is a short check of server-side resources used by Optin Comment Notifications
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.60 ▲0.06
Dashboard /wp-admin3.34 ▲0.0447.18 ▼4.81
Posts /wp-admin/edit.php3.39 ▲0.0450.51 ▲3.46
Add New Post /wp-admin/post-new.php5.92 ▲0.0489.24 ▼0.35
Media Library /wp-admin/upload.php3.27 ▲0.0438.99 ▲6.52

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Optin Comment Notifications
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.32 ▼1.044.30 ▲2.4241.74 ▼4.59
Dashboard /wp-admin2,206 ▲184.81 ▼1.06108.01 ▼4.3938.38 ▼5.59
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0239.76 ▲1.4634.87 ▲2.72
Add New Post /wp-admin/post-new.php1,534 ▲1723.51 ▲5.95668.28 ▲34.6959.57 ▲12.56
Media Library /wp-admin/upload.php1,385 ▼64.20 ▲0.03100.30 ▲3.8042.61 ▲0.04

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% 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 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/optin-comment-notifications/tests/bootstrap.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/optin-comment-notifications/tests/bootstrap.php on line 17
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/optin-comment-notifications/tests/bootstrap.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: email, commenting, comment, coffee2code, notifications...

optin-comment-notifications/optin-comment-notifications.php Passed 13 tests

The principal PHP file in "Optin Comment Notifications" v. 1.4 is loaded by WordPress automatically on each request
89 characters long description:
Allows users to opt into receiving a notification whenever a comment is made to the site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin456 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4140243338
Markdown224082
Bourne Shell17322
XML10014

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity10.50
▷ Minimum class complexity3.00
▷ Maximum class complexity18.00
Average method complexity1.51
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods37
▷ Static methods821.62%
▷ Public methods3594.59%
▷ Protected methods00.00%
▷ Private methods25.41%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin