78% wp-gdpr-cookie-consent

Code Review | WP GDPR Cookie Consent

WordPress plugin WP GDPR Cookie Consent scored78%from 54 tests.

About plugin

  • Plugin page: wp-gdpr-cookie-co...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9.8
  • WordPress version: 6.3.1
  • First release: Sep 28, 2018
  • Latest release: Sep 28, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: techjewel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,975 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.00ms] Passed 4 tests

A check of server-side resources used by WP GDPR Cookie Consent
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.39 ▼1.10
Dashboard /wp-admin3.31 ▲0.0143.09 ▼1.89
Posts /wp-admin/edit.php3.37 ▲0.0144.68 ▼0.54
Add New Post /wp-admin/post-new.php5.90 ▲0.0193.45 ▼12.45
Media Library /wp-admin/upload.php3.24 ▲0.0138.79 ▲4.15
WP GDRP Consent /wp-admin/tools.php?page=ninja-wp-gdpr3.2330.98

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WP GDPR Cookie Consent
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.25 ▼1.061.77 ▲0.1044.39 ▼5.76
Dashboard /wp-admin2,213 ▲214.86 ▼0.0997.09 ▼15.0138.22 ▲0.93
Posts /wp-admin/edit.php2,096 ▲72.00 ▲0.0239.86 ▼0.4737.13 ▲0.91
Add New Post /wp-admin/post-new.php1,517 ▼2517.41 ▼1.09593.13 ▼30.7259.40 ▲5.51
Media Library /wp-admin/upload.php1,395 ▲74.27 ▲0.0299.85 ▼10.2840.36 ▼1.89
WP GDRP Consent /wp-admin/tools.php?page=ninja-wp-gdpr1,3726.50151.6349.68

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-gdpr-cookie-consent/views/admin_view.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-gdpr-cookie-consent/views/frontend_consent.php on line 12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-gdpr-cookie-consent/views/frontend_consent.php on line 12
    • > PHP Notice
      Undefined variable: config in wp-content/plugins/wp-gdpr-cookie-consent/views/frontend_consent.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/wp-gdpr-cookie-consent/views/frontend_consent.php:16
    • > PHP Notice
      Undefined variable: config in wp-content/plugins/wp-gdpr-cookie-consent/views/frontend_consent.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-gdpr-cookie-consent/views/frontend_consent.php on line 4
    • > PHP Notice
      Undefined variable: template in wp-content/plugins/wp-gdpr-cookie-consent/views/frontend_consent.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Requires php: Invalid version format
You can look at the official readme.txt

wp-gdpr-cookie-consent/wp-gdpr-cookie-consent.php 85% from 13 tests

Analyzing the main PHP file in "WP GDPR Cookie Consent" version 1.0.0
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: Please use dashes and lowercase characters for text domains

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
No dangerous file extensions were detected506 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP8103111498
JSON1005
JavaScript2002
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods2184.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants3
▷ Global constants3100.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
No PNG files were detected