78% walmart-affiliate-link

Code Review | Walmart Affiliate Link

WordPress plugin Walmart Affiliate Link scored78%from 54 tests.

About plugin

  • Plugin page: walmart-affiliate...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Jun 16, 2014
  • Latest release: Apr 12, 2016
  • Number of updates: 17
  • Update frequency: every 39.8 days
  • Top authors: tofa.wl (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

70+ active /8,136 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.31MB] [CPU: ▼16.35ms] Passed 4 tests

An overview of server-side resources used by Walmart Affiliate Link
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0134.17 ▼5.67
Dashboard /wp-admin3.33 ▼0.0148.56 ▼16.76
Posts /wp-admin/edit.php3.39 ▲0.0350.38 ▲2.76
Add New Post /wp-admin/post-new.php4.62 ▼1.2645.04 ▼45.38
Media Library /wp-admin/upload.php3.26 ▲0.0339.71 ▲2.40
Walmart Affiliate Link /wp-admin/options-general.php?page=wal-admin3.2032.35

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Walmart Affiliate Link
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.26 ▼0.971.80 ▼0.1441.42 ▼4.21
Dashboard /wp-admin2,213 ▲255.88 ▲1.0196.28 ▼22.5139.49 ▼5.01
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0341.44 ▲3.8235.02 ▼3.38
Add New Post /wp-admin/post-new.php1,517 ▼317.57 ▼5.68683.86 ▲33.9755.10 ▼3.43
Media Library /wp-admin/upload.php1,392 ▲44.23 ▼0.07106.69 ▲7.7248.88 ▲7.02
Walmart Affiliate Link /wp-admin/options-general.php?page=wal-admin9832.0128.4342.84

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wal-admin
    • > Notice in wp-content/plugins/walmart-affiliate-link/wmt_admin_page.php+31
    Trying to access array offset on value of type bool

SRP 50% 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
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/walmart-affiliate-link/wmt_link_generator.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/walmart-affiliate-link/wmt_admin_page.php:154
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/walmart-affiliate-link/tests.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: tool, link, affiliate, walmart, marketing

walmart-affiliate-link/wmt_link_generator.php 92% from 13 tests

The main PHP script in "Walmart Affiliate Link" version 1.0.5 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("walmart-affiliate-link.php" instead of "wmt_link_generator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected446 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP48430446

PHP code Passed 2 tests

This is a very shot review 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.01
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods39100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions440.00%
▷ Anonymous functions660.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin