84% acf-google-font-selector-field

Code Review | ACF: Google Font Selector

WordPress plugin ACF: Google Font Selector scored84%from 54 tests.

About plugin

  • Plugin page: acf-google-font-s...
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2
  • WordPress version: 6.3.1
  • First release: Feb 4, 2014
  • Latest release: Apr 28, 2015
  • Number of updates: 20
  • Update frequency: every 22.4 days
  • Top authors: danielpataki (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

4,000+ active /16,794 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.09ms] Passed 4 tests

An overview of server-side resources used by ACF: Google Font Selector
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0549.14 ▲7.91
Dashboard /wp-admin3.36 ▲0.0647.02 ▼2.25
Posts /wp-admin/edit.php3.41 ▲0.0654.36 ▲3.26
Add New Post /wp-admin/post-new.php5.94 ▲0.0693.55 ▼14.94
Media Library /wp-admin/upload.php3.28 ▲0.0635.36 ▲1.57
Google Font Selector /wp-admin/options-general.php?page=acfgfs-settings3.2531.38

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for ACF: Google Font Selector
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5813.31 ▼1.094.56 ▲2.3244.11 ▼2.01
Dashboard /wp-admin2,218 ▲305.83 ▲0.9698.20 ▼2.4038.64 ▼4.53
Posts /wp-admin/edit.php2,101 ▲121.99 ▼0.0339.60 ▼0.5636.09 ▼0.60
Add New Post /wp-admin/post-new.php1,542 ▲923.32 ▲0.17576.68 ▼68.4350.80 ▲4.12
Media Library /wp-admin/upload.php1,406 ▲184.20 ▲0.0496.15 ▲1.3443.79 ▼0.04
Google Font Selector /wp-admin/options-general.php?page=acfgfs-settings7942.0338.5325.18

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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 everything seems fine, this is not 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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-google-font-selector-field/acf-google_font_selector-v4.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-google-font-selector-field/acf-google_font_selector-v5.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-google-font-selector-field/acf-google_font_selector.php:18

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: google, acf, fonts

acf-google-font-selector-field/acf-google_font_selector.php 92% from 13 tests

Analyzing the main PHP file in "ACF: Google Font Selector" version 3.0.1
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("acf-google-font-selector-field.php" instead of "acf-google_font_selector.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected686 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5163410471
PO File22844100
JavaScript1312873
CSS18042

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.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
PNG images were not found in this plugin