84% two-level-conditional-menu

Code Review | Two Level Conditional Menu

WordPress plugin Two Level Conditional Menu scored84%from 54 tests.

About plugin

  • Plugin page: two-level-conditi...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Mar 25, 2013
  • Latest release: May 29, 2013
  • Number of updates: 7
  • Update frequency: every 9.7 days
  • Top authors: pwp2 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,826 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼12.19ms] Passed 4 tests

Analyzing server-side resources used by Two Level Conditional Menu
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.10 ▼5.96
Dashboard /wp-admin3.32 ▼0.0351.45 ▼19.43
Posts /wp-admin/edit.php3.37 ▲0.0152.19 ▼3.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.43 ▼20.36
Media Library /wp-admin/upload.php3.24 ▲0.0139.06 ▲1.08

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Two Level Conditional Menu
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.31 ▲0.081.72 ▼0.0243.12 ▲2.60
Dashboard /wp-admin2,195 ▲215.65 ▼0.1287.07 ▲0.5939.63 ▼5.09
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0040.23 ▲3.0635.61 ▲0.29
Add New Post /wp-admin/post-new.php1,545 ▲1923.22 ▲5.63677.99 ▲38.8551.42 ▲4.23
Media Library /wp-admin/upload.php1,403 ▼04.27 ▲0.07101.62 ▼2.2642.51 ▼3.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/two-level-conditional-menu/two-level-conditional-menu.php:95

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues 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
2 plugin tags: navigation, menu

two-level-conditional-menu/two-level-conditional-menu.php Passed 13 tests

"Two Level Conditional Menu" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
58 characters long description:
Replaces two-level menu with a two-level conditional menu.

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 plugin55 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1172455

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.88
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin