67% contact-form-to-db

Code Review | Contact Form to DB by BestWebSoft - Messages Database Plugin For WordPress

WordPress plugin Contact Form to DB by BestWebSoft - Messages Database Plugin For WordPress scored67%from 54 tests.

About plugin

  • Plugin page: contact-form-to-db
  • Plugin version: 1.7.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Oct 24, 2013
  • Latest release: Aug 10, 2023
  • Number of updates: 60
  • Update frequency: every 59.6 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /97,351 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲1.12MB] [CPU: ▲3.57ms] Passed 4 tests

An overview of server-side resources used by Contact Form to DB by BestWebSoft - Messages Database Plugin For WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.62 ▲1.1656.90 ▲12.26
Dashboard /wp-admin4.46 ▲1.1557.96 ▲6.33
Posts /wp-admin/edit.php4.51 ▲1.1551.98 ▲2.24
Add New Post /wp-admin/post-new.php6.99 ▲1.1191.73 ▲0.49
Media Library /wp-admin/upload.php4.32 ▲1.0946.49 ▲5.21
BWS Panel /wp-admin/admin.php?page=cntctfrmtdb-bws-panel4.6247.24
CF7 to DB /wp-admin/admin.php?page=cntctfrmtdb_manager_cf74.2838.07
POJO to DB /wp-admin/admin.php?page=cntctfrmtdb_manager_pojo4.2841.54
CF to DB /wp-admin/admin.php?page=cntctfrmtdb_manager4.3045.09

Server storage [IO: ▲5.22MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 129 new files
Database: 7 new tables, 8 new options
New tables
wp_cntctfrmtdb_refer
wp_cntctfrmtdb_blogname
wp_cntctfrmtdb_message
wp_cntctfrmtdb_to_email
wp_cntctfrmtdb_message_status
wp_cntctfrmtdb_field_selection
wp_cntctfrmtdb_hosted_site
New WordPress options
widget_recent-posts
cntctfrmtdb_options
widget_recent-comments
bstwbsftwppdtplgns_options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Contact Form to DB by BestWebSoft - Messages Database Plugin For WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲9914.26 ▼0.021.99 ▲0.2540.59 ▼1.28
Dashboard /wp-admin2,238 ▲575.61 ▼0.1186.51 ▼16.1944.78 ▼1.19
Posts /wp-admin/edit.php2,146 ▲462.05 ▲0.0735.88 ▼5.4839.60 ▲0.85
Add New Post /wp-admin/post-new.php1,564 ▲3822.81 ▼0.47639.72 ▼32.3658.40 ▼1.85
Media Library /wp-admin/upload.php1,446 ▲464.20 ▲0.0399.65 ▲1.3344.83 ▼0.72
BWS Panel /wp-admin/admin.php?page=cntctfrmtdb-bws-panel2,8592.0238.0475.19
Settings /wp-admin/contact_form_to_db.php260.420.1014.62
CF7 to DB /wp-admin/admin.php?page=cntctfrmtdb_manager_cf71,1731.7824.3326.27
POJO to DB /wp-admin/admin.php?page=cntctfrmtdb_manager_pojo1,1761.7125.0729.47
CF to DB /wp-admin/admin.php?page=cntctfrmtdb_manager1,2571.9729.9332.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 7 tables
    • wp_cntctfrmtdb_field_selection
    • wp_cntctfrmtdb_hosted_site
    • wp_cntctfrmtdb_refer
    • wp_cntctfrmtdb_message
    • wp_cntctfrmtdb_to_email
    • wp_cntctfrmtdb_message_status
    • wp_cntctfrmtdb_blogname
  • Zombie WordPress options detected upon uninstall: 8 options
    • db_upgraded
    • cntctfrmtdb_options
    • can_compress_scripts
    • bstwbsftwppdtplgns_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/contact-form-to-db/includes/class-cntctfrmtdb-settings.php:7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-to-db/contact_form_to_db.php on line 1356
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/contact-form-to-db/contact_form_to_db.php on line 1356
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/contact-form-to-db/contact_form_to_db.php on line 1356
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/contact-form-to-db/bws_menu/product_list.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-to-db/bws_menu/class-bws-settings.php:1453

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=cntctfrmtdb-bws-panel
    • > Network (severe)
    http://ps.w.org/custom-admin-page/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/contact_form_to_db.php
    • > Network (severe)
    wp-admin/contact_form_to_db.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Plugin settings in WordPress admin panel.), #2 (Contact Form to DB manager page display.), #3 (Message on the Contact Form to DB manager page display.), #4 (Spam page on the Contact Form to DB manager page display.)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

contact-form-to-db/contact_form_to_db.php 92% from 13 tests

The entry point to "Contact Form to DB by BestWebSoft - Messages Database Plugin For WordPress" version 1.7.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("contact-form-to-db.php" instead of "contact_form_to_db.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 detected22,289 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PO File146,16211,7459,603
PHP95567266,349
CSS91562565,481
JavaScript637138689
SVG400167

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.58
Average class complexity78.25
▷ Minimum class complexity10.00
▷ Maximum class complexity210.00
Average method complexity9.58
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods36
▷ Static methods00.00%
▷ Public methods3083.33%
▷ Protected methods00.00%
▷ Private methods616.67%
Functions78
▷ Named functions78100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
65 PNG files occupy 3.28MB with 1.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/status-icons.png2.47KB2.54KB0.00%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
bws_menu/icons/themes/renty.png657.95KB198.11KB▼ 69.89%
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.17KB▼ 53.39%