83% 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 scored83%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: 6.3.1
  • 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

300+ active /8,775 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Advanced Custom Fields: NextGen Gallery Custom Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.82 ▼19.01
Dashboard /wp-admin3.31 ▲0.0145.39 ▼0.95
Posts /wp-admin/edit.php3.36 ▲0.0045.53 ▼4.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.74 ▼11.08
Media Library /wp-admin/upload.php3.23 ▲0.0033.72 ▼1.12

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom Fields: NextGen Gallery Custom Field
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.17 ▼1.211.63 ▼0.2241.12 ▼2.86
Dashboard /wp-admin2,206 ▲184.85 ▼0.00108.35 ▲3.0642.79 ▼1.01
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0239.92 ▼0.0335.95 ▲0.55
Add New Post /wp-admin/post-new.php1,542 ▼018.21 ▼0.07598.08 ▼24.8653.90 ▼8.51
Media Library /wp-admin/upload.php1,388 ▼04.19 ▲0.0294.75 ▼1.8443.32 ▲2.53

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > 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
    • > 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

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

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (This is the field in de ACF admin panel.), #2 (NGGallery object returned in template.), #3 (Images array returned in template.)
The official readme.txt might help

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

This is the main PHP file of "Advanced Custom Fields: NextGen Gallery Custom Field" version 1.1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • 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: The description should be shorter than 140 characters (currently 191 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
There were no executable files found in this plugin176 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP264167176

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for 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

PNG files should be compressed to save space and minimize bandwidth usage
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-2.png62.70KB15.59KB▼ 75.13%
screenshot-1.png88.44KB27.26KB▼ 69.17%
screenshot-3.png57.40KB17.04KB▼ 70.32%