83% tr-timthumb

Code Review | TR Timthumb

WordPress plugin TR Timthumb scored 83% from 54 tests.

About plugin

  • Plugin page: tr-timthumb
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Apr 28, 2013
  • Latest release: Dec 14, 2013
  • Number of updates: 13
  • Update frequency: every 17.7 days
  • Top authors: pntrinh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 5,911 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.60ms] Passed 4 tests

Server-side resources used by TR Timthumb
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.83 ▲0.58
Dashboard /wp-admin3.31 ▲0.0149.18 ▼2.45
Posts /wp-admin/edit.php3.36 ▲0.0144.36 ▼4.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0193.89 ▼3.76
Media Library /wp-admin/upload.php3.24 ▲0.0135.49 ▲2.48
reCreate Thumbnails /wp-admin/tools.php?page=tr-thumbnails3.2832.06

Server storage [IO: ▲0.13MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • The plugin illegally modified 2 files (51.40KB) outside of "wp-content/plugins/tr-timthumb/" and "wp-content/uploads/"
    • (modified) .htaccess
    • (new file) wp-content/timthumb.php
Filesystem: 23 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
_can_use_rewrite
widget_theysaidso_widget
tr_timthumb_backup_htaccess
db_upgraded
can_compress_scripts
log_timthumb
_timthumb_content
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

TR Timthumb: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.55 ▼0.651.75 ▲0.0344.48 ▼2.86
Dashboard /wp-admin2,210 ▲225.86 ▲0.84106.16 ▼9.5042.72 ▼5.09
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0233.89 ▼2.0634.14 ▲0.88
Add New Post /wp-admin/post-new.php1,545 ▲1018.24 ▼5.00608.35 ▼47.9055.17 ▼1.02
Media Library /wp-admin/upload.php1,392 ▲44.24 ▲0.0799.14 ▲0.6141.82 ▼2.21
reCreate Thumbnails /wp-admin/tools.php?page=tr-thumbnails7931.7524.8726.34

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 10 options in the database
    • _can_use_rewrite
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • _timthumb_content
    • tr_timthumb_backup_htaccess
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • log_timthumb
    • can_compress_scripts

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
Even though no errors were found, this is by no means an exhaustive test

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 fix the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tr-timthumb/inc/admin.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tr-timthumb/templates/create-thumbnails.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/tr-timthumb/inc/front.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/tr-timthumb/plugin.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can take inspiration from this readme.txt

tr-timthumb/plugin.php 85% from 13 tests

The entry point to "TR Timthumb" version 1.0.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 215 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("tr-timthumb.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,361 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP62001331,360
CSS1041

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity206.00
▷ Minimum class complexity206.00
▷ Maximum class complexity206.00
Average method complexity6.86
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods35
▷ Static methods38.57%
▷ Public methods514.29%
▷ Protected methods3085.71%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants49
▷ Global constants49100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%
css/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
css/images/ui-bg_glass_100_f6f6f6_1x400.png0.26KB0.12KB▼ 53.44%
css/images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%