78% google-font-fix

Code Review | Google Font Fix

WordPress plugin Google Font Fix scored78%from 54 tests.

About plugin

  • Plugin page: google-font-fix
  • Plugin version: 2.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.1
  • WordPress version: 6.3.1
  • First release: Nov 5, 2014
  • Latest release: Apr 29, 2021
  • Number of updates: 57
  • Update frequency: every 41.5 days
  • Top authors: zjhzxhz (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

600+ active /21,894 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.29MB] [CPU: ▼7.37ms] Passed 4 tests

Server-side resources used by Google Font Fix
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2537.61 ▼2.96
Dashboard /wp-admin3.60 ▲0.2948.18 ▼4.66
Posts /wp-admin/edit.php3.69 ▲0.3353.15 ▲1.48
Add New Post /wp-admin/post-new.php6.27 ▲0.3878.12 ▼19.30
Media Library /wp-admin/upload.php3.53 ▲0.3035.35 ▼2.55
Google Font Fix /wp-admin/options-general.php?page=google-font-fix3.4330.16

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Google Font Fix
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.32 ▼1.201.66 ▲0.1041.07 ▼5.24
Dashboard /wp-admin2,210 ▲224.88 ▼0.93109.54 ▲5.1040.26 ▼3.51
Posts /wp-admin/edit.php2,096 ▲71.97 ▼0.0838.60 ▲3.3933.80 ▼0.86
Add New Post /wp-admin/post-new.php1,546 ▲1318.55 ▼4.53618.49 ▼70.8752.65 ▼7.30
Media Library /wp-admin/upload.php1,386 ▼24.18 ▼0.0298.18 ▼5.9342.02 ▼4.79
Google Font Fix /wp-admin/options-general.php?page=google-font-fix8512.0428.0629.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=google-font-fix
    • > Notice in wp-content/plugins/google-font-fix/google-font-fix-options.php+43
    Undefined index: google-service
    • > GET request to /wp-admin/options-general.php?page=google-font-fix
    • > Notice in wp-content/plugins/google-font-fix/google-font-fix-options.php+44
    Undefined index: gravatar-service

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
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-font-fix/google-font-fix-options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/google-font-fix/google-font-fix.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === google-font-fix === )
You can take inspiration from this readme.txt

google-font-fix/google-font-fix.php Passed 13 tests

The main file in "Google Font Fix" v. 2.3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
56 characters long description:
Replace Google and Gravatar resources for Chinese users.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,994 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP360451,940
PO File1101037
Markdown112017

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions37
▷ Named functions3594.59%
▷ Anonymous functions25.41%
Constants49
▷ Global constants49100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.27MB with 0.19MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot.png272.41KB78.91KB▼ 71.03%