84% persondoc

Code Review | PersonDoc for WooCommerce

WordPress plugin PersonDoc for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: persondoc
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9
  • WordPress version: 6.3.1
  • First release: Aug 16, 2018
  • Latest release: Apr 4, 2019
  • Number of updates: 17
  • Update frequency: every 13.9 days
  • Top authors: cierczek91 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /630 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.44ms] Passed 4 tests

A check of server-side resources used by PersonDoc for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.89 ▼6.26
Dashboard /wp-admin3.32 ▲0.0245.80 ▼5.98
Posts /wp-admin/edit.php3.37 ▲0.0248.83 ▼7.86
Add New Post /wp-admin/post-new.php5.90 ▲0.0290.86 ▼5.64
Media Library /wp-admin/upload.php3.25 ▲0.0234.23 ▼0.39

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by PersonDoc for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.45 ▲0.271.66 ▼0.2643.52 ▼1.62
Dashboard /wp-admin2,198 ▲185.56 ▼0.1688.04 ▼12.4840.04 ▼3.43
Posts /wp-admin/edit.php2,110 ▲102.02 ▲0.0839.86 ▲0.8736.05 ▼2.91
Add New Post /wp-admin/post-new.php1,541 ▲317.99 ▼5.21623.74 ▼54.4271.22 ▲14.79
Media Library /wp-admin/upload.php1,406 ▲124.18 ▲0.0096.26 ▼8.7241.23 ▼2.81

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

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
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/persondoc/includes/reg-persondoc.php:11

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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 need to be fixed:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can look at the official readme.txt

persondoc/persondoc.php Passed 13 tests

The primary PHP file in "PersonDoc for WooCommerce" version 1.1 is used by WordPress to initiate all plugin functionality
100 characters long description:
Todos tus documentos personales juntos, seguros, ordenados, actualizados y con alarmas de caducidad.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected501 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP39590298
JavaScript1530186
CSS12017

PHP code Passed 2 tests

A short review of 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.43
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods12
▷ Static methods18.33%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected