90% can-i-use-cookies

Code Review | Can I Use Cookies ?

WordPress plugin Can I Use Cookies ? scored90%from 54 tests.

About plugin

  • Plugin page: can-i-use-cookies
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.7
  • WordPress version: 6.3.1
  • First release: Dec 16, 2020
  • Latest release: Mar 13, 2021
  • Number of updates: 7
  • Update frequency: every 12.6 days
  • Top authors: fcaylus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /559 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.02ms] Passed 4 tests

Server-side resources used by Can I Use Cookies ?
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.94 ▼3.62
Dashboard /wp-admin3.36 ▲0.0653.60 ▼0.46
Posts /wp-admin/edit.php3.47 ▲0.1252.31 ▲1.85
Add New Post /wp-admin/post-new.php5.94 ▲0.0586.53 ▼17.85
Media Library /wp-admin/upload.php3.28 ▲0.0540.02 ▲2.94
Cookies Consent /wp-admin/options-general.php?page=can-i-use-cookies-settings3.2534.68

Server storage [IO: ▲0.03MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • Illegal file modification found: 1 file (4.00KB) outside of "wp-content/plugins/can-i-use-cookies/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Can I Use Cookies ?
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,865 ▲10413.22 ▼1.293.39 ▲1.5645.74 ▼0.22
Dashboard /wp-admin2,225 ▲224.84 ▼1.06106.05 ▼11.9041.16 ▼3.14
Posts /wp-admin/edit.php2,104 ▲11.97 ▼0.0540.66 ▼5.7034.35 ▼4.74
Add New Post /wp-admin/post-new.php1,549 ▲1823.18 ▼0.16660.54 ▼33.0451.35 ▼4.99
Media Library /wp-admin/upload.php1,404 ▲44.28 ▲0.19103.15 ▼15.1042.62 ▼6.25
Cookies Consent /wp-admin/options-general.php?page=can-i-use-cookies-settings8492.0222.7226.57

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: ccpa, cookies, cookie, gdpr, popup...

can-i-use-cookies/can-i-use-cookies.php Passed 13 tests

The primary PHP file in "Can I Use Cookies ?" version 1.0.1 is used by WordPress to initiate all plugin functionality
118 characters long description:
Ask the user for his consent about cookies and tracking, and comply with the EU GDPR privacy law and CCPA regulations.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected280 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP55234279
JavaScript1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity6.67
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods626.09%
▷ Public methods2295.65%
▷ Protected methods00.00%
▷ Private methods14.35%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
cookie.png12.81KB13.29KB0.00%