78% fonto

Code Review | Fonto - Custom Web Fonts Manager

WordPress plugin Fonto - Custom Web Fonts Manager scored 78% from 54 tests.

About plugin

  • Plugin page: fonto
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.9-5.9.2
  • WordPress version: 6.3.1
  • First release: Jun 19, 2016
  • Latest release: Mar 30, 2022
  • Number of updates: 25
  • Update frequency: every 84.5 days
  • Top authors: vlad.olaru (56%)babbardel (32%)pixelgrade (20%)

Code review

54 tests

User reviews

4 reviews

Install metrics

3,000+ active / 25,063 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 gracefully, with no errors

Server metrics [RAM: ▲1.00MB] [CPU: ▲7.78ms] Passed 4 tests

This is a short check of server-side resources used by Fonto - Custom Web Fonts Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6942.40 ▲0.49
Dashboard /wp-admin4.45 ▲1.1459.60 ▲8.81
Posts /wp-admin/edit.php4.46 ▲1.1158.20 ▲11.00
Add New Post /wp-admin/post-new.php7.10 ▲1.21124.85 ▲30.04
Media Library /wp-admin/upload.php4.28 ▲1.0544.59 ▲10.80
Add New /wp-admin/post-new.php?post_type=font4.9363.79
All Fonts /wp-admin/edit.php?post_type=font4.4154.40

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 368 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
fonto_version
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Fonto - Custom Web Fonts Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,000 ▲26515.02 ▲0.831.84 ▲0.0837.84 ▼5.62
Dashboard /wp-admin2,403 ▲2186.48 ▲1.61121.17 ▲18.8942.53 ▲0.40
Posts /wp-admin/edit.php2,306 ▲2143.50 ▲1.5246.40 ▲8.9030.49 ▼3.52
Add New Post /wp-admin/post-new.php1,569 ▲3823.32 ▲5.19596.81 ▼31.6632.35 ▼59.55
Media Library /wp-admin/upload.php1,439 ▲484.27 ▲0.0992.03 ▼10.9340.43 ▼2.57
Add New /wp-admin/post-new.php?post_type=font2,6926.48151.44179.39
All Fonts /wp-admin/edit.php?post_type=font1,2733.4754.7330.04

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • fonto_version
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% 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 | 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
  • 40× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Select' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/types/CMB2_Type_Taxonomy_Select_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/CMB2_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/CMB2.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/fonto/includes/vendor/CMB2/includes/types/CMB2_Type_File.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=font
    • > Deprecation (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can look at the official readme.txt

fonto/fonto.php 92% from 13 tests

The main PHP file in "Fonto - Custom Web Fonts Manager" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 169 characters long)

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
Success! There were no dangerous files found in this plugin49,821 lines of code in 217 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP702,6117,5488,722
CSS51,526686,170
JavaScript144246551,686
Markdown42600801
JSON10054
SVG20244
YAML16021

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity19.21
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes76
▷ Abstract classes911.84%
▷ Concrete classes6788.16%
▷ Final classes00.00%
Methods617
▷ Static methods9515.40%
▷ Public methods52284.60%
▷ Protected methods9114.75%
▷ Private methods40.65%
Functions45
▷ Named functions4395.56%
▷ Anonymous functions24.44%
Constants11
▷ Global constants327.27%
▷ Class constants872.73%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/CMB2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
includes/vendor/CMB2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
includes/vendor/CMB2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
includes/vendor/CMB2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
includes/vendor/CMB2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%