56% awesome-ads

Code Review | Awesome Ads - Google Adsense and Others

WordPress plugin Awesome Ads - Google Adsense and Others scored56%from 54 tests.

About plugin

  • Plugin page: awesome-ads
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.5.2
  • WordPress version: 6.3.1
  • First release: May 23, 2011
  • Latest release: Sep 12, 2016
  • Number of updates: 17
  • Update frequency: every 114.1 days
  • Top authors: awesomedev_ (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /41,734 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.84MB] [CPU: ▼32.79ms] Passed 4 tests

Server-side resources used by Awesome Ads - Google Adsense and Others
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0833.43 ▼5.44
Dashboard /wp-admin3.10 ▼0.2024.43 ▼25.46
Posts /wp-admin/edit.php3.10 ▼0.2524.46 ▼23.81
Add New Post /wp-admin/post-new.php3.10 ▼2.7823.64 ▼71.11
Media Library /wp-admin/upload.php3.10 ▼0.1322.49 ▼10.77
Awesome Ads /wp-admin/admin.php?page=awesome-ads3.1024.78
Awesome Ads /wp-admin/options-general.php?page=awesome-ads3.1022.42
Google Adsense /wp-admin/admin.php?page=awesome_google_ads3.1024.51
Chitika /wp-admin/admin.php?page=awesome_chitika_ads3.1019.20

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 11 new options
New WordPress options
db_upgraded
awesome_ads_chitika_json
can_compress_scripts
awesome-ads-networks
widget_theysaidso_widget
awesome_ads_users_google
awesome_ads_google_json
awesome_ads_users_chitika
widget_recent-posts
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Awesome Ads - Google Adsense and Others
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲9613.19 ▼1.461.69 ▲0.0243.69 ▲1.57
Dashboard /wp-admin2,231 ▲435.80 ▼0.10102.16 ▼1.5738.74 ▼0.54
Posts /wp-admin/edit.php2,120 ▲281.99 ▼0.0133.45 ▼8.1333.55 ▼1.42
Add New Post /wp-admin/post-new.php1,558 ▲3822.94 ▼0.33679.70 ▲24.2662.82 ▲8.54
Media Library /wp-admin/upload.php1,413 ▲224.21 ▲0.0396.92 ▼5.0744.42 ▼0.54
Awesome Ads /wp-admin/admin.php?page=awesome-ads9873.1160.9525.85
Awesome Ads /wp-admin/options-general.php?page=awesome-ads9903.1058.3927.98
Google Adsense /wp-admin/admin.php?page=awesome_google_ads1,7122.9043.6629.50
Chitika /wp-admin/admin.php?page=awesome_chitika_ads1,6592.8839.6626.87

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/awesome-ads/libs/functions.php+162
    The each() function is deprecated. This message will be suppressed on further calls
  • This plugin does not fully uninstall, leaving 11 options in the database
    • awesome_ads_chitika_json
    • awesome_ads_google_json
    • awesome-ads-networks
    • db_upgraded
    • theysaidso_admin_options
    • awesome_ads_users_chitika
    • widget_recent-posts
    • widget_recent-comments
    • awesome_ads_users_google
    • can_compress_scripts
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=awesome_chitika_ads
    • > Deprecated in wp-content/plugins/awesome-ads/libs/functions.php+162
    The each() function is deprecated. This message will be suppressed on further calls
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=awesome_chitika_ads
    • > Notice in wp-content/plugins/awesome-ads/libs/functions.php+182
    Undefined variable: response
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=awesome_chitika_ads
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=awesome_chitika_ads
    • > User deprecated in wp-includes/functions.php+5453
    Function get_users_of_blog is deprecated since version 3.1.0! Use get_users() instead.

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/awesome-ads/admin_pages/js/main_js.php
  • 22× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/awesome-ads/admin_pages/js/chitika_ads_js.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/awesome-ads/libs/awesome_google_ads.php:3
    • > PHP Warning
      Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/awesome-ads/admin_pages/js/google_ads_js.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/awesome-ads/admin_pages/js/chitika_ads_js.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/awesome-ads/admin_pages/js/google_ads_js.php:48
    • > PHP Warning
      Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/awesome-ads/admin_pages/js/chitika_ads_js.php on line 2
    • > PHP Warning
      Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/awesome-ads/admin_pages/js/google_ads_js.php on line 1
    • > PHP Warning
      Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/awesome-ads/admin_pages/js/chitika_ads_js.php on line 3
    • > PHP Warning
      Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/awesome-ads/admin_pages/js/google_ads_js.php on line 2
    • > PHP Warning
      Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/awesome-ads/admin_pages/js/google_ads_js.php on line 1

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
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=awesome_chitika_ads
    • > Javascript (severe) in unknown
    /wp-admin/js/common.min.js?ver=6.3.1 1:6139 Uncaught TypeError: W(...).on is not a function
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=awesome_chitika_ads
    • > Javascript (severe) in unknown
    /wp-includes/js/heartbeat.min.js?ver=6.3.1 1:5086 Uncaught TypeError: i.on is not a function
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=awesome_chitika_ads
    • > Javascript (severe) in unknown
    /wp-includes/js/wp-auth-check.min.js?ver=6.3.1 1:502 Uncaught TypeError: i(...).on is not a function
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=awesome_chitika_ads
    • > Javascript (severe) in unknown
    https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js 15:13142 Uncaught TypeError: W(...).on is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Options.), #2 (Google Adsense Options.), #3 (Chitika Options.)
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
Please take inspiration from this readme.txt

awesome-ads/awesome-ads.php Passed 13 tests

The entry point to "Awesome Ads - Google Adsense and Others" version 1.0.5 is a PHP file that has certain tags in its header comment area
127 characters long description:
Awesome Ads is the easiest way to show Google Adsense and Others ads in your wordpress. You don't need to copy and paste codes.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,296 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP10167431,501
JavaScript213941709
CSS19486

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.18MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png66.19KB32.74KB▼ 50.54%
assets/icon-128x128.png6.33KB3.10KB▼ 51.09%
admin_pages/resources/colorpicker/hv.png2.80KB7.32KB0.00%
assets/banner-772x250.png17.01KB8.26KB▼ 51.45%
admin_pages/resources/jquery.tzCheckbox/background.png4.07KB1.99KB▼ 51.13%