90% affiliatewp-force-pending-referrals

Code Review | AffiliateWP - Force Pending Referrals

WordPress plugin AffiliateWP - Force Pending Referrals scored90%from 54 tests.

About plugin

  • Plugin page: affiliatewp-force...
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: Aug 11, 2014
  • Latest release: Jun 3, 2022
  • Number of updates: 16
  • Update frequency: every 178.3 days
  • Top authors: DrewAPicture (37.5%)sumobi (37.5%)dbeja (31.25%)tubiz (12.5%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active /10,587 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by AffiliateWP - Force Pending Referrals
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.57 ▼0.94
Dashboard /wp-admin3.36 ▲0.0650.23 ▼9.69
Posts /wp-admin/edit.php3.48 ▲0.1247.40 ▼1.53
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.29 ▼10.26
Media Library /wp-admin/upload.php3.29 ▲0.0535.93 ▲1.88

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by AffiliateWP - Force Pending Referrals
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4614.80 ▲0.411.81 ▼0.7543.91 ▼5.73
Dashboard /wp-admin2,212 ▲275.88 ▲1.02110.98 ▼10.1842.55 ▼0.57
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0535.31 ▼3.3433.94 ▲1.74
Add New Post /wp-admin/post-new.php1,517 ▼217.43 ▼5.72686.01 ▲4.2950.15 ▼4.05
Media Library /wp-admin/upload.php1,382 ▼94.16 ▼0.0398.63 ▼1.2442.28 ▼3.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

affiliatewp-force-pending-referrals/affiliatewp-force-pending-referrals.php Passed 13 tests

Analyzing the main PHP file in "AffiliateWP - Force Pending Referrals" version 1.2
38 characters long description:
Forces referrals to be "pending" first

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
Good job! No executable or dangerous file extensions detected645 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP6219931645

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity10.40
▷ Minimum class complexity5.00
▷ Maximum class complexity14.00
Average method complexity1.68
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes240.00%
▷ Concrete classes360.00%
▷ Final classes133.33%
Methods71
▷ Static methods22.82%
▷ Public methods3245.07%
▷ Protected methods2230.99%
▷ Private methods1723.94%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin