78% webpushr-web-push-notifications

Code Review | Web Push Notifications - Webpushr

WordPress plugin Web Push Notifications - Webpushr scored78%from 54 tests.

About plugin

  • Plugin page: webpushr-web-push...
  • Plugin version: 4.35.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.4
  • WordPress version: 6.3.1
  • First release: Oct 30, 2019
  • Latest release: Oct 27, 2023
  • Number of updates: 142
  • Update frequency: every 10.3 days
  • Top authors: webpushr (100%)

Code review

54 tests

User reviews

53 reviews

Install metrics

10,000+ active /205,441 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▲1.21ms] Passed 4 tests

Server-side resources used by Web Push Notifications - Webpushr
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1638.84 ▲2.29
Dashboard /wp-admin3.50 ▲0.2048.24 ▲1.39
Posts /wp-admin/edit.php3.61 ▲0.2647.25 ▼1.30
Add New Post /wp-admin/post-new.php5.64 ▼0.25931.78 ▲843.64
Media Library /wp-admin/upload.php3.42 ▲0.2036.03 ▲2.45

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 65 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Web Push Notifications - Webpushr
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲4614.26 ▼0.011.74 ▲0.1236.98 ▼5.86
Dashboard /wp-admin2,213 ▲335.53 ▼0.0781.68 ▼5.3142.47 ▲3.46
Posts /wp-admin/edit.php2,118 ▲212.01 ▼0.0133.91 ▼1.7734.72 ▼1.19
Add New Post /wp-admin/post-new.php6,236 ▲4,71025.83 ▲2.90819.86 ▲171.8049.56 ▼2.48
Media Library /wp-admin/upload.php1,421 ▲214.22 ▼0.1697.51 ▼9.3743.68 ▼1.49

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
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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 0% 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 perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/webpushr-web-push-notifications/include/woocommerce/webpushr_woo_menu.php
    • > /wp-content/plugins/webpushr-web-push-notifications/sdk_files/webpushr-sw.js.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/webpushr-web-push-notifications/include/woocommerce/sale_price.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/webpushr-web-push-notifications/include/woocommerce/new_product.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/webpushr-web-push-notifications/include/woocommerce/price_drop.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/webpushr-web-push-notifications/include/woocommerce/abandoned_cart.php:5

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, but this is not an exhaustive test


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:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
The official readme.txt is a good inspiration

webpushr-web-push-notifications/push.php 92% from 13 tests

This is the main PHP file of "Web Push Notifications - Webpushr" version 4.35.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("webpushr-web-push-notifications.php" instead of "push.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected28,016 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity1.29
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods112.50%
▷ Public methods787.50%
▷ Protected methods112.50%
▷ Private methods00.00%
▷ Named functions3296.97%
▷ Anonymous functions13.03%
▷ Global constants2100.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
18 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/check_mark.png2.86KB0.33KB▼ 88.35%
images/delete.png0.50KB0.40KB▼ 20.23%
images/android_icon.png7.62KB2.80KB▼ 63.31%