84% ns-category-widget

Code Review | NS Category Widget

WordPress plugin NS Category Widget scored84%from 54 tests.

About plugin

  • Plugin page: ns-category-widget
  • Plugin version: 3.1.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Dec 10, 2013
  • Latest release: May 24, 2023
  • Number of updates: 54
  • Update frequency: every 63.9 days
  • Top authors: rabmalin (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

2,000+ active /31,032 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.43MB] [CPU: ▼2.07ms] Passed 4 tests

A check of server-side resources used by NS Category Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2139.51 ▼4.11
Dashboard /wp-admin3.88 ▲0.5356.44 ▼8.00
Posts /wp-admin/edit.php3.93 ▲0.5762.60 ▲8.91
Add New Post /wp-admin/post-new.php6.39 ▲0.5097.31 ▼3.98
Media Library /wp-admin/upload.php3.71 ▲0.4844.57 ▲7.82
NS Category Widget /wp-admin/options-general.php?page=ns-category-widget3.7143.20

Server storage [IO: ▲0.41MB] [DB: ▲0.02MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for NS Category Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,142 ▲39617.45 ▲3.078.62 ▲6.8841.75 ▲0.06
Dashboard /wp-admin2,400 ▲1978.20 ▲3.32169.42 ▲63.4543.56 ▼1.73
Posts /wp-admin/edit.php2,299 ▲2025.46 ▲3.45100.72 ▲62.1037.70 ▲2.59
Add New Post /wp-admin/post-new.php1,553 ▲824.59 ▲1.44741.33 ▲80.6136.24 ▼21.27
Media Library /wp-admin/upload.php1,435 ▲415.53 ▲1.29135.98 ▲33.0543.23 ▼1.71
NS Category Widget /wp-admin/options-general.php?page=ns-category-widget1,1785.1393.0729.31

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • nscw_plugin_options
    • widget_ns-category-widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

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

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ns-category-widget/widgets/nscw-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Nilambar\\Optioner\\add_action() in wp-content/plugins/ns-category-widget/vendor/ernilambar/optioner/optioner.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can look at the official readme.txt

ns-category-widget/ns-category-widget.php Passed 13 tests

Analyzing the main PHP file in "NS Category Widget" version 3.1.7
74 characters long description:
A widget plugin for listing categories and taxonomies in the way you want.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected3,770 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP207501,4292,475
CSS2012978
JavaScript62762166
JSON300149
Markdown1102

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity32.67
▷ Minimum class complexity1.00
▷ Maximum class complexity152.00
Average method complexity3.61
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods147
▷ Static methods2819.05%
▷ Public methods12182.31%
▷ Protected methods106.80%
▷ Private methods1610.88%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants12
▷ Global constants975.00%
▷ Class constants325.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/css/themes/default/40px.png1.84KB1.84KB0.00%
public/assets/css/themes/default/32px.png3.05KB2.88KB▼ 5.58%