51% krsp-frontend-file-upload

Code Review | KRSP Frontend File Uploader

WordPress plugin KRSP Frontend File Uploader scored 51% from 54 tests.

About plugin

  • Plugin page: krsp-frontend-fil...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9.7
  • WordPress version: 5.9.2
  • First release: Jul 12, 2018
  • Latest release: Jul 12, 2018
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: krsp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 409 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲1.27MB] [CPU: ▼325.04ms] Passed 4 tests

A check of server-side resources used by KRSP Frontend File Uploader
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.64 ▲2.1219.49 ▼26.85
Dashboard /wp-admin5.65 ▲2.2518.50 ▼15.04
Posts /wp-admin/edit.php5.65 ▲2.0217.90 ▼19.79
Add New Post /wp-admin/post-new.php5.65 ▼1.3217.65 ▼1,238.46
Media Library /wp-admin/upload.php5.65 ▲2.3617.53 ▼8.54
Freemius Debug [v.1.2.4] /wp-admin/admin.php?page=freemius5.6517.51
KRSP Frontend File Upload /wp-admin/options-general.php?page=krsp_file_upload5.6617.60

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 209 new files
Database: no new tables, 3 new options
New WordPress options
fs_active_plugins
fs_accounts
fs_debug_mode

Browser metrics Passed 4 tests

KRSP Frontend File Uploader: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,888 ▲14417.54 ▲1.8648.00 ▲42.192.86 ▲0.01
Dashboard /wp-admin2,932 ▲746.18 ▼0.06120.22 ▼11.14169.91 ▲9.51
Posts /wp-admin/edit.php2,733 ▲483.25 ▲0.0165.27 ▼0.09156.01 ▲15.93
Add New Post /wp-admin/post-new.php1,681 ▼3819.33 ▲1.86415.25 ▼9.28165.11 ▼6.08
Media Library /wp-admin/upload.php1,740 ▲485.56 ▲0.03145.60 ▲7.87201.11 ▲12.91
Freemius Debug [v.1.2.4] /wp-admin/admin.php?page=freemius1,4182.4954.84124.56
KRSP Frontend File Upload /wp-admin/options-general.php?page=krsp_file_upload1,2523.2275.56142.35

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
    • > Notice in wp-content/plugins/krsp-frontend-file-upload/includes/media.class.php+59
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 4 options
    • fs_api_cache
    • fs_accounts
    • fs_debug_mode
    • fs_active_plugins

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=krsp_file_upload
    • > Notice in wp-content/plugins/krsp-frontend-file-upload/includes/media.class.php+59
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=krsp_file_upload
    • > Warning in wp-includes/class-wp-hook.php+307
    call_user_func_array() expects parameter 1 to be a valid callback, function 'krsp_file_upload_custom_connect_message_on_update' not found or invalid function name

SRP 50% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/krsp-frontend-file-upload/freemius/templates/ajax-loader.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=krsp_file_upload
    • > Javascript (severe) in unknown
    /wp-content/plugins/krsp-frontend-file-upload/includes/js/settings.js 4:0 Uncaught TypeError: Vue is not a constructor

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Settings page), #2 (Shortcode added to page), #3 (Plugin displayed on page), #4 (KRSP Frontend File Uploader Teaser)
The official readme.txt might help

krsp-frontend-file-upload/frontend-file-upload.php 69% from 13 tests

The primary PHP file in "KRSP Frontend File Uploader" version 1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters (".")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("krsp-frontend-file-upload.php" instead of "frontend-file-upload.php")
  • Domain Path: Please prefix the domain path with a forward slash character ("/.")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
These items require your attention
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .xap - Silverlight Application Package in Microsoft Silverlight
      • wp-content/plugins/krsp-frontend-file-upload/static/Moxie.xap
29,163 lines of code in 166 files:
LanguageFilesBlank linesComment linesLines of code
PHP944,53410,96819,214
PO File62,7783,0586,111
Sass31357792,540
Vuejs Component93411641
JavaScript96792454
JSON200111
HTML13055
CSS138736
SVG1001

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,332)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity49.44
▷ Minimum class complexity1.00
▷ Maximum class complexity1,332.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity80.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes43
▷ Abstract classes24.65%
▷ Concrete classes4195.35%
▷ Final classes00.00%
Methods819
▷ Static methods13416.36%
▷ Public methods61575.09%
▷ Protected methods161.95%
▷ Private methods18822.95%
Functions87
▷ Named functions8698.85%
▷ Anonymous functions11.15%
Constants106
▷ Global constants8681.13%
▷ Class constants2018.87%
▷ Public constants20100.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
6 PNG files occupy 0.30MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
screenshot-3.png67.12KB15.82KB▼ 76.44%
screenshot-2.png152.94KB51.71KB▼ 66.19%
screenshot-1.png54.02KB11.90KB▼ 77.97%
freemius/assets/img/krsp-file-upload.png9.16KB5.26KB▼ 42.58%