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

Code Review | Advanced Custom Fields: NextGen Gallery Custom Field

WordPress plugin Advanced Custom Fields: NextGen Gallery Custom Field scored 93% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.7.1
  • WordPress version: 5.9.2
  • First release: Sep 23, 2013
  • Latest release: Nov 10, 2013
  • Number of updates: 12
  • Update frequency: every 4.0 days
  • Top authors: JeroenReumkens (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active / 8,411 total downloads

Benchmarks

Plugin footprint Passed 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: ▼0.02MB] [CPU: ▼295.18ms] Passed 4 tests

Server-side resources used by Advanced Custom Fields: NextGen Gallery Custom Field
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0151.84 ▲4.30
Dashboard /wp-admin3.41 ▲0.0130.84 ▼7.63
Posts /wp-admin/edit.php3.64 ▲0.0134.80 ▼0.28
Add New Post /wp-admin/post-new.php6.91 ▼0.0991.78 ▼1,172.46
Media Library /wp-admin/upload.php3.30 ▲0.0023.24 ▼0.35

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 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 Custom Field
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲815.92 ▼0.106.34 ▲0.502.20 ▼0.20
Dashboard /wp-admin2,892 ▲346.06 ▼0.10117.85 ▼14.56159.27 ▲0.24
Posts /wp-admin/edit.php2,691 ▲33.24 ▲0.0162.20 ▲1.33144.90 ▲3.76
Add New Post /wp-admin/post-new.php1,668 ▼4318.04 ▼3.38426.20 ▼16.62151.38 ▼2.54
Media Library /wp-admin/upload.php1,698 ▲35.51 ▲0.00135.34 ▼12.91188.55 ▲0.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-nextgen-gallery-custom-field/nggallery-v4.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-nextgen-gallery-custom-field/acf-nggallery.php:15

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (This is the field in de ACF admin panel.), #2 (NGGallery object returned in template.), #3 (Images array returned in template.)
You can take inspiration from this readme.txt

advanced-custom-fields-nextgen-gallery-custom-field/acf-nggallery.php 85% from 13 tests

Analyzing the main PHP file in "Advanced Custom Fields: NextGen Gallery Custom Field" version 1.1.4
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-custom-fields-nextgen-gallery-custom-field.php" instead of "acf-nggallery.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 191 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected176 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP264167176

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
3 PNG files occupy 0.20MB with 0.15MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png57.40KB17.04KB▼ 70.32%
screenshot-2.png62.70KB15.59KB▼ 75.13%
screenshot-1.png88.44KB27.26KB▼ 69.17%