62% affiliate-ads-builder-for-clickbank-products

Code Review | Affiliate Ads for Clickbank Products

WordPress plugin Affiliate Ads for Clickbank Products scored 62% from 54 tests.

About plugin

  • Plugin page: affiliate-ads-bui...
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0
  • WordPress version: 6.3.1
  • First release: Aug 19, 2016
  • Latest release: Jun 23, 2022
  • Number of updates: 92
  • Update frequency: every 23.2 days
  • Top authors: mycbgenie (60.87%)dactum (40.22%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 13,881 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Affiliate Ads for Clickbank Products
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.37 ▼1.096.27 ▼39.75
Dashboard /wp-admin2.39 ▼0.927.92 ▼45.75
Posts /wp-admin/edit.php2.39 ▼0.977.23 ▼45.30
Add New Post /wp-admin/post-new.php2.39 ▼3.506.65 ▼82.75
Media Library /wp-admin/upload.php2.39 ▼0.847.74 ▼30.39
Ad Settings /wp-admin/admin.php?page=mycbgenie_ads_settings2.396.73
ClickBank Ads /wp-admin/admin.php?page=mycbgenie_ads_main_menu2.396.19
Ad Widget /wp-admin/admin.php?page=mycbgenie_ads_widget2.398.79

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 8 new options
New WordPress options
widget_mycbgenie_ads_plugin
widget_recent-comments
can_compress_scripts
mycbgenie_ads_version
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Affiliate Ads for Clickbank Products
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲19514.10 ▼0.256.76 ▲4.8742.28 ▼4.50
Dashboard /wp-admin2,240 ▲345.13 ▼0.86101.67 ▼13.2786.64 ▲44.49
Posts /wp-admin/edit.php2,141 ▲492.29 ▲0.2442.95 ▲6.7735.25 ▼1.03
Add New Post /wp-admin/post-new.php1,554 ▲2123.25 ▲0.16734.27 ▼27.4737.17 ▼24.75
Media Library /wp-admin/upload.php1,440 ▲524.44 ▲0.24102.98 ▼10.5283.96 ▲38.73
Ad Settings /wp-admin/admin.php?page=mycbgenie_ads_settings1,4261.8426.0631.60
ClickBank Ads /wp-admin/admin.php?page=mycbgenie_ads_main_menu1,4281.8529.2130.47
Ad Widget /wp-admin/admin.php?page=mycbgenie_ads_widget8531.7926.3736.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mycbgenie_text_ads_div_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • can_compress_scripts
    • mycbgenie_ads_version
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_mycbgenie_ads_plugin
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_widget
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mycbgenie_text_ads_div_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_widget
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mycbgenie_banner_ads_div_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_widget
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mycbgenie_image_ads_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_widget
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mycbgenie_image_ads_div_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_main_menu
    • > Notice in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/settings.inc.php+349
    Undefined variable: mycbgenie_cb_tracking_id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_main_menu
    • > Notice in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/settings.inc.php+355
    Undefined variable: show_ads_top_single_post
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_main_menu
    • > Notice in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/settings.inc.php+426
    Undefined variable: mycbgenie_ad_position_single_post
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_main_menu
    • > Notice in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/settings.inc.php+375
    Undefined variable: mycbgenie_ad_format_top_single_post
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_main_menu
    • > Notice in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/settings.inc.php+399
    Undefined variable: thumbnails_top_location
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_main_menu
    • > Notice in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/settings.inc.php+419
    Undefined variable: show_ads_bottom_single_post
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_main_menu
    • > Notice in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/settings.inc.php+438
    Undefined variable: mycbgenie_ad_format_bottom_single_post
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mycbgenie_ads_main_menu
    • > Notice in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/settings.inc.php+460
    Undefined variable: thumbnails_bottom_location

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/affiliate-ads-builder-for-clickbank-products/text_ads_ajax.php
    • > /wp-content/plugins/affiliate-ads-builder-for-clickbank-products/banner_ads_ajax.php
    • > /wp-content/plugins/affiliate-ads-builder-for-clickbank-products/image_ad_ajax.php
  • 36× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined index: hide_footer in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/image_ad_ajax.php on line 32
    • > PHP Notice
      Undefined index: rows in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/text_ads_ajax.php on line 35
    • > PHP Notice
      Undefined index: default_font_family in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/text_ads_ajax.php on line 29
    • > PHP Notice
      Undefined index: link_color in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/image_ad_ajax.php on line 25
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/banner_ads_ajax.php on line 33
    • > PHP Notice
      Undefined index: show_read_more_btn in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/text_ads_ajax.php on line 28
    • > PHP Notice
      Undefined index: im_width in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/image_ad_ajax.php on line 19
    • > PHP Notice
      Undefined index: rows in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/image_ad_ajax.php on line 28
    • > PHP Notice
      Undefined index: show_product_descr in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/image_ad_ajax.php on line 20
    • > PHP Notice
      Undefined index: border_color in wp-content/plugins/affiliate-ads-builder-for-clickbank-products/image_ad_ajax.php on line 24

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 Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: clickbank script, clickbank affiliate ads, clickbak affiliates, click bank, clickbank wordpress plugin...

affiliate-ads-builder-for-clickbank-products/mycbgenie_clickbank_affiliate_ads.php 85% from 13 tests

The principal PHP file in "Affiliate Ads for Clickbank Products" v. 2.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("affiliate-ads-builder-for-clickbank-products.php" instead of "mycbgenie_clickbank_affiliate_ads.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 161 characters long)

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 plugin4,461 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP141,1421601,869
JavaScript163597231,546
CSS614760538
Markdown1950483
JSON10025

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity91.00
▷ Minimum class complexity91.00
▷ Maximum class complexity91.00
Average method complexity23.50
▷ Minimum method complexity1.00
▷ Maximum method complexity84.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
6 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bxslider_carousel/bxslider/images/controls.png2.74KB1.42KB▼ 48.29%
bxslider_carousel/styles/images/controls.png2.74KB1.42KB▼ 48.29%
bxslider_carousel/js/jscolor/hv.png2.80KB7.32KB0.00%
images/MyCBGenie_logo.png13.48KB5.25KB▼ 61.03%
bxslider_carousel/js/jscolor/hs.png2.62KB7.54KB0.00%