72% wb-ads-rotator-with-split-test

Code Review | WB Ads Rotator with Split Test

WordPress plugin WB Ads Rotator with Split Test scored72%from 54 tests.

About plugin

  • Plugin page: wb-ads-rotator-wi...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 24, 2015
  • Latest release: Aug 24, 2015
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: vapvarun (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /8,537 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼9.27MB] [CPU: ▼1,947,798.51ms] Passed 4 tests

A check of server-side resources used by WB Ads Rotator with Split Test
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2546.07 ▼0.03
Dashboard /wp-admin3.59 ▼37.8262.78 ▼7,791,178.16
Posts /wp-admin/edit.php3.70 ▲0.3053.03 ▼1.27
Add New Post /wp-admin/post-new.php6.19 ▲0.2593.00 ▼14.58
Media Library /wp-admin/upload.php3.51 ▲0.2343.90 ▲5.30
Add New /wp-admin/post-new.php?post_type=wb_ads_rotator3.5947.96
Split Tests /wp-admin/admin.php?page=wb-ads-rotator-main3.6136.67
All Ads /wp-admin/edit.php?post_type=wb_ads_rotator3.4330.47
Filters /wp-admin/admin.php?page=wb-ads-segments3.5036.76

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 24 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
wb_ads_settings
widget_theysaidso_widget
theysaidso_admin_options
widget_wbadssidebara
widget_recent-comments
widget_wbadssidebarc
widget_wbadssidebarb
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WB Ads Rotator with Split Test
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲12013.66 ▼0.691.76 ▲0.0644.56 ▼2.08
Dashboard /wp-admin2,257 ▲795.53 ▼0.14101.49 ▼13.6247.40 ▼0.42
Posts /wp-admin/edit.php2,177 ▲802.40 ▲0.4248.18 ▲11.7535.76 ▼0.93
Add New Post /wp-admin/post-new.php1,583 ▲5722.63 ▼0.36727.79 ▲92.1837.18 ▼11.78
Media Library /wp-admin/upload.php1,474 ▲775.05 ▲0.88113.82 ▲14.1845.41 ▼2.33
Add New /wp-admin/post-new.php?post_type=wb_ads_rotator2,5268.46187.4281.76
Split Tests /wp-admin/admin.php?page=wb-ads-rotator-main9032.1732.7235.67
All Ads /wp-admin/edit.php?post_type=wb_ads_rotator1,1462.3741.6130.94
Filters /wp-admin/admin.php?page=wb-ads-segments9002.1032.8533.27

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_wbadssidebarc
    • wb_ads_settings
    • can_compress_scripts
    • widget_recent-comments
    • widget_wbadssidebara
    • widget_wbadssidebarb

Smoke tests 25% 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
  • 30 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wb_ads_rotator
    • > Notice in wp-content/plugins/wb-ads-rotator-with-split-test/wb-ad-sense.php+364
    Undefined variable: editingad
  • 49 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wb-ads-segments
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 49 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wb-ads-segments
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known
    • > GET request to /wp-admin/admin.php?page=wb-ads-rotator-main
    • > request to
    • > Notice in wp-content/plugins/wb-ads-rotator-with-split-test/wb-ad-sense.php+95
    Undefined index: REMOTE_ADDR
    • > GET request to /wp-admin/admin.php?page=wb-ads-rotator-main
    • > request to
    • > Warning in wp-content/plugins/wb-ads-rotator-with-split-test/wb-ad-sense.php+118
    session_start(): Cannot start session when headers already sent
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wb-ads-rotator-main
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD
    • > GET request to /wp-admin/edit.php?post_type=wb_ads_rotator
    • > Notice in wp-content/plugins/wb-ads-rotator-with-split-test/wb-ad-sense.php+681
    Trying to get property 'post_type' of non-object

SRP 0% from 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wb-ads-rotator-with-split-test/wb-ad-sense.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wb-ads-rotator-with-split-test/split-test.php:85
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wb-ads-rotator-with-split-test/segments.php:81
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wb-ads-rotator-with-split-test/widget.php:4

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Requires at least: Invalid version format
  • Screenshots: These screenshots require images: #1 (Wb Ads Rotator admin panel), #2 (Wb Ads Rotator Split tests setting), #3 (Wb Ads Rotator Filters setting)
You can take inspiration from this readme.txt

wb-ads-rotator-with-split-test/wb-ad-sense.php 92% from 13 tests

"WB Ads Rotator with Split Test" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wb-ads-rotator-with-split-test.php" instead of "wb-ad-sense.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin25,517 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
CSS53,0904023,340
PHP51531231,246
JavaScript215145931

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity51.80
▷ Minimum class complexity5.00
▷ Maximum class complexity217.00
Average method complexity9.76
▷ Minimum method complexity1.00
▷ Maximum method complexity95.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/resume.png0.35KB0.16KB▼ 54.32%
resources/hs.png2.62KB7.54KB0.00%
resources/edit.png0.44KB0.25KB▼ 42.95%
resources/hv.png2.80KB7.32KB0.00%
resources/pause.png0.31KB0.12KB▼ 61.71%