78% improved-sale-badges-free-version

Code Review | Improved Sale Badges - Free Version

WordPress plugin Improved Sale Badges - Free Version scored78%from 54 tests.

About plugin

  • Plugin page: improved-sale-bad...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2.2
  • WordPress version: 6.3.1
  • First release: Jul 10, 2015
  • Latest release: Jul 10, 2015
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: dzeriho (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

500+ active /12,826 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
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.72ms] Passed 4 tests

Analyzing server-side resources used by Improved Sale Badges - Free Version
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.67 ▼6.23
Dashboard /wp-admin3.38 ▲0.0745.28 ▼5.70
Posts /wp-admin/edit.php3.49 ▲0.1348.14 ▼1.00
Add New Post /wp-admin/post-new.php5.96 ▲0.0781.64 ▼1.93
Media Library /wp-admin/upload.php3.30 ▲0.0734.50 ▲1.86

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

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

Browser metrics Passed 4 tests

Improved Sale Badges - Free Version: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9014.48 ▼0.121.94 ▼0.1941.66 ▼7.53
Dashboard /wp-admin2,200 ▲155.86 ▼0.02103.37 ▼15.4741.59 ▼0.20
Posts /wp-admin/edit.php2,092 ▲61.97 ▼0.0639.70 ▲2.1734.49 ▲2.78
Add New Post /wp-admin/post-new.php1,533 ▼1123.21 ▲4.95670.61 ▲35.2071.65 ▲17.87
Media Library /wp-admin/upload.php1,382 ▼34.20 ▲0.0395.03 ▼5.1839.57 ▼3.09

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/improved-sale-badges-free-version/includes/styles/isb_style_xmas_1.php
  • 18× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: isb_price in wp-content/plugins/improved-sale-badges-free-version/includes/styles/isb_style_pop.php on line 1
    • > PHP Notice
      Undefined variable: isb_price in wp-content/plugins/improved-sale-badges-free-version/includes/styles/isb_style_pop.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/improved-sale-badges-free-version/includes/styles/isb_style_xmas_1.php on line 15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/improved-sale-badges-free-version/includes/styles/isb_style_pop.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/improved-sale-badges-free-version/includes/isb-settings.php:244
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/improved-sale-badges-free-version/includes/styles/isb_style_xmas_1.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/improved-sale-badges-free-version/includes/styles/isb_style_pop.php on line 9
    • > PHP Notice
      Undefined variable: isb_curr_set in wp-content/plugins/improved-sale-badges-free-version/includes/styles/isb_style_xmas_1.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to a member function is_type() on null in wp-content/plugins/improved-sale-badges-free-version/woocommerce/single-product/sale-flash.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/improved-sale-badges-free-version/includes/styles/isb_style_xmas_1.php:18

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 undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
Please take inspiration from this readme.txt

improved-sale-badges-free-version/improved-sale-badges-free.php 85% from 13 tests

This is the main PHP file of "Improved Sale Badges - Free Version" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 157 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("improved-sale-badges-free-version.php" instead of "improved-sale-badges-free.php")

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
No dangerous file extensions were detected845 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP616513543
CSS33644232
JavaScript245070

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity14.50
▷ Minimum class complexity12.00
▷ Maximum class complexity17.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods1058.82%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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