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

Code Review | Add & Replace Affiliate Links for Amazon

WordPress plugin Add & Replace Affiliate Links for Amazon scored 78% 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: 5.9.2
  • 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

8 reviews

Install metrics

1,000+ active / 6,638 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼319.84ms] Passed 4 tests

An overview of server-side resources used by Add & Replace Affiliate Links for Amazon
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.17114.31 ▲60.54
Dashboard /wp-admin3.52 ▲0.1236.91 ▲0.21
Posts /wp-admin/edit.php3.75 ▲0.1141.51 ▼74.52
Add New Post /wp-admin/post-new.php6.99 ▲0.02103.30 ▼1,197.95
Media Library /wp-admin/upload.php3.40 ▲0.1130.27 ▼7.11
Updated Pages /wp-admin/admin.php?page=uralp-upd-amazon-updated3.3755.77
Update Links /wp-admin/admin.php?page=uralp-upd-amazon-plugin3.4042.18

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 12 new files
Database: 3 new tables, no new options
New tables
wp_upd_amazon_jobs_log
wp_upd_amazon_updated_pages
wp_upd_amazon_plugin

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add & Replace Affiliate Links for Amazon
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,817 ▲7516.18 ▲0.445.79 ▼0.312.38 ▲0.18
Dashboard /wp-admin2,926 ▲686.11 ▼0.09137.89 ▲1.63159.85 ▼5.63
Posts /wp-admin/edit.php2,725 ▲313.23 ▼0.0063.87 ▼1.23142.16 ▼4.99
Add New Post /wp-admin/post-new.php1,690 ▲2918.10 ▲2.54411.61 ▼30.86156.34 ▲5.11
Media Library /wp-admin/upload.php1,732 ▲345.55 ▲0.02141.85 ▲2.10203.76 ▲5.04
Updated Pages /wp-admin/admin.php?page=uralp-upd-amazon-updated1,0022.4267.42116.71
Update Links /wp-admin/admin.php?page=uralp-upd-amazon-plugin1,5302.7866.82369.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_upd_amazon_jobs_log

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)
Almost there, just fix the following server-side errors
    • > 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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
    • > 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: Call to undefined function submit_button() in wp-content/plugins/add-replace-affiliate-links-for-amazon/templates/schedule-settings.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
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 need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (No screenshots available)
You can take inspiration from this readme.txt

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

This is the main PHP file of "Add & Replace Affiliate Links for Amazon" version 1.0.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal 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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
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

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues 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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
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%