83% documents-for-woocommerce

Code Review | Documents for WooCommerce

WordPress plugin Documents for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: documents-for-woo...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Mar 16, 2021
  • Latest release: Mar 24, 2021
  • Number of updates: 17
  • Update frequency: every 0.7 days
  • Top authors: wpharvest (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

700+ active / 1,967 total downloads

Benchmarks

Plugin footprint 83% 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.04MB] [CPU: ▼3.35ms] Passed 4 tests

This is a short check of server-side resources used by Documents for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.69 ▼3.37
Dashboard /wp-admin3.34 ▲0.0444.00 ▼4.30
Posts /wp-admin/edit.php3.39 ▲0.0451.32 ▲5.06
Add New Post /wp-admin/post-new.php5.94 ▲0.0686.47 ▼5.70
Media Library /wp-admin/upload.php3.27 ▲0.0436.51 ▼0.02

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Documents for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.22 ▼1.151.76 ▼0.1744.62 ▲1.47
Dashboard /wp-admin2,210 ▲304.88 ▼0.04109.68 ▼0.7640.57 ▼2.65
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0038.32 ▲0.5533.18 ▲0.78
Add New Post /wp-admin/post-new.php1,532 ▼1023.16 ▲5.00591.40 ▼74.4451.65 ▼13.23
Media Library /wp-admin/upload.php1,389 ▲44.23 ▲0.0496.59 ▼12.2142.23 ▼2.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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 trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/documents-for-woocommerce/templates/html-product-document.php:15

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Contributors: Plugin contributors not specified
The official readme.txt is a good inspiration

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

The primary PHP file in "Documents for WooCommerce" version 1.0.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.9" instead of "5.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin289 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP22646147
JavaScript1151083
CSS14337
Markdown112022

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin