88% adsense-plugin

Code Review | AdPush

WordPress plugin AdPush scored 88% from 54 tests.

About plugin

  • Plugin page: adsense-plugin
  • Plugin version: 1.50
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.4
  • WordPress version: 5.8.1
  • First release: Nov 24, 2011
  • Latest release: Jan 19, 2022
  • Number of updates: 97
  • Update frequency: every 38.2 days
  • Top authors: bestwebsoft (92.78%)gasplugin (5.15%)namith.jawahar (4.12%)

Code review

54 tests

User reviews

97 reviews

Install metrics

5,000+ active / 595,663 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.05MB] [CPU: ▲46.41ms] Passed 4 tests

A check of server-side resources used by AdPush
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲1.0137.79 ▲9.60
Dashboard /wp-admin4.15 ▲1.08324.97 ▲283.03
Posts /wp-admin/edit.php4.20 ▲1.09350.65 ▲314.09
Add New Post /wp-admin/post-new.php6.44 ▲1.00369.68 ▼356.31
Media Library /wp-admin/upload.php4.10 ▲1.10275.17 ▲249.30

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: no files
Database: no new tables, 2 new options
New WordPress options
bstwbsftwppdtplgns_options
adsns_options

Browser metrics Passed 4 tests

An overview of browser requirements for AdPush
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,720 ▲10915.91 ▼0.099.85 ▲0.1177.73 ▲2.50
Dashboard /wp-admin2,978 ▲796.10 ▼0.09118.02 ▼14.79165.70 ▼15.38
Posts /wp-admin/edit.php2,793 ▲563.25 ▲0.0168.52 ▲3.66138.53 ▼4.66
Add New Post /wp-admin/post-new.php2,363 ▲29716.56 ▲0.93398.05 ▼9.95159.65 ▼9.74
Media Library /wp-admin/upload.php1,804 ▲525.57 ▲0.03160.55 ▲17.87184.42 ▼11.29
Ads /wp-admin/adsense-list.php260.940.0522.90
BWS Panel /wp-admin/adsense-plugin.php?page=adsns-bws-panel260.940.0516.78
Settings /wp-admin/adsense-plugin.php260.940.0417.44

Uninstaller [IO: ✅] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please take a closer look at the following
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/adsense-plugin/bws_menu/product_list.php:7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/adsense-plugin/includes/adsns-list-table.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/adsense-plugin/google_api/../autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/adsense-plugin/google_api/Collection.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/adsense-plugin/google_api/Service/AdSense.php:32
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/adsense-plugin/includes/adsns-list-table.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/adsense-plugin/adsense-plugin.php:2624
    • > PHP Warning
      require_once(wp-content/plugins/adsense-plugin/google_api/../autoload.php): failed to open stream: No such file or directory in wp-content/plugins/adsense-plugin/google_api/Collection.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/adsense-plugin/includes/class-adsns-settings.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/adsense-plugin/includes/adsns-list-table.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > 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/adsense-plugin.php?page=adsns-bws-panel
    • > Network (severe)
    wp-admin/adsense-plugin.php?page=adsns-bws-panel - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/adsense-plugin.php
    • > Network (severe)
    wp-admin/adsense-plugin.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (Ads Settings page (Unauthorized in Google AdSense and vi stories).), #2 (vi stories Sign Up form.), #3 (vi stories Log In form.), #4 (Ads Settings page (Authorized in Google AdSense and vi stories ).), #5 (Ads page (Authorized in Google AdSense).), #6 (vi stories Player customization form.), #7 (Google AdSense Ads and vi stories Ads in the front-end (Before the content).)
Please take inspiration from this readme.txt

adsense-plugin/adsense-plugin.php Passed 13 tests

"AdPush" version 1.50's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
100 characters long description:
Add Adsense ads to pages, posts, custom posts, search results, categories, tags, pages, and widgets.

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
No dangerous file extensions were detected28,852 lines of code in 94 files:
LanguageFilesBlank linesComment linesLines of code
PHP571,5893,85713,282
PO File124,0495,8768,848
CSS122282765,722
JavaScript9103144841
SVG400159

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity9.08
▷ Minimum class complexity1.00
▷ Maximum class complexity222.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes106
▷ Abstract classes65.66%
▷ Concrete classes10094.34%
▷ Final classes00.00%
Methods676
▷ Static methods131.92%
▷ Public methods61290.53%
▷ Protected methods202.96%
▷ Private methods446.51%
Functions96
▷ Named functions96100.00%
▷ Anonymous functions00.00%
Constants49
▷ Global constants24.08%
▷ Class constants4795.92%
▷ Public constants47100.00%

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
63 PNG files occupy 3.03MB with 1.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/css/jquery-ui-styles/1.12.1/images/ui-bg_glass_75_dadada_1x400.png0.32KB0.16KB▼ 50.46%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
bws_menu/icons/themes/realestate.png280.34KB108.34KB▼ 61.35%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_flat_0_aaaaaa_40x100.png0.26KB0.11KB▼ 56.06%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.17KB▼ 53.39%