68% ng-gallery-optimizer-modified

Code Review | NG Gallery Optimizer Modified

WordPress plugin NG Gallery Optimizer Modified scored68%from 54 tests.

About plugin

  • Plugin page: ng-gallery-optimi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.2-3.5
  • WordPress version: 6.3.1
  • First release: Jan 20, 2013
  • Latest release: Jan 21, 2013
  • Number of updates: 16
  • Update frequency: every 0.1 days
  • Top authors: kiranantony (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

40+ active /3,550 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.80MB] [CPU: ▼30.68ms] Passed 4 tests

An overview of server-side resources used by NG Gallery Optimizer Modified
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1239.60 ▼0.46
Dashboard /wp-admin3.18 ▼0.1628.22 ▼24.16
Posts /wp-admin/edit.php3.18 ▼0.2128.01 ▼24.47
Add New Post /wp-admin/post-new.php3.18 ▼2.7427.63 ▼66.08
Media Library /wp-admin/upload.php3.18 ▼0.0826.78 ▼7.99
Ngg Optimizer Modified /wp-admin/admin.php?page=nggom_options3.1825.47

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

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

Browser metrics Passed 4 tests

A check of browser resources used by NG Gallery Optimizer Modified
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.341.63 ▼0.1242.00 ▲2.56
Dashboard /wp-admin2,206 ▲185.86 ▼0.04112.43 ▲10.1545.23 ▲4.48
Posts /wp-admin/edit.php2,086 ▼62.04 ▲0.0739.23 ▼3.9333.71 ▼2.41
Add New Post /wp-admin/post-new.php1,533 ▲1223.54 ▲0.49583.76 ▼28.5853.76 ▼9.81
Media Library /wp-admin/upload.php1,388 ▲34.28 ▲0.0599.29 ▼2.4944.99 ▲1.46
Ngg Optimizer Modified /wp-admin/admin.php?page=nggom_options1,0102.1924.0545.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/ng-gallery-optimizer-modified/nextgen-gallery-optimizer.php+234
    Use of undefined constant NGGO_VERSION - assumed 'NGGO_VERSION' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=nggom_options
    • > Warning in wp-content/plugins/ng-gallery-optimizer-modified/nextgen-gallery-optimizer.php+234
    Use of undefined constant NGGO_VERSION - assumed 'NGGO_VERSION' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nggom_options
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/nextgen-gallery): failed to open dir: No such file or directory
    • > GET request to /wp-admin/admin.php?page=nggom_options
    • > Warning in wp-content/plugins/ng-gallery-optimizer-modified/nextgen-optimizer-options.php+69
    Use of undefined constant wordpress - assumed 'wordpress' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=nggom_options
    • > Warning in wp-content/plugins/ng-gallery-optimizer-modified/nextgen-optimizer-options.php+73
    Use of undefined constant google - assumed 'google' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=nggom_options
    • > Warning in wp-content/plugins/ng-gallery-optimizer-modified/nextgen-optimizer-options.php+91
    Use of undefined constant NGGO_FANCYBOX_VERSION - assumed 'NGGO_FANCYBOX_VERSION' (this will throw an Error in a future version of PHP)

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 take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ng-gallery-optimizer-modified/nextgen-gallery-optimizer.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ng-gallery-optimizer-modified/nextgen-optimizer-functions.php:14

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 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
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

ng-gallery-optimizer-modified/nextgen-gallery-optimizer.php 85% from 13 tests

"NG Gallery Optimizer Modified" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ng-gallery-optimizer-modified.php" instead of "nextgen-gallery-optimizer.php")
  • Description: The description should be shorter than 140 characters (currently 288 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected2,151 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4304127893
PHP5334171634
CSS311036624

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions36
▷ Named functions36100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
21 compressed PNG files occupy 0.12MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
fancybox/fancy_shadow_sw.png0.33KB0.48KB0.00%
fancybox/fancy_title_right.png0.49KB0.82KB0.00%
fancybox/fancy_shadow_nw.png0.32KB0.47KB0.00%
fancybox/fancybox-x.png0.20KB0.31KB0.00%
fancybox/fancybox.png14.93KB8.47KB▼ 43.29%