78% awesome-cookie-consent

Code Review | Awesome GDPR Compliant Cookie Consent and Notice

WordPress plugin Awesome GDPR Compliant Cookie Consent and Notice scored78%from 54 tests.

About plugin

  • Plugin page: awesome-cookie-co...
  • Plugin version: 3.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Dec 26, 2019
  • Latest release: Jul 27, 2021
  • Number of updates: 23
  • Update frequency: every 25.2 days
  • Top authors: techastha (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /2,301 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.88ms] Passed 4 tests

Analyzing server-side resources used by Awesome GDPR Compliant Cookie Consent and Notice
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.43 ▲0.37
Dashboard /wp-admin3.33 ▼0.0145.01 ▼16.94
Posts /wp-admin/edit.php3.38 ▲0.0349.88 ▲4.55
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.49 ▼11.09
Media Library /wp-admin/upload.php3.26 ▲0.0337.69 ▲4.16
Awesome Cookie Consent /wp-admin/options-general.php?page=ta_gcccn3.3733.78

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 15 new options
New WordPress options
widget_theysaidso_widget
gcccn_dismiss_button_text
gcccn_popup_hide_pages
db_upgraded
gcccn_url_cookie_policy_link
widget_recent-posts
theysaidso_admin_options
gcccn_cookie_policy_url_type
gcccn_layout_configuration
gcccn_cookie_expiry_duration
...

Browser metrics Passed 4 tests

A check of browser resources used by Awesome GDPR Compliant Cookie Consent and Notice
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,957 ▲21113.61 ▼1.178.70 ▲6.3644.23 ▲0.84
Dashboard /wp-admin2,210 ▲224.87 ▼0.00107.49 ▼8.7836.33 ▼11.19
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0340.52 ▲2.7435.01 ▲2.12
Add New Post /wp-admin/post-new.php1,539 ▲2023.34 ▼0.02598.59 ▼72.3351.52 ▼8.68
Media Library /wp-admin/upload.php1,395 ▲104.17 ▼0.1493.22 ▼6.9843.24 ▼0.95
Awesome Cookie Consent /wp-admin/options-general.php?page=ta_gcccn9852.6338.6824.31

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 15 options in the database
    • gcccn_cookie_policy_url_type
    • widget_recent-comments
    • widget_recent-posts
    • gcccn_dismiss_button_text
    • widget_theysaidso_widget
    • gcccn_policy_link_text
    • db_upgraded
    • gcccn_cookie_expiry_duration
    • theysaidso_admin_options
    • gcccn_open_new_tab
    • ...

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
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/awesome-cookie-consent/classes/class-gcccn.php
    • > /wp-content/plugins/awesome-cookie-consent/classes/class-gcccn-front.php
    • > /wp-content/plugins/awesome-cookie-consent/classes/class-gcccn-i18n.php
    • > /wp-content/plugins/awesome-cookie-consent/awesome-cookie-consent.php
    • > /wp-content/plugins/awesome-cookie-consent/classes/class-gcccn-admin.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/awesome-cookie-consent/templates/gcccn-cookie-consent-text.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/awesome-cookie-consent/templates/gcccn-general-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/awesome-cookie-consent/templates/gcccn-layout-configuration.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: cookie law, cookie consent, eu cookie law, cookie, compliance...

awesome-cookie-consent/awesome-cookie-consent.php 92% from 13 tests

The entry point to "Awesome GDPR Compliant Cookie Consent and Notice" version 3.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin3,365 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP91111481,738
CSS41851937
JavaScript4251417
PO File2114154273

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity24.00
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity6.11
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods18
▷ Static methods15.56%
▷ Public methods1477.78%
▷ Protected methods00.00%
▷ Private methods422.22%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin