84% regenerate-thumbnails-advanced

Code Review | reGenerate Thumbnails Advanced

WordPress plugin reGenerate Thumbnails Advanced scored84%from 54 tests.

About plugin

  • Plugin page: regenerate-thumbn...
  • Plugin version: 2.4.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 10, 2015
  • Latest release: Aug 5, 2023
  • Number of updates: 164
  • Update frequency: every 18.0 days
  • Top authors: turcuciprian (84.76%)petredobrescu (9.15%)ShortPixel (7.32%)

Code review

54 tests

User reviews

38 reviews

Install metrics

100,000+ active /1,010,237 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▲0.46ms] Passed 4 tests

Analyzing server-side resources used by reGenerate Thumbnails Advanced
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1640.82 ▲1.12
Dashboard /wp-admin3.64 ▲0.3351.78 ▲2.18
Posts /wp-admin/edit.php3.69 ▲0.3351.52 ▲1.83
Add New Post /wp-admin/post-new.php6.16 ▲0.2795.42 ▼3.31
Media Library /wp-admin/upload.php3.50 ▲0.2737.28 ▲2.76
Regenerate Thumbnails /wp-admin/tools.php?page=rta_generate_thumbnails3.8469.07

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 49 new files
Database: 1 new table, 7 new options
New tables
wp_shortpixel_queue
New WordPress options
shortqwp_rta
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for reGenerate Thumbnails Advanced
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.27 ▼1.412.02 ▲0.1842.20 ▼1.64
Dashboard /wp-admin2,210 ▲255.85 ▼0.03110.30 ▼9.1841.99 ▼3.55
Posts /wp-admin/edit.php2,093 ▲12.00 ▼0.0240.26 ▲2.6435.31 ▲3.58
Add New Post /wp-admin/post-new.php1,538 ▲1023.35 ▲4.96645.60 ▲39.4649.75 ▼2.55
Media Library /wp-admin/upload.php1,395 ▲164.16 ▼0.03102.18 ▼2.4946.35 ▲3.75
Regenerate Thumbnails /wp-admin/tools.php?page=rta_generate_thumbnails1,5062.1230.5343.97

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

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)
Good news, no errors were detected

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
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ReThumbAdvanced\\_e() in wp-content/plugins/regenerate-thumbnails-advanced/templates/admin/rta_generate_thumbnails.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ReThumbAdvanced\\_e() in wp-content/plugins/regenerate-thumbnails-advanced/templates/admin/view_rta_regenerate.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ReThumbAdvanced\\ShortPixelLogger\\wp_enqueue_script() in wp-content/plugins/regenerate-thumbnails-advanced/build/shortpixel/log/src/view-debug-box.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ReThumbAdvanced\\_e() in wp-content/plugins/regenerate-thumbnails-advanced/templates/admin/view_regenerate_process.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ReThumbAdvanced\\_e() in wp-content/plugins/regenerate-thumbnails-advanced/templates/admin/view_rta_settings.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'ReThumbAdvanced\\ShortQ\\DataProvider\\DataProvider' not found in wp-content/plugins/regenerate-thumbnails-advanced/build/shortpixel/shortq/src/DataProvider/MysqlDataProvider.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'ReThumbAdvanced\\ShortQ\\Queue\\Queue' not found in wp-content/plugins/regenerate-thumbnails-advanced/build/shortpixel/shortq/src/Queue/WPQ.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ReThumbAdvanced\\Controllers\\Controller' not found in wp-content/plugins/regenerate-thumbnails-advanced/classes/Controllers/AdminController.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/regenerate-thumbnails-advanced/templates/admin/view_ad.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can look at the official readme.txt

regenerate-thumbnails-advanced/regenerate-thumbnails-advanced.php 92% from 13 tests

The principal PHP file in "reGenerate Thumbnails Advanced" v. 2.4.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin5,151 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP309354923,758
Sass48724627
JavaScript214261576
CSS462122
JSON51068

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity23.18
▷ Minimum class complexity1.00
▷ Maximum class complexity65.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces9
Interfaces2
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods258
▷ Static methods3011.63%
▷ Public methods21382.56%
▷ Protected methods2710.47%
▷ Private methods186.98%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants45
▷ Global constants613.33%
▷ Class constants3986.67%
▷ Public constants39100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/robo-winky.png3.24KB1.89KB▼ 41.70%