94% advanced-custom-fields-widget-relationship-field-add-on

Code Review | Advanced Custom Fields - Widget Relationship Field add-on

WordPress plugin Advanced Custom Fields - Widget Relationship Field add-on scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.6.0
  • WordPress version: 5.8.1
  • First release: Jan 18, 2013
  • Latest release: Jan 2, 2014
  • Number of updates: 51
  • Update frequency: every 6.8 days
  • Top authors: djbokka (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 5,942 total downloads

Benchmarks

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

This is a short check of server-side resources used by Advanced Custom Fields - Widget Relationship Field add-on
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0031.68 ▼42.77
Dashboard /wp-admin3.06 ▲0.0145.58 ▼24.96
Posts /wp-admin/edit.php3.11 ▼0.0048.30 ▼10.66
Add New Post /wp-admin/post-new.php5.42 ▼0.01154.28 ▼537.04
Media Library /wp-admin/upload.php3.00 ▲0.0034.82 ▼2.63

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Custom Fields - Widget Relationship Field add-on
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲6615.82 ▲0.217.24 ▼3.8049.86 ▼20.84
Dashboard /wp-admin2,970 ▲425.90 ▼0.00143.02 ▼20.02122.91 ▼3.78
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0179.63 ▲0.81101.40 ▲0.12
Add New Post /wp-admin/post-new.php1,498 ▼18518.77 ▲0.02567.69 ▲186.54136.16 ▲14.26
Media Library /wp-admin/upload.php1,810 ▲35.03 ▲0.02162.86 ▼0.93127.51 ▼0.38

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
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-widget-relationship-field-add-on/acf-widget-relationship-field.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: widget, widget filter, widget relationship, widget management, advanced custom fields

advanced-custom-fields-widget-relationship-field-add-on/acf-widget-relationship-field.php 92% from 13 tests

"Advanced Custom Fields - Widget Relationship Field add-on" version 1.3.4'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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-custom-fields-widget-relationship-field-add-on.php" instead of "acf-widget-relationship-field.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin418 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2175204370
JavaScript117626
Markdown122017
CSS1005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity72.00
▷ Minimum class complexity72.00
▷ Maximum class complexity72.00
Average method complexity6.07
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods535.71%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
There are no PNG files in this plugin