84% replace-image

Code Review | Replace Image

WordPress plugin Replace Image scored84%from 54 tests.

About plugin

  • Plugin page: replace-image
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3.0
  • WordPress version: 6.3.1
  • First release: Nov 4, 2015
  • Latest release: Aug 18, 2023
  • Number of updates: 47
  • Update frequency: every 60.5 days
  • Top authors: hearken (82.98%)annaqq (10.64%)aspengrovestudios (10.64%)

Code review

54 tests

User reviews

54 reviews

Install metrics

10,000+ active /77,430 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.53ms] Passed 4 tests

Analyzing server-side resources used by Replace Image
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.67 ▼4.55
Dashboard /wp-admin3.35 ▲0.0050.24 ▼17.66
Posts /wp-admin/edit.php3.40 ▲0.0450.67 ▼2.82
Add New Post /wp-admin/post-new.php5.95 ▲0.0698.10 ▼5.07
Media Library /wp-admin/upload.php3.27 ▲0.0443.01 ▲5.19
Replace Image /wp-admin/tools.php?page=hm_replace_image3.2432.78

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
hm_replace_image_first_activate
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Replace Image
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲3414.29 ▼0.071.84 ▼0.2344.93 ▼3.38
Dashboard /wp-admin2,204 ▲275.63 ▲0.0191.15 ▼3.8541.54 ▼5.32
Posts /wp-admin/edit.php2,106 ▲61.98 ▼0.0240.36 ▲2.4235.80 ▼2.12
Add New Post /wp-admin/post-new.php1,531 ▲323.21 ▲0.11681.31 ▲9.5359.62 ▲1.90
Media Library /wp-admin/upload.php1,403 ▼04.13 ▼0.07110.01 ▼6.6947.02 ▼0.77
Replace Image /wp-admin/tools.php?page=hm_replace_image9303.4491.3833.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • hm_replace_image_first_activate
    • widget_recent-comments

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/replace-image/hm-replace-image.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/replace-image/plugin-credit.php:10
    • > PHP Notice
      Undefined variable: potent_slug in wp-content/plugins/replace-image/plugin-credit.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: image, attachments, media, overwrite, images...

replace-image/hm-replace-image.php 92% from 13 tests

The entry point to "Replace Image" version 1.1.8 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("replace-image.php" instead of "hm-replace-image.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin203 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP23323183
JavaScript17520

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ags-logo.png2.19KB1.17KB▼ 46.63%
images/disable-cache-firefox.png27.29KB15.64KB▼ 42.70%
images/disable-cache-chrome.png18.14KB8.58KB▼ 52.73%