83% ob-contact-form-to-db

Code Review | OB Contact Form to DB

WordPress plugin OB Contact Form to DB scored83%from 54 tests.

About plugin

  • Plugin page: ob-contact-form-t...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.3
  • WordPress version: 6.3.1
  • First release: Aug 11, 2015
  • Latest release: Aug 11, 2015
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: owebest (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,569 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.16ms] Passed 4 tests

A check of server-side resources used by OB Contact Form to DB
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.81 ▼0.25
Dashboard /wp-admin3.34 ▲0.0363.13 ▲12.46
Posts /wp-admin/edit.php3.39 ▲0.0345.54 ▼5.57
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.63 ▼5.86
Media Library /wp-admin/upload.php3.26 ▲0.0333.90 ▼0.97
Entries /wp-admin/admin.php?page=entries3.2129.19

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 58 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for OB Contact Form to DB
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.171.67 ▼0.2044.16 ▲0.73
Dashboard /wp-admin2,206 ▲155.85 ▲0.96112.74 ▼3.0638.10 ▼3.78
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0239.68 ▼3.4335.05 ▼1.05
Add New Post /wp-admin/post-new.php1,519 ▼1423.46 ▲0.10673.18 ▲74.3353.72 ▲6.63
Media Library /wp-admin/upload.php1,391 ▼04.31 ▲0.1395.91 ▼4.7343.14 ▼0.10
Entries /wp-admin/admin.php?page=entries1,0742.6761.9369.59

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ob-contact-form-to-db/contact-form-db.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (OB Contact Form to DB Entries) image missing
Please take inspiration from this readme.txt

ob-contact-form-to-db/contact-form-db.php 85% from 13 tests

The primary PHP file in "OB Contact Form to DB" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ob-contact-form-to-db.php" instead of "contact-form-db.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 199 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin11,358 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript72,7438,2689,421
CSS71481591,595
PHP11815201
JSON400108
Markdown229033

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions5
▷ Named functions5100.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
25 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
DataTables/media/images/back_enabled_hover.png1.34KB0.60KB▼ 55.56%
DataTables/extensions/TableTools/images/csv.png1.57KB1.02KB▼ 35.10%
DataTables/extensions/TableTools/images/background.png0.92KB0.08KB▼ 91.21%
DataTables/extensions/TableTools/images/xls_hover.png2.01KB1.31KB▼ 35.13%
DataTables/media/images/sort_asc.png1.09KB0.25KB▼ 77.46%