94% replace-broken-images

Code Review | Replace Broken Images

WordPress plugin Replace Broken Images scored 94% from 53 tests.

About plugin

  • Plugin page: replace-broken-im...
  • Plugin version: 1.02
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 5.8.1
  • First release: Mar 11, 2017
  • Latest release: Jul 13, 2021
  • Number of updates: 25
  • Update frequency: every 63.2 days
  • Top authors: huynhmaianhkiet (100%)

Code review

53 tests

User reviews

3 reviews

Install metrics

800+ active / 7,143 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Replace Broken Images
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1334.99 ▲12.04
Dashboard /wp-admin3.07 ▲0.0246.54 ▼12.53
Posts /wp-admin/edit.php3.12 ▲0.0241.95 ▼15.42
Add New Post /wp-admin/post-new.php5.44 ▲0.0188.73 ▼1,264.08
Media Library /wp-admin/upload.php3.02 ▲0.0233.27 ▼14.34

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Replace Broken Images
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,698 ▲9216.33 ▲0.719.23 ▼0.4044.25 ▼19.15
Dashboard /wp-admin2,976 ▲576.09 ▲0.08144.82 ▼43.29109.52 ▼21.58
Posts /wp-admin/edit.php2,726 ▲202.69 ▲0.0064.70 ▼16.3988.67 ▼16.63
Add New Post /wp-admin/post-new.php1,494 ▼16218.38 ▲0.18362.99 ▼63.00115.40 ▼2.93
Media Library /wp-admin/upload.php1,792 ▲175.01 ▼0.00160.78 ▲1.60123.10 ▼3.28

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/replace-broken-images/HMAK-Replace-Broken-Images.php:99

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: You can look at the official readme.txt

replace-broken-images/HMAK-Replace-Broken-Images.php 92% from 13 tests

The main PHP script in "Replace Broken Images" version 1.02 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("replace-broken-images.php" instead of "HMAK-Replace-Broken-Images.php")

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
Everything looks great! No dangerous files found in this plugin141 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP127141

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png81.49KB34.56KB▼ 57.59%