90% affiliatewp-affiliate-product-rates

Code Review | AffiliateWP - Affiliate Product Rates

WordPress plugin AffiliateWP - Affiliate Product Rates scored90%from 54 tests.

About plugin

  • Plugin page: affiliatewp-affil...
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Jan 29, 2015
  • Latest release: May 3, 2023
  • Number of updates: 26
  • Update frequency: every 116.0 days
  • Top authors: sumobi (38.46%)DrewAPicture (26.92%)paninapress (23.08%)dbeja (19.23%)tubiz (7.69%)

Code review

54 tests

User reviews

2 reviews

Install metrics

2,000+ active /29,095 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 gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.04ms] Passed 4 tests

Analyzing server-side resources used by AffiliateWP - Affiliate Product Rates
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0548.85 ▲10.45
Dashboard /wp-admin3.36 ▲0.0648.45 ▼3.24
Posts /wp-admin/edit.php3.47 ▲0.1250.10 ▼0.19
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.69 ▼6.35
Media Library /wp-admin/upload.php3.28 ▲0.0536.59 ▼2.38

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for AffiliateWP - Affiliate Product Rates
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲614.38 ▲0.101.64 ▼0.4643.51 ▲0.02
Dashboard /wp-admin2,198 ▲215.49 ▼0.1987.35 ▼8.0638.47 ▼1.21
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0741.20 ▲1.8535.66 ▲2.15
Add New Post /wp-admin/post-new.php1,529 ▼823.67 ▲5.69675.38 ▲34.6363.89 ▼8.98
Media Library /wp-admin/upload.php1,397 ▼34.24 ▲0.06101.94 ▲3.9244.51 ▲2.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
The official readme.txt might help

affiliatewp-affiliate-product-rates/affiliatewp-affiliate-product-rates.php Passed 13 tests

The entry point to "AffiliateWP - Affiliate Product Rates" version 1.2.1 is a PHP file that has certain tags in its header comment area
40 characters long description:
Set per-affiliate product referral rates

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
Everything looks great! No dangerous files found in this plugin4,171 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript25644022,598
PHP93431,083960
CSS212419562
PO File1161751

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity13.29
▷ Minimum class complexity5.00
▷ Maximum class complexity31.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes228.57%
▷ Concrete classes571.43%
▷ Final classes120.00%
Methods82
▷ Static methods22.44%
▷ Public methods4251.22%
▷ Protected methods2226.83%
▷ Private methods1821.95%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants4
▷ Global constants4100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/select2x2.png0.83KB0.77KB▼ 6.15%
assets/css/select2.png0.60KB0.99KB0.00%