10% ajax-adsense

Code Review | AJAX Plugin for AdSense

WordPress plugin AJAX Plugin for AdSense scored10%from 54 tests.

About plugin

  • Plugin page: ajax-adsense
  • Plugin version: 9.30
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-4.8
  • WordPress version: 6.3.1
  • First release: Apr 17, 2015
  • Latest release: Jul 31, 2017
  • Number of updates: 76
  • Update frequency: every 11.0 days
  • Top authors: manojtd (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /25,214 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/ajax-adsense/easy-adsense-widget.php+52
    Function create_function() is deprecated

Server metrics [RAM: ▼1.76MB] [CPU: ▼51.40ms] Passed 4 tests

An overview of server-side resources used by AJAX Plugin for AdSense
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.22 ▼1.249.08 ▼28.65
Dashboard /wp-admin2.24 ▼1.068.54 ▼43.05
Posts /wp-admin/edit.php2.25 ▼1.1110.73 ▼44.69
Add New Post /wp-admin/post-new.php2.24 ▼3.649.74 ▼89.15
Media Library /wp-admin/upload.php2.25 ▼0.989.05 ▼28.71

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 90 new files
Database: 1 new table, 9 new options
New tables
wp_ez_adsense_options
New WordPress options
widget_ezadslu
can_compress_scripts
widget_ezadswidget
db_upgraded
widget_ezadssearch
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

AJAX Plugin for AdSense: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.22 ▼0.131.98 ▲0.3444.26 ▲3.40
Dashboard /wp-admin2,199 ▲195.61 ▲0.0188.74 ▼0.1140.07 ▲0.57
Posts /wp-admin/edit.php2,107 ▲41.98 ▼0.0535.14 ▼7.3935.38 ▲0.40
Add New Post /wp-admin/post-new.php1,529 ▲123.57 ▲0.31615.00 ▼93.6656.32 ▼8.39
Media Library /wp-admin/upload.php1,401 ▲14.22 ▲0.01102.19 ▲0.8441.76 ▼2.55
AJAX AdSense Lite /wp-admin/wp-google-adsense.php260.420.0814.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/ajax-adsense/easy-adsense-widget.php+52
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_ez_adsense_options
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_ezadswidget
    • theysaidso_admin_options
    • widget_ezadslu
    • db_upgraded
    • widget_ezadssearch
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/ajax-adsense/wp-google-adsense.php
    • > /wp-content/plugins/ajax-adsense/easy-adsense.php
  • 49× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ajax-adsense/ezKillLite.php on line 21
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/ajax-adsense/ezKillLite.php on line 21
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ajax-adsense/ezKillLite.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'EzGA' not found in wp-content/plugins/ajax-adsense/admin/box-more-info.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'EzGA' not found in wp-content/plugins/ajax-adsense/admin/footer.php:24
    • > PHP Warning
      chdir(): No such file or directory (errno 2) in wp-content/plugins/ajax-adsense/EZWP.php on line 35
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/ajax-adsense/ezKillLite.php on line 21
    • > PHP Notice
      Undefined variable: ezAdminUrl in wp-content/plugins/ajax-adsense/admin/footer.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function openBox() in wp-content/plugins/ajax-adsense/admin/box-ad-alignment.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_login_url() in wp-content/plugins/ajax-adsense/admin/lock.php:13

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/wp-google-adsense.php
    • > Network (severe)
    wp-admin/wp-google-adsense.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% 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
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (AJAX Plugin for AdSense Dashboard.), #2 (How to set the plugin options.), #3 (Advanced configuration of the plugin.), #4 (Options to support safety, compatibility, mobile devices and category/post control.)
The official readme.txt is a good inspiration

ajax-adsense/easy-adsense.php 85% from 13 tests

The main PHP file in "AJAX Plugin for AdSense" ver. 9.30 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ajax-adsense.php" instead of "easy-adsense.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 193 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected7,533 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP43387684,941
CSS8152811,173
SVG200749
JavaScript86355670

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity31.57
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes17.14%
▷ Concrete classes1392.86%
▷ Final classes00.00%
Methods159
▷ Static methods8150.94%
▷ Public methods159100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.45MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/bootstrap-colorpicker/saturation.png8.61KB5.13KB▼ 40.41%
admin/img/bootstrap-colorpicker/hue.png2.90KB0.50KB▼ 82.71%
admin/img/paypal-partner.png18.11KB6.98KB▼ 61.46%
screenshot-2.png76.42KB83.14KB0.00%
admin/img/bootstrap-colorpicker/alpha.png3.19KB1.68KB▼ 47.45%