10% bottled-water-costs-calculator

Code Review | Wordpress water calculator

WordPress plugin Wordpress water calculator scored 10% from 53 tests.

About plugin

  • Plugin page: bottled-water-cos...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0+
  • WordPress version: 5.8.1
  • First release: May 11, 2013
  • Latest release: May 11, 2013
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: ThesisPremium (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 697 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/bottled-water-costs-calculator/water-calc.php+32
    Methods with the same name as their class will not be constructors in a future version of PHP; WaterWidget has a deprecated constructor

Server metrics [RAM: ▼1.83MB] [CPU: ▼330.04ms] Passed 4 tests

An overview of server-side resources used by Wordpress water calculator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.80 ▼0.924.85 ▼18.05
Dashboard /wp-admin1.82 ▼1.236.47 ▼36.78
Posts /wp-admin/edit.php1.82 ▼1.285.35 ▼38.62
Add New Post /wp-admin/post-new.php1.82 ▼3.614.89 ▼1,211.68
Media Library /wp-admin/upload.php1.82 ▼1.184.95 ▼33.06

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 1 new option
New WordPress options
widget_waterwidget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wordpress water calculator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,674 ▲9215.80 ▲0.347.72 ▼1.0145.75 ▼2.77
Dashboard /wp-admin2,928 ▲785.92 ▲0.06139.53 ▲8.0396.87 ▼3.86
Posts /wp-admin/edit.php2,706 ▼02.69 ▲0.0064.52 ▼1.1890.58 ▼3.16
Add New Post /wp-admin/post-new.php1,851 ▲20017.50 ▲0.25364.76 ▲7.94105.85 ▼7.21
Media Library /wp-admin/upload.php1,775 ▼05.02 ▼0.01150.96 ▼1.01107.32 ▼10.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/bottled-water-costs-calculator/water-calc.php+32
    Methods with the same name as their class will not be constructors in a future version of PHP; WaterWidget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_waterwidget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bottled-water-costs-calculator/water-calc.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is not present
  • Contributors: No tags were detected
You can take inspiration from this readme.txt

bottled-water-costs-calculator/water-calc.php 92% from 13 tests

"Wordpress water calculator" version 1.0'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: Please rename the main PHP file in this plugin to the plugin slug ("bottled-water-costs-calculator.php" instead of "water-calc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin147 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14039147

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png9.88KB5.86KB▼ 40.76%
screenshot-1.png20.46KB10.15KB▼ 50.40%