93% advanced-custom-fields-nextgen-gallery-field-add-on

Code Review | Advanced Custom Fields: NextGEN Gallery Field add-on

WordPress plugin Advanced Custom Fields: NextGEN Gallery Field add-on scored 93% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0 or higher-4.1.0
  • WordPress version: 5.8.1
  • First release: Jun 9, 2012
  • Latest release: Jan 4, 2015
  • Number of updates: 122
  • Update frequency: every 7.7 days
  • Top authors: aloziak (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active / 31,810 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by Advanced Custom Fields: NextGEN Gallery Field add-on
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0144.50 ▲7.80
Dashboard /wp-admin3.06 ▲0.0151.36 ▼6.14
Posts /wp-admin/edit.php3.12 ▲0.0152.64 ▼3.71
Add New Post /wp-admin/post-new.php5.42 ▼0.0190.53 ▼569.49
Media Library /wp-admin/upload.php3.01 ▲0.0139.63 ▲3.05

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Custom Fields: NextGEN Gallery Field add-on
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.99 ▲0.508.95 ▼3.3354.55 ▲1.79
Dashboard /wp-admin2,967 ▲365.91 ▼0.04158.52 ▼15.76116.31 ▼6.36
Posts /wp-admin/edit.php2,739 ▼02.72 ▼0.0074.78 ▲10.4796.40 ▲0.49
Add New Post /wp-admin/post-new.php1,615 ▼6821.39 ▲2.63363.27 ▼72.69124.50 ▲5.24
Media Library /wp-admin/upload.php1,807 ▼05.03 ▼0.02166.17 ▼5.22113.48 ▼8.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
  • 5× 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/advanced-custom-fields-nextgen-gallery-field-add-on/acf-ngg-v3.php:386
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-nextgen-gallery-field-add-on/acf-ngg-v5.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/advanced-custom-fields-nextgen-gallery-field-add-on/acf-ngg-v4.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/advanced-custom-fields-nextgen-gallery-field-add-on/acf-ngg.php:19
    • > calling Plugin Construct

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)
No browser issues were found


Plugin configuration 83% from 29 tests

readme.txt 88% 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 need to be fixed:
  • Requires at least: Version not formatted correctly
  • Screenshots: Add images for these screenshots: #1 (NextGEN Gallery Field.), #2 (Adding a NextGEN Gallery to a page.)
Please take inspiration from this readme.txt

advanced-custom-fields-nextgen-gallery-field-add-on/acf-ngg.php 77% from 13 tests

The primary PHP file in "Advanced Custom Fields: NextGEN Gallery Field add-on" version 2.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 212 characters long)
  • Requires at least: Required version number should only contain digits separated by dots (ex. "7.0" instead of "3.0 or higher")
  • Main file name: Name the main plugin file the same as the plugin slug ("advanced-custom-fields-nextgen-gallery-field-add-on.php" instead of "acf-ngg.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin670 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity16.20
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
▷ Static methods13.57%
▷ Public methods2589.29%
▷ Protected methods00.00%
▷ Private methods310.71%
▷ Named functions3100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.17MB with 0.11MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png103.83KB38.07KB▼ 63.34%
screenshot-1.png74.21KB25.60KB▼ 65.51%