93% advanced-custom-fields-table-field

Code Review | Advanced Custom Fields: Table Field

WordPress plugin Advanced Custom Fields: Table Field scored 93% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.3.14
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.7
  • WordPress version: 5.9.2
  • First release: Dec 29, 2014
  • Latest release: Jul 2, 2021
  • Number of updates: 208
  • Update frequency: every 12.4 days
  • Top authors: Jonua (100%)

Code review

54 tests

User reviews

53 reviews

Install metrics

50,000+ active / 393,972 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

An overview of server-side resources used by Advanced Custom Fields: Table Field
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0156.80 ▲2.95
Dashboard /wp-admin3.42 ▲0.0133.45 ▼0.81
Posts /wp-admin/edit.php3.65 ▲0.0139.45 ▲0.89
Add New Post /wp-admin/post-new.php6.90 ▼0.0896.78 ▼1,180.12
Media Library /wp-admin/upload.php3.30 ▼0.0024.87 ▼4.14

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Custom Fields: Table Field
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲4115.93 ▲0.235.97 ▼0.442.45 ▼0.21
Dashboard /wp-admin2,895 ▲406.15 ▲0.01115.89 ▼24.16156.36 ▼0.32
Posts /wp-admin/edit.php2,694 ▲63.24 ▼0.0062.52 ▼1.66140.03 ▼2.66
Add New Post /wp-admin/post-new.php1,698 ▲3722.62 ▲6.19405.35 ▼10.60156.35 ▲2.60
Media Library /wp-admin/upload.php1,698 ▼05.50 ▼0.06160.33 ▲21.33197.88 ▲7.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-table-field/acf-table.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-table-field/acf-table-v5.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-table-field/acf-table-v4.php:3

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

advanced-custom-fields-table-field/acf-table.php 85% from 13 tests

Analyzing the main PHP file in "Advanced Custom Fields: Table Field" version 1.3.14
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-custom-fields-table-field.php" instead of "acf-table.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin2,387 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript29381451,519
PHP3334500479
CSS14834255
PO File34885134

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity42.50
▷ Minimum class complexity40.00
▷ Maximum class complexity45.00
Average method complexity7.08
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.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