10% pb-responsive-images

Code Review | PB Responsive Images

WordPress plugin PB Responsive Images scored10%from 54 tests.

About plugin

  • Plugin page: pb-responsive-images
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9
  • WordPress version: 6.3.1
  • First release: Jul 10, 2012
  • Latest release: May 5, 2014
  • Number of updates: 19
  • Update frequency: every 35.0 days
  • Top authors: phenomblue (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /17,918 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/pb-responsive-images/options.php+184
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.46ms] Passed 4 tests

Server-side resources used by PB Responsive Images
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.84 ▼2.89
Dashboard /wp-admin3.33 ▲0.0246.56 ▼4.15
Posts /wp-admin/edit.php3.38 ▲0.0251.24 ▲1.02
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.11 ▼6.21
Media Library /wp-admin/upload.php3.25 ▲0.0235.40 ▼0.59
Responsive Images /wp-admin/options-general.php?page=rip_options3.2931.89

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 77 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
rip_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for PB Responsive Images
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.34 ▼0.022.32 ▲0.4240.13 ▼1.90
Dashboard /wp-admin2,199 ▲225.64 ▼0.0087.37 ▼10.8038.82 ▼5.74
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0240.14 ▲3.4236.14 ▼0.62
Add New Post /wp-admin/post-new.php1,532 ▲623.12 ▼0.35610.40 ▼8.9151.73 ▼7.94
Media Library /wp-admin/upload.php1,401 ▲14.19 ▼0.04102.83 ▼4.8542.75 ▼2.24
Responsive Images /wp-admin/options-general.php?page=rip_options1,4212.0830.7529.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/pb-responsive-images/slir/index.php
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Declaration of PelEntryNumber::setValue() should be compatible with PelEntry::setValue($value) in wp-content/plugins/pb-responsive-images/slir/pel/src/PelEntryNumber.php on line 136
    • > PHP Fatal error
      require_once(): Failed opening required 'PEAR/PackageFileManager2.php' (include_path='.:/usr/share/php') in wp-content/plugins/pb-responsive-images/slir/pel/makepackagexml.php on line 19
    • > PHP Warning
      Declaration of PelEntryNumber::setValue() should be compatible with PelEntry::setValue($value) in wp-content/plugins/pb-responsive-images/slir/pel/src/PelEntryNumber.php on line 136
    • > PHP Fatal error
      Uncaught Error: Class 'PelEntryLong' not found in wp-content/plugins/pb-responsive-images/slir/pel/src/PelEntryRational.php:68
    • > PHP Warning
      require_once(PEAR/PackageFileManager2.php): failed to open stream: No such file or directory in wp-content/plugins/pb-responsive-images/slir/pel/makepackagexml.php on line 19
    • > PHP Warning
      Declaration of PelEntryNumber::setValue() should be compatible with PelEntry::setValue($value) in wp-content/plugins/pb-responsive-images/slir/pel/src/PelEntryNumber.php on line 136
    • > PHP Fatal error
      Uncaught Error: Class 'SLIR' not found in wp-content/plugins/pb-responsive-images/slir/core/slirconfigdefaults.class.php:212
    • > PHP Fatal error
      Uncaught Error: Class 'PelEntryNumber' not found in wp-content/plugins/pb-responsive-images/slir/pel/src/PelEntryLong.php:62
    • > PHP Warning
      Declaration of PelEntryNumber::setValue() should be compatible with PelEntry::setValue($value) in wp-content/plugins/pb-responsive-images/slir/pel/src/PelEntryNumber.php on line 136
    • > PHP Warning
      Declaration of PelEntryNumber::setValue() should be compatible with PelEntry::setValue($value) in wp-content/plugins/pb-responsive-images/slir/pel/src/PelEntryNumber.php on line 136

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (The configuration page)
You can take inspiration from this readme.txt

pb-responsive-images/responsive-image-polyfill.php 92% from 13 tests

The primary PHP file in "PB Responsive Images" version 1.4.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("pb-responsive-images.php" instead of "responsive-image-polyfill.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin11,973 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP451,9458,1647,192
PO File72,6615,0934,433
Bourne Shell463116150
JavaScript32712107
Markdown138081
XML11010

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 146)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity23.12
▷ Minimum class complexity1.00
▷ Maximum class complexity291.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity146.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes62
▷ Abstract classes34.84%
▷ Concrete classes5995.16%
▷ Final classes00.00%
Methods537
▷ Static methods499.12%
▷ Public methods38872.25%
▷ Protected methods20.37%
▷ Private methods14727.37%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants270
▷ Global constants72.59%
▷ Class constants26397.41%
▷ Public constants263100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.15MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png100.93KB31.52KB▼ 68.77%
images/editor-icon.png1.09KB0.18KB▼ 83.33%
images/bg-head.png51.16KB45.66KB▼ 10.74%
images/editor-icon-disabled.png1.09KB0.18KB▼ 83.33%
images/logo.png2.66KB1.01KB▼ 61.85%