78% fresh-cookie-bar

Code Review | Fresh Cookie Bar

WordPress plugin Fresh Cookie Bar scored 78% from 54 tests.

About plugin

  • Plugin page: fresh-cookie-bar
  • Plugin version: 0.1.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 22, 2019
  • Latest release: Aug 22, 2019
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: contactjavas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 479 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.16ms] Passed 4 tests

This is a short check of server-side resources used by Fresh Cookie Bar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1042.36 ▲1.38
Dashboard /wp-admin3.42 ▲0.1248.56 ▲2.17
Posts /wp-admin/edit.php3.53 ▲0.1849.78 ▼1.42
Add New Post /wp-admin/post-new.php6.00 ▲0.1196.47 ▲0.75
Media Library /wp-admin/upload.php3.34 ▲0.1136.61 ▼1.34
Cookie Bar /wp-admin/options-general.php?page=freshcookiebar3.3533.54

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Fresh Cookie Bar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲5013.23 ▼1.151.65 ▼0.4742.50 ▼5.38
Dashboard /wp-admin2,213 ▲254.83 ▼0.01108.29 ▼12.5941.87 ▼1.77
Posts /wp-admin/edit.php2,099 ▲102.06 ▲0.0739.93 ▼0.2033.01 ▼2.54
Add New Post /wp-admin/post-new.php1,543 ▲1023.28 ▲0.18600.04 ▼120.5252.91 ▼0.13
Media Library /wp-admin/upload.php1,398 ▲104.23 ▼0.0297.44 ▼4.6440.59 ▼3.42
Cookie Bar /wp-admin/options-general.php?page=freshcookiebar1,8906.63176.6665.06

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, 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 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/fresh-cookie-bar/fresh-cookie-bar.php
    • > /wp-content/plugins/fresh-cookie-bar/autoload.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=freshcookiebar
    • > Javascript (severe) in unknown
    /wp-content/plugins/fresh-cookie-bar/assets/js/settings.js?ver=0.1.1 2:30 Uncaught TypeError: $(...).cs_wpColorPicker is not a function
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=freshcookiebar
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=freshcookiebar
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clear is deprecated since version 5.5.0! Use wp.i18n instead.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=freshcookiebar
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clearAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: gdpr, privacy-bar, privacy, cookie-bar, gdpr-cookie...

fresh-cookie-bar/fresh-cookie-bar.php 92% from 13 tests

Analyzing the main PHP file in "Fresh Cookie Bar" version 0.1.1
Please make the necessary changes and fix the following:
  • 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin749 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP10115243509
CSS2293129
JavaScript471080
Markdown112023
JSON2008

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity16.75
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods39
▷ Static methods37.69%
▷ Public methods3897.44%
▷ Protected methods00.00%
▷ Private methods12.56%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants3
▷ Global constants3100.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
2 PNG files occupy 0.37MB with 0.24MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-1.png357.33KB81.80KB▼ 77.11%
assets/images/banner-772x250.png20.37KB9.34KB▼ 54.17%