90% affiliatewp-allowed-products

Code Review | AffiliateWP - Allowed Products

WordPress plugin AffiliateWP - Allowed Products scored90%from 54 tests.

About plugin

  • Plugin page: affiliatewp-allow...
  • Plugin version: 1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: Mar 21, 2015
  • Latest release: Jun 6, 2022
  • Number of updates: 19
  • Update frequency: every 138.6 days
  • Top authors: DrewAPicture (36.84%)dbeja (26.32%)sumobi (26.32%)mordauk (15.79%)tubiz (10.53%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /22,312 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.04MB] [CPU: ▼7.12ms] Passed 4 tests

Analyzing server-side resources used by AffiliateWP - Allowed Products
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.58 ▲1.26
Dashboard /wp-admin3.36 ▲0.0150.93 ▼14.48
Posts /wp-admin/edit.php3.48 ▲0.1249.53 ▼0.22
Add New Post /wp-admin/post-new.php5.94 ▲0.0587.52 ▼10.65
Media Library /wp-admin/upload.php3.29 ▲0.0537.50 ▼3.14

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by AffiliateWP - Allowed Products
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲4614.36 ▲0.011.86 ▲0.1340.40 ▼2.15
Dashboard /wp-admin2,198 ▲185.66 ▼0.0284.74 ▼12.2441.05 ▼20.15
Posts /wp-admin/edit.php2,103 ▼01.95 ▼0.0635.64 ▼4.6738.57 ▲2.06
Add New Post /wp-admin/post-new.php1,531 ▲523.18 ▲0.16668.30 ▼64.5053.77 ▲5.52
Media Library /wp-admin/upload.php1,403 ▲34.15 ▼0.10107.42 ▼0.9246.32 ▼1.03

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

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 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 just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 20 tag instead of maximum 10
The official readme.txt is a good inspiration

affiliatewp-allowed-products/affiliatewp-allowed-products.php Passed 13 tests

This is the main PHP file of "AffiliateWP - Allowed Products" version 1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
52 characters long description:
Allows only specific products to generate commission

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
There were no executable files found in this plugin763 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP82621,045733
Markdown120030

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.67
▷ Minimum class complexity5.00
▷ Maximum class complexity13.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes233.33%
▷ Concrete classes466.67%
▷ Final classes125.00%
Methods72
▷ Static methods22.78%
▷ Public methods3345.83%
▷ Protected methods2230.56%
▷ Private methods1723.61%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants4
▷ Global constants4100.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
PNG images were not found in this plugin