78% font-awesome

Code Review | Font Awesome

WordPress plugin Font Awesome scored78%from 54 tests.

About plugin

  • Plugin page: font-awesome
  • Plugin version: 4.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Sep 18, 2012
  • Latest release: Aug 3, 2023
  • Number of updates: 94
  • Update frequency: every 42.3 days
  • Top authors: mlwilkerson (85.11%)rachelbaker (15.96%)

Code review

54 tests

User reviews

50 reviews

Install metrics

400,000+ active /3,420,788 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.87MB] [CPU: ▼3.18ms] Passed 4 tests

This is a short check of server-side resources used by Font Awesome
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.37 ▲0.9045.82 ▲1.45
Dashboard /wp-admin4.20 ▲0.9051.39 ▲2.70
Posts /wp-admin/edit.php4.26 ▲0.9053.01 ▲0.05
Add New Post /wp-admin/post-new.php6.77 ▲0.8886.13 ▼16.93
Media Library /wp-admin/upload.php4.06 ▲0.8342.99 ▲9.53
Font Awesome /wp-admin/options-general.php?page=font-awesome4.7440.74

Server storage [IO: ▲3.46MB] [DB: ▲0.14MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 54 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
font-awesome
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
font-awesome-conflict-detection

Browser metrics Passed 4 tests

This is an overview of browser requirements for Font Awesome
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲8714.74 ▲0.351.75 ▼0.4743.44 ▼6.33
Dashboard /wp-admin2,213 ▲224.88 ▼1.01117.61 ▲16.0236.18 ▼6.00
Posts /wp-admin/edit.php2,099 ▲102.05 ▲0.0539.64 ▼1.5036.10 ▲0.96
Add New Post /wp-admin/post-new.php6,319 ▲4,80525.84 ▲8.30856.24 ▲204.3235.75 ▼14.81
Media Library /wp-admin/upload.php1,395 ▲104.24 ▲0.04114.26 ▲13.2346.96 ▲4.66
Font Awesome /wp-admin/options-general.php?page=font-awesome1,3057.60156.5636.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/font-awesome/admin/views/main.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/font-awesome/defines.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FortAwesome\\trailingslashit() in wp-content/plugins/font-awesome/includes/class-fontawesome-config-controller.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FortAwesome\\trailingslashit() in wp-content/plugins/font-awesome/includes/class-fontawesome-metadata-provider.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FortAwesome\\trailingslashit() in wp-content/plugins/font-awesome/includes/class-fontawesome-v3deprecation-controller.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FortAwesome\\trailingslashit() in wp-content/plugins/font-awesome/includes/class-fontawesome.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FortAwesome\\trailingslashit() in wp-content/plugins/font-awesome/includes/class-fontawesome-api-controller.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FortAwesome\\trailingslashit() in wp-content/plugins/font-awesome/includes/class-fontawesome-preference-check-controller.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FortAwesome\\trailingslashit() in wp-content/plugins/font-awesome/includes/class-fontawesome-command.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Response' not found in wp-content/plugins/font-awesome/includes/class-fontawesome-rest-response.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FortAwesome\\trailingslashit() in wp-content/plugins/font-awesome/includes/class-fontawesome-deactivator.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: awesome, webfont, fontawesome, svg, font...

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

The main PHP script in "Font Awesome" version 4.4.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("font-awesome.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin9,665 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
CSS35651995,440
PHP287413,4834,193
JavaScript211232

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity13.11
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes38
▷ Abstract classes37.89%
▷ Concrete classes3592.11%
▷ Final classes12.86%
Methods206
▷ Static methods4823.30%
▷ Public methods15374.27%
▷ Protected methods2411.65%
▷ Private methods2914.08%
Functions63
▷ Named functions1422.22%
▷ Anonymous functions4977.78%
Constants39
▷ Global constants1230.77%
▷ Class constants2769.23%
▷ Public constants27100.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