89% affiliatewp-affiliate-banners-widget

Code Review | AffiliateWP Affiliate Banners Widget

WordPress plugin AffiliateWP Affiliate Banners Widget scored89%from 54 tests.

About plugin

  • Plugin page: affiliatewp-affil...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8+
  • WordPress version: 6.3.1
  • First release: May 15, 2014
  • Latest release: Jun 10, 2014
  • Number of updates: 5
  • Update frequency: every 5.2 days
  • Top authors: sebd86 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

40+ active /3,382 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.92ms] Passed 4 tests

Server-side resources used by AffiliateWP Affiliate Banners Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.25 ▼2.26
Dashboard /wp-admin3.37 ▲0.0346.91 ▼14.53
Posts /wp-admin/edit.php3.49 ▲0.1347.02 ▲1.26
Add New Post /wp-admin/post-new.php5.96 ▲0.0780.99 ▼16.15
Media Library /wp-admin/upload.php3.30 ▲0.0736.34 ▲2.35

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_affiliate_wp_banner_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for AffiliateWP Affiliate Banners Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.65 ▼0.941.66 ▼0.1644.41 ▲0.25
Dashboard /wp-admin2,209 ▲214.86 ▼0.04100.65 ▼14.6842.03 ▼4.33
Posts /wp-admin/edit.php2,089 ▲31.98 ▼0.0634.91 ▼1.2436.56 ▲0.81
Add New Post /wp-admin/post-new.php1,514 ▼2117.74 ▼5.46707.37 ▲20.2052.20 ▲2.58
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0593.85 ▼6.9840.76 ▼3.94

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 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_affiliate_wp_banner_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Everything seems fine, however this is by no means an exhaustive test

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 86% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: affiliatewp, pippin williamson, affiliate, banners, sdavis2702...

affiliatewp-affiliate-banners-widget/affiliatewp-banners-widget.php 69% from 13 tests

The main PHP file in "AffiliateWP Affiliate Banners Widget" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("affiliatewp-affiliate-banners-widget.php" instead of "affiliatewp-banners-widget.php")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin249 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP272205249

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity11.50
▷ Minimum class complexity6.00
▷ Maximum class complexity17.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods18
▷ Static methods211.11%
▷ Public methods1688.89%
▷ Protected methods00.00%
▷ Private methods211.11%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants675.00%
▷ Class constants225.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.20MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banners/300x600-white.png50.47KB22.37KB▼ 55.67%
assets/banners/728x90.png45.94KB20.68KB▼ 54.98%
assets/banners/300x250-get-started.png13.64KB6.34KB▼ 53.52%
assets/banners/234x60.png10.24KB5.28KB▼ 48.47%
assets/banners/300x250-get-started-white.png13.26KB6.18KB▼ 53.42%