62% really-simple-affiliate-program

Code Review | Really Simple Affiliate Program

WordPress plugin Really Simple Affiliate Program scored 62% from 54 tests.

About plugin

  • Plugin page: really-simple-aff...
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.0
  • WordPress version: 6.3.1
  • First release: Mar 10, 2019
  • Latest release: May 13, 2022
  • Number of updates: 13
  • Update frequency: every 89.2 days
  • Top authors: likebuttonsoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,046 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.61MB] [CPU: ▼12.56ms] Passed 4 tests

Server-side resources used by Really Simple Affiliate Program
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▼0.0033.04 ▼12.67
Dashboard /wp-admin3.41 ▲0.1080.00 ▲25.25
Posts /wp-admin/edit.php3.53 ▲0.1765.31 ▲13.28
Add New Post /wp-admin/post-new.php3.26 ▼2.6240.59 ▼55.34
Media Library /wp-admin/upload.php3.31 ▲0.0842.71 ▲4.48
Affiliate Program /wp-admin/options-general.php?page=really-simple-affiliate-program3.2833.72

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: 2 new tables, 15 new options
New tables
wp_rsap_referral_log
wp_rsap_affiliates
New WordPress options
rsap_option_social_blurb_instagram
theysaidso_admin_options
widget_recent-comments
db_upgraded
rsap_db_version
widget_theysaidso_widget
rsap_option_social_blurb_email
can_compress_scripts
widget_recent-posts
rsap_option_social_image
...

Browser metrics Passed 4 tests

An overview of browser requirements for Really Simple Affiliate Program
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,027 ▲22715.14 ▲0.707.69 ▲5.7743.46 ▼2.11
Dashboard /wp-admin2,346 ▲1406.43 ▲1.56124.97 ▲11.4146.04 ▲2.44
Posts /wp-admin/edit.php2,255 ▲1633.40 ▲1.3554.45 ▲16.9935.40 ▲0.17
Add New Post /wp-admin/post-new.php1,533 ▲1923.23 ▲5.75679.63 ▼11.7039.25 ▼18.97
Media Library /wp-admin/upload.php1,389 ▲14.22 ▲0.0196.15 ▼17.7648.51 ▲1.99
Affiliate Program /wp-admin/options-general.php?page=really-simple-affiliate-program1,2063.0147.4877.55

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_rsap_referral_log
    • wp_rsap_affiliates
  • The uninstall procedure has failed, leaving 15 options in the database
    • rsap_option_social_blurb_email
    • widget_theysaidso_widget
    • rsap_option_enable_ip_restriction
    • rsap_option_days_before_new_submission_allowed
    • rsap_option_main_url
    • rsap_option_social_blurb_facebook
    • can_compress_scripts
    • theysaidso_admin_options
    • rsap_option_social_blurb_instagram
    • widget_recent-posts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=really-simple-affiliate-program
    • > Warning in wp-content/plugins/really-simple-affiliate-program/really-simple-affiliate-program.php+622
    Use of undefined constant RSSFI_TEXT - assumed 'RSSFI_TEXT' (this will throw an Error in a future version of PHP)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: nextAffiliateCode in wp-content/plugins/really-simple-affiliate-program/affiliateCodeEmailTemplate.php on line 585
    • > PHP Notice
      Undefined variable: firstname in wp-content/plugins/really-simple-affiliate-program/affiliateCodeEmailTemplate.php on line 583
    • > PHP Notice
      Undefined variable: socialblurb_emailtext in wp-content/plugins/really-simple-affiliate-program/affiliateCodeEmailTemplate.php on line 591
    • > PHP Notice
      Undefined variable: referralUrl in wp-content/plugins/really-simple-affiliate-program/affiliateCodeEmailTemplate.php on line 589
    • > PHP Notice
      Undefined variable: websiteUrl in wp-content/plugins/really-simple-affiliate-program/affiliateCodeEmailTemplate.php on line 615
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/really-simple-affiliate-program/really-simple-affiliate-program.php:130
    • > PHP Notice
      Undefined variable: referralUrl in wp-content/plugins/really-simple-affiliate-program/affiliateCodeEmailTemplate.php on line 589

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=really-simple-affiliate-program
    • > Network (severe)
    wp-content/plugins/really-simple-affiliate-program/img/no-image.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: You can take inspiration from this readme.txt

really-simple-affiliate-program/really-simple-affiliate-program.php 92% from 13 tests

The main PHP script in "Really Simple Affiliate Program" version 2.1.1 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 294 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,032 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2207181942
JavaScript2211890

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions1588.24%
▷ Anonymous functions211.76%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin