72% wc-image-swapper

Code Review | WC Image Swapper

WordPress plugin WC Image Swapper scored72%from 54 tests.

About plugin

  • Plugin page: wc-image-swapper
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.3
  • WordPress version: 6.3.1
  • First release: Sep 4, 2016
  • Latest release: Mar 16, 2017
  • Number of updates: 7
  • Update frequency: every 27.7 days
  • Top authors: adoncreatives (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,127 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

An overview of server-side resources used by WC Image Swapper
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.26 ▼6.98
Dashboard /wp-admin3.35 ▲0.0046.73 ▼24.61
Posts /wp-admin/edit.php3.40 ▲0.0444.22 ▼8.16
Add New Post /wp-admin/post-new.php5.93 ▲0.0490.30 ▼7.03
Media Library /wp-admin/upload.php3.27 ▲0.0436.77 ▼0.51

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
wcpis-options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WC Image Swapper
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲15213.60 ▼0.835.42 ▲3.5140.87 ▼5.49
Dashboard /wp-admin2,226 ▲235.83 ▲0.02101.17 ▼17.1842.02 ▼1.33
Posts /wp-admin/edit.php2,108 ▲82.02 ▼0.0436.72 ▼0.8334.75 ▼0.82
Add New Post /wp-admin/post-new.php1,533 ▼1717.66 ▼5.49696.35 ▲28.6369.28 ▲17.58
Media Library /wp-admin/upload.php1,405 ▲54.19 ▼0.1599.45 ▼21.4242.74 ▼8.57
WC image swap /wp-admin/wc-imageswap.php260.440.1015.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • wcpis-options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wc-image-swapper/index.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-image-swapper/wc-imageswap.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/wc-imageswap.php
    • > Network (severe)
    wp-admin/wc-imageswap.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt might help

wc-image-swapper/wc-imageswap.php 77% from 13 tests

The main file in "WC Image Swapper" v. 1.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 220 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-image-swapper.php" instead of "wc-imageswap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin344 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP21644175
CSS51510160
JavaScript1239

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/help.png0.76KB0.57KB▼ 24.74%