89% credits-system-for-woocommerce

Code Review | Credits System for WooCommerce

WordPress plugin Credits System for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: credits-system-fo...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9
  • WordPress version: 6.3.1
  • First release: Dec 27, 2017
  • Latest release: Jan 6, 2018
  • Number of updates: 20
  • Update frequency: every 0.6 days
  • Top authors: joemarasiado (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /956 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Credits System for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0048.23 ▲3.41
Dashboard /wp-admin3.31 ▲0.0146.84 ▼7.18
Posts /wp-admin/edit.php3.36 ▲0.0052.58 ▲4.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.12 ▼12.62
Media Library /wp-admin/upload.php3.23 ▲0.0037.29 ▲2.72

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Credits System for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.73 ▲0.372.20 ▲0.4042.77 ▼2.36
Dashboard /wp-admin2,198 ▲245.60 ▲0.0088.21 ▼13.2139.19 ▼7.73
Posts /wp-admin/edit.php2,100 ▼32.00 ▼0.0539.33 ▲2.9437.50 ▲1.13
Add New Post /wp-admin/post-new.php1,545 ▲1423.36 ▼0.14671.73 ▼3.5457.18 ▼7.27
Media Library /wp-admin/upload.php1,400 ▲34.22 ▲0.0294.48 ▼17.9840.57 ▼3.75

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 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)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

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 83% 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
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
The official readme.txt is a good inspiration

credits-system-for-woocommerce/credits-for-woocommrece.php 77% from 13 tests

The main file in "Credits System for WooCommerce" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("credits-system-for-woocommerce.php" instead of "credits-for-woocommrece.php")
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin729 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP68118718
CSS10011

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.20
▷ Minimum class complexity3.00
▷ Maximum class complexity52.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods58
▷ Static methods1220.69%
▷ Public methods58100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin