84% selfhost-google-fonts

Code Review | Self-Hosted Google Fonts

WordPress plugin Self-Hosted Google Fonts scored84%from 54 tests.

About plugin

  • Plugin page: selfhost-google-f...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.6
  • WordPress version: 6.3.1
  • First release: May 26, 2018
  • Latest release: Jun 15, 2018
  • Number of updates: 9
  • Update frequency: every 2.2 days
  • Top authors: asadkn (100%)

Code review

54 tests

User reviews

40 reviews

Install metrics

40,000+ active /126,472 total downloads

Benchmarks

Plugin footprint 83% 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.60MB] [CPU: ▼0.26ms] Passed 4 tests

A check of server-side resources used by Self-Hosted Google Fonts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1139.62 ▲0.21
Dashboard /wp-admin4.10 ▲0.7752.75 ▼0.34
Posts /wp-admin/edit.php4.19 ▲0.8056.36 ▲6.78
Add New Post /wp-admin/post-new.php6.69 ▲0.7790.38 ▼7.70
Media Library /wp-admin/upload.php4.03 ▲0.7689.14 ▲53.97
Delete Cache /wp-admin/admin.php?page=sgf-delete-cache3.9363.76
Self-Hosted Google Fonts /wp-admin/options-general.php?page=sgf_options4.3472.79

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: no files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Self-Hosted Google Fonts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲10713.33 ▼1.221.93 ▲0.1242.40 ▲1.17
Dashboard /wp-admin2,231 ▲405.90 ▲0.0094.06 ▼7.2241.87 ▼2.11
Posts /wp-admin/edit.php2,117 ▲252.07 ▲0.0741.51 ▲3.7734.80 ▲2.59
Add New Post /wp-admin/post-new.php1,537 ▲1823.24 ▼0.18669.37 ▲8.7960.99 ▲8.45
Media Library /wp-admin/upload.php1,404 ▲134.30 ▲0.11378.94 ▲283.27189.80 ▲144.79
Delete Cache /wp-admin/admin.php?page=sgf-delete-cache6741.1413.6745.58
Self-Hosted Google Fonts /wp-admin/options-general.php?page=sgf_options9891.8860.0061.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 40× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/includes/helper-functions.php:127
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/init.php:127
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/selfhost-google-fonts/vendor/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: typography, gdpr, google fonts, dsgvo

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

"Self-Hosted Google Fonts" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
There were no executable files found in this plugin55,061 lines of code in 239 files:
LanguageFilesBlank linesComment linesLines of code
PO File12013,78717,86831,576
PHP722,4616,5609,358
JSON5005,955
CSS131,1651,1444,650
JavaScript93744701,527
Sass16300251,374
Markdown42170621

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.47
Average class complexity18.36
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes77
▷ Abstract classes810.39%
▷ Concrete classes6989.61%
▷ Final classes00.00%
Methods597
▷ Static methods9115.24%
▷ Public methods50484.42%
▷ Protected methods8914.91%
▷ Private methods40.67%
Functions49
▷ Named functions3775.51%
▷ Anonymous functions1224.49%
Constants14
▷ Global constants428.57%
▷ Class constants1071.43%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
vendor/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
vendor/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%