78% web-push

Code Review | Web Push

WordPress plugin Web Push scored78%from 54 tests.

About plugin

  • Plugin page: web-push
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.5
  • WordPress version: 6.3.1
  • First release: Feb 2, 2016
  • Latest release: Apr 22, 2016
  • Number of updates: 33
  • Update frequency: every 2.5 days
  • Top authors: marco-c (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /5,670 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.39MB] [CPU: ▼0.99ms] Passed 4 tests

An overview of server-side resources used by Web Push
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3741.03 ▼0.10
Dashboard /wp-admin3.76 ▲0.4551.62 ▲7.19
Posts /wp-admin/edit.php3.80 ▲0.4552.63 ▼3.67
Add New Post /wp-admin/post-new.php6.27 ▲0.38100.29 ▼6.16
Media Library /wp-admin/upload.php3.61 ▲0.3839.01 ▲5.96
Web Push /wp-admin/options-general.php?page=web-push-options3.6137.95
Send a custom push notification /wp-admin/tools.php?page=web-push-tools3.5534.64

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 173 new files
Database: 1 new table, 20 new options
New tables
wp_webpush_subscription
New WordPress options
webpush_gcm_key
widget_recent-posts
webpush_gcm_sender_id
wpswmanager_registrations
webpush_prompt_count
webpush_icon
webpush_generate_manifest
theysaidso_admin_options
widget_recent-comments
webpush_triggers
...

Browser metrics Passed 4 tests

A check of browser resources used by Web Push
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,013 ▲27813.52 ▼0.903.69 ▲2.0741.07 ▼3.23
Dashboard /wp-admin2,295 ▲1075.40 ▲0.50126.44 ▲7.2541.02 ▼7.04
Posts /wp-admin/edit.php2,109 ▲202.04 ▲0.0439.72 ▼0.8238.03 ▲1.92
Add New Post /wp-admin/post-new.php6,292 ▲4,76419.66 ▼3.37896.17 ▲302.2164.43 ▲12.47
Media Library /wp-admin/upload.php1,409 ▲214.24 ▲0.0397.59 ▲1.8542.48 ▲0.18
Web Push /wp-admin/options-general.php?page=web-push-options1,5084.1564.1334.81
Send a custom push notification /wp-admin/tools.php?page=web-push-tools8912.2025.7328.62

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • webpush_generate_manifest
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wpswmanager_registrations

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/tools.php?page=web-push-tools
    • > Notice in wp-content/plugins/web-push/wp-web-push-admin.php+567
    Undefined variable: icon_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
Please take a closer look at the following
  • 87× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Mdanter\\Ecc\\Crypto\\EcDH\\EcDHInterface' not found in wp-content/plugins/web-push/vendor/mdanter/ecc/src/Crypto/EcDH/EcDH.php:46
    • > PHP Fatal error
      Uncaught Error: Interface 'Lcobucci\\JWT\\Signer' not found in wp-content/plugins/web-push/vendor/lcobucci/jwt/src/Signer/BaseSigner.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/web-push/wp-web-push-main.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/web-push/wp-web-push.php:18
    • > PHP Fatal error
      Cannot use FG\\ASN1\\Object as Object because 'Object' is a special class name in wp-content/plugins/web-push/vendor/mdanter/ecc/src/Serializer/PublicKey/Der/Parser.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\Construct' not found in wp-content/plugins/web-push/vendor/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Mdanter\\Ecc\\Serializer\\Point\\PointSerializerInterface' not found in wp-content/plugins/web-push/vendor/mdanter/ecc/src/Serializer/Point/UncompressedPointSerializer.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Mdanter\\Ecc\\File\\FileLoader' not found in wp-content/plugins/web-push/vendor/mdanter/ecc/src/File/DerFileLoader.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\AbstractString' not found in wp-content/plugins/web-push/vendor/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\AbstractString' not found in wp-content/plugins/web-push/vendor/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: push notifications, notifications, mobile notifications, web push, desktop notifications...

web-push/wp-web-push.php 92% from 13 tests

This is the main PHP file of "Web Push" version 1.4.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("web-push.php" instead of "wp-web-push.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected9,139 lines of code in 169 files:
LanguageFilesBlank linesComment linesLines of code
PHP1562,1154,6028,314
JavaScript811130634
CSS2220155
SVG30136

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.23
▷ Minimum class complexity1.00
▷ Maximum class complexity97.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces34
Interfaces17
Traits0
Classes133
▷ Abstract classes86.02%
▷ Concrete classes12593.98%
▷ Final classes21.60%
Methods829
▷ Static methods11613.99%
▷ Public methods71285.89%
▷ Protected methods667.96%
▷ Private methods516.15%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants109
▷ Global constants32.75%
▷ Class constants10697.25%
▷ Public constants106100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
lib/placeholder.png17.97KB9.60KB▼ 46.57%