89% discountx

Code Review | DiscountX - Best Woocommerce Discount Popup Plugin

WordPress plugin DiscountX - Best Woocommerce Discount Popup Plugin scored89%from 54 tests.

About plugin

  • Plugin page: discountx
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Jan 19, 2022
  • Latest release: Jan 19, 2022
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: mahfuz01 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,049 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼6.02ms] Passed 4 tests

Analyzing server-side resources used by DiscountX - Best Woocommerce Discount Popup Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.84 ▲1.51
Dashboard /wp-admin3.42 ▲0.0744.62 ▼17.61
Posts /wp-admin/edit.php3.53 ▲0.1748.02 ▲3.84
Add New Post /wp-admin/post-new.php6.00 ▲0.1179.37 ▼11.81
Media Library /wp-admin/upload.php3.34 ▲0.1136.23 ▲4.93

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
discountx_activation_redirect
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for DiscountX - Best Woocommerce Discount Popup Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6613.23 ▼1.164.98 ▲3.0842.47 ▼1.86
Dashboard /wp-admin2,218 ▲274.87 ▼0.02109.93 ▼5.2539.72 ▼3.23
Posts /wp-admin/edit.php2,100 ▲82.02 ▼0.0339.72 ▲2.8635.33 ▲4.09
Add New Post /wp-admin/post-new.php1,548 ▲623.45 ▲5.37632.93 ▼18.4156.93 ▼5.20
Media Library /wp-admin/upload.php1,400 ▲94.31 ▲0.03101.34 ▲3.3841.89 ▼1.99

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: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • discountx_activation_redirect

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Condition Rules), #2 (Popup Settings), #3 (Style settings.), #4 (Popup Display theme one.)
  • Tags: You are using too many tags: 20 tag instead of maximum 10
You can take inspiration from this readme.txt

discountx/discountx.php 92% from 13 tests

The entry point to "DiscountX - Best Woocommerce Discount Popup Plugin" version 1.0.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,624 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP10166299927
CSS35610433
JavaScript33824207
Markdown136057

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.71
▷ Minimum class complexity2.00
▷ Maximum class complexity26.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes114.29%
Methods36
▷ Static methods12.78%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants5
▷ Global constants5100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
app/assets/frontend/img/close.png0.29KB0.25KB▼ 12.63%