62% web-push-notifications-lite

Code Review | Push Notifications Lite

WordPress plugin Push Notifications Lite scored 62% from 54 tests.

About plugin

  • Plugin page: web-push-notifica...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Jun 2, 2016
  • Latest release: Dec 14, 2016
  • Number of updates: 20
  • Update frequency: every 10.8 days
  • Top authors: emrysforge (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 3,452 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▲9.44ms] Passed 4 tests

An overview of server-side resources used by Push Notifications Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1170.02 ▲32.17
Dashboard /wp-admin3.49 ▲0.19133.92 ▲84.66
Posts /wp-admin/edit.php3.45 ▲0.0956.78 ▲8.17
Add New Post /wp-admin/post-new.php5.99 ▲0.1192.50 ▼8.15
Media Library /wp-admin/upload.php3.34 ▲0.1141.67 ▲5.57
Push Notifications /wp-admin/edit.php?post_type=desktop_notification3.3641.86
Add New Push Notification /wp-admin/post-new.php?post_type=desktop_notification3.4756.29
Push Notifications Lite /wp-admin/options-general.php?page=emdn_options3.2840.56
Push Notifications categories /wp-admin/edit-tags.php?taxonomy=desktop_notifications_categories&post_type=desktop_notification3.3337.73

Server storage [IO: ▲0.11MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Push Notifications Lite: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲8113.23 ▼1.151.73 ▼0.1441.66 ▼0.36
Dashboard /wp-admin2,235 ▲505.80 ▲0.87110.07 ▼1.6139.90 ▼6.84
Posts /wp-admin/edit.php2,124 ▲352.01 ▼0.1740.31 ▼1.7734.99 ▼2.67
Add New Post /wp-admin/post-new.php1,562 ▲2023.34 ▲5.19605.86 ▼31.7752.44 ▼6.22
Media Library /wp-admin/upload.php1,423 ▲324.19 ▼0.0099.59 ▲2.8141.93 ▲0.13
Push Notifications /wp-admin/edit.php?post_type=desktop_notification1,0881.9332.3031.76
Add New Push Notification /wp-admin/post-new.php?post_type=desktop_notification3,0047.95184.1176.76
Push Notifications Lite /wp-admin/options-general.php?page=emdn_options9772.0322.3533.66
Push Notifications categories /wp-admin/edit-tags.php?taxonomy=desktop_notifications_categories&post_type=desktop_notification1,2942.1426.3024.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=emdn_options
    • > Notice in wp-content/plugins/web-push-notifications-lite/em_desktop_notifications_lite.php+180
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/web-push-notifications-lite/js/index.php
    • > /wp-content/plugins/web-push-notifications-lite/index.php
    • > /wp-content/plugins/web-push-notifications-lite/js/sdk/index.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/web-push-notifications-lite/em_desktop_notifications_lite.php:22

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === web-push-notifications-lite === )
The official readme.txt might help

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

The main PHP script in "Push Notifications Lite" version 1.0.3 is automatically included on every request by WordPress
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-notifications-lite.php" instead of "em_desktop_notifications_lite.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 175 characters long)

Code Analysis 5% from 3 tests

File types 0% from 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
Almost there! Just fix the following issues
  • For security reasons, never distribute binary or executable files with your plugin
    • .url - Internet Shortcut in Firefox, IE, Chrome, Safari
      • wp-content/plugins/web-push-notifications-lite/documentation/Online Documentation For Advanced Plugin.url
1,374 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP3245321,079
JavaScript443827295

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions55
▷ Named functions55100.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
PNG images were not found in this plugin