62% nextgen-gallery-optimizer

Code Review | NextGEN Gallery Optimizer

WordPress plugin NextGEN Gallery Optimizer scored62%from 54 tests.

About plugin

  • Plugin page: nextgen-gallery-o...
  • Plugin version: 2.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.7
  • WordPress version: 6.3.1
  • First release: Feb 28, 2012
  • Latest release: Dec 12, 2016
  • Number of updates: 101
  • Update frequency: every 17.4 days
  • Top authors: Mark Jeldi (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

3,000+ active /250,409 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.88MB] [CPU: ▼48.96ms] Passed 4 tests

This is a short check of server-side resources used by NextGEN Gallery Optimizer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.366.34 ▼35.98
Dashboard /wp-admin2.13 ▼1.186.40 ▼40.08
Posts /wp-admin/edit.php2.13 ▼1.236.82 ▼39.18
Add New Post /wp-admin/post-new.php2.13 ▼3.766.85 ▼80.61
Media Library /wp-admin/upload.php2.13 ▼1.106.41 ▼25.64
/wp-admin/options-general.php?page=nextgen-optimizer-basic-fancybox-interface2.135.84
NextGEN Gallery Optimizer Basic /wp-admin/options-general.php?page=nextgen-gallery-optimizer-basic-settings2.136.51

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 71 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
nextgen_gallery_optimizer_basic_settings
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for NextGEN Gallery Optimizer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.26 ▼0.091.90 ▲0.1745.33 ▼3.19
Dashboard /wp-admin2,205 ▲255.63 ▼0.0381.12 ▼20.5438.38 ▼3.58
Posts /wp-admin/edit.php2,107 ▲72.03 ▼0.0033.09 ▼3.3533.80 ▲1.32
Add New Post /wp-admin/post-new.php1,536 ▲1023.32 ▲0.09631.67 ▼53.9753.62 ▼15.34
Media Library /wp-admin/upload.php1,407 ▲74.18 ▼0.0395.16 ▼32.0443.62 ▼1.15
/wp-admin/options-general.php?page=nextgen-optimizer-basic-fancybox-interface5672.0126.923.93
NextGEN Gallery Optimizer Basic /wp-admin/options-general.php?page=nextgen-gallery-optimizer-basic-settings1,0241.8828.0843.66

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/nextgen-gallery): failed to open dir: No such file or directory
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=nextgen-gallery-optimizer-basic-settings
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/nextgen-gallery): failed to open dir: No such file or directory
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=nextgen-gallery-optimizer-basic-settings
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/nextcellent-gallery-nextgen-legacy): failed to open dir: No such file or directory

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
  • 19× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/class-nggobasic-validation.php
    • > /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/view/nggobasic-settings-view.php
    • > /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/install/class-nggobasic-fancybox-installer-nextgen-v1.php
    • > /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/class-nggobasic-settings-page.php
    • > /wp-content/plugins/nextgen-gallery-optimizer/nextgen-gallery-optimizer.php
    • > /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/class-nggobasic-admin-cleanup.php
    • > /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/view/nggobasic-dfsi-demo-view.php
    • > /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/class-nggobasic-dfsi-demo.php
    • > /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/class-nggobasic-regex.php
    • > /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/install/class-nggobasic-lightbox-installer-nextgen-v2.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=nextgen-optimizer-basic-fancybox-interface
    • > Javascript (severe) in unknown
    /wp-content/plugins/nextgen-gallery-optimizer/admin/assets/js/nggobasic-dfsi-demo.min.js?ver=2.1.5 66:114 Uncaught TypeError: Cannot read properties of undefined (reading 'pluginDirUrl')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

nextgen-gallery-optimizer/nextgen-gallery-optimizer.php 92% from 13 tests

The primary PHP file in "NextGEN Gallery Optimizer" version 2.1.5 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 1973 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected4,493 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP201,7804,8042,671
JavaScript106319991,420
CSS378179402

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity30.47
▷ Minimum class complexity2.00
▷ Maximum class complexity77.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods196
▷ Static methods178.67%
▷ Public methods196100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
21 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
fancybox/fancy_close.png1.48KB1.73KB0.00%
fancybox/fancy_shadow_e.png0.10KB0.18KB0.00%
fancybox/fancybox-x.png0.20KB0.31KB0.00%
fancybox/fancy_shadow_nw.png0.32KB0.47KB0.00%
fancybox/fancy_title_left.png0.49KB0.82KB0.00%