84% wp-cookie-tool

Code Review | WP Cookie Tool

WordPress plugin WP Cookie Tool scored84%from 54 tests.

About plugin

  • Plugin page: wp-cookie-tool
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Dec 18, 2013
  • Latest release: Jul 31, 2014
  • Number of updates: 5
  • Update frequency: every 52.2 days
  • Top authors: cmoral3s (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,571 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼9.64ms] Passed 4 tests

A check of server-side resources used by WP Cookie Tool
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.96 ▼1.12
Dashboard /wp-admin3.38 ▲0.0442.61 ▼19.76
Posts /wp-admin/edit.php3.49 ▲0.1443.20 ▼0.65
Add New Post /wp-admin/post-new.php5.96 ▲0.0779.61 ▼17.03
Media Library /wp-admin/upload.php3.30 ▲0.0835.03 ▲0.95
WP Cookie Tool /wp-admin/options-general.php?page=wp_cookie_tool_options_page3.2730.41

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP Cookie Tool
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.20 ▼1.172.66 ▲0.9537.53 ▼4.33
Dashboard /wp-admin2,204 ▲125.83 ▲0.88106.04 ▲2.1138.51 ▼8.25
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0238.39 ▲0.3337.68 ▲3.80
Add New Post /wp-admin/post-new.php1,531 ▲1723.39 ▲5.88683.95 ▲12.5856.56 ▲2.78
Media Library /wp-admin/upload.php1,392 ▲44.18 ▼0.0694.55 ▼11.8641.49 ▼5.30
WP Cookie Tool /wp-admin/options-general.php?page=wp_cookie_tool_options_page9272.0322.1633.36

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-cookie-tool/wp-cookietool.php:40

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: privacy, cookie, eu

wp-cookie-tool/wp-cookietool.php 92% from 13 tests

"WP Cookie Tool" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-cookie-tool.php" instead of "wp-cookietool.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin640 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP15293293
JavaScript124100232
PO File1363686
CSS15028
Markdown1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity4.67
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.55
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected