84% purchase-button

Code Review | Purchase Button For Affiliate Link

WordPress plugin Purchase Button For Affiliate Link scored84%from 54 tests.

About plugin

  • Plugin page: purchase-button
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.9
  • WordPress version: 6.3.1
  • First release: Dec 21, 2021
  • Latest release: Aug 3, 2022
  • Number of updates: 8
  • Update frequency: every 28.2 days
  • Top authors: themepul (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /574 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.95ms] Passed 4 tests

This is a short check of server-side resources used by Purchase Button For Affiliate Link
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.48 ▲3.33
Dashboard /wp-admin3.31 ▲0.0147.24 ▼1.87
Posts /wp-admin/edit.php3.36 ▲0.0144.27 ▼3.64
Add New Post /wp-admin/post-new.php5.91 ▲0.0385.48 ▼10.01
Media Library /wp-admin/upload.php3.23 ▲0.0132.55 ▼4.28
Purchase Button /wp-admin/options-general.php?page=purchase-button-options3.2833.88

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Purchase Button For Affiliate Link: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲10113.80 ▼0.821.72 ▲0.1547.68 ▲0.93
Dashboard /wp-admin2,229 ▲385.09 ▼0.81104.45 ▼1.5640.70 ▲0.34
Posts /wp-admin/edit.php2,111 ▲192.31 ▲0.3239.21 ▼1.0432.01 ▼3.67
Add New Post /wp-admin/post-new.php1,540 ▲718.53 ▼4.63625.51 ▲1.7434.61 ▼23.48
Media Library /wp-admin/upload.php1,408 ▲234.47 ▲0.2696.84 ▼0.3539.47 ▼3.07
Purchase Button /wp-admin/options-general.php?page=purchase-button-options1,4152.6264.8327.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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)
Even though no errors were found, 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
Please fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/purchase-button/inc/purchase-btn-options-page.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/purchase-button/purchase-button.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/purchase-button/inc/data.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: affiliate button, buy now, purchase button, buy now button, demo link...

purchase-button/purchase-button.php Passed 13 tests

The main PHP file in "Purchase Button For Affiliate Link" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
101 characters long description:
This plugin for Theme or Plugin demo Purchase Affiliate Link. you can easily add your Affiliate link.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin232 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP51031206
CSS13020
JavaScript1006

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin