68% surbma-gdpr-proof-google-analytics

Code Review | Surbma | GDPR Proof Cookie Consent & Notice Bar

WordPress plugin Surbma | GDPR Proof Cookie Consent & Notice Bar scored 68% from 54 tests.

About plugin

  • Plugin page: surbma-gdpr-proof...
  • Plugin version: 17.5.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.9
  • WordPress version: 5.8.1
  • First release: Mar 27, 2018
  • Latest release: Mar 3, 2022
  • Number of updates: 103
  • Update frequency: every 14.0 days
  • Top authors: Surbma (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active / 31,721 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.15MB] [CPU: ▼163.67ms] 75% from 4 tests

An overview of server-side resources used by Surbma | GDPR Proof Cookie Consent & Notice Bar
Please have a look at the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.15MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.63 ▲5.7950.52 ▲26.27
Dashboard /wp-admin8.65 ▲5.5857.11 ▲13.87
Posts /wp-admin/edit.php8.65 ▲5.5457.24 ▲21.45
Add New Post /wp-admin/post-new.php9.28 ▲3.8494.70 ▼711.80
Media Library /wp-admin/upload.php8.65 ▲5.6447.21 ▲21.80
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.6543.45

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 422 new files
Database: no new tables, 5 new options
New WordPress options
fs_debug_mode
fs_accounts
surbma_gpga_fields
fs_gdpr
fs_active_plugins

Browser metrics Passed 4 tests

Checking browser requirements for Surbma | GDPR Proof Cookie Consent & Notice Bar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,715 ▲11416.06 ▲0.514.82 ▼0.1673.15 ▼1.31
Dashboard /wp-admin2,979 ▲836.14 ▲0.12116.55 ▼15.90180.44 ▲10.48
Posts /wp-admin/edit.php2,789 ▲523.24 ▲0.0266.45 ▲1.27152.23 ▲9.63
Add New Post /wp-admin/post-new.php3,828 ▲1,50218.60 ▲2.11416.37 ▼1.87165.93 ▲7.71
Media Library /wp-admin/upload.php1,798 ▲465.52 ▼0.03153.37 ▲7.19205.64 ▲21.39
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,5062.4553.93113.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/surbma-gdpr-proof-google-analytics/vendors/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 5 options in the database
    • surbma_gpga_fields
    • fs_accounts
    • fs_debug_mode
    • fs_active_plugins
    • fs_gdpr

Smoke tests 50% 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 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/surbma-gdpr-proof-google-analytics/surbma-gdpr-proof-google-analytics.php
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'SURBMA_GPGA_PLUGIN_DIR/admin/surbma-admin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/admin.php on line 3
    • > PHP Warning
      include_once(SURBMA_GPGA_PLUGIN_DIR/admin/surbma-admin.php): failed to open stream: No such file or directory in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/admin.php on line 3
    • > PHP Warning
      include_once(): Failed opening 'SURBMA_GPGA_PLUGIN_DIR/pages/social.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/admin.php on line 5
    • > PHP Warning
      Use of undefined constant SURBMA_GPGA_PLUGIN_DIR - assumed 'SURBMA_GPGA_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/shortcodes.php:10
    • > PHP Warning
      include_once(SURBMA_GPGA_PLUGIN_DIR/pages/social.php): failed to open stream: No such file or directory in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/admin.php on line 5
    • > PHP Warning
      include_once(): Failed opening 'SURBMA_GPGA_PLUGIN_DIR/pages/settings.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/admin.php on line 4
    • > PHP Warning
      Use of undefined constant SURBMA_GPGA_PLUGIN_DIR - assumed 'SURBMA_GPGA_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/admin.php on line 4
    • > PHP Warning
      include_once(SURBMA_GPGA_PLUGIN_DIR/pages/settings.php): failed to open stream: No such file or directory in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/admin.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surbma-gdpr-proof-google-analytics/lib/social.php:27

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: cookie compliance, cookie, facebook pixel, cookie consent, google analytics...

surbma-gdpr-proof-google-analytics/surbma-gdpr-proof-google-analytics.php 92% from 13 tests

Analyzing the main PHP file in "Surbma | GDPR Proof Cookie Consent & Notice Bar" version 17.5.3
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages/")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin65,601 lines of code in 326 files:
LanguageFilesBlank linesComment linesLines of code
PHP1167,40616,11632,439
JavaScript264,68325611,748
CSS18383,0329,638
LESS1494,5995,0028,746
Markdown576001,936
JSON32201,072
XML10014
SVG8008

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity90.29
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes45
▷ Abstract classes24.44%
▷ Concrete classes4395.56%
▷ Final classes00.00%
Methods1,132
▷ Static methods17315.28%
▷ Public methods79269.96%
▷ Protected methods151.33%
▷ Private methods32528.71%
Functions124
▷ Named functions124100.00%
▷ Anonymous functions00.00%
Constants131
▷ Global constants10680.92%
▷ Class constants2519.08%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendors/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendors/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%