62% websuite-push-notifier

Code Review | WebSuite Push Notifier

WordPress plugin WebSuite Push Notifier scored62%from 54 tests.

About plugin

  • Plugin page: websuite-push-not...
  • Plugin version: 1.1.7
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 7, 2021
  • Latest release: Oct 20, 2023
  • Number of updates: 36
  • Update frequency: every 20.6 days
  • Top authors: publisherstoolbox (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,735 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼8.02ms] Passed 4 tests

Server-side resources used by WebSuite Push Notifier
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0735.22 ▼6.92
Dashboard /wp-admin3.67 ▲0.3246.86 ▼16.55
Posts /wp-admin/edit.php3.84 ▲0.4849.88 ▲0.78
Add New Post /wp-admin/post-new.php6.25 ▲0.3693.61 ▼9.40
Media Library /wp-admin/upload.php3.59 ▲0.3638.87 ▲3.12
WebSuite Push Notifier /wp-admin/admin.php?page=websuite-push-notifier3.6544.23
Logs /wp-admin/admin.php?page=websuite-push-notifier-sub3.6243.03

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

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • The filesystem usage should be lower than 25MB (currently using 30.31MB)
Filesystem: 3,949 new files
Database: 1 new table, 8 new options
New tables
wp_websuite_push_notifier_logs
New WordPress options
db_upgraded
category_children
theysaidso_admin_options
widget_theysaidso_widget
websuite_push_notifier_db_version
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

WebSuite Push Notifier: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲8714.32 ▼0.301.53 ▼0.3735.80 ▼9.85
Dashboard /wp-admin2,264 ▲875.58 ▲0.0682.41 ▼16.7871.29 ▲28.08
Posts /wp-admin/edit.php2,472 ▲37211.96 ▲10.01309.55 ▲274.5259.80 ▲24.21
Add New Post /wp-admin/post-new.php1,595 ▲6723.04 ▼0.03608.43 ▼45.2450.94 ▼5.68
Media Library /wp-admin/upload.php1,472 ▲724.21 ▲0.0788.84 ▼5.1469.86 ▲27.42
WebSuite Push Notifier /wp-admin/admin.php?page=websuite-push-notifier1,70211.79115.4858.27
Logs /wp-admin/admin.php?page=websuite-push-notifier-sub1,32311.75100.4837.20

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 does not fully uninstall, leaving 1 table in the database
    • wp_websuite_push_notifier_logs
  • The uninstall procedure has failed, leaving 8 options in the database
    • db_upgraded
    • category_children
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • websuite_push_notifier_db_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=websuite-push-notifier
    • > Notice in wp-content/plugins/websuite-push-notifier/admin/partials/websuite-push-notifier-admin-display.php+145
    Undefined offset: 0

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/websuite-push-notifier/vendor/mtdowling/jmespath.php/bin/jp.php
    • > /wp-content/plugins/websuite-push-notifier/admin/partials/settings-sub/websuite-push-notifier-inc-menu-settings.php
    • > /wp-content/plugins/websuite-push-notifier/admin/partials/settings/websuite-push-notifier-inc-menu-settings.php
  • 1919× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Kreait\\Firebase\\Exception\\FirebaseException' not found in wp-content/plugins/websuite-push-notifier/libraries/firebase-php/src/Firebase/Exception/DatabaseException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/websuite-push-notifier/libraries/aws-sdk-php/Aws/ConfigService/Exception/ConfigServiceException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Cloud\\Core\\Report\\GAEMetadataProvider' not found in wp-content/plugins/websuite-push-notifier/vendor/google/cloud-core/src/Report/GAEStandardMetadataProvider.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Arn\\AccessPointArn' not found in wp-content/plugins/websuite-push-notifier/libraries/aws-sdk-php/Aws/Arn/S3/OutpostsAccessPointArn.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/websuite-push-notifier/libraries/aws-sdk-php/Aws/PrometheusService/PrometheusServiceClient.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/websuite-push-notifier/libraries/firebase-php/vendor/guzzlehttp/psr7/src/CachingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/websuite-push-notifier/vendor/google/cloud-core/src/Testing/System/SystemTestCase.php:38
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Auth\\FetchAuthTokenInterface' not found in wp-content/plugins/websuite-push-notifier/vendor/google/auth/src/SignBlobInterface.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Lcobucci\\JWT\\Token' not found in wp-content/plugins/websuite-push-notifier/vendor/lcobucci/jwt/src/UnencryptedToken.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Kreait\\Firebase\\Exception\\FirebaseException' not found in wp-content/plugins/websuite-push-notifier/libraries/firebase-php/src/Firebase/Auth/CreateSessionCookie/FailedToCreateSessionCookie.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The settings page where your AWS details need to be entered.), #2 (The plugin page where you can enter a custom message or select a post for sending.), #3 (The logs page where successful and failed messages will be recorded.), #4 (The Send button on the posts list where you can send a post as a push notification.), #5 (The customised message sidebar widget on a post where you can send the post with a custom title and message.)
You can look at the official readme.txt

websuite-push-notifier/websuite-push-notifier.php Passed 13 tests

The primary PHP file in "WebSuite Push Notifier" version 1.1.7 is used by WordPress to initiate all plugin functionality
71 characters long description:
Send push notifications with custom messaging when a post is published.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin133,102 lines of code in 3,021 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,99827,24892,838127,421
JavaScript95884342,780
CSS6143452,561
C23570144
reStructuredText1352959
make1131642
m41111438
C/C++ Header1101825
XML12018
Bourne Shell141614

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 should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity6.76
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces745
Interfaces335
Traits156
Classes2,425
▷ Abstract classes642.64%
▷ Concrete classes2,36197.36%
▷ Final classes70729.94%
Methods12,868
▷ Static methods1,69913.20%
▷ Public methods10,11178.57%
▷ Protected methods6064.71%
▷ Private methods2,15116.72%
Functions1,194
▷ Named functions34128.56%
▷ Anonymous functions85371.44%
Constants1,572
▷ Global constants644.07%
▷ Class constants1,50895.93%
▷ Public constants1,27484.48%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
25 PNG files occupy 0.72MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png83.78KB29.93KB▼ 64.28%
admin/assets/img/minicolors.png67.02KB34.31KB▼ 48.80%
admin/assets/img/icons/icon-128x128.png7.75KB3.40KB▼ 56.07%
admin/img/banner.png40.76KB23.92KB▼ 41.32%
admin/img/icons/icon-128x128.png4.71KB3.38KB▼ 28.39%