72% wp-replace-unlicensed-and-broken-images

Code Review | WP Replace Unlicensed and Broken Images

WordPress plugin WP Replace Unlicensed and Broken Images scored 72% from 54 tests.

About plugin

  • Plugin page: wp-replace-unlice...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.7.3
  • WordPress version: 5.8.1
  • First release: Jul 19, 2016
  • Latest release: Mar 14, 2017
  • Number of updates: 23
  • Update frequency: every 11.1 days
  • Top authors: CK MacLeod (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active / 1,919 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.04MB] [CPU: ▼139.72ms] Passed 4 tests

An overview of server-side resources used by WP Replace Unlicensed and Broken Images
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1444.31 ▲21.45
Dashboard /wp-admin3.08 ▲0.0352.36 ▲9.52
Posts /wp-admin/edit.php3.20 ▲0.0947.98 ▼0.22
Add New Post /wp-admin/post-new.php5.45 ▲0.0192.21 ▼568.94
Media Library /wp-admin/upload.php3.03 ▲0.0337.71 ▲0.78
Replace Unlicensed and Broken Images /wp-admin/options-general.php?page=cks_rui_main_menu3.0031.04

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: no new tables, 3 new options
New WordPress options
cks_rui_options
category_children
cks_rui_version

Browser metrics Passed 4 tests

A check of browser resources used by WP Replace Unlicensed and Broken Images
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,687 ▲9116.46 ▲0.869.52 ▼1.1857.51 ▲8.18
Dashboard /wp-admin2,979 ▲456.55 ▲0.54151.33 ▼21.29129.54 ▲6.33
Posts /wp-admin/edit.php2,865 ▲1262.72 ▲0.0073.20 ▲8.7193.96 ▲0.68
Add New Post /wp-admin/post-new.php1,585 ▲418.55 ▲4.05400.60 ▲5.21141.04 ▲23.33
Media Library /wp-admin/upload.php1,832 ▲255.39 ▲0.34137.22 ▼27.55124.69 ▲6.22
Replace Unlicensed and Broken Images /wp-admin/options-general.php?page=cks_rui_main_menu2,5142.9674.73238.08

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • category_children

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Please fix the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-replace-unlicensed-and-broken-images/admin.php
    • > /wp-content/plugins/wp-replace-unlicensed-and-broken-images/cks_rui.php
    • > /wp-content/plugins/wp-replace-unlicensed-and-broken-images/migrate.php
    • > /wp-content/plugins/wp-replace-unlicensed-and-broken-images/uninstall.php
  • 1× 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/wp-replace-unlicensed-and-broken-images/admin_extra.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=cks_rui_main_menu
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-replace-unlicensed-and-broken-images/js/cks_admin_url_select.js?ver=5.8.1 2:27 Uncaught TypeError: $(...).live is not a function
    • > GET request to /wp-admin/options-general.php?page=cks_rui_main_menu
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-replace-unlicensed-and-broken-images/js/cks_rui_scripts.js?ver=5.8.1 43:18 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: seo, site errors, usage rights, dmca, copyright...

wp-replace-unlicensed-and-broken-images/cks_rui.php 85% from 13 tests

"WP Replace Unlicensed and Broken Images" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-replace-unlicensed-and-broken-images.php" instead of "cks_rui.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin2,393 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP51,0313961,302
SVG444607
CSS17512417
JavaScript3421967

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
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%
Functions62
▷ Named functions62100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/digital_arts_alliance.png48.27KB80.76KB0.00%
images/no_featured_image.png0.69KB0.31KB▼ 55.19%
images/daa.png1.74KB1.34KB▼ 23.25%
images/empty_image.png0.14KB0.08KB▼ 41.43%
images/image_removed.png18.71KB8.70KB▼ 53.48%