78% better-font-awesome

Code Review | Better Font Awesome

WordPress plugin Better Font Awesome scored78%from 54 tests.

About plugin

  • Plugin page: better-font-awesome
  • Plugin version: 2.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 5, 2014
  • Latest release: Jan 15, 2023
  • Number of updates: 138
  • Update frequency: every 23.3 days
  • Top authors: McGuive7 (93.48%)aaronbmm (7.25%)

Code review

54 tests

User reviews

84 reviews

Install metrics

100,000+ active /1,088,154 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲5.28MB] [CPU: ▲6.81ms] 75% from 4 tests

Analyzing server-side resources used by Better Font Awesome
The following require your attention
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.28MB on /wp-admin/options-general.php?page=better-font-awesome)
PageMemory (MB)CPU Time (ms)
Home /7.97 ▲4.4648.42 ▲4.23
Dashboard /wp-admin8.87 ▲5.4864.30 ▲1.13
Posts /wp-admin/edit.php8.95 ▲5.5560.00 ▲4.85
Add New Post /wp-admin/post-new.php11.77 ▲5.84280.44 ▲175.89
Media Library /wp-admin/upload.php8.87 ▲5.6053.49 ▲17.01
Better Font Awesome /wp-admin/options-general.php?page=better-font-awesome8.8543.17

Server storage [IO: ▲5.35MB] [DB: ▲0.49MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 136 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
better-font-awesome_options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Better Font Awesome
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6813.99 ▼0.414.49 ▲2.6744.04 ▲0.54
Dashboard /wp-admin2,204 ▲305.32 ▼0.3589.12 ▼4.1637.74 ▼5.20
Posts /wp-admin/edit.php2,121 ▲212.37 ▲0.3735.09 ▼6.4532.64 ▼7.30
Add New Post /wp-admin/post-new.php1,547 ▲2122.30 ▼0.73708.71 ▲38.2234.58 ▼30.92
Media Library /wp-admin/upload.php1,418 ▲214.76 ▲0.5897.58 ▼12.8643.24 ▼4.19
Better Font Awesome /wp-admin/options-general.php?page=better-font-awesome8662.1725.4125.95

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • better-font-awesome_options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/better-font-awesome/vendor/mickey-kay/better-font-awesome-library/vendor/mustangostang/spyc/php4/5to4.php
    • > /wp-content/plugins/better-font-awesome/vendor/mickey-kay/better-font-awesome-library/vendor/mustangostang/spyc/examples/yaml-load.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/better-font-awesome/vendor/mickey-kay/better-font-awesome-library/vendor/mustangostang/spyc/tests/DumpTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/better-font-awesome/vendor/mickey-kay/better-font-awesome-library/vendor/mustangostang/spyc/tests/LoadTest.php:5
    • > PHP Warning
      file_get_contents(../spyc.php): failed to open stream: No such file or directory in wp-content/plugins/better-font-awesome/vendor/mickey-kay/better-font-awesome-library/vendor/mustangostang/spyc/php4/5to4.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/better-font-awesome/vendor/mickey-kay/better-font-awesome-library/vendor/mustangostang/spyc/tests/RoundTripTest.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-font-awesome/better-font-awesome.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/better-font-awesome/vendor/mickey-kay/better-font-awesome-library/vendor/mustangostang/spyc/tests/ParseTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/better-font-awesome/vendor/mickey-kay/better-font-awesome-library/vendor/mustangostang/spyc/tests/IndentTest.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: bootstrap, shortcode, cdn, icons, font...

better-font-awesome/better-font-awesome.php Passed 13 tests

The entry point to "Better Font Awesome" version 2.0.4 is a PHP file that has certain tags in its header comment area
52 characters long description:
The ultimate Font Awesome icon plugin for WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin26,155 lines of code in 108 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript121931856,793
PHP269271,6544,573
JSON12104,174
CSS713542,680
SVG1002,671
LESS17771312,055
Sass1434341,768
Markdown82660687
HTML22110315
YAML57234196
PO File12328178
XML3101265

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity32.00
▷ Minimum class complexity1.00
▷ Maximum class complexity257.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods295
▷ Static methods186.10%
▷ Public methods22877.29%
▷ Protected methods41.36%
▷ Private methods6321.36%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants10
▷ Global constants00.00%
▷ Class constants10100.00%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.22MB with 0.12MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/mickey-kay/better-font-awesome-library/lib/fontawesome-iconpicker/extension/icon-large.png12.55KB5.02KB▼ 60.02%
vendor/mickey-kay/better-font-awesome-library/lib/fontawesome-iconpicker/extension/screenshot.png210.46KB90.40KB▼ 57.05%
vendor/mickey-kay/better-font-awesome-library/lib/fontawesome-iconpicker/extension/icon.png1.48KB0.74KB▼ 49.80%