83% acf-typography-field

Code Review | Advanced Custom Fields: Typography Field

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

About plugin

  • Plugin page: acf-typography-field
  • Plugin version: 3.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.0
  • WordPress version: 6.3.1
  • First release: Oct 17, 2016
  • Latest release: Jul 1, 2022
  • Number of updates: 28
  • Update frequency: every 74.3 days
  • Top authors: mujahid158 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

6,000+ active / 28,425 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Server-side resources used by Advanced Custom Fields: Typography Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.43 ▼0.0423.12 ▼16.13
Dashboard /wp-admin3.35 ▲0.0540.48 ▼4.41
Posts /wp-admin/edit.php3.40 ▲0.0444.77 ▼0.82
Add New Post /wp-admin/post-new.php5.93 ▲0.0490.26 ▼4.99
Media Library /wp-admin/upload.php3.28 ▲0.0432.03 ▲2.71
ACF Typography Settings /wp-admin/options-general.php?page=acf-typography-field3.2429.77

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Custom Fields: Typography Field
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,469 ▼27714.72 ▲0.340.47 ▼1.2318.12 ▼20.79
Dashboard /wp-admin2,207 ▲194.87 ▼0.05115.58 ▼3.2147.72 ▼1.18
Posts /wp-admin/edit.php2,090 ▼21.97 ▼0.0239.06 ▼2.5134.57 ▼5.07
Add New Post /wp-admin/post-new.php1,536 ▲222.98 ▼0.18611.28 ▼23.6159.58 ▲4.70
Media Library /wp-admin/upload.php1,392 ▲74.28 ▼0.01104.74 ▲2.5545.04 ▲0.40
ACF Typography Settings /wp-admin/options-general.php?page=acf-typography-field7712.0324.7726.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-typography-field/includes/admin_settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-typography-field/includes/functions.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/acf-typography-field/includes/api-template.php:143

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Typography Field Settings), #2 (Typography Field Content Editing), #3 (Google Key Field required for Google Fonts)
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

acf-typography-field/acf-typography.php 92% from 13 tests

This is the main PHP file of "Advanced Custom Fields: Typography Field" version 3.2.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("acf-typography-field.php" instead of "acf-typography.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,221 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP64066301,089
Markdown226087
JavaScript125045

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity23.33
▷ Minimum class complexity2.00
▷ Maximum class complexity35.00
Average method complexity3.68
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.12MB with 0.08MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png9.69KB3.79KB▼ 60.88%
screenshot-1.png82.35KB33.68KB▼ 59.10%
screenshot-2.png33.13KB9.63KB▼ 70.94%