84% ps4l-pond-calculator

Code Review | PS4L Pond Calculator

WordPress plugin PS4L Pond Calculator scored84%from 54 tests.

About plugin

  • Plugin page: ps4l-pond-calculator
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8.0
  • WordPress version: 6.3.1
  • First release: Oct 18, 2017
  • Latest release: Jan 15, 2018
  • Number of updates: 16
  • Update frequency: every 11.8 days
  • Top authors: sellersbay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /603 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼10.37ms] Passed 4 tests

This is a short check of server-side resources used by PS4L Pond Calculator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0737.08 ▼13.08
Dashboard /wp-admin3.37 ▲0.0645.37 ▼1.25
Posts /wp-admin/edit.php3.42 ▲0.0642.31 ▼5.16
Add New Post /wp-admin/post-new.php5.95 ▲0.0680.82 ▼21.97
Media Library /wp-admin/upload.php3.29 ▲0.0636.05 ▲1.48

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for PS4L Pond Calculator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,920 ▲17413.79 ▼0.7711.38 ▲9.7062.56 ▲14.95
Dashboard /wp-admin2,206 ▲155.02 ▼0.87111.05 ▲6.4941.82 ▲2.04
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0234.56 ▼4.1533.35 ▼2.02
Add New Post /wp-admin/post-new.php1,533 ▼023.16 ▼0.27625.11 ▼29.9851.86 ▼14.03
Media Library /wp-admin/upload.php1,388 ▼04.26 ▲0.0295.22 ▼2.3644.39 ▲1.72

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_pond_calculator_widget
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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
Even though no errors were found, this is by no means an exhaustive test

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ps4l-pond-calculator/inc/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/ps4l-pond-calculator/pond-calculator.php:33

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (front-end side bar view), #2 (Widget panel view)
The official readme.txt might help

ps4l-pond-calculator/pond-calculator.php 92% from 13 tests

The main file in "PS4L Pond Calculator" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ps4l-pond-calculator.php" instead of "pond-calculator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin19,643 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
CSS5423117,461
JavaScript66852581,916
PHP24627266

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity12.50
▷ Minimum class complexity4.00
▷ Maximum class complexity21.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
3 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/cross-icon.png1.63KB0.78KB▼ 52.16%
assets/screenshot-2.png65.42KB17.88KB▼ 72.67%
img/water-img.png45.63KB10.41KB▼ 77.18%