78% font-squirrel

Code Review | Font Squirrel (unofficial)

WordPress plugin Font Squirrel (unofficial) scored78%from 54 tests.

About plugin

  • Plugin page: font-squirrel
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Sep 17, 2014
  • Latest release: Sep 17, 2014
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: Fab1en (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /10,955 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.19MB] [CPU: ▼15.67ms] 75% from 4 tests

Server-side resources used by Font Squirrel (unofficial)
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 907.57ms on /wp-admin/edit.php?post_type=font)
PageMemory (MB)CPU Time (ms)
Home /3.44 ▼0.0223.74 ▼16.54
Dashboard /wp-admin3.41 ▲0.1045.44 ▼8.02
Posts /wp-admin/edit.php3.52 ▲0.1749.14 ▲1.35
Add New Post /wp-admin/post-new.php4.92 ▼0.9660.76 ▼37.07
Media Library /wp-admin/upload.php3.33 ▲0.1035.82 ▼1.04
Fonts /wp-admin/edit.php?post_type=font3.46907.57
Search Fonts /wp-admin/edit.php?post_type=font&page=search-fonts3.3328.41
Add New /wp-admin/post-new.php?post_type=font3.3640.57

Server storage [IO: ▲0.17MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • Illegal file modification detected: 1 file (0.00KB) outside of "wp-content/plugins/font-squirrel/" and "wp-content/uploads/"
    • (new file) wp-content/fonts/.empty
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Font Squirrel (unofficial)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲12313.27 ▼1.281.91 ▲0.1539.25 ▼2.79
Dashboard /wp-admin2,239 ▲484.89 ▲0.01100.39 ▼5.0668.87 ▲24.43
Posts /wp-admin/edit.php2,111 ▲222.01 ▼0.0036.14 ▼2.0533.32 ▼1.25
Add New Post /wp-admin/post-new.php1,540 ▲723.12 ▼0.24709.19 ▲39.8753.81 ▼6.16
Media Library /wp-admin/upload.php1,421 ▲364.24 ▲0.0594.59 ▼7.6278.72 ▲35.82
Fonts /wp-admin/edit.php?post_type=font1,2171.9930.9130.75
Search Fonts /wp-admin/edit.php?post_type=font&page=search-fonts1,0582.2125.1829.06
Add New /wp-admin/post-new.php?post_type=font1,4102.4846.3161.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=font&page=search-fonts
    • > Warning in wp-content/plugins/font-squirrel/view/class.fonts-list-table.php+10
    Declaration of FontSq_List_Table::prepare_items($API, $classification) should be compatible with WP_Posts_List_Table::prepare_items()
    • > GET request to /wp-admin/edit.php?post_type=font&page=search-fonts
    • > Warning in wp-content/plugins/font-squirrel/view/class.fonts-list-table.php+53
    Declaration of FontSq_List_Table::display_rows() should be compatible with WP_Posts_List_Table::display_rows($posts = Array, $level = 0)
    • > GET request to /wp-admin/edit.php?post_type=font&page=search-fonts
    • > Warning in wp-content/plugins/font-squirrel/view/class.fonts-list-table.php+67
    Declaration of FontSq_List_Table::single_row($item) should be compatible with WP_Posts_List_Table::single_row($post, $level = 0)
    • > GET request to /wp-admin/edit.php?post_type=font&page=search-fonts
    • > Warning in wp-content/plugins/font-squirrel/view/class.fonts-list-table.php+13
    sizeof(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/edit.php?post_type=font&page=search-fonts
    • > Warning in wp-content/plugins/font-squirrel/view/class.fonts-list-table.php+22
    array_slice() expects parameter 1 to be array, object given
    • > GET request to /wp-admin/edit.php?post_type=font&page=search-fonts
    • > Warning in wp-content/plugins/font-squirrel/view/class.fonts-list-table.php+23
    Invalid argument supplied for foreach()

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 take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Posts_List_Table' not found in wp-content/plugins/font-squirrel/view/class.fonts-list-table.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/font-squirrel/view/class.font-customize-control.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: fonts, font

font-squirrel/index.php 92% from 13 tests

The principal PHP file in "Font Squirrel (unofficial)" v. 1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("font-squirrel.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin2,959 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23422142,028
CSS12540527
PHP754102390
Markdown15014

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.33
▷ Minimum class complexity3.00
▷ Maximum class complexity18.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
15 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
view/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
view/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%
view/images/ui-bg_glass_100_f6f6f6_1x400.png0.26KB0.12KB▼ 53.44%
view/images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.27KB0.14KB▼ 47.84%
view/images/ui-bg_glass_100_fdf5ce_1x400.png0.34KB0.16KB▼ 54.02%