66% wp-google-fonts

Code Review | WP Google Fonts

WordPress plugin WP Google Fonts scored66%from 54 tests.

About plugin

  • Plugin page: wp-google-fonts
  • Plugin version: 3.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-5.8.1
  • WordPress version: 6.3.1
  • First release: May 24, 2010
  • Latest release: Aug 1, 2022
  • Number of updates: 53
  • Update frequency: every 84.0 days
  • Top authors: adrian3 (60.38%)grimmdude (26.42%)noahkagan (11.32%)marnietave (7.55%)

Code review

54 tests

User reviews

38 reviews

Install metrics

60,000+ active /1,356,956 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▼2.88ms] Passed 4 tests

A check of server-side resources used by WP Google Fonts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2041.22 ▲1.50
Dashboard /wp-admin3.50 ▲0.1653.41 ▼6.75
Posts /wp-admin/edit.php3.62 ▲0.2648.52 ▼0.18
Add New Post /wp-admin/post-new.php6.10 ▲0.2288.09 ▼6.10
Media Library /wp-admin/upload.php3.42 ▲0.2036.55 ▲2.57
AppSumo /wp-admin/admin.php?page=gf_go_appsumo_pro3.2227.18
Other Tools /wp-admin/admin.php?page=gf-plugin-other-tools3.3932.15
Google Fonts /wp-admin/admin.php?page=google-fonts3.3732.38

Server storage [IO: ▲0.69MB] [DB: ▲1.49MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_recent-posts
googlefonts_data
theysaidso_admin_options
googlefonts_options
widget_theysaidso_widget
wp_google_fonts_global_notification
db_upgraded
can_compress_scripts

Browser metrics 75% from 4 tests

Checking browser requirements for WP Google Fonts
Please improve the following
  • Nodes: For the best user experience, please reduce the number of DOM nodes under 25,000 (currently 48,842 on /wp-admin/admin.php?page=google-fonts)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8114.26 ▼0.361.69 ▲0.0133.30 ▼5.77
Dashboard /wp-admin2,236 ▲565.60 ▼0.0583.97 ▼2.7446.23 ▲4.23
Posts /wp-admin/edit.php2,138 ▲382.03 ▲0.0932.25 ▼3.3536.20 ▲3.54
Add New Post /wp-admin/post-new.php1,557 ▲3123.33 ▼0.06669.63 ▼10.8051.58 ▼4.28
Media Library /wp-admin/upload.php1,438 ▲414.19 ▼0.0293.36 ▼7.3347.67 ▲1.71
AppSumo /wp-admin/admin.php?page=gf_go_appsumo_pro2,25615.16627.90168.08
Other Tools /wp-admin/admin.php?page=gf-plugin-other-tools1,0152.0424.0046.10
Google Fonts /wp-admin/admin.php?page=google-fonts48,8421.4745.3055.35

Uninstaller [IO: ▲0.00MB] [DB: ▲1.49MB] 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
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • googlefonts_options
    • widget_recent-comments
    • db_upgraded
    • googlefonts_data
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gf_go_appsumo_pro
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD
    • > GET request to /wp-admin/admin.php?page=gf-plugin-other-tools
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=gf-plugin-other-tools
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=google-fonts
    • > Notice in wp-content/plugins/wp-google-fonts/google-fonts.php+1101
    Undefined index: wp_google_fonts_global_notification

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-google-fonts/appsumo-capture-form.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/wp-google-fonts/appsumo.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/wp-google-fonts/other_tools.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/wp-google-fonts/other_plugins.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-google-fonts/google-fonts.php:28

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=gf_go_appsumo_pro
    • > Network (severe)
    https://appsumo.com/tools/wordpress/?utm_source=sumo&utm_medium=wp-widget&utm_campaign=wp-google-fonts - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=gf_go_appsumo_pro
    • > Javascript (severe) in unknown
    https://appsumo2-cdn.appsumo.com/static/dist/js/vue_bridge.61ea1a9c.js 6:75186 Uncaught TypeError: (void 0) is not a function
    • > GET request to /wp-admin/admin.php?page=gf_go_appsumo_pro
    • > Console-api (warning) in unknown
    https://accounts.google.com/gsi/client 41:457 "[GSI_LOGGER]: Relative login_uri was provided. Use absolute url instead. Relative login_uri may be considered invalid in the future."

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (This screenshot shows the "settings" panel for the WP Google Fonts plugin.) image not found
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

wp-google-fonts/google-fonts.php 92% from 13 tests

Analyzing the main PHP file in "WP Google Fonts" version 3.1.5
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-google-fonts.php" instead of "google-fonts.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 detected9,555 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP62281618,360
PO File5200504471
SVG402403
CSS2342314
JavaScript1007

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity171.00
▷ Minimum class complexity171.00
▷ Maximum class complexity171.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods40
▷ Static methods00.00%
▷ Public methods40100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
6 PNG files occupy 0.16MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/products/recent-tweets-widget-logo.png34.12KB25.86KB▼ 24.22%
images/products/sumo-logo.png6.58KB3.19KB▼ 51.51%
images/products/appsumo-logo.png5.92KB6.11KB0.00%
images/products/social-media-widget-logo.png75.72KB28.07KB▼ 62.93%
images/products/google-analyticator-logo.png12.53KB2.97KB▼ 76.27%