84% advanced-custom-fields-widget

Code Review | Advanced Custom Fields: Widget

WordPress plugin Advanced Custom Fields: Widget scored 84% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.3.1
  • WordPress version: 5.9.2
  • First release: Aug 2, 2014
  • Latest release: May 10, 2016
  • Number of updates: 14
  • Update frequency: every 46.3 days
  • Top authors: alexvandervegt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 6,903 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼290.97ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Custom Fields: Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1251.51 ▲1.49
Dashboard /wp-admin3.46 ▲0.0633.58 ▲0.66
Posts /wp-admin/edit.php3.69 ▲0.0539.63 ▲1.91
Add New Post /wp-admin/post-new.php6.95 ▼0.0594.59 ▼1,165.14
Media Library /wp-admin/upload.php3.34 ▲0.0423.21 ▼0.88

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 1 new option
New WordPress options
widget_acf_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom Fields: Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲3115.89 ▲0.116.09 ▲0.142.43 ▼0.19
Dashboard /wp-admin2,895 ▲416.15 ▲0.01116.60 ▼19.25153.98 ▼5.17
Posts /wp-admin/edit.php2,691 ▼33.23 ▼0.0165.60 ▲1.79146.76 ▲1.91
Add New Post /wp-admin/post-new.php1,661 ▼5016.84 ▼4.47410.29 ▼28.59163.51 ▲12.12
Media Library /wp-admin/upload.php1,695 ▼35.55 ▲0.01135.17 ▼13.96183.33 ▼10.94

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_acf_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-custom-fields-widget/includes/class-acf-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-custom-fields-widget/includes/class-acf-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/advanced-custom-fields-widget/partials/acf-widget-html.php:1

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 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: advanced custom fields, widget, widgets, acf

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

The main PHP file in "Advanced Custom Fields: Widget" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-custom-fields-widget.php" instead of "acf-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin269 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP516944264
JavaScript1405

PHP code Passed 2 tests

A short review of 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.27
Average class complexity7.67
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
4 PNG files occupy 0.16MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png48.42KB15.27KB▼ 68.47%
screenshot-3.png38.01KB12.16KB▼ 68.00%
screenshot-2.png32.78KB10.25KB▼ 68.72%
screenshot-4.png48.26KB14.56KB▼ 69.83%