84% acf-field-selector-field

Code Review | ACF: Field Selector

WordPress plugin ACF: Field Selector scored84%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: 6.3.1
  • 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

90+ active /3,359 total downloads

Benchmarks

Plugin footprint 83% from 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: ▼6.15ms] Passed 4 tests

An overview of server-side resources used by ACF: Field Selector
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.23 ▼11.66
Dashboard /wp-admin3.31 ▲0.0143.67 ▼6.20
Posts /wp-admin/edit.php3.36 ▲0.0047.37 ▲1.94
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.76 ▼8.68
Media Library /wp-admin/upload.php3.23 ▲0.0035.28 ▲2.86

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by ACF: Field Selector
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.15 ▼1.501.60 ▼0.4641.01 ▲0.30
Dashboard /wp-admin2,209 ▲214.80 ▼1.10109.83 ▲3.1542.91 ▼2.15
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0139.80 ▲4.8736.51 ▲1.81
Add New Post /wp-admin/post-new.php1,533 ▼1023.14 ▲5.08662.91 ▲30.7677.00 ▲16.81
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.0194.31 ▼15.3240.28 ▼1.85

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, 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
Please fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-field-selector-field/acf-field_selector-v5.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: fields, google, acf

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

The main PHP file in "ACF: Field Selector" ver. 4.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-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 a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected803 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP4168346431
JavaScript16929164
CSS1180103
PO File23640102
Markdown1203

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
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
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.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
No PNG files were detected