94% acf-link-picker-field

Code Review | Advanced Custom Fields: Link Picker Field

WordPress plugin Advanced Custom Fields: Link Picker Field scored 94% from 54 tests.

About plugin

  • Plugin page: acf-link-picker-f...
  • Plugin version: 1.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 5.9.2
  • First release: Sep 18, 2015
  • Latest release: Dec 8, 2016
  • Number of updates: 20
  • Update frequency: every 31.5 days
  • Top authors: caalami (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 13,083 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼304.21ms] Passed 4 tests

A check of server-side resources used by Advanced Custom Fields: Link Picker Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0157.41 ▲7.41
Dashboard /wp-admin3.41 ▲0.0134.85 ▲1.10
Posts /wp-admin/edit.php3.65 ▲0.0139.22 ▲2.02
Add New Post /wp-admin/post-new.php6.88 ▼0.0993.44 ▼1,213.67
Media Library /wp-admin/upload.php3.30 ▲0.0023.44 ▼6.28

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 20 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom Fields: Link Picker Field
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲3115.25 ▼0.355.91 ▼0.122.16 ▼0.69
Dashboard /wp-admin2,895 ▲345.98 ▼0.28119.90 ▼18.02159.98 ▼1.12
Posts /wp-admin/edit.php2,694 ▲93.23 ▲0.0164.23 ▼0.05140.01 ▼3.84
Add New Post /wp-admin/post-new.php1,661 ▼5016.74 ▼3.88409.77 ▼45.29156.66 ▼2.64
Media Library /wp-admin/upload.php1,698 ▼35.48 ▼0.04140.52 ▲0.65182.57 ▼5.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-link-picker-field/acf-link_picker-v4.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/acf-link-picker-field/acf-link_picker.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-link-picker-field/acf-link_picker-v5.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: acf, link chooser, acf link picker, advanced custom fields, link picker

acf-link-picker-field/acf-link_picker.php 92% from 13 tests

"Advanced Custom Fields: Link Picker Field" version 1.2.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("acf-link-picker-field.php" instead of "acf-link_picker.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
Everything looks great! No dangerous files found in this plugin531 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP3263590237
JavaScript15446173
PO File3350109
Markdown48012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
PNG images were not found in this plugin