73% broken-images-redirection

Code Review | 404 Image Redirection (Replace Broken Images)

WordPress plugin 404 Image Redirection (Replace Broken Images) scored73%from 54 tests.

About plugin

  • Plugin page: broken-images-red...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2
  • WordPress version: 6.3.1
  • First release: Dec 8, 2021
  • Latest release: Apr 6, 2023
  • Number of updates: 10
  • Update frequency: every 48.4 days
  • Top authors: osamaesh (80%)wp-buy (30%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /4,202 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼8.11ms] Passed 4 tests

Server-side resources used by 404 Image Redirection (Replace Broken Images)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1046.20 ▲2.74
Dashboard /wp-admin3.41 ▲0.1153.31 ▼5.46
Posts /wp-admin/edit.php3.53 ▲0.1753.67 ▼0.06
Add New Post /wp-admin/post-new.php5.99 ▲0.1089.16 ▼29.10
Media Library /wp-admin/upload.php3.34 ▲0.1041.06 ▲2.18
Existing WP Docs Orders /wp-admin/admin.php?page=broken_image_change3.3444.31

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 17 new files
Database: 1 new table, 6 new options
New tables
wp_BIR_replace_an_image
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

404 Image Redirection (Replace Broken Images): an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.34 ▼0.341.75 ▼0.1947.25 ▲3.67
Dashboard /wp-admin2,210 ▲335.62 ▲0.1086.77 ▼3.9840.58 ▼3.53
Posts /wp-admin/edit.php2,115 ▲122.02 ▲0.0036.38 ▼3.8734.64 ▲0.42
Add New Post /wp-admin/post-new.php1,536 ▲1023.45 ▲0.22684.45 ▲12.6756.76 ▲4.60
Media Library /wp-admin/upload.php1,415 ▲124.23 ▲0.10101.03 ▼7.8644.01 ▲0.63
Existing WP Docs Orders /wp-admin/admin.php?page=broken_image_change1,2713.8973.6740.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_BIR_replace_an_image
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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
The following issues need your attention
  • 2× 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/broken-images-redirection/admin/setting.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/broken-images-redirection/admin/change.php:6

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

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Example), #2 (General Options), #3 (Custom Redirection)
You can take inspiration from this readme.txt

broken-images-redirection/broken-images-redirection.php 85% from 13 tests

"404 Image Redirection (Replace Broken Images)" version 1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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
Success! There were no dangerous files found in this plugin935 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP611016629
JavaScript21114210
CSS219796

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity22.33
▷ Minimum class complexity15.00
▷ Maximum class complexity29.00
Average method complexity4.05
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.10MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png62.96KB23.53KB▼ 62.63%
screenshot-1.png10.51KB5.18KB▼ 50.77%
assets/images/sort_asc.png0.16KB0.25KB0.00%
assets/images/sort_desc.png0.15KB0.25KB0.00%
assets/images/sort_both.png0.20KB0.29KB0.00%