84% affiliatewp-store-credit

Code Review | AffiliateWP - Store Credit

WordPress plugin AffiliateWP - Store Credit scored 84% from 54 tests.

About plugin

  • Plugin page: affiliatewp-store...
  • Plugin version: 2.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 30, 2014
  • Latest release: Jun 6, 2022
  • Number of updates: 41
  • Update frequency: every 67.7 days
  • Top authors: ramiabraham (39.02%)mordauk (17.07%)DrewAPicture (14.63%)tubiz (12.2%)dbeja (12.2%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active / 24,494 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.61ms] Passed 4 tests

A check of server-side resources used by AffiliateWP - Store Credit
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.38 ▲0.27
Dashboard /wp-admin3.32 ▲0.0145.99 ▼3.85
Posts /wp-admin/edit.php3.37 ▲0.0150.62 ▲1.23
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.62 ▼12.07
Media Library /wp-admin/upload.php3.24 ▲0.0135.10 ▲2.53

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for AffiliateWP - Store Credit
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲6813.22 ▼1.451.72 ▼0.0443.48 ▼6.34
Dashboard /wp-admin2,209 ▲185.87 ▲0.9897.31 ▼20.2538.48 ▼7.51
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0039.57 ▲0.1339.34 ▲3.84
Add New Post /wp-admin/post-new.php1,536 ▲1723.00 ▼0.21645.41 ▼51.1658.59 ▲4.93
Media Library /wp-admin/upload.php1,391 ▼04.20 ▼0.0895.47 ▼9.2139.87 ▼6.21

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 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
Please fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/affiliatewp-store-credit/includes/admin/settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliatewp-store-credit/includes/dashboard.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'AffiliateWP_Store_Credit_Base' not found in wp-content/plugins/affiliatewp-store-credit/integrations/class-edd.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'AffiliateWP_Store_Credit_Base' not found in wp-content/plugins/affiliatewp-store-credit/integrations/class-woocommerce.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/affiliatewp-store-credit/includes/admin/class-upgrades.php:29

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: store credit, affiliates, edd, woocommerce, affiliatewp...

affiliatewp-store-credit/affiliatewp-store-credit.php Passed 13 tests

"AffiliateWP - Store Credit" version 2.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
41 characters long description:
Pay AffiliateWP referrals as store credit

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
Good job! No executable or dangerous file extensions detected1,336 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP155641,4771,332
Markdown1204

PHP code Passed 2 tests

An short overview of 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.31
Average class complexity11.92
▷ Minimum class complexity3.00
▷ Maximum class complexity48.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes323.08%
▷ Concrete classes1076.92%
▷ Final classes110.00%
Methods120
▷ Static methods10.83%
▷ Public methods7159.17%
▷ Protected methods3226.67%
▷ Private methods1714.17%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants4
▷ Global constants4100.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
There are no PNG files in this plugin