84% affiliates-wp-e-commerce

Code Review | Affiliates WP e-Commerce Integration

WordPress plugin Affiliates WP e-Commerce Integration scored84%from 54 tests.

About plugin

  • Plugin page: affiliates-wp-e-c...
  • Plugin version: 2.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-3.9
  • WordPress version: 6.3.1
  • First release: Oct 2, 2013
  • Latest release: May 5, 2014
  • Number of updates: 6
  • Update frequency: every 35.8 days
  • Top authors: itthinx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,444 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.01MB] [CPU: ▼6.63ms] Passed 4 tests

This is a short check of server-side resources used by Affiliates WP e-Commerce Integration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.60 ▲0.34
Dashboard /wp-admin3.31 ▼0.0456.69 ▼11.56
Posts /wp-admin/edit.php3.36 ▲0.0047.92 ▼2.46
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.25 ▼12.82
Media Library /wp-admin/upload.php3.23 ▲0.0039.00 ▲3.57

Server storage [IO: ▲0.20MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Affiliates WP e-Commerce Integration
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲9014.72 ▲0.562.10 ▲0.4642.16 ▼0.88
Dashboard /wp-admin2,220 ▲435.56 ▲0.0197.83 ▲5.7844.33 ▲0.30
Posts /wp-admin/edit.php2,122 ▲191.99 ▲0.0436.46 ▼2.5235.21 ▼1.29
Add New Post /wp-admin/post-new.php1,563 ▲3722.73 ▼0.21643.73 ▼31.6656.10 ▼4.98
Media Library /wp-admin/upload.php1,422 ▲284.21 ▼0.02100.60 ▲4.7245.55 ▼1.85

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliates-wp-e-commerce/includes/class-affiliates-wpec-admin.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliates-wp-e-commerce/includes/class-affiliates-wpec-handler.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliates-wp-e-commerce/includes/class-affiliates-wpec.php:80
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliates-wp-e-commerce/includes/class-affiliates-wpec.php:80

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Referral rate setting - Here, a referral rate set at 0.2 credits affiliates with 20% commissions on sales.), #2 (Referrals created automatically for sales - Each referral is linked to its order.)
  • Tags: Too many tags (36 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

affiliates-wp-e-commerce/affiliates-wp-e-commerce.php Passed 13 tests

The primary PHP file in "Affiliates WP e-Commerce Integration" version 2.1.2 is used by WordPress to initiate all plugin functionality
82 characters long description:
Integrates Affiliates, Affiliates Pro and Affiliates Enterprise with WP e-Commerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected557 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP486228557

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity31.67
▷ Minimum class complexity14.00
▷ Maximum class complexity56.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods26
▷ Static methods26100.00%
▷ Public methods2596.15%
▷ Protected methods00.00%
▷ Private methods13.85%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants23
▷ Global constants28.70%
▷ Class constants2191.30%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.13MB with 0.09MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png105.90KB34.24KB▼ 67.67%
screenshot-1.png22.63KB6.89KB▼ 69.55%