72% ws-coupon-woocommerce

Code Review | WS Coupon Woocommerce

WordPress plugin WS Coupon Woocommerce scored72%from 54 tests.

About plugin

  • Plugin page: ws-coupon-woocomm...
  • Plugin version: 0.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 17, 2019
  • Latest release: Jul 19, 2019
  • Number of updates: 9
  • Update frequency: every 0.3 days
  • Top authors: xjohnyk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /434 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.03MB] [CPU: ▼4.82ms] Passed 4 tests

Server-side resources used by WS Coupon Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.59 ▲0.19
Dashboard /wp-admin3.34 ▼0.0048.57 ▼11.92
Posts /wp-admin/edit.php3.46 ▲0.1048.32 ▼1.56
Add New Post /wp-admin/post-new.php5.94 ▲0.0696.02 ▼5.29
Media Library /wp-admin/upload.php3.27 ▲0.0433.51 ▼0.52
My Custom Page /wp-admin/admin.php?page=ws_two_woocommerce_slug3.2131.63

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WS Coupon Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲17713.40 ▼0.888.41 ▲6.3741.92 ▼3.55
Dashboard /wp-admin2,215 ▲385.65 ▲0.1196.25 ▲3.1443.08 ▼0.77
Posts /wp-admin/edit.php2,120 ▲202.00 ▲0.0340.66 ▲5.2435.98 ▼2.44
Add New Post /wp-admin/post-new.php1,564 ▲3518.25 ▼4.90589.93 ▼90.3755.50 ▼1.77
Media Library /wp-admin/upload.php1,420 ▲174.23 ▲0.0396.26 ▼5.5043.45 ▼4.50
My Custom Page /wp-admin/admin.php?page=ws_two_woocommerce_slug8002.0022.8725.25

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=ws_two_woocommerce_slug
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Ws_Coupon_Subadmin_Page::adminSubMenuCallback() should not be called statically

SRP 0% from 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ws-coupon-woocommerce/admin/pages/admin-no-woocommerce.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ws-coupon-woocommerce/ws_woocommerce.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ws-coupon-woocommerce/woocommerce/initWoo.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ws-coupon-woocommerce/admin/admin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ws-coupon-woocommerce/admin/pages/admin-page.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #1, #2 in ws-coupon-woocommerce/assets to your readme.txt
  • Donate link: Please fix this invalid url: "paypal.me/WPKwojciechskrzek"
Please take inspiration from this readme.txt

ws-coupon-woocommerce/ws_woocommerce.php 92% from 13 tests

"WS Coupon Woocommerce" version 0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ws-coupon-woocommerce.php" instead of "ws_woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected322 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP95130223
CSS215486
JavaScript23013

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity2.60
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods12
▷ Static methods650.00%
▷ Public methods12100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/paypalme.png24.38KB9.08KB▼ 62.75%