62% fast-affiliate

Code Review | Fast Affiliate

WordPress plugin Fast Affiliate scored62%from 54 tests.

About plugin

  • Plugin page: fast-affiliate
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Mar 10, 2017
  • Latest release: Aug 23, 2017
  • Number of updates: 11
  • Update frequency: every 13.8 days
  • Top authors: fastaffiliate (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,438 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.34MB] [CPU: ▼7.12ms] 75% from 4 tests

Analyzing server-side resources used by Fast Affiliate
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 10,036.95ms on /wp-admin/admin.php?page=fast_affiliate_stock)
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4341.58 ▼5.71
Dashboard /wp-admin3.80 ▲0.4946.79 ▼2.37
Posts /wp-admin/edit.php3.85 ▲0.4945.24 ▼3.50
Add New Post /wp-admin/post-new.php5.88 ▼0.0173.09 ▼16.91
Media Library /wp-admin/upload.php3.66 ▲0.4338.37 ▲7.23
Performance /wp-admin/admin.php?page=fast_affiliate_performance3.6335.30
Configuration /wp-admin/admin.php?page=fast_affiliate_admin3.6329.89
Stock /wp-admin/admin.php?page=fast_affiliate_stock3.6210,036.95

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 72 new files
Database: 1 new table, 7 new options
New tables
wp_f_a_link_performance
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_fast_affiliate_widget2

Browser metrics Passed 4 tests

This is an overview of browser requirements for Fast Affiliate
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲17313.70 ▼0.8810.90 ▲8.7238.26 ▼8.87
Dashboard /wp-admin2,252 ▲735.93 ▲0.9896.58 ▼19.9040.48 ▼5.86
Posts /wp-admin/edit.php2,135 ▲462.08 ▲0.0936.07 ▼1.7833.94 ▲0.02
Add New Post /wp-admin/post-new.php6,567 ▲5,02528.50 ▲10.25961.14 ▲306.4537.74 ▼13.64
Media Library /wp-admin/upload.php1,425 ▲344.22 ▼0.0298.47 ▼1.9742.02 ▼0.59
Performance /wp-admin/admin.php?page=fast_affiliate_performance8092.1526.7731.47
Configuration /wp-admin/admin.php?page=fast_affiliate_admin8372.0925.4124.51
Stock /wp-admin/admin.php?page=fast_affiliate_stock8062.1426.0827.17

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_f_a_link_performance
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_fast_affiliate_widget2
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fast_affiliate_stock
    • > Warning in wp-content/plugins/fast-affiliate/admin/fast-affiliate-stock.php+28
    count(): Parameter must be an array or an object that implements Countable

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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/fast-affiliate/admin/partials/fast-affiliate-admin-display.php
    • > /wp-content/plugins/fast-affiliate/public/partials/fast-affiliate-public-display.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/fast-affiliate/includes/fast-affiliate-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/fast-affiliate/includes/fast-affiliate-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/fast-affiliate/includes/class-fast-affiliate-activator.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5 in fast-affiliate/assets to your readme.txt
You can look at the official readme.txt

fast-affiliate/fast_affiliate.php 92% from 13 tests

The entry point to "Fast Affiliate" version 1.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("fast-affiliate.php" instead of "fast_affiliate.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected3,180 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP305047212,120
CSS26323405
PO File2152198332
JavaScript38929323

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity3.12
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.63
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions67
▷ Named functions67100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 2.22MB with 1.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-4.png422.92KB131.78KB▼ 68.84%
assets/banner-772x250.png25.87KB9.83KB▼ 62.00%
includes/images/fnac_es.png2.58KB1.27KB▼ 50.72%
includes/images/nologo.png1.89KB0.89KB▼ 52.72%
assets/icon-128x128.png8.21KB3.26KB▼ 60.26%