84% regenerate-thumbnails

Code Review | Regenerate Thumbnails

WordPress plugin Regenerate Thumbnails scored84%from 54 tests.

About plugin

  • Plugin page: regenerate-thumbn...
  • Plugin version: 3.1.6
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Aug 28, 2008
  • Latest release: Aug 14, 2023
  • Number of updates: 80
  • Update frequency: every 68.3 days
  • Top authors: Viper007Bond (71.25%)donncha (16.25%)gikaragia (6.25%)aaronfc (3.75%)renathoc (3.75%)

Code review

54 tests

User reviews

382 reviews

Install metrics

1,000,000+ active /20,460,468 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼4.06ms] Passed 4 tests

Server-side resources used by Regenerate Thumbnails
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2042.87 ▲3.30
Dashboard /wp-admin3.50 ▲0.1643.78 ▼12.97
Posts /wp-admin/edit.php3.61 ▲0.2645.13 ▼7.10
Add New Post /wp-admin/post-new.php6.10 ▲0.2190.39 ▲4.05
Media Library /wp-admin/upload.php3.42 ▲0.2034.46 ▲0.53
Regenerate Thumbnails /wp-admin/tools.php?page=regenerate-thumbnails3.4132.61

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

Browser metrics Passed 4 tests

An overview of browser requirements for Regenerate Thumbnails
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.62 ▼1.061.62 ▼0.3440.88 ▼8.62
Dashboard /wp-admin2,213 ▲224.86 ▼0.02109.27 ▼4.1544.37 ▲4.01
Posts /wp-admin/edit.php2,093 ▲12.05 ▲0.0539.69 ▼7.4934.50 ▼4.64
Add New Post /wp-admin/post-new.php1,517 ▼2117.65 ▼5.40664.29 ▲6.0454.66 ▲3.66
Media Library /wp-admin/upload.php1,396 ▲54.18 ▼0.0699.25 ▼1.2841.73 ▼2.35
Regenerate Thumbnails /wp-admin/tools.php?page=regenerate-thumbnails9512.8357.0529.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/regenerate-thumbnails/includes/class-regeneratethumbnails-rest-controller.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/regenerate-thumbnails/regenerate-thumbnails.php:570

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 Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: thumbnails, post thumbnails, thumbnail, post thumbnail

regenerate-thumbnails/regenerate-thumbnails.php Passed 13 tests

The main PHP file in "Regenerate Thumbnails" ver. 3.1.6 adds more information about the plugin and also serves as the entry point for this plugin
112 characters long description:
Regenerate the thumbnails for one or more of your image uploads. Useful when changing their sizes or your theme.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected962 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3226449929
CSS10131
JavaScript2012

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity48.67
▷ Minimum class complexity20.00
▷ Maximum class complexity87.00
Average method complexity4.76
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods38
▷ Static methods37.89%
▷ Public methods3694.74%
▷ Protected methods00.00%
▷ Private methods25.26%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png0.29KB0.10KB▼ 65.41%
css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png5.69KB2.08KB▼ 63.46%