10% wp-choose-thumb

Code Review | WP-Choose-Thumb

WordPress plugin WP-Choose-Thumb scored 10% from 54 tests.

About plugin

  • Plugin page: wp-choose-thumb
  • Plugin version: 1.3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-3.5
  • WordPress version: 6.3.1
  • First release: Feb 12, 2009
  • Latest release: Dec 18, 2012
  • Number of updates: 34
  • Update frequency: every 41.3 days
  • Top authors: dave.ligthart (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 10,052 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-choose-thumb/wp-choose-thumb.php+17
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.15ms] Passed 4 tests

A check of server-side resources used by WP-Choose-Thumb
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.25 ▼52.59
Dashboard /wp-admin2.05 ▼1.265.45 ▼40.34
Posts /wp-admin/edit.php2.05 ▼1.317.07 ▼37.66
Add New Post /wp-admin/post-new.php2.05 ▼3.845.54 ▼86.02
Media Library /wp-admin/upload.php2.05 ▼1.184.85 ▼28.81
WP-Choose-Thumb /wp-admin/options-general.php?page=wct_options2.055.67

Server storage [IO: ▲0.19MB] [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: 15 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-Choose-Thumb
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲9713.24 ▼1.171.97 ▲0.1345.24 ▲2.81
Dashboard /wp-admin2,216 ▲315.88 ▼0.02106.51 ▲3.0939.63 ▼4.73
Posts /wp-admin/edit.php2,099 ▲102.02 ▼0.0334.43 ▼0.8631.39 ▼3.75
Add New Post /wp-admin/post-new.php6,635 ▲5,11429.50 ▲6.21903.74 ▲243.1363.57 ▲8.87
Media Library /wp-admin/upload.php1,395 ▲134.28 ▲0.1094.60 ▼0.8640.93 ▼5.06
WP-Choose-Thumb /wp-admin/options-general.php?page=wct_options8001.8727.2423.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • 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 errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wct_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=wct_options
    • > Deprecated in wp-content/plugins/wp-choose-thumb/wp-choose-thumb.php+17
    Function create_function() is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wct_options
    • > Notice in wp-content/plugins/wp-choose-thumb/wp-choose-thumb.php+238
    Trying to get property 'ID' of non-object

SRP 50% 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 take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-choose-thumb/settings.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/wp-choose-thumb/wp-choose-thumb.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% 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
These attributes need your attention:
  • Contributors: No tags were detected
  • Screenshots: These screenshots require images: #1 (Choose from thumbnails in the edit post view.), #2 (Display thumbnail in post.), #3 (Overview demo)
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

wp-choose-thumb/wp-choose-thumb.php Passed 13 tests

The principal PHP file in "WP-Choose-Thumb" v. 1.3.6 is loaded by WordPress automatically on each request
53 characters long description:
A simple way to add a default thumbnail to your post.

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 detected294 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP364166234
PO File2161460

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
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
4 PNG files occupy 0.17MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/thumbsup.png1.46KB1.46KB0.00%
screenshot-3.png43.53KB17.51KB▼ 59.77%
screenshot-2.png94.95KB37.56KB▼ 60.44%
screenshot-1.png35.82KB15.35KB▼ 57.14%