56% material-dashboard

Code Review | Material Dashboard

WordPress plugin Material Dashboard scored56%from 54 tests.

About plugin

  • Plugin page: material-dashboard
  • Plugin version: 1.0.9
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: May 5, 2023
  • Latest release: Oct 12, 2023
  • Number of updates: 12
  • Update frequency: every 13.5 days
  • Top authors: ho3einie (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /633 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲2.41MB] [CPU: ▲47.84ms] Passed 4 tests

This is a short check of server-side resources used by Material Dashboard
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.85 ▲2.3888.07 ▲48.72
Dashboard /wp-admin5.72 ▲2.4183.03 ▲33.49
Posts /wp-admin/edit.php5.87 ▲2.51103.15 ▲56.53
Add New Post /wp-admin/post-new.php8.32 ▲2.43304.45 ▲210.06
Media Library /wp-admin/upload.php5.65 ▲2.4286.00 ▲52.61
Wizard /wp-admin/admin.php?page=amd-wizard5.64111.79
More /wp-admin/admin.php?page=amd-more5.6790.86
Appearance /wp-admin/admin.php?page=amd-appearance5.7990.10
Themes /wp-admin/admin.php?page=amd-themes5.6795.10
Manage data /wp-admin/admin.php?page=amd-data5.6993.11
Security /wp-admin/admin.php?page=amd-security5.6789.15
Extensions /wp-admin/admin.php?page=amd-ext5.6694.82
Dashboard /wp-admin/admin.php?page=material-dashboard5.86119.49
Settings /wp-admin/admin.php?page=amd-settings5.76111.97

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 250 new files
Database: 7 new tables, 6 new options
New tables
wp_amd_options
wp_amd_tasks
wp_amd_reports
wp_amd_components
wp_amd_todo
wp_amd_users_meta
wp_amd_temp
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Material Dashboard
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,193 ▲43215.35 ▲0.767.00 ▲5.3528.89 ▼12.98
Dashboard /wp-admin2,485 ▲3086.45 ▲0.91118.54 ▲32.89112.27 ▲69.38
Posts /wp-admin/edit.php2,408 ▲3083.77 ▲1.6549.24 ▲10.6378.06 ▲44.66
Add New Post /wp-admin/post-new.php1,819 ▲41320.47 ▲2.56656.33 ▲42.3230.37 ▼21.13
Media Library /wp-admin/upload.php1,541 ▲1414.49 ▲0.3285.71 ▼18.9986.08 ▲41.65
Wizard /wp-admin/admin.php?page=amd-wizard1,4173.9261.2256.43
More /wp-admin/admin.php?page=amd-more1,5143.8356.26116.77
Appearance /wp-admin/admin.php?page=amd-appearance2,1604.1963.63120.76
Themes /wp-admin/admin.php?page=amd-themes1,3793.9551.60102.32
Manage data /wp-admin/admin.php?page=amd-data1,6944.1972.21112.75
Security /wp-admin/admin.php?page=amd-security1,5113.9757.88108.23
Extensions /wp-admin/admin.php?page=amd-ext1,4963.5652.94121.70
Dashboard /wp-admin/admin.php?page=material-dashboard1,5863.5354.47135.18
Settings /wp-admin/admin.php?page=amd-settings2,4804.3073.69121.62

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
You still need to fix the following
  • The uninstall procedure failed, leaving 7 tables in the database
    • wp_amd_options
    • wp_amd_todo
    • wp_amd_temp
    • wp_amd_tasks
    • wp_amd_components
    • wp_amd_reports
    • wp_amd_users_meta
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=amd-settings
    • > Warning in wp-content/plugins/material-dashboard/pages/admin-tabs/tab_registration.php+19
    Invalid argument supplied for foreach()

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/material-dashboard/themes/amatris/dashboard/parts/navbar.php
    • > /wp-content/plugins/material-dashboard/themes/amatris/dashboard/parts/loader.php
    • > /wp-content/plugins/material-dashboard/themes/amatris/dashboard/parts/suspension_loader.php
  • 74× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function getExportVariants() on null in wp-content/plugins/material-dashboard/pages/admin-tabs/tab_md_export.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function amd_get_site_option() in wp-content/plugins/material-dashboard/ext/_app/wizard/initialize_script.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/material-dashboard/dashboard/pages/page-home.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_session_token() in wp-content/plugins/material-dashboard/dashboard/pages/page-login-reports.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/material-dashboard/ext/woocommerce/view/page_wc_cart.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function amd_get_site_option() in wp-content/plugins/material-dashboard/ext/_app/wizard/steps/step_3.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/material-dashboard/pages/admin-tabs/tab_md_cleanup.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/material-dashboard/pages/admin-tabs/tab_pages.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function amd_sanitize_get_fields() in wp-content/plugins/material-dashboard/ext/woocommerce/view/page_wc_purchases.php:31
    • > PHP Fatal error
      Uncaught Error: Call to a member function cacheExists() on null in wp-content/plugins/material-dashboard/themes/amatris/dashboard/templates/card_col_card.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=amd-wizard
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=amd-wizard 33:106 Uncaught ReferenceError: amd_conf is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention: The official readme.txt is a good inspiration

material-dashboard/index.php 92% from 13 tests

The principal PHP file in "Material Dashboard" v. 1.0.9 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("material-dashboard.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin47,511 lines of code in 176 files:
LanguageFilesBlank linesComment linesLines of code
PHP1205,5727,92621,289
JavaScript92,7101,51813,915
CSS261,1171049,827
PO File15947801,834
JSON1100580
SVG70049
Markdown29017

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity54.32
▷ Minimum class complexity2.00
▷ Maximum class complexity166.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity89.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods420
▷ Static methods00.00%
▷ Public methods37589.29%
▷ Protected methods4210.00%
▷ Private methods30.71%
Functions457
▷ Named functions27359.74%
▷ Anonymous functions18440.26%
Constants96
▷ Global constants3839.58%
▷ Class constants5860.42%
▷ Public constants58100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
30 PNG files occupy 0.63MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo/default_512.png7.60KB3.58KB▼ 52.85%
themes/amatris/thumbnail.png13.17KB6.62KB▼ 49.77%
assets/images/flags/iran-flag.png14.36KB6.53KB▼ 54.49%
assets/images/logo/mono_256.png2.88KB1.53KB▼ 47.05%
assets/images/bootstrap-icons-thumb.png12.67KB2.01KB▼ 84.14%