10% fontsy

Code Review | Fontsy

WordPress plugin Fontsy scored 10% from 54 tests.

About plugin

  • Plugin page: fontsy
  • Plugin version: 1.8.6
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5
  • WordPress version: 5.9.2
  • First release: Apr 15, 2020
  • Latest release: May 7, 2021
  • Number of updates: 30
  • Update frequency: every 12.9 days
  • Top authors: fontbundles (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 2,177 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/fontsy/classes/class-premium-fontSettings.php+653
    Trying to get property 'data' of non-object

Server metrics [RAM: ▼1.09MB] [CPU: ▲236.55ms] 75% from 4 tests

This is a short check of server-side resources used by Fontsy
Please have a look at the following items
  • Extra CPU: Try to keep extra CPU usage under 200.00ms (currently 236.55ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.29 ▼0.23517.73 ▲467.59
Dashboard /wp-admin3.30 ▼0.11672.07 ▲635.42
Posts /wp-admin/edit.php3.30 ▼0.34597.78 ▲560.52
Add New Post /wp-admin/post-new.php3.30 ▼3.67533.40 ▼717.34
Media Library /wp-admin/upload.php3.30 ▼0.00686.49 ▲656.43

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 228 new files
Database: 2 new tables, 1 new option
New tables
wp_fontsy_custom_fonts
wp_fontsy_html_tags
New WordPress options
fontsy_europe_countries

Browser metrics Passed 4 tests

This is an overview of browser requirements for Fontsy
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,820 ▲7615.88 ▲0.235.95 ▼0.152.96 ▲0.73
Dashboard /wp-admin2,914 ▲536.16 ▼0.12120.01 ▼16.47158.91 ▼0.25
Posts /wp-admin/edit.php2,710 ▲192.98 ▼0.2560.21 ▼3.99140.69 ▼5.96
Add New Post /wp-admin/post-new.php1,950 ▲28520.76 ▼0.22423.14 ▼22.39146.01 ▼7.31
Media Library /wp-admin/upload.php1,721 ▲265.44 ▼0.04146.99 ▲4.66175.04 ▼15.84

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/fontsy/classes/class-premium-fontSettings.php+653
    Trying to get property 'data' of non-object
  • The uninstall procedure has failed, leaving 1 option in the database
    • fontsy_europe_countries

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/fontsy/assets/stripe/build.php
    • > /wp-content/plugins/fontsy/assets/stripe/update_certs.php
    • > /wp-content/plugins/fontsy/assets/stripe/examples/oauth.php
    • > /wp-content/plugins/fontsy/assets/stripe/tests/bootstrap.no_autoload.php
    • > /wp-content/plugins/fontsy/assets/stripe/tests/bootstrap.php
  • 154× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/fontsy/assets/stripe/lib/Error/Authentication.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/fontsy/assets/stripe/lib/PaymentIntent.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/fontsy/assets/stripe/tests/Stripe/HttpClient/CurlClientTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/fontsy/assets/stripe/tests/Stripe/Issuing/CardTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/fontsy/assets/stripe/lib/File.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/fontsy/assets/stripe/tests/Stripe/RefundTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/fontsy/assets/stripe/lib/UsageRecord.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/fontsy/assets/stripe/tests/Stripe/StripeTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/fontsy/assets/stripe/tests/Stripe/FileTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/fontsy/assets/stripe/tests/Stripe/FileUploadCreationTest.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: fonts, fontsy, font install, font management

fontsy/fontsy.php 92% from 13 tests

The main PHP script in "Fontsy" version 1.8.6 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 154 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please make sure to remedy the following
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/fontsy/assets/stripe/data/ca-certificates.crt
15,116 lines of code in 211 files:
LanguageFilesBlank linesComment linesLines of code
PHP1871,7793,16810,358
CSS4210322,370
JavaScript113873311,682
Markdown42660604
JSON10036
YAML28336
XML20030

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.93
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces12
Interfaces2
Traits7
Classes168
▷ Abstract classes74.17%
▷ Concrete classes16195.83%
▷ Final classes00.00%
Methods739
▷ Static methods11515.56%
▷ Public methods69694.18%
▷ Protected methods172.30%
▷ Private methods263.52%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
Constants326
▷ Global constants185.52%
▷ Class constants30894.48%
▷ Public constants308100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.22MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/search-icon.png3.07KB0.61KB▼ 80.19%
assets/images/settings.png2.21KB1.78KB▼ 19.27%
assets/images/fontsy_logo.png101.03KB53.83KB▼ 46.71%
assets/images/Fontsy_White_Circle.png101.69KB34.28KB▼ 66.29%
assets/css/drop-arrow.png15.10KB0.31KB▼ 97.96%