84% cookie-cat

Code Review | cookie-cat

WordPress plugin cookie-cat scored84%from 54 tests.

About plugin

  • Plugin page: cookie-cat
  • Plugin version: 1.4.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-6.3.1
  • WordPress version: 6.3.1
  • First release: May 17, 2012
  • Latest release: Oct 17, 2023
  • Number of updates: 40
  • Update frequency: every 104.3 days
  • Top authors: bobbingwide (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /30,870 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.71ms] Passed 4 tests

An overview of server-side resources used by cookie-cat
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.86 ▼1.60
Dashboard /wp-admin3.31 ▼0.0345.83 ▼14.29
Posts /wp-admin/edit.php3.37 ▲0.0143.59 ▼4.55
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.33 ▼7.60
Media Library /wp-admin/upload.php3.24 ▲0.0131.78 ▼4.41

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for cookie-cat
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲5014.14 ▼0.151.86 ▲0.1642.47 ▼0.47
Dashboard /wp-admin2,202 ▲225.52 ▼0.1089.12 ▲5.5042.84 ▲2.06
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0133.54 ▼2.2336.10 ▲0.11
Add New Post /wp-admin/post-new.php1,537 ▲1122.91 ▼0.11633.19 ▼35.2165.50 ▲7.56
Media Library /wp-admin/upload.php1,404 ▲74.16 ▼0.1393.70 ▼17.6742.13 ▼4.01

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
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-cat/cookie-cat.php:103

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (cookie-cat options section), #2 (XML feed section: showing the XML files being used), #3 (Cookie catalog - the "current" output from the [cookie] shortcode), #4 (Example showing selected cookies and plugins), #5 (cookie-cat.co.uk Mapping page - the source of the data), #6 (cookie cat Warning that data is passed to the cookie-cat server)
You can look at the official readme.txt

cookie-cat/cookie-cat.php Passed 13 tests

"cookie-cat" version 1.4.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
69 characters long description:
[cookies] shortcode for producing a table of cookies the website uses

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin947 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4117433660
XML130287

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions60
▷ Named functions60100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.30MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png193.26KB75.26KB▼ 61.06%
screenshot-3.png29.76KB13.49KB▼ 54.66%
screenshot-4.png23.89KB11.41KB▼ 52.24%
screenshot-1.png26.12KB12.84KB▼ 50.85%
screenshot-6.png12.67KB6.96KB▼ 45.07%