83% web-font-display

Code Review | Web Font Display

WordPress plugin Web Font Display scored83%from 54 tests.

About plugin

  • Plugin page: web-font-display
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.0
  • WordPress version: 6.3.1
  • First release: May 29, 2020
  • Latest release: Jun 17, 2022
  • Number of updates: 5
  • Update frequency: every 150.0 days
  • Top authors: aistechnolabspvtltd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /1,991 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.56ms] Passed 4 tests

This is a short check of server-side resources used by Web Font Display
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.57 ▼11.96
Dashboard /wp-admin3.31 ▲0.0152.47 ▼16.90
Posts /wp-admin/edit.php3.36 ▲0.0149.93 ▼1.87
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.62 ▼5.35
Media Library /wp-admin/upload.php3.24 ▲0.0136.81 ▼4.03

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Web Font Display
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲514.35 ▼0.021.66 ▼0.3847.28 ▲3.32
Dashboard /wp-admin2,195 ▲185.63 ▼0.02100.47 ▲13.4047.79 ▲8.40
Posts /wp-admin/edit.php2,100 ▼32.03 ▲0.0641.07 ▲6.1742.20 ▲9.07
Add New Post /wp-admin/post-new.php1,529 ▲323.44 ▲0.33612.32 ▼20.5657.01 ▼5.17
Media Library /wp-admin/upload.php1,400 ▼04.25 ▲0.0494.65 ▼3.7944.64 ▲0.78

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

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 | 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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/web-font-display/wfd-function.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/web-font-display/webfont-display.php:45

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 87% from 29 tests

readme.txt 88% 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
Attributes that require attention:
  • Donate link: Invalid URI found ("")
  • Screenshots: Add a description for screenshot #1 in web-font-display/assets to your readme.txt
The official readme.txt is a good inspiration

web-font-display/webfont-display.php 85% from 13 tests

Analyzing the main PHP file in "Web Font Display" version 1.0
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("web-font-display.php" instead of "webfont-display.php")
  • Description: The description should be shorter than 140 characters (currently 217 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin718 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
SVG100685
PHP2273332
CSS1031

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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