79% tk-google-fonts

Code Review | TK Google Fonts GDPR Compliant

WordPress plugin TK Google Fonts GDPR Compliant scored79%from 54 tests.

About plugin

  • Plugin page: tk-google-fonts
  • Plugin version: 2.2.13
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3.2
  • WordPress version: 6.3.1
  • First release: Mar 14, 2016
  • Latest release: Nov 6, 2023
  • Number of updates: 80
  • Update frequency: every 35.0 days
  • Top authors: svenl77 (98.75%)romelir (2.5%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active /79,032 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲4.68MB] [CPU: ▲25.28ms] 75% from 4 tests

An overview of server-side resources used by TK Google Fonts GDPR Compliant
It is recommended to improve the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,725.41ms on /wp-admin/themes.php?page=tk-google-fonts-options)
PageMemory (MB)CPU Time (ms)
Home /8.34 ▲4.8870.64 ▲25.95
Dashboard /wp-admin8.36 ▲5.0676.35 ▲26.79
Posts /wp-admin/edit.php8.36 ▲5.0177.76 ▲30.63
Add New Post /wp-admin/post-new.php9.68 ▲3.79112.43 ▲17.76
Media Library /wp-admin/upload.php8.36 ▲5.1375.48 ▲40.96
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.3656.61
TK Google Fonts /wp-admin/themes.php?page=tk-google-fonts-options8.371,725.41
Go Pro /wp-admin/themes.php?page=tk-google-fonts-optionss8.3756.11

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 205 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
db_upgraded
fs_debug_mode
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
fs_active_plugins
widget_recent-comments
fs_accounts

Browser metrics Passed 4 tests

A check of browser resources used by TK Google Fonts GDPR Compliant
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8614.43 ▲0.131.75 ▲0.1244.83 ▲3.44
Dashboard /wp-admin2,255 ▲775.00 ▼0.69103.30 ▼6.9843.09 ▲2.89
Posts /wp-admin/edit.php2,159 ▲562.40 ▲0.4638.89 ▼0.9642.75 ▲5.40
Add New Post /wp-admin/post-new.php1,598 ▲7124.53 ▲1.39633.89 ▼49.3431.02 ▼36.22
Media Library /wp-admin/upload.php1,449 ▲524.57 ▲0.37114.08 ▲5.4248.93 ▲2.60
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1562.1229.6531.00
TK Google Fonts /wp-admin/themes.php?page=tk-google-fonts-options1,0432.0730.5065.88
Go Pro /wp-admin/themes.php?page=tk-google-fonts-optionss1,1412.0328.8660.58

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/tk-google-fonts/includes/resources/freemius/includes/class-freemius.php+127
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • fs_active_plugins
    • theysaidso_admin_options
    • fs_accounts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • fs_debug_mode
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: fonts, webfonts, google fonts

tk-google-fonts/tk-google-fonts.php Passed 13 tests

Analyzing the main PHP file in "TK Google Fonts GDPR Compliant" version 2.2.13
36 characters long description:
Google Fonts UI for WordPress Themes

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected10,268 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
PHP1231,4197478,295
JavaScript11119941,670
CSS16493294
JSON1009

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity84.07
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes53
▷ Abstract classes23.77%
▷ Concrete classes5196.23%
▷ Final classes00.00%
Methods1,280
▷ Static methods19915.55%
▷ Public methods88068.75%
▷ Protected methods171.33%
▷ Private methods38329.92%
Functions123
▷ Named functions123100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.93MB with 0.59MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/resources/font-select/images/fs-sprite.png1.07KB0.18KB▼ 82.82%
includes/admin/media/gdpr-thumbnail.png843.49KB268.90KB▼ 68.12%
includes/resources/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
includes/admin/media/choose-bundle.png67.96KB16.06KB▼ 76.36%
includes/resources/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%