84% webgains-ads-widget

Code Review | Webgains Ads Widget

WordPress plugin Webgains Ads Widget scored84%from 54 tests.

About plugin

  • Plugin page: webgains-ads-widget
  • Plugin version: 1.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5+
  • WordPress version: 6.3.1
  • First release: Sep 5, 2015
  • Latest release: Sep 9, 2015
  • Number of updates: 10
  • Update frequency: every 0.4 days
  • Top authors: ntuananh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /985 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

A check of server-side resources used by Webgains Ads Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0236.60 ▲1.14
Dashboard /wp-admin3.33 ▼0.0243.83 ▼16.24
Posts /wp-admin/edit.php3.38 ▲0.0243.16 ▼4.43
Add New Post /wp-admin/post-new.php5.91 ▲0.0281.07 ▼12.03
Media Library /wp-admin/upload.php3.25 ▲0.0237.80 ▲5.88
Webgains Ads Widget /wp-admin/options-general.php?page=webgains_ads_widget3.2232.44

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: 1 new table, 7 new options
New tables
wp_webgainsads
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_webgains-ad-widget-id
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Webgains Ads Widget: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▼0.031.51 ▼0.0936.79 ▼2.97
Dashboard /wp-admin2,196 ▲155.52 ▼0.2181.57 ▼17.3438.03 ▼4.32
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0334.96 ▼2.9934.40 ▼1.65
Add New Post /wp-admin/post-new.php1,529 ▲323.24 ▼0.34691.96 ▼18.8552.46 ▼1.97
Media Library /wp-admin/upload.php1,401 ▲44.26 ▲0.09107.47 ▲8.5547.04 ▲2.49
Webgains Ads Widget /wp-admin/options-general.php?page=webgains_ads_widget9142.3331.4025.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 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 50% 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
Please fix the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/webgains-ads-widget/WebgainsAdsWidget_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/webgains-ads-widget/WebgainsAdsWidget_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/webgains-ads-widget/WebgainsAdsWidget_ads.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/webgains-ads-widget/WebgainsAdsWidget_widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: affiliate, page, plugin, webgains, widget...

webgains-ads-widget/WebgainsAdsWidget.php 92% from 13 tests

The primary PHP file in "Webgains Ads Widget" version 1.5.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("webgains-ads-widget.php" instead of "WebgainsAdsWidget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin444 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP611736444

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin