78% smart-notification-bar

Code Review | Smart Notification Bar

WordPress plugin Smart Notification Bar scored 78% from 54 tests.

About plugin

  • Plugin page: smart-notificatio...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.0
  • WordPress version: 6.3.1
  • First release: Jul 31, 2022
  • Latest release: Jul 31, 2022
  • Number of updates: 2
  • Update frequency: every 6.0 days
  • Top authors: ferkho (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 431 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 gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▼3.55ms] Passed 4 tests

A check of server-side resources used by Smart Notification Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4353.14 ▲14.26
Dashboard /wp-admin3.42 ▲0.1145.51 ▼8.02
Posts /wp-admin/edit.php3.53 ▲0.1750.43 ▲8.19
Add New Post /wp-admin/post-new.php6.00 ▲0.1185.66 ▼17.47
Media Library /wp-admin/upload.php3.34 ▲0.1137.34 ▲3.11
Edit Notification Bar /wp-admin/admin.php?page=smart-notification-bar-edit3.3430.62
Notification Bars /wp-admin/admin.php?page=smart-notification-bars-list3.3637.14
Add New /wp-admin/admin.php?page=smart-notification-bar-create3.3945.17

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 54 new files
Database: 1 new table, 6 new options
New tables
wp_ep_smart_notification_bars
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Smart Notification Bar
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲9513.69 ▼0.712.08 ▼0.0183.42 ▲34.66
Dashboard /wp-admin2,258 ▲704.89 ▼0.96101.73 ▼5.4539.28 ▼4.72
Posts /wp-admin/edit.php2,137 ▲482.04 ▲0.0435.40 ▲1.7930.74 ▼1.35
Add New Post /wp-admin/post-new.php1,555 ▲2223.40 ▲0.10675.13 ▼34.2363.89 ▲6.57
Media Library /wp-admin/upload.php1,443 ▲554.26 ▲0.0593.27 ▼10.5643.50 ▼1.54
Edit Notification Bar /wp-admin/admin.php?page=smart-notification-bar-edit1,0123.3143.9042.22
Notification Bars /wp-admin/admin.php?page=smart-notification-bars-list1,60810.13268.2277.13
Add New /wp-admin/admin.php?page=smart-notification-bar-create2,9223.9477.64182.53

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=smart-notification-bar-edit
    • > Notice in wp-content/plugins/smart-notification-bar/admin/views/smart-notification-bar-layout.view.php+65
    Undefined index: id

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 16× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/smart-notification-bar/admin/views/smart-notification-bar-404.view.php
    • > /wp-content/plugins/smart-notification-bar/admin/views/form-components/get-started.php
    • > /wp-content/plugins/smart-notification-bar/admin/views/form-components/notification-bar-content.php
    • > /wp-content/plugins/smart-notification-bar/admin/views/form-components/call-to-action-settings.php
    • > /wp-content/plugins/smart-notification-bar/admin/views/smart-notification-bar-form.view.php
    • > /wp-content/plugins/smart-notification-bar/admin/views/form-components/close-button-settings.php
    • > /wp-content/plugins/smart-notification-bar/admin/views/smart-notification-bars-list.view.php
    • > /wp-content/plugins/smart-notification-bar/admin/views/smart-notification-bar-layout.view.php
    • > /wp-content/plugins/smart-notification-bar/admin/views/form-components/display-rules.php
    • > /wp-content/plugins/smart-notification-bar/admin/views/form-components/visibility.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
There were no plugin tags found

smart-notification-bar/smart-notification-bar.php 92% from 13 tests

The main file in "Smart Notification Bar" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected7,457 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP184829072,542
CSS602762,213
Sass2239161,452
JavaScript52583841,250

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.52
Average class complexity108.00
▷ Minimum class complexity82.00
▷ Maximum class complexity134.00
Average method complexity5.46
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods48
▷ Static methods918.75%
▷ Public methods4593.75%
▷ Protected methods24.17%
▷ Private methods12.08%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants535.71%
▷ Class constants964.29%
▷ Public constants9100.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
16 PNG files occupy 0.20MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/images/discount-background.png13.08KB3.61KB▼ 72.40%
admin/assets/images/templates/discount.png7.70KB3.96KB▼ 48.56%
public/assets/images/christmas-background.png24.28KB7.82KB▼ 67.77%
public/assets/images/halloween-background.png17.86KB5.82KB▼ 67.44%
admin/assets/images/templates/light.png4.18KB2.21KB▼ 47.18%