84% simple-cookie-notification-bar

Code Review | Simple Cookie Notification Bar

WordPress plugin Simple Cookie Notification Bar scored84%from 54 tests.

About plugin

  • Plugin page: simple-cookie-not...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3
  • WordPress version: 6.3.1
  • First release: Nov 18, 2014
  • Latest release: Sep 8, 2015
  • Number of updates: 14
  • Update frequency: every 21.0 days
  • Top authors: lucymtc (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /17,792 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.36ms] Passed 4 tests

This is a short check of server-side resources used by Simple Cookie Notification Bar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0734.81 ▼4.48
Dashboard /wp-admin3.36 ▲0.0644.73 ▼0.43
Posts /wp-admin/edit.php3.48 ▲0.1246.72 ▼4.16
Add New Post /wp-admin/post-new.php5.96 ▲0.0881.38 ▼8.10
Media Library /wp-admin/upload.php3.28 ▲0.0634.66 ▼0.71
Simple Cookie Bar /wp-admin/options-general.php?page=scnb-options3.2830.47

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
scnb_settings
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Simple Cookie Notification Bar: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲18413.74 ▼0.616.20 ▲4.5048.69 ▲7.07
Dashboard /wp-admin2,228 ▲465.06 ▼0.82103.49 ▲0.5037.28 ▼9.59
Posts /wp-admin/edit.php2,098 ▲62.32 ▲0.2343.35 ▲1.7636.65 ▼0.94
Add New Post /wp-admin/post-new.php1,537 ▲1817.72 ▼5.48666.76 ▼0.8536.35 ▼24.07
Media Library /wp-admin/upload.php1,414 ▲264.38 ▲0.1787.93 ▼11.9639.69 ▼4.25
Simple Cookie Bar /wp-admin/options-general.php?page=scnb-options1,6533.0366.6532.90

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/simple-cookie-notification-bar/includes/front-cookiebar.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-cookie-notification-bar/includes/settings-form.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 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
5 plugin tags: fixed bar, customizable, cookies, notifications, responsive

simple-cookie-notification-bar/simple-cookie-notification-bar.php Passed 13 tests

This is the main PHP file of "Simple Cookie Notification Bar" version 1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
100 characters long description:
Displays a simple cookie notification bar on the bottom of the page, customizable colours and texts.

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
There were no executable files found in this plugin611 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP7240175358
PO File24952136
CSS331858
JavaScript2572349
XML10010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.50
▷ Minimum class complexity3.00
▷ Maximum class complexity10.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods22
▷ Static methods1254.55%
▷ Public methods1568.18%
▷ Protected methods14.55%
▷ Private methods627.27%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
There are no PNG files in this plugin