78% easy-cookie-optin

Code Review | easy Cookie Consent - Optin

WordPress plugin easy Cookie Consent - Optin scored78%from 54 tests.

About plugin

  • Plugin page: easy-cookie-optin
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Jul 14, 2020
  • Latest release: Oct 12, 2020
  • Number of updates: 9
  • Update frequency: every 11.2 days
  • Top authors: msar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /505 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼12.99ms] Passed 4 tests

This is a short check of server-side resources used by easy Cookie Consent - Optin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1546.88 ▲5.54
Dashboard /wp-admin3.33 ▲0.0353.69 ▲2.84
Posts /wp-admin/edit.php3.38 ▲0.0249.12 ▼7.25
Add New Post /wp-admin/post-new.php5.93 ▲0.0487.33 ▼50.99
Media Library /wp-admin/upload.php3.25 ▲0.0240.90 ▲3.44
Cookie Groups /wp-admin/admin.php?page=easy-cookie-optin-cookie-groups3.4044.31
Cookie Scripts /wp-admin/admin.php?page=easy-cookie-optin-cookie-scripts3.3941.96
Main Settings /wp-admin/admin.php?page=easy-cookie-optin-main3.3340.28

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 46 new files
Database: 3 new tables, 6 new options
New tables
wp_msar_easyCookie_cookieGroups
wp_msar_easyCookie_cookieScripts
wp_msar_easyCookie_settings
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for easy Cookie Consent - Optin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲17413.48 ▼0.8711.95 ▲10.3042.82 ▼1.44
Dashboard /wp-admin2,233 ▲565.64 ▼0.0397.42 ▼2.8545.49 ▲1.80
Posts /wp-admin/edit.php2,138 ▲352.01 ▼0.0235.30 ▼4.0634.54 ▲0.35
Add New Post /wp-admin/post-new.php1,555 ▲2723.08 ▲0.08672.79 ▼27.6151.50 ▼8.59
Media Library /wp-admin/upload.php1,435 ▲414.32 ▲0.10110.13 ▼2.0444.72 ▼4.99
Cookie Groups /wp-admin/admin.php?page=easy-cookie-optin-cookie-groups9932.0524.4427.41
Cookie Scripts /wp-admin/admin.php?page=easy-cookie-optin-cookie-scripts8992.0525.4531.32
Main Settings /wp-admin/admin.php?page=easy-cookie-optin-main1,0902.1923.6532.64

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/easy-cookie-optin/admin/template/class-msar-form-group.php
    • > /wp-content/plugins/easy-cookie-optin/admin/template/class-msar-form-main.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_blog_prefix() on null in wp-content/plugins/easy-cookie-optin/includes/updates/1.0.3.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Abstract_Msar_Easycookie_Admin_Table' not found in wp-content/plugins/easy-cookie-optin/admin/partials/pages/groups/class-msar-easycookie-admin-table-groups.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Abstract_Msar_Easycookie_Admin_Table' not found in wp-content/plugins/easy-cookie-optin/admin/partials/pages/styling/class-msar-easycookie-admin-table-styling.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/easy-cookie-optin/includes/class-msar-easycookie-activator.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/easy-cookie-optin/admin/partials/pages/class-abstract-msar-easycookie-admin-table.php on line 15
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/easy-cookie-optin/admin/partials/pages/class-abstract-msar-easycookie-admin-table.php on line 15
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/easy-cookie-optin/includes/class-msar-easycookie-activator.php on line 13
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/easy-cookie-optin/admin/partials/pages/class-abstract-msar-easycookie-admin-table.php on line 15
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/easy-cookie-optin/includes/class-msar-easycookie-activator.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_blog_prefix() on null in wp-content/plugins/easy-cookie-optin/includes/updates/1.0.2.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: consentform, optin, dsgvo, cookie, cookie consent

easy-cookie-optin/msar-easycookie.php 85% from 13 tests

This is the main PHP file of "easy Cookie Consent - Optin" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("easy-cookie-optin.php" instead of "msar-easycookie.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 168 characters long)

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
Everything looks great! No dangerous files found in this plugin3,862 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP285661,8352,693
PO File1142198465
CSS27629432
JavaScript26445271
JSON1001

PHP code Passed 2 tests

An overview of 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.33
Average class complexity14.77
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes21
▷ Abstract classes14.76%
▷ Concrete classes2095.24%
▷ Final classes00.00%
Methods181
▷ Static methods31.66%
▷ Public methods14278.45%
▷ Protected methods179.39%
▷ Private methods2212.15%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin