84% thumbsniper

Code Review | ThumbSniper

WordPress plugin ThumbSniper scored84%from 54 tests.

About plugin

  • Plugin page: thumbsniper
  • Plugin version: 2.9.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.7
  • WordPress version: 6.3.1
  • First release: Aug 7, 2011
  • Latest release: Dec 21, 2016
  • Number of updates: 76
  • Update frequency: every 29.0 days
  • Top authors: CupRacer (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /10,344 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.67MB] [CPU: ▼16.35ms] Passed 4 tests

Server-side resources used by ThumbSniper
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.68 ▲1.10
Dashboard /wp-admin3.33 ▲0.0346.62 ▼1.68
Posts /wp-admin/edit.php3.38 ▲0.0347.42 ▲1.12
Add New Post /wp-admin/post-new.php3.12 ▼2.7736.95 ▼64.92
Media Library /wp-admin/upload.php3.25 ▲0.0335.06 ▲0.10
ThumbSniper /wp-admin/options-general.php?page=thumbsniper3.2232.68

Server storage [IO: ▲0.15MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by ThumbSniper
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲12813.59 ▼1.096.62 ▲4.6144.97 ▲2.13
Dashboard /wp-admin2,210 ▲254.80 ▼1.0198.26 ▼1.8838.07 ▼5.47
Posts /wp-admin/edit.php2,109 ▲202.24 ▲0.2139.21 ▼5.0238.81 ▲0.44
Add New Post /wp-admin/post-new.php6,458 ▲4,91619.99 ▲1.86893.54 ▲277.4363.73 ▲8.10
Media Library /wp-admin/upload.php1,404 ▲134.19 ▼0.0098.53 ▲2.9240.75 ▼0.77
ThumbSniper /wp-admin/options-general.php?page=thumbsniper1,0941.8525.9731.68

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/thumbsniper/thumbsniper.php:35

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

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Screenshots: Screenshot #1 (This screenshot shows a tooltip preview which is shown while holding the mouse cursor over the WordPress.org hyperlink.) image required
The official readme.txt is a good inspiration

thumbsniper/thumbsniper.php Passed 13 tests

The main file in "ThumbSniper" v. 2.9.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
99 characters long description:
This plugin dynamically shows preview screenshots of hyperlinks as tooltips on your WordPress site.

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
There were no executable files found in this plugin1,453 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP133493811,307
JSON30079
Markdown111067

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity25.00
▷ Minimum class complexity1.00
▷ Maximum class complexity115.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes8
▷ Abstract classes225.00%
▷ Concrete classes675.00%
▷ Final classes00.00%
Methods93
▷ Static methods3638.71%
▷ Public methods8389.25%
▷ Protected methods00.00%
▷ Private methods1010.75%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png44.08KB19.33KB▼ 56.15%