78% google-webfont-optimizer

Code Review | Google Webfont Optimizer

WordPress plugin Google Webfont Optimizer scored78%from 54 tests.

About plugin

  • Plugin page: google-webfont-op...
  • Plugin version: 0.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2
  • WordPress version: 6.3.1
  • First release: Nov 13, 2014
  • Latest release: Jun 22, 2015
  • Number of updates: 6
  • Update frequency: every 36.8 days
  • Top authors: sigurdurg (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /35,376 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.27MB] [CPU: ▼17.59ms] Passed 4 tests

An overview of server-side resources used by Google Webfont Optimizer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.92 ▼0.5518.40 ▼19.14
Dashboard /wp-admin3.23 ▼0.0840.46 ▼10.07
Posts /wp-admin/edit.php3.29 ▼0.0636.62 ▼10.75
Add New Post /wp-admin/post-new.php5.48 ▼0.4168.33 ▼30.40
Media Library /wp-admin/upload.php3.23 ▲0.0028.01 ▼7.22
GWF Optimizer /wp-admin/options-general.php?page=gwf-optimizer3.2028.21

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
google_webfont_optimizer_options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Google Webfont Optimizer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.38 ▼0.151.74 ▲0.0244.39 ▲5.05
Dashboard /wp-admin2,199 ▲195.61 ▲0.0285.02 ▼6.1038.00 ▼5.14
Posts /wp-admin/edit.php2,104 ▲12.03 ▲0.0334.75 ▼10.3333.21 ▼3.33
Add New Post /wp-admin/post-new.php1,539 ▲1322.77 ▼0.31574.11 ▼84.6758.35 ▲4.83
Media Library /wp-admin/upload.php1,407 ▲74.28 ▲0.0796.41 ▼15.1242.33 ▼4.66
GWF Optimizer /wp-admin/options-general.php?page=gwf-optimizer8002.0424.4328.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=gwf-optimizer
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
    • > GET request to /wp-admin/options-general.php?page=gwf-optimizer
    • > 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/options-general.php?page=gwf-optimizer
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/google-webfont-optimizer/scb/Widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-webfont-optimizer/google-webfont-optimizer.php:377
    • > PHP Fatal error
      Uncaught Error: Class 'scbAdminPage' not found in wp-content/plugins/google-webfont-optimizer/scb/BoxesPage.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'scbAdminPage' not found in wp-content/plugins/google-webfont-optimizer/adminpage.php:3

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (15 tag instead of maximum 10)
You can take inspiration from this readme.txt

google-webfont-optimizer/google-webfont-optimizer.php Passed 13 tests

The principal PHP file in "Google Webfont Optimizer" v. 0.2.4 is loaded by WordPress automatically on each request
104 characters long description:
This plugin optimizes the way Google Fonts loads on your webpage, increasing your website's performance.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,742 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP146258781,720
JSON10022

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity11.48
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes22
▷ Abstract classes522.73%
▷ Concrete classes1777.27%
▷ Final classes00.00%
Methods181
▷ Static methods5832.04%
▷ Public methods14379.01%
▷ Protected methods2714.92%
▷ Private methods116.08%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin