94% acf-unique-id-field

Code Review | Advanced Custom Fields: Unique ID Field

WordPress plugin Advanced Custom Fields: Unique ID Field scored 94% from 54 tests.

About plugin

  • Plugin page: acf-unique-id-field
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.0.1
  • WordPress version: 5.9.2
  • First release: Dec 5, 2014
  • Latest release: Dec 5, 2014
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: KLicheR (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active / 11,592 total downloads

Benchmarks

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.02MB] [CPU: ▼383.56ms] Passed 4 tests

Server-side resources used by Advanced Custom Fields: Unique ID Field
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0156.24 ▲4.60
Dashboard /wp-admin3.41 ▲0.0137.12 ▲2.73
Posts /wp-admin/edit.php3.64 ▲0.0139.28 ▼7.76
Add New Post /wp-admin/post-new.php6.92 ▼0.08103.47 ▼1,525.36
Media Library /wp-admin/upload.php3.30 ▼0.0024.96 ▼3.84

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Custom Fields: Unique ID Field
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲3115.85 ▼0.156.11 ▼0.502.44 ▼0.41
Dashboard /wp-admin2,892 ▲316.06 ▼0.03114.93 ▼26.62155.64 ▼1.98
Posts /wp-admin/edit.php2,694 ▲33.23 ▼0.0063.20 ▼3.32143.87 ▲1.26
Add New Post /wp-admin/post-new.php1,719 ▲5817.11 ▲0.41437.52 ▼2.93158.08 ▼2.16
Media Library /wp-admin/upload.php1,698 ▼05.54 ▲0.02138.36 ▲1.79193.24 ▲2.16

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-unique-id-field/acf-unique_id-v5.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/acf-unique-id-field/acf-unique_id.php:19

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: id, unique, acf

acf-unique-id-field/acf-unique_id.php 92% from 13 tests

The main PHP file in "Advanced Custom Fields: Unique ID Field" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("acf-unique-id-field.php" instead of "acf-unique_id.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected46 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2358632
Markdown19014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.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
No PNG images were found in this plugin