84% wc-documents-tab

Code Review | WC Documents Tab

WordPress plugin WC Documents Tab scored84%from 54 tests.

About plugin

  • Plugin page: wc-documents-tab
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7
  • WordPress version: 6.3.1
  • First release: Mar 27, 2017
  • Latest release: Apr 13, 2017
  • Number of updates: 8
  • Update frequency: every 1.6 days
  • Top authors: romanrehacek (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /767 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼13.34ms] Passed 4 tests

An overview of server-side resources used by WC Documents Tab
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.74 ▼6.74
Dashboard /wp-admin3.31 ▼0.0448.76 ▼16.11
Posts /wp-admin/edit.php3.36 ▲0.0046.41 ▼1.73
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.29 ▼28.76
Media Library /wp-admin/upload.php3.23 ▲0.0035.52 ▲0.23

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WC Documents Tab
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.07 ▼0.461.66 ▼0.0746.42 ▲4.83
Dashboard /wp-admin2,192 ▲155.51 ▼0.1292.39 ▼2.4841.32 ▼0.76
Posts /wp-admin/edit.php2,097 ▼32.03 ▲0.0434.74 ▼3.3833.10 ▼1.39
Add New Post /wp-admin/post-new.php1,526 ▼122.92 ▼0.27657.63 ▼30.1351.73 ▼2.66
Media Library /wp-admin/upload.php1,403 ▲34.17 ▲0.0199.62 ▼0.3841.77 ▼5.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wc-documents-tab/includes/views/html-product-document.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
6 plugin tags: files, product, documentation, documents, tab...

wc-documents-tab/wc-documents-tab.php 92% from 13 tests

"WC Documents Tab" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
No dangerous file extensions were detected552 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP667104272
LESS1160113
CSS200100
JavaScript2171067

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity7.75
▷ Minimum class complexity3.00
▷ Maximum class complexity16.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1575.00%
▷ Protected methods00.00%
▷ Private methods525.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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