84% wpx-gdpr-consent

Code Review | WPX GDPR Consent

WordPress plugin WPX GDPR Consent scored84%from 54 tests.

About plugin

  • Plugin page: wpx-gdpr-consent
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Apr 1, 2022
  • Latest release: Jul 3, 2022
  • Number of updates: 5
  • Update frequency: every 18.8 days
  • Top authors: stalukder03 (80%)wpxon (40%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /409 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.12MB] [CPU: ▲1.06ms] Passed 4 tests

A check of server-side resources used by WPX GDPR Consent
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0845.50 ▲3.66
Dashboard /wp-admin3.48 ▲0.1853.93 ▼5.75
Posts /wp-admin/edit.php3.54 ▲0.1856.91 ▲2.96
Add New Post /wp-admin/post-new.php6.00 ▲0.11100.57 ▲3.36
Media Library /wp-admin/upload.php3.32 ▲0.1041.50 ▲4.20

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 13 new options
New WordPress options
wgc_version
widget_recent-comments
wgc_privacy
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
wgc_installed
wgc_general
widget_recent-posts
...

Browser metrics Passed 4 tests

A check of browser resources used by WPX GDPR Consent
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,045 ▲28414.94 ▲0.665.69 ▲3.8939.35 ▼2.49
Dashboard /wp-admin2,365 ▲1886.33 ▲0.70117.82 ▲29.1740.81 ▲0.64
Posts /wp-admin/edit.php2,296 ▲1993.49 ▲1.5157.78 ▲21.7234.93 ▼1.25
Add New Post /wp-admin/post-new.php1,552 ▲2623.71 ▲0.66641.22 ▼38.0234.05 ▼24.65
Media Library /wp-admin/upload.php1,430 ▲274.29 ▲0.1187.26 ▼10.9240.48 ▼2.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 13 options in the database
    • can_compress_scripts
    • wgc_style
    • widget_recent-comments
    • widget_recent-posts
    • wgc_privacy
    • wgc_version
    • db_upgraded
    • wgc_custom_txt
    • wgc_installed
    • theysaidso_admin_options
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 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/wpx-gdpr-consent/vendor/tareq1988/wordpress-settings-api-class/src/class.settings-api.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpx-gdpr-consent/vendor/tareq1988/wordpress-settings-api-class/example/procedural-example.php:270
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wpx-gdpr-consent/includes/views/gdpr_frontend.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: cookie-notice, gdpr consent, gdpr, cookie

wpx-gdpr-consent/wpx-gdpr-consent.php Passed 13 tests

The primary PHP file in "WPX GDPR Consent" version 1.0.2 is used by WordPress to initiate all plugin functionality
70 characters long description:
A Light-Weight, Simple and Complete GDPR Consent Plugin for WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,300 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP264508461,984
JSON30097
CSS20089
Markdown130073
JavaScript23057

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity15.40
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes16.67%
Methods116
▷ Static methods2925.00%
▷ Public methods11397.41%
▷ Protected methods00.00%
▷ Private methods32.59%
Functions10
▷ Named functions880.00%
▷ Anonymous functions220.00%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.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
1 PNG file occupies 0.38MB with 0.27MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/tareq1988/wordpress-settings-api-class/screenshot-1.png389.59KB115.93KB▼ 70.24%