67% dropdown-menu-widget

Code Review | Dropdown Menu Widget

WordPress plugin Dropdown Menu Widget scored 67% from 54 tests.

About plugin

  • Plugin page: dropdown-menu-widget
  • Plugin version: 1.9.7
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.9.8
  • WordPress version: 5.8.1
  • First release: Nov 25, 2009
  • Latest release: Nov 14, 2018
  • Number of updates: 260
  • Update frequency: every 12.6 days
  • Top authors: mattsay (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

10,000+ active / 513,650 total downloads


Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.62MB] [CPU: ▼170.69ms] Passed 4 tests

A check of server-side resources used by Dropdown Menu Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.06 ▲0.3441.07 ▲19.29
Dashboard /wp-admin3.03 ▼0.0329.69 ▼16.34
Posts /wp-admin/edit.php3.03 ▼0.0829.92 ▼16.84
Add New Post /wp-admin/post-new.php3.03 ▼2.4125.44 ▼633.99
Media Library /wp-admin/upload.php3.03 ▲0.0226.18 ▼15.59
Dropdown Menu /wp-admin/options-general.php?page=dropdown-menu3.0520.94

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 117 new files
Database: no new tables, 1 new option
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for Dropdown Menu Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,867 ▲27116.40 ▲0.5214.57 ▲5.8549.58 ▲3.95
Dashboard /wp-admin2,992 ▲615.96 ▲0.04142.99 ▼4.57111.69 ▼19.84
Posts /wp-admin/edit.php2,761 ▲222.74 ▲0.0674.29 ▲4.61102.14 ▲9.29
Add New Post /wp-admin/post-new.php1,517 ▼6421.18 ▲4.93377.40 ▼36.27108.33 ▼20.63
Media Library /wp-admin/upload.php1,829 ▲255.08 ▼0.01157.65 ▼49.13124.33 ▼6.98
Dropdown Menu /wp-admin/options-general.php?page=dropdown-menu2,4552.6280.08116.30

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/dropdown-menu-widget/shailan.DropDownMenu.php+72
    Undefined index: page
  • This plugin does not fully uninstall, leaving 1 option in the database
    • shailan_dropdown_menu

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dropdown-menu
    • > Notice in wp-content/plugins/dropdown-menu-widget/shailan.DropDownMenu.php+103
    Undefined index: action

SRP 50% 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
Almost there! Just fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/dropdown-menu-widget/shailan-page-walker.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/dropdown-menu-widget/stf-page-options.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/dropdown-menu-widget/shailan-category-walker.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/dropdown-menu-widget/shailan-multi-dropdown.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/dropdown-menu-widget/shailan.DropDownMenu.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/dropdown-menu-widget/shailan-dropdown-menu-options.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test


Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Brand new dropdown menu options page.) image required
  • Tags: There are too many tags (15 tag instead of maximum 10)
You can look at the official readme.txt

dropdown-menu-widget/shailan.DropDownMenu.php 85% from 13 tests

The main file in "Dropdown Menu Widget" v. 1.9.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("dropdown-menu-widget.php" instead of "shailan.DropDownMenu.php")

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
Success! There were no dangerous files found in this plugin3,005 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing 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.28
Average class complexity32.50
▷ Minimum class complexity11.00
▷ Maximum class complexity80.00
Average method complexity5.85
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions7100.00%
▷ Anonymous functions00.00%
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
52 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings