84% simple-gdpr-cookie-compliance

Code Review | Simple GDPR Cookie Compliance

WordPress plugin Simple GDPR Cookie Compliance scored84%from 54 tests.

About plugin

  • Plugin page: simple-gdpr-cooki...
  • Plugin version: 1.1.7
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Aug 3, 2019
  • Latest release: Nov 3, 2023
  • Number of updates: 19
  • Update frequency: every 81.7 days
  • Top authors: themebeez (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /16,809 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼3.21ms] Passed 4 tests

This is a short check of server-side resources used by Simple GDPR Cookie Compliance
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3339.53 ▲0.79
Dashboard /wp-admin3.64 ▲0.2948.26 ▼8.05
Posts /wp-admin/edit.php3.75 ▲0.3949.92 ▲5.75
Add New Post /wp-admin/post-new.php6.21 ▲0.3284.23 ▼5.33
Media Library /wp-admin/upload.php3.56 ▲0.3235.06 ▼0.24

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

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

Browser metrics Passed 4 tests

Simple GDPR Cookie Compliance: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲12714.34 ▼0.282.69 ▲1.0445.83 ▲3.49
Dashboard /wp-admin2,226 ▲455.56 ▼0.3187.88 ▼15.5239.53 ▼2.57
Posts /wp-admin/edit.php2,119 ▲192.00 ▲0.0235.40 ▼0.9533.64 ▼2.57
Add New Post /wp-admin/post-new.php1,539 ▲1323.27 ▲0.08676.41 ▼0.6055.29 ▲3.02
Media Library /wp-admin/upload.php1,419 ▲164.26 ▲0.0396.58 ▼11.3545.31 ▲1.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • udp_installed_agents
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/simple-gdpr-cookie-compliance/public/partials/simple-gdpr-cookie-compliance-public-display.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-gdpr-cookie-compliance/admin/partials/simple-gdpr-cookie-compliance-admin-page.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-gdpr-cookie-compliance/includes/udp/init.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can look at the official readme.txt

simple-gdpr-cookie-compliance/simple-gdpr-cookie-compliance.php Passed 13 tests

The principal PHP file in "Simple GDPR Cookie Compliance" v. 1.1.7 is loaded by WordPress automatically on each request
111 characters long description:
Simple GDPR Cookie Compliance is a simple plugin that helps to display cookie notice on your WordPress website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin2,488 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP154678701,712
JavaScript3100226478
CSS311012264
SVG10034

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity25.67
▷ Minimum class complexity1.00
▷ Maximum class complexity95.00
Average method complexity5.19
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods53
▷ Static methods11.89%
▷ Public methods4177.36%
▷ Protected methods00.00%
▷ Private methods1222.64%
Functions13
▷ Named functions430.77%
▷ Anonymous functions969.23%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin