68% onesignal-sender

Code Review | OneSignal Sender

WordPress plugin OneSignal Sender scored68%from 54 tests.

About plugin

  • Plugin page: onesignal-sender
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-5.2
  • WordPress version: 6.3.1
  • First release: Jul 10, 2017
  • Latest release: May 27, 2019
  • Number of updates: 33
  • Update frequency: every 20.8 days
  • Top authors: marcbousleiman (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

900+ active /12,736 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.94MB] [CPU: ▼35.64ms] Passed 4 tests

This is a short check of server-side resources used by OneSignal Sender
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.91 ▼1.55
Dashboard /wp-admin3.00 ▼0.3121.61 ▼31.11
Posts /wp-admin/edit.php3.00 ▼0.3625.27 ▼24.62
Add New Post /wp-admin/post-new.php3.00 ▼2.8927.46 ▼76.74
Media Library /wp-admin/upload.php3.00 ▼0.2324.54 ▼10.09
OneSignal Sender /wp-admin/admin.php?page=SP_menu_3.0024.09
Sent /wp-admin/admin.php?page=oss_sent_notifications3.0022.77
Settings /wp-admin/admin.php?page=oss_settings_page_options3.0023.71
Overview /wp-admin/admin.php?page=oss_general_overview3.0023.18
New Message /wp-admin/admin.php?page=oss_send_notifications3.0018.78
Scheduled /wp-admin/admin.php?page=oss_all_notifications3.0023.49

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for OneSignal Sender
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲10514.31 ▼0.071.75 ▲0.1043.40 ▲1.54
Dashboard /wp-admin2,272 ▲695.84 ▲0.99117.43 ▲11.8237.66 ▼10.22
Posts /wp-admin/edit.php2,157 ▲542.93 ▲0.8946.30 ▲7.4836.75 ▲0.63
Add New Post /wp-admin/post-new.php1,569 ▲3823.67 ▲0.30600.38 ▼70.1833.95 ▼18.91
Media Library /wp-admin/upload.php1,454 ▲545.34 ▲1.13103.56 ▲2.1041.19 ▼0.06
OneSignal Sender /wp-admin/admin.php?page=SP_menu_9072.8829.2640.31
Sent /wp-admin/admin.php?page=oss_sent_notifications9072.7931.0736.63
Settings /wp-admin/admin.php?page=oss_settings_page_options8862.8929.7133.38
Overview /wp-admin/admin.php?page=oss_general_overview9012.9030.1337.93
New Message /wp-admin/admin.php?page=oss_send_notifications9072.8030.6232.56
Scheduled /wp-admin/admin.php?page=oss_all_notifications1,7834.3255.1940.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 105 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=oss_all_notifications
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=oss_all_notifications
    • > Notice in wp-content/plugins/onesignal-sender/admin_menu/sections/all-nots.php+17
    Trying to access array offset on value of type bool

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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/onesignal-sender/one-signal-backend.php:14

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 on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: onesignal, dashboard, backend, web push notifications

onesignal-sender/one-signal-backend.php 92% from 13 tests

"OneSignal Sender" version 1.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("onesignal-sender.php" instead of "one-signal-backend.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin8,584 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript398424386,351
PHP8228912,232
CSS1131

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin_menu/images/notification-logo.png1.23KB0.65KB▼ 46.66%
admin_menu/images/close_button.png1.44KB0.56KB▼ 61.27%