83% wrap-google-fonts

Code Review | Google-Fonts-Wrapper

WordPress plugin Google-Fonts-Wrapper scored83%from 54 tests.

About plugin

  • Plugin page: wrap-google-fonts
  • Plugin version: 0.4.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.0
  • WordPress version: 6.3.1
  • First release: Jun 19, 2018
  • Latest release: Jun 1, 2022
  • Number of updates: 22
  • Update frequency: every 65.8 days
  • Top authors: Lugat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,695 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.38ms] Passed 4 tests

An overview of server-side resources used by Google-Fonts-Wrapper
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.89 ▲3.41
Dashboard /wp-admin3.31 ▲0.0147.57 ▲3.21
Posts /wp-admin/edit.php3.36 ▲0.0144.03 ▼4.92
Add New Post /wp-admin/post-new.php5.89 ▲0.0178.43 ▼18.15
Media Library /wp-admin/upload.php3.24 ▲0.0136.42 ▲2.36

Server storage [IO: ▲0.01MB] [DB: ▲0.07MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • Illegal file modification found: 2 files (0.00KB) outside of "wp-content/plugins/wrap-google-fonts/" and "wp-content/uploads/"
    • (new file) wp-content/fonts/.empty
    • (new file) wp-content/cache/.empty
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Google-Fonts-Wrapper
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.56 ▼1.051.73 ▲0.1046.16 ▲5.33
Dashboard /wp-admin2,214 ▲225.79 ▲0.85104.57 ▼4.1142.13 ▼3.42
Posts /wp-admin/edit.php2,097 ▲82.06 ▲0.0237.03 ▲2.3133.40 ▼4.94
Add New Post /wp-admin/post-new.php1,518 ▼117.50 ▼5.51697.12 ▲49.2953.03 ▼2.45
Media Library /wp-admin/upload.php1,396 ▲84.22 ▼0.01101.96 ▲6.4344.00 ▼0.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wrap-google-fonts/index.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: googlefonts, dsgvo, fonts, webfonts, privacy...

wrap-google-fonts/index.php 85% from 13 tests

The main PHP script in "Google-Fonts-Wrapper" version 0.4.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wrap-google-fonts.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected125 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP28979125

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes1100.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods11
▷ Static methods11100.00%
▷ Public methods654.55%
▷ Protected methods545.45%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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