84% woocom-account-widget

Code Review | WooCom Account Widget

WordPress plugin WooCom Account Widget scored84%from 54 tests.

About plugin

  • Plugin page: woocom-account-wi...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.8
  • WordPress version: 6.3.1
  • First release: Oct 13, 2017
  • Latest release: Oct 13, 2017
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: rnaby (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /762 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

A check of server-side resources used by WooCom Account Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.55 ▲1.92
Dashboard /wp-admin3.31 ▲0.0046.33 ▼1.73
Posts /wp-admin/edit.php3.36 ▲0.0048.89 ▲2.14
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.93 ▲1.71
Media Library /wp-admin/upload.php3.23 ▲0.0034.38 ▼11.03

Server storage [IO: ▲0.20MB] [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: 46 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for WooCom Account Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.101.59 ▼0.0339.62 ▼0.58
Dashboard /wp-admin2,203 ▲155.81 ▲0.9493.65 ▼11.7339.89 ▼3.61
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0038.85 ▲2.0935.25 ▲2.32
Add New Post /wp-admin/post-new.php1,548 ▲3418.20 ▲0.76697.23 ▲1.0472.93 ▲17.57
Media Library /wp-admin/upload.php1,388 ▲64.19 ▲0.0295.54 ▼2.0942.09 ▼3.41

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/woocom-account-widget/src/AccountWidgetCore/AccountWidgetCore.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function TheDramatist\\WooComAW\\add_action() in wp-content/plugins/woocom-account-widget/woocom-account-widget.php:80
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woocom-account-widget/src/AccountWidgetCore/Views/HtmlFormView.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: ecommerce, woocommerce, orders, my-account, logout...

woocom-account-widget/woocom-account-widget.php 92% from 13 tests

Analyzing the main PHP file in "WooCom Account Widget" version 1.0.0
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 180 characters long)

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
Success! There were no dangerous files found in this plugin2,312 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PO File145209171,425
PHP11154270811
Markdown229052
JSON20024

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity26.20
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity5.06
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods32
▷ Static methods39.38%
▷ Public methods3196.88%
▷ Protected methods00.00%
▷ Private methods13.12%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.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
There were not PNG files found in your plugin