77% bws-adsense

Code Review | AdS by BestWebSoft

WordPress plugin AdS by BestWebSoft scored77%from 54 tests.

About plugin

  • Plugin page: bws-adsense
  • Plugin version: 1.52
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Aug 11, 2022
  • Latest release: May 22, 2023
  • Number of updates: 6
  • Update frequency: every 54.5 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /666 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▲157.37ms] Passed 4 tests

This is a short check of server-side resources used by AdS by BestWebSoft
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0944.30 ▲1.90
Dashboard /wp-admin3.46 ▲0.11263.37 ▲202.18
Posts /wp-admin/edit.php3.51 ▲0.15276.86 ▲228.23
Add New Post /wp-admin/post-new.php5.99 ▲0.11326.63 ▲198.49
Media Library /wp-admin/upload.php3.32 ▲0.09260.90 ▲226.92

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 960 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
adsns_options
widget_theysaidso_widget
theysaidso_admin_options
bstwbsftwppdtplgns_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by AdS by BestWebSoft
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,886 ▲12513.34 ▼0.953.01 ▲1.2240.08 ▼1.48
Dashboard /wp-admin2,262 ▲565.89 ▲1.01103.02 ▼1.7842.49 ▼0.51
Posts /wp-admin/edit.php2,147 ▲442.05 ▲0.0541.43 ▲2.9337.39 ▼3.02
Add New Post /wp-admin/post-new.php1,563 ▲1823.36 ▼0.07666.34 ▲18.5553.36 ▼4.75
Media Library /wp-admin/upload.php1,444 ▲474.23 ▲0.01111.27 ▼5.1046.59 ▼0.45
Settings /wp-admin/bws-adsense.php260.440.1114.97
AdS /wp-admin/adsense-list.php260.440.106.56
BWS Panel /wp-admin/bws-adsense.php?page=adsns-bws-panel260.440.147.11

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 430× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/bws-adsense/google_api/vendor/guzzlehttp/guzzle/src/Client.php:17
    • > PHP Fatal error
      Trait 'phpseclib3\\System\\SSH\\Common\\Traits\\ReadBytes' not found in wp-content/plugins/bws-adsense/google_api/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php on line 52
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/bws-adsense/google_api/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/bws-adsense/google_api/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php:23
    • > PHP Warning
      Class 'Google\\Http\\Batch' not found in wp-content/plugins/bws-adsense/google_api/vendor/google/apiclient/src/aliases.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\BigInteger\\Engines\\BCMath' not found in wp-content/plugins/bws-adsense/google_api/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Service' not found in wp-content/plugins/bws-adsense/google_api/vendor/google/apiclient-services/src/AdSenseHost.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/bws-adsense/google_api/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/bws-adsense/google_api/vendor/guzzlehttp/psr7/src/CachingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/bws-adsense/google_api/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php:28

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/bws-adsense.php
    • > Network (severe)
    wp-admin/bws-adsense.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/adsense-list.php
    • > Network (severe)
    wp-admin/adsense-list.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/bws-adsense.php?page=adsns-bws-panel
    • > Network (severe)
    wp-admin/bws-adsense.php?page=adsns-bws-panel - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 33 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (AdS Settings page (Unauthorized in Google AdSense and vi stories).), #2 (AdS Settings page (Authorized in Google AdSense).), #3 (vi stories Page.), #4 (AdS Settings page (Authorized in Google AdSense).), #5 (Google AdSense Ads and vi stories Ads in the front-end (Before the content).)
You can take inspiration from this readme.txt

bws-adsense/bws-adsense.php 92% from 13 tests

The principal PHP file in "AdS by BestWebSoft" v. 1.52 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected91,039 lines of code in 847 files:
LanguageFilesBlank linesComment linesLines of code
PHP75212,78344,41367,497
PO File124,1306,1419,121
CSS122272825,804
Markdown301,76805,207
JSON20002,178
JavaScript885139858
SVG700241
YAML332102
XML10019
make1409
Bourne Shell1203

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.82
▷ Minimum class complexity1.00
▷ Maximum class complexity662.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces80
Interfaces50
Traits14
Classes683
▷ Abstract classes21431.33%
▷ Concrete classes46968.67%
▷ Final classes5311.30%
Methods3,693
▷ Static methods67718.33%
▷ Public methods2,82176.39%
▷ Protected methods39110.59%
▷ Private methods48113.02%
Functions275
▷ Named functions13348.36%
▷ Anonymous functions14251.64%
Constants504
▷ Global constants101.98%
▷ Class constants49498.02%
▷ Public constants45792.51%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
64 PNG files occupy 3.67MB with 1.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-icons_222222_256x240.png6.68KB4.20KB▼ 37.05%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-icons_888888_256x240.png6.88KB4.20KB▼ 38.90%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
bws_menu/icons/themes/realestate.png280.34KB108.34KB▼ 61.35%