79% digital-asset-manager

Code Review | Digital Asset Manager

WordPress plugin Digital Asset Manager scored79%from 54 tests.

About plugin

  • Plugin page: digital-asset-man...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Apr 30, 2022
  • Latest release: Oct 3, 2023
  • Number of updates: 6
  • Update frequency: every 88.2 days
  • Top authors: 2bytecode (83.33%)tassawerhussain (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /832 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.36MB] [CPU: ▼0.73ms] Passed 4 tests

A check of server-side resources used by Digital Asset Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3341.72 ▲0.56
Dashboard /wp-admin3.69 ▲0.3948.23 ▼1.67
Posts /wp-admin/edit.php3.74 ▲0.3951.23 ▲4.75
Add New Post /wp-admin/post-new.php6.36 ▲0.4892.96 ▼2.54
Media Library /wp-admin/upload.php3.55 ▲0.3236.39 ▲0.74
Asset Tags /wp-admin/edit-tags.php?taxonomy=asset-tags&post_type=dam-asset3.5434.59
Asset Types /wp-admin/edit-tags.php?taxonomy=asset-type&post_type=dam-asset3.5436.14
Add Asset /wp-admin/post-new.php?post_type=dam-asset3.7954.61
All Assets /wp-admin/edit.php?post_type=dam-asset3.5936.94
Tokens /wp-admin/edit-tags.php?taxonomy=dam_token&post_type=dam-asset3.5435.75
Settings /wp-admin/edit.php?post_type=dam-asset&page=dam-settings3.5232.31

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
dam_settings_options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Digital Asset Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,993 ▲23213.75 ▼0.4714.24 ▲12.4839.69 ▼6.57
Dashboard /wp-admin2,239 ▲655.63 ▼0.0587.75 ▼6.3239.79 ▼3.47
Posts /wp-admin/edit.php2,150 ▲501.98 ▼0.0239.42 ▲3.6235.62 ▲3.67
Add New Post /wp-admin/post-new.php1,566 ▲4023.24 ▲0.06654.81 ▼23.9551.04 ▼20.72
Media Library /wp-admin/upload.php1,447 ▲474.12 ▼0.0799.01 ▲4.1942.71 ▲1.74
Asset Tags /wp-admin/edit-tags.php?taxonomy=asset-tags&post_type=dam-asset1,2962.1327.0329.18
Asset Types /wp-admin/edit-tags.php?taxonomy=asset-type&post_type=dam-asset1,3212.1529.0631.57
Add Asset /wp-admin/post-new.php?post_type=dam-asset3,5029.36230.5078.17
All Assets /wp-admin/edit.php?post_type=dam-asset1,1921.9130.8930.85
Tokens /wp-admin/edit-tags.php?taxonomy=dam_token&post_type=dam-asset1,2932.1327.0728.58
Settings /wp-admin/edit.php?post_type=dam-asset&page=dam-settings1,0311.6523.7128.97

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • dam_settings_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/digital-asset-manager/admin/partials/digital-asset-manager-admin-display.php
    • > /wp-content/plugins/digital-asset-manager/public/partials/digital-asset-manager-public-display.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/digital-asset-manager/public/templates/archive-asset.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function locate_template() in wp-content/plugins/digital-asset-manager/public/partials/digital-asset-manager-single-asset.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/digital-asset-manager/admin/partials/digital-asset-manager-settings-page.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function locate_template() in wp-content/plugins/digital-asset-manager/public/partials/digital-asset-manager-archive-asset.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/digital-asset-manager/admin/partials/digital-asset-manager-asset-metabox.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/digital-asset-manager/public/templates/single-asset.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function list_asset_categories_on_sidebar() in wp-content/plugins/digital-asset-manager/public/templates/sidebar-asset.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: download management, download plugin, document management, download manager, file manager...

digital-asset-manager/digital-asset-manager.php Passed 13 tests

The main PHP script in "Digital Asset Manager" version 1.1.0 is automatically included on every request by WordPress
70 characters long description:
Helps you to store and manage all of your digital assets in one place.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin2,764 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP253921,0931,673
CSS31661111,018
JavaScript3186373

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.83
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods58
▷ Static methods23.45%
▷ Public methods5391.38%
▷ Protected methods00.00%
▷ Private methods58.62%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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