88% advanced-custom-fields-font-awesome

Code Review | Advanced Custom Fields: Font Awesome Field

WordPress plugin Advanced Custom Fields: Font Awesome Field scored 88% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 4.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.9
  • WordPress version: 5.9.2
  • First release: Feb 18, 2014
  • Latest release: Feb 10, 2022
  • Number of updates: 92
  • Update frequency: every 31.7 days
  • Top authors: mattkeys (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

100,000+ active / 619,434 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by Advanced Custom Fields: Font Awesome Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0453.42 ▼0.49
Dashboard /wp-admin3.44 ▲0.0333.26 ▼0.29
Posts /wp-admin/edit.php3.68 ▲0.0341.37 ▲1.95
Add New Post /wp-admin/post-new.php6.92 ▼0.0596.41 ▼1,219.86
Media Library /wp-admin/upload.php3.33 ▲0.0224.84 ▼8.83

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Custom Fields: Font Awesome Field
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲3116.03 ▲0.367.43 ▲0.082.33 ▼0.88
Dashboard /wp-admin2,888 ▲276.13 ▼0.08120.81 ▼16.86156.25 ▼8.06
Posts /wp-admin/edit.php2,685 ▼33.23 ▼0.0165.44 ▼0.01139.97 ▼3.22
Add New Post /wp-admin/post-new.php1,711 ▼020.99 ▲0.11450.57 ▲13.43159.37 ▲1.63
Media Library /wp-admin/upload.php1,698 ▼05.46 ▼0.07143.95 ▼2.29184.33 ▼5.16

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 50% 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 0% 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
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/advanced-custom-fields-font-awesome/assets/js/templates/tmpl-fa-kit.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-font-awesome/admin/class-ACFFA-Admin.php:957

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes: Please take inspiration from this readme.txt

advanced-custom-fields-font-awesome/acf-font-awesome.php 92% from 13 tests

Analyzing the main PHP file in "Advanced Custom Fields: Font Awesome Field" version 4.0.1
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-custom-fields-font-awesome.php" instead of "acf-font-awesome.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin5,091 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP106853263,351
JavaScript6222401,167
CSS42911307
Markdown3770266

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity92.25
▷ Minimum class complexity39.00
▷ Maximum class complexity257.00
Average method complexity6.14
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods142
▷ Static methods107.04%
▷ Public methods7854.93%
▷ Protected methods00.00%
▷ Private methods6445.07%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/inc/multi-select/switch.png0.53KB0.64KB0.00%