84% discount-percent

Code Review | Percent - Porcentaje de Descuento en Woocommerce

WordPress plugin Percent - Porcentaje de Descuento en Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: discount-percent
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8
  • WordPress version: 6.3.1
  • First release: Jul 29, 2021
  • Latest release: Jul 29, 2021
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: wpgrafiweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /619 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.93ms] Passed 4 tests

A check of server-side resources used by Percent - Porcentaje de Descuento en Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.72 ▼6.76
Dashboard /wp-admin3.31 ▲0.0044.55 ▼1.87
Posts /wp-admin/edit.php3.36 ▲0.0042.18 ▼4.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.78 ▼0.54
Media Library /wp-admin/upload.php3.23 ▲0.0034.64 ▼2.81

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Percent - Porcentaje de Descuento en Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.28 ▼1.004.37 ▲2.3340.79 ▼3.77
Dashboard /wp-admin2,206 ▲154.86 ▼0.17105.94 ▼5.1638.20 ▼8.18
Posts /wp-admin/edit.php2,086 ▼02.01 ▲0.0036.04 ▼1.0431.19 ▼2.78
Add New Post /wp-admin/post-new.php1,528 ▲818.42 ▼4.72608.88 ▼75.1258.41 ▲1.44
Media Library /wp-admin/upload.php1,385 ▼04.20 ▼0.17101.51 ▼4.5843.21 ▼1.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/discount-percent/percent.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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 your attention: You can look at the official readme.txt

discount-percent/percent.php 92% from 13 tests

The entry point to "Percent - Porcentaje de Descuento en Woocommerce" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("discount-percent.php" instead of "percent.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin28 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1111028

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin