78% cookie-jar

Code Review | Cookie Jar

WordPress plugin Cookie Jar scored78%from 54 tests.

About plugin

  • Plugin page: cookie-jar
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.1
  • WordPress version: 6.3.1
  • First release: Apr 17, 2019
  • Latest release: May 17, 2023
  • Number of updates: 24
  • Update frequency: every 62.1 days
  • Top authors: gregbialowas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /692 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.60ms] Passed 4 tests

Analyzing server-side resources used by Cookie Jar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.75 ▼0.92
Dashboard /wp-admin3.33 ▼0.0246.74 ▼12.46
Posts /wp-admin/edit.php3.38 ▲0.0245.51 ▲1.96
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.09 ▼6.88
Media Library /wp-admin/upload.php3.25 ▲0.0235.98 ▼2.15
Cookie Jar - settings /wp-admin/options-general.php?page=list3.2429.75

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cookie Jar
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲14913.36 ▼1.0210.61 ▲8.8543.75 ▲4.75
Dashboard /wp-admin2,204 ▲365.58 ▲0.0395.69 ▲9.1841.03 ▼0.32
Posts /wp-admin/edit.php2,106 ▲62.02 ▲0.0536.72 ▲1.7232.18 ▼5.29
Add New Post /wp-admin/post-new.php1,549 ▲1423.22 ▲5.29581.99 ▼60.1665.06 ▼10.38
Media Library /wp-admin/upload.php1,406 ▲64.18 ▲0.0195.72 ▲1.5242.36 ▼3.13
Cookie Jar - settings /wp-admin/options-general.php?page=list8722.0324.3026.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=list
    • > Deprecated in wp-content/plugins/cookie-jar/main_admin.php+50
    The each() function is deprecated. This message will be suppressed on further calls

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/cookie-jar/main_admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/cookie-jar/main_admin.php:72
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-jar/cookie-jar.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: cookie, consent

cookie-jar/cookie-jar.php 92% from 13 tests

This is the main PHP file of "Cookie Jar" version 2.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
There were no executable files found in this plugin486 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP24537192
CSS2161113
JavaScript2212284
PO File1212355
Markdown229042

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/cookies3.png14.63KB5.57KB▼ 61.91%
img/cookie_jar.png15.03KB5.29KB▼ 64.79%
img/cookies2.png13.28KB5.07KB▼ 61.82%
img/cookies.png11.53KB4.16KB▼ 63.94%