90% cookie-notify

Code Review | Cookie Notify

WordPress plugin Cookie Notify scored90%from 54 tests.

About plugin

  • Plugin page: cookie-notify
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.0.2
  • WordPress version: 6.3.1
  • First release: Jun 28, 2017
  • Latest release: Sep 7, 2022
  • Number of updates: 4
  • Update frequency: every 474.3 days
  • Top authors: zp20 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /3,456 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 successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Cookie Notify
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.00 ▼2.17
Dashboard /wp-admin3.32 ▲0.0249.04 ▼1.89
Posts /wp-admin/edit.php3.37 ▲0.0152.18 ▲4.05
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.83 ▼12.14
Media Library /wp-admin/upload.php3.24 ▲0.0137.28 ▲0.79

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 31 new options
New WordPress options
db_upgraded
cnpl_css
cnpl_remember_corners
cnpl_content_link_regulation_url
theysaidso_admin_options
cnpl_theme_css_links
cnpl_settings_time
cnpl_text_panel_opened
cnpl_content_button_text
cnpl_content_link_howto_url
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cookie Notify
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.34 ▼0.301.90 ▼0.0045.50 ▼3.11
Dashboard /wp-admin2,213 ▲365.56 ▼0.0283.77 ▼20.0076.91 ▲33.56
Posts /wp-admin/edit.php2,115 ▲151.94 ▼0.0738.03 ▼0.6534.11 ▼1.60
Add New Post /wp-admin/post-new.php1,539 ▲1323.54 ▲0.38733.30 ▲61.5754.52 ▼8.91
Media Library /wp-admin/upload.php1,418 ▲184.08 ▼0.11104.39 ▼3.7180.22 ▲35.11

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt might help

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

Analyzing the main PHP file in "Cookie Notify" version 1.0.1
121 characters long description:
Cookie usage notification. Quick and easy configuration of position, appearance, colors, links, buttons and text content.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,671 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP23581911,455
PO File18191216

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ 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
8 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/powiadomienie-cookie-bottom.png4.47KB2.94KB▼ 34.29%
images/powiadomienie-cookie-bottom-right.png4.50KB2.98KB▼ 33.73%
images/powiadomienie-cookie-bottom-left.png4.57KB2.99KB▼ 34.69%
images/plugin-icon.png1.38KB1.34KB▼ 2.69%
images/powiadomienie-cookie-top-left.png4.68KB2.98KB▼ 36.40%