68% add-replace-affiliate-links-for-amazon

Code Review | Add & Replace Affiliate Links for Amazon

WordPress plugin Add & Replace Affiliate Links for Amazon scored68%from 54 tests.

About plugin

  • Plugin page: add-replace-affil...
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.8
  • WordPress version: 6.3.1
  • First release: Jan 5, 2020
  • Latest release: Feb 10, 2022
  • Number of updates: 16
  • Update frequency: every 48.1 days
  • Top authors: hekkup (56.25%)thewebsiteflip (50%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active /9,333 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.51ms] Passed 4 tests

This is a short check of server-side resources used by Add & Replace Affiliate Links for Amazon
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.70 ▼16.89
Dashboard /wp-admin3.41 ▲0.1144.68 ▼5.64
Posts /wp-admin/edit.php3.52 ▲0.1746.18 ▼1.91
Add New Post /wp-admin/post-new.php5.99 ▲0.1189.02 ▼1.11
Media Library /wp-admin/upload.php3.33 ▲0.1136.31 ▼1.59
Update Links /wp-admin/admin.php?page=uralp-upd-amazon-plugin3.3339.40
Updated Pages /wp-admin/admin.php?page=uralp-upd-amazon-updated3.3033.15

Server storage [IO: ▲0.10MB] [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: 12 new files
Database: 3 new tables, 6 new options
New tables
wp_upd_amazon_plugin
wp_upd_amazon_updated_pages
wp_upd_amazon_jobs_log
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Add & Replace Affiliate Links for Amazon
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲11713.65 ▼0.682.03 ▼0.1840.03 ▼9.22
Dashboard /wp-admin2,233 ▲455.79 ▼0.1096.63 ▼20.3540.74 ▼7.37
Posts /wp-admin/edit.php2,116 ▲242.06 ▲0.0639.99 ▲2.7536.14 ▲2.60
Add New Post /wp-admin/post-new.php1,563 ▲3023.23 ▼0.03666.14 ▼16.1555.33 ▼8.24
Media Library /wp-admin/upload.php1,418 ▲274.23 ▼0.0495.92 ▼8.6942.50 ▲0.72
Update Links /wp-admin/admin.php?page=uralp-upd-amazon-plugin1,1432.1533.1265.43
Updated Pages /wp-admin/admin.php?page=uralp-upd-amazon-updated7992.0221.8725.85

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_upd_amazon_jobs_log
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=uralp-upd-amazon-plugin
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/add-replace-affiliate-links-for-amazon/upd-amazon.php+291
    Trying to get property 'is_old' of non-object

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
Please fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function submit_button() in wp-content/plugins/add-replace-affiliate-links-for-amazon/templates/schedule-settings.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'URALP_UpdAmazonPlugin' not found in wp-content/plugins/add-replace-affiliate-links-for-amazon/templates/upd-amazon-plugin.php:56
    • > PHP Fatal error
      Uncaught Error: Class 'URALP_UpdAmazonPlugin' not found in wp-content/plugins/add-replace-affiliate-links-for-amazon/templates/updated-records.php:4

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (No screenshots available)
Please take inspiration from this readme.txt

add-replace-affiliate-links-for-amazon/upd-amazon-plugin.php 92% from 13 tests

Analyzing the main PHP file in "Add & Replace Affiliate Links for Amazon" version 1.0.6
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-replace-affiliate-links-for-amazon.php" instead of "upd-amazon-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected1,225 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP7133311,225

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity69.00
▷ Minimum class complexity69.00
▷ Maximum class complexity69.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods1789.47%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions1178.57%
▷ Anonymous functions321.43%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.04MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/rating.png4.84KB4.55KB▼ 5.84%
images/websiteflip-logo.png39.66KB39.82KB0.00%