84% bu-navigation

Code Review | BU Navigation

WordPress plugin BU Navigation scored84%from 54 tests.

About plugin

  • Plugin page: bu-navigation
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.7
  • WordPress version: 6.3.1
  • First release: Mar 15, 2013
  • Latest release: Nov 10, 2021
  • Number of updates: 37
  • Update frequency: every 85.9 days
  • Top authors: bostonu (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

300+ active /18,284 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 gracefully, with no errors

Server metrics [RAM: ▲0.64MB] [CPU: ▼6.38ms] Passed 4 tests

Analyzing server-side resources used by BU Navigation
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5644.07 ▲3.78
Dashboard /wp-admin3.98 ▲0.6350.77 ▼8.49
Posts /wp-admin/edit.php4.03 ▲0.6847.48 ▲2.97
Add New Post /wp-admin/post-new.php6.63 ▲0.7485.44 ▼23.77
Media Library /wp-admin/upload.php3.90 ▲0.6738.74 ▲4.23
Edit Order /wp-admin/edit.php?post_type=page&page=bu-navigation-manager3.8344.60

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 137 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_bu_pages

Browser metrics Passed 4 tests

This is an overview of browser requirements for BU Navigation
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.32 ▼1.334.52 ▲2.5945.56 ▲1.75
Dashboard /wp-admin2,210 ▲224.87 ▼1.01100.01 ▼16.5839.54 ▼7.29
Posts /wp-admin/edit.php2,106 ▲172.18 ▲0.1336.85 ▼1.7131.54 ▼6.13
Add New Post /wp-admin/post-new.php6,200 ▲4,68119.70 ▼3.46964.66 ▲340.1953.99 ▲4.86
Media Library /wp-admin/upload.php1,397 ▲64.21 ▲0.04102.62 ▲7.1245.50 ▲3.21
Edit Order /wp-admin/edit.php?post_type=page&page=bu-navigation-manager1,0712.8168.3648.97

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_bu_pages

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

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 34× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/bu-navigation/templates/metabox-navigation-attributes.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bu-navigation/includes/class-tree-view.php:553
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/bu-navigation/tests/phpunit/nav-testcase.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BU\\Plugins\avigation\\add_filter() in wp-content/plugins/bu-navigation/composer-includes/bu-navigation-core-widget/src/filters.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'BU_Navigation_UnitTestCase' not found in wp-content/plugins/bu-navigation/tests/phpunit/test-extras.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bu-navigation/templates/primary-navigation.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_SeleniumTestCase' not found in wp-content/plugins/bu-navigation/tests/selenium/nav-selenium-testcase.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'BU_Navigation_UnitTestCase' not found in wp-content/plugins/bu-navigation/tests/phpunit/test-plugin.php:9
    • > PHP Notice
      Trying to get property 'menu_order' of non-object in wp-content/plugins/bu-navigation/templates/metabox-navigation-attributes.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bu-navigation/includes/class-tree-view.php:553

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/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: bu, navigation, hierarchical, post type, boston university

bu-navigation/bu-navigation.php Passed 13 tests

The principal PHP file in "BU Navigation" v. 1.3.4 is loaded by WordPress automatically on each request
82 characters long description:
Provides alternative navigation elements designed for blogs with large page counts

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
No dangerous file extensions were detected63,811 lines of code in 104 files:
LanguageFilesBlank linesComment linesLines of code
JSON827048,190
JavaScript218368607,071
PHP462,1812,5095,923
CSS122873561,842
PO File1106111297
Bourne Shell22111122
YAML390108
Python3172482
Markdown327079
XML36368
Cucumber15125
Sass1004

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity15.67
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods231
▷ Static methods00.00%
▷ Public methods21894.37%
▷ Protected methods114.76%
▷ Private methods20.87%
Functions73
▷ Named functions6386.30%
▷ Anonymous functions1013.70%
Constants65
▷ Global constants1320.00%
▷ Class constants5280.00%
▷ Public constants52100.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
11 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/vendor/jstree/themes/classic/d.png7.36KB2.58KB▼ 64.91%
images/ui-icons_333333_256x240.png4.27KB4.11KB▼ 3.78%
images/ui-icons_999999_256x240.png4.27KB4.11KB▼ 3.78%
js/vendor/jstree/themes/bu-jstree/sprite.png6.79KB3.47KB▼ 48.90%
js/vendor/jstree/themes/default/d.png7.46KB2.60KB▼ 65.11%