62% affiliator-lite

Code Review | Affiliator

WordPress plugin Affiliator scored62%from 54 tests.

About plugin

  • Plugin page: affiliator-lite
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.2-4.7.0
  • WordPress version: 6.3.1
  • First release: Jun 26, 2015
  • Latest release: Jan 16, 2017
  • Number of updates: 28
  • Update frequency: every 20.4 days
  • Top authors: basdog22 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,115 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.29MB] [CPU: ▼28.64ms] Passed 4 tests

Analyzing server-side resources used by Affiliator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.05 ▼0.4015.81 ▼23.69
Dashboard /wp-admin3.49 ▲0.1937.31 ▼13.24
Posts /wp-admin/edit.php3.43 ▲0.0732.61 ▼14.33
Add New Post /wp-admin/post-new.php4.89 ▼1.0045.66 ▼63.31
Media Library /wp-admin/upload.php3.52 ▲0.2940.34 ▲9.64
Affiliate Προγράμματα /wp-admin/admin.php?page=affiliator-plugin-sites3.4631.61
Affiliator /wp-admin/admin.php?page=affiliator-plugin-menu3.5033.47
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=merchants3.5138.32
Affiliate Δίκτυα /wp-admin/admin.php?page=affiliator-plugin-networks3.4632.76
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=merchants3.5135.54
Εισαγωγή Προϊόντων /wp-admin/admin.php?page=affiliator-plugin-products3.4631.34
Add New /wp-admin/post-new.php?post_type=networks3.6352.78
Δίκτυα /wp-admin/edit.php?post_type=networks3.4333.29
Add New /wp-admin/post-new.php?post_type=merchants3.6556.79
Προγράμματα /wp-admin/edit.php?post_type=merchants3.4327.84

Server storage [IO: ▲0.12MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
general_settings
can_compress_scripts
affiliator_texts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
affiliator_auto_post
db_upgraded
category_children

Browser metrics Passed 4 tests

Affiliator: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲20313.15 ▼1.431.77 ▼0.3537.55 ▼10.96
Dashboard /wp-admin2,313 ▲1255.81 ▲0.68104.63 ▲0.6340.79 ▼1.85
Posts /wp-admin/edit.php2,202 ▲1131.99 ▼0.0336.58 ▲1.9340.37 ▲6.00
Add New Post /wp-admin/post-new.php1,507 ▼1322.45 ▼0.74597.69 ▼30.1631.83 ▼17.92
Media Library /wp-admin/upload.php1,498 ▲1104.23 ▲0.0698.23 ▲3.0443.12 ▲0.58
Affiliate Προγράμματα /wp-admin/admin.php?page=affiliator-plugin-sites9092.0322.0825.10
Affiliator /wp-admin/admin.php?page=affiliator-plugin-menu1,4013.4553.5833.47
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=merchants1,5562.2929.7437.28
Affiliate Δίκτυα /wp-admin/admin.php?page=affiliator-plugin-networks8881.9921.9726.27
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=merchants1,4142.2828.8135.02
Εισαγωγή Προϊόντων /wp-admin/admin.php?page=affiliator-plugin-products9022.0425.8126.65
Add New /wp-admin/post-new.php?post_type=networks2,4087.73169.0269.22
Δίκτυα /wp-admin/edit.php?post_type=networks1,7082.0434.1634.32
Add New /wp-admin/post-new.php?post_type=merchants2,6057.91175.6464.02
Προγράμματα /wp-admin/edit.php?post_type=merchants1,2211.9332.5532.31

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/affiliator-lite/lib/affiliator.php+288
    Undefined index: name
  • The uninstall procedure has failed, leaving 10 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • affiliator_texts
    • can_compress_scripts
    • category_children
    • widget_recent-posts
    • affiliator_auto_post
    • db_upgraded
    • general_settings

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=affiliator-plugin-products
    • > Notice in wp-content/plugins/affiliator-lite/lib/affiliator.php+802
    Undefined offset: 1
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=merchants
    • > Notice in wp-content/plugins/affiliator-lite/lib/affiliator.php+288
    Undefined index: name

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/affiliator-lite/templates/common/views.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/affiliator-lite/templates/archive/grid.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/affiliator-lite/templates/single/default.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/affiliator-lite/templates/single.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/affiliator-lite/templates/archive.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/affiliator-lite/affiliator.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/affiliator-lite/templates/archive/list.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/affiliator-lite/templates/archive/compact.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: affiliate, linkwise, forestview

affiliator-lite/affiliator.php 92% from 13 tests

The primary PHP file in "Affiliator" version 2.1.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("affiliator-lite.php" instead of "affiliator.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
There were no executable files found in this plugin1,822 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP103992041,665
CSS1150157

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity77.00
▷ Minimum class complexity49.00
▷ Maximum class complexity105.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods77
▷ Static methods00.00%
▷ Public methods6584.42%
▷ Protected methods00.00%
▷ Private methods1215.58%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected