78% pushalert-web-push-notifications

Code Review | PushAlert - Web Push Notifications for WordPress and WooCommerce

WordPress plugin PushAlert - Web Push Notifications for WordPress and WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: pushalert-web-pus...
  • Plugin version: 2.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-6.3
  • WordPress version: 6.3.1
  • First release: Nov 10, 2016
  • Latest release: Oct 6, 2023
  • Number of updates: 82
  • Update frequency: every 30.7 days
  • Top authors: pushalert (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /38,712 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▲1.47ms] Passed 4 tests

This is a short check of server-side resources used by PushAlert - Web Push Notifications for WordPress and WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3342.91 ▲6.95
Dashboard /wp-admin3.62 ▲0.3151.64 ▲4.69
Posts /wp-admin/edit.php3.73 ▲0.3754.91 ▲4.00
Add New Post /wp-admin/post-new.php6.20 ▲0.3187.70 ▼9.78
Media Library /wp-admin/upload.php3.54 ▲0.3146.28 ▲13.45
General Settings /wp-admin/admin.php?page=pushalert-general-settings3.5138.83
Stats /wp-admin/admin.php?page=pushalert-web-push-notifications3.4937.00
Send Notification /wp-admin/admin.php?page=pushalert-send-notification3.5138.76

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 18 new options
New WordPress options
_pushalert_woocommerce_enable
can_compress_scripts
_pushalert_enable_auto_sw_manifest
woocommerce_settings_pushalert_confirm_message
woocommerce_settings_pushalert_association_css
widget_recent-comments
woocommerce_settings_pushalert_auto_assoc_yes
woocommerce_settings_pushalert_dashboard_option
theysaidso_admin_options
woocommerce_settings_pushalert_button_no
...

Browser metrics Passed 4 tests

PushAlert - Web Push Notifications for WordPress and WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲8414.18 ▼0.201.98 ▼0.3142.25 ▲3.73
Dashboard /wp-admin2,252 ▲845.50 ▼0.1386.46 ▼5.5941.70 ▲0.48
Posts /wp-admin/edit.php2,156 ▲531.96 ▼0.0139.82 ▲2.6836.62 ▲1.77
Add New Post /wp-admin/post-new.php1,558 ▲3223.33 ▲0.36660.61 ▼31.4254.54 ▲2.88
Media Library /wp-admin/upload.php1,460 ▲574.21 ▲0.04114.29 ▲13.2048.99 ▲4.10
General Settings /wp-admin/admin.php?page=pushalert-general-settings9761.6924.9130.45
Stats /wp-admin/admin.php?page=pushalert-web-push-notifications1,0963.3398.4939.45
Send Notification /wp-admin/admin.php?page=pushalert-send-notification9092.1423.4225.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 18 options in the database
    • _pushalert_version
    • woocommerce_settings_pushalert_dashboard_option
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • woocommerce_settings_pushalert_association_css
    • pushalert_encrypt_key
    • widget_recent-posts
    • _pushalert_woocommerce_enable
    • woocommerce_settings_pushalert_button_no
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pushalert-web-push-notifications
    • > Notice in wp-content/plugins/pushalert-web-push-notifications/pushalert.php+1599
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pushalert-web-push-notifications/pushalert.php:11
    • > PHP Notice
      Undefined index: elem in wp-content/plugins/pushalert-web-push-notifications/sw.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: There are too many tags (22 tag instead of maximum 10)
The official readme.txt is a good inspiration

pushalert-web-push-notifications/pushalert.php 85% from 13 tests

The primary PHP file in "PushAlert - Web Push Notifications for WordPress and WooCommerce" version 2.8.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 225 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pushalert-web-push-notifications.php" instead of "pushalert.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected2,250 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP23101771,746
CSS1640392
JavaScript265112

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions62
▷ Named functions62100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin