83% ts-webfonts-for-standard-plan

Code Review | TS Webfonts for Standard Plan

WordPress plugin TS Webfonts for Standard Plan scored83%from 54 tests.

About plugin

  • Plugin page: ts-webfonts-for-s...
  • Plugin version: 3.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-5.6.2
  • WordPress version: 6.3.1
  • First release: Jun 1, 2016
  • Latest release: Apr 7, 2021
  • Number of updates: 18
  • Update frequency: every 106.1 days
  • Top authors: morisawa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,644 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▼5.07ms] Passed 4 tests

Server-side resources used by TS Webfonts for Standard Plan
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.3745.17 ▼0.72
Dashboard /wp-admin4.24 ▲0.8658.99 ▼4.08
Posts /wp-admin/edit.php3.76 ▲0.3653.61 ▲1.19
Add New Post /wp-admin/post-new.php6.23 ▲0.3086.78 ▼16.68
Media Library /wp-admin/upload.php3.57 ▲0.3043.47 ▲4.86

Server storage [IO: ▲0.12MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

TS Webfonts for Standard Plan: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,030 ▲25913.49 ▼0.868.56 ▲6.7640.94 ▲0.41
Dashboard /wp-admin2,328 ▲1515.66 ▲0.0081.08 ▼6.0776.14 ▲36.26
Posts /wp-admin/edit.php2,122 ▲221.99 ▲0.0435.63 ▼6.8639.34 ▲0.17
Add New Post /wp-admin/post-new.php1,545 ▲1623.19 ▼0.45686.41 ▼4.9164.07 ▼0.56
Media Library /wp-admin/upload.php1,419 ▲254.20 ▲0.03110.93 ▼10.6648.19 ▼0.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.08MB] 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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/ts-webfonts-for-standard-plan/inc/class/class.fonttheme.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TypeSquare_Admin_Base' not found in wp-content/plugins/ts-webfonts-for-standard-plan/inc/admin-root.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/ts-webfonts-for-standard-plan/inc/class/class.fonttheme.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/file.php' (include_path='.:/usr/share/php') in wp-content/plugins/ts-webfonts-for-standard-plan/inc/class/class.fonttheme.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ts-webfonts-for-standard-plan/inc/class/class.fonttheme.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/ts-webfonts-for-standard-plan/inc/class/class.fonttheme.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ts-webfonts-for-standard-plan/inc/admin-dashboard.php:16
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/ts-webfonts-for-standard-plan/inc/class/class.api.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/file.php' (include_path='.:/usr/share/php') in wp-content/plugins/ts-webfonts-for-standard-plan/inc/class/class.api.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/file.php' (include_path='.:/usr/share/php') in wp-content/plugins/ts-webfonts-for-standard-plan/inc/class/class.fonttheme.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
2 plugin tags: fonts, webfonts

ts-webfonts-for-standard-plan/typesquare.php 77% from 13 tests

"TS Webfonts for Standard Plan" version 3.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ts-webfonts-for-standard-plan.php" instead of "typesquare.php")

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
Good job! No executable or dangerous file extensions detected3,462 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP10202741,736
CSS2156201,069
JavaScript29871546
JSON100111

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity25.00
▷ Minimum class complexity2.00
▷ Maximum class complexity70.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods98
▷ Static methods1515.31%
▷ Public methods6566.33%
▷ Protected methods00.00%
▷ Private methods3333.67%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants8
▷ Global constants225.00%
▷ Class constants675.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected