88% mw-wp-form

Code Review | MW WP Form

WordPress plugin MW WP Form scored 88% from 54 tests.

About plugin

  • Plugin page: mw-wp-form
  • Plugin version: 4.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 5.9.2
  • First release: Dec 17, 2012
  • Latest release: Dec 1, 2020
  • Number of updates: 317
  • Update frequency: every 9.2 days
  • Top authors: inc2734 (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

200,000+ active / 835,614 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼300.12ms] Passed 4 tests

This is a short check of server-side resources used by MW WP Form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2553.81 ▲2.23
Dashboard /wp-admin3.59 ▲0.1933.02 ▼0.30
Posts /wp-admin/edit.php3.82 ▲0.1837.71 ▼0.77
Add New Post /wp-admin/post-new.php7.15 ▲0.1594.55 ▼1,201.65
Media Library /wp-admin/upload.php3.53 ▲0.2425.92 ▲2.65
MW WP Form /wp-admin/edit.php?post_type=mw-wp-form3.5932.78
Add New /wp-admin/post-new.php?post_type=mw-wp-form4.0448.22

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 143 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for MW WP Form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,804 ▲6215.89 ▲0.315.45 ▼0.052.11 ▲0.07
Dashboard /wp-admin2,929 ▲746.13 ▼0.03113.63 ▼19.32154.18 ▼6.70
Posts /wp-admin/edit.php2,725 ▲403.23 ▼0.0164.24 ▲1.41138.64 ▼2.91
Add New Post /wp-admin/post-new.php1,686 ▲2516.67 ▲1.10409.53 ▲4.79154.15 ▲6.82
Media Library /wp-admin/upload.php1,735 ▲375.48 ▼0.06135.16 ▼7.84188.58 ▲7.03
MW WP Form /wp-admin/edit.php?post_type=mw-wp-form1,4272.9360.00112.03
Add New /wp-admin/post-new.php?post_type=mw-wp-form8,52212.50365.21255.78

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mw-wp-form/templates/contact-data-list/admin-print-styles.php
    • > /wp-content/plugins/mw-wp-form/templates/form-fields/checkbox.php
    • > /wp-content/plugins/mw-wp-form/templates/contact-data/admin-print-styles.php
  • 106× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mw-wp-form/templates/chart/index.php:12
    • > PHP Notice
      Undefined variable: column in wp-content/plugins/mw-wp-form/templates/contact-data-list/column.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'MW_WP_Form_Abstract_Form_Field' not found in wp-content/plugins/mw-wp-form/classes/form-fields/class.datepicker.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/mw-wp-form/templates/form-fields/textarea.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/mw-wp-form/templates/admin-list/form-key.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/mw-wp-form/templates/form-fields/button_button.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'MW_WP_Form_Abstract_Validation_Rule' not found in wp-content/plugins/mw-wp-form/classes/validation-rules/class.alpha.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'MW_WP_Form_Abstract_Form_Field' not found in wp-content/plugins/mw-wp-form/classes/form-fields/class.zip.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/mw-wp-form/templates/admin/complete-message.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/mw-wp-form/templates/form-fields/button_submit.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
Please take inspiration from this readme.txt

mw-wp-form/mw-wp-form.php 92% from 13 tests

"MW WP Form" version 4.4.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 197 characters long)

Code Analysis Passed 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 plugin9,683 lines of code in 141 files:
LanguageFilesBlank linesComment linesLines of code
PHP1251,5244,8758,942
CSS843125434
JavaScript82835307

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity11.36
▷ Minimum class complexity1.00
▷ Maximum class complexity104.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes86
▷ Abstract classes22.33%
▷ Concrete classes8497.67%
▷ Final classes00.00%
Methods551
▷ Static methods366.53%
▷ Public methods35163.70%
▷ Protected methods19335.03%
▷ Private methods71.27%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants00.00%
▷ Class constants15100.00%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/handle.png0.20KB0.10KB▼ 48.28%