84% cc-canadian-mortgage-calculator

Code Review | CC Canadian Mortgage Calculator

WordPress plugin CC Canadian Mortgage Calculator scored84%from 54 tests.

About plugin

  • Plugin page: cc-canadian-mortg...
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 13, 2014
  • Latest release: Jul 26, 2023
  • Number of updates: 43
  • Update frequency: every 74.6 days
  • Top authors: CalculatorsCanada.ca (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /3,972 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.60ms] Passed 4 tests

This is a short check of server-side resources used by CC Canadian Mortgage Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.81 ▲1.31
Dashboard /wp-admin3.35 ▲0.0043.51 ▼14.48
Posts /wp-admin/edit.php3.40 ▲0.0446.91 ▼1.61
Add New Post /wp-admin/post-new.php5.95 ▲0.0685.94 ▼3.63
Media Library /wp-admin/upload.php3.27 ▲0.0437.78 ▲3.52

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_cc_mortgage_canada
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for CC Canadian Mortgage Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲15614.07 ▼0.295.63 ▲3.9341.95 ▼0.74
Dashboard /wp-admin2,228 ▲405.10 ▲0.21100.09 ▼1.8938.75 ▼1.27
Posts /wp-admin/edit.php2,110 ▲212.29 ▲0.2541.42 ▲4.2135.35 ▼4.82
Add New Post /wp-admin/post-new.php1,528 ▲923.46 ▲0.36654.28 ▲54.1139.39 ▼16.49
Media Library /wp-admin/upload.php1,407 ▲194.45 ▲0.2595.84 ▲0.1844.24 ▲1.91

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_cc_mortgage_canada
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
Please take a closer look at the following
  • 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/cc-canadian-mortgage-calculator/cc-mortgage-canada.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

cc-canadian-mortgage-calculator/cc-mortgage-canada.php 92% from 13 tests

"CC Canadian Mortgage Calculator" version 2.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cc-canadian-mortgage-calculator.php" instead of "cc-mortgage-canada.php")

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
There were no executable files found in this plugin372 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP24239189
JavaScript2335101
CSS113082

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin