84% c4d-woo-category

Code Review | C4D Woocommerce Category

WordPress plugin C4D Woocommerce Category scored84%from 54 tests.

About plugin

  • Plugin page: c4d-woo-category
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.6
  • WordPress version: 6.3.1
  • First release: Feb 17, 2017
  • Latest release: Jun 26, 2018
  • Number of updates: 8
  • Update frequency: every 61.7 days
  • Top authors: coffee4dev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,124 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.89ms] Passed 4 tests

Analyzing server-side resources used by C4D Woocommerce Category
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.96 ▼2.85
Dashboard /wp-admin3.33 ▲0.0347.11 ▲1.07
Posts /wp-admin/edit.php3.39 ▲0.0348.36 ▼1.13
Add New Post /wp-admin/post-new.php5.92 ▲0.0377.92 ▼12.51
Media Library /wp-admin/upload.php3.26 ▲0.0337.36 ▲0.95

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_c4d-woo-category

Browser metrics Passed 4 tests

An overview of browser requirements for C4D Woocommerce Category
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.101.64 ▼0.1339.28 ▼5.19
Dashboard /wp-admin2,195 ▲185.57 ▼0.0195.48 ▲9.4443.73 ▲1.62
Posts /wp-admin/edit.php2,100 ▼32.02 ▲0.0339.15 ▼3.8636.14 ▼5.54
Add New Post /wp-admin/post-new.php1,529 ▲323.24 ▲0.08671.92 ▼18.9957.58 ▲1.34
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.0494.52 ▼11.6741.51 ▼3.17

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_c4d-woo-category

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/c4d-woo-category/c4d-woo-category.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/c4d-woo-category/templates/default.php:3

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 Passed 29 tests

readme.txt Passed 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
5 plugin tags: archive, category, taxonomy, product, woocommerce

c4d-woo-category/c4d-woo-category.php Passed 13 tests

The main PHP script in "C4D Woocommerce Category" version 2.0.1 is automatically included on every request by WordPress
22 characters long description:
Simple Category Widget

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected118 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21531117
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity5.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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin