72% notice-bar

Code Review | Notice Bar

WordPress plugin Notice Bar scored72%from 54 tests.

About plugin

  • Plugin page: notice-bar
  • Plugin version: 3.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.2
  • WordPress version: 6.3.1
  • First release: Dec 22, 2015
  • Latest release: Jul 25, 2023
  • Number of updates: 44
  • Update frequency: every 63.0 days
  • Top authors: WEN Solutions (86.36%)wptravel (15.91%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /28,326 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.49MB] [CPU: ▼4.22ms] Passed 4 tests

Server-side resources used by Notice Bar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.5448.06 ▲9.32
Dashboard /wp-admin3.83 ▲0.5251.70 ▼1.70
Posts /wp-admin/edit.php3.88 ▲0.5257.15 ▲2.06
Add New Post /wp-admin/post-new.php6.35 ▲0.4687.08 ▼18.24
Media Library /wp-admin/upload.php3.69 ▲0.4638.64 ▲0.99
All Subscribers /wp-admin/edit.php?post_type=subscriber3.7342.31
Settings /wp-admin/edit.php?post_type=notice-bar&page=notice-bar3.6836.22
Add New /wp-admin/post-new.php?post_type=notice-bar4.0244.22
All Notice Bars /wp-admin/edit.php?post_type=notice-bar3.7437.76

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Notice Bar
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,961 ▲20013.42 ▼0.949.15 ▲7.4437.66 ▼6.72
Dashboard /wp-admin2,227 ▲475.55 ▼0.1185.71 ▼1.9438.12 ▼7.40
Posts /wp-admin/edit.php2,135 ▲351.99 ▼0.0139.08 ▼0.1638.70 ▼4.66
Add New Post /wp-admin/post-new.php1,558 ▲3023.62 ▲0.58630.10 ▼37.4651.41 ▼5.87
Media Library /wp-admin/upload.php1,441 ▲444.17 ▼0.1296.49 ▼8.1146.33 ▼4.74
All Subscribers /wp-admin/edit.php?post_type=subscriber1,1112.0930.9131.82
Settings /wp-admin/edit.php?post_type=notice-bar&page=notice-bar1,0332.6748.4634.84
Add New /wp-admin/post-new.php?post_type=notice-bar9,7664.30419.6584.34
All Notice Bars /wp-admin/edit.php?post_type=notice-bar1,1252.7543.8042.15

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=notice-bar
    • > Notice in wp-content/plugins/notice-bar/inc/backend/views/visibility-config.php+23
    date_default_timezone_set(): Timezone ID 'UTC+0' is invalid

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/notice-bar/inc/cores/activation.php
    • > /wp-content/plugins/notice-bar/inc/notice-types/news-ticker/news-ticker-styles.php
    • > /wp-content/plugins/notice-bar/inc/notice-types/social-icons/social-icons-styles.php
  • 34× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/notice-bar/inc/notice-types/class-notice-bar-nb-subscribe.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/notice-bar/inc/backend/views/visibility-config.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/notice-bar/inc/notice-types/class-notice-bar-cta.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/notice-bar/inc/class-notice-bar-frontend-scripts.php:55
    • > PHP Notice
      Undefined variable: active_section_count in wp-content/plugins/notice-bar/css/dynamic-css.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/notice-bar/inc/notice-types/nb-subscribe/nb-subscribe-styles.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/notice-bar/css/front-end-css.php:4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/notice-bar/inc/notice-types/social-icons/social-icons-styles.php on line 3
    • > PHP Notice
      Undefined variable: nb_settings in wp-content/plugins/notice-bar/inc/notice-types/social-icons/social-icons-styles.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/notice-bar/inc/backend/views/display-config.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add descriptions for screenshots #2, #3, #4, #5 in notice-bar/assets to your readme.txt
  • Tags: There are too many tags (13 tag instead of maximum 10)
Please take inspiration from this readme.txt

notice-bar/notice-bar.php 85% from 13 tests

The main file in "Notice Bar" v. 3.1.1 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:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin19,291 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript121,91193313,276
PHP347215054,537
CSS981301,465
SVG11013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity16.06
▷ Minimum class complexity2.00
▷ Maximum class complexity94.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods93
▷ Static methods1010.75%
▷ Public methods8692.47%
▷ Protected methods00.00%
▷ Private methods77.53%
Functions12
▷ Named functions866.67%
▷ Anonymous functions433.33%
Constants6
▷ Global constants6100.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
10 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/drag.png1.32KB0.28KB▼ 78.95%
css/images/controls.png2.74KB1.42KB▼ 48.29%
css/images/arw-lft.png1.57KB0.61KB▼ 61.15%
css/images/arw-lft1.png1.69KB0.64KB▼ 62.22%
css/images/docico.png7.15KB3.26KB▼ 54.48%