94% acf-field-selector-field

Code Review | ACF: Field Selector

WordPress plugin ACF: Field Selector scored 94% from 54 tests.

About plugin

  • Plugin page: acf-field-selecto...
  • Plugin version: 4.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2
  • WordPress version: 5.9.2
  • First release: Feb 4, 2014
  • Latest release: Apr 22, 2015
  • Number of updates: 18
  • Update frequency: every 24.6 days
  • Top authors: danielpataki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,071 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼303.96ms] Passed 4 tests

An overview of server-side resources used by ACF: Field Selector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0253.05 ▼6.44
Dashboard /wp-admin3.43 ▲0.0234.67 ▼2.75
Posts /wp-admin/edit.php3.66 ▲0.0237.63 ▼3.42
Add New Post /wp-admin/post-new.php6.90 ▼0.0896.42 ▼1,203.24
Media Library /wp-admin/upload.php3.31 ▲0.0123.07 ▼2.01

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for ACF: Field Selector
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲2115.84 ▲0.066.44 ▼0.292.38 ▼0.44
Dashboard /wp-admin2,895 ▲416.06 ▼0.13122.84 ▼13.36159.81 ▼3.41
Posts /wp-admin/edit.php2,694 ▲93.24 ▲0.0064.27 ▲2.69144.02 ▲2.34
Add New Post /wp-admin/post-new.php1,760 ▲7017.20 ▼3.73426.65 ▼19.15156.46 ▲3.63
Media Library /wp-admin/upload.php1,698 ▼35.49 ▼0.03135.86 ▼1.58186.06 ▲5.09

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
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 | 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
  • 3× 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-field-selector-field/acf-field_selector-v5.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-field-selector-field/acf-field_selector.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-field-selector-field/acf-field_selector-v4.php:23

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 on the user side


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: fields, google, acf

acf-field-selector-field/acf-field_selector.php 92% from 13 tests

This is the main PHP file of "ACF: Field Selector" version 4.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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-field-selector-field.php" instead of "acf-field_selector.php")

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 detected803 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PO File23640102

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions7100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin