79% pw-woocommerce-affiliates

Code Review | PW WooCommerce Affiliates

WordPress plugin PW WooCommerce Affiliates scored79%from 54 tests.

About plugin

  • Plugin page: pw-woocommerce-af...
  • Plugin version: 1.42
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 13, 2018
  • Latest release: Oct 25, 2023
  • Number of updates: 47
  • Update frequency: every 39.7 days
  • Top authors: pimwick (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

90+ active /9,123 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.72ms] Passed 4 tests

This is a short check of server-side resources used by PW WooCommerce Affiliates
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1341.44 ▲2.41
Dashboard /wp-admin3.42 ▲0.0748.04 ▼10.52
Posts /wp-admin/edit.php3.53 ▲0.1751.60 ▲4.76
Add New Post /wp-admin/post-new.php6.00 ▲0.1181.27 ▼9.42
Media Library /wp-admin/upload.php3.34 ▲0.1138.31 ▲2.64

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

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

Browser metrics Passed 4 tests

PW WooCommerce Affiliates: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.10 ▼0.252.13 ▲0.4346.10 ▲5.49
Dashboard /wp-admin2,195 ▲155.59 ▼0.0780.53 ▼7.8734.01 ▼6.60
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0539.03 ▲3.9536.59 ▲0.77
Add New Post /wp-admin/post-new.php1,526 ▼023.17 ▲0.26677.74 ▼22.9252.11 ▼9.08
Media Library /wp-admin/upload.php1,403 ▼04.19 ▲0.0899.51 ▼3.6745.58 ▲0.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_pimwick_affiliate
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: referrals, pimwick, affiliates, woocommerce

pw-woocommerce-affiliates/pw-affiliates.php 85% from 13 tests

Analyzing the main PHP file in "PW WooCommerce Affiliates" version 1.42
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pw-woocommerce-affiliates.php" instead of "pw-affiliates.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.5" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected3,554 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP163832441,485
PO File65466311,430
JavaScript4738342
CSS3635297

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity26.67
▷ Minimum class complexity13.00
▷ Maximum class complexity36.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes266.67%
Methods53
▷ Static methods23.77%
▷ Public methods5298.11%
▷ Protected methods00.00%
▷ Private methods11.89%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants2
▷ Global constants2100.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
15 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png0.26KB0.15KB▼ 42.37%
admin/assets/images/pimwick.png2.74KB2.49KB▼ 9.09%
assets/css/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
assets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%