80% easy-cookie-consent

Code Review | Easy cookie consent

WordPress plugin Easy cookie consent scored80%from 54 tests.

About plugin

  • Plugin page: easy-cookie-consent
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.0
  • WordPress version: 6.3.1
  • First release: Jan 28, 2022
  • Latest release: Jun 13, 2022
  • Number of updates: 4
  • Update frequency: every 34.0 days
  • Top authors: kamilpesekubkcz (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /1,037 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼8.51ms] Passed 4 tests

Analyzing server-side resources used by Easy cookie consent
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1137.35 ▼1.09
Dashboard /wp-admin3.37 ▲0.0748.15 ▲1.85
Posts /wp-admin/edit.php3.42 ▲0.0745.60 ▼9.80
Add New Post /wp-admin/post-new.php5.95 ▲0.0781.61 ▼18.81
Media Library /wp-admin/upload.php3.29 ▲0.0733.09 ▼4.32
Cookie consent /wp-admin/options-general.php?page=easy-cookie-consent-settings3.2935.86

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 18 new files
Database: 1 new table, 8 new options
New tables
wp_easy_cookie_consent
New WordPress options
widget_recent-comments
widget_theysaidso_widget
easy-cookie-consent-version
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
easy-cookie-consent-settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy cookie consent
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,007 ▲27213.28 ▼1.119.00 ▲7.3483.82 ▲42.89
Dashboard /wp-admin2,209 ▲246.07 ▲1.18106.76 ▲2.3838.86 ▼2.46
Posts /wp-admin/edit.php2,095 ▲62.04 ▲0.0434.64 ▼5.6933.98 ▼2.22
Add New Post /wp-admin/post-new.php1,533 ▼423.31 ▼0.03631.95 ▼39.4749.69 ▼6.63
Media Library /wp-admin/upload.php1,394 ▲124.32 ▲0.0893.54 ▼10.2942.14 ▼3.01
Cookie consent /wp-admin/options-general.php?page=easy-cookie-consent-settings1,4242.0623.4836.51

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_easy_cookie_consent
  • Zombie WordPress options were found after uninstall: 8 options
    • easy-cookie-consent-version
    • widget_recent-comments
    • easy-cookie-consent-settings
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
No output text or server-side errors detected on direct access of PHP files

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
No tags were found

easy-cookie-consent/easy-cookie-consent.php Passed 13 tests

"Easy cookie consent" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
111 characters long description:
Plugin implements orestbida/cookieconsent cookie consent solution and stores consents in custom database table.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,274 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP4103147658
JSON100246
JavaScript32416188
PO File15070126
Sass29053
CSS3023

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity31.00
▷ Minimum class complexity12.00
▷ Maximum class complexity50.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods315.00%
▷ Public methods945.00%
▷ Protected methods00.00%
▷ Private methods1155.00%
Functions13
▷ Named functions17.69%
▷ Anonymous functions1292.31%
Constants7
▷ Global constants457.14%
▷ Class constants342.86%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin