83% better-section-navigation

Code Review | Better Section Navigation Widget

WordPress plugin Better Section Navigation Widget scored83%from 54 tests.

About plugin

  • Plugin page: better-section-na...
  • Plugin version: 1.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.7.1
  • WordPress version: 6.3.1
  • First release: Jun 14, 2017
  • Latest release: Oct 15, 2022
  • Number of updates: 22
  • Update frequency: every 88.6 days
  • Top authors: drywallbmb (77.27%)kenjigarland (27.27%)

Code review

54 tests

User reviews

3 reviews

Install metrics

800+ active /8,858 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.35ms] Passed 4 tests

Server-side resources used by Better Section Navigation Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.79 ▲0.76
Dashboard /wp-admin3.33 ▲0.0345.11 ▼4.58
Posts /wp-admin/edit.php3.38 ▲0.0346.93 ▼1.47
Add New Post /wp-admin/post-new.php5.91 ▲0.0292.80 ▼6.82
Media Library /wp-admin/upload.php3.25 ▲0.0233.57 ▼0.53

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_better-section-nav
widget_simple-section-nav
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Better Section Navigation Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.181.73 ▼0.1640.07 ▼7.47
Dashboard /wp-admin2,206 ▲155.90 ▲0.99102.60 ▼3.4138.28 ▼2.23
Posts /wp-admin/edit.php2,089 ▼12.02 ▲0.0042.61 ▲0.9235.96 ▲2.96
Add New Post /wp-admin/post-new.php1,530 ▼318.49 ▼4.82618.06 ▲8.2954.63 ▼0.24
Media Library /wp-admin/upload.php1,385 ▼04.19 ▼0.03100.62 ▲1.4541.02 ▼1.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_simple-section-nav
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_better-section-nav
    • db_upgraded

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 no errors were found, this is by no means an exhaustive test

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
Please take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/better-section-navigation/exclude-pages.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/better-section-navigation/class-better-section-nav.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/better-section-navigation/class-better-section-nav.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Screenshot of widget output on "Open Source" page under top level page "My Portfolio", running Twenty-Ten theme), #2 (Screenshot of widget configuration.)
You can take inspiration from this readme.txt

better-section-navigation/better-section-nav.php 85% from 13 tests

The principal PHP file in "Better Section Navigation Widget" v. 1.6 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("better-section-navigation.php" instead of "better-section-nav.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected437 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3122192437

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity17.00
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity7.40
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions1794.44%
▷ Anonymous functions15.56%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png75.27KB20.56KB▼ 72.69%
screenshot-1.png19.60KB18.83KB▼ 3.97%