83% easy-replace-image

Code Review | Easy Replace Image

WordPress plugin Easy Replace Image scored83%from 54 tests.

About plugin

  • Plugin page: easy-replace-image
  • Plugin version: 3.3.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 19, 2017
  • Latest release: Nov 14, 2023
  • Number of updates: 27
  • Update frequency: every 85.6 days
  • Top authors: Iulia Cazan (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active /6,870 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼7.40ms] Passed 4 tests

An overview of server-side resources used by Easy Replace Image
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1738.87 ▼1.56
Dashboard /wp-admin3.48 ▲0.1344.00 ▼15.56
Posts /wp-admin/edit.php3.59 ▲0.2350.83 ▲2.51
Add New Post /wp-admin/post-new.php6.06 ▲0.1779.99 ▼14.92
Media Library /wp-admin/upload.php3.40 ▲0.1735.60 ▲2.46
Easy Replace Image /wp-admin/tools.php?page=easy-replace-image-settings3.3931.76

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
srifu_plugin_notice_db_ver
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Easy Replace Image
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲10914.01 ▼0.121.78 ▲0.0837.65 ▼6.63
Dashboard /wp-admin2,261 ▲865.56 ▼0.1693.24 ▼12.0476.13 ▲32.51
Posts /wp-admin/edit.php2,170 ▲702.11 ▲0.1039.80 ▼2.1437.99 ▼0.45
Add New Post /wp-admin/post-new.php1,586 ▲5123.18 ▲0.02659.06 ▲35.74178.16 ▲121.82
Media Library /wp-admin/upload.php1,463 ▲664.23 ▲0.06107.88 ▲5.4281.80 ▲38.32
Easy Replace Image /wp-admin/tools.php?page=easy-replace-image-settings9342.0124.8938.75

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 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • srifu_plugin_notice_db_ver
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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 fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/easy-replace-image/easy-replace-image.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Requires at least: Invalid plugin version format
Please take inspiration from this readme.txt

easy-replace-image/easy-replace-image.php 85% from 13 tests

The main PHP script in "Easy Replace Image" version 3.3.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 238 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected942 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP2105295790
PO File14053148
CSS2002
JavaScript2002

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity111.00
▷ Minimum class complexity111.00
▷ Maximum class complexity111.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods37
▷ Static methods3594.59%
▷ Public methods3697.30%
▷ Protected methods00.00%
▷ Private methods12.70%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants450.00%
▷ Class constants450.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-128x128.png6.62KB3.58KB▼ 45.84%
assets/images/buy-me-a-coffee.png19.75KB7.15KB▼ 63.78%