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

Code Review | Universal Google Adsense and Ads manager

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

About plugin

  • Plugin page: universal-google-...
  • Plugin version: 1.1.7
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Jun 17, 2019
  • Latest release: Nov 9, 2023
  • Number of updates: 19
  • Update frequency: every 84.6 days
  • Top authors: themebeez (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

5,000+ active /85,311 total downloads

Benchmarks

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 successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Universal Google Adsense and Ads manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.03 ▲1.74
Dashboard /wp-admin3.40 ▲0.1046.89 ▲0.26
Posts /wp-admin/edit.php3.51 ▲0.1652.58 ▲10.40
Add New Post /wp-admin/post-new.php5.98 ▲0.0985.77 ▼9.63
Media Library /wp-admin/upload.php3.32 ▲0.0932.84 ▼1.37

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 56 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
udp_installed_agents
can_compress_scripts
theysaidso_admin_options
widget_universal-google-adsense-and-ads-manager-advertisement-widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Universal Google Adsense and Ads manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲9414.69 ▲0.533.60 ▲2.1235.41 ▼3.18
Dashboard /wp-admin2,223 ▲435.53 ▼0.1090.81 ▼5.2540.56 ▼5.94
Posts /wp-admin/edit.php2,116 ▲161.95 ▼0.0539.96 ▲4.5736.24 ▲5.56
Add New Post /wp-admin/post-new.php6,246 ▲4,72025.91 ▲2.58912.15 ▲267.5255.28 ▲5.42
Media Library /wp-admin/upload.php1,419 ▲194.20 ▼0.0097.85 ▼5.3242.05 ▼1.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • widget_universal-google-adsense-and-ads-manager-advertisement-widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • udp_installed_agents

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 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
  • 8× PHP files trigger server errors when accessed directly:
    • > 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: 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 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: 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: 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: 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: Call to undefined function get_option() in wp-content/plugins/universal-google-adsense-and-ads-manager/includes/udp/init.php:26
    • > 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 just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 25 tag instead of maximum 10
You can look at the official readme.txt

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

The primary PHP file in "Universal Google Adsense and Ads manager" version 1.1.7 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 146 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected4,460 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP331,3361,8493,404
CSS422334495
Sass91151329
JavaScript4127146232

PHP code Passed 2 tests

Analyzing 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.48
Average class complexity15.47
▷ Minimum class complexity1.00
▷ Maximum class complexity134.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods109
▷ Static methods1110.09%
▷ Public methods9688.07%
▷ Protected methods21.83%
▷ Private methods1110.09%
Functions81
▷ Named functions7288.89%
▷ Anonymous functions911.11%
Constants10
▷ 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
No PNG images were found in this plugin