88% push-notification-sender

Code Review | Push Notification Sender for WP

WordPress plugin Push Notification Sender for WP scored 88% from 54 tests.

About plugin

  • Plugin page: push-notification...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 5.8.1
  • First release: Aug 30, 2017
  • Latest release: Aug 30, 2017
  • Number of updates: 10
  • Update frequency: every 0.2 days
  • Top authors: bishal.saha (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 815 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.50MB] [CPU: ▼159.09ms] Passed 4 tests

Analyzing server-side resources used by Push Notification Sender for WP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2237.83 ▲12.69
Dashboard /wp-admin3.18 ▲0.1251.07 ▲0.75
Posts /wp-admin/edit.php3.29 ▲0.1853.32 ▼9.85
Add New Post /wp-admin/post-new.php3.01 ▼2.4225.67 ▼620.98
Media Library /wp-admin/upload.php3.12 ▲0.1136.13 ▼6.26
Custom Notification /wp-admin/admin.php?page=custom-push-notification-sender3.1530.56
Settings /wp-admin/admin.php?page=push-notification-sender-settings3.1832.28
All Push Notifications /wp-admin/admin.php?page=push-notification-sender3.1236.89

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: 2 new tables, no new options
New tables
wp_push_notification_sender_logs
wp_push_notification_sender_tokens

Browser metrics Passed 4 tests

Checking browser requirements for Push Notification Sender for WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,875 ▲29316.74 ▲0.8513.50 ▲2.7548.40 ▼8.05
Dashboard /wp-admin3,033 ▲966.54 ▲0.38172.15 ▲14.97108.71 ▼8.28
Posts /wp-admin/edit.php2,806 ▲672.77 ▲0.0584.68 ▲12.33102.98 ▲7.07
Add New Post /wp-admin/post-new.php1,651 ▲7021.45 ▲4.00330.79 ▼145.72118.48 ▼10.58
Media Library /wp-admin/upload.php1,880 ▲705.25 ▲0.23139.14 ▼24.55115.43 ▼14.73
Custom Notification /wp-admin/admin.php?page=custom-push-notification-sender1,3752.8570.5774.49
Settings /wp-admin/admin.php?page=push-notification-sender-settings1,1912.6059.8170.67
All Push Notifications /wp-admin/admin.php?page=push-notification-sender1,2782.5958.3162.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/push-notification-sender/admin/api/class-push-notification-sender-api.php:15
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/push-notification-sender/admin/class-push-notification-sender-list-table.php on line 16
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/push-notification-sender/admin/class-push-notification-sender-list-table.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/push-notification-sender/admin/partials/push-notification-sender-list-display.php:17
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/push-notification-sender/admin/class-push-notification-sender-list-table.php on line 16

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=push-notification-sender
    • > Network (severe)
    wp-content/plugins/push-notification-sender/admin/css/jquery-ui-min.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Admin Settings page.), #2 (Admin Send custom push notification manually.), #3 (List of Sent notifications in Admin Panel.)
  • Tags: You are using too many tags: 18 tag instead of maximum 10
The official readme.txt might help

push-notification-sender/push-notification-sender.php Passed 13 tests

"Push Notification Sender for WP" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected1,488 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP203098761,437
JavaScript4136346
CSS71295

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.82
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods49
▷ Static methods36.12%
▷ Public methods4489.80%
▷ Protected methods00.00%
▷ Private methods510.20%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin