84% ngg-image-chooser-block

Code Review | Image Chooser Block for NextGEN Gallery

WordPress plugin Image Chooser Block for NextGEN Gallery scored84%from 54 tests.

About plugin

  • Plugin page: ngg-image-chooser...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-6.0.3
  • WordPress version: 6.3.1
  • First release: Oct 21, 2020
  • Latest release: Oct 23, 2022
  • Number of updates: 11
  • Update frequency: every 66.6 days
  • Top authors: umertin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /933 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Image Chooser Block for NextGEN Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.30 ▼3.22
Dashboard /wp-admin3.31 ▲0.0050.36 ▲1.01
Posts /wp-admin/edit.php3.36 ▲0.0048.43 ▼1.12
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.65 ▼18.01
Media Library /wp-admin/upload.php3.23 ▲0.0036.62 ▼4.97

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Image Chooser Block for NextGEN Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.35 ▼0.001.94 ▼0.4740.91 ▼4.06
Dashboard /wp-admin2,195 ▲185.62 ▼0.0484.63 ▼12.3141.77 ▼2.59
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0234.55 ▼3.4535.83 ▼4.88
Add New Post /wp-admin/post-new.php1,526 ▼022.95 ▼0.14635.20 ▼48.2457.29 ▲5.21
Media Library /wp-admin/upload.php1,403 ▲64.17 ▼0.0896.56 ▼25.4143.82 ▼4.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ngg-image-chooser-block/admin/settings.php

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: gallery, image chooser, nextgen

ngg-image-chooser-block/nextgen-ic.php 92% from 13 tests

The primary PHP file in "Image Chooser Block for NextGEN Gallery" version 1.0.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ngg-image-chooser-block.php" instead of "nextgen-ic.php")

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
No dangerous file extensions were detected427 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP691116383
CSS219041
SVG2002
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected