84% affiliate-solution

Code Review | AFFILIATE Solution

WordPress plugin AFFILIATE Solution scored 84% from 53 tests.

About plugin

  • Plugin page: affiliate-solution
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.0
  • WordPress version: 5.8.1
  • First release: Oct 22, 2018
  • Latest release: Dec 10, 2018
  • Number of updates: 10
  • Update frequency: every 5.1 days
  • Top authors: essitco (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 487 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼255.70ms] Passed 4 tests

Server-side resources used by AFFILIATE Solution
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.06 ▲0.3441.51 ▲16.40
Dashboard /wp-admin3.29 ▲0.2452.18 ▲6.93
Posts /wp-admin/edit.php3.40 ▲0.2955.72 ▲14.62
Add New Post /wp-admin/post-new.php5.65 ▲0.22102.70 ▼1,045.84
Media Library /wp-admin/upload.php3.23 ▲0.2341.80 ▲1.48
Add Store /wp-admin/post-new.php?post_type=store3.3655.82
Add Offer /wp-admin/post-new.php?post_type=offer3.4459.11
Affiliate Solution /wp-admin/options-general.php?page=essitco_manage_channels3.2039.20
Store Category /wp-admin/edit-tags.php?taxonomy=store_category&post_type=store3.2339.69
Offer Category /wp-admin/edit-tags.php?taxonomy=offer_category&post_type=offer3.2339.94
Stores /wp-admin/edit.php?post_type=store3.2744.98
Offers /wp-admin/edit.php?post_type=offer3.2740.83

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 20 new files
Database: no new tables, 2 new options
New WordPress options
widget_essitco_ams_offer_widget
widget_essitco_ams_store_widget

Browser metrics Passed 4 tests

Checking browser requirements for AFFILIATE Solution
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,779 ▲17315.98 ▲0.5311.81 ▲0.2274.51 ▲27.20
Dashboard /wp-admin3,043 ▲1905.96 ▼0.08136.22 ▲6.49101.40 ▼5.83
Posts /wp-admin/edit.php2,793 ▲872.70 ▼0.0068.28 ▲3.2184.70 ▼15.16
Add New Post /wp-admin/post-new.php1,710 ▲12218.79 ▼3.16357.83 ▲84.54107.13 ▲3.92
Media Library /wp-admin/upload.php1,859 ▲875.01 ▲0.02153.13 ▲8.08116.48 ▼6.44
Add Store /wp-admin/post-new.php?post_type=store3,3189.05223.36135.41
Add Offer /wp-admin/post-new.php?post_type=offer3,6498.93237.24123.54
Affiliate Solution /wp-admin/options-general.php?page=essitco_manage_channels1,2002.0960.2775.33
Store Category /wp-admin/edit-tags.php?taxonomy=store_category&post_type=store1,7912.5160.5667.85
Offer Category /wp-admin/edit-tags.php?taxonomy=offer_category&post_type=offer1,7882.4961.7366.02
Stores /wp-admin/edit.php?post_type=store1,5132.6462.1271.02
Offers /wp-admin/edit.php?post_type=offer1,5082.6363.3668.90

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 2 options
    • widget_essitco_ams_offer_widget
    • widget_essitco_ams_store_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliate-solution/affiliate-solution.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/affiliate-solution/templates/single-store.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/affiliate-solution/admin/features.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/affiliate-solution/templates/archive-offer.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/affiliate-solution/admin/AMS_Widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/affiliate-solution/templates/offer-loop.php:1
    • > PHP Notice
      Undefined variable: offers in wp-content/plugins/affiliate-solution/templates/offer-loop.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/affiliate-solution/templates/archive-store.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliate-solution/admin/AMS_shortcodes.php:2

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

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (screenshot-1.png)
Please take inspiration from this readme.txt

affiliate-solution/affiliate-solution.php Passed 13 tests

This is the main PHP file of "AFFILIATE Solution" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
61 characters long description:
Affiliate Solution for Commission Junction, Linkshare, Vglink

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,533 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP11109201,220
CSS344311
JavaScript1052

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity4.50
▷ Minimum class complexity4.00
▷ Maximum class complexity5.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin