84% flash-notification

Code Review | Flash Notification

WordPress plugin Flash Notification scored84%from 54 tests.

About plugin

  • Plugin page: flash-notification
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.6.1
  • WordPress version: 6.3.1
  • First release: Feb 9, 2021
  • Latest release: Jun 25, 2021
  • Number of updates: 3
  • Update frequency: every 45.7 days
  • Top authors: codeworkweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /612 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
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Flash Notification
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.30 ▼2.43
Dashboard /wp-admin3.32 ▲0.0147.67 ▼6.69
Posts /wp-admin/edit.php3.37 ▲0.0150.58 ▼0.50
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.34 ▼25.85
Media Library /wp-admin/upload.php3.24 ▲0.0137.09 ▲2.69

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Flash Notification: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲15413.89 ▼0.498.66 ▲6.0244.06 ▼2.45
Dashboard /wp-admin2,214 ▲264.93 ▲0.01106.54 ▲4.1577.33 ▲30.90
Posts /wp-admin/edit.php2,100 ▲142.01 ▼0.0038.81 ▲0.8037.91 ▲2.88
Add New Post /wp-admin/post-new.php1,524 ▲1023.72 ▲6.24716.10 ▲51.0851.05 ▼0.42
Media Library /wp-admin/upload.php1,402 ▲144.15 ▼0.03108.74 ▲0.1945.50 ▼3.40

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 7× 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/flash-notification/views/styling.php:95
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/flash-notification/admin/settings-content.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flash-notification/flash-notification-class.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_print_styles() in wp-content/plugins/flash-notification/views/content-frontend.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/flash-notification/admin/dashboard.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_print_styles() in wp-content/plugins/flash-notification/admin/content-frontend/search-form.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/flash-notification/admin/settings-display.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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
10 plugin tags: floating bar, message, attention bar, notice, notification bar...

flash-notification/flash-notification.php 92% from 13 tests

The primary PHP file in "Flash Notification" version 1.0.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 179 characters long)

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
Success! There were no dangerous files found in this plugin1,019 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP9271111570
CSS33521385
JavaScript322252
SVG10012

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.50
▷ Minimum class complexity4.00
▷ Maximum class complexity11.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods15.56%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/flash-ico.png3.14KB0.67KB▼ 78.62%
admin/assets/img/announcement.png1.39KB0.92KB▼ 33.83%
admin/assets/img/boost.png3.25KB0.82KB▼ 74.65%
admin/assets/img/bl-boost.png3.34KB0.82KB▼ 75.35%
admin/assets/img/flash.png0.51KB0.67KB0.00%