74% woo-category-post-widget

Code Review | Woocommerce Category Post Widget

WordPress plugin Woocommerce Category Post Widget scored74%from 54 tests.

About plugin

  • Plugin page: woo-category-post...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 20, 2017
  • Latest release: Aug 16, 2019
  • Number of updates: 9
  • Update frequency: every 84.1 days
  • Top authors: amairatech (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /1,636 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Server-side resources used by Woocommerce Category Post Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.10 ▼2.40
Dashboard /wp-admin3.36 ▲0.0644.07 ▼10.27
Posts /wp-admin/edit.php3.48 ▲0.1245.61 ▼1.08
Add New Post /wp-admin/post-new.php5.94 ▲0.0689.31 ▼6.62
Media Library /wp-admin/upload.php3.29 ▲0.0633.52 ▲0.04

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_woocommerce-category-post-widget-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Woocommerce Category Post Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.23 ▼1.164.32 ▲2.5140.83 ▼8.51
Dashboard /wp-admin2,206 ▲185.85 ▲0.97107.37 ▲4.0143.15 ▲0.77
Posts /wp-admin/edit.php2,092 ▲32.05 ▼0.0139.13 ▲1.6938.18 ▲5.91
Add New Post /wp-admin/post-new.php1,542 ▼018.53 ▲0.34606.64 ▼21.1546.34 ▼5.38
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0495.31 ▼2.5042.71 ▼0.95

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/woo-category-post-widget/woocommerce-category-post-widget.php+38
    Non-static method WOOCPW_Deactivator::deactivate() should not be called statically
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_woocommerce-category-post-widget-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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
Almost there! Just 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/woo-category-post-widget/classes/class-widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: woocommerce category recent products, woocommerce category product widget, woo category post widget, woocommerce category base products, woocommerce category post widget...

woo-category-post-widget/woocommerce-category-post-widget.php 92% from 13 tests

Analyzing the main PHP file in "Woocommerce Category Post Widget" version 1.0.2
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-category-post-widget.php" instead of "woocommerce-category-post-widget.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 plugin243 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP882112225
CSS10018

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods22
▷ Static methods14.55%
▷ Public methods1881.82%
▷ Protected methods00.00%
▷ Private methods418.18%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/default.png6.90KB3.70KB▼ 46.37%