94% advanced-forms

Code Review | Advanced Forms for ACF

WordPress plugin Advanced Forms for ACF scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-forms
  • Plugin version: 1.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.9
  • WordPress version: 5.9.2
  • First release: Nov 13, 2016
  • Latest release: Jan 5, 2022
  • Number of updates: 62
  • Update frequency: every 30.2 days
  • Top authors: fabianlindfors (100%)

Code review

54 tests

User reviews

39 reviews

Install metrics

3,000+ active / 61,526 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

Server-side resources used by Advanced Forms for ACF
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0854.55 ▲4.61
Dashboard /wp-admin3.45 ▲0.0534.68 ▲2.80
Posts /wp-admin/edit.php3.69 ▲0.0538.32 ▲0.90
Add New Post /wp-admin/post-new.php6.92 ▼0.0496.50 ▼1,173.47
Media Library /wp-admin/upload.php3.34 ▲0.0525.37 ▼0.26

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 57 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Forms for ACF
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,777 ▲5516.23 ▲1.085.82 ▼1.102.33 ▼0.48
Dashboard /wp-admin2,909 ▲486.15 ▼0.10117.24 ▼18.70156.76 ▼6.06
Posts /wp-admin/edit.php2,703 ▲123.38 ▲0.1465.85 ▼2.62144.86 ▼1.72
Add New Post /wp-admin/post-new.php1,718 ▼6321.36 ▲2.41449.78 ▼34.94158.81 ▼3.28
Media Library /wp-admin/upload.php1,709 ▲115.51 ▲0.02158.13 ▲19.22188.78 ▼2.47

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script 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
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
Please take a closer look at the following
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-forms/acf/fields/page.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/advanced-forms/core/core-restrictions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-forms/admin/admin-emails.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/advanced-forms/core/forms/forms-rendering.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-forms/core/forms/forms-submissions.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-forms/admin/forms/forms-preview.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-forms/acf/fields/field_select.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-forms/acf/fields/divider.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-forms/admin/admin-forms.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-forms/core/core-gutenberg.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: advanced custom fields, form builder, acf, contact form, acf form...

advanced-forms/advanced-forms.php Passed 13 tests

Analyzing the main PHP file in "Advanced Forms for ACF" version 1.9.1
79 characters long description:
Flexible and developer-friendly forms with the power of Advanced Custom Fields.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin12,488 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
JSON2007,552
PHP251,3731,2273,427
PO File3248250594
JavaScript513789470
CSS410764418
Markdown19027

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity13.10
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods142
▷ Static methods00.00%
▷ Public methods13595.07%
▷ Protected methods00.00%
▷ Private methods74.93%
Functions40
▷ Named functions3895.00%
▷ Anonymous functions25.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.81MB with 0.66MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-3.png66.40KB18.85KB▼ 71.62%
assets/images/icon-128x128.png20.56KB1.02KB▼ 95.02%
assets/images/banner-772x250.png41.63KB9.44KB▼ 77.33%
assets/images/logo-40.png20.02KB0.92KB▼ 95.38%
assets/images/banner-1544x500.png68.03KB20.10KB▼ 70.46%