72% google-adsense-for-responsive-design-gard

Code Review | Google AdSense for Responsive Design - GARD

WordPress plugin Google AdSense for Responsive Design - GARD scored72%from 54 tests.

About plugin

  • Plugin page: google-adsense-fo...
  • Plugin version: 2.23
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 6.3.1
  • First release: Jun 26, 2013
  • Latest release: Apr 25, 2016
  • Number of updates: 60
  • Update frequency: every 17.2 days
  • Top authors: The Plugin Factory (53.33%)The Digital Hippies (48.33%)

Code review

54 tests

User reviews

18 reviews

Install metrics

400+ active /54,305 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼5.08ms] Passed 4 tests

Server-side resources used by Google AdSense for Responsive Design - GARD
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0537.77 ▲1.96
Dashboard /wp-admin3.58 ▲0.2349.37 ▼13.03
Posts /wp-admin/edit.php3.63 ▲0.2749.83 ▼2.35
Add New Post /wp-admin/post-new.php6.16 ▲0.2795.77 ▼5.26
Media Library /wp-admin/upload.php3.50 ▲0.2735.72 ▲0.32
GARD /wp-admin/admin.php?page=gard3.6131.54
GARD Help /wp-admin/admin.php?page=gard-help3.4832.43
GARD Pro Demo /wp-admin/admin.php?page=gard-pro-info4.3732.27

Server storage [IO: ▲1.89MB] [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: 31 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Google AdSense for Responsive Design - GARD
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,867 ▲12113.34 ▼0.842.06 ▲0.3241.49 ▼2.90
Dashboard /wp-admin2,236 ▲444.97 ▲0.0399.41 ▼12.4480.54 ▲31.35
Posts /wp-admin/edit.php2,138 ▲462.09 ▲0.1239.06 ▼1.2433.76 ▲0.08
Add New Post /wp-admin/post-new.php1,543 ▲2417.63 ▼5.45716.79 ▲82.1849.70 ▼12.73
Media Library /wp-admin/upload.php1,430 ▲424.24 ▼0.09110.94 ▲8.5443.91 ▼2.13
GARD /wp-admin/admin.php?page=gard6,1752.5347.7349.24
GARD Help /wp-admin/admin.php?page=gard-help9261.7929.6127.04
GARD Pro Demo /wp-admin/admin.php?page=gard-pro-info9,2131.9735.3648.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gard-help
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gard-help
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gard-help
    • > Notice in wp-content/plugins/google-adsense-for-responsive-design-gard/help.php+91
    Undefined variable: plugin_id
    • > GET request to /wp-admin/admin.php?page=gard-help
    • > Notice in wp-content/plugins/google-adsense-for-responsive-design-gard/help.php+92
    Undefined variable: gard_help
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gard-pro-info
    • > Notice in wp-content/plugins/google-adsense-for-responsive-design-gard/pro.php+45
    Undefined variable: MAA_vars
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gard-pro-info
    • > Notice in wp-content/plugins/google-adsense-for-responsive-design-gard/pro.php+45
    Trying to access array offset on value of type null

SRP 50% 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
Please fix the following items
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/google-adsense-for-responsive-design-gard/help.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/google-adsense-for-responsive-design-gard/pro.php:2
    • > PHP Warning
      Use of undefined constant GARD_PRO_LINK - assumed 'GARD_PRO_LINK' (this will throw an Error in a future version of PHP) in wp-content/plugins/google-adsense-for-responsive-design-gard/sidebar.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/google-adsense-for-responsive-design-gard/donate.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/google-adsense-for-responsive-design-gard/options.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/google-adsense-for-responsive-design-gard/register.php:31
    • > PHP Warning
      Use of undefined constant GARD_PRO_LINK - assumed 'GARD_PRO_LINK' (this will throw an Error in a future version of PHP) in wp-content/plugins/google-adsense-for-responsive-design-gard/sidebar.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/google-adsense-for-responsive-design-gard/sidebar.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/google-adsense-for-responsive-design-gard/index.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/google-adsense-for-responsive-design-gard/menu.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gard-pro-info
    • > Rendering (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1 The specified value "!" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=gard
    • > Network (severe)
    https://s2.googleusercontent.com/s2/favicons - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=gard-pro-info
    • > Network (severe)
    http://dev.thepluginfactory.co/wp-content/plugins/gard-pro/video16.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
10 plugin tags: advertising, google adsense, responsive design, responsive, gard...

google-adsense-for-responsive-design-gard/index.php 92% from 13 tests

The main PHP script in "Google AdSense for Responsive Design - GARD" version 2.23 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("google-adsense-for-responsive-design-gard.php" instead of "index.php")

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 detected8,196 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP9621955,639
JavaScript32831941,745
CSS310739812

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
14 PNG files occupy 1.44MB with 0.76MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/GARD Pro - License Page.png18.51KB7.42KB▼ 59.93%
images/screenshot.png43.02KB17.56KB▼ 59.20%
images/screenshot_pro.png23.43KB12.59KB▼ 46.27%
images/GARD Pro - Group 1 Basic Settings.png138.06KB58.36KB▼ 57.73%
images/tpf_donate.png41.89KB23.96KB▼ 42.81%