10% fonts-master

Code Review | ShuFont

WordPress plugin ShuFont scored10%from 54 tests.

About plugin

  • Plugin page: fonts-master
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8
  • WordPress version: 6.3.1
  • First release: Mar 14, 2017
  • Latest release: Aug 3, 2017
  • Number of updates: 18
  • Update frequency: every 7.8 days
  • Top authors: orrafgin (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /616 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
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/fonts-master/font-class.php+625
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▼1.50MB] [CPU: ▼52.83ms] Passed 4 tests

This is a short check of server-side resources used by ShuFont
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.48 ▼0.986.01 ▼36.61
Dashboard /wp-admin2.51 ▼0.807.99 ▼43.51
Posts /wp-admin/edit.php2.51 ▼0.857.40 ▼41.54
Add New Post /wp-admin/post-new.php2.51 ▼3.386.70 ▼89.65
Media Library /wp-admin/upload.php2.51 ▼0.727.23 ▼28.94
ShuFont /wp-admin/options-general.php?page=fm-fonts2.517.02

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
oasf-fonts_id_count
db_upgraded
oafm-google-fonts-data
can_compress_scripts
widget_recent-comments
oafm_settings
theysaidso_admin_options
oasf-fonts_options
widget_recent-posts

Browser metrics Passed 4 tests

ShuFont: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.53 ▼1.061.72 ▼0.1340.14 ▼3.23
Dashboard /wp-admin2,217 ▲295.86 ▲0.94115.00 ▲4.9348.88 ▲8.00
Posts /wp-admin/edit.php2,106 ▲202.04 ▲0.0340.05 ▲5.1435.61 ▲1.21
Add New Post /wp-admin/post-new.php1,527 ▲1317.64 ▲0.07668.44 ▲42.2955.37 ▼12.39
Media Library /wp-admin/upload.php1,405 ▲174.24 ▲0.0397.82 ▼10.1049.03 ▲6.35
ShuFont /wp-admin/options-general.php?page=fm-fonts1,0721.8425.5931.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/fonts-master/font-class.php+625
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=fm-fonts
    • > Warning in wp-content/plugins/fonts-master/font-class.php+629
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
    • > GET request to /wp-admin/options-general.php?page=fm-fonts
    • > Notice in wp-content/plugins/fonts-master/tinymce/tinymce.php+26
    Undefined variable: data
    • > GET request to /wp-admin/options-general.php?page=fm-fonts
    • > Warning in wp-content/plugins/fonts-master/font-class.php+1875
    count(): Parameter must be an array or an object that implements Countable

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
The following issues need your attention
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/fonts-master/font-class.php on line 625
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/fonts-master/font-class-admin-tables.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/fonts-master/font-class-admin-tables.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/fonts-master/shufont.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/fonts-master/font-class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fonts-master/functions.php:5
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/fonts-master/font-class.php on line 629
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/fonts-master/font-class-admin-tables.php on line 3

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (This is the font's settings page in the admin area. Here is where you upload your fonts and assing them to elements.), #2 (This is the page where you manage your fonts. You can edit them or delete them.)
You can look at the official readme.txt

fonts-master/shufont.php 85% from 13 tests

The primary PHP file in "ShuFont" version 1.6.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("fonts-master.php" instead of "shufont.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin3,199 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP105463332,099
JavaScript216667637
CSS27013311
PO File1692152

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity38.10
▷ Minimum class complexity1.00
▷ Maximum class complexity232.00
Average method complexity5.58
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods81
▷ Static methods22.47%
▷ Public methods8098.77%
▷ Protected methods00.00%
▷ Private methods11.23%
Functions8
▷ Named functions8100.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
PNG images were not found in this plugin