10% ionic-user-push-notification

Code Review | Ionic User Push Notification

WordPress plugin Ionic User Push Notification scored10%from 54 tests.

About plugin

  • Plugin page: ionic-user-push-n...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3+
  • WordPress version: 6.3.1
  • First release: Dec 9, 2015
  • Latest release: Dec 21, 2015
  • Number of updates: 14
  • Update frequency: every 0.9 days
  • Top authors: rintynator (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,120 total downloads

Benchmarks

Plugin footprint 5% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Ionic_User_Push::plugin_activation() should not be called statically

Server metrics [RAM: ▼0.96MB] [CPU: ▼33.43ms] Passed 4 tests

An overview of server-side resources used by Ionic User Push Notification
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.94 ▼0.5315.31 ▼19.88
Dashboard /wp-admin3.08 ▼0.2221.82 ▼29.42
Posts /wp-admin/edit.php3.08 ▼0.2721.51 ▼25.54
Add New Post /wp-admin/post-new.php3.08 ▼2.8023.44 ▼58.86
Media Library /wp-admin/upload.php3.08 ▼0.1519.69 ▼11.92
Ionic User Push /wp-admin/options-general.php?page=ionic-user-push3.0821.64

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 22 new files
Database: 3 new tables, 6 new options
New tables
wp_iup_user_ids
wp_iup_push_history
wp_iup_scheduled_push
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Ionic User Push Notification: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8713.24 ▼1.141.93 ▼0.1440.79 ▼6.47
Dashboard /wp-admin2,217 ▲264.89 ▼0.0196.57 ▼21.1840.77 ▼6.05
Posts /wp-admin/edit.php2,097 ▲82.01 ▲0.0034.96 ▼3.3230.30 ▼4.03
Add New Post /wp-admin/post-new.php1,544 ▲2623.20 ▼0.02615.22 ▼77.2552.49 ▼9.89
Media Library /wp-admin/upload.php1,396 ▲114.26 ▲0.0295.09 ▼4.9342.16 ▲1.45
Ionic User Push /wp-admin/options-general.php?page=ionic-user-push8602.0323.5330.17

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Ionic_User_Push_Admin::admin_menu() should not be called statically
  • The plugin did not uninstall correctly, leaving 22 files (0.46MB) in the plugin directory
    • (new file) assets/html/iup-admin-documentation.html
    • (new file) assets/html/iup-admin-send.html
    • (new file) assets/html/tabs.html
    • (new file) LICENSE
    • (new file) includes/class-iup-admin.php
    • (new file) assets/html/messages.html
    • (new file) assets/html/iup-admin-settings.html
    • (new file) assets/html/iup-admin-userIds.html
    • (new file) assets/html/iup-admin-history.html
    • (new file) assets/html/iup-admin-scheduled.html
    • ...
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_iup_user_ids
    • wp_iup_scheduled_push
    • wp_iup_push_history
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Ionic_User_Push_Admin::admin_menu() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Ionic_User_Push_Admin::admin_menu_options() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Deprecated in wp-content/plugins/ionic-user-push-notification/includes/class-iup-admin.php+17
    Non-static method Ionic_User_Push_Admin::store_option() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Deprecated in wp-content/plugins/ionic-user-push-notification/includes/class-iup-admin.php+18
    Non-static method Ionic_User_Push_Admin::load_options() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Deprecated in wp-content/plugins/ionic-user-push-notification/includes/class-iup-admin.php+19
    Non-static method Ionic_User_UserId_Manager::get_total_userIds() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Notice in wp-content/plugins/ionic-user-push-notification/includes/class-iup-admin.php+59
    Undefined index: tab
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Notice in wp-content/plugins/ionic-user-push-notification/assets/html/messages.html+2
    Undefined variable: scheduledStoreReturn
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Notice in wp-content/plugins/ionic-user-push-notification/assets/html/messages.html+5
    Undefined variable: sendPushReturn
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Notice in wp-content/plugins/ionic-user-push-notification/assets/html/iup-admin-settings.html+11
    Undefined index: appId
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Notice in wp-content/plugins/ionic-user-push-notification/assets/html/iup-admin-settings.html+18
    Undefined index: privateApiKey
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Notice in wp-content/plugins/ionic-user-push-notification/assets/html/iup-admin-settings.html+25
    Undefined index: sendNewPost
    • > GET request to /wp-admin/options-general.php?page=ionic-user-push
    • > Notice in wp-content/plugins/ionic-user-push-notification/assets/html/iup-admin-settings.html+32
    Undefined index: sendUpdatePost

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
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/ionic-user-push-notification/includes/class-iup-userId-manager.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ionic-user-push-notification/includes/class-iup-history-manager.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/ionic-user-push-notification/includes/class-iup-history-manager.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ionic-user-push-notification/includes/class-iup-scheduled-manager.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/ionic-user-push-notification/includes/class-iup-scheduled-manager.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ionic-user-push-notification/includes/class-iup-userId-manager.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/ionic-user-push-notification/includes/class-iup-userId-manager.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/ionic-user-push-notification/includes/class-iup-userId-manager.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/ionic-user-push-notification/includes/class-iup-userId-manager.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ionic-user-push-notification/ionic-user-push.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: ionic, user, notification, push

ionic-user-push-notification/ionic-user-push.php 92% from 13 tests

The principal PHP file in "Ionic User Push Notification" v. 1.1.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ionic-user-push-notification.php" instead of "ionic-user-push.php")

Code Analysis Passed 3 tests

File types Passed 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
There were no executable files found in this plugin716 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP8137105471
HTML8150222
Markdown114023

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.17
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2184.00%
▷ Protected methods00.00%
▷ Private methods416.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants16.25%
▷ Class constants1593.75%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.40MB with 0.29MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png141.01KB36.42KB▼ 74.17%
screenshot-1.png109.03KB33.58KB▼ 69.20%
screenshot-3.png162.93KB51.04KB▼ 68.67%