83% affiliatewp-affiliate-area-shortcodes

Code Review | WordPress Affiliate Program Plugin Shortcodes by AffiliateWP

WordPress plugin WordPress Affiliate Program Plugin Shortcodes by AffiliateWP scored 83% from 54 tests.

About plugin

  • Plugin page: affiliatewp-affil...
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 3, 2015
  • Latest release: Jan 19, 2023
  • Number of updates: 27
  • Update frequency: every 107.7 days
  • Top authors: sumobi (70.37%)dbeja (18.52%)DrewAPicture (14.81%)tubiz (7.41%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active / 34,867 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by WordPress Affiliate Program Plugin Shortcodes by AffiliateWP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0636.58 ▼3.77
Dashboard /wp-admin3.36 ▲0.0646.08 ▼1.77
Posts /wp-admin/edit.php3.47 ▲0.1248.53 ▲2.29
Add New Post /wp-admin/post-new.php5.94 ▲0.05104.99 ▲4.36
Media Library /wp-admin/upload.php3.28 ▲0.0536.74 ▲3.19

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Affiliate Program Plugin Shortcodes by AffiliateWP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲9313.24 ▼1.554.90 ▲3.1137.36 ▼11.75
Dashboard /wp-admin2,209 ▲214.85 ▼0.04110.21 ▲2.6342.43 ▼0.04
Posts /wp-admin/edit.php2,095 ▲62.00 ▼0.0040.20 ▼0.1235.73 ▲0.60
Add New Post /wp-admin/post-new.php1,526 ▼723.07 ▼0.06692.45 ▲67.2064.42 ▲9.40
Media Library /wp-admin/upload.php1,391 ▲64.23 ▲0.0396.00 ▼10.3739.75 ▼4.13

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/affiliatewp-affiliate-area-shortcodes/includes/class-shortcodes.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt is a good inspiration

affiliatewp-affiliate-area-shortcodes/affiliatewp-affiliate-area-shortcodes.php 85% from 13 tests

The main PHP file in "WordPress Affiliate Program Plugin Shortcodes by AffiliateWP" ver. 1.3.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin1,314 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP84131,1821,027
CSS1330179
SVG300108

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity17.43
▷ Minimum class complexity5.00
▷ Maximum class complexity70.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes228.57%
▷ Concrete classes571.43%
▷ Final classes120.00%
Methods99
▷ Static methods22.02%
▷ Public methods5959.60%
▷ Protected methods2222.22%
▷ Private methods1818.18%
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

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.10MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/lib/affwp/images/affwp-banner-image.png20.75KB20.76KB0.00%
includes/lib/affwp/images/affwp-banner-image-2x.png86.74KB86.76KB0.00%