78% web-push-notification

Code Review | Web Push Notification

WordPress plugin Web Push Notification scored 78% from 54 tests.

About plugin

  • Plugin page: web-push-notifica...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-4.5.3
  • WordPress version: 5.8.1
  • First release: Jun 21, 2016
  • Latest release: Jun 25, 2016
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: djerba (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 666 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼0.04MB] [CPU: ▼146.05ms] Passed 4 tests

Analyzing server-side resources used by Web Push Notification
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.81 ▲0.0826.01 ▲3.25
Dashboard /wp-admin3.13 ▲0.0747.37 ▲4.60
Posts /wp-admin/edit.php3.19 ▲0.0745.33 ▲3.00
Add New Post /wp-admin/post-new.php5.04 ▼0.4077.23 ▼583.87
Media Library /wp-admin/upload.php3.08 ▲0.0725.41 ▼6.56
Push Notif /wp-admin/options-general.php?page=web-push-notifications-main-menu3.0223.84

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 1 new option
New WordPress options
web-push-notifications

Browser metrics Passed 4 tests

Checking browser requirements for Web Push Notification
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,691 ▲5415.93 ▲0.358.52 ▼3.7749.60 ▼0.70
Dashboard /wp-admin2,976 ▲455.91 ▼0.22139.86 ▼13.01108.96 ▼8.63
Posts /wp-admin/edit.php2,748 ▲92.73 ▲0.0170.07 ▲0.2690.75 ▲0.06
Add New Post /wp-admin/post-new.php1,668 ▲6421.89 ▲3.28271.54 ▼138.25117.00 ▲12.04
Media Library /wp-admin/upload.php1,816 ▲95.04 ▲0.03137.74 ▼14.66116.88 ▲5.86
Push Notif /wp-admin/options-general.php?page=web-push-notifications-main-menu1,2092.3455.5583.60

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • web-push-notifications

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
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=web-push-notifications-main-menu
    • > Notice in wp-content/plugins/web-push-notification/wpn/wpn.php+193
    Undefined index: pluginPublicKey
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=web-push-notifications-main-menu
    • > Notice in wp-content/plugins/web-push-notification/wpn/wpn.php+286
    Undefined index: pluginPrivateKey
    • > GET request to /wp-admin/options-general.php?page=web-push-notifications-main-menu
    • > Notice in wp-content/plugins/web-push-notification/wpn/wpn.php+199
    Undefined index: pluginTestingKey
    • > GET request to /wp-admin/options-general.php?page=web-push-notifications-main-menu
    • > Notice in wp-content/plugins/web-push-notification/wpn/wpn.php+276
    Undefined index: actionMessage
    • > GET request to /wp-admin/options-general.php?page=web-push-notifications-main-menu
    • > Notice in wp-content/plugins/web-push-notification/wpn/wpn.php+278
    Undefined index: actionMessageInterval

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 fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/web-push-notification/wpn/wpn.php:22

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (Edit post), #2 (Front end), #3 (Settings)
Please take inspiration from this readme.txt

web-push-notification/index.php 92% from 13 tests

The main file in "Web Push Notification" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("web-push-notification.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin672 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP21337277
CSS230192
JavaScript242137
PO File1252566

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
6 PNG files occupy 0.18MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png57.24KB23.67KB▼ 58.64%
screenshot-1.png65.49KB30.54KB▼ 53.37%
wpn/images/32.png0.84KB0.68KB▼ 19.31%
screenshot-2.png57.73KB25.52KB▼ 55.81%
wpn/images/16.png0.46KB0.42KB▼ 9.75%