93% notification-button

Code Review | NotificationButton - FREE Web Push Notifications for WordPress or Online Store

WordPress plugin NotificationButton - FREE Web Push Notifications for WordPress or Online Store scored 93% from 54 tests.

About plugin

  • Plugin page: notification-button
  • Plugin version: 1.0.0
  • PHP compatiblity: 4.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-5.2
  • WordPress version: 5.8.1
  • First release: Oct 28, 2019
  • Latest release: Mar 27, 2020
  • Number of updates: 13
  • Update frequency: every 11.9 days
  • Top authors: scordeveloper (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 244 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼161.22ms] Passed 4 tests

Analyzing server-side resources used by NotificationButton - FREE Web Push Notifications for WordPress or Online Store
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1239.21 ▲17.24
Dashboard /wp-admin3.06 ▲0.0147.74 ▼1.07
Posts /wp-admin/edit.php3.12 ▲0.0147.61 ▲0.33
Add New Post /wp-admin/post-new.php5.42 ▼0.0190.81 ▼648.33
Media Library /wp-admin/upload.php3.01 ▲0.0136.05 ▲4.18

Server storage [IO: ▲0.01MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • You have illegally modified 1 file (0.09KB) outside of "wp-content/plugins/notification-button/" and "wp-content/uploads/"
    • (new file) serviceNotButton.js
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for NotificationButton - FREE Web Push Notifications for WordPress or Online Store
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,728 ▲13216.09 ▲0.5913.37 ▲3.7647.40 ▲0.11
Dashboard /wp-admin2,963 ▲325.97 ▼0.17147.57 ▼2.21102.92 ▼6.32
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0276.09 ▲4.6988.38 ▼23.55
Add New Post /wp-admin/post-new.php1,678 ▲9718.85 ▲0.30417.89 ▼32.19110.24 ▼22.96
Media Library /wp-admin/upload.php1,810 ▲35.03 ▲0.01162.65 ▲3.12120.58 ▲5.42

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/notification-button/index.php:50

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 23 tag instead of maximum 10
Please take inspiration from this readme.txt

notification-button/index.php 77% from 13 tests

The main PHP file in "NotificationButton - FREE Web Push Notifications for WordPress or Online Store" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("notification-button.php" instead of "index.php")

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
Everything looks great! No dangerous files found in this plugin19 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1102119

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin