84% wc-wallet

Code Review | WC Wallet

WordPress plugin WC Wallet scored84%from 54 tests.

About plugin

  • Plugin page: wc-wallet
  • Plugin version: 2.2.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 6.3.1
  • First release: Mar 24, 2016
  • Latest release: Jan 14, 2021
  • Number of updates: 26
  • Update frequency: every 67.7 days
  • Top authors: hemnathmouli (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

70+ active /13,972 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.05MB] [CPU: ▼4.86ms] Passed 4 tests

Server-side resources used by WC Wallet
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.76 ▼5.60
Dashboard /wp-admin3.36 ▲0.0552.89 ▼2.93
Posts /wp-admin/edit.php3.41 ▲0.0554.81 ▲3.96
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.74 ▼8.89
Media Library /wp-admin/upload.php3.28 ▲0.0538.72 ▼2.01

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WC Wallet
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲1914.36 ▲0.091.64 ▼0.3943.26 ▼1.03
Dashboard /wp-admin2,208 ▲315.57 ▼0.10100.51 ▲8.8345.87 ▲5.50
Posts /wp-admin/edit.php2,116 ▲161.98 ▼0.0233.98 ▼5.9242.31 ▲3.85
Add New Post /wp-admin/post-new.php1,542 ▲1423.00 ▲0.04639.62 ▼32.6056.37 ▲7.59
Media Library /wp-admin/upload.php1,419 ▲194.25 ▲0.1394.24 ▼14.1546.61 ▲1.68

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 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 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 fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-wallet/log/backend.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_cancel_request_enabled() in wp-content/plugins/wc-wallet/includes/cancel_requests.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-wallet/includes/settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/wc-wallet/log/backend.php:66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function remove_all_filters() in wp-content/plugins/wc-wallet/includes/settings.php:12

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: wc wallet, woocommerce wallet, wc credits, woocommerce credits, cancelled order to wallet

wc-wallet/wcw.php 92% from 13 tests

The principal PHP file in "WC Wallet" v. 2.2.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wc-wallet.php" instead of "wcw.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,550 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP62693121,550

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions50
▷ Named functions50100.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 files were detected