84% document-library-lite

Code Review | Document Library Lite

WordPress plugin Document Library Lite scored84%from 54 tests.

About plugin

  • Plugin page: document-library-...
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Apr 6, 2022
  • Latest release: Nov 14, 2023
  • Number of updates: 17
  • Update frequency: every 34.6 days
  • Top authors: Barn2Media (88.24%)amirition (17.65%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /11,153 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.12MB] [CPU: ▲2.83ms] 75% from 4 tests

Analyzing server-side resources used by Document Library Lite
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 668.44ms on /wp-admin/admin.php?page=document_library)
PageMemory (MB)CPU Time (ms)
Home /4.14 ▲0.6843.11 ▼5.20
Dashboard /wp-admin4.58 ▲1.2354.75 ▼5.55
Posts /wp-admin/edit.php4.63 ▲1.2859.56 ▲15.90
Add New Post /wp-admin/post-new.php7.19 ▲1.3095.09 ▲9.30
Media Library /wp-admin/upload.php4.51 ▲1.2848.35 ▲12.76
Categories /wp-admin/edit-tags.php?taxonomy=doc_categories&post_type=dlp_document4.5043.68
Settings /wp-admin/admin.php?page=document_library4.53668.44
Add New /wp-admin/post-new.php?post_type=dlp_document4.6663.41
All Documents /wp-admin/edit.php?post_type=dlp_document4.5546.30
Import /wp-admin/admin.php?page=dlp_import4.4739.38

Server storage [IO: ▲2.54MB] [DB: ▲0.08MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by Document Library Lite
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲8914.06 ▲0.151.68 ▼0.4940.36 ▼6.40
Dashboard /wp-admin2,241 ▲615.60 ▼0.1489.56 ▲0.2639.97 ▼3.55
Posts /wp-admin/edit.php2,146 ▲462.02 ▼0.0144.15 ▲10.7336.70 ▲4.07
Add New Post /wp-admin/post-new.php1,561 ▲3523.34 ▲0.19600.99 ▼91.5254.20 ▼1.65
Media Library /wp-admin/upload.php1,443 ▲434.21 ▼0.0198.98 ▼0.8141.50 ▼5.50
Categories /wp-admin/edit-tags.php?taxonomy=doc_categories&post_type=dlp_document1,3202.1227.2531.00
Settings /wp-admin/admin.php?page=document_library1,7722.1424.6847.54
Add New /wp-admin/post-new.php?post_type=dlp_document2,4337.88165.5464.10
All Documents /wp-admin/edit.php?post_type=dlp_document1,1231.9133.1529.54
Import /wp-admin/admin.php?page=dlp_import8311.9921.7124.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • dlp_document_page
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • dlp_should_flush_rewrite_rules
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 42× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Barn2\\Plugin\\Document_Library\\Dependencies\\Lib\\Plugin\\Simple_Plugin' not found in wp-content/plugins/document-library-lite/src/Plugin.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Barn2\\Plugin\\Document_Library\\Dependencies\\Lib\\Plugin\\Plugin' not found in wp-content/plugins/document-library-lite/dependencies/barn2/barn2-lib/src/Plugin/Simple_Plugin.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Barn2\\Plugin\\Document_Library\\Dependencies\\Lib\\Registerable' not found in wp-content/plugins/document-library-lite/dependencies/barn2/barn2-lib/src/WooCommerce/Admin/Custom_Settings_Fields.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Barn2\\Plugin\\Document_Library\\Dependencies\\Setup_Wizard\\Step' not found in wp-content/plugins/document-library-lite/dependencies/barn2/setup-wizard/src/Steps/Ready.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Barn2\\Plugin\\Document_Library\\Dependencies\\Setup_Wizard\\Steps\\Ready' not found in wp-content/plugins/document-library-lite/src/Admin/Wizard/Steps/Completed.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Barn2\\Plugin\\Document_Library\\Dependencies\\Lib\\Registerable' not found in wp-content/plugins/document-library-lite/dependencies/barn2/barn2-lib/src/Plugin/License/Admin/License_Key_Setting.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Barn2\\Plugin\\Document_Library\\Dependencies\\Lib\\Plugin\\License\\License_Summary' not found in wp-content/plugins/document-library-lite/dependencies/barn2/barn2-lib/src/Plugin/License/License.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Barn2\\Plugin\\Document_Library\\Dependencies\\Setup_Wizard\\Step' not found in wp-content/plugins/document-library-lite/src/Admin/Wizard/Steps/Layout.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Barn2\\Plugin\\Document_Library\\Dependencies\\Lib\\Registerable' not found in wp-content/plugins/document-library-lite/dependencies/barn2/barn2-lib/src/Rest/Base_Server.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Barn2\\Plugin\\Document_Library\\Dependencies\\Setup_Wizard\\Interfaces\\Pluggable' not found in wp-content/plugins/document-library-lite/dependencies/barn2/setup-wizard/src/Step.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: file manager, download manager, wordpress, document management, documents...

document-library-lite/document-library-lite.php Passed 13 tests

The primary PHP file in "Document Library Lite" version 1.0.6 is used by WordPress to initiate all plugin functionality
64 characters long description:
Add documents and display them in a searchable document library.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin19,652 lines of code in 143 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript163,2597,78511,294
PHP1088714,2527,813
CSS112424411
Sass420123
JSON2006
Markdown1304
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.10
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces25
Interfaces20
Traits2
Classes74
▷ Abstract classes56.76%
▷ Concrete classes6993.24%
▷ Final classes22.90%
Methods671
▷ Static methods11917.73%
▷ Public methods57585.69%
▷ Protected methods91.34%
▷ Private methods8712.97%
Functions12
▷ Named functions433.33%
▷ Anonymous functions866.67%
Constants50
▷ Global constants00.00%
▷ Class constants50100.00%
▷ Public constants50100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 compressed PNG files occupy 0.36MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/promo-grid.png153.90KB164.40KB0.00%
assets/js/datatables/DataTables-1.11.3/images/sort_desc.png0.15KB0.25KB0.00%
assets/js/photoswipe/default-skin/default-skin.png0.53KB0.72KB0.00%
assets/js/datatables/DataTables-1.11.3/images/sort_desc_disabled.png0.14KB0.25KB0.00%
assets/images/promo-import.png73.13KB76.10KB0.00%