57% push-notification-mobile-and-web-app

Code Review | Push notification for Mobile and Web app

WordPress plugin Push notification for Mobile and Web app scored57%from 54 tests.

About plugin

  • Plugin page: push-notification...
  • Plugin version: 1.7.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 6, 2021
  • Latest release: Nov 9, 2023
  • Number of updates: 21
  • Update frequency: every 40.8 days
  • Top authors: appcheap (100%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active /8,322 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.50MB] [CPU: ▼12.84ms] Passed 4 tests

Server-side resources used by Push notification for Mobile and Web app
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4739.11 ▲0.11
Dashboard /wp-admin3.82 ▲0.5145.38 ▼3.65
Posts /wp-admin/edit.php3.87 ▲0.5150.21 ▲1.56
Add New Post /wp-admin/post-new.php6.54 ▲0.6592.08 ▼2.77
Media Library /wp-admin/upload.php3.75 ▲0.5136.96 ▼45.04

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 306 new files
Database: 4 new tables, 7 new options
New tables
wp_pn_user_notifications
wp_queue_failures
wp_pn_notification_tokens
wp_queue_jobs
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
push_notify_version
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Push notification for Mobile and Web app
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲4414.34 ▲0.141.77 ▼0.1440.60 ▼5.40
Dashboard /wp-admin2,221 ▲445.59 ▼0.0495.54 ▲5.6672.84 ▲30.72
Posts /wp-admin/edit.php2,129 ▲291.95 ▼0.0138.87 ▲1.3935.00 ▼0.76
Add New Post /wp-admin/post-new.php1,550 ▲2422.98 ▲0.08684.71 ▼29.7150.81 ▼3.43
Media Library /wp-admin/upload.php1,420 ▲204.23 ▲0.07100.11 ▼35.3678.69 ▲24.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_queue_jobs
    • wp_pn_user_notifications
    • wp_pn_notification_tokens
    • wp_queue_failures
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • push_notify_version
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/push-notification-mobile-and-web-app/templates/merge-tags/metabox-accordion.php
    • > /wp-content/plugins/push-notification-mobile-and-web-app/vendor/symfony/translation/Resources/bin/translation-status.php
  • 100× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/push-notification-mobile-and-web-app/vendor/a5hleyrich/wp-queue/tests/TestDatabaseConnection.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/push-notification-mobile-and-web-app/vendor/symfony/translation/Command/XliffLintCommand.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PushNotify\\Base' not found in wp-content/plugins/push-notification-mobile-and-web-app/includes/Notifications/Notification.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/push-notification-mobile-and-web-app/vendor/symfony/translation/Dumper/IniFileDumper.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Queue\\Job' not found in wp-content/plugins/push-notification-mobile-and-web-app/includes/Job/NotificationJob.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\FileLoader' not found in wp-content/plugins/push-notification-mobile-and-web-app/vendor/symfony/translation/Loader/PhpFileLoader.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\TranslatorInterface' not found in wp-content/plugins/push-notification-mobile-and-web-app/vendor/symfony/translation/DataCollectorTranslator.php:23
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/push-notification-mobile-and-web-app/vendor/symfony/translation/Resources/bin/translation-status.php on line 59
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\FileLoader' not found in wp-content/plugins/push-notification-mobile-and-web-app/vendor/symfony/translation/Loader/MoFileLoader.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pushNotify() in wp-content/plugins/push-notification-mobile-and-web-app/templates/body/metabox.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt might help

push-notification-mobile-and-web-app/push-notify.php 85% from 13 tests

The entry point to "Push notification for Mobile and Web app" version 1.7.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("push-notification-mobile-and-web-app.php" instead of "push-notify.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Almost there! Just fix the following issues
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/push-notification-mobile-and-web-app/vendor/nesbot/carbon/bin/upgrade-carbon.bat
23,359 lines of code in 288 files:
LanguageFilesBlank linesComment linesLines of code
PHP2584,0649,88119,158
XSD392482,803
JSON10001,024
Markdown91170328
YAML24018
XML10016
DOS Batch1004
SVG1004
CSS1002
LESS1002
JavaScript1020

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 160)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity14.33
▷ Minimum class complexity1.00
▷ Maximum class complexity263.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity160.00
Code structure
Namespaces40
Interfaces23
Traits1
Classes143
▷ Abstract classes64.20%
▷ Concrete classes13795.80%
▷ Final classes42.92%
Methods1,272
▷ Static methods21717.06%
▷ Public methods1,10987.19%
▷ Protected methods907.08%
▷ Private methods735.74%
Functions127
▷ Named functions10078.74%
▷ Anonymous functions2721.26%
Constants90
▷ Global constants2426.67%
▷ Class constants6673.33%
▷ Public constants6598.48%

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.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon/firebase.png3.59KB2.61KB▼ 27.42%
assets/icon/one-signal.png7.56KB3.51KB▼ 53.62%
assets/icon/logo.png4.80KB2.62KB▼ 45.50%