78% overstock-affiliate-links

Code Review | Overstock Affiliate Links

WordPress plugin Overstock Affiliate Links scored 78% from 54 tests.

About plugin

  • Plugin page: overstock-affilia...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Nov 4, 2015
  • Latest release: Nov 19, 2015
  • Number of updates: 33
  • Update frequency: every 0.5 days
  • Top authors: travishoki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,035 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼141.87ms] Passed 4 tests

This is a short check of server-side resources used by Overstock Affiliate Links
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.10 ▲0.3837.10 ▲16.20
Dashboard /wp-admin3.39 ▲0.3348.26 ▲5.84
Posts /wp-admin/edit.php3.44 ▲0.3334.92 ▼10.17
Add New Post /wp-admin/post-new.php5.69 ▲0.2593.56 ▼565.20
Media Library /wp-admin/upload.php3.27 ▲0.2734.01 ▲2.04
sandbox /wp-admin/admin.php?page=ostk-sandbox3.2230.58
contact /wp-admin/admin.php?page=ostk-contact3.2424.00
documentation /wp-admin/admin.php?page=ostk-documentation3.2230.88
Overstock Affiliate Links /wp-admin/admin.php?page=ostk-home3.2527.69

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 3,432 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Overstock Affiliate Links
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,018 ▲42217.23 ▲1.6417.29 ▲8.6043.74 ▼7.46
Dashboard /wp-admin3,090 ▲1567.04 ▲1.10143.79 ▼2.31137.27 ▲30.30
Posts /wp-admin/edit.php2,870 ▲1313.24 ▲0.4071.77 ▲9.2191.07 ▼1.37
Add New Post /wp-admin/post-new.php3,987 ▲2,30416.18 ▼2.53472.25 ▲92.30135.22 ▲22.06
Media Library /wp-admin/upload.php1,875 ▲625.65 ▲0.63135.22 ▼10.06147.42 ▲25.89
sandbox /wp-admin/admin.php?page=ostk-sandbox1,2592.7856.1979.57
contact /wp-admin/admin.php?page=ostk-contact1,2122.7854.6272.35
documentation /wp-admin/admin.php?page=ostk-documentation1,2552.7955.4782.41
Overstock Affiliate Links /wp-admin/admin.php?page=ostk-home1,4492.8164.9591.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=ostk-sandbox
    • > Notice in wp-content/plugins/overstock-affiliate-links/sandbox_page.php+19
    Undefined variable: shortcode
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ostk-documentation
    • > Notice in wp-content/plugins/overstock-affiliate-links/doc_page.php+17
    Undefined index: pattern

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
The following issues need your attention
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/overstock-affiliate-links/admin_page.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/overstock-affiliate-links/functions.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/overstock-affiliate-links/functions.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/overstock-affiliate-links/functions.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
No plugin tags provided

overstock-affiliate-links/overstock-shortcode.php 85% from 13 tests

"Overstock Affiliate Links" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 143 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("overstock-affiliate-links.php" instead of "overstock-shortcode.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Please fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/overstock-affiliate-links/css/src/node_modules/less/gradlew.bat
198,891 lines of code in 2,143 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1,15122,76836,213116,718
JSON31538039,592
Markdown1798,368021,783
LESS3461,2603569,376
CSS8191944,724
PHP91171531,675
HTML58131,651
XML700651
SVG200644
diff1313588
Perl187170582
YAML352211326
Gradle15314280
Bourne Again Shell12021123
DOS Batch124264
make416039
Bourne Shell15227
C17423
Handlebars13019
Lisp1006

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity9.50
▷ Minimum class complexity3.00
▷ Maximum class complexity22.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions46
▷ Named functions46100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
13 PNG files occupy 0.21MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
api/images/overstock-icon.png1.24KB0.53KB▼ 57.42%
css/src/node_modules/hawk/images/logo.png70.05KB21.07KB▼ 69.93%
css/src/node_modules/less/test/data/data-uri-fail.png51.19KB26.81KB▼ 47.62%
api/images/overstock-arrows.png1.87KB0.75KB▼ 59.98%
images/overstock-icon.png1.24KB0.53KB▼ 57.42%