72% universal-google-adsense-and-ads-manager

Code Review | Universal Google Adsense and Ads manager

WordPress plugin Universal Google Adsense and Ads manager scored 72% from 54 tests.

About plugin

  • Plugin page: universal-google-...
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 5.9.2
  • First release: Jun 17, 2019
  • Latest release: Jan 23, 2022
  • Number of updates: 10
  • Update frequency: every 95.2 days
  • Top authors: themebeez (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

6,000+ active / 46,289 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.52MB] [CPU: ▼289.84ms] Passed 4 tests

This is a short check of server-side resources used by Universal Google Adsense and Ads manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.5661.42 ▲10.69
Dashboard /wp-admin3.91 ▲0.5036.36 ▲3.74
Posts /wp-admin/edit.php4.20 ▲0.5640.42 ▲5.34
Add New Post /wp-admin/post-new.php7.46 ▲0.4695.09 ▼1,173.18
Media Library /wp-admin/upload.php3.85 ▲0.5627.32 ▲4.76
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php5.6969.09

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 77 new files
Database: no new tables, 3 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Universal Google Adsense and Ads manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,912 ▲16816.37 ▲0.369.50 ▲2.682.50 ▲0.44
Dashboard /wp-admin2,913 ▲556.17 ▼0.01117.37 ▼25.51158.48 ▼6.50
Posts /wp-admin/edit.php2,713 ▲223.24 ▲0.0162.99 ▼2.96141.83 ▼8.64
Add New Post /wp-admin/post-new.php1,722 ▲6117.14 ▲1.58393.53 ▼52.00168.77 ▲12.45
Media Library /wp-admin/upload.php1,726 ▲285.49 ▼0.04138.87 ▼9.87188.13 ▼11.33
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php10,56320.74562.66176.97

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 3 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_universal-google-adsense-and-ads-manager-advertisement-widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/universal-google-adsense-and-ads-manager/public/partials/ugaam-public-display.php
  • 7× 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/universal-google-adsense-and-ads-manager/includes/functions/template-hooks.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/universal-google-adsense-and-ads-manager/includes/customizer/functions/dynamic-style-script.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/universal-google-adsense-and-ads-manager/includes/widgets/class-ugaam-ad-widget.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/universal-google-adsense-and-ads-manager/includes/customizer/controls/class-customizer-toggle-control.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/universal-google-adsense-and-ads-manager/includes/customizer/functions/customizer-fields.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/universal-google-adsense-and-ads-manager/includes/customizer/controls/class-customizer-responsive-dimension-control.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/universal-google-adsense-and-ads-manager/admin/partials/ugaam-admin-display.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 25 tag instead of maximum 10
The official readme.txt is a good inspiration

universal-google-adsense-and-ads-manager/universal-google-adsense-and-ads-manager.php 92% from 13 tests

The principal PHP file in "Universal Google Adsense and Ads manager" v. 1.0.8 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 146 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin5,484 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity15.11
▷ Minimum class complexity1.00
▷ Maximum class complexity134.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
▷ Static methods1111.46%
▷ Public methods8891.67%
▷ Protected methods22.08%
▷ Private methods66.25%
▷ Named functions71100.00%
▷ Anonymous functions00.00%
▷ Global constants110.00%
▷ Class constants990.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
27 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/customizer/assets/images/layout_four.png4.08KB1.43KB▼ 65.07%
includes/customizer/assets/images/layout_two.png4.93KB1.21KB▼ 75.35%
includes/customizer/assets/images/header_seven.png3.15KB1.07KB▼ 65.88%
includes/customizer/assets/images/layout_one.png4.51KB1.38KB▼ 69.37%