93% woo-sku-label-changer

Code Review | SKU Label Changer For WooCommerce

WordPress plugin SKU Label Changer For WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: woo-sku-label-cha...
  • Plugin version: 2.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-5.7.1
  • WordPress version: 5.8.1
  • First release: Jan 17, 2020
  • Latest release: Apr 27, 2021
  • Number of updates: 35
  • Update frequency: every 13.3 days
  • Top authors: asadabir (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

900+ active / 4,635 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.23MB] [CPU: ▼140.95ms] Passed 4 tests

Analyzing server-side resources used by SKU Label Changer For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.05 ▲0.2231.11 ▲7.06
Dashboard /wp-admin3.34 ▲0.2837.71 ▲0.81
Posts /wp-admin/edit.php3.39 ▲0.2848.05 ▲4.38
Add New Post /wp-admin/post-new.php5.64 ▲0.2081.12 ▼571.28
Media Library /wp-admin/upload.php3.22 ▲0.2227.29 ▲2.31

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

SKU Label Changer For WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,764 ▲16315.24 ▲0.085.45 ▲0.0180.75 ▼2.79
Dashboard /wp-admin3,005 ▲1096.18 ▲0.01133.91 ▲0.10181.40 ▼1.54
Posts /wp-admin/edit.php2,812 ▲753.37 ▲0.1463.31 ▼1.72142.30 ▲1.95
Add New Post /wp-admin/post-new.php3,861 ▼6319.36 ▼0.01462.37 ▼62.45159.60 ▼2.57
Media Library /wp-admin/upload.php1,824 ▲755.54 ▲0.02144.78 ▼5.62186.60 ▲0.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Appsero\\plugin_basename() in wp-content/plugins/woo-sku-label-changer/vendor/appsero/client/src/Client.php:153
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-sku-label-changer/vendor/appsero/client/src/Client.php on line 152

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 86% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: mpn, upc, woocommerce, sku, sku to isbn...

woo-sku-label-changer/main.php 69% from 13 tests

The main file in "SKU Label Changer For WooCommerce" v. 2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "2.2")
  • Description: Please don't use more than 140 characters for the plugin description (currently 148 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
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-sku-label-changer.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin2,198 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP124627531,819
Markdown1650179
JavaScript22617128
JSON30072

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity31.86
▷ Minimum class complexity1.00
▷ Maximum class complexity70.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods110
▷ Static methods43.64%
▷ Public methods7568.18%
▷ Protected methods65.45%
▷ Private methods2926.36%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.65MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png59.01KB29.38KB▼ 50.21%
assets/banner-772x250.png19.45KB8.89KB▼ 54.30%
assets/screenshot-2.png257.26KB118.60KB▼ 53.90%
assets/icon-256x256.png1.66KB0.77KB▼ 53.38%
assets/screenshot-3.png326.97KB162.07KB▼ 50.43%