61% featured-image-toolkit

Code Review | FIT: Featured Image Toolkit

WordPress plugin FIT: Featured Image Toolkit scored 61% from 54 tests.

About plugin

  • Plugin page: featured-image-to...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-4.9.6
  • WordPress version: 5.9.2
  • First release: May 23, 2018
  • Latest release: Jun 20, 2018
  • Number of updates: 8
  • Update frequency: every 3.5 days
  • Top authors: Richard-B (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 536 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼310.91ms] Passed 4 tests

This is a short check of server-side resources used by FIT: Featured Image Toolkit
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.99 ▲0.4858.71 ▼1.96
Dashboard /wp-admin3.58 ▲0.1725.41 ▼14.21
Posts /wp-admin/edit.php3.78 ▲0.1424.88 ▼17.76
Add New Post /wp-admin/post-new.php6.48 ▼0.4980.51 ▼1,209.71
Media Library /wp-admin/upload.php3.60 ▲0.3126.62 ▼0.49
Featured Image Toolkit /wp-admin/options-general.php?page=fisr-setting-admin3.5725.00
Freemius Debug [v.2.1.0] /wp-admin/admin.php?page=freemius3.5724.08

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 219 new files
Database: no new tables, 5 new options
New WordPress options
fs_active_plugins
fs_gdpr
fs_accounts
fs_debug_mode
fs_api_cache

Browser metrics Passed 4 tests

FIT: Featured Image Toolkit: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,131 ▲38317.69 ▲1.699.13 ▲2.462.16 ▼0.13
Dashboard /wp-admin3,119 ▲2658.02 ▲1.71141.12 ▲5.89166.28 ▲6.13
Posts /wp-admin/edit.php2,954 ▲2635.10 ▲1.8778.91 ▲15.68153.89 ▲11.13
Add New Post /wp-admin/post-new.php1,720 ▲5216.76 ▼2.94377.02 ▼14.40180.29 ▲25.09
Media Library /wp-admin/upload.php1,732 ▲345.45 ▼0.14105.61 ▼40.18192.40 ▲7.68
Featured Image Toolkit /wp-admin/options-general.php?page=fisr-setting-admin1,4964.1972.27173.86
Freemius Debug [v.2.1.0] /wp-admin/admin.php?page=freemius1,6804.3168.99124.63

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+307
    call_user_func_array() expects parameter 1 to be a valid callback, function 'uninstall_fisr' not found or invalid function name
  • Zombie WordPress options detected upon uninstall: 5 options
    • fs_debug_mode
    • fs_accounts
    • fs_active_plugins
    • fs_gdpr
    • fs_api_cache

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Notice in wp-content/plugins/featured-image-toolkit/admin/class-fisr-admin.php+149
    Trying to access array offset on value of type bool

SRP 0% 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 fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/featured-image-toolkit/freemius/templates/ajax-loader.php
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/featured-image-toolkit/admin/partials/fisr-admin-display.php:247
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/featured-image-toolkit/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/featured-image-toolkit/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/featured-image-toolkit/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/featured-image-toolkit/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/featured-image-toolkit/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/featured-image-toolkit/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/featured-image-toolkit/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/featured-image-toolkit/freemius/templates/account/partials/addon.php on line 8

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

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • License uri: Please fix this invalid url: ""
  • Requires php: Invalid version format
You can take inspiration from this readme.txt

featured-image-toolkit/fit.php 85% from 13 tests

This is the main PHP file of "FIT: Featured Image Toolkit" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("featured-image-toolkit.php" instead of "fit.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected38,996 lines of code in 172 files:
LanguageFilesBlank linesComment linesLines of code
PHP1136,15614,43125,553
PO File94,7435,57310,287
Sass26391792,517
JavaScript871140404
Markdown1610192
JSON10027
CSS140416

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,212)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity61.00
▷ Minimum class complexity1.00
▷ Maximum class complexity2,212.00
Average method complexity4.10
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes23.77%
▷ Concrete classes5196.23%
▷ Final classes00.00%
Methods1,058
▷ Static methods15915.03%
▷ Public methods75170.98%
▷ Protected methods151.42%
▷ Private methods29227.60%
Functions96
▷ Named functions96100.00%
▷ Anonymous functions00.00%
Constants112
▷ Global constants9282.14%
▷ Class constants2017.86%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/fisr.png1.61KB1.11KB▼ 31.44%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/featured-image-toolkit.png1.61KB1.11KB▼ 31.44%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%