10% picker

Code Review | Picker

WordPress plugin Picker scored 10% from 53 tests.

About plugin

  • Plugin page: picker
  • Plugin version: 1.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 5.8.1
  • First release: Jan 6, 2015
  • Latest release: Mar 14, 2021
  • Number of updates: 33
  • Update frequency: every 68.5 days
  • Top authors: lando1982 (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

10+ active / 1,805 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • Install procedure had errors
    • > User notice in wp-includes/functions.php+5663
    register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼1.82MB] [CPU: ▼311.24ms] Passed 4 tests

Server-side resources used by Picker
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.81 ▼1.034.64 ▼27.38
Dashboard /wp-admin1.83 ▼1.236.19 ▼36.78
Posts /wp-admin/edit.php1.83 ▼1.286.04 ▼42.64
Add New Post /wp-admin/post-new.php1.83 ▼3.604.81 ▼1,134.19
Media Library /wp-admin/upload.php1.83 ▼1.185.56 ▼31.34
Picker /wp-admin/options-general.php?page=picker1.835.28

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 1 new option
New WordPress options
widget_picker

Browser metrics Passed 4 tests

An overview of browser requirements for Picker
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,667 ▲6115.88 ▲0.258.31 ▲0.4546.87 ▼3.42
Dashboard /wp-admin2,972 ▲1226.48 ▲0.65140.68 ▼5.27112.94 ▲11.69
Posts /wp-admin/edit.php2,726 ▲202.99 ▲0.3176.26 ▲7.6788.80 ▼7.11
Add New Post /wp-admin/post-new.php1,673 ▲2018.41 ▼0.23373.40 ▼19.76110.40 ▲1.94
Media Library /wp-admin/upload.php1,805 ▲335.46 ▲0.44143.70 ▼10.92108.41 ▼17.06
Picker /wp-admin/options-general.php?page=picker1,4712.6067.5172.26

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
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5663
    register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_picker

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
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=picker
    • > User notice in wp-includes/functions.php+5663
    register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=picker
    • > Notice in wp-content/plugins/picker/includes/core.php+94
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/picker/includes/utils/picker-utils.php
    • > /wp-content/plugins/picker/picker.php
    • > /wp-content/plugins/picker/includes/install.php
    • > /wp-content/plugins/picker/includes/settings.php
    • > /wp-content/plugins/picker/includes/core.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/picker/includes/admin/class-picker-admin.php:33
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_custom_url() on null in wp-content/plugins/picker/templates/picker-widget-default.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/picker/includes/abstracts/abstract-picker-widget.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Abstract_Picker_Widget' not found in wp-content/plugins/picker/includes/widgets/class-picker-widget-default.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Picker_Item' not found in wp-content/plugins/picker/includes/class-picker-item-default.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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 (Widget admin page (customizing widget)), #2 (Widget admin page (datetimepicker usage)), #3 (Frontend widget layout), #4 (Admin settings page)
The official readme.txt might help

picker/picker.php 92% from 13 tests

The principal PHP file in "Picker" v. 1.1.6 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected5,773 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JSON1002,170
JavaScript32484382,036
PHP142757121,030
CSS34252399
PO File14765138

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity16.67
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes112.50%
Methods61
▷ Static methods58.20%
▷ Public methods5996.72%
▷ Protected methods00.00%
▷ Private methods23.28%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon32.png1.28KB1.02KB▼ 20.35%