72% pushninja

Code Review | PushNinja by 500apps - Push Notification Plugin To Send Real-time Notifications

WordPress plugin PushNinja by 500apps - Push Notification Plugin To Send Real-time Notifications scored72%from 54 tests.

About plugin

  • Plugin page: pushninja
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1
  • WordPress version: 6.3.1
  • First release: Jul 20, 2021
  • Latest release: Dec 9, 2022
  • Number of updates: 42
  • Update frequency: every 12.1 days
  • Top authors: 500appsmarketing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /999 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.99ms] Passed 4 tests

A check of server-side resources used by PushNinja by 500apps - Push Notification Plugin To Send Real-time Notifications
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0524.46 ▼16.66
Dashboard /wp-admin3.34 ▼0.0061.01 ▼2.38
Posts /wp-admin/edit.php3.40 ▲0.0450.85 ▲3.19
Add New Post /wp-admin/post-new.php5.94 ▲0.0688.30 ▼15.98
Media Library /wp-admin/upload.php3.27 ▲0.0441.50 ▲3.05
PushNinja /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php3.2132.19
Other apps by 500apps /wp-admin/admin.php?page=Other3.2336.11

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

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • There were 1 file (0.08KB) illegally modified outside of "wp-content/plugins/pushninja/" and "wp-content/uploads/"
    • (new file) firebase-messaging-sw.js
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for PushNinja by 500apps - Push Notification Plugin To Send Real-time Notifications
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,442 ▲68119.00 ▲4.92176.68 ▲174.34185.48 ▲142.78
Dashboard /wp-admin2,212 ▲355.65 ▲0.0599.41 ▲6.04121.95 ▲77.09
Posts /wp-admin/edit.php2,134 ▲342.10 ▲0.1346.19 ▲11.9159.71 ▲18.75
Add New Post /wp-admin/post-new.php1,552 ▲2623.17 ▼0.66645.92 ▼41.0969.56 ▲7.27
Media Library /wp-admin/upload.php1,445 ▲454.25 ▼0.07103.65 ▼9.8176.94 ▲26.90
PushNinja /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php4,00545.28629.7365.31
Other apps by 500apps /wp-admin/admin.php?page=Other2,7101.8926.8740.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Notice in wp-content/plugins/pushninja/classes/class.pushninjaplugin_pushninja.php+22
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=Other
    • > Notice in wp-content/plugins/pushninja/classes/pushninja_other.php+2
    Undefined variable: pushninja_url

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
Almost there! Just fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pushninja/classes/other_products.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pushninja/pushninja.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/pushninja/classes/pushninja_content.php:4
    • > PHP Notice
      Undefined variable: pushninja_url in wp-content/plugins/pushninja/classes/pushninja_other.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/pushninja/uninstall.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pushninja/classes/other_products.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=pushninja%2Fclasses%2Fclass.pushninjaplugin_pushninja.php - Access to font at 'https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-semibold.woff' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Other
    • > Network (severe)
    https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-semibold.woff - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=pushninja%2Fclasses%2Fclass.pushninjaplugin_pushninja.php 271 Access to font at 'https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-regular.woff' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Other
    • > Network (severe)
    https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-regular.woff - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=pushninja%2Fclasses%2Fclass.pushninjaplugin_pushninja.php - Access to font at 'https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-semibold.ttf' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Other
    • > Network (severe)
    https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-semibold.ttf - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=pushninja%2Fclasses%2Fclass.pushninjaplugin_pushninja.php - Access to font at 'https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-regular.ttf' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Other
    • > Network (severe)
    https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-regular.ttf - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Network (severe)
    https://api.prod.500apps.com/location/public/country?limit=50 - Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Network (severe)
    https://api.500apps.com/v2/users/domain/domain_user?limit=950&fields=apps_admin,billing_admin,domain_id,email,id,is_active,name,pic_path,status,super_admin,theme,time_zone,users_admin - Failed to load resource: the server responded with a status of 400 ()
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Network (severe)
    https://api.500apps.com/auth/v1/organization-free-subscription?limit=50 - Failed to load resource: the server responded with a status of 400 ()
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Console-api (severe) in unknown
    https://infinity.500apps.com/js/chunk-vendors.4204576a.js 67:12050 Error: Request failed with status code 400at t.exports (https://infinity.500apps.com/js/chunk-vendors.4204576a.js:80:3207)at t.exports (https://infinity.500apps.com/js/chunk-vendors.4204576a.js:112:3005)at p.onreadystatechange (https://infinity.500apps.com/js/chunk-vendors.4204576a.js:264:2485)
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Javascript (severe) in unknown
    https://infinity.500apps.com/js/chunk-vendors.4204576a.js 79:3206
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Console-api (severe) in unknown
    https://infinity.500apps.com/js/chunk-vendors.4204576a.js 67:12050 Error: Network Errorat t.exports (https://infinity.500apps.com/js/chunk-vendors.4204576a.js:80:3207)at p.onerror (https://infinity.500apps.com/js/chunk-vendors.4204576a.js:264:2603)
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Network (severe)
    https://api.prod.500apps.com/v2/push/domain/websites?limit=50 - Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Network (severe)
    https://api.prod.500apps.com/v2/push/domain/websites?limit=50&order_by=order_seq%20desc - Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Console-api (warning) in unknown
    https://static.hotjar.com/c/hotjar-3008425.js?sv=7 2:6897 "Hotjar not launching due to suspicious userAgent:" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/118.0.5993.70 Safari/537.36"
    • > GET request to /wp-admin/admin.php?page=pushninja/classes/class.pushninjaplugin_pushninja.php
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'interest-cohort'.
    • > GET request to /wp-admin/admin.php?page=Other
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=Other 144:122 Uncaught ReferenceError: pushninja_form is not defined
    • > GET request to /wp-admin/admin.php?page=Other
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=Other 144 Access to font at 'https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-semibold.woff' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/admin.php?page=Other
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=Other 144 Access to font at 'https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-regular.woff' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/admin.php?page=Other
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=Other 271 Access to font at 'https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-semibold.ttf' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/admin.php?page=Other
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=Other 271 Access to font at 'https://infinity.500apps.com/fonts/cerebrisans/cerebrisans-regular.ttf' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots need descriptions #0, #0, #0, #0, #0 in pushninja/assets to your readme.txt
The official readme.txt is a good inspiration

pushninja/pushninja.php 92% from 13 tests

Analyzing the main PHP file in "PushNinja by 500apps - Push Notification Plugin To Send Real-time Notifications" version 0.3
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 175 characters long)

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
Good job! No executable or dangerous file extensions detected2,186 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
SVG4001,224
PHP84746636
CSS1614246
JavaScript21457
INI15022
Markdown1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity6.50
▷ Minimum class complexity6.00
▷ Maximum class complexity7.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods14100.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
17 PNG files occupy 0.90MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png125.60KB61.97KB▼ 50.66%
classes/images/pushninja_logo.png5.87KB2.82KB▼ 52.04%
assets/screenshot-7.png69.19KB25.07KB▼ 63.77%
assets/screenshot-4.png43.22KB19.68KB▼ 54.45%
assets/screenshot-12.png46.81KB20.36KB▼ 56.50%