78% mtpl-insurance

Code Review | MTPL Insurance calculator

WordPress plugin MTPL Insurance calculator scored78%from 54 tests.

About plugin

  • Plugin page: mtpl-insurance
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.6
  • WordPress version: 6.3.1
  • First release: Jan 5, 2019
  • Latest release: Jan 20, 2021
  • Number of updates: 9
  • Update frequency: every 83.1 days
  • Top authors: sl147 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /641 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.27ms] Passed 4 tests

Server-side resources used by MTPL Insurance calculator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.31 ▼5.38
Dashboard /wp-admin3.32 ▲0.0145.64 ▼8.71
Posts /wp-admin/edit.php3.37 ▲0.0149.19 ▲5.33
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.25 ▲4.36
Media Library /wp-admin/upload.php3.24 ▲0.0132.66 ▲0.67

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for MTPL Insurance calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲20214.07 ▼0.2114.53 ▲12.7739.61 ▼3.71
Dashboard /wp-admin2,206 ▲185.84 ▲0.96110.50 ▼10.7944.16 ▲0.12
Posts /wp-admin/edit.php2,089 ▼32.03 ▼0.0139.25 ▲4.4335.09 ▲1.41
Add New Post /wp-admin/post-new.php1,534 ▼218.37 ▼4.89622.25 ▼68.9981.26 ▲27.13
Media Library /wp-admin/upload.php1,388 ▼04.23 ▼0.0097.62 ▼11.1842.13 ▼8.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mtpl-insurance/public/partials/mtpl-insurance-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mtpl-insurance/public/mtbl-insurance-shortcode.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: mtpl, calculator, insurance

mtpl-insurance/mtpl-insurance.php 85% from 13 tests

The primary PHP file in "MTPL Insurance calculator" version 1.0.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Description: The description should be shorter than 140 characters (currently 142 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
No dangerous file extensions were detected681 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3119439
PHP878302186
CSS36456

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity1.67
▷ Minimum class complexity1.00
▷ Maximum class complexity2.00
Average method complexity1.14
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1178.57%
▷ Protected methods00.00%
▷ Private methods321.43%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin