10% woo-product-counter

Code Review | Woo Product Counter

WordPress plugin Woo Product Counter scored10%from 54 tests.

About plugin

  • Plugin page: woo-product-counter
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.2
  • WordPress version: 6.3.1
  • First release: Jul 9, 2015
  • Latest release: Jul 9, 2015
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: JohnnyDu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /803 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure had errors
    • > Warning in wp-content/plugins/woo-product-counter/WooProductCounter_Plugin.php+82
    Declaration of WooProductCounter_Plugin::addActionsAndFilters($atts) should be compatible with WooProductCounter_LifeCycle::addActionsAndFilters()

Server metrics [RAM: ▲0.00MB] [CPU: ▲0.18ms] Passed 4 tests

An overview of server-side resources used by Woo Product Counter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.48 ▼0.27
Dashboard /wp-admin3.31 ▲0.0051.82 ▲2.71
Posts /wp-admin/edit.php3.36 ▲0.0048.31 ▼3.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.26 ▲6.43
Media Library /wp-admin/upload.php3.23 ▲0.0039.34 ▲1.92

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, 11 new options
New WordPress options
WooProductCounter_Plugin__version
widget_theysaidso_widget
WooProductCounter_Plugin__installed
WooProductCounter_Plugin_AmAwesome
db_upgraded
WooProductCounter_Plugin_CanDoSomething
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
...

Browser metrics Passed 4 tests

Woo Product Counter: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.311.64 ▼0.1042.87 ▼3.30
Dashboard /wp-admin2,198 ▲245.62 ▲0.0291.70 ▲2.0538.69 ▼0.50
Posts /wp-admin/edit.php2,100 ▼32.00 ▼0.0338.58 ▼3.3835.64 ▼3.72
Add New Post /wp-admin/post-new.php1,526 ▼223.09 ▲0.05673.97 ▼25.7659.03 ▲2.98
Media Library /wp-admin/upload.php1,400 ▼04.12 ▼0.00113.85 ▼5.7447.06 ▼4.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 11 options
    • widget_recent-posts
    • WooProductCounter_Plugin_ATextInput
    • db_upgraded
    • WooProductCounter_Plugin__version
    • theysaidso_admin_options
    • WooProductCounter_Plugin_CanDoSomething
    • WooProductCounter_Plugin__installed
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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
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
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/woo-product-counter/WooProductCounter_getwidget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/woo-product-counter/woo-product-counter.php:67
    • > PHP Warning
      Declaration of WooProductCounter_Plugin::addActionsAndFilters($atts) should be compatible with WooProductCounter_LifeCycle::addActionsAndFilters() in wp-content/plugins/woo-product-counter/WooProductCounter_Plugin.php on line 82

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: No tags were detected
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

woo-product-counter/woo-product-counter.php Passed 13 tests

This is the main PHP file of "Woo Product Counter" version 0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
48 characters long description:
Display the amount of all the published products

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
There were no executable files found in this plugin569 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP10186549560
CSS1109

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.12
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes225.00%
▷ Concrete classes675.00%
▷ Final classes00.00%
Methods76
▷ Static methods00.00%
▷ Public methods4863.16%
▷ Protected methods2836.84%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
There are no PNG files in this plugin