72% affilinet-performance-module

Code Review | affilinet Performance Ads

WordPress plugin affilinet Performance Ads scored 72% from 54 tests.

About plugin

  • Plugin page: affilinet-perform...
  • Plugin version: 1.9.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0
  • WordPress version: 6.3.1
  • First release: Jun 17, 2015
  • Latest release: May 11, 2018
  • Number of updates: 33
  • Update frequency: every 32.9 days
  • Top authors: Affilinet (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

9,000+ active / 236,935 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.10ms] Passed 4 tests

This is a short check of server-side resources used by affilinet Performance Ads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.07 ▼16.37
Dashboard /wp-admin3.35 ▲0.0448.18 ▲2.24
Posts /wp-admin/edit.php3.40 ▲0.0456.39 ▲12.23
Add New Post /wp-admin/post-new.php5.93 ▲0.0583.78 ▼5.70
Media Library /wp-admin/upload.php3.27 ▲0.0434.46 ▼0.56
Settings /wp-admin/admin.php?page=affilinet_settings3.2931.74
Start /wp-admin/admin.php?page=affilinet3.2632.49
Reporting /wp-admin/admin.php?page=affilinet_reporting3.3433.75
Signup /wp-admin/admin.php?page=affilinet_signup3.2830.59
affilinet Perf. Ads /wp-admin/options-general.php?page=affilinet_options3.2630.13

Server storage [IO: ▲1.57MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • Illegal file modification found: 1 file (0.30KB) outside of "wp-content/plugins/affilinet-performance-module/" and "wp-content/uploads/"
    • (new file) ads.txt
Filesystem: 72 new files
Database: no new tables, 8 new options
New WordPress options
widget_affilinet_performance_ad_widget
widget_recent-posts
recovery_mode_email_last_sent
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by affilinet Performance Ads
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲4914.74 ▼0.061.63 ▼0.3143.10 ▲2.78
Dashboard /wp-admin2,247 ▲475.79 ▼0.01106.70 ▼0.3987.97 ▲46.85
Posts /wp-admin/edit.php2,124 ▲352.01 ▼0.0235.33 ▲2.1335.32 ▲1.50
Add New Post /wp-admin/post-new.php1,552 ▲1817.51 ▼5.53723.24 ▼25.3558.66 ▼10.10
Media Library /wp-admin/upload.php1,429 ▲474.26 ▲0.03101.41 ▼23.7381.83 ▲23.93
Settings /wp-admin/admin.php?page=affilinet_settings7171.536.3718.61
Start /wp-admin/admin.php?page=affilinet8351.8527.0431.59
Reporting /wp-admin/admin.php?page=affilinet_reporting8252.0325.1527.09
Signup /wp-admin/admin.php?page=affilinet_signup8762.0223.7925.46
affilinet Perf. Ads /wp-admin/options-general.php?page=affilinet_options7171.536.5619.12

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
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_affilinet_performance_ad_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=affilinet_settings
    • > Error in wp-content/plugins/affilinet-performance-module/classes/Api.php+23
    Uncaught Error: Call to undefined method soapclient::__soapCall() in wp-content/plugins/affilinet-performance-module/classes/Api.php:23
    Stack trace:
    #0 wp-content/plugins/affilinet-performance-module/classes/Api.php(79): Affilinet_Api::logon()
    #1 wp-content/plugins/affilinet-performance-module/views/settings.php(6): Affilinet_Api::checkPartnershipStatus()
    #2 wp-content/plugins/affilinet-performance-module/classes/View.php(12): require_once('/var/www/wordpr...')
    #3 wp-includes/class-wp-hook.php(310): Affilinet_View::settings()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown
    • > GET request to /wp-admin/options-general.php?page=affilinet_options
    • > Error in wp-content/plugins/affilinet-performance-module/classes/Api.php+23
    Uncaught Error: Call to undefined method soapclient::__soapCall() in wp-content/plugins/affilinet-performance-module/classes/Api.php:23
    Stack trace:
    #0 wp-content/plugins/affilinet-performance-module/classes/Api.php(79): Affilinet_Api::logon()
    #1 wp-content/plugins/affilinet-performance-module/views/settings.php(6): Affilinet_Api::checkPartnershipStatus()
    #2 wp-content/plugins/affilinet-performance-module/classes/View.php(12): require_once('/var/www/wordpr...')
    #3 wp-includes/class-wp-hook.php(310): Affilinet_View::settings()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #8 {main}
    thrown

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
Please fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/affilinet-performance-module/views/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affilinet-performance-module/views/start.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/affilinet-performance-module/classes/Widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/affilinet-performance-module/views/signup.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/affilinet-performance-module/affilinet.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/affilinet-performance-module/views/reporting.php:2

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/admin.php?page=affilinet
    • > Network (severe)
    https://www.awin.com/?utm_medium=redirect&utm_source=www.affili.net - Failed to load resource: the server responded with a status of 403 ()
    • > GET request to /wp-admin/admin.php?page=affilinet_reporting
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=affilinet_reporting 228:27 Uncaught ReferenceError: affilinet_report_data_views is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: advertising, affiliate, performance marketing, banner, affilinet

affilinet-performance-module/affilinet.php 85% from 13 tests

The main PHP script in "affilinet Performance Ads" version 1.9.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 143 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("affilinet-performance-module.php" instead of "affilinet.php")

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
Success! There were no dangerous files found in this plugin22,004 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript213,0852,80612,495
PHP157032,7286,809
Markdown679002,160
PO File3200329485
JSON30046
make1426
YAML1003

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity64.64
▷ Minimum class complexity1.00
▷ Maximum class complexity389.00
Average method complexity8.18
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods195
▷ Static methods2512.82%
▷ Public methods19398.97%
▷ Protected methods00.00%
▷ Private methods21.03%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/affilinet_logo.png4.25KB1.85KB▼ 56.37%
images/affilinet_icon.png1.30KB1.36KB0.00%
images/affilinet_signet.png12.96KB6.80KB▼ 47.52%
images/affilinet_signet_small.png2.16KB1.81KB▼ 16.09%