10% nice-navigation

Code Review | Nice Navigation

WordPress plugin Nice Navigation scored10%from 54 tests.

About plugin

  • Plugin page: nice-navigation
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.4.1
  • WordPress version: 6.3.1
  • First release: Jul 22, 2010
  • Latest release: Aug 16, 2012
  • Number of updates: 17
  • Update frequency: every 44.5 days
  • Top authors: eskapism (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /22,694 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/nice-navigation/nice-navigation.php+72
    Methods with the same name as their class will not be constructors in a future version of PHP; Nice_Navigation has a deprecated constructor

Server metrics [RAM: ▼1.90MB] [CPU: ▼58.58ms] Passed 4 tests

This is a short check of server-side resources used by Nice Navigation
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.374.62 ▼36.31
Dashboard /wp-admin2.11 ▼1.236.69 ▼68.49
Posts /wp-admin/edit.php2.11 ▼1.246.09 ▼40.15
Add New Post /wp-admin/post-new.php2.11 ▼3.777.50 ▼89.35
Media Library /wp-admin/upload.php2.11 ▼1.125.33 ▼30.49

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Nice Navigation
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13713.60 ▼0.999.65 ▲7.7542.68 ▼0.87
Dashboard /wp-admin2,206 ▲155.88 ▲0.7597.70 ▼7.7938.96 ▼1.70
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0441.24 ▼0.2234.36 ▼2.74
Add New Post /wp-admin/post-new.php1,544 ▲1118.27 ▼4.89600.73 ▼75.1550.90 ▼9.48
Media Library /wp-admin/upload.php1,385 ▼64.21 ▼0.0095.10 ▼6.2242.23 ▼1.29

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/nice-navigation/nice-navigation.php+72
    Methods with the same name as their class will not be constructors in a future version of PHP; Nice_Navigation has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_nice_navigation
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nice-navigation/nice-navigation.php:11

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
  • Screenshots: Add images for these screenshots: #1 (It's your menu. Before and after Nice Navigation.), #2 (Nice Navigation widget configuration. Choose function and layout/look.)
  • Plugin Name: Please specify the plugin name on the first line ( === nice-navigation === )
You can look at the official readme.txt

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

"Nice Navigation" version 1.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
97 characters long description:
Adds a widget that makes your page list expandable/collapsible with a nice slide animation effect

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin239 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15463160
JavaScript1211541
CSS17038

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png17.21KB6.06KB▼ 64.80%