10% amazon-affiliate-link-globalizer

Code Review | Amazon Affiliate Link Globalizer

WordPress plugin Amazon Affiliate Link Globalizer scored10%from 54 tests.

About plugin

  • Plugin page: amazon-affiliate-...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.4.1
  • WordPress version: 6.3.1
  • First release: Apr 4, 2013
  • Latest release: Jun 6, 2016
  • Number of updates: 12
  • Update frequency: every 96.6 days
  • Top authors: guruz (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /8,349 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/amazon-affiliate-link-globalizer/amazon-link-globalizer.php+89
    Non-static method WAALG::init_settings() should not be called statically

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.41ms] Passed 4 tests

This is a short check of server-side resources used by Amazon Affiliate Link Globalizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.43 ▼6.58
Dashboard /wp-admin3.32 ▲0.0260.17 ▲6.55
Posts /wp-admin/edit.php3.38 ▲0.0255.88 ▼0.17
Add New Post /wp-admin/post-new.php5.90 ▲0.0294.55 ▼0.13
Media Library /wp-admin/upload.php3.25 ▲0.0239.73 ▼10.76
Woboq Amazon Affiliate Link Globalizer /wp-admin/options-general.php?page=waalg3.2637.81

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Amazon Affiliate Link Globalizer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.79 ▲0.231.63 ▼0.3146.52 ▲0.94
Dashboard /wp-admin2,199 ▲195.61 ▲0.0785.86 ▼6.8440.52 ▼2.55
Posts /wp-admin/edit.php2,101 ▼22.01 ▲0.0435.14 ▲0.9133.10 ▼4.66
Add New Post /wp-admin/post-new.php1,531 ▲523.33 ▼0.21651.71 ▼37.6866.76 ▲3.19
Media Library /wp-admin/upload.php1,401 ▲74.16 ▼0.06109.79 ▼17.8745.65 ▼9.39
Woboq Amazon Affiliate Link Globalizer /wp-admin/options-general.php?page=waalg1,2022.0325.4827.93

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/amazon-affiliate-link-globalizer/uninstall.php
    • > /wp-content/plugins/amazon-affiliate-link-globalizer/settings.php
    • > /wp-content/plugins/amazon-affiliate-link-globalizer/amazon-link-globalizer.php

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 on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: amazon affiliate, amazon, amazon associates, amazon partner, amazon localizer

amazon-affiliate-link-globalizer/amazon-link-globalizer.php 85% from 13 tests

The main file in "Amazon Affiliate Link Globalizer" v. 1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("amazon-affiliate-link-globalizer.php" instead of "amazon-link-globalizer.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 329 characters long)

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
Everything looks great! No dangerous files found in this plugin308 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP44497308

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity26.00
▷ Minimum class complexity26.00
▷ Maximum class complexity26.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods325.00%
▷ Public methods866.67%
▷ Protected methods00.00%
▷ Private methods433.33%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin