74% push-notifications-for-web

Code Review | Push Notifications For Web

WordPress plugin Push Notifications For Web scored 74% from 54 tests.

About plugin

  • Plugin page: push-notification...
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.3-6.3
  • WordPress version: 6.3.1
  • First release: Aug 1, 2022
  • Latest release: Aug 25, 2023
  • Number of updates: 25
  • Update frequency: every 16.1 days
  • Top authors: zealopensource (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active / 652 total downloads

Benchmarks

Plugin footprint 65% 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.07MB] [CPU: ▲6.78ms] Passed 4 tests

Analyzing server-side resources used by Push Notifications For Web
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0651.01 ▲13.49
Dashboard /wp-admin3.44 ▲0.1454.45 ▲6.99
Posts /wp-admin/edit.php3.48 ▲0.1260.88 ▲16.85
Add New Post /wp-admin/post-new.php5.94 ▲0.0688.39 ▼3.75
Media Library /wp-admin/upload.php3.28 ▲0.0544.56 ▲10.38

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 22 new files
Database: 1 new table, 6 new options
New tables
wp_web_notification
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Push Notifications For Web
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,043 ▲28615.02 ▲0.7413.54 ▲11.5142.94 ▲2.57
Dashboard /wp-admin2,362 ▲1716.48 ▲1.46115.00 ▲14.1439.32 ▼4.42
Posts /wp-admin/edit.php2,265 ▲1763.32 ▲1.3557.66 ▲23.0235.19 ▲0.06
Add New Post /wp-admin/post-new.php6,624 ▲5,09128.96 ▲5.57883.96 ▲255.2844.67 ▼13.58
Media Library /wp-admin/upload.php1,401 ▲134.17 ▼0.0877.92 ▼33.9345.78 ▼0.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_web_notification
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/push-notifications-for-web/inc/admin/template/zpn.template.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

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
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
You can take inspiration from this readme.txt

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

This is the main PHP file of "Push Notifications For Web" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("push-notifications-for-web.php" instead of "zealpush.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,216 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP10304447946
JavaScript85632224
CSS211146

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity10.12
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods31
▷ Static methods13.23%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
Constants11
▷ Global constants11100.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 files were detected