84% wc-simple-product-badge

Code Review | WC Simple Product Badge

WordPress plugin WC Simple Product Badge scored 84% from 54 tests.

About plugin

  • Plugin page: wc-simple-product...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.5
  • WordPress version: 6.3.1
  • First release: Mar 9, 2016
  • Latest release: Mar 31, 2016
  • Number of updates: 18
  • Update frequency: every 1.2 days
  • Top authors: Mike_Oberdick (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 4,287 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.22ms] Passed 4 tests

An overview of server-side resources used by WC Simple Product Badge
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.27 ▼1.49
Dashboard /wp-admin3.32 ▲0.0145.97 ▼12.71
Posts /wp-admin/edit.php3.37 ▲0.0147.14 ▲2.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.41 ▼9.66
Media Library /wp-admin/upload.php3.24 ▲0.0134.35 ▼1.03

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WC Simple Product Badge
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.12 ▼1.501.71 ▼0.6042.97 ▼6.07
Dashboard /wp-admin2,203 ▲155.83 ▲0.96101.55 ▼2.1340.17 ▼2.03
Posts /wp-admin/edit.php2,092 ▲32.04 ▼0.0137.33 ▲0.2030.22 ▼3.24
Add New Post /wp-admin/post-new.php1,535 ▼923.47 ▲5.36630.19 ▲24.2055.19 ▲1.04
Media Library /wp-admin/upload.php1,388 ▼34.21 ▲0.0594.71 ▼10.7743.12 ▼2.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

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
Even though everything seems fine, this is not 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 take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-simple-product-badge/wc-simple-product-badge.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wc-simple-product-badge/wc-simple-product-badge.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can take inspiration from this readme.txt

wc-simple-product-badge/wc-simple-product-badge.php Passed 13 tests

The primary PHP file in "WC Simple Product Badge" version 1.1 is used by WordPress to initiate all plugin functionality
71 characters long description:
Display a simple product badge overlay for a WooCommerce store product.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected83 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1232054
CSS17029

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin