84% gdpr-cookie-notice

Code Review | GDPR Cookie Notice

WordPress plugin GDPR Cookie Notice scored 84% from 54 tests.

About plugin

  • Plugin page: gdpr-cookie-notice
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.7
  • WordPress version: 5.8.1
  • First release: Jun 3, 2020
  • Latest release: Sep 23, 2021
  • Number of updates: 10
  • Update frequency: every 47.7 days
  • Top authors: themeqx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 568 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼141.55ms] Passed 4 tests

A check of server-side resources used by GDPR Cookie Notice
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.0937.00 ▲5.01
Dashboard /wp-admin3.14 ▲0.0939.52 ▲3.28
Posts /wp-admin/edit.php3.26 ▲0.1544.81 ▲2.76
Add New Post /wp-admin/post-new.php5.51 ▲0.0891.48 ▼566.04
Media Library /wp-admin/upload.php3.09 ▲0.0832.45 ▼6.18
GDPR Cookie Notice /wp-admin/options-general.php?page=gdprcn3.0629.02

Server storage [IO: ▲0.03MB] [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: 18 new files
Database: no new tables, 2 new options
New WordPress options
gdprcn_options
gdprcn_version

Browser metrics Passed 4 tests

Checking browser requirements for GDPR Cookie Notice
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,809 ▲21316.30 ▲0.7913.96 ▲5.7550.04 ▲3.92
Dashboard /wp-admin2,972 ▲386.04 ▲0.09138.33 ▼11.05108.03 ▼18.01
Posts /wp-admin/edit.php2,744 ▲52.69 ▲0.0067.73 ▲4.6483.80 ▼8.37
Add New Post /wp-admin/post-new.php1,607 ▲10718.82 ▲0.25368.24 ▲5.84116.81 ▲15.30
Media Library /wp-admin/upload.php1,815 ▲85.03 ▼0.01142.95 ▼2.68118.55 ▲8.76
GDPR Cookie Notice /wp-admin/options-general.php?page=gdprcn1,1182.0962.5085.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • gdprcn_version
    • gdprcn_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/gdpr-cookie-notice/views/admin_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gdpr-cookie-notice/gdpr-cookie-notice.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: cookie consent, privacy, compliance, gdpr, privacy directive...

gdpr-cookie-notice/gdpr-cookie-notice.php Passed 13 tests

Analyzing the main PHP file in "GDPR Cookie Notice" version 1.2.0
65 characters long description:
GDPR cookie notice notify your users that your site uses cookies.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin641 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP12131193549
CSS191041
JavaScript12733
JSON10018

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity12.40
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods38
▷ Static methods410.53%
▷ Public methods3797.37%
▷ Protected methods00.00%
▷ Private methods12.63%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG images were found in this plugin