90% wp-add-active-class-to-menu-item

Code Review | WP Add Active Class To Menu Item

WordPress plugin WP Add Active Class To Menu Item scored90%from 54 tests.

About plugin

  • Plugin page: wp-add-active-cla...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.0
  • WordPress version: 6.3.1
  • First release: Jan 30, 2017
  • Latest release: Jul 2, 2022
  • Number of updates: 17
  • Update frequency: every 116.2 days
  • Top authors: aftabmuni (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

800+ active /6,501 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by WP Add Active Class To Menu Item
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.65 ▼5.23
Dashboard /wp-admin3.32 ▼0.0352.30 ▼14.11
Posts /wp-admin/edit.php3.37 ▲0.0159.49 ▲5.67
Add New Post /wp-admin/post-new.php5.91 ▲0.0194.24 ▼3.33
Media Library /wp-admin/upload.php3.25 ▲0.0135.21 ▲0.20
WP Add Active Class To Menu Item /wp-admin/options-general.php?page=wp_add_active_class_to_menu_item_dashboard3.2133.66

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
wp_add_active_class_to_menu_item_classes
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

WP Add Active Class To Menu Item: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.38 ▼0.141.87 ▲0.0740.57 ▼3.59
Dashboard /wp-admin2,196 ▲215.51 ▼0.2191.99 ▼13.6538.85 ▼6.59
Posts /wp-admin/edit.php2,107 ▲41.95 ▼0.0341.16 ▲3.2534.56 ▼5.33
Add New Post /wp-admin/post-new.php1,534 ▲923.39 ▼0.21671.80 ▲55.3860.31 ▲6.70
Media Library /wp-admin/upload.php1,404 ▲74.20 ▼0.00116.61 ▲17.5749.30 ▲5.81
WP Add Active Class To Menu Item /wp-admin/options-general.php?page=wp_add_active_class_to_menu_item_dashboard8111.9624.3123.08

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • wp_add_active_class_to_menu_item_classes
    • theysaidso_admin_options

Smoke tests Passed 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 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: add active to li tag wordpress menu, add active class to menu li tag, add active class to li tag, wordpress add active class to menu item, wp add active class to menu item

wp-add-active-class-to-menu-item/wp-add-active-class-to-menu-item.php Passed 13 tests

The primary PHP file in "WP Add Active Class To Menu Item" version 1.0 is used by WordPress to initiate all plugin functionality
128 characters long description:
This plugin is useful when you need to add active class to menu item li tag in place of current-menu-item or current_page_parent

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin68 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2141868

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.54
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin