78% better-gdpr

Code Review | Better GDPR

WordPress plugin Better GDPR scored78%from 54 tests.

About plugin

  • Plugin page: better-gdpr
  • Plugin version: 0.3.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.6
  • WordPress version: 6.3.1
  • First release: Aug 27, 2020
  • Latest release: Jun 26, 2022
  • Number of updates: 58
  • Update frequency: every 11.9 days
  • Top authors: stremovsky (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /669 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼0.10ms] Passed 4 tests

Server-side resources used by Better GDPR
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1345.14 ▲2.57
Dashboard /wp-admin3.44 ▲0.1346.78 ▼4.69
Posts /wp-admin/edit.php3.55 ▲0.1952.23 ▲5.63
Add New Post /wp-admin/post-new.php6.02 ▲0.1387.73 ▼1.51
Media Library /wp-admin/upload.php3.36 ▲0.1335.66 ▲3.21
Setup /wp-admin/admin.php?page=bettergdpr_setup3.3031.23
Better GDPR /wp-admin/admin.php?page=bettergdpr3.3030.91

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Better GDPR: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9213.57 ▼1.021.60 ▼0.4741.56 ▼6.45
Dashboard /wp-admin2,230 ▲425.77 ▼0.1198.09 ▼16.4739.91 ▼5.19
Posts /wp-admin/edit.php2,116 ▲302.05 ▲0.0139.01 ▲1.7136.22 ▲1.82
Add New Post /wp-admin/post-new.php1,541 ▲823.15 ▲0.01657.06 ▼15.5468.78 ▲9.15
Media Library /wp-admin/upload.php1,415 ▲274.23 ▲0.0693.73 ▼3.9342.68 ▼1.29
Setup /wp-admin/admin.php?page=bettergdpr_setup8982.0123.8625.93
Better GDPR /wp-admin/admin.php?page=bettergdpr9012.0123.3022.23

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bettergdpr
    • > User deprecated in wp-includes/functions.php+5453
    Function get_settings is deprecated since version 2.1.0! Use get_option() instead.

SRP 50% 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
Please fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/privacy-tools.php' (include_path='.:/usr/share/php') in wp-content/plugins/better-gdpr/better-gdpr.php on line 22
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/privacy-tools.php): failed to open stream: No such file or directory in wp-content/plugins/better-gdpr/better-gdpr.php on line 22
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/better-gdpr/better-gdpr.php on line 22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === better-gdpr === )
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

better-gdpr/better-gdpr.php 92% from 13 tests

The main PHP script in "Better GDPR" version 0.3.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • 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 detected842 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP45949842

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions45
▷ Named functions4497.78%
▷ Anonymous functions12.22%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png15.65KB7.21KB▼ 53.95%