10% announcements-bar

Code Review | Top Bar Announcements and News

WordPress plugin Top Bar Announcements and News scored10%from 54 tests.

About plugin

  • Plugin page: announcements-bar
  • Plugin version: 1.0.211
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.2
  • WordPress version: 6.3.1
  • First release: May 21, 2020
  • Latest release: Jun 26, 2020
  • Number of updates: 18
  • Update frequency: every 2.1 days
  • Top authors: wisercoding (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /619 total downloads


Plugin footprint 58% 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
These installer errors require your attention
  • Install procedure had errors
    • > Warning in wp-content/plugins/announcements-bar/wico-announcements-bar.php+22
    include_once(wp-content/plugins/announcements-bar/wicore\business.php): failed to open stream: No such file or directory

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.33ms] Passed 4 tests

This is a short check of server-side resources used by Top Bar Announcements and News
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0052.31 ▲13.15
Dashboard /wp-admin3.31 ▲0.0046.35 ▼5.30
Posts /wp-admin/edit.php3.36 ▲0.0047.12 ▼1.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.11 ▼13.72
Media Library /wp-admin/upload.php3.23 ▲0.0032.93 ▲2.82

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Top Bar Announcements and News: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.281.72 ▼0.0642.90 ▼2.67
Dashboard /wp-admin2,195 ▲185.56 ▼0.1084.15 ▼2.8438.89 ▼2.83
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0234.04 ▼7.1335.05 ▼8.16
Add New Post /wp-admin/post-new.php1,526 ▼023.64 ▲0.50596.69 ▼1.4053.02 ▲1.61
Media Library /wp-admin/upload.php1,403 ▲94.17 ▼0.1595.83 ▼2.2840.12 ▼1.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/announcements-bar/functions/functions.php:214
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/announcements-bar/pages/admin/main.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: announcements, promotions bar, bottom bar, offers, top bar

announcements-bar/wico-announcements-bar.php 85% from 13 tests

The principal PHP file in "Top Bar Announcements and News" v. 1.0.211 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Name the main plugin file the same as the plugin slug ("announcements-bar.php" instead of "wico-announcements-bar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin6,886 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
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 functions24100.00%
▷ Anonymous functions00.00%
▷ Global constants22100.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
10 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
wicore/images/icon-css.png1.11KB1.06KB▼ 4.48%
images/wp-pluginlogo.png0.70KB0.60KB▼ 14.17%
wicore/images/icon-settings.png2.24KB1.63KB▼ 27.55%
wicore/images/icon-styles.png1.85KB1.47KB▼ 20.69%