84% wp-retina-2x

Code Review | Perfect Images (Manage Image Sizes, Thumbnails, Replace, Retina)

WordPress plugin Perfect Images (Manage Image Sizes, Thumbnails, Replace, Retina) scored84%from 54 tests.

About plugin

  • Plugin page: wp-retina-2x
  • Plugin version: 6.4.9
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 26, 2012
  • Latest release: Nov 29, 2023
  • Number of updates: 380
  • Update frequency: every 11.0 days
  • Top authors: TigrouMeow (100%)

Code review

54 tests

User reviews

254 reviews

Install metrics

100,000+ active /4,888,093 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.66MB] [CPU: ▲6.33ms] Passed 4 tests

An overview of server-side resources used by Perfect Images (Manage Image Sizes, Thumbnails, Replace, Retina)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6045.35 ▲10.53
Dashboard /wp-admin4.00 ▲0.6660.41 ▲1.79
Posts /wp-admin/edit.php4.05 ▲0.6959.36 ▲9.77
Add New Post /wp-admin/post-new.php6.60 ▲0.7196.77 ▲3.22
Media Library /wp-admin/upload.php3.93 ▲0.7049.73 ▲17.04
Dashboard /wp-admin/admin.php?page=meowapps-main-menu4.1062.00
Perfect Images 0 /wp-admin/upload.php?page=wr2x_dashboard3.8939.21
Perfect Images /wp-admin/admin.php?page=wr2x_settings3.8939.60

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 152 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
wr2x_options
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Perfect Images (Manage Image Sizes, Thumbnails, Replace, Retina)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲12314.16 ▼0.191.66 ▲0.1440.56 ▲2.10
Dashboard /wp-admin2,278 ▲1006.20 ▲0.44127.04 ▲13.0642.61 ▼0.26
Posts /wp-admin/edit.php2,177 ▲773.09 ▲1.0756.56 ▲17.1032.92 ▼2.06
Add New Post /wp-admin/post-new.php1,593 ▲6423.79 ▲0.56688.53 ▲31.1335.67 ▼15.14
Media Library /wp-admin/upload.php1,484 ▲845.41 ▲1.25108.48 ▲12.3642.43 ▲2.21
Dashboard /wp-admin/admin.php?page=meowapps-main-menu5,6704.47118.1375.13
Perfect Images 0 /wp-admin/upload.php?page=wr2x_dashboard1,1804.88136.4546.64
Perfect Images /wp-admin/admin.php?page=wr2x_settings1,3104.36109.7838.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • wr2x_options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • 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
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 44× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/wp-retina-2x/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Process\\Pipes\\PipesInterface' not found in wp-content/plugins/wp-retina-2x/vendor/symfony/process/Pipes/AbstractPipes.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'ImageOptimizer\\WrapperOptimizer' not found in wp-content/plugins/wp-retina-2x/vendor/ps/image-optimizer/src/ImageOptimizer/ChangedOutputOptimizer.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/wp-retina-2x/vendor/symfony/options-resolver/Exception/AccessException.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/wp-retina-2x/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Process\\Exception\\ExceptionInterface' not found in wp-content/plugins/wp-retina-2x/vendor/symfony/process/Exception/RuntimeException.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/wp-retina-2x/classes/core.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Process\\Pipes\\AbstractPipes' not found in wp-content/plugins/wp-retina-2x/vendor/symfony/process/Pipes/WindowsPipes.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'ImageOptimizer\\Optimizer' not found in wp-content/plugins/wp-retina-2x/vendor/ps/image-optimizer/src/ImageOptimizer/CommandOptimizer.php:7
    • > PHP Warning
      Use of undefined constant WR2X_PATH - assumed 'WR2X_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-retina-2x/classes/optimize.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: high-dpi, replace, retina, regenerate, thumbnail...

wp-retina-2x/wp-retina-2x.php 92% from 13 tests

Analyzing the main PHP file in "Perfect Images (Manage Image Sizes, Thumbnails, Replace, Retina)" version 6.4.9
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 207 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected12,269 lines of code in 134 files:
LanguageFilesBlank linesComment linesLines of code
PHP971,9213,3439,735
PO File53887571,127
JSON900805
Markdown131570474
JavaScript81117103
YAML25025

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity20.29
▷ Minimum class complexity1.00
▷ Maximum class complexity359.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces17
Interfaces10
Traits2
Classes74
▷ Abstract classes34.05%
▷ Concrete classes7195.95%
▷ Final classes68.45%
Methods631
▷ Static methods558.72%
▷ Public methods57791.44%
▷ Protected methods233.65%
▷ Private methods314.91%
Functions57
▷ Named functions2645.61%
▷ Anonymous functions3154.39%
Constants76
▷ Global constants3748.68%
▷ Class constants3951.32%
▷ Public constants3897.44%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected