83% acf-db-field

Code Review | Advanced Custom Fields: DB Field

WordPress plugin Advanced Custom Fields: DB Field scored 83% from 54 tests.

About plugin

  • Plugin page: acf-db-field
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.9.4
  • WordPress version: 6.3.1
  • First release: Oct 18, 2018
  • Latest release: Nov 28, 2018
  • Number of updates: 10
  • Update frequency: every 4.2 days
  • Top authors: ktyrnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 916 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Advanced Custom Fields: DB Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.82 ▼4.41
Dashboard /wp-admin3.31 ▲0.0147.84 ▼4.57
Posts /wp-admin/edit.php3.36 ▲0.0149.11 ▲0.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.16 ▼12.95
Media Library /wp-admin/upload.php3.23 ▲0.0137.47 ▼0.51

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Advanced Custom Fields: DB Field: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.33 ▼1.051.64 ▼0.2140.84 ▼2.74
Dashboard /wp-admin2,206 ▲154.88 ▼1.02108.21 ▲8.2738.18 ▼5.41
Posts /wp-admin/edit.php2,089 ▼01.97 ▲0.0039.94 ▲3.4834.04 ▲1.77
Add New Post /wp-admin/post-new.php1,535 ▲2123.36 ▲5.70650.44 ▼23.1267.80 ▲18.16
Media Library /wp-admin/upload.php1,391 ▼04.27 ▲0.0894.71 ▼1.7441.96 ▼3.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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 everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-db-field/views/parts-item-list.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-db-field/views/parts-item-list.php on line 1
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/acf-db-field/views/parts-item-list.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'acf_db_common' not found in wp-content/plugins/acf-db-field/fields/acf-db.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-db-field/fields/acf-db-common.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/acf-db-field/views/parts-item-list.php on line 3
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/acf-db-field/views/parts-item-list.php on line 1
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/acf-db-field/views/parts-item-list.php on line 3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (DB Field Settings), #2 (Edit Post With DB Field)
Please take inspiration from this readme.txt

acf-db-field/acf-db.php 85% from 13 tests

The primary PHP file in "Advanced Custom Fields: DB Field" version 1.0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("acf-db-field.php" instead of "acf-db.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 plugin459 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4727273
JavaScript100163
Markdown17014
CSS1009

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity10.33
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
2 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png26.78KB14.00KB▼ 47.74%
screenshot-1.png40.92KB20.55KB▼ 49.76%