68% wp-cookie

Code Review | WP Cookie

WordPress plugin WP Cookie scored68%from 54 tests.

About plugin

  • Plugin page: wp-cookie
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.7
  • WordPress version: 6.3.1
  • First release: Feb 10, 2018
  • Latest release: Oct 30, 2018
  • Number of updates: 6
  • Update frequency: every 44.3 days
  • Top authors: AdlPlugins (66.67%)aazztech (50%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /839 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.96MB] [CPU: ▼49.72ms] Passed 4 tests

Analyzing server-side resources used by WP Cookie
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.49 ▼32.59
Dashboard /wp-admin2.05 ▼1.265.11 ▼42.97
Posts /wp-admin/edit.php2.05 ▼1.315.55 ▼39.75
Add New Post /wp-admin/post-new.php2.05 ▼3.844.93 ▼83.55
Media Library /wp-admin/upload.php2.05 ▼1.185.96 ▼29.92
WP Cookie /wp-admin/options-general.php?page=wpcookie2.055.78

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

WP Cookie: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,987 ▲24113.89 ▼0.489.89 ▲8.3049.39 ▲9.76
Dashboard /wp-admin2,229 ▲435.05 ▲0.11100.27 ▼10.5335.78 ▼5.85
Posts /wp-admin/edit.php2,114 ▲252.32 ▲0.2035.92 ▼1.8832.83 ▼2.69
Add New Post /wp-admin/post-new.php1,531 ▼217.62 ▼5.52601.71 ▼75.1334.08 ▼31.45
Media Library /wp-admin/upload.php1,411 ▲234.47 ▲0.25105.53 ▲4.3643.97 ▼0.65
WP Cookie /wp-admin/options-general.php?page=wpcookie9141.9728.0025.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wpcookie
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-cookie/main.php

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

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: cookie notification, cookie, cookies, cookie notice, cookie consent

wp-cookie/main.php 92% from 13 tests

"WP Cookie" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-cookie.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected300 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP113569288
CSS1006
JavaScript2216

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected