84% property-hive-rental-affordability-calculator

Code Review | Property Hive Rental Affordability Calculator

WordPress plugin Property Hive Rental Affordability Calculator scored 84% from 54 tests.

About plugin

  • Plugin page: property-hive-ren...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.9.2
  • WordPress version: 6.3.1
  • First release: Feb 25, 2021
  • Latest release: Mar 24, 2022
  • Number of updates: 8
  • Update frequency: every 49.0 days
  • Top authors: PropertyHive (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,338 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.45ms] Passed 4 tests

Analyzing server-side resources used by Property Hive Rental Affordability Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.21 ▼6.80
Dashboard /wp-admin3.32 ▲0.0246.02 ▼1.49
Posts /wp-admin/edit.php3.37 ▲0.0247.80 ▼1.97
Add New Post /wp-admin/post-new.php5.90 ▲0.0294.07 ▲0.45
Media Library /wp-admin/upload.php3.25 ▲0.0235.97 ▲1.12

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Property Hive Rental Affordability Calculator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.041.70 ▼0.2338.76 ▼5.06
Dashboard /wp-admin2,206 ▲155.83 ▼0.05111.47 ▲2.5539.76 ▼6.41
Posts /wp-admin/edit.php2,092 ▲31.97 ▼0.0843.23 ▲1.2235.49 ▼1.45
Add New Post /wp-admin/post-new.php1,520 ▼1623.38 ▲0.40625.77 ▲36.4659.01 ▲1.27
Media Library /wp-admin/upload.php1,382 ▼64.16 ▼0.0399.22 ▼7.3643.36 ▼4.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/property-hive-rental-affordability-calculator/templates/rental-affordability-calculator.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: propertyhive, estate agent, rental affordability calculator, property hive, rent calculator...

property-hive-rental-affordability-calculator/propertyhive-rental-affordability-calculator.php 92% from 13 tests

"Property Hive Rental Affordability Calculator" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("property-hive-rental-affordability-calculator.php" instead of "propertyhive-rental-affordability-calculator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin170 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24237105
JavaScript114059
CSS1006

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.29
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods7
▷ Static methods114.29%
▷ Public methods571.43%
▷ Protected methods00.00%
▷ Private methods228.57%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png8.51KB3.52KB▼ 58.63%
assets/icon-256x256.png16.45KB6.18KB▼ 62.44%