93% documents-tab-for-woocommerce

Code Review | Documents Tab for WooCommerce

WordPress plugin Documents Tab for WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: documents-tab-for...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.3
  • WordPress version: 5.8.1
  • First release: Aug 21, 2015
  • Latest release: Aug 21, 2015
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: dimitrov.adrian (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 1,206 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.04MB] [CPU: ▼148.77ms] Passed 4 tests

Analyzing server-side resources used by Documents Tab for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1640.05 ▲17.28
Dashboard /wp-admin3.10 ▲0.0550.67 ▼13.01
Posts /wp-admin/edit.php3.15 ▲0.0445.59 ▼6.29
Add New Post /wp-admin/post-new.php5.46 ▲0.0288.65 ▼577.66
Media Library /wp-admin/upload.php3.04 ▲0.0434.73 ▲1.90

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Documents Tab for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,681 ▲8515.89 ▲0.3615.94 ▲5.8952.11 ▼23.50
Dashboard /wp-admin2,975 ▲445.95 ▼0.10141.58 ▼20.64114.89 ▲9.60
Posts /wp-admin/edit.php2,741 ▲22.71 ▲0.0065.12 ▼2.6780.81 ▼17.34
Add New Post /wp-admin/post-new.php1,674 ▼918.75 ▼0.12432.88 ▲28.94107.49 ▼13.26
Media Library /wp-admin/upload.php1,809 ▲25.03 ▲0.00156.45 ▼14.55116.53 ▲1.10

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/documents-tab-for-woocommerce/documents-tab-woocommerce.php:268

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 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Documents management), #2 (How it looks)
The official readme.txt is a good inspiration

documents-tab-for-woocommerce/documents-tab-woocommerce.php 85% from 13 tests

Analyzing the main PHP file in "Documents Tab for WooCommerce" version 1.0
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("documents-tab-for-woocommerce.php" instead of "documents-tab-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected377 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP13949180
JavaScript127784
CSS11160
PO File1131453

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 were not PNG files found in your plugin