84% fonts-add

Code Review | Google Font

WordPress plugin Google Font scored84%from 54 tests.

About plugin

  • Plugin page: fonts-add
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.8
  • WordPress version: 6.3.1
  • First release: Apr 30, 2016
  • Latest release: Oct 2, 2016
  • Number of updates: 14
  • Update frequency: every 29.5 days
  • Top authors: umarbajwa (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /20,977 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.53ms] Passed 4 tests

Analyzing server-side resources used by Google Font
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0737.93 ▲0.37
Dashboard /wp-admin3.37 ▲0.0649.74 ▲0.06
Posts /wp-admin/edit.php3.42 ▲0.0647.59 ▼2.31
Add New Post /wp-admin/post-new.php5.97 ▲0.0887.96 ▼11.92
Media Library /wp-admin/upload.php3.29 ▲0.0635.82 ▲0.05

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Google Font
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲12213.79 ▼0.561.91 ▲0.2838.15 ▼2.97
Dashboard /wp-admin2,225 ▲455.31 ▼0.2897.30 ▲6.6740.93 ▼4.30
Posts /wp-admin/edit.php2,117 ▲142.49 ▲0.4942.19 ▼2.3434.54 ▼2.64
Add New Post /wp-admin/post-new.php1,556 ▲2823.13 ▲0.28601.89 ▼30.6335.47 ▼13.65
Media Library /wp-admin/upload.php1,437 ▲374.78 ▲0.5797.28 ▼18.0246.48 ▼0.79

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
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/fonts-add/public/wsgf-load-style.php:140
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fonts-add/google-fonts-ws.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
Please take inspiration from this readme.txt

fonts-add/google-fonts-ws.php 92% from 13 tests

The main PHP file in "Google Font" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fonts-add.php" instead of "google-fonts-ws.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,152 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript11452480
PHP21418422
CSS1270250

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.01
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%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
fs-sprite.png1.07KB0.18KB▼ 82.82%