72% cm-download-manager

Code Review | CM Download Manager

WordPress plugin CM Download Manager scored 72% from 53 tests.

About plugin

  • Plugin page: cm-download-manager
  • Plugin version: 2.8.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.8
  • WordPress version: 5.8.1
  • First release: May 11, 2013
  • Latest release: Aug 6, 2021
  • Number of updates: 337
  • Update frequency: every 9.2 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

53 tests

User reviews

41 reviews

Install metrics

600+ active / 120,209 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼265.05ms] 75% from 4 tests

An overview of server-side resources used by CM Download Manager
Please take the time to fix the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 3,726.27ms on /wp-admin/admin.php?page=CMDM_admin_settings)
PageMemory (MB)CPU Time (ms)
Home /3.16 ▲0.4447.10 ▲26.61
Dashboard /wp-admin3.37 ▲0.3254.24 ▲13.03
Posts /wp-admin/edit.php3.44 ▲0.3345.13 ▼2.47
Add New Post /wp-admin/post-new.php5.73 ▲0.3098.93 ▼1,077.29
Media Library /wp-admin/upload.php3.32 ▲0.3239.15 ▲6.54
Settings /wp-admin/admin.php?page=CMDM_admin_settings3.503,726.27
User Guide /wp-admin/admin.php?page=cmdm_about3.4634.07
Categories /wp-admin/edit-tags.php?taxonomy=cmdm_category&post_type=cmdm_page3.3243.86
CM Downloads /wp-admin/edit.php?post_type=cmdm_page3.3844.65
Add New /wp-admin/post-new.php?post_type=cmdm_page3.1127.02
Upgrade ➤ /wp-admin/admin.php?page=cmdm_pro3.3232.64

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 195 new files
Database: no new tables, 2 new options
New WordPress options
cmdm_category_children
CMDM_afterActivation

Browser metrics Passed 4 tests

A check of browser resources used by CM Download Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,738 ▲13215.87 ▲0.188.53 ▲0.9547.40 ▲2.63
Dashboard /wp-admin2,993 ▲1465.93 ▲0.07136.96 ▲5.72104.31 ▲5.10
Posts /wp-admin/edit.php2,763 ▲572.70 ▲0.0064.47 ▼0.8996.20 ▲1.59
Add New Post /wp-admin/post-new.php1,891 ▲3819.00 ▼0.06369.98 ▲6.68103.99 ▼10.36
Media Library /wp-admin/upload.php1,838 ▲635.00 ▼0.01142.40 ▼5.92112.20 ▼3.48
Settings /wp-admin/admin.php?page=CMDM_admin_settings3,7465.69104.17145.97
User Guide /wp-admin/admin.php?page=cmdm_about4,99511.39249.77183.29
Categories /wp-admin/edit-tags.php?taxonomy=cmdm_category&post_type=cmdm_page1,8672.5365.3889.35
CM Downloads /wp-admin/edit.php?post_type=cmdm_page1,5342.6463.5479.27
Add New /wp-admin/post-new.php?post_type=cmdm_page260.900.049.56
Upgrade ➤ /wp-admin/admin.php?page=cmdm_pro1,9612.9870.5651.38

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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
  • Zombie WordPress options detected upon uninstall: 2 options
    • cmdm_category_children
    • CMDM_afterActivation

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=cmdm_about
    • > Warning in wp-content/plugins/cm-download-manager/package/cminds-free.php+2989
    mysqli_get_server_info() expects exactly 1 parameter, 0 given

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
Please fix the following items
  • 102× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require_once(CMDM_PATH/lib/helpers/Form/Element.php): failed to open stream: No such file or directory in wp-content/plugins/cm-download-manager/lib/helpers/Form/Element/Hidden.php on line 4
    • > PHP Warning
      include_once(CMDM_PATH/lib/models/GroupDownloadPage.php): failed to open stream: No such file or directory in wp-content/plugins/cm-download-manager/lib/CMDM.php on line 2
    • > PHP Warning
      require_once(CMDM_PATH/lib/helpers/Form/Element.php): failed to open stream: No such file or directory in wp-content/plugins/cm-download-manager/lib/helpers/Form/Element/WpUploader.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/cm-download-manager/package/cminds-plugin-config.php:10
    • > PHP Warning
      Use of undefined constant CMDM_PATH - assumed 'CMDM_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cm-download-manager/lib/helpers/Form/Element/Hidden.php on line 4
    • > PHP Warning
      require_once(CMDM_PATH/lib/helpers/Validate/Interface.php): failed to open stream: No such file or directory in wp-content/plugins/cm-download-manager/lib/helpers/Validate/Digits.php on line 4
    • > PHP Warning
      Use of undefined constant CMDM_PATH - assumed 'CMDM_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cm-download-manager/lib/helpers/Form/Element/Visual.php on line 4
    • > PHP Warning
      include_once(CMDM_PATH/lib/models/SupportThread.php): failed to open stream: No such file or directory in wp-content/plugins/cm-download-manager/lib/models/GroupDownloadPage.php on line 3
    • > PHP Warning
      include_once(CMDM_PATH/lib/models/forms/AddDownloadForm.php): failed to open stream: No such file or directory in wp-content/plugins/cm-download-manager/lib/controllers/CmdownloadController.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'CMDM_PATH/lib/helpers/Validate/Interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/cm-download-manager/lib/helpers/Validate/Url.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=CMDM_admin_settings
    • > Other (warning) in unknown
    /wp-admin/admin.php?page=CMDM_admin_settings 885 Allow attribute will take precedence over 'allowfullscreen'.
    • > GET request to /wp-admin/post-new.php?post_type=cmdm_page
    • > Network (severe)
    cmdownload/add - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: document management, file manager, downloads, file management, download

cm-download-manager/cm-download-manager.php Passed 13 tests

The primary PHP file in "CM Download Manager" version 2.8.2 is used by WordPress to initiate all plugin functionality
131 characters long description:
Allow users to upload, manage, track and support documents or files in a directory listing structure for others to use and comment.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected12,312 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
PHP711,2937069,390
PO File55258951,374
CSS9167241,268
JavaScript93633259
SVG11013
Ruby1208

PHP code Passed 2 tests

A short review 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.33
Average class complexity24.24
▷ Minimum class complexity1.00
▷ Maximum class complexity248.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces2
Traits0
Classes35
▷ Abstract classes25.71%
▷ Concrete classes3394.29%
▷ Final classes00.00%
Methods451
▷ Static methods16336.14%
▷ Public methods38485.14%
▷ Protected methods6213.75%
▷ Private methods51.11%
Functions13
▷ Named functions753.85%
▷ Anonymous functions646.15%
Constants64
▷ Global constants812.50%
▷ Class constants5687.50%
▷ Public constants56100.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
74 PNG files occupy 0.95MB with 0.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
views/resources/imgs/butPost.png1.40KB0.64KB▼ 54.36%
views/banner-772x250.png65.15KB26.72KB▼ 58.99%
views/resources/imgs/textarea.png1.57KB0.54KB▼ 65.84%
package/css/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
views/resources/imgs/sideBoxBg.png1.86KB0.72KB▼ 61.24%