67% gdpraccept-lite

Code Review | GdprAccept Lite

WordPress plugin GdprAccept Lite scored67%from 54 tests.

About plugin

  • Plugin page: gdpraccept-lite
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: May 19, 2019
  • Latest release: May 19, 2019
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: chipsolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /452 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼5.29ms] Passed 4 tests

A check of server-side resources used by GdprAccept Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3344.47 ▲2.75
Dashboard /wp-admin3.65 ▲0.3060.66 ▼9.58
Posts /wp-admin/edit.php3.70 ▲0.3455.75 ▲1.72
Add New Post /wp-admin/post-new.php6.18 ▲0.3086.04 ▼14.77
Media Library /wp-admin/upload.php3.51 ▲0.2841.51 ▲1.48
Edit Preamble /wp-admin/admin.php?page=gdpraccept_companypreamble_form3.6944.25
Edit mail body /wp-admin/admin.php?page=gdpraccept_mailbody_form3.6144.39
Settings /wp-admin/admin.php?page=gdpraccept_settings3.6539.14
Consent Fields /wp-admin/admin.php?page=gdpraccept_companyfield3.5836.46
Dashboard /wp-admin/admin.php?page=gdpraccept3.6639.86
Shortcode /wp-admin/admin.php?page=gdpraccept_tokenacceptance_shortcode3.4732.76
Add New Field /wp-admin/admin.php?page=gdpraccept_companyfield_form3.6035.54
Add New Token /wp-admin/admin.php?page=gdpraccept_token_form3.6536.21

Server storage [IO: ▲0.16MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 60 new files
Database: 6 new tables, 7 new options
New tables
wp_gdpraccept_consentformfield
wp_gdpraccept_company
wp_gdpraccept_import
wp_gdpraccept_token
wp_gdpraccept_emailtpl
wp_gdpraccept_consentform
New WordPress options
widget_recent-posts
gdpraccept_db_version
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

GdprAccept Lite: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲10214.25 ▼0.342.28 ▲0.2846.32 ▼1.43
Dashboard /wp-admin2,247 ▲675.60 ▼0.0784.42 ▼9.1342.37 ▼3.11
Posts /wp-admin/edit.php2,159 ▲562.22 ▲0.2132.63 ▼6.9036.63 ▲2.35
Add New Post /wp-admin/post-new.php1,570 ▲2517.48 ▼5.77676.19 ▲7.4857.77 ▼1.94
Media Library /wp-admin/upload.php1,458 ▲554.20 ▲0.0599.01 ▼7.1643.18 ▼2.77
Edit Preamble /wp-admin/admin.php?page=gdpraccept_companypreamble_form1,5826.79144.5156.44
Edit mail body /wp-admin/admin.php?page=gdpraccept_mailbody_form1,7176.83144.6752.29
Settings /wp-admin/admin.php?page=gdpraccept_settings8681.9325.0029.66
Consent Fields /wp-admin/admin.php?page=gdpraccept_companyfield1,2062.1331.6128.21
Dashboard /wp-admin/admin.php?page=gdpraccept1,1171.9526.3326.51
Shortcode /wp-admin/admin.php?page=gdpraccept_tokenacceptance_shortcode8551.9324.7132.98
Add New Field /wp-admin/admin.php?page=gdpraccept_companyfield_form9412.0525.8625.80
Add New Token /wp-admin/admin.php?page=gdpraccept_token_form9531.9327.0229.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_gdpraccept_consentformfield
    • wp_gdpraccept_consentform
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/gdpraccept-lite/templates/tokenacceptance-preamble.php
    • > /wp-content/plugins/gdpraccept-lite/gdpraccept.php
    • > /wp-content/plugins/gdpraccept-lite/templates/html/styles.php
    • > /wp-content/plugins/gdpraccept-lite/templates/html/table_consent.php
    • > /wp-content/plugins/gdpraccept-lite/templates/tokenacceptance.php
  • 34× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gdpraccept-lite/inc/Base/Activate.php on line 9
    • > PHP Fatal error
      Uncaught Error: Interface 'GdprAccept\\Api\\VirtualPages\\TemplateLoaderInterface' not found in wp-content/plugins/gdpraccept-lite/inc/Api/VirtualPages/TemplateLoader.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GdprAccept\\Api\\VirtualPages\\VirtualPageControllerInterface' not found in wp-content/plugins/gdpraccept-lite/inc/Api/VirtualPages/VirtualPageController.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/gdpraccept-lite/inc/Base/Activate.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'GdprAccept\\Base\\BaseController' not found in wp-content/plugins/gdpraccept-lite/inc/Api/Callbacks/ManagerCallbacks.php:9
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gdpraccept-lite/inc/Base/TokenListTable.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'GdprAccept\\Base\\BaseController' not found in wp-content/plugins/gdpraccept-lite/inc/Pages/Dashboard.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'GdprAccept\\Api\\Models\\BaseModel' not found in wp-content/plugins/gdpraccept-lite/inc/Api/Models/EmailTplModel.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/gdpraccept-lite/inc/Base/TokenListTable.php on line 14
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/gdpraccept-lite/templates/html/table_consent.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid url: ""
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
The official readme.txt is a good inspiration

gdpraccept-lite/gdpraccept.php 85% from 13 tests

The main PHP script in "GdprAccept Lite" version 1.0.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("gdpraccept-lite.php" instead of "gdpraccept.php")

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
Good job! No executable or dangerous file extensions detected2,720 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP514776902,716
JavaScript2022
CSS1111
JSON1001

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.28
Average class complexity7.71
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces9
Interfaces3
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes13.12%
Methods197
▷ Static methods2512.69%
▷ Public methods18191.88%
▷ Protected methods115.58%
▷ Private methods52.54%
Functions7
▷ Named functions342.86%
▷ Anonymous functions457.14%
Constants0
▷ Global constants00.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 images were found in this plugin