10% announcement-banner

Code Review | Announcement Banner

WordPress plugin Announcement Banner scored10%from 54 tests.

About plugin

  • Plugin page: announcement-banner
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: May 15, 2020
  • Latest release: Jul 1, 2022
  • Number of updates: 10
  • Update frequency: every 77.7 days
  • Top authors: agehman (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /2,533 total downloads


Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/announcement-banner/announcement-banner.php+54
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.96MB] [CPU: ▼51.25ms] Passed 4 tests

Server-side resources used by Announcement Banner
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.436.23 ▼35.39
Dashboard /wp-admin2.05 ▼1.265.22 ▼42.50
Posts /wp-admin/edit.php2.05 ▼1.316.14 ▼40.01
Add New Post /wp-admin/post-new.php2.05 ▼3.845.70 ▼87.08
Media Library /wp-admin/upload.php2.05 ▼1.185.13 ▼27.28
Announcement Banner /wp-admin/options-general.php?page=minddnd-wa-submenu-page2.055.76

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Announcement Banner
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.56 ▼0.661.75 ▼0.2245.09 ▼7.49
Dashboard /wp-admin2,210 ▲224.85 ▼0.24101.21 ▼18.0039.47 ▼6.05
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0033.97 ▼1.8635.69 ▼1.59
Add New Post /wp-admin/post-new.php1,536 ▲1623.44 ▲0.23677.39 ▼2.7656.64 ▲4.96
Media Library /wp-admin/upload.php1,392 ▲74.22 ▼0.0396.69 ▲0.2842.97 ▲0.40
Announcement Banner /wp-admin/options-general.php?page=minddnd-wa-submenu-page9692.0725.2832.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/announcement-banner/announcement-banner.php+54
    Illegal string offset 'show_announcement'
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • minddnd_wa_settings
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=minddnd-wa-submenu-page
    • > Warning in wp-content/plugins/announcement-banner/announcement-banner.php+54
    Illegal string offset 'show_announcement'
    • > GET request to /wp-admin/options-general.php?page=minddnd-wa-submenu-page
    • > Notice in wp-content/plugins/announcement-banner/announcement-banner.php+54
    Uninitialized string offset: 0

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/announcement-banner/admin/minddnd-wa-settings-fields.php:8

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)
Everything seems fine on the user side


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is stored in the /assets directory.), #2 (This is the second screen shot)
The official readme.txt is a good inspiration

announcement-banner/announcement-banner.php Passed 13 tests

"Announcement Banner" version 1.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
71 characters long description:
Add an announcement banner to the top or bottom of your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected479 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions2492.31%
▷ Anonymous functions27.69%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG images were found in this plugin