77% gravitec-net-web-push-notifications

Code Review | Gravitec.net - Web Push Notifications

WordPress plugin Gravitec.net - Web Push Notifications scored77%from 54 tests.

About plugin

  • Plugin page: gravitec-net-web-...
  • Plugin version: 2.9.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.0
  • WordPress version: 6.3.1
  • First release: Feb 7, 2020
  • Latest release: Jul 18, 2022
  • Number of updates: 45
  • Update frequency: every 19.8 days
  • Top authors: asgravitec (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

2,000+ active /28,710 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.48MB] [CPU: ▼2.70ms] Passed 4 tests

A check of server-side resources used by Gravitec.net - Web Push Notifications
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3541.77 ▼2.17
Dashboard /wp-admin3.82 ▲0.5253.50 ▲3.28
Posts /wp-admin/edit.php3.87 ▲0.5257.05 ▲2.85
Add New Post /wp-admin/post-new.php6.42 ▲0.5486.49 ▼14.75
Media Library /wp-admin/upload.php3.75 ▲0.5245.02 ▲9.86
Header /wp-admin/themes.php?page=custom-header3.8941.74

Server storage [IO: ▲2.49MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gravitec.net - Web Push Notifications
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.72 ▲0.351.92 ▲0.1140.25 ▼4.76
Dashboard /wp-admin2,212 ▲415.60 ▼0.1089.82 ▲0.0680.10 ▲35.80
Posts /wp-admin/edit.php2,140 ▲432.03 ▲0.0240.80 ▲1.8834.78 ▼2.79
Add New Post /wp-admin/post-new.php1,556 ▲2823.64 ▲0.25767.89 ▲122.1538.33 ▼16.86
Media Library /wp-admin/upload.php1,432 ▲324.28 ▲0.1396.89 ▼17.6276.14 ▲26.83
Header /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image7,83722.55563.23137.41
Header /wp-admin/themes.php?page=custom-header1,3493.9556.4082.25

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 13× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/gravitec-net-web-push-notifications/includes/class-gravitecnet-i18n.php
    • > /wp-content/plugins/gravitec-net-web-push-notifications/includes/class-gravitecnet-security-helper.php
    • > /wp-content/plugins/gravitec-net-web-push-notifications/includes/class-gravitecnet-form.php
    • > /wp-content/plugins/gravitec-net-web-push-notifications/includes/class-gravitecnet.php
    • > /wp-content/plugins/gravitec-net-web-push-notifications/includes/class-gravitecnet-settings.php
    • > /wp-content/plugins/gravitec-net-web-push-notifications/includes/class-gravitecnet-loader.php
    • > /wp-content/plugins/gravitec-net-web-push-notifications/admin/views/gravitecnet-admin-page.php
    • > /wp-content/plugins/gravitec-net-web-push-notifications/public/class-gravitecnet-public.php
    • > /wp-content/plugins/gravitec-net-web-push-notifications/admin/class-gravitecnet-admin.php
    • > /wp-content/plugins/gravitec-net-web-push-notifications/sdk_files/sw.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image
    • > Security (warning) in unknown
    /?customize_changeset_uuid=b9a4a50f-04af-4a7b-9349-65e37e4958b5&customize_theme=twentytwentyone&customize_messenger_channel=preview-0 - An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (34 tag instead of maximum 10)
The official readme.txt might help

gravitec-net-web-push-notifications/gravitecnet.php 85% from 13 tests

The entry point to "Gravitec.net - Web Push Notifications" version 2.9.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gravitec-net-web-push-notifications.php" instead of "gravitecnet.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected2,818 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP165286082,107
CSS1680384
SVG100200
JavaScript32928127

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.55
▷ Minimum class complexity1.00
▷ Maximum class complexity104.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods178
▷ Static methods31.69%
▷ Public methods16994.94%
▷ Protected methods00.00%
▷ Private methods95.06%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 2.31MB with 1.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/badge.png0.65KB0.58KB▼ 11.21%
screenshot-3.png410.00KB116.16KB▼ 71.67%
screenshot-1.png157.75KB58.38KB▼ 62.99%
admin/images/favicon-32x32.png2.27KB1.76KB▼ 22.54%
screenshot-2.png309.88KB83.72KB▼ 72.98%