68% mailtarget-form

Code Review | MTARGET Form

WordPress plugin MTARGET Form scored 68% from 54 tests.

About plugin

  • Plugin page: mailtarget-form
  • Plugin version: 2.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 5, 2018
  • Latest release: Mar 31, 2023
  • Number of updates: 50
  • Update frequency: every 38.5 days
  • Top authors: timenz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,141 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

This is a short check of server-side resources used by MTARGET Form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.40 ▼3.61
Dashboard /wp-admin3.35 ▲0.0551.03 ▲3.20
Posts /wp-admin/edit.php3.40 ▲0.0447.71 ▼2.48
Add New Post /wp-admin/post-new.php5.93 ▲0.0483.51 ▼23.80
Media Library /wp-admin/upload.php3.27 ▲0.0439.99 ▲3.06
New Form /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-widget-form3.2730.50
Popup Setting /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-popup-main3.2432.67
New Form /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-widget-add3.2429.24
Setting /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-config3.2731.36
List Form /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu3.2431.12
Edit Form /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-widget-edit3.2132.22

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 48 new files
Database: 1 new table, 7 new options
New tables
wp_mailtarget_forms
New WordPress options
widget_recent-posts
db_upgraded
widget_mailtarget_widget
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for MTARGET Form
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,029 ▲27214.37 ▼0.0610.60 ▲8.3337.20 ▼6.48
Dashboard /wp-admin2,227 ▲424.85 ▼0.97100.02 ▼10.2679.66 ▲35.14
Posts /wp-admin/edit.php2,125 ▲362.01 ▲0.0037.29 ▼1.2333.78 ▲1.33
Add New Post /wp-admin/post-new.php1,697 ▲15522.26 ▲3.88728.43 ▲112.0257.15 ▼4.57
Media Library /wp-admin/upload.php1,421 ▲334.24 ▲0.04110.14 ▲11.0245.60 ▲1.05
New Form /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-widget-form8242.0224.3826.25
Popup Setting /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-popup-main8272.1824.2526.15
New Form /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-widget-add8232.0124.2122.69
Setting /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-config8852.0727.5324.19
List Form /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu8242.0123.5026.29
Edit Form /wp-admin/admin.php?page=mailtarget-form-plugin--admin-menu-widget-edit6911.146.5616.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_mailtarget_forms
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_mailtarget_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/mailtarget-form/views/render/input_checkbox.php
    • > /wp-content/plugins/mailtarget-form/views/render/input_multiple.php
  • 54× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: row in wp-content/plugins/mailtarget-form/views/render/input_dropdown.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mailtarget-form/views/render/input_phone.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mailtarget-form/views/render/input_multiple.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mailtarget-form/include/mailtarget_shortcode.php:93
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mailtarget-form/views/render/input_upload.php on line 10
    • > PHP Notice
      Undefined variable: error in wp-content/plugins/mailtarget-form/views/admin/error.php on line 12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mailtarget-form/views/render/input_multiple.php on line 61
    • > PHP Notice
      Trying to get property 'data' of non-object in wp-content/plugins/mailtarget-form/views/admin/wp_form_edit.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mailtarget-form/include/mailtarget_widget.php:14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mailtarget-form/views/render/input_checkbox.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: webform, mtarget, newsletter, subscribe, marketing...

mailtarget-form/mailtarget-form.php Passed 13 tests

Analyzing the main PHP file in "MTARGET Form" version 2.1.5
123 characters long description:
The MTARGET plugin to simplify embedding MTARGET Form in your post or as widget, also easily to set MTARGET Forms as popup.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected4,157 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP231704792,021
CSS3201,017
LESS115951,003
JavaScript314774
Markdown112031
SVG2006
JSON1005

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity37.40
▷ Minimum class complexity2.00
▷ Maximum class complexity151.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity60.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods46
▷ Static methods613.04%
▷ Public methods4291.30%
▷ Protected methods00.00%
▷ Private methods48.70%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/image/wp-icon-compose.png0.51KB0.60KB0.00%
assets/image/mt-icon-32x32.png1.16KB1.60KB0.00%
assets/image/mt-icon-20x20.png0.87KB1.35KB0.00%
assets/image/wp-icon.png0.81KB0.71KB▼ 12.33%