67% easy-adsense-ads-scripts-manager

Code Review | Easy AdSense Ads - Ad Inserter & AdSense Ad Manager

WordPress plugin Easy AdSense Ads - Ad Inserter & AdSense Ad Manager scored 67% from 54 tests.

About plugin

  • Plugin page: easy-adsense-ads-...
  • Plugin version: 0.56
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Mar 5, 2017
  • Latest release: Jan 29, 2022
  • Number of updates: 140
  • Update frequency: every 12.8 days
  • Top authors: gandham (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

3,000+ active / 94,073 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼1.19MB] [CPU: ▼321.20ms] Passed 4 tests

This is a short check of server-side resources used by Easy AdSense Ads - Ad Inserter & AdSense Ad Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.4958.86 ▲40.85
Dashboard /wp-admin3.14 ▼0.2723.51 ▼13.03
Posts /wp-admin/edit.php3.14 ▼0.5021.78 ▼23.47
Add New Post /wp-admin/post-new.php3.14 ▼3.8317.15 ▼1,241.13
Media Library /wp-admin/upload.php3.14 ▼0.1619.52 ▼7.16
EAA Help /wp-admin/admin.php?page=eaa3.1422.26
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php4.4452.75
EAA Settings /wp-admin/admin.php?page=eaa-settings3.1419.83

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, 4 new options
New WordPress options
widget_eaa
widget_recent-posts
eaa_settings
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Easy AdSense Ads - Ad Inserter & AdSense Ad Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,871 ▲11715.53 ▼0.126.16 ▼0.763.31 ▲0.74
Dashboard /wp-admin2,951 ▲936.42 ▲0.27117.45 ▼27.02154.33 ▼60.32
Posts /wp-admin/edit.php2,764 ▲702.95 ▼0.2963.42 ▲3.47135.44 ▼2.82
Add New Post /wp-admin/post-new.php1,743 ▼816.09 ▼5.06431.35 ▼31.51185.21 ▼8.55
Media Library /wp-admin/upload.php1,770 ▲725.88 ▲0.43124.53 ▼45.09186.99 ▲1.77
EAA Help /wp-admin/admin.php?page=eaa2,25211.21301.49276.14
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php9,36420.69640.55280.88
EAA Settings /wp-admin/admin.php?page=eaa-settings2,55210.51311.34283.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • The uninstall procedure has failed, leaving 4 options in the database
    • eaa_settings
    • widget_recent-comments
    • widget_eaa
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eaa-settings
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-content/plugins/easy-adsense-ads-scripts-manager/inc/widget.php+192
    Undefined index: text_amp
  • 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
    • > GET request to /wp-admin/admin.php?page=eaa-settings
    • > Notice in wp-content/plugins/easy-adsense-ads-scripts-manager/admin/plugin-settings.php+287
    Undefined index: enable_debug_mode
    • > GET request to /wp-admin/admin.php?page=eaa-settings
    • > Notice in wp-content/plugins/easy-adsense-ads-scripts-manager/admin/plugin-settings.php+352
    Undefined index: custom_locations

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
The following issues need your attention
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/easy-adsense-ads-scripts-manager/inc/shortcodes.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-adsense-ads-scripts-manager/admin/meta-boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-adsense-ads-scripts-manager/admin/load-customizer-styles.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/easy-adsense-ads-scripts-manager/inc/functions-eaa-filters.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-adsense-ads-scripts-manager/inc/hook-header-footer.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-adsense-ads-scripts-manager/inc/custom-content.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-adsense-ads-scripts-manager/admin/control-responsive-content.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-adsense-ads-scripts-manager/admin/admin-ajax.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-adsense-ads-scripts-manager/admin/notices.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/easy-adsense-ads-scripts-manager/inc/widget.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 87% 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
These attributes need your attention:
  • Tags: Please delete some tags, you are using 27 tag instead of maximum 10
  • Requires at least: Invalid plugin version format
You can take inspiration from this readme.txt

easy-adsense-ads-scripts-manager/eaa.php 85% from 13 tests

Analyzing the main PHP file in "Easy AdSense Ads - Ad Inserter & AdSense Ad Manager" version 0.56
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 292 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("easy-adsense-ads-scripts-manager.php" instead of "eaa.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected3,516 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP246699212,582
CSS48736592
Markdown11020241
JavaScript4227101

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity47.75
▷ Minimum class complexity12.00
▷ Maximum class complexity134.00
Average method complexity4.82
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods49
▷ Static methods918.37%
▷ Public methods4795.92%
▷ Protected methods24.08%
▷ Private methods00.00%
Functions66
▷ Named functions6496.97%
▷ Anonymous functions23.03%
Constants15
▷ Global constants640.00%
▷ Class constants960.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/favicon.png1.15KB0.46KB▼ 60.00%
assets/img/amp-icon.png1.37KB1.50KB0.00%
assets/img/adsense-setup.png7.98KB4.16KB▼ 47.86%