10% clickbank-ads-clickbank-widget

Code Review | Affiliate Ads for ClickBank

WordPress plugin Affiliate Ads for ClickBank scored 10% from 54 tests.

About plugin

  • Plugin page: clickbank-ads-cli...
  • Plugin version: 1.35
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.8.2
  • WordPress version: 6.3.1
  • First release: Sep 2, 2014
  • Latest release: Dec 10, 2021
  • Number of updates: 35
  • Update frequency: every 75.9 days
  • Top authors: cbads (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

300+ active / 28,887 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/clickbank-ads-clickbank-widget/clickbank-ads.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; cbwec has a deprecated constructor

Server metrics [RAM: ▼1.62MB] [CPU: ▼53.79ms] Passed 4 tests

Server-side resources used by Affiliate Ads for ClickBank
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.37 ▼1.105.60 ▼40.54
Dashboard /wp-admin2.39 ▼0.927.90 ▼45.81
Posts /wp-admin/edit.php2.39 ▼0.976.33 ▼42.16
Add New Post /wp-admin/post-new.php2.39 ▼3.506.70 ▼86.66
Media Library /wp-admin/upload.php2.39 ▼0.847.42 ▼27.58
Affiliate Ads for ClickBank /wp-admin/options-general.php?page=clickbank-ads-clickbank-widget/clickbank-ads.php2.396.38

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_clickbank_ads_widget_version
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Affiliate Ads for ClickBank
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.30 ▼1.071.92 ▲0.0043.54 ▲4.28
Dashboard /wp-admin2,210 ▲225.84 ▲0.04112.55 ▲3.5042.32 ▲0.04
Posts /wp-admin/edit.php2,090 ▲42.00 ▼0.0135.61 ▼0.6233.30 ▼1.69
Add New Post /wp-admin/post-new.php1,539 ▲623.36 ▲0.41629.78 ▲3.4353.41 ▼3.51
Media Library /wp-admin/upload.php1,392 ▲104.21 ▲0.05103.37 ▲8.5046.14 ▲1.79
Affiliate Ads for ClickBank /wp-admin/options-general.php?page=clickbank-ads-clickbank-widget/clickbank-ads.php1,1952.2028.2132.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/clickbank-ads-clickbank-widget/clickbank-ads.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; cbwec has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_clickbank_ads_widget_version
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=clickbank-ads-clickbank-widget/clickbank-ads.php
    • > Deprecated in wp-content/plugins/clickbank-ads-clickbank-widget/clickbank-ads.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; cbwec has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=clickbank-ads-clickbank-widget/clickbank-ads.php
    • > Deprecated in wp-content/plugins/clickbank-ads-clickbank-widget/clickbank-ads.php+354
    Methods with the same name as their class will not be constructors in a future version of PHP; ClickBank_Ads_W has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=clickbank-ads-clickbank-widget/clickbank-ads.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in ClickBank_Ads_W is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=clickbank-ads-clickbank-widget/clickbank-ads.php
    • > Notice in wp-content/plugins/clickbank-ads-clickbank-widget/clickbank-ads.php+72
    Undefined index: keywords

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/clickbank-ads-clickbank-widget/clickbank-ads.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 68 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 ("Affiliate Ads for ClickBank" Plugin options for widget area), #2 (Widget Output - Vertical Affiliate Banner), #3 (Affiliate Widget Output (1:5) - Carousel Slideshow), #4 ("Affiliate Ads for ClickBank" Plugin options for post area), #5 (Plugin Output - Horizontal Affiliate Banner), #6 (Click Bank Affiliate Plugin Output - Rectangle (360x400))
You can look at the official readme.txt

clickbank-ads-clickbank-widget/clickbank-ads.php 85% from 13 tests

The main PHP file in "Affiliate Ads for ClickBank" ver. 1.35 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 342 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("clickbank-ads-clickbank-widget.php" instead of "clickbank-ads.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected445 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14821445

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity70.50
▷ Minimum class complexity45.00
▷ Maximum class complexity96.00
Average method complexity12.58
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.37MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png69.91KB20.66KB▼ 70.45%
screenshot-4.png28.36KB10.00KB▼ 64.74%
screenshot-5.png120.14KB40.56KB▼ 66.24%
prev.png3.04KB2.15KB▼ 29.37%
screenshot-1.png33.07KB11.26KB▼ 65.94%