78% kuvatfi-picker

Code Review | Kuvat.fi picker

WordPress plugin Kuvat.fi picker scored78%from 54 tests.

About plugin

  • Plugin page: kuvatfi-picker
  • Plugin version: 1.0.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Feb 7, 2019
  • Latest release: Nov 10, 2022
  • Number of updates: 12
  • Update frequency: every 114.3 days
  • Top authors: kuvatfi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,245 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.20MB] [CPU: ▼14.67ms] Passed 4 tests

An overview of server-side resources used by Kuvat.fi picker
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0433.52 ▼9.33
Dashboard /wp-admin3.10 ▼0.2129.99 ▼15.88
Posts /wp-admin/edit.php3.24 ▼0.1231.92 ▼12.03
Add New Post /wp-admin/post-new.php5.47 ▼0.4266.27 ▼21.43
Media Library /wp-admin/upload.php3.17 ▼0.0628.29 ▼7.96
Kuvat.fi /wp-admin/options-general.php?page=kuvatfi-picker3.0927.25

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Kuvat.fi picker
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.68 ▼0.701.60 ▼0.6742.63 ▼0.65
Dashboard /wp-admin2,207 ▲195.94 ▲1.0596.94 ▼15.4836.36 ▼9.24
Posts /wp-admin/edit.php2,093 ▲72.02 ▲0.0434.02 ▼1.9133.36 ▼0.25
Add New Post /wp-admin/post-new.php1,536 ▲2223.54 ▲5.92639.83 ▼49.7366.75 ▲12.23
Media Library /wp-admin/upload.php1,392 ▲104.26 ▲0.0596.82 ▼2.9745.12 ▲1.94
Kuvat.fi /wp-admin/options-general.php?page=kuvatfi-picker7942.0225.0926.81

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=kuvatfi-picker
    • > Notice in wp-content/plugins/kuvatfi-picker/kuvatfi.php+317
    Undefined index: query

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/kuvatfi-picker/kuvatfi.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: media picker, media library, kuvatfi

kuvatfi-picker/kuvatfi.php 92% from 13 tests

This is the main PHP file of "Kuvat.fi picker" version 1.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("kuvatfi-picker.php" instead of "kuvatfi.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,033 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP11487561
JavaScript1694366
CSS140106

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.80
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions2291.67%
▷ Anonymous functions28.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected