84% cookie-ok

Code Review | Cookie OK

WordPress plugin Cookie OK scored84%from 54 tests.

About plugin

  • Plugin page: cookie-ok
  • Plugin version: 0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-4.5
  • WordPress version: 6.3.1
  • First release: Oct 28, 2012
  • Latest release: May 9, 2016
  • Number of updates: 25
  • Update frequency: every 51.6 days
  • Top authors: RavanH (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,582 total downloads


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.01MB] [CPU: ▼8.72ms] Passed 4 tests

Server-side resources used by Cookie OK
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.92 ▲1.34
Dashboard /wp-admin3.31 ▼0.0448.83 ▼14.68
Posts /wp-admin/edit.php3.36 ▲0.0052.99 ▲0.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.94 ▼15.93
Media Library /wp-admin/upload.php3.23 ▲0.0035.46 ▼4.64

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cookie OK
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,926 ▲14013.39 ▼1.2613.41 ▲11.2643.14 ▼0.41
Dashboard /wp-admin2,195 ▲185.55 ▲0.0281.61 ▼20.1138.87 ▼4.76
Posts /wp-admin/edit.php2,079 ▼212.04 ▲0.0439.98 ▲5.8834.57 ▲0.52
Add New Post /wp-admin/post-new.php1,542 ▲1318.88 ▼3.89614.02 ▼46.7780.23 ▲27.76
Media Library /wp-admin/upload.php1,394 ▼64.22 ▲0.0997.97 ▼21.1042.94 ▼5.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-ok/cookieok.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found


Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Example of the cookie notice bar on http://cookieok.eu) image required
The official readme.txt is a good inspiration

cookie-ok/cookieok.php 92% from 13 tests

"Cookie OK" version 0.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cookie-ok.php" instead of "cookieok.php")

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 detected165 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.00
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions2100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png112.56KB37.48KB▼ 66.70%