74% sumedia-gfont

Code Review | Sumedia GFont

WordPress plugin Sumedia GFont scored 74% from 54 tests.

About plugin

  • Plugin page: sumedia-gfont
  • Plugin version: 0.3.3
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3 (nothing else tested yet)-5.4
  • WordPress version: 5.8.1
  • First release: Dec 18, 2019
  • Latest release: Dec 9, 2020
  • Number of updates: 7
  • Update frequency: every 51.4 days
  • Top authors: sumediawebdesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 252 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼140.17ms] Passed 4 tests

Server-side resources used by Sumedia GFont
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0334.99 ▲1.75
Dashboard /wp-admin3.11 ▲0.0648.47 ▼0.30
Posts /wp-admin/edit.php3.23 ▲0.1244.40 ▲2.31
Add New Post /wp-admin/post-new.php5.47 ▲0.0491.18 ▼564.12
Media Library /wp-admin/upload.php3.06 ▲0.0632.68 ▲1.99
GFont /wp-admin/plugins.php?page=sumedia-gfont3.0729.44

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 40 new files
Database: 1 new table, 1 new option
New tables
wp_sumedia_gfont_fonts
New WordPress options
sumedia_gfont_version

Browser metrics Passed 4 tests

Sumedia GFont: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,711 ▲11516.07 ▲0.1012.00 ▼0.3348.78 ▲2.34
Dashboard /wp-admin2,971 ▲405.90 ▼0.08141.73 ▼18.18131.14 ▲16.98
Posts /wp-admin/edit.php2,762 ▲232.70 ▼0.0168.38 ▼0.0488.20 ▼5.67
Add New Post /wp-admin/post-new.php1,506 ▼9818.50 ▼0.34381.69 ▼0.98111.33 ▼2.98
Media Library /wp-admin/upload.php1,830 ▲85.02 ▲0.00140.47 ▲6.19136.15 ▲19.87
GFont /wp-admin/plugins.php?page=sumedia-gfont1,2842.0958.9779.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_sumedia_gfont_fonts
  • This plugin does not fully uninstall, leaving 1 option in the database
    • sumedia_gfont_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Sumedia\\GFont\\Base\\View' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Admin/View/NewFont.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Sumedia\\GFont\\Base\\Form' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Admin/Form/NewFont.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Sumedia\\GFont\\Base\\Repository' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Repository/Fonts.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Sumedia\\GFont\\Base\\View' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Admin/View/Fontlist.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Sumedia\\GFont\\Base\\View' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Admin/View/Overview.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Sumedia\\GFont\\Base\\View' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Admin/View/Menu.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Sumedia\\GFont\\Base\\View' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Admin/View/Heading.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Sumedia\\GFont\\Base\\Controller' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Admin/Controller/Delete.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Sumedia\\GFont\\Base\\Controller' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Admin/Controller/NewFont.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/sumedia-gfont/src/Sumedia/GFont/Admin/Table/Fontlist.php:5

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

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: data privacy, fonts, google

sumedia-gfont/sumedia-gfont.php 92% from 13 tests

"Sumedia GFont" version 0.3.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "5.3 (nothing else tested yet)")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,493 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP292623621,184
CSS1280140
PO File15379136
Markdown19020
JSON10013

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity5.86
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes22
▷ Abstract classes313.64%
▷ Concrete classes1986.36%
▷ Final classes15.26%
Methods106
▷ Static methods65.66%
▷ Public methods9589.62%
▷ Protected methods1110.38%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants9
▷ Global constants444.44%
▷ Class constants555.56%
▷ Public constants5100.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
3 PNG files occupy 0.15MB with 0.09MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/font-screen.png34.80KB13.71KB▼ 60.61%
assets/images/wp-n-suma.png55.99KB19.83KB▼ 64.59%
assets/images/css-class-howto.png58.44KB22.94KB▼ 60.74%