62% wp-foft-loader

Code Review | WP FOFT Loader

WordPress plugin WP FOFT Loader scored62%from 54 tests.

About plugin

  • Plugin page: wp-foft-loader
  • Plugin version: 2.1.31
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 27, 2019
  • Latest release: Nov 20, 2023
  • Number of updates: 122
  • Update frequency: every 13.2 days
  • Top authors: seezee (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /3,809 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.62MB] [CPU: ▲4.47ms] 75% from 4 tests

This is a short check of server-side resources used by WP FOFT Loader
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,906.42ms on /wp-admin/options-general.php?page=wp-foft-loader)
PageMemory (MB)CPU Time (ms)
Home /5.33 ▲1.8774.92 ▲31.49
Dashboard /wp-admin3.98 ▲0.6852.62 ▲0.62
Posts /wp-admin/edit.php4.03 ▲0.6855.59 ▲7.68
Add New Post /wp-admin/post-new.php6.50 ▲0.61100.92 ▲3.87
Media Library /wp-admin/upload.php3.74 ▲0.5138.54 ▲5.71
WP FOFT Loader /wp-admin/options-general.php?page=wp-foft-loader4.011,906.42
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius4.0946.52

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 588 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
wp-foft-loaderversion
fs_debug_mode
can_compress_scripts
wpfl_version
fs_active_plugins
widget_recent-posts
...

Browser metrics Passed 4 tests

WP FOFT Loader: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9314.04 ▼0.361.89 ▲0.2428.13 ▼16.11
Dashboard /wp-admin2,219 ▲455.59 ▲0.0993.14 ▼7.7945.37 ▲3.75
Posts /wp-admin/edit.php2,125 ▲252.00 ▲0.0441.60 ▲1.7838.31 ▲3.27
Add New Post /wp-admin/post-new.php1,534 ▲823.36 ▲0.15601.03 ▼47.6863.91 ▲13.66
Media Library /wp-admin/upload.php1,421 ▲184.17 ▲0.00112.79 ▲16.4352.15 ▲9.19
WP FOFT Loader /wp-admin/options-general.php?page=wp-foft-loader1,2893.3958.37112.09
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0861.6627.8930.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp-foft-loader/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 11 options
    • can_compress_scripts
    • wp-foft-loaderversion
    • fs_active_plugins
    • db_upgraded
    • widget_recent-comments
    • wpfl_version
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • fs_accounts
    • widget_recent-posts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-foft-loader
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-foft-loader/includes/class-wp-foft-loader-ratings.php
    • > /wp-content/plugins/wp-foft-loader/includes/class-wp-foft-loader-js-vars.php
  • 168× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Token_Tag' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/Token/End.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrDef_Enum' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_HTMLModule' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Nofollow.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_URIScheme' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/URIScheme/tel.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_URIFilter' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_URIFilter' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrDef' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Injector' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/Injector/SafeObject.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrDef' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_HTMLModule' not found in wp-content/plugins/wp-foft-loader/includes/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php:13

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #7 (Documentation (2): Video tutorials)
The official readme.txt is a good inspiration

wp-foft-loader/wp-foft-loader.php Passed 13 tests

The principal PHP file in "WP FOFT Loader" v. 2.1.31 is loaded by WordPress automatically on each request
132 characters long description:
Optimize and speed up web font loading and improve UX by minimizing Flash of Invisible Text, Flash of Unstyled Text, and DOM Reflow.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin58,867 lines of code in 407 files:
LanguageFilesBlank linesComment linesLines of code
PHP37311,73929,40454,860
JavaScript124841482,995
Markdown33651753
CSS16312177
JSON20081
INI1111

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,096)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 232)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity28.40
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity232.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes298
▷ Abstract classes175.70%
▷ Concrete classes28194.30%
▷ Final classes00.00%
Methods2,161
▷ Static methods25211.66%
▷ Public methods1,59173.62%
▷ Protected methods1024.72%
▷ Private methods46821.66%
Functions108
▷ Named functions108100.00%
▷ Anonymous functions00.00%
Constants219
▷ Global constants11452.05%
▷ Class constants10547.95%
▷ Public constants105100.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
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/wp-foft-loader.png6.43KB5.40KB▼ 16.03%