78% cm-download-manager

Code Review | CM Download and File Manager

WordPress plugin CM Download and File Manager scored78%from 54 tests.

About plugin

  • Plugin page: cm-download-manager
  • Plugin version: 2.8.10
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: May 11, 2013
  • Latest release: Aug 6, 2023
  • Number of updates: 377
  • Update frequency: every 10.2 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

54 tests

User reviews

42 reviews

Install metrics

300+ active /126,520 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲1.39MB] [CPU: ▲3.63ms] 75% from 4 tests

Analyzing server-side resources used by CM Download and File Manager
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 881.62ms on /wp-admin/admin.php?page=CMDM_admin_settings)
PageMemory (MB)CPU Time (ms)
Home /4.93 ▲1.4653.87 ▲18.01
Dashboard /wp-admin4.74 ▲1.3952.63 ▼3.55
Posts /wp-admin/edit.php4.81 ▲1.4555.14 ▲3.27
Add New Post /wp-admin/post-new.php7.26 ▲1.37101.64 ▼1.79
Media Library /wp-admin/upload.php4.60 ▲1.3752.06 ▲16.58
Upgrade ➤ /wp-admin/admin.php?page=cmdm_pro4.6544.36
Categories /wp-admin/edit-tags.php?taxonomy=cmdm_category&post_type=cmdm_page4.6142.83
CM Downloads /wp-admin/edit.php?post_type=cmdm_page4.7345.57
User Guide /wp-admin/admin.php?page=cmdm_about4.78427.10
Add New /wp-admin/post-new.php?post_type=cmdm_page4.4551.80
Settings /wp-admin/admin.php?page=CMDM_admin_settings4.83881.62

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 197 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
cmdm_category_children
widget_recent-comments
theysaidso_admin_options
CMDM_afterActivation
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for CM Download and File Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8014.35 ▼0.011.71 ▲0.1539.92 ▼1.17
Dashboard /wp-admin2,245 ▲685.61 ▲0.0083.15 ▼1.9739.46 ▼3.01
Posts /wp-admin/edit.php2,147 ▲472.02 ▲0.0339.27 ▲1.7935.94 ▲2.62
Add New Post /wp-admin/post-new.php1,565 ▲3923.20 ▼0.29681.61 ▲23.8975.25 ▲19.64
Media Library /wp-admin/upload.php1,447 ▲474.29 ▲0.02105.98 ▲2.9851.04 ▲6.47
Upgrade ➤ /wp-admin/admin.php?page=cmdm_pro2,2362.2941.2195.54
Categories /wp-admin/edit-tags.php?taxonomy=cmdm_category&post_type=cmdm_page1,4672.1426.8529.64
CM Downloads /wp-admin/edit.php?post_type=cmdm_page1,1942.0130.9632.63
User Guide /wp-admin/admin.php?page=cmdm_about4,20722.17421.98197.41
Add New /wp-admin/post-new.php?post_type=cmdm_page260.420.068.01
Settings /wp-admin/admin.php?page=CMDM_admin_settings2,6547.6872.6061.65

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-posts
    • cmdm_category_children
    • db_upgraded
    • CMDM_afterActivation
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 101× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > 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/Text.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/cm-download-manager/cm-download-manager.php:25
    • > PHP Fatal error
      require_once(): Failed opening required 'CMDM_PATH/lib/helpers/Form/Element.php' (include_path='.:/usr/share/php') in wp-content/plugins/cm-download-manager/lib/helpers/Form/Element/WpUploader.php on line 2
    • > PHP Warning
      include_once(CMDM_PATH/lib/models/PostType.php): failed to open stream: No such file or directory in wp-content/plugins/cm-download-manager/lib/models/GroupDownloadPage.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'CMDM_PATH/lib/helpers/Form/Element/Combobox.php' (include_path='.:/usr/share/php') in wp-content/plugins/cm-download-manager/lib/helpers/Form/Element/Radio.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'CMDM_BaseController' not found in wp-content/plugins/cm-download-manager/lib/controllers/ErrorController.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'CMDM_PATH/lib/helpers/Form/Element.php' (include_path='.:/usr/share/php') in wp-content/plugins/cm-download-manager/lib/helpers/Form/Element/Visual.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/Validate/Alnum.php on line 4
    • > 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
    • > PHP Warning
      include_once(): Failed opening 'CMDM_PATH/lib/helpers/Form/Element.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cm-download-manager/lib/helpers/Form.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=cmdm_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=cmdm_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=cmdm_about
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yQ/r/bnRvNSHX7Ev.js?_nc_x=Ij3Wp8lg5Kz 275 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/admin.php?page=cmdm_about
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yQ/r/bnRvNSHX7Ev.js?_nc_x=Ij3Wp8lg5Kz 60:573 "ErrorUtils caught an error:\n\nCannot listen to an undefined element. [Caught in: Tried to listen to element of type click]\n\nSubsequent non-fatal errors won't be logged; see https://fburl.com/debugjs."
    • > 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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: downloads, document management, download manager, file manager plugin, file manager

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

"CM Download and File Manager" version 2.8.10's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin12,719 lines of code in 97 files:
LanguageFilesBlank linesComment linesLines of code
PHP721,3167139,797
PO File55258951,374
CSS9167241,268
JavaScript93633259
SVG11013
Ruby1208

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity24.70
▷ Minimum class complexity1.00
▷ Maximum class complexity254.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces2
Traits0
Classes35
▷ Abstract classes25.71%
▷ Concrete classes3394.29%
▷ Final classes00.00%
Methods452
▷ Static methods16436.28%
▷ Public methods38585.18%
▷ Protected methods6213.72%
▷ Private methods51.11%
Functions13
▷ Named functions753.85%
▷ Anonymous functions646.15%
Constants64
▷ Global constants812.50%
▷ Class constants5687.50%
▷ Public constants56100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
75 PNG files occupy 0.98MB with 0.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
package/views/searchreplace.png37.22KB10.60KB▼ 71.53%
views/resources/imgs/roundedGrey225x69.png1.25KB0.26KB▼ 79.28%
package/css/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
views/resources/imgs/694GreyCorners.png1.18KB0.28KB▼ 76.55%
views/resources/imgs/icon-2.png2.63KB1.66KB▼ 36.98%