84% direct-mail-subscribe-form

Code Review | Direct Mail Subscribe Form

WordPress plugin Direct Mail Subscribe Form scored84%from 54 tests.

About plugin

  • Plugin page: direct-mail-subsc...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.9.2
  • WordPress version: 6.3.1
  • First release: Aug 25, 2009
  • Latest release: Mar 22, 2022
  • Number of updates: 54
  • Update frequency: every 85.3 days
  • Top authors: raenner (90.74%)steven_tang (11.11%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /12,953 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Direct Mail Subscribe Form
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.88 ▼2.69
Dashboard /wp-admin3.34 ▲0.0450.43 ▲0.84
Posts /wp-admin/edit.php3.40 ▲0.0451.41 ▼4.20
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.05 ▼14.16
Media Library /wp-admin/upload.php3.27 ▲0.0434.71 ▼2.35

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_directmail_sg
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Direct Mail Subscribe Form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲3514.72 ▼0.002.04 ▼0.0240.76 ▼8.39
Dashboard /wp-admin2,197 ▲205.61 ▼0.0493.96 ▲3.6739.61 ▼4.23
Posts /wp-admin/edit.php2,102 ▲22.01 ▲0.0642.73 ▲6.0035.32 ▲1.45
Add New Post /wp-admin/post-new.php1,537 ▲1118.61 ▼4.87653.18 ▼34.4568.99 ▲6.25
Media Library /wp-admin/upload.php1,402 ▼14.21 ▲0.01103.56 ▼5.8246.42 ▲0.93

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_directmail_sg
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/direct-mail-subscribe-form/DirectMailSubscribeForm.php:43

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: email newsletter, mailing list, direct mail, mailing, subscription...

direct-mail-subscribe-form/DirectMailSubscribeForm.php 85% from 13 tests

The main file in "Direct Mail Subscribe Form" v. 1.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 168 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("direct-mail-subscribe-form.php" instead of "DirectMailSubscribeForm.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected169 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13334169

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods480.00%
▷ Protected methods00.00%
▷ Private methods120.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected