93% fiat-alert-bar

Code Review | Alert Bar

WordPress plugin Alert Bar scored 93% from 54 tests.

About plugin

  • Plugin page: fiat-alert-bar
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.0
  • WordPress version: 5.9.2
  • First release: Jun 10, 2013
  • Latest release: Dec 10, 2018
  • Number of updates: 24
  • Update frequency: every 83.7 days
  • Top authors: benzumdahl (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 5,035 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼293.65ms] Passed 4 tests

An overview of server-side resources used by Alert Bar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0351.26 ▲0.01
Dashboard /wp-admin3.44 ▲0.0433.93 ▲0.39
Posts /wp-admin/edit.php3.67 ▲0.0338.07 ▲1.25
Add New Post /wp-admin/post-new.php6.91 ▼0.0695.17 ▼1,173.43
Media Library /wp-admin/upload.php3.32 ▲0.0224.69 ▼1.58
Add New /wp-admin/post-new.php?post_type=fiat_alert3.6541.39
Alerts /wp-admin/edit.php?post_type=fiat_alert3.3524.49

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Alert Bar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲8116.16 ▲0.257.06 ▲1.372.38 ▼0.04
Dashboard /wp-admin2,926 ▲656.19 ▼0.01116.46 ▼14.71177.68 ▲15.16
Posts /wp-admin/edit.php2,722 ▲313.26 ▲0.0362.60 ▲0.75139.76 ▼2.61
Add New Post /wp-admin/post-new.php1,734 ▲7321.07 ▲4.61425.68 ▼11.56181.33 ▲26.41
Media Library /wp-admin/upload.php1,731 ▲305.54 ▼0.01124.02 ▼9.55217.18 ▲30.70
Add New /wp-admin/post-new.php?post_type=fiat_alert2,80910.09189.36216.55
Alerts /wp-admin/edit.php?post_type=fiat_alert1,4113.1659.59114.79

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

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)
Good news, no errors were detected

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 items
  • 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/fiat-alert-bar/fiatalert.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fiat-alert-bar/trunk/fiatalert.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (This is the alert in action on a school website.), #2 (The Alert function is added directly into the WordPress dashboard.)
You can take inspiration from this readme.txt

fiat-alert-bar/fiatalert.php 92% from 13 tests

The principal PHP file in "Alert Bar" v. 2.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fiat-alert-bar.php" instead of "fiatalert.php")

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
Good job! No executable or dangerous file extensions detected53 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1131541
CSS10012

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.10
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
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 1.40MB with 0.83MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
fiat-alert.png1.76KB0.82KB▼ 53.63%
screenshot-2.png57.19KB22.21KB▼ 61.16%
trunk/fiat-alert.png1.76KB0.82KB▼ 53.63%
trunk/screenshot-2.png57.19KB22.21KB▼ 61.16%
screenshot-1.png659.79KB214.79KB▼ 67.45%