84% simpleform

Code Review | SimpleForm – Contact form made simple

WordPress plugin SimpleForm – Contact form made simple scored84%from 54 tests.

About plugin

  • Plugin page: simpleform
  • Plugin version: 2.1.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0
  • WordPress version: 6.3.1
  • First release: Dec 1, 2019
  • Latest release: Jun 1, 2022
  • Number of updates: 58
  • Update frequency: every 16.4 days
  • Top authors: simpleform (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /16,756 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.22MB] [CPU: ▲5.61ms] Passed 4 tests

An overview of server-side resources used by SimpleForm – Contact form made simple
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.71 ▲1.2542.79 ▲5.08
Dashboard /wp-admin4.54 ▲1.2454.01 ▲3.35
Posts /wp-admin/edit.php4.59 ▲1.2457.10 ▲7.18
Add New Post /wp-admin/post-new.php7.44 ▲1.55105.45 ▲6.82
Media Library /wp-admin/upload.php4.40 ▲1.1744.14 ▲9.93
Editor /wp-admin/admin.php?page=sform-editor4.8342.46
Add New /wp-admin/admin.php?page=sform-new4.6340.19
Settings /wp-admin/admin.php?page=sform-settings5.3244.48
Entries /wp-admin/admin.php?page=sform-entries4.5840.50
Support /wp-admin/admin.php?page=sform-support4.3737.62
Forms /wp-admin/admin.php?page=sform-forms4.3839.82
Form /wp-admin/admin.php?page=sform-form4.6839.57

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 54 new files
Database: 2 new tables, 12 new options
New tables
wp_sform_shortcodes
wp_sform_submissions
New WordPress options
sform_attributes
widget_theysaidso_widget
sform_additional_script
sform_settings
widget_sform_widget
sform_db_version
can_compress_scripts
widget_recent-posts
sform_additional_style
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for SimpleForm – Contact form made simple
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲6413.37 ▼1.211.73 ▼0.1741.65 ▼4.61
Dashboard /wp-admin2,241 ▲534.88 ▼0.17114.67 ▲6.4938.26 ▼4.67
Posts /wp-admin/edit.php2,127 ▲382.06 ▲0.0438.34 ▲0.6033.16 ▼1.88
Add New Post /wp-admin/post-new.php6,385 ▲4,84323.60 ▲5.15936.70 ▲255.1458.60 ▲4.80
Media Library /wp-admin/upload.php1,420 ▲324.23 ▲0.10101.90 ▼13.3043.78 ▼4.18
Editor /wp-admin/admin.php?page=sform-editor1,8812.1629.6338.61
Add New /wp-admin/admin.php?page=sform-new1,8752.1627.5835.49
Settings /wp-admin/admin.php?page=sform-settings2,0861.7729.2433.04
Entries /wp-admin/admin.php?page=sform-entries8242.2225.8846.05
Support /wp-admin/admin.php?page=sform-support8192.0225.5935.51
Forms /wp-admin/admin.php?page=sform-forms1,0831.8726.2129.57
Form /wp-admin/admin.php?page=sform-form9452.1227.9331.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

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

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simpleform/admin/includes/class-widget.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
10 plugin tags: captcha, ajax, contact form, email, custom form...

simpleform/simpleform.php Passed 13 tests

This is the main PHP file of "SimpleForm – Contact form made simple" version 2.1.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
124 characters long description:
Create a basic contact form for your website. Lightweight and very simple to manage, SimpleForm is immediately ready to use.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin7,730 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP251,5031,0385,682
JavaScript79771,120
CSS63834779
JSON100149

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.79
Average class complexity132.17
▷ Minimum class complexity4.00
▷ Maximum class complexity548.00
Average method complexity13.30
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods128
▷ Static methods2519.53%
▷ Public methods12396.09%
▷ Protected methods00.00%
▷ Private methods53.91%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/block/img/transparent.png0.09KB0.10KB0.00%
public/img/confirmation.png2.58KB2.92KB0.00%
admin/block/img/block-preview.png0.92KB0.99KB0.00%
admin/block/build/images/transparent.f55e0d8b.png0.09KB0.10KB0.00%
admin/img/copy_icon.png0.42KB0.46KB0.00%