10% bwtf-waterquality

Code Review | BWTF Water Quality

WordPress plugin BWTF Water Quality scored10%from 54 tests.

About plugin

  • Plugin page: bwtf-waterquality
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Oct 11, 2013
  • Latest release: Aug 2, 2016
  • Number of updates: 10
  • Update frequency: every 102.5 days
  • Top authors: gwsuperfan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,053 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/bwtf-waterquality/bwtf-waterquality.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; WQWidget has a deprecated constructor

Server metrics [RAM: ▼1.92MB] [CPU: ▼49.96ms] Passed 4 tests

An overview of server-side resources used by BWTF Water Quality
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.72 ▼35.32
Dashboard /wp-admin2.08 ▼1.225.89 ▼42.68
Posts /wp-admin/edit.php2.08 ▼1.276.28 ▼38.58
Add New Post /wp-admin/post-new.php2.08 ▼3.806.51 ▼83.25
Media Library /wp-admin/upload.php2.08 ▼1.155.24 ▼32.02

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_wqwidget
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for BWTF Water Quality
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.19 ▼1.114.59 ▲2.9743.23 ▲6.78
Dashboard /wp-admin2,206 ▲174.85 ▼1.22101.32 ▼32.3838.74 ▼7.01
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0338.84 ▲3.1535.95 ▲2.85
Add New Post /wp-admin/post-new.php1,533 ▲1422.95 ▲0.02649.69 ▼10.7350.06 ▼7.37
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0693.36 ▼12.9339.87 ▼9.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/bwtf-waterquality/bwtf-waterquality.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; WQWidget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_wqwidget
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/bwtf-waterquality/wq2.php
    • > /wp-content/plugins/bwtf-waterquality/wq.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bwtf-waterquality/bwtf-waterquality.php:10
    • > PHP Notice
      Undefined index: site in wp-content/plugins/bwtf-waterquality/wq2.php on line 28
    • > PHP Notice
      Undefined index: site in wp-content/plugins/bwtf-waterquality/wq.php on line 28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: widget, water quality

bwtf-waterquality/bwtf-waterquality.php Passed 13 tests

The primary PHP file in "BWTF Water Quality" version 2.2 is used by WordPress to initiate all plugin functionality
112 characters long description:
Provides a Widget to display water quality test resuts from Surfrider Foundation's Blue Water Task Force program

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin178 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34149178

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin