90% nav-menu-trim

Code Review | Nav Menu Trim

WordPress plugin Nav Menu Trim scored90%from 54 tests.

About plugin

  • Plugin page: nav-menu-trim
  • Plugin version: 1.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.0
  • WordPress version: 6.3.1
  • First release: Aug 1, 2017
  • Latest release: Apr 13, 2023
  • Number of updates: 28
  • Update frequency: every 74.3 days
  • Top authors: thingsym (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,159 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.75ms] Passed 4 tests

This is a short check of server-side resources used by Nav Menu Trim
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.62 ▼3.94
Dashboard /wp-admin3.35 ▲0.0549.77 ▼5.08
Posts /wp-admin/edit.php3.40 ▲0.0549.29 ▼3.52
Add New Post /wp-admin/post-new.php5.93 ▲0.0588.45 ▼14.46
Media Library /wp-admin/upload.php3.28 ▲0.0537.27 ▼1.18

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Nav Menu Trim
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.35 ▼0.241.72 ▼0.2340.98 ▼4.39
Dashboard /wp-admin2,195 ▲185.56 ▼0.0384.15 ▼20.7439.35 ▼5.42
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0734.94 ▼1.7433.90 ▼6.43
Add New Post /wp-admin/post-new.php1,526 ▼923.16 ▲5.01592.45 ▼71.0054.28 ▼15.95
Media Library /wp-admin/upload.php1,400 ▼04.15 ▼0.0997.46 ▼3.4646.89 ▲0.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Appearance > Customize > Menus), #2 (Nav Menu Trim options)
The official readme.txt is a good inspiration

nav-menu-trim/nav-menu-trim.php Passed 13 tests

The main file in "Nav Menu Trim" v. 1.2.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
64 characters long description:
This WordPress plugin trim html id/class attributes of Nav Menu.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin317 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP259247276
PO File1141741

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png10.63KB11.56KB0.00%
screenshot-1.png7.29KB7.34KB0.00%