74% sp-client-document-manager

Code Review | SP Project & Document Manager

WordPress plugin SP Project & Document Manager scored74%from 54 tests.

About plugin

  • Plugin page: sp-client-documen...
  • Plugin version: 4.68
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 16, 2012
  • Latest release: Jul 17, 2023
  • Number of updates: 637
  • Update frequency: every 6.5 days
  • Top authors: smartypants (100%)

Code review

54 tests

User reviews

57 reviews

Install metrics

2,000+ active /373,808 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.14MB] [CPU: ▲22.14ms] Passed 4 tests

This is a short check of server-side resources used by SP Project & Document Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.59 ▲2.1266.39 ▲29.97
Dashboard /wp-admin5.45 ▲2.1570.88 ▲26.87
Posts /wp-admin/edit.php5.51 ▲2.1675.29 ▲27.65
Add New Post /wp-admin/post-new.php8.04 ▲2.15103.69 ▲4.08
Media Library /wp-admin/upload.php5.35 ▲2.1364.52 ▲30.89

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 170 new files
Database: 9 new tables, 17 new options
New tables
wp_sp_cu_form_entries
wp_sp_cu_cats
wp_sp_cu_project
wp_sp_cu
wp_sp_cu_meta
wp_sp_cu_forms
wp_sp_cu_groups_assign
wp_sp_cu_groups
wp_sp_cu_event_log
New WordPress options
sp_cdm_cdm_link_version
sp_client_upload_page
cdm_protect_dirs
sp_cdm_cdm_media_version
sp_cdm_cdm_local_import_version
sp_client_upload
widget_recent-comments
widget_theysaidso_widget
sp_cdm_recycle_bin_schedule
can_compress_scripts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for SP Project & Document Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,287 ▲50115.30 ▲0.7210.58 ▲8.8943.40 ▲1.69
Dashboard /wp-admin2,465 ▲2946.21 ▲0.59121.10 ▲28.1043.05 ▲4.14
Posts /wp-admin/edit.php2,393 ▲2933.46 ▲1.4944.14 ▲7.0228.48 ▼9.65
Add New Post /wp-admin/post-new.php1,630 ▲10222.88 ▼0.14592.88 ▼47.1234.40 ▼18.43
Media Library /wp-admin/upload.php1,537 ▲1434.14 ▼0.0381.72 ▼28.1141.08 ▼6.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 9 tables in the database
    • wp_sp_cu_groups
    • wp_sp_cu_form_entries
    • wp_sp_cu_groups_assign
    • wp_sp_cu_cats
    • wp_sp_cu_forms
    • wp_sp_cu_project
    • wp_sp_cu
    • wp_sp_cu_meta
    • wp_sp_cu_event_log
  • This plugin does not fully uninstall, leaving 17 options in the database
    • cdm_protect_dirs
    • sp_cdm_cdm_local_import_version
    • widget_theysaidso_widget
    • sp_cdm_recycle_bin_schedule
    • cdm_rerun_recycler
    • sp_cdm_cdm_link_version
    • sp_cdm_cdm_media_version
    • theysaidso_admin_options
    • sp_cu_event_logger_installer
    • widget_recent-posts
    • ...

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 28× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sp-client-document-manager/templates/login/login.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sp-client-document-manager/integrated/sp-cdm-local-import/admin/importer.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sp-client-document-manager/admin/virtual-directory.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sp-client-document-manager/user/customizer.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sp-client-document-manager/admin/recycle-bin.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sp-client-document-manager/integrated/sp-cdm-media/user/uploader.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sp-client-document-manager/integrated/sp-cdm-link/index.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sp-client-document-manager/admin/users.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/sp-client-document-manager/templates/file-list/table.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sp-client-document-manager/integrated/sp-cdm-local-import/index.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === sp-client-document-manager === )
The official readme.txt is a good inspiration

sp-client-document-manager/cu.php 92% from 13 tests

The entry point to "SP Project & Document Manager" version 4.68 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("sp-client-document-manager.php" instead of "cu.php")

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
Good job! No executable or dangerous file extensions detected38,144 lines of code in 84 files:
LanguageFilesBlank linesComment linesLines of code
PO File95,50510,44412,135
PHP445,2091,10010,931
JSON20010,131
JavaScript189696352,479
CSS115081252,468

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity30.77
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity4.74
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes00.00%
Methods247
▷ Static methods124.86%
▷ Public methods24097.17%
▷ Protected methods41.62%
▷ Private methods31.21%
Functions158
▷ Named functions158100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants1666.67%
▷ Class constants833.33%
▷ Public constants8100.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
64 PNG files occupy 0.23MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/types/picture.png0.59KB0.69KB0.00%
images/types/ruby.png0.61KB0.65KB0.00%
images/folder-add-icon.png3.26KB0.74KB▼ 77.38%
integrated/sp-cdm-link/images/url.png15.38KB5.79KB▼ 62.35%
css/smoothness.1.12/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.32KB0.18KB▼ 44.00%