10% affiliasale

Code Review | WordPress AffiliASale

WordPress plugin WordPress AffiliASale scored10%from 54 tests.

About plugin

  • Plugin page: affiliasale
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.1.0
  • WordPress version: 6.3.1
  • First release: Dec 22, 2014
  • Latest release: Dec 23, 2014
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: bmarshall511 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,183 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Parse error in wp-content/plugins/affiliasale/lib/wordpress-affiliasale.class.php+695
    syntax error, unexpected 'public' (T_PUBLIC), expecting case (T_CASE) or default (T_DEFAULT) or '}'

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.54ms] Passed 4 tests

An overview of server-side resources used by WordPress AffiliASale
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.48 ▼2.06
Dashboard /wp-admin3.31 ▲0.0045.30 ▼5.42
Posts /wp-admin/edit.php3.36 ▲0.0044.05 ▼2.29
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.08 ▼20.40
Media Library /wp-admin/upload.php3.23 ▲0.0033.36 ▼0.29

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 54 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WordPress AffiliASale
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.64 ▼0.514.79 ▲2.8943.80 ▼6.42
Dashboard /wp-admin2,209 ▲244.82 ▼1.05103.64 ▼1.0739.32 ▼3.63
Posts /wp-admin/edit.php2,092 ▲242.04 ▲0.0337.49 ▲2.9433.20 ▼2.71
Add New Post /wp-admin/post-new.php1,514 ▼817.48 ▼5.72672.87 ▲68.8754.73 ▼1.27
Media Library /wp-admin/upload.php1,388 ▼34.17 ▼0.0694.49 ▼8.3342.34 ▼0.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall correctly, leaving 54 files (0.81MB) in the plugin directory
    • (new file) build/fonts/index.php
    • (new file) LICENSE
    • (new file) build/css/style.css
    • (new file) build/fonts/FontAwesome.otf
    • (new file) build/fonts/fontawesome-webfont.woff
    • (new file) build/fonts/fontawesome-webfont.eot
    • (new file) build/fonts/fontawesome-webfont.svg
    • (new file) build/css-dev/style.css
    • (new file) Gruntfile.js
    • (new file) build/fonts/fontawesome-webfont.ttf
    • ...
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/affiliasale/inc/admin-sidebar.tpl.php
    • > /wp-content/plugins/affiliasale/wordpress-affiliasale.php
    • > /wp-content/plugins/affiliasale/inc/settings.tpl.php
    • > /wp-content/plugins/affiliasale/inc/reports.tpl.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliasale/inc/reports_merchant-status.tpl.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliasale/inc/reports_traffic.tpl.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliasale/inc/reports_activity-details.tpl.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliasale/inc/reports_activity-summary.tpl.php:4
    • > PHP Parse error
      syntax error, unexpected 'public' (T_PUBLIC), expecting case (T_CASE) or default (T_DEFAULT) or '}' in wp-content/plugins/affiliasale/lib/wordpress-affiliasale.class.php on line 695

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: shareasale

affiliasale/wordpress-affiliasale.php 85% from 13 tests

The primary PHP file in "WordPress AffiliASale" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("affiliasale.php" instead of "wordpress-affiliasale.php")
  • Description: The description should be shorter than 140 characters (currently 291 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected5,269 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
CSS25575891,960
Sass1497301,561
PHP122096081,077
SVG100520
JavaScript11524103
JSON10022
YAML13018
Ruby16138

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity39.50
▷ Minimum class complexity18.00
▷ Maximum class complexity61.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods47
▷ Static methods12.13%
▷ Public methods3370.21%
▷ Protected methods00.00%
▷ Private methods1429.79%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected