84% property-hive-rental-yield-calculator

Code Review | Property Hive Rental Yield Calculator

WordPress plugin Property Hive Rental Yield Calculator scored84%from 54 tests.

About plugin

  • Plugin page: property-hive-ren...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.7.2
  • WordPress version: 6.3.1
  • First release: Feb 23, 2017
  • Latest release: Jun 15, 2021
  • Number of updates: 10
  • Update frequency: every 157.2 days
  • Top authors: PropertyHive (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /2,633 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Property Hive Rental Yield Calculator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.07 ▼2.76
Dashboard /wp-admin3.31 ▲0.0149.15 ▲2.30
Posts /wp-admin/edit.php3.36 ▲0.0046.67 ▼3.73
Add New Post /wp-admin/post-new.php5.89 ▲0.0197.66 ▲14.32
Media Library /wp-admin/upload.php3.23 ▲0.0033.23 ▼0.50

Server storage [IO: ▲0.14MB] [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_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Property Hive Rental Yield Calculator: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.30 ▼0.861.94 ▲0.2939.85 ▼6.17
Dashboard /wp-admin2,206 ▲174.87 ▼0.04108.24 ▼1.9741.99 ▼3.63
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0338.99 ▲3.2034.40 ▲2.12
Add New Post /wp-admin/post-new.php1,533 ▲523.16 ▲0.02592.32 ▼121.0456.48 ▲0.07
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0494.46 ▼15.7343.39 ▼3.29

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 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-yield-calculator/templates/rental-yield-calculator.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: propertyhive, rentalyield, property, estate agent, property hive...

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

Analyzing the main PHP file in "Property Hive Rental Yield Calculator" version 1.0.3
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("property-hive-rental-yield-calculator.php" instead of "propertyhive-rental-yield-calculator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected134 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2383789
JavaScript16040
CSS1005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
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.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png16.73KB6.11KB▼ 63.46%
assets/icon-128x128.png8.59KB3.45KB▼ 59.90%