78% gdpr-visitor-consent

Code Review | GDPR Visitor Consent

WordPress plugin GDPR Visitor Consent scored78%from 54 tests.

About plugin

  • Plugin page: gdpr-visitor-consent
  • Plugin version: 1.1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.8.3
  • WordPress version: 6.3.1
  • First release: Jun 19, 2018
  • Latest release: Jan 15, 2022
  • Number of updates: 29
  • Update frequency: every 45.2 days
  • Top authors: nateconley (96.55%)brandondove (6.9%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /992 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.61ms] Passed 4 tests

A check of server-side resources used by GDPR Visitor Consent
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0526.53 ▼20.42
Dashboard /wp-admin3.38 ▲0.0751.33 ▲0.05
Posts /wp-admin/edit.php3.49 ▲0.1349.66 ▼0.45
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.75 ▼5.63
Media Library /wp-admin/upload.php3.30 ▲0.0738.63 ▲1.85

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

GDPR Visitor Consent: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.32 ▼0.062.45 ▲0.6943.02 ▼0.86
Dashboard /wp-admin2,204 ▲335.53 ▼0.0488.96 ▼11.5442.76 ▼1.81
Posts /wp-admin/edit.php2,112 ▲122.02 ▼0.0036.34 ▼2.6135.29 ▼0.37
Add New Post /wp-admin/post-new.php1,538 ▲1223.17 ▲0.00660.33 ▼24.1158.45 ▲3.10
Media Library /wp-admin/upload.php1,406 ▲64.23 ▲0.02101.07 ▼4.6242.47 ▼0.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gdpr-visitor-consent/gdpr-visitor-consent.php
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'GDPR_VISITOR_CONSENT_ABSTRACTSget-options.php' (include_path='.:/usr/share/php') in wp-content/plugins/gdpr-visitor-consent/lib/banner.php on line 7
    • > PHP Warning
      Use of undefined constant GDPR_VISITOR_CONSENT_ABSTRACTS - assumed 'GDPR_VISITOR_CONSENT_ABSTRACTS' (this will throw an Error in a future version of PHP) in wp-content/plugins/gdpr-visitor-consent/lib/banner.php on line 7
    • > PHP Warning
      require_once(GDPR_VISITOR_CONSENT_ABSTRACTSget-options.php): failed to open stream: No such file or directory in wp-content/plugins/gdpr-visitor-consent/lib/admin-screen.php on line 7
    • > PHP Warning
      require_once(GDPR_VISITOR_CONSENT_ABSTRACTSget-options.php): failed to open stream: No such file or directory in wp-content/plugins/gdpr-visitor-consent/lib/banner.php on line 7
    • > PHP Warning
      require_once(GDPR_VISITOR_CONSENT_ABSTRACTSget-options.php): failed to open stream: No such file or directory in wp-content/plugins/gdpr-visitor-consent/lib/options.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/gdpr-visitor-consent/views/frontend-banner.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'GDPR_VISITOR_CONSENT_ABSTRACTSget-options.php' (include_path='.:/usr/share/php') in wp-content/plugins/gdpr-visitor-consent/lib/admin-screen.php on line 7
    • > PHP Warning
      Use of undefined constant GDPR_VISITOR_CONSENT_ABSTRACTS - assumed 'GDPR_VISITOR_CONSENT_ABSTRACTS' (this will throw an Error in a future version of PHP) in wp-content/plugins/gdpr-visitor-consent/lib/options.php on line 7
    • > PHP Warning
      Use of undefined constant GDPR_VISITOR_CONSENT_ABSTRACTS - assumed 'GDPR_VISITOR_CONSENT_ABSTRACTS' (this will throw an Error in a future version of PHP) in wp-content/plugins/gdpr-visitor-consent/lib/scripts.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'GDPR_VISITOR_CONSENT_ABSTRACTSget-options.php' (include_path='.:/usr/share/php') in wp-content/plugins/gdpr-visitor-consent/lib/scripts.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: scripts, privacy, gdpr

gdpr-visitor-consent/gdpr-visitor-consent.php 92% from 13 tests

The main PHP script in "GDPR Visitor Consent" version 1.1.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected12,965 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
JSON20010,845
Vuejs Component714849782
Sass912612538
PHP10166127484
SVG301168
JavaScript82315133
Markdown14012
CSS2003

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.00
▷ Minimum class complexity2.00
▷ Maximum class complexity15.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods30
▷ Static methods2686.67%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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