10% thegdprlaw

Code Review | The GDPR Law

WordPress plugin The GDPR Law scored 10% from 54 tests.

About plugin

  • Plugin page: thegdprlaw
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9
  • WordPress version: 6.3.1
  • First release: May 23, 2018
  • Latest release: May 28, 2018
  • Number of updates: 21
  • Update frequency: every 0.5 days
  • Top authors: craigedmonds (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 4,995 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/thegdprlaw/thegdprlaw.php+30
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.96MB] [CPU: ▼51.85ms] Passed 4 tests

An overview of server-side resources used by The GDPR Law
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.435.19 ▼33.89
Dashboard /wp-admin2.05 ▼1.268.89 ▼38.59
Posts /wp-admin/edit.php2.05 ▼1.317.10 ▼43.01
Add New Post /wp-admin/post-new.php2.05 ▼3.845.77 ▼91.90
Media Library /wp-admin/upload.php2.05 ▼1.185.95 ▼28.74
The GDPR Law /wp-admin/options-general.php?page=thegdprlaw_plugin2.056.62

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for The GDPR Law
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.19 ▼1.041.80 ▼0.1242.35 ▼2.75
Dashboard /wp-admin2,210 ▲225.81 ▲0.8898.17 ▼12.7140.04 ▼3.61
Posts /wp-admin/edit.php2,090 ▲11.99 ▼0.0638.86 ▲0.2434.58 ▲0.27
Add New Post /wp-admin/post-new.php1,536 ▲2223.06 ▲5.44595.89 ▼94.5454.14 ▼4.48
Media Library /wp-admin/upload.php1,386 ▼54.15 ▼0.0497.98 ▼5.9741.98 ▼3.45
The GDPR Law /wp-admin/options-general.php?page=thegdprlaw_plugin8332.0224.0828.33

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/thegdprlaw/thegdprlaw.php+30
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=thegdprlaw_plugin
    • > Notice in wp-content/plugins/thegdprlaw/functions-options.php+83
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/thegdprlaw/functions-options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/thegdprlaw/functions.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/thegdprlaw/thegdprlaw.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: gdpr, privacy policy

thegdprlaw/thegdprlaw.php 92% from 13 tests

The main PHP file in "The GDPR Law" ver. 1.8 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 209 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin131 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP45365131

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.09
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected